lcl: gtk1: fixed compile

git-svn-id: trunk@60773 -
This commit is contained in:
mattias 2019-03-26 13:11:34 +00:00
parent 3b972346b3
commit 6d813c4d01
8 changed files with 23 additions and 31 deletions

View File

@ -1537,7 +1537,7 @@ begin
// send the message directly to the LCL // send the message directly to the LCL
NotifyApplicationUserInput(AWinControl, MessE.Msg); NotifyApplicationUserInput(AWinControl, MessE.Msg);
DeliverMessage(AWinControl, MessE); DeliverMessage(AWinControl, MessE);
end end;
if event^.Button in [6, 7] then if event^.Button in [6, 7] then
begin begin
// this is a mouse wheel horizontal-scroll event // this is a mouse wheel horizontal-scroll event

View File

@ -47,7 +47,7 @@ uses
// rtl+fcl // rtl+fcl
Types, Classes, SysUtils, Types, Classes, SysUtils,
// LazUtils // LazUtils
FPCAdds, FPCAdds, LazUTF8,
// gtk // gtk
{$IFDEF gtk2} {$IFDEF gtk2}
glib2, gdk2pixbuf, gdk2, gtk2, Pango, gtk2proc, glib2, gdk2pixbuf, gdk2, gtk2, Pango, gtk2proc,
@ -66,7 +66,7 @@ uses
LCLPlatformDef, InterfaceBase, LCLPlatformDef, InterfaceBase,
FileUtil, Translations, ExtDlgs, Dialogs, Controls, Forms, LCLStrConsts, FileUtil, Translations, ExtDlgs, Dialogs, Controls, Forms, LCLStrConsts,
LMessages, LCLProc, LCLIntf, LCLType, DynHashArray, GraphType, GraphMath, LMessages, LCLProc, LCLIntf, LCLType, DynHashArray, GraphType, GraphMath,
Graphics, Menus, Maps, Themes, Graphics, Menus, Maps, LazLoggerBase, LazFileUtils, LazStringUtils, Themes,
// widgetset // widgetset
GtkDebug, GtkFontCache, gtkDef, GtkProc, gtkMsgQueue, GtkExtra, WSLCLClasses; GtkDebug, GtkFontCache, gtkDef, GtkProc, gtkMsgQueue, GtkExtra, WSLCLClasses;

View File

@ -4491,6 +4491,8 @@ var
begin begin
{$IfDef GTK1} {$IfDef GTK1}
//debugln('UpdateTabCloseBtn ',GetWidgetDebugReport(NoteBookWidget)); //debugln('UpdateTabCloseBtn ',GetWidgetDebugReport(NoteBookWidget));
Img:=nil;
Mask:=nil;
GetNoteBookCloseBtnImage(GetControlWindow(NoteBookWidget), Img, Mask); GetNoteBookCloseBtnImage(GetControlWindow(NoteBookWidget), Img, Mask);
{$EndIf} {$EndIf}
//debugln('UpdateTabCloseBtn ',dbgs(nboShowCloseButtons in TheNotebook.Options),' ',dbgs(Img<>nil)); //debugln('UpdateTabCloseBtn ',dbgs(nboShowCloseButtons in TheNotebook.Options),' ',dbgs(Img<>nil));
@ -5004,7 +5006,7 @@ var
begin begin
Handler := gtk_object_get_data_by_id (AnObject, gtk_handler_quark); Handler := gtk_object_get_data_by_id (AnObject, gtk_handler_quark);
SignalID := g_signal_lookup(ASignal, GTK_OBJECT_TYPE(AnObject)); SignalID := g_signal_lookup(ASignal, GTK_OBJECT_TYPE(AnObject));
if (SignalID<0) or (SignalID>$ffffff) then if SignalID>$ffffff then
RaiseGDBException('SignalConnected'); RaiseGDBException('SignalConnected');
while (Handler <> nil) do begin while (Handler <> nil) do begin
@ -5905,7 +5907,7 @@ begin
OldCheckMenuItemDrawProc(MenuItem,Area); OldCheckMenuItemDrawProc(MenuItem,Area);
exit; exit;
end; end;
IconSize:=LCLMenuItem.GetIconSize; IconSize:=LCLMenuItem.GetIconSize(0);
IconWidth:=IconSize.X; IconWidth:=IconSize.X;
IconHeight:=IconSize.Y; IconHeight:=IconSize.Y;
@ -5998,7 +6000,7 @@ begin
CurToggleSize:=OldCheckMenuItemToggleSize; CurToggleSize:=OldCheckMenuItemToggleSize;
LCLMenuItem:=TMenuItem(GetLCLObject(MenuItem)); LCLMenuItem:=TMenuItem(GetLCLObject(MenuItem));
if LCLMenuItem<>nil then begin if LCLMenuItem<>nil then begin
IconSize:=LCLMenuItem.GetIconSize; IconSize:=LCLMenuItem.GetIconSize(0);
{if IconSize.X>100 then {if IconSize.X>100 then
debugln('MenuSizeRequest LCLMenuItem=',LCLMenuItem.Name,' ',LCLMenuItem.Caption, debugln('MenuSizeRequest LCLMenuItem=',LCLMenuItem.Name,' ',LCLMenuItem.Caption,
' ');} ' ');}
@ -6124,7 +6126,7 @@ var
if LCLMenuItem.HasIcon then if LCLMenuItem.HasIcon then
begin begin
{$IFNDEF Gtk2} {$IFNDEF Gtk2}
IconSize := LCLMenuItem.GetIconSize; IconSize := LCLMenuItem.GetIconSize(0);
IconWidth := IconSize.X; IconWidth := IconSize.X;
IconHeight := IconSize.Y; IconHeight := IconSize.Y;
// set the toggle width // set the toggle width

