Changeset 23 for branches/overos
- Timestamp:
- Dec 30, 2018, 1:17:24 AM (6 years ago)
- Location:
- branches/overos
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/overos/UApplication.pas
r22 r23 40 40 Message := MessageQueue.Messages.First; 41 41 MessageQueue.Messages.Delete(0); 42 if Message is TMessageWindowClose then begin 43 TWindow(Message.Handle).Free; 44 end; 42 if Message is TMessageWindow then 43 TWindow(Message.Handle).HandleMessage(Message); 45 44 end; 46 45 end; -
branches/overos/UFormMain.pas
r22 r23 101 101 Y: Integer); 102 102 begin 103 Caption := IntToStr(X) + ',' + IntToStr(Y);103 //Caption := IntToStr(X) + ',' + IntToStr(Y); 104 104 System.Mouse.Move(TPosition.Create(X, Y)); 105 105 end; -
branches/overos/UWindow.pas
r22 r23 47 47 end; 48 48 49 TMessageWindowClose = class(TMessage); 49 TMessageWindow = class(TMessage); 50 TMessageWindowClose = class(TMessageWindow); 51 TMessageWindowMaximize = class(TMessageWindow); 50 52 51 53 { TWindow } … … 65 67 Title: string; 66 68 Application: TObject; // TApplication 69 procedure HandleMessage(Message: TMessage); 67 70 procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton); override; 68 71 procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton); override; 69 72 procedure Close; 73 procedure Maximize; 70 74 procedure Focus; 71 75 procedure Paint; override; … … 125 129 procedure TTitleBar.ButtonMaximizeClick(Sender: TObject); 126 130 begin 127 Rectangle := TRectangle.Create(TPosition.Create(0, 0), Window.Screen.Size); 128 Paint; 131 Window.Maximize; 129 132 end; 130 133 … … 228 231 end; 229 232 233 procedure TWindow.HandleMessage(Message: TMessage); 234 begin 235 if Message is TMessageWindowClose then begin 236 Free; 237 end else 238 if Message is TMessageWindowMaximize then begin; 239 Rectangle := TRectangle.Create(TPosition.Create(0, 0), Screen.Size); 240 Paint; 241 end; 242 end; 243 230 244 procedure TWindow.MouseButtonDown(Pos: TPosition; Button: TMouseButton); 231 245 begin … … 243 257 begin 244 258 TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowClose.Create); 259 end; 260 261 procedure TWindow.Maximize; 262 begin 263 TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowMaximize.Create); 245 264 end; 246 265
Note:
See TracChangeset
for help on using the changeset viewer.