- Timestamp:
- Sep 19, 2014, 7:12:01 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r5 r6 1 1 object FormMain: TFormMain 2 Left = 5142 Left = 664 3 3 Height = 640 4 Top = 2994 Top = 443 5 5 Width = 920 6 6 Caption = 'LibrePaint' 7 ClientHeight = 61 47 ClientHeight = 611 8 8 ClientWidth = 920 9 9 Menu = MainMenu1 … … 11 11 object PaintBox1: TPaintBox 12 12 Left = 0 13 Height = 61413 Height = 582 14 14 Top = 0 15 15 Width = 920 … … 18 18 OnResize = PaintBox1Resize 19 19 end 20 object StatusBar1: TStatusBar 21 Left = 0 22 Height = 29 23 Top = 582 24 Width = 920 25 Panels = <> 26 end 20 27 object MainMenu1: TMainMenu 28 Images = Core.ImageList1 21 29 left = 104 22 30 top = 48 23 31 object MenuItem1: TMenuItem 24 Caption = ' Soubor'32 Caption = 'File' 25 33 object MenuItem3: TMenuItem 26 Action = Core.AProjectNew 34 Action = Core.AFileNew 35 end 36 object MenuItem12: TMenuItem 37 Action = Core.AFileOpen 38 end 39 object MenuItemRecentFiles: TMenuItem 40 Caption = 'Recent files' 41 end 42 object MenuItem13: TMenuItem 43 Action = Core.AFileSave 44 end 45 object MenuItem15: TMenuItem 46 Action = Core.AFileSaveAs 47 end 48 object MenuItem16: TMenuItem 49 Action = Core.AFileClose 50 end 51 object MenuItem11: TMenuItem 52 Caption = '-' 27 53 end 28 54 object MenuItem2: TMenuItem 29 55 Action = Core.AExit 56 end 57 end 58 object MenuItem6: TMenuItem 59 Caption = 'View' 60 object MenuItem7: TMenuItem 61 Action = Core.AZoomNormal 62 end 63 object MenuItem8: TMenuItem 64 Action = Core.AZoomIn 65 end 66 object MenuItem9: TMenuItem 67 Action = Core.AZoomOut 68 end 69 object MenuItem10: TMenuItem 70 Action = Core.AZoomAll 30 71 end 31 72 end … … 34 75 object MenuItem5: TMenuItem 35 76 Action = Core.AImageClear 36 end37 object MenuItem6: TMenuItem38 Action = Core.AImageRandom39 77 end 40 78 end -
trunk/Forms/UFormMain.pas
r4 r6 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ExtCtrls ;9 ExtCtrls, ComCtrls; 10 10 11 11 type … … 16 16 MainMenu1: TMainMenu; 17 17 MenuItem1: TMenuItem; 18 MenuItem10: TMenuItem; 19 MenuItem11: TMenuItem; 20 MenuItem12: TMenuItem; 21 MenuItem13: TMenuItem; 22 MenuItemRecentFiles: TMenuItem; 23 MenuItem15: TMenuItem; 24 MenuItem16: TMenuItem; 18 25 MenuItem2: TMenuItem; 19 26 MenuItem3: TMenuItem; … … 21 28 MenuItem5: TMenuItem; 22 29 MenuItem6: TMenuItem; 30 MenuItem7: TMenuItem; 31 MenuItem8: TMenuItem; 32 MenuItem9: TMenuItem; 23 33 PaintBox1: TPaintBox; 34 StatusBar1: TStatusBar; 24 35 Timer1: TTimer; 25 36 procedure PaintBox1Paint(Sender: TObject); -
trunk/LibrePaint.lpi
r5 r6 17 17 <StringTable ProductVersion=""/> 18 18 </VersionInfo> 19 <BuildModes Count="1"> 20 <Item1 Name="Default" Default="True"/> 19 <BuildModes Count="2"> 20 <Item1 Name="Debug" Default="True"/> 21 <Item2 Name="Release"> 22 <CompilerOptions> 23 <Version Value="11"/> 24 <Target> 25 <Filename Value="lib/$(TargetCPU)-$(TargetOS)/LibrePaint"/> 26 </Target> 27 <SearchPaths> 28 <IncludeFiles Value="$(ProjOutDir)"/> 29 <OtherUnitFiles Value="Forms;ColorFormats"/> 30 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 31 </SearchPaths> 32 <Parsing> 33 <SyntaxOptions> 34 <SyntaxMode Value="Delphi"/> 35 <CStyleOperator Value="False"/> 36 <AllowLabel Value="False"/> 37 <CPPInline Value="False"/> 38 </SyntaxOptions> 39 </Parsing> 40 <CodeGeneration> 41 <SmartLinkUnit Value="True"/> 42 <Optimizations> 43 <OptimizationLevel Value="3"/> 44 </Optimizations> 45 </CodeGeneration> 46 <Linking> 47 <Debugging> 48 <GenerateDebugInfo Value="False"/> 49 </Debugging> 50 <LinkSmart Value="True"/> 51 <Options> 52 <Win32> 53 <GraphicApplication Value="True"/> 54 </Win32> 55 </Options> 56 </Linking> 57 </CompilerOptions> 58 </Item2> 21 59 </BuildModes> 22 60 <PublishOptions> … … 33 71 </Item1> 34 72 </RequiredPackages> 35 <Units Count=" 8">73 <Units Count="7"> 36 74 <Unit0> 37 75 <Filename Value="LibrePaint.lpr"/> … … 54 92 <Filename Value="UProject.pas"/> 55 93 <IsPartOfProject Value="True"/> 94 <UnitName Value="UProject"/> 56 95 </Unit3> 57 96 <Unit4> … … 61 100 <HasResources Value="True"/> 62 101 <ResourceBaseClass Value="Form"/> 102 <UnitName Value="UFormNew"/> 63 103 </Unit4> 64 104 <Unit5> … … 75 115 <UnitName Value="UFormMain"/> 76 116 </Unit6> 77 <Unit7>78 <Filename Value="ColorFormats/UColorGray8.pas"/>79 <IsPartOfProject Value="True"/>80 <UnitName Value="UColorGray8"/>81 </Unit7>82 117 </Units> 83 118 </ProjectOptions> … … 85 120 <Version Value="11"/> 86 121 <Target> 87 <Filename Value=" LibrePaint"/>122 <Filename Value="lib/$(TargetCPU)-$(TargetOS)/LibrePaint"/> 88 123 </Target> 89 124 <SearchPaths> … … 95 130 <SyntaxOptions> 96 131 <SyntaxMode Value="Delphi"/> 132 <CStyleOperator Value="False"/> 133 <IncludeAssertionCode Value="True"/> 134 <AllowLabel Value="False"/> 135 <CPPInline Value="False"/> 97 136 </SyntaxOptions> 98 137 </Parsing> 138 <CodeGeneration> 139 <Checks> 140 <IOChecks Value="True"/> 141 <RangeChecks Value="True"/> 142 <OverflowChecks Value="True"/> 143 <StackChecks Value="True"/> 144 </Checks> 145 <VerifyObjMethodCallValidity Value="True"/> 146 </CodeGeneration> 99 147 <Linking> 100 148 <Options> -
trunk/UCore.lfm
r4 r6 7 7 Width = 857 8 8 object ActionList1: TActionList 9 Images = ImageList1 9 10 left = 201 10 top = 162 11 object AProjectNew: TAction 11 top = 160 12 object AFileNew: TAction 13 Category = 'File' 12 14 Caption = 'New...' 13 OnExecute = A ProjectNewExecute15 OnExecute = AFileNewExecute 14 16 end 15 17 object AExit: TAction … … 21 23 OnExecute = AImageClearExecute 22 24 end 23 object AImageRandom: TAction 24 Caption = 'Random' 25 OnExecute = AImageRandomExecute 25 object AZoomIn: TAction 26 Category = 'View' 27 Caption = 'Zoom in' 28 OnExecute = AZoomInExecute 29 ShortCut = 107 30 end 31 object AZoomOut: TAction 32 Category = 'View' 33 Caption = 'Zoom out' 34 OnExecute = AZoomOutExecute 35 ShortCut = 109 36 end 37 object AZoomAll: TAction 38 Category = 'View' 39 Caption = 'Zoom all' 40 end 41 object AZoomNormal: TAction 42 Category = 'View' 43 Caption = 'Zoom 100%' 44 OnExecute = AZoomNormalExecute 45 end 46 object AFileOpen: TAction 47 Category = 'File' 48 Caption = 'Open...' 49 end 50 object AFileClose: TAction 51 Category = 'File' 52 Caption = 'Close' 53 end 54 object AFileSave: TAction 55 Category = 'File' 56 Caption = 'Save' 57 end 58 object AFileSaveAs: TAction 59 Category = 'File' 60 Caption = 'Save as...' 26 61 end 27 62 end 63 object ImageList1: TImageList 64 left = 200 65 top = 240 66 end 28 67 end -
trunk/UCore.pas
r5 r6 13 13 14 14 TCore = class(TDataModule) 15 AFileSaveAs: TAction; 16 AFileSave: TAction; 17 AFileClose: TAction; 18 AFileOpen: TAction; 19 AZoomNormal: TAction; 20 AZoomAll: TAction; 21 AZoomIn: TAction; 22 AZoomOut: TAction; 15 23 AImageRandom: TAction; 16 24 AImageClear: TAction; 17 25 AExit: TAction; 18 A ProjectNew: TAction;26 AFileNew: TAction; 19 27 ActionList1: TActionList; 28 ImageList1: TImageList; 20 29 procedure AExitExecute(Sender: TObject); 21 30 procedure AImageClearExecute(Sender: TObject); 22 31 procedure AImageRandomExecute(Sender: TObject); 23 procedure AProjectNewExecute(Sender: TObject); 32 procedure AFileNewExecute(Sender: TObject); 33 procedure AZoomInExecute(Sender: TObject); 34 procedure AZoomNormalExecute(Sender: TObject); 35 procedure AZoomOutExecute(Sender: TObject); 24 36 procedure DataModuleCreate(Sender: TObject); 25 37 private … … 54 66 end; 55 67 56 procedure TCore.A ProjectNewExecute(Sender: TObject);68 procedure TCore.AFileNewExecute(Sender: TObject); 57 69 begin 58 70 if FormNew.ShowModal = mrOk then begin … … 65 77 FormMain.Redraw; 66 78 end; 79 end; 80 81 procedure TCore.AZoomInExecute(Sender: TObject); 82 begin 83 Project.ViewPort.Zoom := Project.ViewPort.Zoom * 1.3; 84 FormMain.Redraw; 85 end; 86 87 procedure TCore.AZoomNormalExecute(Sender: TObject); 88 begin 89 Project.ViewPort.Zoom := 1; 90 FormMain.Redraw; 91 end; 92 93 procedure TCore.AZoomOutExecute(Sender: TObject); 94 begin 95 Project.ViewPort.Zoom := Project.ViewPort.Zoom / 1.3; 96 FormMain.Redraw; 67 97 end; 68 98 -
trunk/UProject.pas
r2 r6 10 10 type 11 11 12 { TViewPort } 13 14 TViewPort = class 15 public 16 Pos: TPoint; 17 Zoom: Double; 18 ViewSize: TPoint; 19 end; 20 12 21 { TProject } 13 22 … … 15 24 FileName: string; 16 25 Bitmap: TGBitmap; 26 ViewPort: TViewPort; 17 27 constructor Create; 18 28 destructor Destroy; override; … … 21 31 implementation 22 32 33 23 34 { TProject } 24 35 … … 26 37 begin 27 38 Bitmap := TGBitmap.Create; 39 ViewPort := TViewPort.Create; 28 40 end; 29 41 30 42 destructor TProject.Destroy; 31 43 begin 44 ViewPort.Free; 32 45 Bitmap.Free; 33 46 inherited Destroy;
Note:
See TracChangeset
for help on using the changeset viewer.