Changeset 5 for os/trunk/Xvcl
- Timestamp:
- Jun 2, 2013, 2:34:55 PM (11 years ago)
- Location:
- os/trunk
- Files:
-
- 2 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
os/trunk
- Property svn:ignore
-
old new 1 1 Win32 2 2 *.~dsk 3 __history
-
- Property svn:ignore
-
os/trunk/Xvcl
-
Property svn:ignore
set to
__history
-
Property svn:ignore
set to
-
os/trunk/Xvcl/Xvcl.Controls.pas
r3 r5 24 24 TMessageMouseUp = class(TMessageMouse); 25 25 TMessageMouseMove = class(TMessageMouse); 26 TMessageResize = class(TMessage); 27 TMessageTaskList = class(TMessage); 26 28 27 29 TKeyState = (ksShift, ksAlt, ksOS); … … 186 188 if FColor <> Value then begin 187 189 FColor := Value; 188 Paint;190 if Visible then Paint; 189 191 end; 190 192 end; … … 225 227 if FCaption <> Value then begin 226 228 FCaption := Value; 227 Paint;229 if Visible then Paint; 228 230 end; 229 231 end; -
os/trunk/Xvcl/Xvcl.Forms.pas
r3 r5 7 7 8 8 type 9 TBorderStyle = (bsNormal, bsNone); 10 9 11 TForm = class(TWinControl) 10 12 private 11 13 FFocused: Boolean; 14 FBorderStyle: TBorderStyle; 12 15 procedure SetFocused(const Value: Boolean); 16 procedure SetBorderStyle(const Value: TBorderStyle); 13 17 protected 14 18 function GetVideoDevice: TVideoDevice; override; … … 22 26 procedure Paint; override; 23 27 property Focused: Boolean read FFocused write SetFocused; 28 property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle; 29 end; 30 31 TPanel = class(TWinControl) 32 Caption: string; 33 procedure Paint; override; 24 34 end; 25 35 26 36 TApplication = class(TComponent) 37 protected 38 public 39 Caption: string; 27 40 Screen: TObject; // TScreen; 28 41 Forms: TList<TForm>; 29 42 MainForm: TForm; 43 function HandleMessage(Message: TMessage): Boolean; virtual; 30 44 procedure Run; virtual; 31 45 procedure Terminate; virtual; … … 36 50 37 51 uses 38 Xvcl.Kernel;52 LDOS.Kernel; 39 53 40 54 { TApplication } 55 56 function TApplication.HandleMessage(Message: TMessage): Boolean; 57 begin 58 59 end; 41 60 42 61 procedure TApplication.Run; … … 67 86 TitleBarBounds := TRectangle.Create(0, 0, Bounds.Width, TitleBarHeight); 68 87 Focused := True; 69 if TitleBarBounds.Contains(ScreenToClient(Position)) then begin88 if (BorderStyle = bsNormal) and TitleBarBounds.Contains(ScreenToClient(Position)) then begin 70 89 Move.StartControlPos := Bounds.TopLeft; 71 90 Move.StartMousePos := Position; … … 92 111 inherited; 93 112 with Canvas do begin 94 if Focused then Brush.Color := clLightBlue else 95 Brush.Color := clSilver; 96 FillRect(TRectangle.Create(0, 0, Bounds.Width - 1, TitleBarHeight)); 97 MoveTo(TPoint.Create(0, 0)); 98 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 99 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 100 LineTo(TPoint.Create(0, Bounds.Height - 1)); 101 LineTo(TPoint.Create(0, 0)); 102 MoveTo(TPoint.Create(0, TitleBarHeight)); 103 LineTo(TPoint.Create(Bounds.Width - 1, TitleBarHeight)); 104 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 105 (TitleBarHeight - GetTextSize(Caption).Y) div 2), Caption); 113 if BorderStyle = bsNormal then begin 114 if Focused then Brush.Color := clLightBlue else 115 Brush.Color := clSilver; 116 FillRect(TRectangle.Create(0, 0, Bounds.Width - 1, TitleBarHeight)); 117 MoveTo(TPoint.Create(0, 0)); 118 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 119 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 120 LineTo(TPoint.Create(0, Bounds.Height - 1)); 121 LineTo(TPoint.Create(0, 0)); 122 MoveTo(TPoint.Create(0, TitleBarHeight)); 123 LineTo(TPoint.Create(Bounds.Width - 1, TitleBarHeight)); 124 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 125 (TitleBarHeight - GetTextSize(Caption).Y) div 2), Caption); 126 end; 106 127 end; 128 end; 129 130 procedure TForm.SetBorderStyle(const Value: TBorderStyle); 131 begin 132 FBorderStyle := Value; 107 133 end; 108 134 … … 115 141 end; 116 142 143 { TPanel } 144 145 procedure TPanel.Paint; 146 begin 147 inherited; 148 with Canvas do begin 149 MoveTo(TPoint.Create(0, 0)); 150 LineTo(TPoint.Create(Bounds.Width - 1, 0)); 151 LineTo(TPoint.Create(Bounds.Width - 1, Bounds.Height - 1)); 152 LineTo(TPoint.Create(0, Bounds.Height - 1)); 153 LineTo(TPoint.Create(0, 0)); 154 TextOut(TPoint.Create((Bounds.Width - GetTextSize(Caption).X) div 2, 155 (Bounds.Height - GetTextSize(Caption).Y) div 2), Caption); 156 end; 157 end; 158 117 159 end.
Note:
See TracChangeset
for help on using the changeset viewer.