More documentation work.
This commit is contained in:
parent
d7d6de3306
commit
9519c59011
|
@ -9,11 +9,9 @@ Windows | Unix | OS X
|
||||||
uiButton derives from [uiControl](uiControl.md).
|
uiButton derives from [uiControl](uiControl.md).
|
||||||
|
|
||||||
## constructor NewButton()
|
## constructor NewButton()
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uiButton *uiNewButton(const char *text);
|
uiButton *uiNewButton(const char *text);
|
||||||
```
|
```
|
||||||
|
|
||||||
Creates a new uiButton with the specifed text.
|
Creates a new uiButton with the specifed text.
|
||||||
|
|
||||||
## func Text()
|
## func Text()
|
||||||
|
@ -32,9 +30,9 @@ Changes the text shown on the uiButton to the given text string.
|
||||||
```c
|
```c
|
||||||
void uiButtonOnClicked(uiButton *b, void (*handler)(void *sender, void *data), void *data);
|
void uiButtonOnClicked(uiButton *b, void (*handler)(void *sender, void *data), void *data);
|
||||||
```
|
```
|
||||||
Sets the function that is called when the user clicks the uiButton. If a handler was previous assigned, this call replaces the old handler with the given one.
|
Sets the function that is called when the user clicks the uiButton. If a handler was previously assigned, this call replaces the old handler with the given one.
|
||||||
|
|
||||||
The `sender` argument to the callback is the `b` argument to `uiButtonOnClicked()`. It is of type `void *` to allow uiMenus to use the same callback functions.
|
The `sender` argument to the callback is the `b` argument to `uiButtonOnClicked()`. It is of type `void *` to allow uiMenuItems to use the same callback functions.
|
||||||
|
|
||||||
The `data` argument to the callback is the `data` argument to `uiButtonOnClicked()`.
|
The `data` argument to the callback is the `data` argument to `uiButtonOnClicked()`.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
# uiCheckbox
|
||||||
|
|
||||||
|
uiCheckbox is a control which represents a box that can have a checkmark in it.
|
||||||
|
|
||||||
|
Windows | Unix | OS X
|
||||||
|
-----|-----|-----
|
||||||
|
||
|
||||||
|
|
||||||
|
uiCheckbox derives from [uiControl](uiControl.md).
|
||||||
|
|
||||||
|
## constructor NewCheckbox()
|
||||||
|
```c
|
||||||
|
uiCheckbox *uiNewCheckbox(const char *text);
|
||||||
|
```
|
||||||
|
Creates a new uiCheckbox with the specifed text.
|
||||||
|
|
||||||
|
## func Text()
|
||||||
|
```c
|
||||||
|
char *uiCheckboxText(uiCheckbox *c);
|
||||||
|
```
|
||||||
|
Returns the text shown on the uiCheckbox. Free the returned string with `uiTextFree()`.
|
||||||
|
|
||||||
|
## func SetText()
|
||||||
|
```c
|
||||||
|
void uiCheckboxSetText(uiCheckbox *c, const char *text);
|
||||||
|
```
|
||||||
|
Changes the text shown on the uiCheckbox to the given text string.
|
||||||
|
|
||||||
|
## func OnToggled()
|
||||||
|
```c
|
||||||
|
void uiCheckboxOnToggled(uiCheckbox *c, void (*handler)(void *sender, void *data), void *data);
|
||||||
|
```
|
||||||
|
Sets the function that is called when the user changes the checked state of the uiCheckbox. If a handler was previously assigned, this call replaces the old handler with the given one.
|
||||||
|
|
||||||
|
The `sender` argument to the callback is the `c` argument to `uiCheckboxOnToggled()`. It is of type `void *` to allow uiMenuItems to use the same callback functions.
|
||||||
|
|
||||||
|
The `data` argument to the callback is the `data` argument to `uiCheckboxOnToggled()`.
|
||||||
|
|
||||||
|
The default handler does nothing.
|
||||||
|
|
||||||
|
TODO allow NULL to return to default?
|
||||||
|
|
||||||
|
## func Checked()
|
||||||
|
```c
|
||||||
|
int uiCheckboxChecked(uiCheckbox *c);
|
||||||
|
```
|
||||||
|
Returns nonzero if the given uiCheckbox is currently chcecked, and zero otherwise.
|
||||||
|
|
||||||
|
## func SetChecked()
|
||||||
|
```c
|
||||||
|
void uiCheckboxSetChecked(uiCheckbox *c, int checked)
|
||||||
|
```
|
||||||
|
Changes the checked state of the given uiCheckbox. If `checked` is nonzero, the checkbox is checked. If zero, the checkbox is unchecked.
|
||||||
|
|
||||||
|
Calling `uiCheckboxSetChecked()` does NOT trigger the `OnToggled()` event.
|
|
@ -0,0 +1,27 @@
|
||||||
|
# uiEntry
|
||||||
|
|
||||||
|
uiEntry is a control which represents an area where a user can enter a single line of text.
|
||||||
|
|
||||||
|
Windows | Unix | OS X
|
||||||
|
-----|-----|-----
|
||||||
|
||
|
||||||
|
|
||||||
|
uiEntry derives from [uiControl](uiControl.md).
|
||||||
|
|
||||||
|
## constructor NewEntry()
|
||||||
|
```c
|
||||||
|
uiEntry *uiNewEntry(void);
|
||||||
|
```
|
||||||
|
Creates a new uiEntry.
|
||||||
|
|
||||||
|
## func Text()
|
||||||
|
```c
|
||||||
|
char *uiEntryText(uiEntry *e);
|
||||||
|
```
|
||||||
|
Returns the text currently entered in the uiEntry. Free the returned string with `uiTextFree()`.
|
||||||
|
|
||||||
|
## func SetText()
|
||||||
|
```c
|
||||||
|
void uiEntrySetText(uiEntry *e, const char *text);
|
||||||
|
```
|
||||||
|
Changes the text currently entered in the uiEntry to the given text string.
|
|
@ -0,0 +1,27 @@
|
||||||
|
# uiLabel
|
||||||
|
|
||||||
|
uiLabel is a control which represents a line of text that labels an element or area of a GUI.
|
||||||
|
|
||||||
|
Windows | Unix | OS X
|
||||||
|
-----|-----|-----
|
||||||
|
||
|
||||||
|
|
||||||
|
uiLabel derives from [uiControl](uiControl.md).
|
||||||
|
|
||||||
|
## constructor NewLabel()
|
||||||
|
```c
|
||||||
|
uiLabel *uiNewLabel(const char *text);
|
||||||
|
```
|
||||||
|
Creates a new uiLabel with the specifed text.
|
||||||
|
|
||||||
|
## func Text()
|
||||||
|
```c
|
||||||
|
char *uiLabelText(uiLabel *l);
|
||||||
|
```
|
||||||
|
Returns the text shown on the uiLabel. Free the returned string with `uiTextFree()`.
|
||||||
|
|
||||||
|
## func SetText()
|
||||||
|
```c
|
||||||
|
void uiLabelSetText(uiLabel *l, const char *text);
|
||||||
|
```
|
||||||
|
Changes the text shown on the uiLabel to the given text string.
|
Loading…
Reference in New Issue