mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 16:16:00 +02:00
fixed changing menuitem separator and normal
git-svn-id: trunk@2412 -
This commit is contained in:
parent
27c1fa5151
commit
d8fa211334
@ -2539,21 +2539,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
procedure SetMenuItemLabelText(LCLMenuItem: TMenuItem;
|
procedure UpdateInnerMenuItem(LCLMenuItem: TMenuItem;
|
||||||
MenuItemWidget: PGtkWidget);
|
MenuItemWidget: PGtkWidget);
|
||||||
|
|
||||||
Sets the caption of a menuitem
|
Update the inner widgets of a menuitem widget.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure SetMenuItemLabelText(LCLMenuItem: TMenuItem;
|
procedure UpdateInnerMenuItem(LCLMenuItem: TMenuItem;
|
||||||
MenuItemWidget: PGtkWidget);
|
MenuItemWidget: PGtkWidget);
|
||||||
var
|
var
|
||||||
|
HBoxWidget: PGtkWidget;
|
||||||
|
LabelWidget: PGtkAccelLabel;
|
||||||
|
|
||||||
|
procedure SetMenuItemLabelText(LCLMenuItem: TMenuItem;
|
||||||
|
MenuItemWidget: PGtkWidget);
|
||||||
|
var
|
||||||
ShortCutPos: integer;
|
ShortCutPos: integer;
|
||||||
s: string;
|
s: string;
|
||||||
LabelWidget: PGtkLabel;
|
LabelWidget: PGtkLabel;
|
||||||
begin
|
begin
|
||||||
if (MenuItemWidget=nil) or (LCLMenuItem=nil) then exit;
|
if (MenuItemWidget=nil) or (LCLMenuItem=nil) then exit;
|
||||||
LabelWidget:=gtk_object_get_data(PGtkObject(MenuItemWidget), 'LCLLabel');
|
LabelWidget:=gtk_object_get_data(PGtkObject(MenuItemWidget), 'LCLLabel');
|
||||||
if LabelWidget=nil then exit;
|
if LabelWidget=nil then begin
|
||||||
|
end;
|
||||||
//Check for a shortcut key
|
//Check for a shortcut key
|
||||||
s:=LCLMenuItem.Caption;
|
s:=LCLMenuItem.Caption;
|
||||||
ShortCutPos := pos('&', s);
|
ShortCutPos := pos('&', s);
|
||||||
@ -2583,19 +2590,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
gtk_label_set_text(LabelWidget,PChar(s));
|
gtk_label_set_text(LabelWidget,PChar(s));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
|
||||||
procedure CreateInnerMenuItem(LCLMenuItem: TMenuItem;
|
|
||||||
MenuItemWidget: PGtkWidget);
|
|
||||||
|
|
||||||
Creates the inner widgets of a menuitem widget.
|
|
||||||
------------------------------------------------------------------------------}
|
|
||||||
procedure CreateInnerMenuItem(LCLMenuItem: TMenuItem;
|
|
||||||
MenuItemWidget: PGtkWidget);
|
|
||||||
var
|
|
||||||
HBoxWidget: PGtkWidget;
|
|
||||||
LabelWidget: PGtkAccelLabel;
|
|
||||||
|
|
||||||
procedure CreateIcon;
|
procedure CreateIcon;
|
||||||
var
|
var
|
||||||
@ -2707,7 +2702,7 @@ begin
|
|||||||
gtk_menu_item_right_justify(PGtkMenuItem(MenuItemWidget));
|
gtk_menu_item_right_justify(PGtkMenuItem(MenuItemWidget));
|
||||||
|
|
||||||
// create the hbox containing the label and the control
|
// create the hbox containing the label and the control
|
||||||
CreateInnerMenuItem(LCLMenuItem,MenuItemWidget);
|
UpdateInnerMenuItem(LCLMenuItem,MenuItemWidget);
|
||||||
|
|
||||||
gtk_widget_show(MenuItemWidget);
|
gtk_widget_show(MenuItemWidget);
|
||||||
Result:=MenuItemWidget;
|
Result:=MenuItemWidget;
|
||||||
@ -3241,7 +3236,7 @@ var
|
|||||||
TempWidget,
|
TempWidget,
|
||||||
TempWidget2 : Pointer;
|
TempWidget2 : Pointer;
|
||||||
begin
|
begin
|
||||||
// Create the VBox, we need that to place controls outside
|
// Create the VBox. We need that to place controls outside
|
||||||
// the client area (like menu and the statusbar)
|
// the client area (like menu and the statusbar)
|
||||||
Result := gtk_vbox_new(False, 0);
|
Result := gtk_vbox_new(False, 0);
|
||||||
If FormWidget = nil then
|
If FormWidget = nil then
|
||||||
@ -4068,6 +4063,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.171 2003/05/01 11:44:03 mattias
|
||||||
|
fixed changing menuitem separator and normal
|
||||||
|
|
||||||
Revision 1.170 2003/04/26 10:45:34 mattias
|
Revision 1.170 2003/04/26 10:45:34 mattias
|
||||||
fixed right control release
|
fixed right control release
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user