mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 04:29:25 +02:00
LCL: Remove OldShortCut from SetShortCut parameters and add the real shortcut keys there.
git-svn-id: trunk@29872 -
This commit is contained in:
parent
f38190794b
commit
5d796b9cbb
@ -271,7 +271,6 @@ procedure TCustomButton.WSSetText(const AText: String);
|
||||
var
|
||||
ParseStr : String;
|
||||
AccelIndex : Longint;
|
||||
OldShortCut: TShortCut;
|
||||
begin
|
||||
if (not HandleAllocated) then
|
||||
exit;
|
||||
@ -281,9 +280,8 @@ begin
|
||||
AccelIndex := DeleteAmpersands(ParseStr);
|
||||
if AccelIndex > -1 then
|
||||
begin
|
||||
OldShortCut := FShortCut;
|
||||
FShortCut := Menus.ShortCut(Char2VK(ParseStr[AccelIndex]), [ssCtrl]);
|
||||
TWSButtonClass(WidgetSetClass).SetShortCut(Self, OldShortCut);
|
||||
TWSButtonClass(WidgetSetClass).SetShortCut(Self, FShortCut, FShortCutKey2);
|
||||
end;
|
||||
end;
|
||||
inherited WSSetText(AText);
|
||||
|
@ -206,7 +206,6 @@ procedure TCustomCheckBox.WSSetText(const AText: String);
|
||||
var
|
||||
ParseStr : String;
|
||||
AccelIndex : Longint;
|
||||
OldShortCut: TShortCut;
|
||||
begin
|
||||
if (not HandleAllocated) then
|
||||
exit;
|
||||
@ -216,9 +215,8 @@ begin
|
||||
AccelIndex := DeleteAmpersands(ParseStr);
|
||||
if AccelIndex > -1 then
|
||||
begin
|
||||
OldShortCut := FShortCut;
|
||||
FShortCut := Menus.ShortCut(Char2VK(ParseStr[AccelIndex]), [ssCtrl]);
|
||||
TWSCustomCheckBoxClass(WidgetSetClass).SetShortCut(Self, OldShortCut);
|
||||
TWSCustomCheckBoxClass(WidgetSetClass).SetShortCut(Self, FShortCut, FShortCutKey2);
|
||||
end;
|
||||
end;
|
||||
inherited WSSetText(AText);
|
||||
|
@ -136,7 +136,7 @@ begin
|
||||
if HandleAllocated then
|
||||
begin
|
||||
if ShortCut <> 0 then
|
||||
ShortCutChanged(0);
|
||||
ShortCutChanged;
|
||||
end;
|
||||
end;
|
||||
//DebugLn('TMenuItem.CreateHandle END ',Name,':',ClassName);
|
||||
@ -1314,14 +1314,11 @@ end;
|
||||
Set the ShortCut
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TMenuItem.SetShortCut(const AValue : TShortCut);
|
||||
var
|
||||
OldShortCut: TShortCut;
|
||||
Begin
|
||||
if FShortCut <> AValue then
|
||||
begin
|
||||
OldShortCut:=FShortCut;
|
||||
FShortCut := AValue;
|
||||
ShortCutChanged(OldShortCut);
|
||||
ShortCutChanged;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1330,8 +1327,7 @@ begin
|
||||
if FShortCutKey2 <> AValue then
|
||||
begin
|
||||
FShortCutKey2 := AValue;
|
||||
// ToDo: Remove the unused OldValue parameter if possible. It gets wrong value here.
|
||||
ShortCutChanged(FShortCut);
|
||||
ShortCutChanged;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1426,10 +1422,10 @@ end;
|
||||
|
||||
Installs a new shortCut, removes an old one.
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TMenuItem.ShortcutChanged(const OldValue: TShortcut);
|
||||
procedure TMenuItem.ShortcutChanged;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
TWSMenuItemClass(WidgetSetClass).SetShortCut(Self, OldValue);
|
||||
TWSMenuItemClass(WidgetSetClass).SetShortCut(Self, FShortCut, FShortCutKey2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -54,7 +54,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
@ -204,12 +204,12 @@ end;
|
||||
Sets the shortcut of menu item in Carbon interface
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TCarbonWSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
if not CheckMenuItem(AMenuItem, 'SetShortCut') then Exit;
|
||||
if not CheckMenuItem(AMenuItem.Parent, 'SetShortCut', 'Parent') then Exit;
|
||||
|
||||
TCarbonMenu(AMenuItem.Handle).SetShortCut(AMenuItem.ShortCut);
|
||||
TCarbonMenu(AMenuItem.Handle).SetShortCut(ShortCutK1);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
@ -221,7 +221,7 @@ end;
|
||||
Sets the shortcut of menu item in Cocoa interface
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TCocoaWSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
@ -46,7 +46,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
// class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut, NewShortCut: TShortCut); override;
|
||||
// class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
|
@ -46,7 +46,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
@ -232,12 +232,13 @@ begin
|
||||
AMenuItem.Enabled and (ACaption <> cLineCaption));
|
||||
end;
|
||||
|
||||
class procedure TGtkWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut);
|
||||
class procedure TGtkWSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
if not WSCheckMenuItem(AMenuItem, 'SetShortCut') then
|
||||
Exit;
|
||||
//DebugLn(['TGtkWSMenuItem.SetShortCut ',dbgsName(AMenuItem),' ',ShortCutToText(NewShortCut)]);
|
||||
UpdateInnerMenuItem(AMenuItem, PGTKWidget(AMenuItem.Handle));
|
||||
UpdateInnerMenuItem(AMenuItem, PGTKWidget(AMenuItem.Handle), ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
class procedure TGtkWSMenuItem.SetVisible(const AMenuItem: TMenuItem;
|
||||
|
@ -260,7 +260,7 @@ type
|
||||
class procedure SetColor(const AWinControl: TWinControl); override;
|
||||
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
|
||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const OldShortcut: TShortcut); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortcut); override;
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
{$endif Gtk1}
|
||||
end;
|
||||
@ -274,7 +274,7 @@ type
|
||||
{$IFDEF GTK1}
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACB: TCustomCheckBox; const ANewState: TCheckBoxState); override;
|
||||
class procedure GetPreferredSize(const AWinControl: TWinControl;
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
@ -1695,13 +1695,13 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TGtkWSButton.SetShortcut(const AButton: TCustomButton; const OldShortcut: TShortcut);
|
||||
class procedure TGtkWSButton.SetShortcut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortcut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AButton, 'SetShortcut')
|
||||
then Exit;
|
||||
|
||||
{$IFDEF Gtk1}
|
||||
Accelerate(AButton, PGtkWidget(AButton.Handle), AButton.ShortCut, 'clicked');
|
||||
Accelerate(AButton, PGtkWidget(AButton.Handle), ShortCutK1, 'clicked');
|
||||
{$ENDIF}
|
||||
// gtk2: shortcuts are handled by the LCL
|
||||
end;
|
||||
@ -1821,9 +1821,9 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomCheckBox.SetShortCut(
|
||||
const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut);
|
||||
const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
Accelerate(ACustomCheckBox, PGtkWidget(ACustomCheckBox.Handle), ACustomCheckBox.Shortcut,
|
||||
Accelerate(ACustomCheckBox, PGtkWidget(ACustomCheckBox.Handle), ShortCutK1,
|
||||
'activate_item');
|
||||
end;
|
||||
|
||||
|
@ -44,7 +44,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
@ -375,7 +375,7 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
//var
|
||||
//MenuWidget: PGtkMenuItem;
|
||||
//accel_path: String;
|
||||
@ -385,7 +385,7 @@ begin
|
||||
if not WSCheckMenuItem(AMenuItem, 'SetShortCut') then Exit;
|
||||
|
||||
// Temporary: At least it writes the names of the shortcuts
|
||||
UpdateInnerMenuItem(AMenuItem, PGTKWidget(AMenuItem.Handle));
|
||||
UpdateInnerMenuItem(AMenuItem, PGTKWidget(AMenuItem.Handle), ShortCutK1, ShortCutK2);
|
||||
|
||||
{ // Gets the inner widgets. They should already be created by now
|
||||
MenuWidget := PGtkMenuItem(AMenuItem.Handle);
|
||||
|
@ -303,7 +303,7 @@ type
|
||||
class procedure SetColor(const AWinControl: TWinControl); override;
|
||||
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
|
||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const OldShortcut: TShortcut); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortcut); override;
|
||||
class procedure SetText(const AWinControl: TWinControl; const AText: String); override;
|
||||
end;
|
||||
|
||||
@ -319,7 +319,7 @@ type
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean); override;
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox;
|
||||
const NewState: TCheckBoxState); override;
|
||||
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
|
||||
@ -916,10 +916,9 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
//DebugLn(['TGtk2WSCustomCheckBox.SetShortCut ',NewShortCut]);
|
||||
Accelerate(ACustomCheckBox, PGtkWidget(ACustomCheckBox.Handle), ACustomCheckBox.Shortcut,
|
||||
Accelerate(ACustomCheckBox, PGtkWidget(ACustomCheckBox.Handle), ShortcutK1,
|
||||
'clicked'
|
||||
//'activate_item'
|
||||
);
|
||||
@ -2304,11 +2303,10 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TGtk2WSButton.SetShortcut(const AButton: TCustomButton;
|
||||
const OldShortcut: TShortcut);
|
||||
const ShortCutK1, ShortCutK2: TShortcut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AButton, 'SetShortcut')
|
||||
then Exit;
|
||||
|
||||
// gtk2: shortcuts are handled by the LCL
|
||||
end;
|
||||
|
||||
|
@ -471,7 +471,7 @@ type
|
||||
function getText: WideString; override;
|
||||
procedure setIcon(AIcon: QIconH);
|
||||
procedure setIconSize(Size: PSize);
|
||||
procedure setShortcut(AShortcut, AShortCutKey2: TShortcut);
|
||||
procedure setShortcut(AShortCutK1, AShortCutK2: TShortcut);
|
||||
procedure setText(const W: WideString); override;
|
||||
procedure Toggle;
|
||||
function isChecked: Boolean;
|
||||
@ -1361,7 +1361,7 @@ type
|
||||
procedure setIcon(AIcon: QIconH);
|
||||
procedure setImage(AImage: TQtImage);
|
||||
procedure setSeparator(AValue: Boolean);
|
||||
procedure setShortcut(AShortcut, AShortCutKey2: TShortcut);
|
||||
procedure setShortcut(AShortCutK1, AShortCutK2: TShortcut);
|
||||
procedure setText(const W: WideString); override;
|
||||
procedure setVisible(AVisible: Boolean); override;
|
||||
property trackButton: QtMouseButton read FTrackButton write FTrackButton;
|
||||
@ -4497,7 +4497,7 @@ begin
|
||||
QAbstractButton_setIconSize(QAbstractButtonH(Widget), Size);
|
||||
end;
|
||||
|
||||
procedure TQtAbstractButton.setShortcut(AShortcut, AShortCutKey2: TShortcut);
|
||||
procedure TQtAbstractButton.setShortcut(AShortCutK1, AShortCutK2: TShortcut);
|
||||
var
|
||||
Key: Word;
|
||||
Shift: TShiftState;
|
||||
@ -4506,13 +4506,13 @@ var
|
||||
begin
|
||||
QtK1 := 0;
|
||||
QtK2 := 0;
|
||||
if AShortCut <> 0 then
|
||||
if AShortCutK1 <> 0 then
|
||||
begin
|
||||
ShortCutToKey(AShortCut, Key, Shift);
|
||||
ShortCutToKey(AShortCutK1, Key, Shift);
|
||||
QtK1 := LCLKeyToQtKey(Key) or ShiftStateToQtModifiers(Shift);
|
||||
if AShortCutKey2 <> 0 then
|
||||
if AShortCutK2 <> 0 then
|
||||
begin
|
||||
ShortCutToKey(AShortCutKey2, Key, Shift);
|
||||
ShortCutToKey(AShortCutK2, Key, Shift);
|
||||
QtK2 := LCLKeyToQtKey(Key) or ShiftStateToQtModifiers(Shift);
|
||||
end;
|
||||
end;
|
||||
@ -11051,7 +11051,7 @@ begin
|
||||
QAction_setSeparator(ActionHandle, AValue);
|
||||
end;
|
||||
|
||||
procedure TQtMenu.setShortcut(AShortcut, AShortCutKey2: TShortcut);
|
||||
procedure TQtMenu.setShortcut(AShortCutK1, AShortCutK2: TShortcut);
|
||||
var
|
||||
Key: Word;
|
||||
Shift: TShiftState;
|
||||
@ -11060,13 +11060,13 @@ var
|
||||
begin
|
||||
QtK1 := 0;
|
||||
QtK2 := 0;
|
||||
if AShortCut <> 0 then
|
||||
if AShortCutK1 <> 0 then
|
||||
begin
|
||||
ShortCutToKey(AShortCut, Key, Shift);
|
||||
ShortCutToKey(AShortCutK1, Key, Shift);
|
||||
QtK1 := LCLKeyToQtKey(Key) or ShiftStateToQtModifiers(Shift);
|
||||
if AShortCutKey2 <> 0 then
|
||||
if AShortCutK2 <> 0 then
|
||||
begin
|
||||
ShortCutToKey(AShortCutKey2, Key, Shift);
|
||||
ShortCutToKey(AShortCutK2, Key, Shift);
|
||||
QtK2 := LCLKeyToQtKey(Key) or ShiftStateToQtModifiers(Shift);
|
||||
end;
|
||||
end;
|
||||
|
@ -49,7 +49,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
@ -254,7 +254,7 @@ end;
|
||||
Returns: Nothing
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSMenuItem.SetShortCut(const AMenuItem: TMenuItem;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
var
|
||||
Widget: TQtWidget;
|
||||
begin
|
||||
@ -267,7 +267,7 @@ begin
|
||||
|
||||
Widget := TQtWidget(AMenuItem.Handle);
|
||||
if Widget is TQtMenu then
|
||||
TQtMenu(Widget).setShortcut(AMenuItem.ShortCut, AMenuItem.ShortCutKey2);
|
||||
TQtMenu(Widget).setShortcut(ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -198,7 +198,7 @@ type
|
||||
published
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const OldShortcut: TShortcut); override;
|
||||
class procedure SetShortcut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortcut); override;
|
||||
end;
|
||||
|
||||
{ TQtWSCustomCheckBox }
|
||||
@ -208,7 +208,7 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
@ -227,7 +227,7 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
@ -240,7 +240,7 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
@ -1041,11 +1041,11 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TQtWSButton.SetShortcut(const AButton: TCustomButton;
|
||||
const OldShortcut: TShortcut);
|
||||
const ShortCutK1, ShortCutK2: TShortcut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AButton, 'SetShortcut') then Exit;
|
||||
|
||||
TQtPushButton(AButton.Handle).setShortcut(AButton.Shortcut, AButton.ShortCutKey2);
|
||||
TQtPushButton(AButton.Handle).setShortcut(ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
{ TQtWSCustomCheckBox }
|
||||
@ -1071,12 +1071,11 @@ end;
|
||||
Returns: Nothing
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACustomCheckBox, 'SetShortcut') then Exit;
|
||||
|
||||
TQtCheckBox(ACustomCheckBox.Handle).setShortcut(ACustomCheckBox.ShortCut,
|
||||
ACustomCheckBox.ShortCutKey2);
|
||||
TQtCheckBox(ACustomCheckBox.Handle).setShortcut(ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1138,10 +1137,9 @@ end;
|
||||
Returns: Nothing
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSRadioButton.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
TQtRadioButton(ACustomCheckBox.Handle).setShortcut(ACustomCheckBox.ShortCut,
|
||||
ACustomCheckBox.ShortCutKey2);
|
||||
TQtRadioButton(ACustomCheckBox.Handle).setShortcut(ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -1503,12 +1501,11 @@ end;
|
||||
Returns: Nothing
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSToggleBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACustomCheckBox, 'SetShortCut') then
|
||||
Exit;
|
||||
TQtToggleBox(ACustomCheckBox.Handle).setShortcut(ACustomCheckBox.ShortCut,
|
||||
ACustomCheckBox.ShortCutKey2);
|
||||
TQtToggleBox(ACustomCheckBox.Handle).setShortcut(ShortCutK1, ShortCutK2);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@ type
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
class function SetRightJustify(const AMenuItem: TMenuItem; const Justified: boolean): boolean; override;
|
||||
class procedure UpdateMenuIcon(const AMenuItem: TMenuItem; const HasIcon: Boolean; const AIcon: Graphics.TBitmap); override;
|
||||
@ -1383,7 +1383,7 @@ begin
|
||||
Result := Checked;
|
||||
end;
|
||||
|
||||
class procedure TWin32WSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut);
|
||||
class procedure TWin32WSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
UpdateCaption(AMenuItem, aMenuItem.Caption);
|
||||
end;
|
||||
|
@ -248,7 +248,7 @@ type
|
||||
class function CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): HWND; override;
|
||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||
class procedure SetShortCut(const AButton: TCustomButton; const OldKey: word); override;
|
||||
class procedure SetShortCut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
end;
|
||||
|
||||
{ TWin32WSCustomCheckBox }
|
||||
@ -261,7 +261,7 @@ type
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean); override;
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCut: TShortCut); override;
|
||||
class procedure SetBiDiMode(const AWinControl: TWinControl; UseRightToLeftAlign,
|
||||
UseRightToLeftReading, UseRightToLeftScrollBar : Boolean); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
@ -1598,7 +1598,8 @@ begin
|
||||
Windows.SendMessage(AButton.Handle, BM_SETSTYLE, WindowStyle, 1);
|
||||
end;
|
||||
|
||||
class procedure TWin32WSButton.SetShortCut(const AButton: TCustomButton; const OldKey: word);
|
||||
class procedure TWin32WSButton.SetShortCut(const AButton: TCustomButton;
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
if not WSCheckHandleAllocated(AButton, 'SetShortcut') then Exit;
|
||||
// TODO: implement me!
|
||||
@ -1659,7 +1660,7 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TWin32WSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
// TODO: implement me!
|
||||
end;
|
||||
|
@ -56,7 +56,7 @@ type
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); override;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); override;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; override;
|
||||
class function SetRightJustify(const AMenuItem: TMenuItem; const Justified: boolean): boolean; override;
|
||||
class procedure UpdateMenuIcon(const AMenuItem: TMenuItem; const HasIcon: Boolean; const AIcon: Graphics.TBitmap); override;
|
||||
@ -1019,7 +1019,7 @@ begin
|
||||
Result := Boolean(Windows.CheckMenuItem(AMenuItem.Parent.Handle, AMenuItem.Command, uCheck));
|
||||
end;
|
||||
|
||||
class procedure TWinCEWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut);
|
||||
class procedure TWinCEWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
TWinCEWSMenuItem.SetCaption(AMenuItem, aMenuItem.Caption);
|
||||
end;
|
||||
|
@ -239,7 +239,7 @@ type
|
||||
published
|
||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||
// class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
|
||||
// class procedure SetShortcut(const AButton: TCustomButton; const OldShortcut: TShortcut); override;
|
||||
// class procedure SetShortcut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortcut); override;
|
||||
class procedure GetPreferredSize(const AWinControl: TWinControl;
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean); override;
|
||||
@ -255,7 +255,7 @@ type
|
||||
var PreferredWidth, PreferredHeight: integer;
|
||||
WithThemeSpace: Boolean); override;
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); override;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
|
||||
end;
|
||||
|
||||
@ -1314,7 +1314,7 @@ begin
|
||||
end;
|
||||
|
||||
class procedure TWinCEWSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const OldShortCut: TShortCut);
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
// TODO: implement me!
|
||||
end;
|
||||
|
@ -174,7 +174,7 @@ type
|
||||
procedure SetRightJustify(const AValue: boolean);
|
||||
procedure SetShowAlwaysCheckable(const AValue: boolean);
|
||||
procedure SetSubMenuImages(const AValue: TCustomImageList);
|
||||
procedure ShortcutChanged(const OldValue: TShortcut);
|
||||
procedure ShortcutChanged;
|
||||
procedure SubItemChanged(Sender: TObject; Source: TMenuItem; Rebuild: Boolean);
|
||||
procedure TurnSiblingsOff;
|
||||
procedure DoActionChange(Sender: TObject);
|
||||
@ -289,8 +289,7 @@ type
|
||||
property SubMenuImages: TCustomImageList read FSubMenuImages write SetSubMenuImages;
|
||||
property Visible: Boolean read FVisible write SetVisible
|
||||
stored IsVisibleStored default True;
|
||||
property OnClick: TNotifyEvent read FOnClick write FOnClick
|
||||
stored IsOnClickStored;
|
||||
property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored;
|
||||
end;
|
||||
TMenuItemClass = class of TMenuItem;
|
||||
|
||||
|
@ -58,7 +58,7 @@ type
|
||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; virtual;
|
||||
class procedure DestroyHandle(const AMenuItem: TMenuItem); virtual;
|
||||
class procedure SetCaption(const AMenuItem: TMenuItem; const ACaption: string); virtual;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut); virtual;
|
||||
class procedure SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut); virtual;
|
||||
class procedure SetVisible(const AMenuItem: TMenuItem; const Visible: boolean); virtual;
|
||||
class function SetCheck(const AMenuItem: TMenuItem; const Checked: boolean): boolean; virtual;
|
||||
class function SetEnable(const AMenuItem: TMenuItem; const Enabled: boolean): boolean; virtual;
|
||||
@ -123,7 +123,7 @@ class procedure TWSMenuItem.SetCaption(const AMenuItem: TMenuItem; const ACaptio
|
||||
begin
|
||||
end;
|
||||
|
||||
class procedure TWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const OldShortCut: TShortCut);
|
||||
class procedure TWSMenuItem.SetShortCut(const AMenuItem: TMenuItem; const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
end;
|
||||
|
||||
|
@ -217,7 +217,7 @@ type
|
||||
TWSButton = class(TWSButtonControl)
|
||||
published
|
||||
class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); virtual;
|
||||
class procedure SetShortCut(const AButton: TCustomButton; const OldShortCut: TShortCut); virtual;
|
||||
class procedure SetShortCut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortCut); virtual;
|
||||
end;
|
||||
TWSButtonClass = class of TWSButton;
|
||||
|
||||
@ -226,7 +226,7 @@ type
|
||||
TWSCustomCheckBox = class(TWSButtonControl)
|
||||
published
|
||||
class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; virtual;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut); virtual;
|
||||
class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); virtual;
|
||||
class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); virtual;
|
||||
end;
|
||||
TWSCustomCheckBoxClass = class of TWSCustomCheckBox;
|
||||
@ -602,7 +602,8 @@ class procedure TWSButton.SetDefault(const AButton: TCustomButton; ADefault: Boo
|
||||
begin
|
||||
end;
|
||||
|
||||
class procedure TWSButton.SetShortCut(const AButton: TCustomButton; const OldShortCut: TShortCut);
|
||||
class procedure TWSButton.SetShortCut(const AButton: TCustomButton;
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin;
|
||||
end;
|
||||
|
||||
@ -613,7 +614,8 @@ begin
|
||||
Result := cbUnchecked;
|
||||
end;
|
||||
|
||||
class procedure TWSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox; const OldShortCut: TShortCut);
|
||||
class procedure TWSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
|
||||
const ShortCutK1, ShortCutK2: TShortCut);
|
||||
begin
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user