Changeset 622 for trunk/Packages/CevoComponents
- Timestamp:
- Sep 15, 2024, 10:04:45 PM (3 months ago)
- Location:
- trunk/Packages/CevoComponents
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/BaseWin.pas
r620 r622 103 103 TitleHeight := WideFrame; 104 104 ModalFrameIndent := 45; 105 UserLeft := (Screen.Width - Width) div 2;106 UserTop := (Screen.Height - Height) div 2;105 UserLeft := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2; 106 UserTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 2; 107 107 end; 108 108 -
trunk/Packages/CevoComponents/DrawDlg.pas
r617 r622 35 35 destructor Destroy; override; 36 36 procedure SmartInvalidate; virtual; 37 procedure CenterToScreen; overload; 38 procedure CenterToScreen(AWidth, AHeight: Integer); overload; 37 39 end; 38 40 … … 210 212 end; 211 213 214 procedure TDrawDlg.CenterToScreen; 215 begin 216 BoundsRect := Bounds( 217 Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2, 218 Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - Height) div 2, 219 Width, Height); 220 end; 221 222 procedure TDrawDlg.CenterToScreen(AWidth, AHeight: Integer); 223 begin 224 BoundsRect := Bounds( 225 Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - AWidth) div 2, 226 Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - AHeight) div 2, 227 Width, Height); 228 end; 229 212 230 { TBaseMessgDlg } 213 231 214 232 procedure TBaseMessgDlg.FormCreate(Sender: TObject); 215 233 begin 216 Left := (Screen.Width - Width) div 2;234 Left := Screen.PrimaryMonitor.Left + (Screen.PrimaryMonitor.Width - Width) div 2; 217 235 Canvas.Font.Assign(UniFont[ftNormal]); 218 236 Canvas.Brush.Style := TBrushStyle.bsClear; 219 237 MessgText := ''; 220 238 TopSpace := 0; 221 TitleHeight := Screen. Height;239 TitleHeight := Screen.PrimaryMonitor.Height; 222 240 if csDesigning in ComponentState then Exit; 223 241 InitButtons; … … 287 305 var 288 306 I: Integer; 289 begin 290 Height := 72 + Border + TopSpace + Lines * MessageLineSpacing; 291 Top := (Screen.Height - Height) div 2; 292 for i := 0 to ControlCount - 1 do 293 Controls[i].Top := Height - (34 + Border); 307 NewHeight: Integer; 308 NewTop: Integer; 309 begin 310 NewHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing; 311 NewTop := Screen.PrimaryMonitor.Top + (Screen.PrimaryMonitor.Height - NewHeight) div 2; 312 BoundsRect := Bounds(Left, NewTop, Width, NewHeight); 313 for I := 0 to ControlCount - 1 do 314 Controls[I].Top := NewHeight - (34 + Border); 294 315 end; 295 316
Note:
See TracChangeset
for help on using the changeset viewer.