More documentation work.

This commit is contained in:
Pietro Gagliardi 2015-04-22 11:47:44 -04:00
parent d7d6de3306
commit 9519c59011
4 changed files with 111 additions and 4 deletions

View File

@ -9,11 +9,9 @@ Windows | Unix | OS X
uiButton derives from [uiControl](uiControl.md).
## constructor NewButton()
```c
uiButton *uiNewButton(const char *text);
```
Creates a new uiButton with the specifed text.
## func Text()
@ -32,9 +30,9 @@ Changes the text shown on the uiButton to the given text string.
```c
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()`.

55
docs/uiCheckbox.md Normal file
View File

@ -0,0 +1,55 @@
# uiCheckbox
uiCheckbox is a control which represents a box that can have a checkmark in it.
Windows | Unix | OS X
-----|-----|-----
![Checkbox on Windows](images/uiCheckbox_windows.png)|![Checkbox on Unix](images/uiCheckbox_unix.png)|![Checkbox on OS X](images/uiChekbox_darwin.png)
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.

27
docs/uiEntry.md Normal file
View File

@ -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
-----|-----|-----
![Entry on Windows](images/uiEntry_windows.png)|![Entry on Unix](images/uiEntry_unix.png)|![Entry on OS X](images/uiEntry_darwin.png)
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.

27
docs/uiLabel.md Normal file
View File

@ -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
-----|-----|-----
![Label on Windows](images/uiLabel_windows.png)|![Label on Unix](images/uiLabel_unix.png)|![Label on OS X](images/uiLabel_darwin.png)
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.