MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / AddCheckButton

Method AddCheckButton

src/csvwidgets.cpp:99–115  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

97 @return Newly created checkbox.
98*/
99Fl_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

Callers 1

createMethod · 0.80

Calls 4

beginFunction · 0.85
endFunction · 0.85
getThemeMethod · 0.80
resizeMethod · 0.80

Tested by

no test coverage detected