From 6be96de0d35ad49e8e8bfaecb2bc98584a487682 Mon Sep 17 00:00:00 2001 From: lazarus Date: Sat, 17 Aug 2002 15:45:36 +0000 Subject: [PATCH] MG: removed ClientRectBugfix defines git-svn-id: trunk@1850 - --- components/synedit/synedit.pp | 6 -- designer/objectinspector.pp | 6 -- lcl/comctrls.pp | 9 +-- lcl/forms.pp | 5 -- lcl/include/customform.inc | 22 +------ lcl/include/customgroupbox.inc | 16 +----- lcl/include/customradiogroup.inc | 4 ++ lcl/include/winapi.inc | 5 +- lcl/include/winapih.inc | 5 +- lcl/interfaces/gtk/gtkcallback.inc | 92 ++++++++++++++++-------------- lcl/interfaces/gtk/gtkwinapi.inc | 18 ++---- lcl/interfaces/gtk/gtkwinapih.inc | 5 +- lcl/stdctrls.pp | 8 +-- 13 files changed, 78 insertions(+), 123 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 49bbe3dd96..8af24fa9aa 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -63,7 +63,6 @@ interface uses {$IFDEF SYN_LAZARUS} - {$DEFINE ClientRectBugFix} LCLLinux, LCLType, GraphType, {$ELSE} @@ -85,12 +84,7 @@ const ALPHA_LC = ['a'..'z']; {$IFDEF SYN_LAZARUS} -{$IFDEF ClientRectBugFix} ScrollBarWidth=0; -{$ELSE} -// workaround till clientwidth/height is working correctly with scrollbars -ScrollBarWidth=18; -{$ENDIF} {$ENDIF} {$IFNDEF SYN_COMPILER_3_UP} diff --git a/designer/objectinspector.pp b/designer/objectinspector.pp index 16a867765d..0a7152d43f 100644 --- a/designer/objectinspector.pp +++ b/designer/objectinspector.pp @@ -43,7 +43,6 @@ uses LCLLinux, LMessages, Controls, ComCtrls, ExtCtrls, PropEdits, TypInfo, Messages, LResources, Laz_XMLCfg, Menus, Dialogs; -{$DEFINE ClientRectBugFix} type EObjectInspectorException = class(Exception); @@ -318,12 +317,7 @@ const implementation const - {$IFDEF ClientRectBugFix} ScrollBarWidth=0; - {$ELSE} - // workaround till clientwidth/height is working correctly with scrollbars - ScrollBarWidth=19; - {$ENDIF} { TOIPropertyGrid } diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index bedb765a0c..fca753bfcf 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -34,7 +34,6 @@ unit ComCtrls; {$mode objfpc} {$H+} -{$DEFINE ClientRectBugFix} interface @@ -1512,12 +1511,7 @@ const ButtonStyles: array[TToolButtonStyle] of Word = (TBSTYLE_BUTTON, TBSTYLE_CHECK, TBSTYLE_DROPDOWN, TBSTYLE_SEP, TBSTYLE_SEP); - {$IFDEF ClientRectBugFix} ScrollBarWidth=0; - {$ELSE} - // workaround till clientwidth/height is working correctly with scrollbars - ScrollBarWidth=19; - {$ENDIF} { Toolbar menu support } @@ -1564,6 +1558,9 @@ end. { ============================================================================= $Log$ + Revision 1.37 2002/08/17 15:45:31 lazarus + MG: removed ClientRectBugfix defines + Revision 1.36 2002/05/28 14:58:29 lazarus MG: added scrollbars for TListView diff --git a/lcl/forms.pp b/lcl/forms.pp index 3c0bb3edaf..d01c3799ba 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -35,7 +35,6 @@ interface {$ASSERTIONS ON} {$endif} -{$DEFINE ClientRectBugFix} uses Classes, Controls, VCLGlobals, SysUtils, GraphType, Graphics, Menus, @@ -127,12 +126,8 @@ type procedure DoHide; dynamic; procedure DoShow; dynamic; procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override; - {$IFDEF ClientRectBugFix} // Delphi needed GetClientRect for window specific things, LCL not // Function GetClientRect : TRect ; Override; - {$ELSE} - Function GetClientRect : TRect ; Override; - {$ENDIF} Procedure Notification(AComponent: TComponent; Operation : TOperation);override; procedure Paint; dynamic; Procedure PaintWindow(dc : Hdc); override; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 8cf95393c0..7f27e3c654 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -400,25 +400,6 @@ begin end; end; -{$IFDEF ClientRectBugFix} -{$ELSE} -{------------------------------------------------------------------------------ - Method: TCustomForm.GetClientRect - Params: none - Returns: TRect - - Calls user handler - ------------------------------------------------------------------------------} -Function TCustomForm.GetClientRect :TRect; -Begin - SetRect(Result,0,0,0,0); - AdjustWindowRectEx(Result,GetWindowLong(Handle,GWL_STYLE),Menu <> nil - ,GetWindowLong(Handle,GWL_EXSTYLE)); - SetRect(Result,0,0, Width - Result.Right + Result.Left - , Height - Result.Bottom + Result.Top); -end; -{$ENDIF} - {------------------------------------------------------------------------------ Method: TCustomForm.Paint Params: none @@ -1044,6 +1025,9 @@ end; { ============================================================================= $Log$ + Revision 1.50 2002/08/17 15:45:32 lazarus + MG: removed ClientRectBugfix defines + Revision 1.49 2002/07/05 09:09:20 lazarus MG: fixed TCustomForm.ShowModal reacting to ModalResult diff --git a/lcl/include/customgroupbox.inc b/lcl/include/customgroupbox.inc index c0b45702c9..e7bac4e5e5 100644 --- a/lcl/include/customgroupbox.inc +++ b/lcl/include/customgroupbox.inc @@ -13,19 +13,6 @@ * * ***************************************************************************** } -{$IFDEF ClientRectBugFix} -{$ELSE} -{------------------------------------------------------------------------------} -{ function TCustomGroupBox.AdjustClientRect } -{------------------------------------------------------------------------------} -procedure TCustomGroupBox.AdjustClientRect(var Rect: TRect); -begin - if HandleAllocated then - LCLLinux.GetClientRect(Handle,Rect) - else - inherited; -end; -{$ENDIF} {------------------------------------------------------------------------------} { function TCustomGroupBox.Create } @@ -41,6 +28,9 @@ end; { $Log$ + Revision 1.7 2002/08/17 15:45:32 lazarus + MG: removed ClientRectBugfix defines + Revision 1.6 2002/05/10 06:05:51 lazarus MG: changed license to LGPL diff --git a/lcl/include/customradiogroup.inc b/lcl/include/customradiogroup.inc index 63f44c0d70..a820ab07dc 100644 --- a/lcl/include/customradiogroup.inc +++ b/lcl/include/customradiogroup.inc @@ -110,6 +110,7 @@ begin // create as many TRadioButton as needed while (FButtonList.CountcsNotebook then @@ -838,31 +857,13 @@ begin case event^.Button of 1: - if not(LMouseButtonDown) then - Exit - else - begin - MessI.Msg := LM_LBUTTONUP; - LMouseButtonDown := False; - end; - + if not CheckMouseButtonUp(LastLeft,LM_LBUTTONUP) then Exit; + 2: - if not(MMouseButtonDown) then - Exit - else - begin - MessI.Msg := LM_MBUTTONUP; - MMouseButtonDown := False; - end; + if not CheckMouseButtonUp(LastMiddle,LM_MBUTTONUP) then Exit; 3: - if not(RMouseButtonDown) then - Exit - else - begin - MessI.Msg := LM_RBUTTONUP; - RMouseButtonDown := False; - end; + if not CheckMouseButtonUp(LastRight,LM_RBUTTONUP) then Exit; else begin @@ -2142,6 +2143,9 @@ end; { ============================================================================= $Log$ + Revision 1.99 2002/08/17 15:45:33 lazarus + MG: removed ClientRectBugfix defines + Revision 1.98 2002/08/17 07:57:05 lazarus MG: added TPopupMenu.OnPopup and SourceEditor PopupMenu checks diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 504dc624cb..010004b696 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -2430,7 +2430,6 @@ begin ClientWidget := GetFixedWidget(Widget); if (ClientWidget <> nil) then Widget := ClientWidget; - {$IFDEF ClientRectBugFix} if (Widget <> nil) then begin ARect.Right:=Widget^.Allocation.Width; ARect.Bottom:=Widget^.Allocation.Height; @@ -2438,14 +2437,6 @@ begin ARect.Right:=0; ARect.Bottom:=0; end; - {$ELSE} - if (Widget <> nil) and (Widget^.Window<>nil) then begin - gdk_window_get_size(Widget^.Window, @ARect.Right, @ARect.Bottom); - end else begin - ARect.Bottom:=0; - ARect.Right:=0; - end; - {$ENDIF} {$IFDEF VerboseGetClientRect} if ClientWidget<>nil then begin writeln('GetClientRect Widget=',HexStr(Cardinal(handle),8), @@ -3418,7 +3409,6 @@ begin end; end; -{$IFDEF ClientRectBugFix} {------------------------------------------------------------------------------ Function: GetWindowSize Params: Handle : hwnd; @@ -3436,7 +3426,6 @@ begin end else Result:=false; end; -{$ENDIF} {------------------------------------------------------------------------------ Function: HideCaret @@ -5336,7 +5325,7 @@ var end; function ScaleBuffer(ScaleGC:PGDKGC) : Boolean; - {$Ifdef enable_gdkpixbuf} + {$Ifndef NoGdkPixbufLib} var ScaleSrc, ScaleDest : PGDKPixbuf; ShrinkWidth, @@ -5374,7 +5363,7 @@ var gdk_pixbuf_render_pixmap_and_mask(ScaleDest,@Scale^.GDIPixmapObject, nil,0); GDK_Pixbuf_Unref(ScaleDest); Result := True; - {$Else} + {$Else not NoGdkPixbufLib} begin WriteLn('WARNING: [TgtkObject.StretchBlt] GDKPixbuf support has been disabled, no stretching is available!'); Result := True; @@ -5791,6 +5780,9 @@ end; { ============================================================================= $Log$ + Revision 1.94 2002/08/17 15:45:34 lazarus + MG: removed ClientRectBugfix defines + Revision 1.93 2002/08/15 15:46:50 lazarus MG: added changes from Andrew (Clipping) diff --git a/lcl/interfaces/gtk/gtkwinapih.inc b/lcl/interfaces/gtk/gtkwinapih.inc index 8f2aca4c7a..80d482b74c 100644 --- a/lcl/interfaces/gtk/gtkwinapih.inc +++ b/lcl/interfaces/gtk/gtkwinapih.inc @@ -97,9 +97,7 @@ function GetTextMetrics(DC: HDC; var TM: TTextMetric): Boolean; override; Function GetWindowLong(Handle : hwnd; int: Integer): Longint; override; Function GetWindowOrgEx(dc : hdc; var P: TPoint): Integer; override; Function GetWindowRect(Handle : hwnd; var ARect: TRect): Integer; override; -{$IFDEF ClientRectBugFix} Function GetWindowSize(Handle : hwnd; var Width, Height: integer): boolean; override; -{$ENDIF} function HideCaret(hWnd: HWND): Boolean; override; @@ -172,6 +170,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override; { ============================================================================= $Log$ + Revision 1.40 2002/08/17 15:45:36 lazarus + MG: removed ClientRectBugfix defines + Revision 1.39 2002/08/15 15:46:50 lazarus MG: added changes from Andrew (Clipping) diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index b253fbf06c..0dd952565d 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -35,7 +35,6 @@ unit StdCtrls; interface -{$DEFINE ClientRectBugFix} uses VCLGlobals, Classes, SysUtils, Graphics, GraphType, LMessages, Controls, @@ -122,10 +121,6 @@ type TCustomGroupBox = class (TWinControl) {class(TCustomControl) } protected - {$IFDEF ClientRectBugFix} - {$ELSE} - procedure AdjustClientRect(var Rect: TRect); override; - {$ENDIF} public constructor Create(AOwner : TComponent); Override; end; @@ -594,6 +589,9 @@ end. { ============================================================================= $Log$ + Revision 1.32 2002/08/17 15:45:32 lazarus + MG: removed ClientRectBugfix defines + Revision 1.31 2002/07/23 07:40:51 lazarus MG: fixed get widget position for inherited gdkwindows