implemented right justification for menuitems for winapi intf from Martin Smat

git-svn-id: trunk@7191 -
This commit is contained in:
mattias 2005-05-21 15:58:44 +00:00
parent 68a7c67548
commit b2ba0f4418
15 changed files with 102 additions and 33 deletions

View File

@ -584,8 +584,7 @@ begin
Result := false; Result := false;
end; end;
function TWidgetSet.RightJustifyMenuItem(HndMenu: HMenu; function TWidgetSet.RightJustifyMenuItem(AMenuItem: TComponent): Boolean;
bRightJustify: boolean): Boolean;
begin begin
Result := False; Result := False;
end; end;
@ -627,6 +626,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.35 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.34 2005/03/31 21:29:45 micha Revision 1.34 2005/03/31 21:29:45 micha
move GetNotebookTabIndexAtPos to the widgetset interface move GetNotebookTabIndexAtPos to the widgetset interface
implement it for win32 widgetset (fixes bug 669) implement it for win32 widgetset (fixes bug 669)

View File

@ -404,10 +404,9 @@ begin
Result := InterfaceObject.RequestInput(InputCaption, InputPrompt, MaskInput, Value); Result := InterfaceObject.RequestInput(InputCaption, InputPrompt, MaskInput, Value);
end; end;
function RightJustifyMenuItem(HndMenu: HMenu; function RightJustifyMenuItem(AMenuItem: TComponent): boolean;
bRightJustify: boolean): boolean;
begin begin
Result := InterfaceObject.RightJustifyMenuItem(hndMenu, bRightJustify); Result := InterfaceObject.RightJustifyMenuItem(AMenuItem);
end; end;
procedure SendCachedLCLMessages; procedure SendCachedLCLMessages;
@ -526,6 +525,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.30 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.29 2005/03/31 21:29:45 micha Revision 1.29 2005/03/31 21:29:45 micha
move GetNotebookTabIndexAtPos to the widgetset interface move GetNotebookTabIndexAtPos to the widgetset interface
implement it for win32 widgetset (fixes bug 669) implement it for win32 widgetset (fixes bug 669)

View File

@ -108,7 +108,7 @@ function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean; {$IFDEF
function ReleaseDesignerDC(hWnd: HWND; DC: HDC): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function ReleaseDesignerDC(hWnd: HWND; DC: HDC): Integer; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function RequestInput(const InputCaption, InputPrompt : String; MaskInput : Boolean; var Value : String) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function RequestInput(const InputCaption, InputPrompt : String; MaskInput : Boolean; var Value : String) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function RightJustifyMenuItem(HndMenu: HMenu; bRightJustify: boolean): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function RightJustifyMenuItem(AMenuItem: TComponent): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
procedure SendCachedLCLMessages; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} procedure SendCachedLCLMessages; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function DrawSplitter(DC: HDC; const ARect: TRect; Horizontal: boolean): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function DrawSplitter(DC: HDC; const ARect: TRect; Horizontal: boolean): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
@ -150,6 +150,9 @@ procedure RaiseLastOSError;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.30 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.29 2005/03/31 21:29:45 micha Revision 1.29 2005/03/31 21:29:45 micha
move GetNotebookTabIndexAtPos to the widgetset interface move GetNotebookTabIndexAtPos to the widgetset interface
implement it for win32 widgetset (fixes bug 669) implement it for win32 widgetset (fixes bug 669)

View File

@ -965,7 +965,7 @@ begin
if FRightJustify=AValue then exit; if FRightJustify=AValue then exit;
FRightJustify:=AValue; FRightJustify:=AValue;
if HandleAllocated then if HandleAllocated then
RightJustifyMenuItem(Handle,RightJustify); RightJustifyMenuItem(Self);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -1210,6 +1210,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.67 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.66 2005/05/06 07:52:58 micha Revision 1.66 2005/05/06 07:52:58 micha
fix spelling fix spelling
@ -1438,6 +1441,9 @@ end;
$Log$ $Log$
Revision 1.67 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.66 2005/05/06 07:52:58 micha Revision 1.66 2005/05/06 07:52:58 micha
fix spelling fix spelling

