8000 Update application-menu.md · SRWieZ/fork-nativephp.com@ce8ec9b · GitHub
[go: up one dir, main page]

Skip to content

Commit ce8ec9b

Browse files
authored
Update application-menu.md
1 parent abba6cd commit ce8ec9b

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

resources/views/docs/1/the-basics/application-menu.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ been pressed at the time the item was clicked.
229229

230230
### Hotkeys
231231

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-
235232
Hotkeys can be defined for all menu items, either via their relevant `Menu` facade method or by using the `hotkey()`
236233
chainable method:
237234

@@ -249,6 +246,9 @@ You can find a list of available hotkey modifiers in the
249246
Unlike global hotkeys, hotkeys registered to menu items will only be fired when one of your application's windows are
250247
focused or the relevant context menu is open.
251248

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+
252252
### Label items
253253

254254
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(
259259
);
260260
```
261261

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
263263
the hotkey combo.
264264

265265
### Link items
266266

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
268268
within your application or to an external page hosted on the internet.
269269

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:
271271

272272
```php
273273
Menu::link('/login', 'Login');
@@ -295,20 +295,21 @@ may introduce serious vulnerabilities onto your user's device.**
295295

296296
### Checkbox and Radio items
297297

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.
300300

301301
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.
303303

304304
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'):
306306

307307
```php
308-
Menu::checkbox('Word wrap', checked: false);
308+
Menu::checkbox('Word wrap', checked: true);
309309
```
310310

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.
312313

313314
#### Radio groups
314315

@@ -334,15 +335,15 @@ These two radio groups will operate independently of each other.
334335

335336
NativePHP also ships with a number of "special" menu items that provide specific behavior for you to use in your menus.
336337

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
338339
commonly associated with them in any web browser. Therefore, they do not fire any click events.
339340

340-
You may only override their label.
341+
You may only override their labels.
341342

342343
### Separators
343344
You may add separators to your menu by using the `Menu::separator()` method.
344345

345-
A separator is a horizontal line that separates menu items.
346+
A separator is a horizontal line that visually separates menu items.
346347

347348
```php
348349
Menu::make(
@@ -352,9 +353,12 @@ Menu::make(
352353
);
353354
```
354355

356+
As already noted, they also aid in logically grouping radio items.
357+
355358
### 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.
358362

359363
```php
360364
Menu::make()
@@ -368,9 +372,9 @@ but for more complex undo/redo workflows, you may wish to implement your own log
368372
these items.**
369373

370374
### 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.
374378

375379
```php
376380
Menu::make()
@@ -392,7 +396,7 @@ if your currently-focused window is [fullscreen-able](/docs/the-basics/windows#f
392396

393397
```php
394398
Menu::make()
395-
Menu::fullscreen('Go full screen'),
399+
Menu::fullscreen('Supersize me!'),
396400
);
397401
```
398402

0 commit comments

Comments
 (0)
0