Skip to content

Commit

Permalink
fixed doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
gooosedev committed Dec 12, 2024
1 parent 2e297f8 commit da871a8
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -3543,23 +3543,26 @@ NK_API int nk_combo(struct nk_context*, const char *const *items, int count, int
NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size);
NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* NK_API int nk_combo_from_struct_array(struct nk_context *ctx, const void *items, int count, int item_sz, int stride, int selected, int item_height, struct nk_vec2 size);
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Parameter | Description
* --------------------|-----------------------------------------------------------
* __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
* __items__ | `void` pointer to a list of structures
* __count__ | Number of elements in the array of structs
* __items_sz__ | Size of an individual structure.
* __stride__ | Stride to a char* member inside the structure
* __selected__ | the index of the current selected item
* __item_height__ | Height of the element
* __size__ | Size of the element listing, must point to a `nk_vec2` structure
* Returns the index of the newly selected item.
* #### Usage
* The nk_combo_from_struct_array is designed to create a combobox from an array of strct containing a `char*` member that we use as a name
* this avoids the need to have two arrays (one being for the array of structs, and one for the names) */
/*
* \brief create a combobox from an array of strct containing a `char*` member that we use as a name
* this avoids the need to have two arrays (one being for the array of structs, and one for the names)
*
* \details
* ```c
* int nk_combo_from_struct_array(struct nk_context *ctx, const void *items, int count, int item_sz, int stride, int selected, int item_height, struct nk_vec2 size);
* ```
*
* \param[in] ctx | Must point to an previously initialized `nk_context` struct after calling a layouting function
* \param[in] items | `void` pointer to a list of structures
* \param[in] count | Number of elements in the array of structs
* \param[in] items_sz | Size of an individual structure.
* \param[in] stride | Stride to a char* member inside the structure
* \param[in] selected | the index of the current selected item
* \param[in] item_height | Height of the element
* \param[in] size | Size of the element listing, must point to a `nk_vec2` structure
*
* \returns the index of the newly selected item.
*/
NK_API int nk_combo_from_struct_array(struct nk_context *ctx, const void *items, int count, int item_sz, int stride, int selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size);
NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size);
Expand Down

0 comments on commit da871a8

Please sign in to comment.