vclass removal: Fixes starting the IDE in gtk2

git-svn-id: trunk@55143 -
This commit is contained in:
sekelsenmat 2017-06-01 14:28:40 +00:00
parent a33e8c7b11
commit 892043c910
3 changed files with 25 additions and 14 deletions

View File

@ -272,7 +272,7 @@ begin
if TheWinControl<>nil then
begin
TheWinControl.CNPreferredSizeChanged;
TGtkPrivateWidgetClass(TheWinControl.WidgetSetClass.WSPrivate).UpdateCursor(WinWidgetInfo);
GetGtkPrivate(TheWinControl).UpdateCursor(WinWidgetInfo);
ConnectInternalWidgetsSignals(MainWidget,TheWinControl);
if (TheWinControl is TCustomPage)

View File

@ -770,19 +770,16 @@ begin
// simple
Child := TWinControlHack(AChild);
if ANewPos <= 0 then // bottom
TGtkPrivateWidgetClass(
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack)
GetGtkPrivate(Child).SetZPosition(Child, wszpBack)
else
TGtkPrivateWidgetClass(
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpFront);
GetGtkPrivate(Child).SetZPosition(Child, wszpFront);
end else
begin
for n := 1 to AChildren.Count - 1 do
begin
Child := TWinControlHack(AChildren[n]);
if Child.HandleAllocated then
TGtkPrivateWidgetClass(
Child.WidgetSetClass.WSPrivate).SetZPosition(Child, wszpBack);
GetGtkPrivate(Child).SetZPosition(Child, wszpBack);
end;
end;
end;
@ -798,7 +795,7 @@ begin
if WidgetInfo^.ControlCursor <> ACursor then
begin
WidgetInfo^.ControlCursor := ACursor;
TGtkPrivateWidgetClass(AWinControl.WidgetSetClass.WSPrivate).UpdateCursor(WidgetInfo);
GetGtkPrivate(AWinControl).UpdateCursor(WidgetInfo);
end;
end;

View File

@ -40,10 +40,13 @@ type
{ TGtkPrivate } // GTK1WS Legacy!
{ Generic base class, don't know if it is needed }
TGtkPrivateClass = class of TGtkPrivate;
TGtkPrivate = class(TWSPrivate)
private
protected
public
class procedure SetZPosition(const AWinControl: TWinControl; const APosition: TWSZPosition); virtual; abstract;
class procedure UpdateCursor(AInfo: PWidgetInfo); virtual; abstract;
end;
{ TGtkPrivateWidget }
@ -53,8 +56,8 @@ type
private
protected
public
class procedure SetZPosition(const AWinControl: TWinControl; const APosition: TWSZPosition); virtual;
class procedure UpdateCursor(AInfo: PWidgetInfo); virtual;
class procedure SetZPosition(const AWinControl: TWinControl; const APosition: TWSZPosition); override;
class procedure UpdateCursor(AInfo: PWidgetInfo); override;
end;
TGtkPrivateWidgetClass = class of TGtkPrivateWidget;
@ -164,7 +167,6 @@ type
{ TGtk2PrivateWidget }
{ Private class for gtkwidgets }
TGtk2PrivateWidget = class(TGtkPrivateWidget)
private
protected
@ -204,7 +206,6 @@ type
{ TGtk2PrivateDialog }
{ Private class for gtkdialogs }
TGtk2PrivateDialog = class(TGtkPrivateDialog)
private
protected
@ -214,7 +215,6 @@ type
{ TGtk2PrivateButton }
{ Private class for gtkbuttons }
TGtk2PrivateButton = class(TGtkPrivateButton)
private
protected
@ -257,15 +257,29 @@ procedure SetWindowCursor(AWindow: PGdkWindow; ACursor: HCursor;
procedure SetCursorForWindowsWithInfo(AWindow: PGdkWindow; AInfo: PWidgetInfo;
ASetDefault: Boolean);
procedure SetGlobalCursor(Cursor: HCURSOR);
function GetGtkPrivate(AWinControl: TWinControl): TGtkPrivateClass;
implementation
uses
Gtk2Extra;
Gtk2Extra, buttons, stdctrls, comctrls;
{$I Gtk2PrivateWidget.inc}
{$I Gtk2PrivateList.inc}
function GetGtkPrivate(AWinControl: TWinControl): TGtkPrivateClass;
begin
if AWinControl is TScrollingWinControl then Exit(TGtkPrivateScrollingWinControl);
if AWinControl is TCustomBitBtn then Exit(TGtk2PrivateButton);
if AWinControl is TCustomTabControl then Exit(TGtk2PrivateNotebook);
if AWinControl is TCustomButton then Exit(TGtk2PrivateButton);
if AWinControl is TCustomMemo then Exit(TGtkPrivateScrolling);
if AWinControl is TCustomEdit then Exit(TGtkPrivateEntry);
if AWinControl is TCustomListBox then Exit(TGtk2PrivateList);
if AWinControl is TWinControl then Exit(TGtkPrivateWidget);
Result := nil;
end;
{ TGtkPrivateScrolling }
{ temp class to keep things working }