Changeset 27 for branches/topdown
- Timestamp:
- Aug 22, 2019, 11:32:31 AM (5 years ago)
- Location:
- branches/topdown
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/topdown/UFormMain.lfm
r26 r27 1 1 object FormMain: TFormMain 2 Left = 4412 Left = 689 3 3 Height = 300 4 Top = 2904 Top = 331 5 5 Width = 400 6 6 BorderStyle = bsNone -
branches/topdown/UFormMain.pas
r26 r27 82 82 P: TPoint; 83 83 begin 84 P := ClientToScreen(Point(0, PanelTaskBar.Top - PanelTaskBar.Height));85 FormMenu.BoundsRect := Bounds( 0, P.Y - FormMenu.Height,84 P := PanelTaskBar.ClientToScreen(Point(ButtonMenu.Left, ButtonMenu.Top - PanelTaskBar.Height)); 85 FormMenu.BoundsRect := Bounds(P.X, P.Y - FormMenu.Height, 86 86 FormMenu.Width, FormMenu.Height); 87 87 FormMenu.Show; -
branches/topdown/UFormMenu.lfm
r26 r27 12 12 OnShow = FormShow 13 13 LCLVersion = '2.0.2.0' 14 object ButtonShutDown: TButton15 Left = 716 Height = 3117 Top = 36218 Width = 9419 Anchors = [akLeft, akBottom]20 Caption = 'Shut down'21 OnClick = ButtonShutDownClick22 TabOrder = 023 end24 14 object ListBoxApps: TListBox 25 15 Left = 10 … … 34 24 ItemHeight = 20 35 25 OnClick = ListBoxAppsClick 26 TabOrder = 0 27 end 28 object ToolBar1: TToolBar 29 Left = 164 30 Height = 30 31 Top = 362 32 Width = 90 33 Align = alCustom 34 Anchors = [akTop, akRight] 35 AutoSize = True 36 Caption = 'ToolBar1' 37 EdgeBorders = [] 38 Flat = False 39 ShowCaptions = True 36 40 TabOrder = 1 41 object ToolButton1: TToolButton 42 Left = 1 43 Top = 2 44 Caption = 'Shutdown' 45 DropdownMenu = PopupMenu1 46 OnClick = ToolButton1Click 47 Style = tbsDropDown 48 end 37 49 end 38 object ButtonReboot: TButton 39 Left = 112 40 Height = 31 41 Top = 362 42 Width = 94 43 Anchors = [akLeft, akBottom] 44 Caption = 'Reboot' 45 OnClick = ButtonRebootClick 46 TabOrder = 2 50 object PopupMenu1: TPopupMenu 51 left = 111 52 top = 278 53 object MenuItemReboot: TMenuItem 54 Caption = 'Reboot' 55 OnClick = MenuItemRebootClick 56 end 47 57 end 48 58 end -
branches/topdown/UFormMenu.pas
r26 r27 6 6 7 7 uses 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Menus, 9 Buttons, ComCtrls; 9 10 10 11 type … … 13 14 14 15 TFormMenu = class(TForm) 15 ButtonShutDown: TButton;16 ButtonReboot: TButton;17 16 ListBoxApps: TListBox; 18 procedure ButtonRebootClick(Sender: TObject); 19 procedure ButtonShutDownClick(Sender: TObject); 17 MenuItemReboot: TMenuItem; 18 PopupMenu1: TPopupMenu; 19 ToolBar1: TToolBar; 20 ToolButton1: TToolButton; 20 21 procedure FormDeactivate(Sender: TObject); 21 22 procedure FormShow(Sender: TObject); 22 23 procedure ListBoxAppsClick(Sender: TObject); 24 procedure MenuItemRebootClick(Sender: TObject); 25 procedure ToolButton1Click(Sender: TObject); 23 26 private 24 27 … … 54 57 FormClass: TFormTaskClass; 55 58 begin 56 FormClass := TFormTaskClass(ListBoxApps.Items.Objects[ListBoxApps.ItemIndex]); 57 BaseSystem.Tasks.StartTask(FormClass); 59 if ListBoxApps.ItemIndex <> -1 then begin 60 FormClass := TFormTaskClass(ListBoxApps.Items.Objects[ListBoxApps.ItemIndex]); 61 BaseSystem.Tasks.StartTask(FormClass); 62 end; 63 end; 64 65 procedure TFormMenu.MenuItemRebootClick(Sender: TObject); 66 begin 67 Hide; 68 BaseSystem.Reboot; 69 end; 70 71 procedure TFormMenu.ToolButton1Click(Sender: TObject); 72 begin 73 Hide; 74 BaseSystem.ShutDown; 58 75 end; 59 76 … … 71 88 end; 72 89 73 procedure TFormMenu.ButtonShutDownClick(Sender: TObject);74 begin75 Hide;76 BaseSystem.ShutDown;77 end;78 79 procedure TFormMenu.ButtonRebootClick(Sender: TObject);80 begin81 Hide;82 BaseSystem.Reboot;83 end;84 85 90 end. 86 91
Note:
See TracChangeset
for help on using the changeset viewer.