libxputty 0.1
Loading...
Searching...
No Matches
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
30extern "C" {
31#endif
32
33/* comment out xasprintf and define _GNU_SOURCE on top of this file will remove this dependency.*/
34#include "xasprintf.h"
35
54
55
56void pop_combobox_menu_show(Widget_t *parent, Widget_t *menu, bool above);
57
66Widget_t* add_combobox(Widget_t *parent, const char * label, int x, int y, int width, int height);
67
74void combobox_add_entry(Widget_t *wid, const char * label);
75
83void combobox_rename_entry(Widget_t *wid, int active, const char* label);
84
92void combobox_add_numeric_entrys(Widget_t *wid, int imin, int imax);
93
100void combobox_set_active_entry(Widget_t *w, int active);
101
108void combobox_mem_free(void *w_, void* user_data);
109
115void combobox_delete_entrys(Widget_t *combobox);
116
123void combobox_set_menu_size(Widget_t *combobox, int v);
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif //XCOMBOBOX_H_
ComboBox_t - struct to hold information for the combobox.
Definition xcombobox.h:45
int active_item
Definition xcombobox.h:49
Widget_t * combobox
Definition xcombobox.h:47
char ** list_names
Definition xcombobox.h:52
int prelight_item
Definition xcombobox.h:48
unsigned int list_size
Definition xcombobox.h:51
Widget_t * slider
Definition xcombobox.h:46
int show_items
Definition xcombobox.h:50
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
Multiplatform implementation of asprintf() from: https://stackoverflow.com/questions/40159892/using-a...
void pop_combobox_menu_show(Widget_t *parent, Widget_t *menu, bool above)
Definition xcombobox.c:82
void combobox_set_active_entry(Widget_t *w, int active)
combobox_set_active_entry - set the active combobox entry
Definition xcombobox.c:27
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:189
void combobox_rename_entry(Widget_t *wid, int active, const char *label)
combobox_rename_entry - rename a entry in the combobox
Definition xcombobox.c:34
void combobox_delete_entrys(Widget_t *combobox)
combobox_delete_entrys - free the list hold the combobox entrys
Definition xcombobox.c:67
void combobox_mem_free(void *w_, void *user_data)
combobox_mem_free - release additional used memory when destroy the Widget_t
Definition xcombobox.c:47
void combobox_set_menu_size(Widget_t *combobox, int v)
combobox_set_menu_size - set the number of entrys shown in the pop menu
Definition xcombobox.c:59
void combobox_add_entry(Widget_t *wid, const char *label)
combobox_add_entry - add a entry to the combobox
Definition xcombobox.c:175
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:152
This file contains definitions and structs used on all platforms. Platform specific definitions are l...