Class TMenuItemToggleFullScreen
Unit
Declaration
type TMenuItemToggleFullScreen = class(TMenuItemChecked)
Description
Menu item that toggles TCastleWindow.FullScreen.
This already has a nice caption, key shortcut (F11 on most platforms, except macOS where it's Command+F11 (on LCL backend) or Ctrl+F11 (on other backends), since the bare F11 is reserved on macOS). And it has a DoClick implementation that takes care of the actual job.
So you can just add it to your menu, and forget about it.
Source: window/castlewindowmenu.inc (line 472).
Hierarchy
- TObject
- TMenuEntry
- TMenuEntryWithCaption
- TMenuItem
- TMenuItemChecked
- TMenuItemToggleFullScreen
Overview
Methods
| Protected | procedure ClearHandles; virtual; |
| Public | procedure MenuUpdateBegin; |
| Public | procedure MenuUpdateEnd; |
| Public | constructor Create(const ACaption: String); |
| Public | function DoClick: boolean; virtual; |
| Public | function KeyToString(out S: string): boolean; |
| Public | function KeyMatches(const AKey: TKey; const AKeyString: String; const AModifiers: TModifierKeys): boolean; |
| Public | function CaptionWithKey: string; |
| Public | constructor Create(const ACaption: String; AIntData: Integer); overload; |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKeyString: String); overload; |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKey: TKey); overload; |
| Public | destructor Destroy; override; |
| Protected | procedure SetChecked(Value: boolean); virtual; |
| Protected | procedure DoAutoCheckedToggle; virtual; |
| Public | function DoClick: boolean; override; |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AChecked, AAutoCheckedToggle: boolean); overload; |
| Public | constructor Create(const ACaption: String; AIntData: Integer; const AKeyString: String; AChecked, AAutoCheckedToggle: boolean); overload; |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKey: TKey; AChecked, AAutoCheckedToggle: boolean); overload; |
| Public | constructor Create(const InitialFullScreen: boolean); |
| Public | function DoClick: boolean; override; |
Properties
| Public | property ParentMenu: TMenu read FParentMenu; |
| Public | property ParentMenuPosition: Cardinal read FParentMenuPosition; |
| Public | property Caption: String read FCaption write SetCaption; |
| Public | property Enabled: boolean read FEnabled write SetEnabled
default true; |
| Public | property IntData: Integer read FIntData write FIntData; |
| Public | property SmallId: Integer read FSmallId; |
| Public | property KeyString: String read FKeyString write FKeyString; |
| Public | property Key: TKey read FKey write FKey default keyNone; |
| Public | property CharKey: Char read GetCharKey write SetCharKey; deprecated 'use KeyString'; |
| Public | property Modifiers: TModifierKeys read FModifiers write FModifiers; |
| Public | property Checked: boolean read FChecked write SetChecked; |
| Public | property AutoCheckedToggle: boolean read FAutoCheckedToggle
write FAutoCheckedToggle; |
Description
Methods
| Protected | procedure ClearHandles; virtual; |
|
Recursively clear TMenuEntry.Handle values. | |
| Public | procedure MenuUpdateBegin; |
|
For optimization purposes, you may surround many menu changes inside | |
| Public | procedure MenuUpdateEnd; |
|
This item has no description. | |
| Public | constructor Create(const ACaption: String); |
|
This item has no description. | |
| Public | function DoClick: boolean; virtual; |
|
Called when this menu item will be choosen by user (by clicking, or pressing the matching key shortcut). You can override this and return true if you handled the event. If this will return false, CastleWindow will call EventMenuClick (OnMenuClick). When entering this method, current OpenGL context is set to the context of the window that the clicked menu belongs to. Default implementation of this method in this class always returns false. | |
| Public | function KeyToString(out S: string): boolean; |
|
Returns as S the string that describes key shortcut (KeyString, Key, Modifiers) and then returns true. If KeyString = '' and Key = keyNone then returns false and S is undefined. | |
| Public | function KeyMatches(const AKey: TKey; const AKeyString: String; const AModifiers: TModifierKeys): boolean; |
|
This item has no description. | |
| Public | function CaptionWithKey: string; |
|
Caption with optional key description (returned by KeyString) appended. | |
| Public | constructor Create(const ACaption: String; AIntData: Integer); overload; |
|
This item has no description. | |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKeyString: String); overload; |
|
This item has no description. | |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKey: TKey); overload; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Protected | procedure SetChecked(Value: boolean); virtual; |
|
Called when Checked property is assigned. | |
| Protected | procedure DoAutoCheckedToggle; virtual; |
|
Called from DoClick when AutoCheckedToggle is Note that this is overriden ina a "dirty" way (i.e. not calling "inherited") in TMenuItemRadio descendant. | |
| Public | function DoClick: boolean; override; |
|
Overriden to handle AutoCheckedToggle. In this class, | |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AChecked, AAutoCheckedToggle: boolean); overload; |
|
This item has no description. | |
| Public | constructor Create(const ACaption: String; AIntData: Integer; const AKeyString: String; AChecked, AAutoCheckedToggle: boolean); overload; |
|
This item has no description. | |
| Public | constructor Create(const ACaption: String; AIntData: Integer; AKey: TKey; AChecked, AAutoCheckedToggle: boolean); overload; |
|
This item has no description. | |
| Public | constructor Create(const InitialFullScreen: boolean); |
|
This item has no description. | |
| Public | function DoClick: boolean; override; |
|
This item has no description. Showing description inherited from TMenuItemChecked.DoClick.
Overriden to handle AutoCheckedToggle. In this class, | |
Properties
| Public | property ParentMenu: TMenu read FParentMenu; |
|
This is the parent TMenu that has this item in it's Entries list. | |
| Public | property ParentMenuPosition: Cardinal read FParentMenuPosition; |
|
Position on ParentMenu. Indexed from 0, so ParentMenu.Entries[ | |
| Public | property Caption: String read FCaption write SetCaption; |
|
Caption of this menu entry. Will be shown to user. To indicate that some letter of a caption is a mnemonic for this menu item put '_' (underscore) char before this letter. Depending on CastleWindow-backend-dependent, mnemonics should allow user to easier activate this menu item with keyboard (e.g. Alt+mnemonic to dropdown item in MainMenu). You can put two consecutive underscore chars in Caption to indicate that here Caption should display literally one underscore character. (Convention to mark mnemonics with '_' is just copied from gtk, from gtk_label_new_with_mnemonic. So no, I didn't invent another new convention here.) It is undefined what will happen if you put underscore chars before *two* or more letters in Caption. I.e. you can't define multiple mnemonics for one menu item. I.e. this will not crash your program, but results may be CastleWindow-backend-dependent. Just like in GTK toolkit gtk_label_new_with_mnemonic and gtk_menu_item_new_with_mnemonic. | |
| Public | property Enabled: boolean read FEnabled write SetEnabled
default true; |
|
This item has no description. | |
| Public | property IntData: Integer read FIntData write FIntData; |
|
An integer value, for any purpose you want. Useful to identify this item in TCastleWindow.OnMenuClick callback. | |
| Public | property SmallId: Integer read FSmallId; |
|
Unique small identifier of this menu item. This is initialized at creation of this object, to be unique among all currently existing (created and not destroyed) TMenuItem instances. The intention is that this See also
| |
| Public | property KeyString: String read FKeyString write FKeyString; |
|
Key shortcut for this menu item. When user presses indicated Key (if it's not keyNone) or Handling of menu key shortcuts is completely within the CastleWindow (usually, it's even done by the underlying backend like GTK or WinAPI). You will not get EventPress (OnPress) messages for keypresses that translate to menu clicks. Although TCastleWindow.Pressed.Keys will be still appropriately updated. Note that Caption of this object should not contain description of Key or You should use at most one of these properties, not both. So either use Key or The
The TODO: for now, this must be assigned before adding this menu item to parent (actually, before the parent menu is added to window MainMenu) to work reliably. Don't change this property afterwards. Usually, you will set this property by an argument to the constructor. | |
| Public | property Key: TKey read FKey write FKey default keyNone; |
|
This item has no description. | |
| Public | property CharKey: Char read GetCharKey write SetCharKey; deprecated 'use KeyString'; |
|
Warning: this symbol is deprecated: use KeyString This item has no description. | |
| Public | property Modifiers: TModifierKeys read FModifiers write FModifiers; |
|
Modifiers (shift, ctrl and such) required to activate this menu item. These have to be pressed along with Key or KeyString. Note that KeyString may already indicate some modifiers, if it's one of the CtrlA ... CtrlZ then the Ctrl key is required and if it's an uppercase letter then the Shift key is required. There's no need to include this modifier in this property then. TODO: for now, this must be assigned before adding this menu item to parent (actually, before the parent menu is added to window MainMenu) to work reliably. Don't change this property afterwards. | |
| Public | property Checked: boolean read FChecked write SetChecked; |
|
This item has no description. | |
| Public | property AutoCheckedToggle: boolean read FAutoCheckedToggle
write FAutoCheckedToggle; |
|
If | |
Generated by PasDoc 0.17.0.snapshot.