diff --git a/lcl/include/intfbaselcl.inc b/lcl/include/intfbaselcl.inc index 8ba7c9e583..812be43140 100644 --- a/lcl/include/intfbaselcl.inc +++ b/lcl/include/intfbaselcl.inc @@ -584,8 +584,7 @@ begin Result := false; end; -function TWidgetSet.RightJustifyMenuItem(HndMenu: HMenu; - bRightJustify: boolean): Boolean; +function TWidgetSet.RightJustifyMenuItem(AMenuItem: TComponent): Boolean; begin Result := False; end; @@ -627,6 +626,9 @@ end; { ============================================================================= $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 move GetNotebookTabIndexAtPos to the widgetset interface implement it for win32 widgetset (fixes bug 669) diff --git a/lcl/include/lclintf.inc b/lcl/include/lclintf.inc index 2f9b7c113c..8d737485f5 100644 --- a/lcl/include/lclintf.inc +++ b/lcl/include/lclintf.inc @@ -404,10 +404,9 @@ begin Result := InterfaceObject.RequestInput(InputCaption, InputPrompt, MaskInput, Value); end; -function RightJustifyMenuItem(HndMenu: HMenu; - bRightJustify: boolean): boolean; +function RightJustifyMenuItem(AMenuItem: TComponent): boolean; begin - Result := InterfaceObject.RightJustifyMenuItem(hndMenu, bRightJustify); + Result := InterfaceObject.RightJustifyMenuItem(AMenuItem); end; procedure SendCachedLCLMessages; @@ -526,6 +525,9 @@ end; { ============================================================================= $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 move GetNotebookTabIndexAtPos to the widgetset interface implement it for win32 widgetset (fixes bug 669) diff --git a/lcl/include/lclintfh.inc b/lcl/include/lclintfh.inc index 00f4676d6b..538d2fbb33 100644 --- a/lcl/include/lclintfh.inc +++ b/lcl/include/lclintfh.inc @@ -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 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 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} function DrawSplitter(DC: HDC; const ARect: TRect; Horizontal: boolean): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} @@ -150,6 +150,9 @@ procedure RaiseLastOSError; { ============================================================================= $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 move GetNotebookTabIndexAtPos to the widgetset interface implement it for win32 widgetset (fixes bug 669) diff --git a/lcl/include/menuitem.inc b/lcl/include/menuitem.inc index 4ef27da35e..755a88702c 100644 --- a/lcl/include/menuitem.inc +++ b/lcl/include/menuitem.inc @@ -965,7 +965,7 @@ begin if FRightJustify=AValue then exit; FRightJustify:=AValue; if HandleAllocated then - RightJustifyMenuItem(Handle,RightJustify); + RightJustifyMenuItem(Self); end; {------------------------------------------------------------------------------ @@ -1210,6 +1210,9 @@ end; { ============================================================================= $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 fix spelling @@ -1438,6 +1441,9 @@ end; $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 fix spelling diff --git a/lcl/interfaces/carbon/carbonlclintf.inc b/lcl/interfaces/carbon/carbonlclintf.inc index 961c549247..ee78e60554 100644 --- a/lcl/interfaces/carbon/carbonlclintf.inc +++ b/lcl/interfaces/carbon/carbonlclintf.inc @@ -90,6 +90,11 @@ begin Result:=inherited MenuItemSetEnable(BaseMenuItem); end; +function TCarbonWidgetSet.RightJustifyMenuItem(BaseMenuItem: TComponent): Boolean; +begin + Result:=inherited RightJustifyMenuItem(BaseMenuItem); +end; + function TCarbonWidgetSet.ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; begin @@ -119,6 +124,9 @@ end; { ============================================================================= $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 + Added RemoveProp winapi call * Some maintenace on winapi/lclintf files diff --git a/lcl/interfaces/carbon/carbonlclintfh.inc b/lcl/interfaces/carbon/carbonlclintfh.inc index 6c3aa91f16..80dc9eea4b 100644 --- a/lcl/interfaces/carbon/carbonlclintfh.inc +++ b/lcl/interfaces/carbon/carbonlclintfh.inc @@ -44,6 +44,7 @@ function IntfSendsUTF8KeyPress: boolean; override; function MenuItemSetCheck(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; @@ -57,6 +58,9 @@ procedure StatusBarUpdate(StatusBar: TObject); override; { ============================================================================= $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 + Added RemoveProp winapi call * Some maintenace on winapi/lclintf files diff --git a/lcl/interfaces/carbon/carbonwinapi.inc b/lcl/interfaces/carbon/carbonwinapi.inc index 9ec1010d72..a6831824a4 100644 --- a/lcl/interfaces/carbon/carbonwinapi.inc +++ b/lcl/interfaces/carbon/carbonwinapi.inc @@ -725,12 +725,6 @@ begin Result:=inherited RestoreDC(DC, SavedDC); 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, RY: Integer): Boolean; begin @@ -926,6 +920,9 @@ end; { ============================================================================= $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 fixed Arc and changed x,y to Left,Top to make meaning more clear diff --git a/lcl/interfaces/carbon/carbonwinapih.inc b/lcl/interfaces/carbon/carbonwinapih.inc index c3dfabac68..263c415d86 100644 --- a/lcl/interfaces/carbon/carbonwinapih.inc +++ b/lcl/interfaces/carbon/carbonwinapih.inc @@ -170,7 +170,6 @@ function RegroupMenuItem(hndMenu: HMENU; GroupIndex: integer): Boolean; override function ReleaseCapture : Boolean; override; function ReleaseDC(hWnd: HWND; DC: HDC): Integer; 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 SaveDC(DC: HDC): Integer; override; @@ -215,6 +214,9 @@ function WindowFromPoint(Point : TPoint) : HWND; override; { ============================================================================= $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 fixed Arc and changed x,y to Left,Top to make meaning more clear diff --git a/lcl/interfaces/gtk/gtklclintf.inc b/lcl/interfaces/gtk/gtklclintf.inc index 51d4bbc0aa..0ef3ae19c5 100644 --- a/lcl/interfaces/gtk/gtklclintf.inc +++ b/lcl/interfaces/gtk/gtklclintf.inc @@ -408,6 +408,25 @@ begin Result := True; 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 Params: Image The HBitmap of the image @@ -468,6 +487,9 @@ end; { ============================================================================= $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 move GetNotebookTabIndexAtPos to the widgetset interface implement it for win32 widgetset (fixes bug 669) diff --git a/lcl/interfaces/gtk/gtklclintfh.inc b/lcl/interfaces/gtk/gtklclintfh.inc index c8aaf38bdd..e13cff89ea 100644 --- a/lcl/interfaces/gtk/gtklclintfh.inc +++ b/lcl/interfaces/gtk/gtklclintfh.inc @@ -46,6 +46,7 @@ function IntfSendsUTF8KeyPress: boolean; override; function MenuItemSetCheck(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; @@ -54,6 +55,9 @@ function ReplaceBitmapMask(var Image, Mask: HBitmap; NewMask: HBitmap): boolean; { ============================================================================= $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 move GetNotebookTabIndexAtPos to the widgetset interface implement it for win32 widgetset (fixes bug 669) diff --git a/lcl/interfaces/gtk/gtkwinapi.inc b/lcl/interfaces/gtk/gtkwinapi.inc index 73fcf2b82d..91eabcd95e 100644 --- a/lcl/interfaces/gtk/gtkwinapi.inc +++ b/lcl/interfaces/gtk/gtkwinapi.inc @@ -7196,24 +7196,6 @@ begin Assert(False, Format('Trace:< [TGtkWidgetSet.RestoreDC] DC:0x%x, Saved: %d --> %s', [Integer(DC), SavedDC, BOOL_TEXT[Result]])); 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 Params: X1, Y1, X2, Y2, RX, RY @@ -9005,6 +8987,9 @@ end; { ============================================================================= $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 fixed retrieving TCanvas.Width/Height diff --git a/lcl/interfaces/gtk/gtkwinapih.inc b/lcl/interfaces/gtk/gtkwinapih.inc index caf4c03b8e..9a0f243010 100644 --- a/lcl/interfaces/gtk/gtkwinapih.inc +++ b/lcl/interfaces/gtk/gtkwinapih.inc @@ -168,7 +168,6 @@ Function ReleaseCapture : Boolean; override; function ReleaseDC(hWnd: HWND; DC: HDC): Integer; override; function RemoveProp(Handle: hwnd; Str: PChar): THandle; 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 SaveDC(DC: HDC): Integer; override; @@ -217,6 +216,9 @@ Function WindowFromPoint(Point : TPoint) : HWND; override; { ============================================================================= $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 fixed Arc and changed x,y to Left,Top to make meaning more clear diff --git a/lcl/interfaces/win32/win32lclintf.inc b/lcl/interfaces/win32/win32lclintf.inc index 83219526de..8e18dec19b 100644 --- a/lcl/interfaces/win32/win32lclintf.inc +++ b/lcl/interfaces/win32/win32lclintf.inc @@ -192,11 +192,38 @@ Begin Result := Boolean(Windows.EnableMenuItem(AMenuItem.Parent.Handle, AMenuItem.Command, EnableFlag)); 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 { ============================================================================= $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 hack: avoid drawing border of scrollbar arrow, by drawing it outside of clipped region diff --git a/lcl/interfaces/win32/win32lclintfh.inc b/lcl/interfaces/win32/win32lclintfh.inc index 1594f3d23a..0e3028f56c 100644 --- a/lcl/interfaces/win32/win32lclintfh.inc +++ b/lcl/interfaces/win32/win32lclintfh.inc @@ -37,12 +37,16 @@ function GetListBoxIndexAtY(ListBox: TComponent; y: integer): integer; override; function MenuItemSetCheck(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 { ============================================================================= $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 + Added RemoveProp winapi call * Some maintenace on winapi/lclintf files diff --git a/lcl/interfaces/win32/win32wsmenus.pp b/lcl/interfaces/win32/win32wsmenus.pp index e63ee30d2b..75b0c60735 100644 --- a/lcl/interfaces/win32/win32wsmenus.pp +++ b/lcl/interfaces/win32/win32wsmenus.pp @@ -238,6 +238,7 @@ begin dwTypeData:=nil; cch:=0; end; + if AMenuItem.RightJustify then fType := fType or MFT_RIGHTJUSTIFY; if AmenuItem.HasIcon then {adds the menuitem icon} begin fMask:=fMask or MIIM_CHECKMARKS;