gtk2: implement BorderStyle setting for GtkEntry (TEdit)

git-svn-id: trunk@19038 -
This commit is contained in:
paul 2009-03-20 04:19:23 +00:00
parent 6efd1ca34f
commit 8ed5064c16
2 changed files with 13 additions and 0 deletions

View File

@ -318,6 +318,9 @@ begin
Widget := PGtkWidget(AWinControl.Handle);
if GTK_IS_SCROLLED_WINDOW(Widget) then
gtk_scrolled_window_set_shadow_type(PGtkScrolledWindow(Widget), BorderStyleShadowMap[ABorderStyle])
else
if GTK_IS_ENTRY(Widget) then
gtk_entry_set_has_frame(PGtkEntry(Widget), ABorderStyle <> bsNone)
else
TGtkWSWinControl{(ClassParent)}.SetBorderStyle(AWinControl, ABorderStyle);
end;

View File

@ -172,6 +172,7 @@ type
TGtk2WSCustomEdit = class(TGtkWSCustomEdit)
published
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;
class procedure SetEchoMode(const ACustomEdit: TCustomEdit; NewMode: TEchoMode); override;
@ -851,6 +852,15 @@ end;
{ TGtk2WSCustomEdit }
class function TGtk2WSCustomEdit.CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle;
begin
Result := TGtkWSCustomEdit{(ClassParent)}.CreateHandle(AWinControl, AParams);
if Result <> 0 then
gtk_entry_set_has_frame(PGtkEntry(Result),
TCustomEdit(AWinControl).BorderStyle <> bsNone);
end;
class function TGtk2WSCustomEdit.GetSelStart(const ACustomEdit: TCustomEdit
): integer;
var