Changeset 29 for trunk/Forms
- Timestamp:
- Oct 6, 2019, 9:53:39 PM (5 years ago)
- Location:
- trunk/Forms
- Files:
-
- 6 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r28 r29 32 32 end 33 33 end 34 object MenuItemTools: TMenuItem 35 Caption = 'Tools' 36 object MenuItem4: TMenuItem 37 Action = Core.AComputer 38 end 39 end 34 40 object MenuItemHelp: TMenuItem 35 41 Caption = 'Help' -
trunk/Forms/UFormMain.lrj
r28 r29 2 2 {"hash":217976,"name":"tformmain.caption","sourcebytes":[50,48,52,56],"value":"2048"}, 3 3 {"hash":317493,"name":"tformmain.menuitemgame.caption","sourcebytes":[71,97,109,101],"value":"Game"}, 4 {"hash":5989939,"name":"tformmain.menuitemtools.caption","sourcebytes":[84,111,111,108,115],"value":"Tools"}, 4 5 {"hash":322608,"name":"tformmain.menuitemhelp.caption","sourcebytes":[72,101,108,112],"value":"Help"} 5 6 ]} -
trunk/Forms/UFormMain.pas
r28 r29 18 18 MenuItem2: TMenuItem; 19 19 MenuItem3: TMenuItem; 20 MenuItem4: TMenuItem; 21 MenuItemTools: TMenuItem; 20 22 MenuItemNew: TMenuItem; 21 23 MenuItemExit: TMenuItem; … … 35 37 public 36 38 procedure Redraw; 39 procedure UpdateInterface; 37 40 end; 38 41 … … 53 56 if Core.Game.Running and not Core.Game.Moving then begin 54 57 case Key of 55 37: Core.Game.MoveAll (drLeft);56 38: Core.Game.MoveAll (drUp);57 39: Core.Game.MoveAll (drRight);58 40: Core.Game.MoveAll (drDown);58 37: Core.Game.MoveAllAndUpdate(drLeft); 59 38: Core.Game.MoveAllAndUpdate(drUp); 60 39: Core.Game.MoveAllAndUpdate(drRight); 61 40: Core.Game.MoveAllAndUpdate(drDown); 59 62 end; 60 63 end; … … 85 88 if not Core.Game.Running then 86 89 Core.Game.New; 90 UpdateInterface; 87 91 end; 88 92 … … 100 104 end; 101 105 106 procedure TFormMain.UpdateInterface; 107 var 108 I: Integer; 109 ToolsVisible: Boolean; 110 begin 111 ToolsVisible := False; 112 for I := 0 to MenuItemTools.Count - 1 do 113 if MenuItemTools.Items[I].Enabled then begin 114 ToolsVisible := True; 115 Break; 116 end; 117 MenuItemTools.Visible := ToolsVisible; 118 end; 119 102 120 end. 103 121
Note:
See TracChangeset
for help on using the changeset viewer.