From 0470b902b2cdbe1c83545b106e9971d753bfc780 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 13 May 2006 08:21:59 +0000 Subject: [PATCH] gtk2 intf: added createhandle for TEdit from Darek git-svn-id: trunk@9262 - --- lcl/interfaces/gtk2/gtk2wsextctrls.pp | 13 +++++++------ lcl/interfaces/gtk2/gtk2wsstdctrls.pp | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2wsextctrls.pp b/lcl/interfaces/gtk2/gtk2wsextctrls.pp index 11f326cc35..d13d7f1117 100644 --- a/lcl/interfaces/gtk2/gtk2wsextctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wsextctrls.pp @@ -28,7 +28,7 @@ interface uses // libs - GLib2, Gtk2, Gdk2, Gdk2pixbuf, + GLib2, Gtk2, Gdk2, Gtk2Int,gtkProc,GtkDef, // LCL ExtCtrls, Classes, Controls, LCLType, // widgetset @@ -152,7 +152,7 @@ type { TGtk2WSCheckGroup } - TGtk2WSCheckGroup = class(TWSCheckGroup) + TGtk2WSCheckGroup = class(TGtkWSCheckGroup) private protected public @@ -176,7 +176,7 @@ type { TGtk2WSLabeledEdit } - TGtk2WSLabeledEdit = class(TWSLabeledEdit) + TGtk2WSLabeledEdit = class(TGtkWSLabeledEdit) private protected public @@ -184,7 +184,7 @@ type { TGtk2WSCustomPanel } - TGtk2WSCustomPanel = class(TWSCustomPanel) + TGtk2WSCustomPanel = class(TGtkWSCustomPanel) private protected public @@ -192,7 +192,7 @@ type { TGtk2WSPanel } - TGtk2WSPanel = class(TWSPanel) + TGtk2WSPanel = class(TGtkWSPanel) private protected public @@ -240,6 +240,7 @@ begin Result := HWND(P); end; + initialization //////////////////////////////////////////////////// @@ -269,4 +270,4 @@ initialization // RegisterWSComponent(TCustomPanel, TGtk2WSCustomPanel); // RegisterWSComponent(TPanel, TGtk2WSPanel); //////////////////////////////////////////////////// -end. \ No newline at end of file +end. diff --git a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp index 7685c34f76..e323f7853a 100644 --- a/lcl/interfaces/gtk2/gtk2wsstdctrls.pp +++ b/lcl/interfaces/gtk2/gtk2wsstdctrls.pp @@ -119,6 +119,7 @@ type private protected public + class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override; class function GetSelStart(const ACustomEdit: TCustomEdit): integer; override; class function GetSelLength(const ACustomEdit: TCustomEdit): integer; override; end; @@ -569,6 +570,27 @@ end; { TGtk2WSCustomEdit } +function TGtk2WSCustomEdit.CreateHandle(const AWinControl: TWinControl; + const AParams: TCreateParams): TLCLIntfHandle; +var + + p: PGtkWidget; // ptr to the newly created GtkWidget + SetupProps : boolean; + + +begin + SetupProps := false; + p := gtk_entry_new(); + gtk_editable_set_editable (PGtkEditable(P), not TCustomEdit(AWinControl).ReadOnly); + gtk_widget_show_all(P); + Result := TLCLIntfHandle(P); + if result = 0 then exit; + gtk2WidgetSet.FinishComponentCreate(AWinControl, P, SetupProps); + + +end; + + function TGtk2WSCustomEdit.GetSelStart(const ACustomEdit: TCustomEdit ): integer; var