@@ -229,9 +229,6 @@ been pressed at the time the item was clicked.
229
229
230
230
### Hotkeys
231
231
232
- When a menu item is fired from a key combo press, the event's ` $combo ` parameter will have its ` triggeredByAccelerator `
233
- equal to ` true ` .
234
-
235
232
Hotkeys can be defined for all menu items, either via their relevant ` Menu ` facade method or by using the ` hotkey() `
236
233
chainable method:
237
234
@@ -249,6 +246,9 @@ You can find a list of available hotkey modifiers in the
249
246
Unlike global hotkeys, hotkeys registered to menu items will only be fired when one of your application's windows are
250
247
focused or the relevant context menu is open.
251
248
249
+ When a menu item is fired from a hotkey combo press, the event's ` $combo ` parameter will have its ` triggeredByAccelerator `
250
+ value set to ` true ` .
251
+
252
252
### Label items
253
253
254
254
The simplest menu item is just a label. You may use the ` Menu::label() ` method to add a label item to your menu:
@@ -259,15 +259,15 @@ Menu::make(
259
259
);
260
260
```
261
261
262
- These are great if you just want your app to do something in response to the user clicking the menu item or pressing
262
+ These are great if when you want your app to do something in response to the user clicking the menu item or pressing
263
263
the hotkey combo.
264
264
265
265
### Link items
266
266
267
- Link items allow you to define navigational elements within your menu . These can either navigate users to another URL
267
+ Link items allow you to define navigational elements within your menus . These can either navigate users to another URL
268
268
within your application or to an external page hosted on the internet.
269
269
270
- You may add a link to your menu by using the ` Menu::link() ` method.
270
+ You may add a link to your menu by using the ` Menu::link() ` method:
271
271
272
272
``` php
273
273
Menu::link('/login', 'Login');
@@ -295,20 +295,21 @@ may introduce serious vulnerabilities onto your user's device.**
295
295
296
296
### Checkbox and Radio items
297
297
298
- In some cases, your app may not require a preferences panel, and a few interactive menu items will suffice to allow
299
- your user to configure some settings. Or you may wish to make certain commonly-used setting more accessible.
298
+ In some cases, your app may not require a preferences panel, and a few interactive menu items may suffice to allow
299
+ your user to configure some settings. Or you may wish to make certain commonly-used settings more readily accessible.
300
300
301
301
Checkbox and Radio items enable you to create menu items for just these purposes. They operate in a very similar way
302
- to checkboxes and radio buttons in a web view .
302
+ to checkboxes and radio buttons in a web form .
303
303
304
304
You may use the ` Menu::checkbox() ` and ` Menu::radio() ` methods to create such items, passing the initial state of the
305
- item to the ` checked ` parameter:
305
+ item to the ` checked ` parameter (the default state is 'unchecked') :
306
306
307
307
``` php
308
- Menu::checkbox('Word wrap', checked: false );
308
+ Menu::checkbox('Word wrap', checked: true );
309
309
```
310
310
311
- When Checkbox and Radio items are triggered, the event data will indicate whether or not the item is currently checked.
311
+ When Checkbox and Radio items are triggered, the click event data will indicate whether or not the item is currently
312
+ checked via the ` $item['checked'] ` value.
312
313
313
314
#### Radio groups
314
315
@@ -334,15 +335,15 @@ These two radio groups will operate independently of each other.
334
335
335
336
NativePHP also ships with a number of "special" menu items that provide specific behavior for you to use in your menus.
336
337
337
- These items usually have default labels and hotkeys associated with them and provide the basic default functionality
338
+ These items usually have default labels and hotkeys associated with them and provide the basic, default functionality
338
339
commonly associated with them in any web browser. Therefore, they do not fire any click events.
339
340
340
- You may only override their label .
341
+ You may only override their labels .
341
342
342
343
### Separators
343
344
You may add separators to your menu by using the ` Menu::separator() ` method.
344
345
345
- A separator is a horizontal line that separates menu items.
346
+ A separator is a horizontal line that visually separates menu items.
346
347
347
348
``` php
348
349
Menu::make(
@@ -352,9 +353,12 @@ Menu::make(
352
353
);
353
354
```
354
355
356
+ As already noted, they also aid in logically grouping radio items.
357
+
355
358
### Undo and Redo
356
- If you have chosen not to include the [ default Edit menu] ( #the-edit-menu ) to your application menu,
357
- you may add undo and redo functionality to your app by using the ` Menu::undo() ` and ` Menu::redo() ` methods.
359
+ If you have chosen not to include the [ default Edit menu] ( #the-edit-menu ) in your application menu,
360
+ you may add the default undo and redo functionality to your app by using the ` Menu::undo() ` and
361
+ ` Menu::redo() ` methods.
358
362
359
363
``` php
360
364
Menu::make()
@@ -368,9 +372,9 @@ but for more complex undo/redo workflows, you may wish to implement your own log
368
372
these items.**
369
373
370
374
### Cut, Copy, and Paste
371
- If you have chosen not to include the [ default Edit menu] ( #the-edit-menu ) to your application menu,
372
- you may add cut, copy and paste functionality to your app by using the ` Menu::cut() ` , ` Menu::copy() ` and ` Menu::paste() `
373
- methods.
375
+ If you have chosen not to include the [ default Edit menu] ( #the-edit-menu ) in your application menu,
376
+ you may add the default cut, copy and paste functionality to your app by using the ` Menu::cut() ` , ` Menu::copy() ` and
377
+ ` Menu::paste() ` methods.
374
378
375
379
``` php
376
380
Menu::make()
@@ -392,7 +396,7 @@ if your currently-focused window is [fullscreen-able](/docs/the-basics/windows#f
392
396
393
397
``` php
394
398
Menu::make()
395
- Menu::fullscreen('Go full screen '),
399
+ Menu::fullscreen('Supersize me! '),
396
400
);
397
401
```
398
402
0 commit comments