View File

@ -47,10 +47,10 @@ uses
glib, gdk, gtk, gdkpixbuf, glib, gdk, gtk, gdkpixbuf,
{$ENDIF} {$ENDIF}
Math, // Math after gtk to get the correct Float type Math, // Math after gtk to get the correct Float type
LMessages, LCLMessageGlue, LCLProc, LCLStrConsts, LCLIntf, LCLType, LazUTF8, LMessages, LCLMessageGlue, LCLProc, LCLStrConsts, LCLIntf, LCLType,
DynHashArray, Masks, GraphType, GraphMath, Graphics, Controls, DynHashArray, Masks, GraphType, GraphMath, Graphics, Controls, Forms, Menus,
Forms, Menus, StdCtrls, ComCtrls, ExtCtrls, Dialogs, ExtDlgs, StdCtrls, ComCtrls, ExtCtrls, Dialogs, ExtDlgs, FileUtil, LazFileUtils,
FileUtil, ImgList, GtkFontCache, GTKGlobals, GtkDef, GtkExtra, GtkDebug; ImgList, GtkFontCache, GTKGlobals, GtkDef, GtkExtra, GtkDebug;
const const
GtkListItemGtkListTag = 'GtkList'; GtkListItemGtkListTag = 'GtkList';

View File

@ -28,7 +28,7 @@ uses
GLib, Gtk, gdk, gdkPixbuf, Gtk1WSPrivate, GLib, Gtk, gdk, gdkPixbuf, Gtk1WSPrivate,
{$ENDIF} {$ENDIF}
// LCL // LCL
Classes, LCLType, Controls, Graphics, GraphType, Buttons, Classes, LCLType, Controls, Graphics, GraphType, Buttons, ImgList,
// widgetset // widgetset
WSButtons, WSProc, WSButtons, WSProc,
// interface // interface
@ -287,8 +287,10 @@ var
Pixbuf: PGdkPixbuf; Pixbuf: PGdkPixbuf;
Mask: PGdkBitmap; Mask: PGdkBitmap;
AGlyph: TBitmap; AGlyph: TBitmap;
AIndex: Integer; AIndex, aPPI: Integer;
AEffect: TGraphicsDrawEffect; AEffect: TGraphicsDrawEffect;
aCanvasScaleFactor: Double;
ImgResolution: TScaledImageListResolution;
begin begin
WidgetInfo := GetWidgetInfo(Pointer(ABitBtn.Handle)); WidgetInfo := GetWidgetInfo(Pointer(ABitBtn.Handle));
BitBtnInfo := WidgetInfo^.UserData; BitBtnInfo := WidgetInfo^.UserData;
@ -296,7 +298,8 @@ begin
if ABitBtn.CanShowGlyph then if ABitBtn.CanShowGlyph then
begin begin
AGlyph := TBitmap.Create; AGlyph := TBitmap.Create;
AValue.GetImageIndexAndEffect(AButtonState, AIndex, AEffect); AValue.GetImageIndexAndEffect(AButtonState, aPPI, aCanvasScaleFactor,
ImgResolution, AIndex, AEffect);
if (AIndex <> -1) and (AValue.Images <> nil) then if (AIndex <> -1) and (AValue.Images <> nil) then
AValue.Images.GetBitmap(AIndex, AGlyph, AEffect); AValue.Images.GetBitmap(AIndex, AGlyph, AEffect);
end end

View File

@ -26,11 +26,9 @@ uses
{$else} {$else}
Gtk, gdk, Glib, Gtk, gdk, Glib,
{$endif} {$endif}
SysUtils, Classes, SysUtils, Classes, Controls, Graphics, Dialogs, ExtDlgs, LCLType, LMessages,
Controls, Graphics, Dialogs, ExtDlgs, InterfaceBase, LCLStrConsts, LCLProc, FileUtil, LazFileUtils, WSDialogs,
LCLType, LMessages, InterfaceBase, LCLStrConsts, LCLProc, FileUtil, WSLCLClasses, GtkInt, GtkProc, GtkWSControls, GtkExtra, GtkDef, GtkGlobals;
WSDialogs, WSLCLClasses,
GtkInt, GtkProc, GtkWSControls, GtkExtra, GtkDef, GtkGlobals;
type type

View File

@ -27,7 +27,7 @@ type
{ TGtkWSCustomImageList } { TGtkWSCustomImageList }
TGtkWSCustomImageList = class(TWSCustomImageList) TGtkWSCustomImageListResolution = class(TWSCustomImageListResolution)
published published
end; end;

View File

@ -92,7 +92,6 @@ type
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override; class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override; class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
class procedure SetText(const AWinControl: TWinControl; const AText: String); override; class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
class function GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override; class function GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override; class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
@ -1214,16 +1213,6 @@ begin
end; end;
end; end;
class procedure TGtkWSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox;
NewReadOnly: boolean);
var
Widget: PGtkWidget;
begin
Widget := PGtkCombo(ACustomComboBox.Handle)^.entry;
if GtkWidgetIsA(Widget, GTK_TYPE_ENTRY) then
gtk_entry_set_editable(PGtkEntry(Widget), not NewReadOnly);
end;
class function TGtkWSCustomComboBox.GetItems( class function TGtkWSCustomComboBox.GetItems(
const ACustomComboBox: TCustomComboBox): TStrings; const ACustomComboBox: TCustomComboBox): TStrings;
begin begin