Adds a checkbox to the toolbar. @param name C-String containing the label for the Button @param cb Callback function, activated when the button is pressed @param data Data that should get sent to the callback @param width Width (and height) of the button. (TODO Not working!?) @return Newly created checkbox. */
| 97 | @return Newly created checkbox. |
| 98 | */ |
| 99 | Fl_Light_Button *My_Toolbar::AddCheckButton(const char *name, Fl_Callback *cb, void *data, int width) { |
| 100 | begin(); |
| 101 | Fl_Light_Button *b = new Fl_Light_Button(0,0,width,TCRUNCHER_ICON_BAR_HEIGHT-18, name); |
| 102 | b->box(FL_FLAT_BOX); |
| 103 | b->color(ColorThemes::getColor(app.getTheme(), "toolbar_bg")); |
| 104 | b->labelcolor(ColorThemes::getColor(app.getTheme(), "toolbar_text")); |
| 105 | b->selection_color(ColorThemes::getColor(app.getTheme(), "header_button_on")); |
| 106 | b->clear_visible_focus(); |
| 107 | if( name ) |
| 108 | b->tooltip(name); |
| 109 | if( cb ) |
| 110 | b->callback(cb,data); |
| 111 | if( width ) |
| 112 | b->resize(0,0,width,32); |
| 113 | end(); |
| 114 | return b; |
| 115 | } |
| 116 | |
| 117 | |
| 118 |