本文整理汇总了C++中Fl_Check_Button::deactivate方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Check_Button::deactivate方法的具体用法?C++ Fl_Check_Button::deactivate怎么用?C++ Fl_Check_Button::deactivate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Check_Button
的用法示例。
在下文中一共展示了Fl_Check_Button::deactivate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: strdup
// add a parameter number to the tree
Fl_Widget *onelabGroup::_addParameterWidget(onelab::number &p, int ww, int hh, Fl_Tree_Item *n, bool highlight, Fl_Color c)
{
char *path = strdup(getPath(n).c_str());
_treeStrings.push_back(path);
// enumeration (display choices as value labels, not numbers)
if(p.getChoices().size() &&
p.getChoices().size() == p.getValueLabels().size()){
Fl_Choice *but = new Fl_Choice(1, 1, ww, hh);
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;
}
}
but->callback(onelab_number_choice_cb, (void*)path);
but->align(FL_ALIGN_RIGHT);
if(p.getReadOnly()) but->deactivate();
return but;
}
// check box (boolean choice)
if(p.getChoices().size() == 2 &&
p.getChoices()[0] == 0 && p.getChoices()[1] == 1){
n->labelsize(FL_NORMAL_SIZE + 2);
Fl_Check_Button *but = new Fl_Check_Button(1, 1, ww / _widgetLabelRatio, hh);
but->box(FL_FLAT_BOX);
but->color(_tree->color());
but->value(p.getValue());
but->callback(onelab_number_check_button_cb, (void*)path);
if(highlight) but->color(c);
if(p.getReadOnly()) but->deactivate();
return but;
}
// non-editable value
if(p.getReadOnly()){
outputRange *but = new outputRange(1, 1, ww, hh);
//TODO but->callback(onelab_number_output_range_cb, (void*)path);
but->value(p.getValue());
but->align(FL_ALIGN_RIGHT);
but->graph(p.getAttribute("Graph"));
if(highlight) but->color(c);
return but;
}
// general number input
inputRange *but = new inputRange(1, 1, ww, hh, onelab::parameter::maxNumber(),
p.getAttribute("ReadOnlyRange") == "1");
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"));
but->callback(onelab_number_input_range_cb, (void*)path);
but->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY);
but->align(FL_ALIGN_RIGHT);
if(highlight) but->color(c);
return but;
}
示例3: make_mods_window
Fl_Double_Window* make_mods_window() {
if(mods_window != nullptr) {
delete (Fl_Double_Window*)mods_window;
mods_window = nullptr;
}
std::shared_ptr<AppendAIPatch> aip = std::dynamic_pointer_cast<AppendAIPatch>(mods->get("aip"));
Fl_Double_Window* w;
{ Fl_Double_Window* o = new Fl_Double_Window(264, 340, "Special Mods");
w = o;
{ new DoneButton(5, 310, 255, 25, "Close Window");
} // Fl_Button* o
{ Fl_Check_Button* o = new ModCheckbox("dpos", 5, 10, 255, 15, "Dark ice caves and hell are possible");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_Check_Button* o = new ModCheckbox("alld", 5, 30, 255, 15, "All levels are dark");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_Check_Button* o = new ModCheckbox("smlt", 5, 50, 255, 15, "End Timer is not set to 99 minutes");
o->down_box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = new ModCheckbox("pret", 5, 70, 255, 15, "Display precise timer");
o->down_box(FL_DOWN_BOX);
}
{
{
init_appendai_choices();
init_appendai_list();
}
{ Fl_Check_Button* o = new Fl_Check_Button(5, 172+40, 255, 15, "Piranhas unaffected (anti-crash)");
o->callback(unstable_check_callback);
if(aip->ignored_entities().size() > 0) {
o->value(true);
}
else {
o->value(false);
}
}
}
std::shared_ptr<ShopContentsPatch> som = std::dynamic_pointer_cast<ShopContentsPatch>(mods->get("smo"));
{ Fl_Group* o = new Fl_Group(5, 190+25+40, 255, 45, "Shop Mods");
{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_JETPACK, 10, 195+25+40, 75, 15, "Jetpack");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_TELEPORTER, 85, 195+25+40, 90, 15, "Teleporter");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_COMPASS, 175, 195+25+40, 83, 15, "Compass");
o->down_box(FL_DOWN_BOX);
} // Fl_Check_Button* o
{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_MATTOCK, 10, 215+25+40, 85, 15, "Mattock");
o->down_box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = new ShopItemCheckbox(ITEM_BOMB_BOX, 85, 215+25+40, 110, 15, "Bomb Box");
o->down_box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = new Fl_Check_Button(175, 215+25+40, 110, 15, "1-2 Only");
o->down_box(FL_DOWN_BOX);
if(som->valid()) {
o->value(som->levels() == 4);
o->callback(shop_only12_callback);
}
else {
o->deactivate();
}
} // Fl_Check_Button* o
o->box(FL_UP_FRAME);
o->end();
} // Fl_Group* o
o->end();
} // Fl_Double_Window* o
mods_window = w;
return w;
}
示例4: sprintf
Fl_Scopes_Manager::Fl_Scopes_Manager(int x, int y, int width, int height, Fl_MDI_Viewport *s, const char *name)
{
Fl::lock();
s->begin();
Fl_MDI_Window *w = SWin = new Fl_MDI_Window(0, 0, width, height, name);
w->user_data((void *)this);
w->resizable(w->view());
w->titlebar()->close_button()->hide();
w->view()->begin();
Scopes_Tabs = new Fl_Tabs*[Num_Scopes];
Scope_Show = new Fl_Check_Button*[Num_Scopes];
Scope_Pause = new Fl_Button*[Num_Scopes];
Scope_OneShot = new Fl_Check_Button*[Num_Scopes];
Scope_Options = new Fl_Menu_Button*[Num_Scopes];
Grid_Color = new Fl_Button*[Num_Scopes];
Bg_Color = new Fl_Button*[Num_Scopes];
Sec_Div = new Fl_Input_Browser*[Num_Scopes];
Save_Type = new Fl_Check_Button*[Num_Scopes];
Save_Points = new Fl_Int_Input*[Num_Scopes];
Save_Time = new Fl_Float_Input*[Num_Scopes];
Save_File = new Fl_Input*[Num_Scopes];
Save = new Fl_Light_Button*[Num_Scopes];
Save_Flag = new int[Num_Scopes];
Save_File_Pointer = new FILE*[Num_Scopes];
Trace_Page = new Fl_Group**[Num_Scopes];
Trace_Show = new Fl_Check_Button**[Num_Scopes];
Units_Div = new Fl_Input_Browser**[Num_Scopes];
Trace_Color = new Fl_Button**[Num_Scopes];
Trace_Pos = new Fl_Dial**[Num_Scopes];
Trace_Width = new Fl_Dial**[Num_Scopes];
Trigger_Mode = new Fl_Choice*[Num_Scopes];
Trace_Options = new Fl_Menu_Button**[Num_Scopes];
Scope_Windows = new Fl_Scope_Window*[Num_Scopes];
for (int i = 0; i < Num_Scopes; i++) {
Save_Flag[i] = false;
{ Fl_Tabs *o = Scopes_Tabs[i] = new Fl_Tabs(160, 5, width-165, height-40);
o->new_page("General");
{ Fl_Check_Button *o = Scope_Show[i] = new Fl_Check_Button(10, 25, 100, 20, "Show/Hide");
o->callback((Fl_Callback *)show_scope, (void *)i);
}
{ Fl_Button *o = Scope_Pause[i] = new Fl_Button(10, 75, 90, 25, "Trigger");
o->value(0);
o->deactivate();
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback *)pause_scope, (void *)i);
}
{ Fl_Check_Button *o = Scope_OneShot[i] = new Fl_Check_Button(10, 50, 100, 20, "OneShot/Run");
o->deactivate();
o->callback((Fl_Callback *)oneshot_scope, (void *)i);
}
{ Fl_Menu_Button *o = Scope_Options[i] = new Fl_Menu_Button(10, 105, 90, 25, "Options");
o->menu(Scope_Opts);
o->when(FL_WHEN_ENTER_KEY);
o->child(0)->set_value();
o->callback((Fl_Callback *)enter_options, (void *)i);
}
{ Fl_Button *o = Grid_Color[i] = new Fl_Button(10, 135, 90, 25, "Grid Color");
o->callback((Fl_Callback *)select_grid_color, (void *)i);
}
{ Fl_Button *o = Bg_Color[i] = new Fl_Button(10, 165, 90, 25, "Bg Color");
o->callback((Fl_Callback *)select_bg_color, (void *)i);
}
{ Fl_Input_Browser *o = Sec_Div[i] = new Fl_Input_Browser(200, 25, 60, 20, "Sec/Div: ");
o->add("0.001|0.005|0.01|0.05|0.1|0.5|1");
o->align(FL_ALIGN_LEFT);
o->value("0.1");
o->when(FL_WHEN_ENTER_KEY);
o->callback((Fl_Callback *)enter_secdiv, (void *)i);
}
{ Fl_Check_Button *o = Save_Type[i] = new Fl_Check_Button(140, 50, 100, 20, "Points/Time");
o->value(1);
o->callback((Fl_Callback *)select_save, (void *)i);
}
{ Fl_Int_Input *o = Save_Points[i] = new Fl_Int_Input(200, 75, 60, 20, "N Points: ");
o->align(FL_ALIGN_LEFT);
o->value("1000");
}
{ Fl_Float_Input *o = Save_Time[i] = new Fl_Float_Input(200, 105, 60, 20, "Time [s]: ");
o->align(FL_ALIGN_LEFT);
o->value("1.0");
o->deactivate();
}
{ Fl_Input *o = Save_File[i] = new Fl_Input(200, 135, 100, 20, "Filename:");
char buf[100];
o->align(FL_ALIGN_LEFT);
sprintf(buf, "%s", Scopes[i].name);
o->value(buf);
}
{ Fl_Light_Button *o = Save[i] = new Fl_Light_Button(140, 165, 90, 25, "Save");
o->selection_color(FL_BLACK);
o->callback((Fl_Callback *)enable_saving, (void *)i);
}
//.........这里部分代码省略.........