View File

@ -90,6 +90,11 @@ begin
Result:=inherited MenuItemSetEnable(BaseMenuItem); Result:=inherited MenuItemSetEnable(BaseMenuItem);
end; end;
function TCarbonWidgetSet.RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean;
begin
Result:=inherited RightJustifyMenuItem(BaseMenuItem);
end;
function TCarbonWidgetSet.ReplaceBitmapMask(var Image, Mask: HBitmap; function TCarbonWidgetSet.ReplaceBitmapMask(var Image, Mask: HBitmap;
NewMask: HBitmap): boolean; NewMask: HBitmap): boolean;
begin begin
@ -119,6 +124,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.3 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.2 2005/02/23 01:12:46 marc Revision 1.2 2005/02/23 01:12:46 marc
+ Added RemoveProp winapi call + Added RemoveProp winapi call
* Some maintenace on winapi/lclintf files * Some maintenace on winapi/lclintf files

View File

@ -44,6 +44,7 @@ function IntfSendsUTF8KeyPress: boolean; override;
function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override;
function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override;
function RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean; override;
function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; override; function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; override;
@ -57,6 +58,9 @@ procedure StatusBarUpdate(StatusBar: TObject); override;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.3 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.2 2005/02/23 01:12:46 marc Revision 1.2 2005/02/23 01:12:46 marc
+ Added RemoveProp winapi call + Added RemoveProp winapi call
* Some maintenace on winapi/lclintf files * Some maintenace on winapi/lclintf files

View File

@ -725,12 +725,6 @@ begin
Result:=inherited RestoreDC(DC, SavedDC); Result:=inherited RestoreDC(DC, SavedDC);
end; end;
function TCarbonWidgetSet.RightJustifyMenuItem(HndMenu: HMenu;
bRightJustify: boolean): Boolean;
begin
Result:=inherited RightJustifyMenuItem(HndMenu, bRightJustify);
end;
function TCarbonWidgetSet.RoundRect(DC: hDC; X1, Y1, X2, Y2: Integer; RX, function TCarbonWidgetSet.RoundRect(DC: hDC; X1, Y1, X2, Y2: Integer; RX,
RY: Integer): Boolean; RY: Integer): Boolean;
begin begin
@ -926,6 +920,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.4 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.3 2005/03/04 13:50:09 mattias Revision 1.3 2005/03/04 13:50:09 mattias
fixed Arc and changed x,y to Left,Top to make meaning more clear fixed Arc and changed x,y to Left,Top to make meaning more clear

View File

@ -170,7 +170,6 @@ function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean; override
function ReleaseCapture : Boolean; override; function ReleaseCapture : Boolean; override;
function ReleaseDC(hWnd: HWND; DC: HDC): Integer; override; function ReleaseDC(hWnd: HWND; DC: HDC): Integer; override;
function RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override; function RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override;
function RightJustifyMenuItem(HndMenu: HMenu; bRightJustify: boolean): Boolean; override;
function RoundRect(DC : hDC; X1, Y1, X2, Y2: Integer; RX,RY : Integer): Boolean; override; function RoundRect(DC : hDC; X1, Y1, X2, Y2: Integer; RX,RY : Integer): Boolean; override;
function SaveDC(DC: HDC): Integer; override; function SaveDC(DC: HDC): Integer; override;
@ -215,6 +214,9 @@ function WindowFromPoint(Point : TPoint) : HWND; override;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.4 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.3 2005/03/04 13:50:09 mattias Revision 1.3 2005/03/04 13:50:09 mattias
fixed Arc and changed x,y to Left,Top to make meaning more clear fixed Arc and changed x,y to Left,Top to make meaning more clear

View File

