31 int width = metrics.
width-2;
32 int height = metrics.
height-2;
37 cairo_rectangle(w->
crb,2.0, 4.0, width, height);
40 cairo_set_line_width(w->
crb, 1.0);
42 cairo_fill_preserve(w->
crb);
44 }
else if(w->
state==1) {
46 cairo_fill_preserve(w->
crb);
47 cairo_set_line_width(w->
crb, 1.5);
49 }
else if(w->
state==2) {
51 cairo_fill_preserve(w->
crb);
52 cairo_set_line_width(w->
crb, 1.0);
54 }
else if(w->
state==3) {
56 cairo_fill_preserve(w->
crb);
57 cairo_set_line_width(w->
crb, 1.0);
63 cairo_rectangle(w->
crb,4.0, 6.0, width, height);
65 cairo_rectangle(w->
crb,3.0, 4.0, width, height);
67 }
else if (w->
state==3) {
68 cairo_rectangle(w->
crb,3.0, 4.0, width, height);
75 }
else if(w->
state==1) {
78 }
else if(w->
state==2) {
81 }
else if(w->
state==3) {
92 cairo_move_to(w->
crb, wa+offset, h+offset);
93 cairo_line_to(w->
crb, wa1+offset, h1+offset);
94 cairo_line_to(w->
crb, wa2+offset, h+offset);
95 cairo_line_to(w->
crb, wa+offset, h+offset);
105 int width = metrics.
width-2;
106 int height = metrics.
height-2;
115 cairo_rectangle(w->
crb,2.0, 2.0, width, height);
118 cairo_set_line_width(w->
crb, 1.0);
120 cairo_fill_preserve(w->
crb);
122 }
else if(w->
state==1) {
124 cairo_fill_preserve(w->
crb);
125 cairo_set_line_width(w->
crb, 1.5);
127 }
else if(w->
state==2) {
129 cairo_fill_preserve(w->
crb);
130 cairo_set_line_width(w->
crb, 1.0);
132 }
else if(w->
state==3) {
134 cairo_fill_preserve(w->
crb);
135 cairo_set_line_width(w->
crb, 1.0);
137 }
else if(w->
state==4) {
139 cairo_fill_preserve(w->
crb);
140 cairo_set_line_width(w->
crb, 1.0);
143 cairo_stroke(w->
crb);
145 cairo_rectangle(w->
crb,4.0, 4.0, width, height);
146 cairo_stroke(w->
crb);
147 cairo_rectangle(w->
crb,3.0, 3.0, width, height);
148 cairo_stroke(w->
crb);
152 cairo_text_extents_t extents;
156 cairo_set_font_size (w->
crb, font_size);
157 cairo_text_extents(w->
crb,
"Ay", &extents);
158 double h = extents.height;
160 cairo_move_to (w->
crb, 15, (height+h)*0.55);
162 cairo_new_path (w->
crb);
163 if (extents.width > (
float)width-20) {
167 w->
flags &= ~HAS_TOOLTIP;
182 int width = metrics.
width-2;
183 int height = metrics.
height-2;
188 cairo_rectangle(w->
crb, 0, 0, width, height);
204 cairo_rectangle(w->
crb, 0, a*25, width, 25);
205 cairo_fill_preserve(w->
crb);
206 cairo_set_line_width(w->
crb, 1.0);
208 cairo_stroke(w->
crb);
209 cairo_text_extents_t extents;
220 cairo_set_font_size (w->
crb, 12);
221 cairo_text_extents(w->
crb,
"Ay", &extents);
222 double h = extents.height;
223 cairo_text_extents(w->
crb,comboboxlist->
list_names[i] , &extents);
225 cairo_move_to (w->
crb, 15, (25*(a+1)) - h +2);
227 cairo_new_path (w->
crb);
228 if (i == comboboxlist->
prelight_item && extents.width > (
float)width-20) {
232 }
else if (i == comboboxlist->
prelight_item && extents.width < (
float)width-20) {
233 w->
flags &= ~HAS_TOOLTIP;
246 int height = metrics.
height-2;
247 int _items = height/(height/25);
261 int height = metrics.
height-2;
262 int _items = height/(height/25);
285 int height = metrics.
height-2;
286 int _items = height/(height/25);
288 if(xbutton->
button == Button4) {
292 }
else if (xbutton->
button == Button5) {
296 }
else if(xbutton->
button == Button1) {
321 int height = metrics.
height;
345 int width = metrics.
width-2;
346 int height = metrics.
height-2;
348 int show_items = height/25;
349 float slidersize = 1.0;
350 if (comboboxlist->
list_size > show_items)
351 slidersize = (float)((
float)show_items/(float)comboboxlist->
list_size);
354 cairo_rectangle(w->
crb, 0,0,width,height);
355 cairo_fill_preserve(w->
crb);
359 cairo_rectangle(w->
crb, 0,((
float)height-
360 ((
float)height*slidersize))*sliderstate,width,((
float)height*slidersize));
375 if (xbutton->
button == Button3) {
422 int posy = (above) ? parent->
height : 0;
424 int item_width = 1.0;
425 cairo_text_extents_t extents;
429 bool is_not_scrolable =
false;
432 is_not_scrolable =
true;
434 cairo_set_font_size (view_port->
crb, height/2);
436 cairo_text_extents(view_port->
crb,comboboxlist->
list_names[i] , &extents);
438 item_width = max(item_width, (
int)extents.width+40);
442 if(item_width<parent->width)item_width = parent->
width;
446 if (y1+(height*elem) > screen_height) y1 = y1-((height*elem)+parent->
height);
ComboBox_t - struct to hold information for the combobox.
evfunc button_release_callback
Metrics_t - struct to receive window size, position & visibility Pass this struct to os_get_window_...
void adj_set_state(Adjustment_t *adj, float state)
adj_set_state - set the current state of the Adjustment_t
void adj_set_value(Adjustment_t *adj, float value)
adj_set_value - set the current value to the Adjustment_t
float adj_get_value(Adjustment_t *adj)
adj_get_value - get the current value of the Adjustment_t
void set_adjustment(Adjustment_t *adj, float std_value, float value, float min_value, float max_value, float step, CL_type type)
*set_adjustment - set a new range to a existing Adjustment_t or create if it not exists yet
float adj_get_state(Adjustment_t *adj)
adj_get_state - get the current state of the Adjustment_t
void adj_set_scale(Adjustment_t *adj, float value)
adj_set_scale - internal use to scale the pointer movement (0.1 -1.0)
void use_frame_color_scheme(Widget_t *w, Color_state st)
use_frame_color_scheme - use frame Colors to paint on Widget_t
Color_state get_color_state(Widget_t *wid)
get_color_state - get the Color_state to use in relation to the Widget_t state
void use_text_color_scheme(Widget_t *w, Color_state st)
use_text_color_scheme - use text Colors to paint on Widget_t
void use_bg_color_scheme(Widget_t *w, Color_state st)
use_bg_color_scheme - use background Colors to paint on Widget_t
void use_fg_color_scheme(Widget_t *w, Color_state st)
use_fg_color_scheme - use forground Colors to paint on Widget_t
void set_pattern(Widget_t *w, Colors *from, Colors *to, Color_mod mod)
set_pattern - set pattern for the selected Colors
void use_shadow_color_scheme(Widget_t *w, Color_state st)
use_shadow_color_scheme - use shadow Colors to paint on Widget_t
void use_base_color_scheme(Widget_t *w, Color_state st)
use_base_color_scheme - use base Colors to paint on Widget_t
void pop_combobox_menu_show(Widget_t *parent, Widget_t *menu, bool above)
void _set_combobox_menu_viewport(void *w_, void *user_data)
_set_combobox_menu_viewport - set the viewport position from slider state
void _draw_combobox(void *w_, void *user_data)
_draw_combobox - internal draw the combobox to the buffer
void _leave_combobox(void *w_, void *user_data)
_leave_combobox - mouse pointer leave the combobox
void _draw_combobox_entrys(void *w_, void *user_data)
_draw_combobox_entrys - internal draw the combobox entrys to the buffer
void _combobox_motion(void *w_, void *xmotion_, void *user_data)
_combobox_motion - mouse pointer move in viewport
void _set_combobox_viewpoint(void *w_, void *user_data)
_set_combobox_viewpoint - set the slider state from viewport position
void _draw_combobox_menu_slider(void *w_, void *user_data)
_draw_combobox_menu_slider - internal draw the combobox menu slider
void _combobox_entry_released(void *w_, void *button_, void *user_data)
_combobox_entry_released - viewport entry released mouse button
void _draw_combobox_menu(void *w_, void *user_data)
_draw_combobox_menu - internal draw the combobox menu to the buffer
void _combobox_button_released(void *w_, void *button_, void *user_data)
_combobox_button_released - popup menu on right click
void _reconfigure_combobox_viewport(void *w_, void *user_data)
_reconfigure_combobox_viewport - set slider scale and step to match viewport entrys
void _draw_combobox_button(void *w_, void *user_data)
_draw_combobox_button - internal draw the combobox button to the buffer
void _configure_combobox_menu(Widget_t *parent, Widget_t *menu, int elem, bool above)
_configure_combobox_menu - set final size and position of menu to a Widget_t
void _button_combobox_released(void *w_, void *button_, void *user_data)
_button_combobox_released - popup the combobox menu
void _combobox_key_pressed(void *w_, void *xkey_, void *user_data)
_combobox_key_released - viewport entry released key
void _entry_released(void *w_, void *item_, void *user_data)
_entry_released - the combobox menu release func
void _set_entry(void *w_, void *user_data)
_set_entry - set the active combobox entry on adjustment change