libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xcombobox.h
Go to the documentation of this file.
1 /*
2  * 0BSD
3  *
4  * BSD Zero Clause License
5  *
6  * Copyright (c) 2019 Hermann Meyer
7  *
8  * Permission to use, copy, modify, and/or distribute this software for any
9  * purpose with or without fee is hereby granted.
10 
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  *
19  */
20 
21 #pragma once
22 
23 #ifndef XCOMBOBOX_H_
24 #define XCOMBOBOX_H_
25 
26 #include "xputty.h"
27 #include "xmenu.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /**
34  * @brief add_combobox - add a combobox
35  * @param *parent - pointer to the Widget_t request the button
36  * @param x,y,width,height - the position/geometry to create the button
37  * @return Widget_t* - pointer to the Widget_t button struct
38  */
39 
40 Widget_t* add_combobox(Widget_t *parent, const char * label, int x, int y, int width, int height);
41 
42 /**
43  * @brief combobox_add_entry - add a entry to the combobox
44  * @param *wid - pointer to the Widget_t combobox
45  * @param *label - Label to show on the menu
46  * @return Widget_t* - pointer to the Widget_t menu_item struct
47  */
48 
49 Widget_t *combobox_add_entry(Widget_t *wid, const char * label);
50 
51 /**
52  * @brief combobox_add_numeric_items - add numeric items from imin to imax to wid
53  * @param *wid - pointer to the Widget_t combobox
54  * @param *imin - the low number of the numeric items
55  * @param *imax - the high number of the numeric items
56  * @return void
57  */
58 
59 void combobox_add_numeric_entrys(Widget_t *wid, int imin, int imax);
60 
61 /**
62  * @brief combobox_set_active_entry - set the active combobox entry
63  * @param *w_ - void pointer to the Widget_t combobox
64  * @param active - the active entry (int)
65  * @return void
66  */
67 
68 void combobox_set_active_entry(Widget_t *w, int active);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif //XCOMBOBOX_H_
combobox_add_entry
Widget_t * combobox_add_entry(Widget_t *wid, const char *label)
combobox_add_entry - add a entry to the combobox
Definition: xcombobox.c:56
xputty.h
combobox_set_active_entry
void combobox_set_active_entry(Widget_t *w, int active)
combobox_set_active_entry - set the active combobox entry
Definition: xcombobox.c:25
xmenu.h
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
add_combobox
Widget_t * add_combobox(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_combobox - add a combobox
Definition: xcombobox.c:32
combobox_add_numeric_entrys
void combobox_add_numeric_entrys(Widget_t *wid, int imin, int imax)
combobox_add_numeric_items - add numeric items from imin to imax to wid
Definition: xcombobox.c:66