@ -408,6 +408,25 @@ begin
Result := True; Result := True;
end; end;
{------------------------------------------------------------------------------
Function: RightJustifyMenuItem
Params: HndMenu: HMenu; bRightJustify: boolean
Returns: true on success
Sets left or right justification of a menuitem
-------------------------------------------------------------------------------}
function TGtkWidgetSet.RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean;
var
AMenuItem: TMenuItem;
MenuItemWidget: PGtkMenuItem;
begin
AMenuItem:=BaseMenuItem as TMenuItem;
MenuItemWidget:=PGtkMenuItem(AMenuItem.Handle);
gtk_menu_item_set_right_justified(MenuItemWidget, AMenuItem.RightJustify);
gtk_widget_queue_resize(GTK_WIDGET(MenuItemWidget));
Result:=false;
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Procedure: ReplaceBitmapMask Procedure: ReplaceBitmapMask
Params: Image The HBitmap of the image Params: Image The HBitmap of the image
@ -468,6 +487,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.38 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.37 2005/03/31 21:29:45 micha Revision 1.37 2005/03/31 21:29:45 micha
move GetNotebookTabIndexAtPos to the widgetset interface move GetNotebookTabIndexAtPos to the widgetset interface
implement it for win32 widgetset (fixes bug 669) implement it for win32 widgetset (fixes bug 669)

View File

@ -46,6 +46,7 @@ function IntfSendsUTF8KeyPress: boolean; override;
function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override;
function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override;
function RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean; override;
function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; override; function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; override;
@ -54,6 +55,9 @@ function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.24 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.23 2005/03/31 21:29:45 micha Revision 1.23 2005/03/31 21:29:45 micha
move GetNotebookTabIndexAtPos to the widgetset interface move GetNotebookTabIndexAtPos to the widgetset interface
implement it for win32 widgetset (fixes bug 669) implement it for win32 widgetset (fixes bug 669)

View File

@ -7196,24 +7196,6 @@ begin
Assert(False, Format('Trace:< [TGtkWidgetSet.RestoreDC] DC:0x%x, Saved: %d --> %s', [Integer(DC), SavedDC, BOOL_TEXT[Result]])); Assert(False, Format('Trace:< [TGtkWidgetSet.RestoreDC] DC:0x%x, Saved: %d --> %s', [Integer(DC), SavedDC, BOOL_TEXT[Result]]));
end; end;
{------------------------------------------------------------------------------
Function: RightJustifyMenuItem
Params: HndMenu: HMenu; bRightJustify: boolean
Returns: true on success
Sets left or justification of a menuitem
-------------------------------------------------------------------------------}
function TGtkWidgetSet.RightJustifyMenuItem(HndMenu: HMenu;
bRightJustify: boolean): Boolean;
var
MenuItemWidget: PGtkMenuItem;
begin
MenuItemWidget:=PGtkMenuItem(HndMenu);
gtk_menu_item_set_right_justified(MenuItemWidget, bRightJustify);
gtk_widget_queue_resize(GTK_WIDGET(MenuItemWidget));
Result:=false;
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Method: RoundRect Method: RoundRect
Params: X1, Y1, X2, Y2, RX, RY Params: X1, Y1, X2, Y2, RX, RY
@ -9005,6 +8987,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.420 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.419 2005/05/18 09:12:21 mattias Revision 1.419 2005/05/18 09:12:21 mattias
fixed retrieving TCanvas.Width/Height fixed retrieving TCanvas.Width/Height

View File

