mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 22:39:21 +02:00
MG: fixed get widget position for inherited gdkwindows
git-svn-id: trunk@1791 -
This commit is contained in:
parent
f51257b9c9
commit
a7c6ec0711
@ -1147,7 +1147,7 @@ begin
|
||||
Add(C,'Jump forward',ecJumpForward,VK_H,[ssCtrl,ssShift],VK_UNKNOWN,[]);
|
||||
Add(C,'Add jump point',ecAddJumpPoint,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'View jump history',ecViewJumpHistory,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'Open file at cursor',ecOpenFileAtCursor,VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
Add(C,'Open file at cursor',ecOpenFileAtCursor,VK_RETURN,[ssCtrl],VK_UNKNOWN,[]);
|
||||
|
||||
// marker
|
||||
C:=Categories[AddCategory('Marker','Marker commands')];
|
||||
|
@ -20,7 +20,7 @@ begin
|
||||
if assigned(AOwner) then
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
fCompStyle := csCHECKBOX;
|
||||
fCompStyle := csCheckbox;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -28,6 +28,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.4 2002/07/23 07:40:51 lazarus
|
||||
MG: fixed get widget position for inherited gdkwindows
|
||||
|
||||
Revision 1.3 2002/05/10 06:05:51 lazarus
|
||||
MG: changed license to LGPL
|
||||
|
||||
|
@ -134,7 +134,7 @@ begin
|
||||
begin
|
||||
ApplyChanges;
|
||||
if assigned (OnClick)
|
||||
then OnCLick (self);
|
||||
then OnClick (self);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -168,6 +168,9 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.5 2002/07/23 07:40:51 lazarus
|
||||
MG: fixed get widget position for inherited gdkwindows
|
||||
|
||||
Revision 1.4 2002/05/10 06:05:51 lazarus
|
||||
MG: changed license to LGPL
|
||||
|
||||
|
@ -107,7 +107,7 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
function GTKRealizeAfterCB(Widget: PGtkWidget; Data: Pointer): GBoolean; cdecl;
|
||||
var
|
||||
WinWidgetInfo, ClientWidgetInfo: PWinWidgetInfo;
|
||||
WinWidgetInfo: PWinWidgetInfo;
|
||||
HiddenLCLObject, LCLObject: TObject;
|
||||
NewEventMask: TGdkEventMask;
|
||||
TheWinControl: TWinControl;
|
||||
@ -138,13 +138,11 @@ begin
|
||||
NewEventMask:=gdk_window_get_events(Widget^.Window)
|
||||
or WinWidgetInfo^.EventMask;
|
||||
gdk_window_set_events(Widget^.Window,NewEventMask);
|
||||
if (ClientWidget<>nil) and (ClientWidget^.Window<>nil) then begin
|
||||
ClientWidgetInfo:=GetWidgetInfo(ClientWidget,false);
|
||||
if ClientWidgetInfo<>nil then begin
|
||||
NewEventMask:=gdk_window_get_events(ClientWidget^.Window)
|
||||
or ClientWidgetInfo^.EventMask;
|
||||
gdk_window_set_events(ClientWidget^.Window,NewEventMask);
|
||||
end;
|
||||
if (ClientWidget<>nil) and (ClientWidget^.Window<>nil)
|
||||
and (ClientWidget^.Window<>Widget^.Window) then begin
|
||||
NewEventMask:=gdk_window_get_events(ClientWidget^.Window)
|
||||
or WinWidgetInfo^.EventMask;
|
||||
gdk_window_set_events(ClientWidget^.Window,NewEventMask);
|
||||
end;
|
||||
//writeln('BBB1 ',HexStr(Cardinal(NewEventMask),8),' ',HexStr(Cardinal(gdk_window_get_events(Widget^.Window)),8));
|
||||
end else begin
|
||||
@ -2157,6 +2155,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.92 2002/07/23 07:40:51 lazarus
|
||||
MG: fixed get widget position for inherited gdkwindows
|
||||
|
||||
Revision 1.91 2002/07/22 18:25:12 lazarus
|
||||
MG: reduced output
|
||||
|
||||
|
@ -301,27 +301,23 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
Function TgtkObject.ClientToScreen(Handle : HWND; var P : TPoint) : Boolean;
|
||||
var
|
||||
X, Y: Integer;
|
||||
Widget: PGTKWidget;
|
||||
Position: TPoint;
|
||||
Begin
|
||||
if Handle = 0
|
||||
then begin
|
||||
X := 0;
|
||||
Y := 0;
|
||||
Position.X := 0;
|
||||
Position.Y := 0;
|
||||
end
|
||||
else begin
|
||||
Widget := GetFixedWidget(pgtkwidget(Handle));
|
||||
if Widget = nil then Widget := pgtkwidget(Handle);
|
||||
gdk_window_get_origin(Widget^.Window, @X, @Y);
|
||||
Position:=GetWidgetClientOrigin(PGtkWidget(Handle));
|
||||
end;
|
||||
|
||||
// Todo: calculate offset, since platform specific
|
||||
Inc(P.X, X);
|
||||
Inc(P.Y, Y);
|
||||
Inc(P.X, Position.X);
|
||||
Inc(P.Y, Position.Y);
|
||||
|
||||
Assert(False, Format('Trace: [GTKObject.ClientToScreen] Handle: 0x%x --> (%d, %d)', [Integer(Handle), P.X, P.y]));
|
||||
Result := True;
|
||||
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -4824,6 +4820,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.83 2002/07/23 07:40:52 lazarus
|
||||
MG: fixed get widget position for inherited gdkwindows
|
||||
|
||||
Revision 1.82 2002/07/20 13:47:04 lazarus
|
||||
MG: fixed eventmask for realized windows
|
||||
|
||||
|
146
lcl/stdctrls.pp
146
lcl/stdctrls.pp
@ -341,6 +341,9 @@ type
|
||||
property OnChange;
|
||||
end;
|
||||
|
||||
|
||||
{ TCustomLabel }
|
||||
|
||||
TCustomLabel = class(TWinControl)
|
||||
private
|
||||
FAlignment : TAlignment;
|
||||
@ -359,6 +362,8 @@ type
|
||||
end;
|
||||
|
||||
|
||||
{ TLabel }
|
||||
|
||||
TLabel = class(TCustomLabel)
|
||||
published
|
||||
property Alignment;
|
||||
@ -371,80 +376,78 @@ type
|
||||
end;
|
||||
|
||||
|
||||
TButtonControl = class(TWinControl)
|
||||
private
|
||||
FClicksDisabled: Boolean;
|
||||
protected
|
||||
function GetChecked: Boolean; virtual;
|
||||
procedure SetChecked(Value: Boolean); virtual;
|
||||
property Checked: Boolean read GetChecked write SetChecked;// stored IsCheckedStored default False;
|
||||
property ClicksDisabled: Boolean read FClicksDisabled write FClicksDisabled;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
end;
|
||||
{ TButtonControl }
|
||||
|
||||
TButtonControl = class(TWinControl)
|
||||
private
|
||||
FClicksDisabled: Boolean;
|
||||
protected
|
||||
function GetChecked: Boolean; virtual;
|
||||
procedure SetChecked(Value: Boolean); virtual;
|
||||
property Checked: Boolean read GetChecked write SetChecked;// stored IsCheckedStored default False;
|
||||
property ClicksDisabled: Boolean read FClicksDisabled write FClicksDisabled;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
|
||||
{ TCHECKBOX }
|
||||
|
||||
{TCHECKBOX}
|
||||
// ToDo: delete TLeftRight when in classesh.inc
|
||||
TLeftRight = taLeftJustify..taRightJustify;
|
||||
|
||||
// ToDo: delete TLeftRight when in classesh.inc
|
||||
TLeftRight = taLeftJustify..taRightJustify;
|
||||
TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
|
||||
|
||||
TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
|
||||
TCustomCheckBox = class(TButtonControl)
|
||||
private
|
||||
// FAlignment: TLeftRight;
|
||||
FAllowGrayed: Boolean;
|
||||
FState: TCheckBoxState;
|
||||
procedure SetState(Value: TCheckBoxState);
|
||||
function GetState : TCheckBoxState;
|
||||
protected
|
||||
procedure InitializeWnd; override;
|
||||
procedure Toggle; virtual;
|
||||
function GetChecked: Boolean; override;
|
||||
procedure SetChecked(Value: Boolean); override;
|
||||
procedure ApplyChanges; virtual;
|
||||
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed;
|
||||
property State: TCheckBoxState read GetState write SetState;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
end;
|
||||
|
||||
TCustomCheckBox = class(TButtonControl)
|
||||
private
|
||||
// FAlignment: TLeftRight;
|
||||
FAllowGrayed: Boolean;
|
||||
FState: TCheckBoxState;
|
||||
procedure SetState(Value: TCheckBoxState);
|
||||
function GetState : TCheckBoxState;
|
||||
protected
|
||||
procedure InitializeWnd; override;
|
||||
// procedure Click; override;
|
||||
procedure Toggle; virtual;
|
||||
function GetChecked: Boolean; override;
|
||||
procedure SetChecked(Value: Boolean); override;
|
||||
procedure ApplyChanges; virtual;
|
||||
property AllowGrayed: Boolean read FAllowGrayed write FAllowGrayed;
|
||||
property State: TCheckBoxState read GetState write SetState;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
|
||||
end;
|
||||
|
||||
TCheckBox = class(TCustomCheckBox)
|
||||
private
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
published
|
||||
property AllowGrayed;
|
||||
property Caption;
|
||||
property Checked;
|
||||
property State;
|
||||
property Visible;
|
||||
property Enabled;
|
||||
property OnEnter;
|
||||
property OnExit;
|
||||
property DragCursor;
|
||||
property DragKind;
|
||||
property DragMode;
|
||||
property Hint;
|
||||
property ParentShowHint;
|
||||
property PopupMenu;
|
||||
property ShowHint;
|
||||
property TabOrder;
|
||||
property TabStop;
|
||||
property OnClick;
|
||||
property OnDragDrop;
|
||||
property OnDragOver;
|
||||
property OnEndDrag;
|
||||
property OnMouseDown;
|
||||
property OnMouseMove;
|
||||
property OnMouseUp;
|
||||
property OnStartDrag;
|
||||
end;
|
||||
TCheckBox = class(TCustomCheckBox)
|
||||
private
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
published
|
||||
property AllowGrayed;
|
||||
property Caption;
|
||||
property Checked;
|
||||
property State;
|
||||
property Visible;
|
||||
property Enabled;
|
||||
property OnEnter;
|
||||
property OnExit;
|
||||
property DragCursor;
|
||||
property DragKind;
|
||||
property DragMode;
|
||||
property Hint;
|
||||
property ParentShowHint;
|
||||
property PopupMenu;
|
||||
property ShowHint;
|
||||
property TabOrder;
|
||||
property TabStop;
|
||||
property OnClick;
|
||||
property OnDragDrop;
|
||||
property OnDragOver;
|
||||
property OnEndDrag;
|
||||
property OnMouseDown;
|
||||
property OnMouseMove;
|
||||
property OnMouseUp;
|
||||
property OnStartDrag;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -452,7 +455,6 @@ type
|
||||
private
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
|
||||
published
|
||||
property AllowGrayed;
|
||||
property Caption;
|
||||
@ -524,8 +526,7 @@ type
|
||||
|
||||
|
||||
|
||||
|
||||
implementation {*******}
|
||||
implementation
|
||||
|
||||
uses LCLLinux, LCLType;
|
||||
|
||||
@ -593,6 +594,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.31 2002/07/23 07:40:51 lazarus
|
||||
MG: fixed get widget position for inherited gdkwindows
|
||||
|
||||
Revision 1.30 2002/05/20 14:19:03 lazarus
|
||||
MG: activated the clientrect bugfixes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user