Changeset 48 for trunk/Forms/UFormMain.pas
- Timestamp:
- Jul 12, 2012, 9:15:02 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r47 r48 44 44 ActionList1: TActionList; 45 45 CoolTranslator1: TCoolTranslator; 46 ImageList 1: TImageList;46 ImageListMain: TImageList; 47 47 MainMenu1: TMainMenu; 48 48 MenuItem1: TMenuItem; … … 86 86 PanelOutput: TPanel; 87 87 PanelInput: TPanel; 88 PopupMenuTargets: TPopupMenu; 89 PopupMenuRecentFiles: TPopupMenu; 88 90 SaveDialog1: TSaveDialog; 89 91 Splitter1: TSplitter; … … 106 108 ToolButton14: TToolButton; 107 109 ToolButton15: TToolButton; 110 ToolButtonTarget: TToolButton; 108 111 ToolButton2: TToolButton; 109 112 ToolButton3: TToolButton; … … 223 226 I: Integer; 224 227 begin 228 if Sender is TMenuItem then 225 229 with TMenuItem(Sender) do begin 226 230 CurrentTarget := TTarget(Targets[MenuIndex]); … … 252 256 FCurrentTarget.OnChangeState := TargetStateChanged; 253 257 FCurrentTarget.Messages.OnChange := MessagesChanged; 258 UpdateTargetList; 254 259 UpdateInterface; 255 260 end; … … 293 298 begin 294 299 LastOpenedList.LoadToMenuItem(MenuItemOpenRecent, AProjectOpenRecentExecute); 300 LastOpenedList.LoadToMenuItem(PopupMenuRecentFiles.Items, AProjectOpenRecentExecute); 295 301 end; 296 302 … … 378 384 var 379 385 I: Integer; 380 NewMenuItem: TMenuItem; 381 begin 382 MenuItemTarget.Clear; 383 for I := 0 to Targets.Count - 1 do begin 384 NewMenuItem := TMenuItem.Create(MenuItemTarget); 385 NewMenuItem.Caption := TTarget(Targets[I]).Name; 386 NewMenuItem.OnClick := MenuItemTargetClick; 387 if TTarget(Targets[I]) = CurrentTarget then NewMenuItem.Checked := True; 388 MenuItemTarget.Add(NewMenuItem); 386 begin 387 Targets.LoadToMenuItem(MenuItemTarget, MenuItemTargetClick, CurrentTarget); 388 Targets.LoadToMenuItem(PopupMenuTargets.Items, MenuItemTargetClick, CurrentTarget); 389 390 // Update toolbutton 391 I := Targets.IndexOf(CurrentTarget); 392 if I <> -1 then 393 with TTarget(Targets[I]) do begin 394 ToolButtonTarget.ImageIndex := ImageIndex; 395 ToolButtonTarget.Caption := Name; 396 ToolButtonTarget.OnClick := MenuItemTargetClick(); 389 397 end; 390 398 end;
Note:
See TracChangeset
for help on using the changeset viewer.