Changeset 6 for os/trunk/Applications
- Timestamp:
- Jun 2, 2013, 5:41:42 PM (12 years ago)
- Location:
- os/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
os/trunk
- Property svn:ignore
-
old new 2 2 *.~dsk 3 3 __history 4 *.identcache
-
- Property svn:ignore
-
os/trunk/Applications/TestApplication.pas
r5 r6 4 4 5 5 uses 6 Vcl.Graphics, Xvcl.Controls, Xvcl.Classes, Xvcl.Forms, SysUtils;6 Vcl.Graphics, Xvcl.Controls, Xvcl.Classes, Xvcl.Forms, LDOS.Kernel, SysUtils; 7 7 8 8 type … … 12 12 Button: TButton; 13 13 Label1: TLabel; 14 Timer1: TTimer; 14 15 procedure Run; override; 15 16 procedure ButtonClick(Sender: TObject); … … 18 19 19 20 implementation 20 21 uses22 LDOS.Kernel;23 21 24 22 { TTestApplication } … … 43 41 Form2.Caption := 'Some form'; 44 42 Form2.Screen := Screen; 43 Timer1 := TTimer.Create; 44 Timer1.Interval := 1000; 45 Timer1.Enabled := True; 46 TScreen(Screen).Kernel.Timers.Add(Timer1); 45 47 Button := TButton.Create; 46 48 Button.Parent := Form1; … … 56 58 Label1.Caption := '0'; 57 59 Form1.Controls.Add(Label1); 60 MainForm := Form1; 58 61 TScreen(Screen).Forms.Add(Form1); 59 62 TScreen(Screen).Forms.Add(Form2); -
os/trunk/Applications/UDesktop.pas
r5 r6 9 9 type 10 10 TDesktopApp = class(TApplication) 11 private 12 procedure TaskButtonClick(Sender: TObject); 11 13 protected 12 14 function HandleMessage(Message: TMessage): Boolean; override; … … 38 40 TestApp.Screen := Screen; 39 41 TScreen(Screen).Kernel.RunApplication(TestApp); 42 end; 43 44 procedure TDesktopApp.TaskButtonClick(Sender: TObject); 45 var 46 Process: TProcess; 47 begin 48 if Sender is TButton then begin 49 Process := TScreen(Screen).Kernel.Processes[TaskButtons.IndexOf(TButton(Sender))]; 50 if Assigned(Process) and Assigned(Process.Application.MainForm) then 51 Process.Application.MainForm.Focused := True; 52 end; 40 53 end; 41 54 … … 75 88 MainBar.Controls.Add(TaskBar); 76 89 MenuButton := TButton.Create; 77 MenuButton.Parent := MainBar;90 MenuButton.Parent := TaskBar; 78 91 MenuButton.Bounds := TRectangle.Create(0, 0, 50, 24); 79 92 MenuButton.Visible := True; … … 82 95 MainBar.Controls.Add(MenuButton); 83 96 TScreen(Screen).Forms.Add(MainBar); 84 UpdateTaskList; 97 MainForm := MainBar; 98 UpdateTaskBar; 85 99 TScreen(Screen).Paint; 86 100 end; … … 93 107 MainBar.Bounds.Width, MainBar.Bounds.Height); 94 108 UpdateTaskList; 109 TScreen(Screen).Paint; 95 110 end; 96 111 … … 120 135 TaskButtons[I].Bounds := TRectangle.Create(MenuButton.Bounds.Width + 121 136 I * Width, 0, Width, MainBar.Bounds.Height); 137 TaskButtons[I].OnClick := TaskButtonClick; 122 138 MainBar.Controls.Add(TaskButtons[I]); 123 139 end;
Note:
See TracChangeset
for help on using the changeset viewer.