Lines Matching refs:button

51 void ui_draw_button( UI_GADGET_BUTTON * button )  in ui_draw_button()  argument
55 if ((button->status==1) || (button->position != button->oldposition)) in ui_draw_button()
59 gr_set_current_canvas( button->canvas ); in ui_draw_button()
60 color = button->canvas->cv_color; in ui_draw_button()
62 if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)button) in ui_draw_button()
66 if ((button->user_function==NULL) && button->dim_if_no_function ) in ui_draw_button()
72 button->status = 0; in ui_draw_button()
73 if (button->position == 0 ) in ui_draw_button()
75 if (button->text ) { in ui_draw_button()
76 ui_draw_box_out( 0, 0, button->width-1, button->height-1 ); in ui_draw_button()
77 ui_string_centered( Middle(button->width), Middle(button->height), button->text ); in ui_draw_button()
80 gr_rect( 0, 0, button->width, button->height ); in ui_draw_button()
82 gr_rect( 1, 1, button->width-1, button->height-1 ); in ui_draw_button()
85 if (button->text ) { in ui_draw_button()
86 ui_draw_box_in( 0, 0, button->width-1, button->height-1 ); in ui_draw_button()
87 ui_string_centered( Middle(button->width)+1, Middle(button->height)+1, button->text ); in ui_draw_button()
90 gr_rect( 0, 0, button->width, button->height ); in ui_draw_button()
92 gr_rect( 2, 2, button->width, button->height ); in ui_draw_button()
95 button->canvas->cv_color = color; in ui_draw_button()
103 UI_GADGET_BUTTON * button; in ui_add_gadget_button() local
105 button = (UI_GADGET_BUTTON *)ui_gadget_add( wnd, 1, x, y, x+w-1, y+h-1 ); in ui_add_gadget_button()
109 MALLOC( button->text, char, strlen(text)+1 ); in ui_add_gadget_button()
110 strcpy( button->text, text ); in ui_add_gadget_button()
112 button->text = NULL; in ui_add_gadget_button()
114 button->width = w; in ui_add_gadget_button()
115 button->height = h; in ui_add_gadget_button()
116 button->position = 0; in ui_add_gadget_button()
117 button->oldposition = 0; in ui_add_gadget_button()
118 button->pressed = 0; in ui_add_gadget_button()
119 button->user_function = function_to_call; in ui_add_gadget_button()
120 button->user_function1 = NULL; in ui_add_gadget_button()
121 button->hotkey1= -1; in ui_add_gadget_button()
122 button->dim_if_no_function = 0; in ui_add_gadget_button()
124 return button; in ui_add_gadget_button()
129 void ui_button_do( UI_GADGET_BUTTON * button, int keypress ) in ui_button_do() argument
134 OnMe = ui_mouse_on_gadget( (UI_GADGET *)button ); in ui_button_do()
136 button->oldposition = button->position; in ui_button_do()
151 button->position = 1; in ui_button_do()
153 button->position = 0; in ui_button_do()
156 if (keypress == button->hotkey ) in ui_button_do()
158 button->position = 2; in ui_button_do()
162 if ((keypress == button->hotkey1) && button->user_function1 ) in ui_button_do()
164 result = button->user_function1(); in ui_button_do()
172 …if ((CurWindow->keyboard_focus_gadget==(UI_GADGET *)button) && ((keypress==KEY_SPACEBAR) || (keypr… in ui_button_do()
173 button->position = 2; in ui_button_do()
175 if (CurWindow->keyboard_focus_gadget==(UI_GADGET *)button) in ui_button_do()
176 if ((button->oldposition==2) && (keyd_pressed[KEY_SPACEBAR] || keyd_pressed[KEY_ENTER] ) ) in ui_button_do()
177 button->position = 2; in ui_button_do()
179 button->pressed = 0; in ui_button_do()
181 if (button->position==0) { in ui_button_do()
182 if ( (button->oldposition==1) && OnMe ) in ui_button_do()
183 button->pressed = 1; in ui_button_do()
184 if ( (button->oldposition==2) && (CurWindow->keyboard_focus_gadget==(UI_GADGET *)button) ) in ui_button_do()
185 button->pressed = 1; in ui_button_do()
188 ui_draw_button( button ); in ui_button_do()
190 if (button->pressed && button->user_function ) in ui_button_do()
192 result = button->user_function(); in ui_button_do()