@ -168,7 +168,6 @@ Function ReleaseCapture : Boolean; override;
function ReleaseDC(hWnd: HWND; DC: HDC): Integer; override; function ReleaseDC(hWnd: HWND; DC: HDC): Integer; override;
function RemoveProp(Handle: hwnd; Str: PChar): THandle; override; function RemoveProp(Handle: hwnd; Str: PChar): THandle; override;
function RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override; function RestoreDC(DC: HDC; SavedDC: Integer): Boolean; override;
function RightJustifyMenuItem(HndMenu: HMenu; bRightJustify: boolean): Boolean; override;
Function RoundRect(DC : hDC; X1, Y1, X2, Y2: Integer; RX,RY : Integer): Boolean; override; Function RoundRect(DC : hDC; X1, Y1, X2, Y2: Integer; RX,RY : Integer): Boolean; override;
function SaveDC(DC: HDC): Integer; override; function SaveDC(DC: HDC): Integer; override;
@ -217,6 +216,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.97 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.96 2005/03/04 13:50:09 mattias Revision 1.96 2005/03/04 13:50:09 mattias
fixed Arc and changed x,y to Left,Top to make meaning more clear fixed Arc and changed x,y to Left,Top to make meaning more clear

View File

@ -192,11 +192,38 @@ Begin
Result := Boolean(Windows.EnableMenuItem(AMenuItem.Parent.Handle, AMenuItem.Command, EnableFlag)); Result := Boolean(Windows.EnableMenuItem(AMenuItem.Parent.Handle, AMenuItem.Command, EnableFlag));
End; End;
{------------------------------------------------------------------------------
Function: RightJustifyMenuItem
Params: BaseMenuItem:
Returns:
Sets left or right justification of a menuitem
------------------------------------------------------------------------------}
function TWin32WidgetSet.RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean;
var
AMenuItem: TMenuItem;
MenuInfo: MENUITEMINFO;
begin
AMenuItem:=BaseMenuItem as TMenuItem;
MenuInfo.cbSize := sizeof(MenuInfo);
MenuInfo.fMask := MIIM_TYPE;
GetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, false, @MenuInfo);
if AMenuItem.RightJustify then MenuInfo.fType := MenuInfo.fType or MFT_RIGHTJUSTIFY
else MenuInfo.fType := MenuInfo.fType and (not MFT_RIGHTJUSTIFY);
MenuInfo.dwTypeData := LPSTR(AMenuItem.Caption);
Result := SetMenuItemInfo(AMenuItem.Parent.Handle, AMenuItem.Command, false, @MenuInfo);
DrawMenuBar(TWinControl(AMenuItem.Owner).Handle);
end;
//##apiwiz##eps## // Do not remove, no wizard declaration after this line //##apiwiz##eps## // Do not remove, no wizard declaration after this line
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.24 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.23 2005/05/05 20:53:37 micha Revision 1.23 2005/05/05 20:53:37 micha
hack: avoid drawing border of scrollbar arrow, by drawing it outside of clipped region hack: avoid drawing border of scrollbar arrow, by drawing it outside of clipped region

View File

@ -37,12 +37,16 @@ function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; override;
function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetCheck(BaseMenuItem: TComponent): Boolean; override;
function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override; function MenuItemSetEnable(BaseMenuItem: TComponent): Boolean; override;
function RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean; override;
//##apiwiz##eps## // Do not remove, no wizard declaration after this line //##apiwiz##eps## // Do not remove, no wizard declaration after this line
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.17 2005/05/21 15:58:44 mattias
implemented right justification for menuitems for winapi intf from Martin Smat
Revision 1.16 2005/02/23 01:12:47 marc Revision 1.16 2005/02/23 01:12:47 marc
+ Added RemoveProp winapi call + Added RemoveProp winapi call
* Some maintenace on winapi/lclintf files * Some maintenace on winapi/lclintf files

View File

@ -238,6 +238,7 @@ begin
dwTypeData:=nil; dwTypeData:=nil;
cch:=0; cch:=0;
end; end;
if AMenuItem.RightJustify then fType := fType or MFT_RIGHTJUSTIFY;
if AmenuItem.HasIcon then {adds the menuitem icon} if AmenuItem.HasIcon then {adds the menuitem icon}
begin begin
fMask:=fMask or MIIM_CHECKMARKS; fMask:=fMask or MIIM_CHECKMARKS;