本文整理汇总了C++中Fl_Check_Button类的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Check_Button类的具体用法?C++ Fl_Check_Button怎么用?C++ Fl_Check_Button使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fl_Check_Button类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: window
window(int x, int y, int w, int h, const char *label = 0)
: Fl_Window(x, y, w, h, label)
{
Fl_Box *o = new Fl_Box(10, 10, 300, 25,
"Open CSV file to convert to HTML -->");
o->box(FL_BORDER_BOX);
o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER);
o->color((Fl_Color)215);
o->labelfont(FL_HELVETICA_BOLD);
Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files");
but->callback(on_pick_button_click, this);
encode_check = new Fl_Check_Button(10, 40, 280, 25,
"Escape special HTML characters.");
encode_check->value(1);
open_file_check = new Fl_Check_Button(10, 65, 280, 25,
"Open HTML in browser.");
open_file_check->value(1);
Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li");
author->box(FL_FLAT_BOX);
author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
author->labelsize(12);
author->labelcolor(fl_rgb_color(128, 128, 128));
author->callback(on_author_click, this);
}
示例2: useserver_cb
void useserver_cb(Fl_Widget *w, void *arg)
{
if(!arg) return;
Fl_Check_Button *checkbox = (Fl_Check_Button *)w;
onelabGroup *obj = (onelabGroup *)arg;
obj->useServer(checkbox->value() == 1);
}
示例3: addParameter
void onelabGroup::updateParameter(onelab::number &p)
{
Fl_Tree_Item *n = _tree->find_item(p.getName().c_str());
if(!n) {
addParameter(p);
return;
}
Fl_Group *grp = (Fl_Group *)n->widget();
// enumeration (display choices as value labels, not numbers)
if(p.getChoices().size() &&
p.getChoices().size() == p.getValueLabels().size()){
Fl_Choice *but = (Fl_Choice *)grp->child(0);
//std::vector<Fl_Menu_Item> menu;
//std::map<double, std::string> labels(p.getValueLabels());
//for(std::map<double, std::string>::iterator it = labels.begin();
// it != labels.end(); it++){
// char *str = strdup(it->second.c_str());
// _treeStrings.push_back(str);
// Fl_Menu_Item menuItem = {str, 0, 0, 0, 0};
// if(highlight) menuItem.labelcolor(c);
// menu.push_back(menuItem);
//}
//Fl_Menu_Item it = {0};
//menu.push_back(it);
//but->copy(&menu[0]);
for(unsigned int i = 0; i < p.getChoices().size(); i++){
if(p.getValue() == p.getChoices()[i]){
but->value(i);
break;
}
}
return;
}
// check box (boolean choice)
if(p.getChoices().size() == 2 &&
p.getChoices()[0] == 0 && p.getChoices()[1] == 1){
Fl_Check_Button *but = (Fl_Check_Button *)grp->child(0);
but->value(p.getValue());
return;
}
// non-editable value FIXME
if(p.getReadOnly()){
outputRange *but = (outputRange *)grp->child(0);;
but->value(p.getValue());
but->graph(p.getAttribute("Graph"));
return;
}
// general number input
inputRange *but = (inputRange *)grp->child(0);
but->value(p.getValue());
but->minimum(p.getMin());
but->maximum(p.getMax());
but->step(p.getStep());
but->choices(p.getChoices());
but->loop(p.getAttribute("Loop"));
but->graph(p.getAttribute("Graph"));
}
示例4: main
int main(int argc, char **argv) {
ThemeLoader::init();
IconLoader::init();
win = new EdeWindow(455, 485, "Theme demo");
win->begin();
{ Fl_Button* o = new Fl_Button(355, 450, 90, 25, "Load");
o->tooltip("Load predefined theme");
o->callback(load_theme_cb);
} // Fl_Button* o
{ Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 455, 25);
o->menu(menu_);
} // Fl_Menu_Bar* o
{ Fl_Round_Button* o = new Fl_Round_Button(5, 285, 90, 25, "round");
o->down_box(FL_ROUND_DOWN_BOX);
} // Fl_Round_Button* o
{ new Fl_Return_Button(5, 195, 90, 25, "button");
} // Fl_Return_Button* o
{ new Fl_Input(160, 196, 285, 25, "input:");
} // Fl_Input* o
{ Fl_Output* o = new Fl_Output(160, 225, 285, 25, "output:");
o->value("Some output value");
} // Fl_Output* o
{ Fl_File_Browser* o = new Fl_File_Browser(5, 30, 210, 125);
o->load("/");
} // Fl_File_Browser* o
{ Fl_Check_Browser* o = new Fl_Check_Browser(220, 30, 225, 125);
o->add("foo");
o->add("foo");
o->add("foo");
} // Fl_Check_Browser* o
{ Fl_Progress* o = new Fl_Progress(5, 160, 210, 25, "progress bar");
o->value(50);
} // Fl_Progress* o
{ Fl_Slider* o = new Fl_Slider(220, 160, 225, 25);
o->type(1);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
} // Fl_Slider* o
{ new Fl_Light_Button(5, 225, 90, 25, "button");
} // Fl_Light_Button* o
{ Fl_Check_Button* o = new Fl_Check_Button(5, 255, 90, 25, "check");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_File_Input* o = new Fl_File_Input(160, 256, 285, 35, "file:");
o->value("/home/foo/baz/taz.txt");
} // Fl_File_Input* o
{ Fl_Text_Editor* o = new Fl_Text_Editor(160, 325, 285, 115, "Text editor");
o->buffer(new Fl_Text_Buffer());
} // Fl_Text_Editor* o
{ Fl_Box* o = new Fl_Box(25, 328, 80, 80, "image");
IconLoader::set(o, "utilities-terminal", ICON_SIZE_MEDIUM);
} // Fl_Box* o
win->end();
win->show(argc, argv);
Fl::run();
ThemeLoader::shutdown();
IconLoader::shutdown();
return 0;
}
示例5: cb_startup
void window::cb_startup(Fl_Widget *widget, void *v)
{
Fl_Check_Button *checkbox = (Fl_Check_Button*)widget;
int result = registry::startup_save(checkbox->value());
if (result != ERROR_SUCCESS)
checkbox->deactivate();
}
示例6: shop_only12_callback
void shop_only12_callback(Fl_Widget* widget) {
Fl_Check_Button* check = dynamic_cast<Fl_Check_Button*>(widget);
std::shared_ptr<ShopContentsPatch> som = std::dynamic_pointer_cast<ShopContentsPatch>(mods->get("smo"));
if(check->value()) {
som->set_levels(4);
}
else {
som->set_levels(0xFFFFFFFF);
}
}
示例7: Init
void Init() {
cWindow = new Fl_Window(400, 420, 300, 70, "Connect to Host");
bInput = new Fl_Input(50, 0, 150, 30, "Host: ");
checkbx = new Fl_Check_Button(50, 40, 100, 14, " Scaling");
checkbx->align(FL_ALIGN_LEFT);
checkbx->callback(setscale, this);
connectbtn = new Fl_Button(200, 0, 80, 30, "Connect");
connectbtn->callback(try_connect_frm, this);
cWindow->end();
cWindow->show();
}
示例8: unstable_check_callback
void unstable_check_callback(Fl_Widget* widget) {
std::shared_ptr<AppendAIPatch> aip = std::dynamic_pointer_cast<AppendAIPatch>(mods->get("aip"));
Fl_Check_Button* unstable = dynamic_cast<Fl_Check_Button*>(widget);
if(unstable->value()) {
AppendAIPatch::entity_storage stor;
stor.push_back(ENTITY_PIRANHA);
stor.push_back(ENTITY_FISH_CRITTER);
stor.push_back(ENTITY_PIRANHA_CRITTER);
aip->set_ignored_entities(stor);
}
else {
aip->set_ignored_entities(AppendAIPatch::entity_storage());
}
}
示例9: onelab_number_check_button_cb
static void onelab_number_check_button_cb(Fl_Widget *w, void *data)
{
if(!data) return;
std::string name((char*)data);
std::vector<onelab::number> numbers;
OnelabDatabase::instance()->get(numbers, name);
if(numbers.size()){
Fl_Check_Button *o = (Fl_Check_Button*)w;
onelab::number old = numbers[0];
numbers[0].setValue(o->value());
setGmshOption(numbers[0]);
OnelabDatabase::instance()->set(numbers[0], std::string("localGUI"));
autoCheck(old, numbers[0]);
}
}
示例10: dpms_enable_cb
static void dpms_enable_cb(Fl_Widget* w, void* s) {
Fl_Check_Button* o = (Fl_Check_Button*)w;
SaverPrefs* sp = (SaverPrefs*)s;
if(o->value()) {
standby_val->activate();
suspend_val->activate();
off_val->activate();
} else {
standby_val->deactivate();
suspend_val->deactivate();
off_val->deactivate();
}
sp->dpms_enabled = o->value();
}
示例11: Fl_Double_Window
//-----------------------------------------------------------------------------
void NrmDlg::create_dlg()
{
Fl_Menu_Item k[]={{"x"}, {"y"}, { "z"}, {0}};
wnd = new Fl_Double_Window(135, 215);
min = new Fl_Value_Input(10, 25, 115, 25, mgl_gettext("Minimal value (v1)"));
min->align(FL_ALIGN_TOP_LEFT);
min->tooltip(mgl_gettext("Minimal value for resulting data values"));
max = new Fl_Value_Input(10, 70, 115, 25, mgl_gettext("Maximal value (v2)"));
max->align(FL_ALIGN_TOP_LEFT);
max->tooltip(mgl_gettext("Maximal value for resulting data values"));
dir = new Fl_Choice(10, 115, 115, 25, mgl_gettext("Direction"));
dir->align(FL_ALIGN_TOP_LEFT); dir->copy(k);
dir->tooltip(mgl_gettext("Direction along which data will be filled"));
sym = new Fl_Check_Button(10, 115, 115, 25, mgl_gettext("Symetrical range"));
sym->tooltip(mgl_gettext("Normalize in symmetrical range: -max(|v1|,|v2|) ... max(|v1|,|v2|)"));
Fl_Button *o;
o = new Fl_Button(25, 150, 85, 25, mgl_gettext("Cancel")); o->callback(close_dlg_cb,wnd);
o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX);
o->tooltip(mgl_gettext("Do nothing and close this window"));
o = new Fl_Return_Button(25, 180, 85, 25, mgl_gettext("Change"));o->callback(nrm_dlg_cb,wnd);
o->box(UDAV_UP_BOX); o->down_box(UDAV_DOWN_BOX);
o->tooltip(mgl_gettext("Change data values and close this window"));
wnd->end();
}
示例12: onelab_listen_udt_cb
void onelab_listen_udt_cb(Fl_Widget *w, void *data)
{
Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
Fl_Input *sockUDT = (Fl_Input *)data;
if(checkbutton->value() == 1) {
sockUDT->deactivate();
CTX::instance()->onelab.udtSock = sockUDT->value();
std::size_t colon = CTX::instance()->onelab.udtSock.find(":");
OnelabServer::instance()->listenOnTcp(
ip4_inet_pton(CTX::instance()->onelab.udtSock.substr(0, colon).c_str()),
atoi(CTX::instance()->onelab.udtSock.substr(colon+1, CTX::instance()->onelab.udtSock.size()-colon-1).c_str()));
}
else {
sockUDT->activate();
OnelabServer::instance()->stopUdt();
}
}
示例13: onelab_listen_unix_cb
void onelab_listen_unix_cb(Fl_Widget *w, void *data)
{
Fl_Check_Button *checkbutton = (Fl_Check_Button *)w;
Fl_Input *sockUNIX = (Fl_Input *)data;
if(checkbutton->value() == 1) {
sockUNIX->deactivate();
CTX::instance()->onelab.unixSock = sockUNIX->value();
std::size_t colon = CTX::instance()->onelab.unixSock.find(":");
std::ostringstream tmp;
tmp << CTX::instance()->homeDir << CTX::instance()->onelab.unixSock;
OnelabServer::instance()->listenOnUnix(tmp.str().c_str());
}
else {
sockUNIX->activate();
OnelabServer::instance()->stopUnix();
}
}
示例14: GetParticipants
/*
Called everytime we click the refresh button. This will request all participants
and update the UI.
*/
void SelectorGUI::update(){
int x = 40;
int y = 10;
int dy = 20;
int i = 0;
int len = 0;
swindow->clear();
swindow->redraw();
swindow->begin();
len = GetParticipants(pList);
for(i; i < len; i ++){
ssrcList[i] = (char*)pList[i].ssrc;
Fl_Check_Button* b = new Fl_Check_Button(x, y, 300, 30, pList[i].name);
b->callback(static_selectCB, (void*) pList[i].ssrc);
b->type(102);
y = y + dy;
}
swindow->end();
swindow->redraw();
}
示例15: assert
//==== Create & Init Gui CheckButton ====//
void GroupLayout::AddButton( CheckButton& cbutton, const char* label )
{
assert( m_Group && m_Screen );
//==== Add Check Button ====//
int bw = FitWidth( 0, m_ButtonWidth );
Fl_Check_Button* flbutton = new Fl_Check_Button( m_X, m_Y, bw, m_StdHeight, label );
flbutton->box( FL_DOWN_BOX );
flbutton->down_box( FL_DOWN_BOX );
flbutton->labelfont( 1 );
flbutton->labelsize( 12 );
flbutton->labelcolor( FL_DARK_BLUE );
flbutton->copy_label( label );
m_Group->add( flbutton );
AddX( bw );
AddY( m_StdHeight );
NewLineX();
cbutton.Init( m_Screen, flbutton );
}