Changeset 46 for trunk/Forms
- Timestamp:
- Aug 16, 2014, 11:02:07 PM (10 years ago)
- Location:
- trunk/Forms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r43 r46 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 59 57 ClientHeight = 592 8 8 ClientWidth = 775 9 9 Menu = MainMenu1 … … 17 17 object PaintBox1: TPaintBox 18 18 Left = 0 19 Height = 53 719 Height = 531 20 20 Top = 32 21 21 Width = 775 … … 32 32 object StatusBar1: TStatusBar 33 33 Left = 0 34 Height = 2 635 Top = 56 934 Height = 29 35 Top = 563 36 36 Width = 775 37 37 Panels = < … … 55 55 Images = Core.ImageListSmall 56 56 ParentShowHint = False 57 PopupMenu = PopupMenuToolbar 57 58 ShowHint = True 58 59 TabOrder = 1 … … 125 126 Action = AZoomOut 126 127 end 128 object MenuItem19: TMenuItem 129 Caption = '-' 130 end 131 object MenuItem20: TMenuItem 132 Action = AToolBarBigIcons 133 end 127 134 end 128 135 object MenuItem8: TMenuItem … … 164 171 ShortCut = 16449 165 172 end 173 object AToolBarBigIcons: TAction 174 Caption = 'Toolbar big icons' 175 OnExecute = AToolBarBigIconsExecute 176 end 177 end 178 object PopupMenuToolbar: TPopupMenu 179 left = 452 180 top = 98 181 object MenuItem18: TMenuItem 182 Action = AToolBarBigIcons 183 end 166 184 end 167 185 end -
trunk/Forms/UFormMain.lrt
r43 r46 3 3 TFORMMAIN.MENUITEM5.CAPTION=- 4 4 TFORMMAIN.MENUITEM10.CAPTION=View 5 TFORMMAIN.MENUITEM19.CAPTION=- 5 6 TFORMMAIN.MENUITEM8.CAPTION=Tools 6 7 TFORMMAIN.MENUITEM16.CAPTION=Help … … 8 9 TFORMMAIN.AZOOMOUT.CAPTION=Zoom out 9 10 TFORMMAIN.AZOOMALL.CAPTION=Zoom all 11 TFORMMAIN.ATOOLBARBIGICONS.CAPTION=Toolbar big icons -
trunk/Forms/UFormMain.pas
r43 r46 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UGame, LCLType, Menus, ActnList, ComCtrls, types, dateutils ;9 UGame, LCLType, Menus, ActnList, ComCtrls, types, dateutils, XMLConf; 10 10 11 11 const … … 17 17 18 18 TFormMain = class(TForm) 19 AToolBarBigIcons: TAction; 19 20 AZoomIn: TAction; 20 21 AZoomAll: TAction; … … 31 32 MenuItem16: TMenuItem; 32 33 MenuItem17: TMenuItem; 34 MenuItem18: TMenuItem; 35 MenuItem19: TMenuItem; 33 36 MenuItem2: TMenuItem; 37 MenuItem20: TMenuItem; 34 38 MenuItem3: TMenuItem; 35 39 MenuItem4: TMenuItem; … … 40 44 MenuItem9: TMenuItem; 41 45 PaintBox1: TPaintBox; 46 PopupMenuToolbar: TPopupMenu; 42 47 StatusBar1: TStatusBar; 43 48 Timer1: TTimer; … … 48 53 ToolButton4: TToolButton; 49 54 ToolButton5: TToolButton; 55 procedure AToolBarBigIconsExecute(Sender: TObject); 50 56 procedure AZoomAllExecute(Sender: TObject); 51 57 procedure AZoomInExecute(Sender: TObject); … … 56 62 procedure FormDestroy(Sender: TObject); 57 63 procedure FormShow(Sender: TObject); 64 procedure MenuItem19Click(Sender: TObject); 58 65 procedure PaintBox1MouseDown(Sender: TObject; Button: TMouseButton; 59 66 Shift: TShiftState; X, Y: Integer); … … 77 84 RedrawPending: Boolean; 78 85 public 86 procedure LoadConfig(Config: TXmlConfig; Path: string); 87 procedure SaveConfig(Config: TXmlConfig; Path: string); 88 procedure ReloadView; 79 89 procedure Redraw; 80 90 end; … … 86 96 87 97 uses 88 U FormNew, UFormMove, UCore;98 UCore; 89 99 90 100 resourcestring … … 132 142 NewCaption := Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption; 133 143 Caption := NewCaption; 144 end; 145 end; 146 147 procedure TFormMain.LoadConfig(Config: TXmlConfig; Path: string); 148 begin 149 with Config do begin 150 AToolBarBigIcons.Checked := GetValue(Path + '/LargeIcons', False); 151 end; 152 end; 153 154 procedure TFormMain.SaveConfig(Config: TXmlConfig; Path: string); 155 begin 156 with Config do begin 157 SetValue(Path + '/LargeIcons', AToolBarBigIcons.Checked); 158 end; 159 end; 160 161 procedure TFormMain.ReloadView; 162 begin 163 if AToolBarBigIcons.Checked then begin 164 ToolBar1.Images := Core.ImageListLarge; 165 ToolBar1.ButtonWidth := 32 + 7; 166 ToolBar1.ButtonHeight := 32 + 6; 167 ToolBar1.Height := 32 + 10; 168 end else begin 169 ToolBar1.ButtonWidth := 16 + 7; 170 ToolBar1.ButtonHeight := 16 + 6; 171 ToolBar1.Height := 16 + 10; 172 ToolBar1.Images := Core.ImageListSmall; 134 173 end; 135 174 end; … … 165 204 end; 166 205 Redraw; 206 end; 207 208 procedure TFormMain.AToolBarBigIconsExecute(Sender: TObject); 209 begin 210 AToolBarBigIcons.Checked := not AToolBarBigIcons.Checked; 211 ReloadView; 167 212 end; 168 213 … … 194 239 begin 195 240 Core.Game.Running := False; 241 SaveConfig(Core.XMLConfig1, 'FormMain'); 196 242 end; 197 243 … … 202 248 procedure TFormMain.FormShow(Sender: TObject); 203 249 begin 204 Redraw; 250 LoadConfig(Core.XMLConfig1, 'FormMain'); 251 ReloadView; 252 Redraw; 253 end; 254 255 procedure TFormMain.MenuItem19Click(Sender: TObject); 256 begin 257 205 258 end; 206 259
Note:
See TracChangeset
for help on using the changeset viewer.