Skip to content

Commit 905fb62

Browse files
committed
Small tidy up of scroll choice doc
1 parent d86af5a commit 905fb62

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

content/arduino-libraries/tc-menu/menu-item-types/scrollchoice-menu-item.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To set up for EEPROM storage, you choose data mode as EEPROM, the item width is
3434

3535
To set up for RAM storage, you choose data mode as RAM, the item width is again the maximum width and initial items works as per EEPROM mode. In this case you must specify the array variable, which is a character array in memory large enough to account for width * numItems. If it does not exist in your sketch, the variable will be created for you in non-const memory as type `char*`, so you can change it at runtime. As per callbacks, if you start the RAM variable with "@" such as `@myVariableName` then it will be exported but not declared.
3636

37-
To set up for custom, you choose custom data mode, at this point only initial items needs setting, the designer will add a custom callback to your code, see the section below on implementing it.
37+
You can also choose custom that will callback every time the item needs data. In this mode only initial items needs setting, the designer will add a custom callback to your code, see the section below on implementing it.
3838

3939
## Dealing with a scroll choice item in code
4040

@@ -54,9 +54,11 @@ Caching: To cache EEPROM values into RAM call `cacheEepromValues` on the item, i
5454

5555
### Custom rendering option
5656

57-
In this case you use a custom rendering function that will be called back to get the name of the item, the location in EEPROM, and also to get the value of each choice. The designer will create the render function for this automatically, and many examples have implementations too.
57+
In this case the menu item will call a custom rendering function that each time information about the item is needed (such as the name or the value of each choice). The designer will create the render function for this automatically, and you can look at many examples for inspiration too.
5858

59-
Basically, by default the designer created code will call into the default function as follows:
59+
Consult [Runtime Menu Item documentation]({{< relref "based-on-runtimemenuitem.md" >}}) for a more detailed background on callbacks.
60+
61+
By default, the designer created code will call into the default function as follows:
6062

6163
int CALLBACK_FUNCTION exampleListRenderFn(RuntimeMenuItem* item, uint8_t row, RenderFnMode mode, char* buffer, int bufferSize) {
6264
switch(mode) {
@@ -72,7 +74,7 @@ Into the above, we can handle the various `mode` and `row` cases as follows:
7274

7375
In most cases implementing just value should be enough. However, the core runtime item documentation linked above describes all the `mode` possibilities in more detail.
7476

75-
### General purpose functions
77+
## General purpose functions you can use
7678

7779
To get the text of a particular choice
7880

0 commit comments

Comments
 (0)