mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 20:29:35 +02:00
fixed position of control in TGroupBox from Micha
git-svn-id: trunk@4465 -
This commit is contained in:
parent
ce7fe66e20
commit
eeed966745
@ -434,6 +434,7 @@ Begin
|
||||
idFrom := SendMessage(HWndFrom, TCM_GETCURSEL, 0, 0);
|
||||
end;
|
||||
end;
|
||||
Win32PosToLCLPos(OwnerObject, XPos, YPos);
|
||||
End;
|
||||
End;
|
||||
WM_PAINT:
|
||||
@ -641,6 +642,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.48 2003/08/11 20:18:46 mattias
|
||||
fixed position of control in TGroupBox from Micha
|
||||
|
||||
Revision 1.47 2003/08/11 18:10:41 mattias
|
||||
fixed combobox height from Micha
|
||||
|
||||
|
@ -550,7 +550,10 @@ Begin
|
||||
If (Sender Is TWinControl) Or (Sender Is TCommonDialog) Then
|
||||
Begin
|
||||
If Handle <> 0 Then
|
||||
begin
|
||||
RemoveProp(Handle, 'Lazarus');
|
||||
DestroyWindow(Handle);
|
||||
end;
|
||||
End
|
||||
Else If Sender Is TMenu Then
|
||||
Begin
|
||||
@ -1612,18 +1615,10 @@ End;
|
||||
------------------------------------------------------------------------------}
|
||||
Procedure TWin32Object.ResizeChild(Sender: TObject; Left, Top, Width, Height: Integer);
|
||||
Var
|
||||
DC: HDC;
|
||||
Handle: HWND;
|
||||
TM: TEXTMETRICA;
|
||||
Begin
|
||||
Handle := (Sender As TWinControl).Handle;
|
||||
If (TControl(Sender).Parent Is TCustomGroupBox) Then
|
||||
Begin
|
||||
DC := GetDC(Handle);
|
||||
GetTextMetrics(DC, TM);
|
||||
Top := Top + TM.TMHeight;
|
||||
ReleaseDC(Handle, DC);
|
||||
End;
|
||||
LCLBoundsToWin32Bounds(Sender, Left, Top, Width, Height);
|
||||
If Handle <> HWND(Nil) Then
|
||||
MoveWindow(Handle, Left, Top, Width, Height, True)
|
||||
End;
|
||||
@ -1760,6 +1755,7 @@ Begin
|
||||
Top := TControl(Sender).Top;
|
||||
Width := TControl(Sender).Width;
|
||||
Assert(False, 'Trace:Setting dimentions');
|
||||
LCLBoundsToWin32Bounds(Sender, Left, Top, Width, Height);
|
||||
End
|
||||
Else If (Sender Is TMenuItem) Then
|
||||
Begin
|
||||
@ -1945,7 +1941,7 @@ Begin
|
||||
End;}
|
||||
csLabel:
|
||||
Begin
|
||||
Window := CreateWindow('STATIC', StrTemp, Flags Or SS_LEFT, (Sender As TControl).Left, (Sender As TControl).Top, (Sender As TControl).Width, (Sender As TControl).Height, FParentWindow, HMENU(Nil), HInstance, Nil);
|
||||
Window := CreateWindow('STATIC', StrTemp, Flags Or SS_LEFT, Left, Top, Width, Height, FParentWindow, HMENU(Nil), HInstance, Nil);
|
||||
SetProp(Window, 'Lazarus', Sender);
|
||||
End;
|
||||
csListView:
|
||||
@ -2734,6 +2730,9 @@ End;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.82 2003/08/11 20:18:46 mattias
|
||||
fixed position of control in TGroupBox from Micha
|
||||
|
||||
Revision 1.81 2003/08/09 16:30:34 mattias
|
||||
fixed LM_ShowModal for win32 intf from Karl
|
||||
|
||||
|
@ -709,6 +709,41 @@ Begin
|
||||
Result := GetProp(Control, 'AccelKey');
|
||||
End;
|
||||
|
||||
Procedure LCLBoundsToWin32Bounds(Sender: TObject; var Left, Top, Width, Height: Integer);
|
||||
var
|
||||
TM: TextMetricA;
|
||||
DC: HDC;
|
||||
Handle: HWND;
|
||||
Begin
|
||||
if Sender = nil then exit;
|
||||
If (TControl(Sender).Parent Is TCustomGroupBox) Then
|
||||
Begin
|
||||
Handle := TControl(Sender).Parent.Handle;
|
||||
DC := GetDC(Handle);
|
||||
GetTextMetrics(DC, TM);
|
||||
Top := Top + TM.TMHeight;
|
||||
ReleaseDC(Handle, DC);
|
||||
End;
|
||||
End;
|
||||
|
||||
Procedure Win32PosToLCLPos(Sender: TObject; var Left, Top: SmallInt);
|
||||
var
|
||||
TM: TextMetricA;
|
||||
DC: HDC;
|
||||
Handle: HWND;
|
||||
Begin
|
||||
if Sender = nil then exit;
|
||||
// check for groupbox client pos
|
||||
If (TControl(Sender).Parent Is TCustomGroupBox) Then
|
||||
Begin
|
||||
Handle := TControl(Sender).Parent.Handle;
|
||||
DC := GetDC(Handle);
|
||||
GetTextMetrics(DC, TM);
|
||||
Top := Top - TM.TMHeight;
|
||||
ReleaseDC(Handle, DC);
|
||||
End;
|
||||
End;
|
||||
|
||||
{$IFDEF ASSERT_IS_ON}
|
||||
{$UNDEF ASSERT_IS_ON}
|
||||
{$C-}
|
||||
@ -717,6 +752,9 @@ End;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.17 2003/08/11 20:18:46 mattias
|
||||
fixed position of control in TGroupBox from Micha
|
||||
|
||||
Revision 1.16 2003/07/28 06:42:42 mattias
|
||||
removed debuggging SetName, Patch from Karl Brandt
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user