Changeset 28 for trunk/Forms
- Timestamp:
- Dec 22, 2016, 6:01:41 PM (8 years ago)
- Location:
- trunk/Forms
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r26 r28 9 9 Menu = MainMenu1 10 10 OnActivate = FormActivate 11 OnClose = FormClose 11 12 OnCreate = FormCreate 12 13 OnDestroy = FormDestroy … … 114 115 top = 206 115 116 end 117 object LastOpenedList1: TLastOpenedList 118 MaxCount = 10 119 OnChange = LastOpenedList1Change 120 left = 292 121 top = 112 122 end 116 123 end -
trunk/Forms/UFormMain.pas
r27 r28 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ExtCtrls, ComCtrls, types, LCLType ;9 ExtCtrls, ComCtrls, types, LCLType, ULastOpenedList, URegistry, Registry; 10 10 11 11 type … … 14 14 15 15 TFormMain = class(TForm) 16 LastOpenedList1: TLastOpenedList; 16 17 MainMenu1: TMainMenu; 17 18 MenuItem1: TMenuItem; … … 40 41 Timer1: TTimer; 41 42 procedure FormActivate(Sender: TObject); 43 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 42 44 procedure FormCreate(Sender: TObject); 43 45 procedure FormDestroy(Sender: TObject); 44 46 procedure FormShow(Sender: TObject); 47 procedure LastOpenedList1Change(Sender: TObject); 45 48 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 46 49 Shift: TShiftState; X, Y: Integer); … … 64 67 MousePos: TPoint; 65 68 Activated: Boolean; 69 procedure OpenRecentClick(Sender: TObject); 66 70 public 67 71 procedure EraseBackground(DC: HDC); override; … … 94 98 end; 95 99 100 procedure TFormMain.OpenRecentClick(Sender: TObject); 101 begin 102 Core.ProjectOpen(TMenuItem(Sender).Caption); 103 end; 104 96 105 procedure TFormMain.EraseBackground(DC: HDC); 97 106 begin … … 120 129 TempBitmap.SetSize(View.SrcRect.Right - View.SrcRect.Left, 121 130 View.SrcRect.Bottom - View.SrcRect.Top); 122 //TempBitmap.BeginUpdate(True);131 TempBitmap.BeginUpdate(True); 123 132 TempBitmap.Canvas.Brush.Color := clBlack; 124 133 TempBitmap.Canvas.FillRect(0, 0, TempBitmap.Width, TempBitmap.Height); 125 134 View.DestRect := Bounds(0, 0, PaintBox1.Width, PaintBox1.Height); 126 //Bitmap.PaintToCanvas(TempBitmap.Canvas, View.SrcRect);127 Bitmap.PaintToBitmap(TempBitmap, View.SrcRect);128 //TempBitmap.EndUpdate(False);135 Bitmap.PaintToCanvas(TempBitmap.Canvas, View.SrcRect); 136 //Bitmap.PaintToBitmap(TempBitmap, View.SrcRect); 137 TempBitmap.EndUpdate(False); 129 138 PaintBox1.Canvas.StretchDraw(View.DestRect, TempBitmap); 130 139 //PaintBox1.Canvas.Draw(0, 0, TempBitmap); … … 147 156 end; 148 157 158 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 159 begin 160 Core.PersistentForm1.Save(Self); 161 LastOpenedList1.SaveToRegistry(RegContext(HKEY(Core.ApplicationInfo1.RegistryRoot), 162 Core.ApplicationInfo1.RegistryKey + '\RecentFiles')); 163 end; 164 149 165 procedure TFormMain.FormDestroy(Sender: TObject); 150 166 begin … … 154 170 procedure TFormMain.FormShow(Sender: TObject); 155 171 begin 172 Core.PersistentForm1.Load(Self); 173 LastOpenedList1.LoadFromRegistry(RegContext(HKEY(Core.ApplicationInfo1.RegistryRoot), 174 Core.ApplicationInfo1.RegistryKey + '\RecentFiles')); 175 end; 176 177 procedure TFormMain.LastOpenedList1Change(Sender: TObject); 178 begin 179 LastOpenedList1.LoadToMenuItem(MenuItemRecentFiles, OpenRecentClick); 156 180 end; 157 181 -
trunk/Forms/UFormNew.lfm
r26 r28 7 7 ClientHeight = 300 8 8 ClientWidth = 497 9 OnClose = FormClose 9 10 OnShow = FormShow 10 11 LCLVersion = '1.6.2.0' -
trunk/Forms/UFormNew.pas
r26 r28 26 26 SpinEditWidth: TSpinEdit; 27 27 SpinEditHeight: TSpinEdit; 28 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 28 29 procedure FormShow(Sender: TObject); 29 30 procedure SpinEditWidthChange(Sender: TObject); … … 40 41 41 42 {$R *.lfm} 43 44 uses 45 UCore; 42 46 43 47 { TFormNew } … … 57 61 I: Integer; 58 62 begin 63 Core.PersistentForm1.Load(Self); 64 59 65 ComboBoxColorFormat.Clear; 60 66 for I := 0 to ColorFormatManager.FormatCount - 1 do begin … … 71 77 end; 72 78 79 procedure TFormNew.FormClose(Sender: TObject; var CloseAction: TCloseAction); 80 begin 81 Core.PersistentForm1.Save(Self); 82 end; 83 73 84 end. 74 85
Note:
See TracChangeset
for help on using the changeset viewer.