本文整理汇总了C++中Fl_Button::color方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Button::color方法的具体用法?C++ Fl_Button::color怎么用?C++ Fl_Button::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Button
的用法示例。
在下文中一共展示了Fl_Button::color方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shadedColorCB
static void shadedColorCB( Fl_Widget *w, void* )
{
Fl_Button *b = (Fl_Button*)w;
b->color( fl_show_colormap( b->color() ) );
b->redraw();
tree->shaded_entry_colors( shadedEvenColor->color(), shadedOddColor->color() );
tree->redraw();
}
示例2: changeBoxColor
void changeBoxColor(Fl_Button *box) {
Fl_Button *colorBox = box;
Fl_Color oldColor = colorBox->color();
Fl_Color defColor = oldColor;
fl_color_chooser(_("Choose color"), defColor);
if ( defColor != oldColor ) {
colorBox->color(defColor);
colorBox->redraw();
}
}
示例3: cb_open_about
void cb_open_about() {
{ a_diag = new Fl_Double_Window(210, 165, "About");
a_diag->color((Fl_Color)29);
{ a_mess = new Fl_Group(5, 10, 200, 45, "Calc 80");
a_mess->box(FL_RFLAT_BOX);
a_mess->color((Fl_Color)206);
a_mess->labelsize(21);
a_mess->align(Fl_Align(FL_ALIGN_CENTER));
a_mess->end();
} // Fl_Group* a_mess
{ Fl_Group* o = new Fl_Group(5, 70, 205, 25, "Version 0.04");
o->align(Fl_Align(FL_ALIGN_CENTER));
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(10, 95, 200, 25, "\302\251""2016, Patrik Wallander");
o->align(Fl_Align(FL_ALIGN_CENTER));
o->end();
} // Fl_Group* o
{ Fl_Button* o = new Fl_Button(70, 135, 70, 20, "Close");
o->box(FL_RFLAT_BOX);
o->color(FL_BACKGROUND2_COLOR);
o->callback((Fl_Callback*)cb_close_about);
} // Fl_Button* o
a_diag->show();
a_diag->position(m_win->x(), m_win->y());
a_diag->end();
} // Fl_Double_Window* a_diag
}
示例4: button_cb
// program button
void button_cb(Fl_Widget* buttonptr, void* data)
{
const char* program_call = (const char*) data;
Fl_Button *butt;
butt = (Fl_Button *) buttonptr;
butt->color(button_pressed__color);
execute_program(program_call,NULL);
}
示例5: make_about_panel
Fl_Window* make_about_panel(const char *copyright) {
Fl_Window* w;
{Fl_Window* o = about_panel = new Fl_Window(330, 276, _("About eFluid"));
w = o;
o->type(240);
o->selection_color((Fl_Color)47);
o->shortcut(0xff1b);
{Fl_Group* o = display_group = new Fl_Group(0, 0, 330, 240);
{Fl_Group* o = new Fl_Group(5, 5, 320, 55, _("eFluid"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->label_type(FL_EMBOSSED_LABEL);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->selection_color((Fl_Color)47);
o->label_size(40);
o->align(FL_ALIGN_INSIDE);
o->end();
}
{Fl_Button* o = new Fl_Button(5, 165, 320, 70, _("\302\251""2002-2003\nClick here for more information"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->highlight_color((Fl_Color)0x9d9da700);
o->highlight_label_color((Fl_Color)55);
o->label_size(14);
o->callback((Fl_Callback*)cb_2002);
o->align(FL_ALIGN_WRAP);
}
{Fl_Box* o = new Fl_Box(5, 60, 320, 105, _("EFLTK User Interface Designer\nVersion 2.0.3"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->label_type(FL_EMBOSSED_LABEL);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->selection_color((Fl_Color)47);
o->label_size(18);
}
o->end();
}
{Fl_Box* o = copyright_box = new Fl_Box(0, 0, 330, 240);
o->label_size(10);
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP);
o->hide();
o->label(copyright);
}
{Fl_Return_Button* o = new Fl_Return_Button(5, 245, 320, 25, _("OK"));
o->label_size(10);
o->shortcut(0xff0d);
o->callback((Fl_Callback*)cb_OK);
}
o->end();
}
return w;
}
示例6: main
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(400,350);
int y = 10;
input[0] = new Fl_Input(70,y,300,23,"Normal:"); y += 27;
input[0]->tooltip("Normal input field");
// input[0]->cursor_color(FL_SELECTION_COLOR);
// input[0]->maximum_size(20);
// input[0]->static_value("this is a testgarbage");
input[1] = new Fl_Float_Input(70,y,300,23,"Float:"); y += 27;
input[1]->tooltip("Input field for floating-point number");
input[2] = new Fl_Int_Input(70,y,300,23,"Int:"); y += 27;
input[2]->tooltip("Input field for integer number");
input[3] = new Fl_Secret_Input(70,y,300,23,"Secret:"); y += 27;
input[3]->tooltip("Input field for password");
input[4] = new Fl_Wordwrap_Input(70,y,300,100,"Wordwrap:"); y += 105;
input[4]->tooltip("Input field for short text with newlines");
for (int i = 0; i < 4; i++) {
input[i]->when(0); input[i]->callback(cb);
}
int y1 = y;
Fl_Button *b;
b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&CHANGED");
b->tooltip("Do callback each time the text changes");
b->callback(toggle_cb, FL_WHEN_CHANGED); y += 23;
b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&RELEASE");
b->callback(toggle_cb, FL_WHEN_RELEASE); y += 23;
b->tooltip("Do callback when widget loses focus");
b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&ENTER_KEY");
b->callback(toggle_cb, FL_WHEN_ENTER_KEY); y += 23;
b->tooltip("Do callback when user hits Enter key");
b = new Fl_Toggle_Button(10,y,200,23,"FL_WHEN_&NOT_CHANGED");
b->callback(toggle_cb, FL_WHEN_NOT_CHANGED); y += 23;
b->tooltip("Do callback even if the text is not changed");
y += 5;
b = new Fl_Button(10,y,200,23,"&print changed()");
b->callback(button_cb);
b->tooltip("Print widgets that have changed() flag set");
b = new Fl_Button(220,y1,100,23,"color"); y1 += 23;
b->color(input[0]->color()); b->callback(color_cb, (void*)0);
b->label_color(fl_contrast(FL_BLACK,b->color()));
b->tooltip("Color behind the text");
b = new Fl_Button(220,y1,100,23,"selection_color"); y1 += 23;
b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1);
b->label_color(fl_contrast(FL_BLACK,b->color()));
b->tooltip("Color behind selected text");
b = new Fl_Button(220,y1,100,23,"text_color"); y1 += 23;
b->color(input[0]->text_color()); b->callback(color_cb, (void*)2);
b->label_color(fl_contrast(FL_BLACK,b->color()));
b->tooltip("Color of the text");
window->resizable(window);
window->end();
window->show(argc,argv);
// CET - FIXME - crashes windows Fl::lock();
return Fl::run();
}
示例7: Fl_Button
void
make_window_banks ()
{
int i, j, x, y, num;
int elw, elh;
elw = 176 * gui.BankWindow->w () / 800;
elh = 24 * gui.BankWindow->h () / 600;
gui.ob->begin ();
x = 40;
y = 10;
num = 0;
for (i = 1; i < 21; i++)
{
y += elh + 2;
for (j = 1; j < 5; j++)
{
Fl_Button *butX =
new Fl_Button (x + 1, y + 1, elw, elh, Banco[num].Name);
butX->type (0);
butX->color (FL_BLUE);
butX->box (FL_FLAT_BOX);
butX->selection_color (FL_RED);
butX->labelsize (14);
butX->align (68 | FL_ALIGN_INSIDE);
butX->user_data ((void *) (num));
butX->value (0);
butX->callback ((Fl_Callback *) preset_click);
gui.ob->add (butX);
x += elw + 4;
num++;
}
x = 40;
}
gui.ob->end ();
gui.made = 1;
}
示例8: main
int main(int argc, char** argv) {
Fl_Window window(5*75,400);
window.box(FL_NO_BOX);
Fl_Scroll scroll(0,0,5*75,300);
Fl_Group g(0, 0, 5*75, 8*25);
int n = 0;
for (int y=0; y<16; y++) for (int x=0; x<5; x++) {
char buf[20]; sprintf(buf,"%d",n++);
if (y==8 && x==0) g.end();
Fl_Button* b = new Fl_Button(x*75,y*25+(y>=8?5*75:0),75,25,strdup(buf));
b->color(n);
b->selection_color(n);
b->label_color(FL_WHITE);
b->selection_text_color(FL_WHITE);
}
g.end();
Drawing drawing(0,8*25,5*75,5*75,0);
scroll.end();
window.resizable(scroll);
Fl_Box box(0,300,5*75,window.h()-300); // gray area below the scroll
box.box(FL_FLAT_BOX);
Fl_Toggle_Button but1(150, 310, 200, 25, "box");
but1.set();
but1.callback(box_cb);
Fl_Choice choice(150, 335, 200, 25, "type():");
choice.menu(choices);
choice.value(3);
Fl_Choice achoice(150, 360, 200, 25, "scrollbar_align():");
achoice.menu(align_choices);
achoice.value(3);
thescroll = &scroll;
//scroll.box(FL_DOWN_BOX);
//scroll.type(Fl_Scroll::VERTICAL);
window.end();
window.show(argc,argv);
return Fl::run();
}
示例9: _addMenu
void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback, void *data)
{
Fl_Tree_Item *n = _tree->add(path.c_str());
_tree->begin();
int ww = _baseWidth - (n->depth() + 1) * _indent;
int hh = n->labelsize() + 4;
Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
Fl_Button *but = new Fl_Button(1, 1, ww, hh);
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
but->callback(callback, data);
but->box(FL_FLAT_BOX);
but->color(_tree->color());
but->selection_color(_tree->color());
grp->end();
if(!_enableTreeWidgetResize) grp->resizable(0);
_treeWidgets.push_back(grp);
std::string label = path;
std::string::size_type last = path.find_last_of('/');
if(last != std::string::npos) label = path.substr(last + 1);
but->copy_label(label.c_str());
n->widget(grp);
_tree->end();
}
示例10: make_formant_window
Fl_Double_Window* FilterUI::make_formant_window() {
{ formantparswindow = new Fl_Double_Window(700, 205, "Formant Filter Parameters");
formantparswindow->user_data((void*)(this));
{ Fl_Group* o = new Fl_Group(485, 47, 105, 113);
o->box(FL_THIN_UP_BOX);
{ Fl_Counter* o = new Fl_Counter(545, 80, 40, 15, "Formant ");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textsize(10);
o->callback((Fl_Callback*)cb_Formant);
o->align(FL_ALIGN_LEFT);
o->bounds(0,FF_MAX_FORMANTS-1);
o->value(nformant);
} // Fl_Counter* o
{ Fl_Counter* o = new Fl_Counter(545, 55, 40, 20, "Vowel no.");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textfont(1);
o->textsize(11);
o->callback((Fl_Callback*)cb_Vowel);
o->align(FL_ALIGN_LEFT);
o->bounds(0,FF_MAX_VOWELS-1);
o->value(nvowel);
} // Fl_Counter* o
{ formantparsgroup = new Fl_Group(490, 105, 95, 50);
formantparsgroup->box(FL_ENGRAVED_FRAME);
{ formant_freq_dial = new WidgetPDial(495, 115, 25, 25, "freq");
formant_freq_dial->tooltip("Formant frequency");
formant_freq_dial->box(FL_ROUND_UP_BOX);
formant_freq_dial->color(FL_BACKGROUND_COLOR);
formant_freq_dial->selection_color(FL_INACTIVE_COLOR);
formant_freq_dial->labeltype(FL_NORMAL_LABEL);
formant_freq_dial->labelfont(0);
formant_freq_dial->labelsize(10);
formant_freq_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_freq_dial->maximum(127);
formant_freq_dial->step(1);
formant_freq_dial->callback((Fl_Callback*)cb_formant_freq_dial);
formant_freq_dial->align(FL_ALIGN_BOTTOM);
formant_freq_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_freq_dial
{ formant_q_dial = new WidgetPDial(525, 115, 24, 25, "Q");
formant_q_dial->tooltip("Formant\'s Q");
formant_q_dial->box(FL_ROUND_UP_BOX);
formant_q_dial->color(FL_BACKGROUND_COLOR);
formant_q_dial->selection_color(FL_INACTIVE_COLOR);
formant_q_dial->labeltype(FL_NORMAL_LABEL);
formant_q_dial->labelfont(0);
formant_q_dial->labelsize(10);
formant_q_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_q_dial->maximum(127);
formant_q_dial->step(1);
formant_q_dial->callback((Fl_Callback*)cb_formant_q_dial);
formant_q_dial->align(FL_ALIGN_BOTTOM);
formant_q_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_q_dial
{ formant_amp_dial = new WidgetPDial(555, 115, 24, 25, "amp");
formant_amp_dial->tooltip("Formant amplitude");
formant_amp_dial->box(FL_ROUND_UP_BOX);
formant_amp_dial->color(FL_BACKGROUND_COLOR);
formant_amp_dial->selection_color(FL_INACTIVE_COLOR);
formant_amp_dial->labeltype(FL_NORMAL_LABEL);
formant_amp_dial->labelfont(0);
formant_amp_dial->labelsize(10);
formant_amp_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_amp_dial->maximum(127);
formant_amp_dial->step(1);
formant_amp_dial->callback((Fl_Callback*)cb_formant_amp_dial);
formant_amp_dial->align(FL_ALIGN_BOTTOM);
formant_amp_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_amp_dial
formantparsgroup->end();
} // Fl_Group* formantparsgroup
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(590, 47, 100, 113);
o->box(FL_THIN_UP_BOX);
{ Fl_Counter* o = new Fl_Counter(595, 62, 55, 20, "Seq.Size");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textfont(1);
o->textsize(11);
o->callback((Fl_Callback*)cb_Seq);
o->align(FL_ALIGN_TOP_LEFT);
o->bounds(1,FF_MAX_SEQUENCE-1);
o->value(pars->Psequencesize);
} // Fl_Counter* o
{ Fl_Counter* o = new Fl_Counter(595, 97, 40, 15, "S.Pos.");
//.........这里部分代码省略.........
示例11: strdup
// add parameter string to tree
Fl_Widget *onelabGroup::_addParameterWidget(onelab::string &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);
// macro button
if(p.getAttribute("Macro") == "Gmsh"){
Fl_Button *but = new Fl_Button(1, 1, ww / _widgetLabelRatio, hh);
but->box(FL_FLAT_BOX);
but->color(_tree->color());
but->selection_color(_tree->color());
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
//TODO but->callback(onelab_string_button_cb, (void*)path);
if(highlight) but->color(c);
return but;
}
// non-editable value
if(p.getReadOnly()){
Fl_Output *but = new Fl_Output(1, 1, ww, hh);
but->value(p.getValue().c_str());
but->align(FL_ALIGN_RIGHT);
if(highlight) but->color(c);
return but;
}
// simple string (no menu)
if(p.getChoices().empty() && p.getKind() != "file"){
Fl_Input *but = new Fl_Input(1, 1, ww, hh);
but->value(p.getValue().c_str());
//TODO but->callback(onelab_string_input_cb, (void*)path);
but->when(FL_WHEN_ENTER_KEY);
but->align(FL_ALIGN_RIGHT);
if(highlight) but->color(c);
return but;
}
// general string input
Fl_Input_Choice *but = new Fl_Input_Choice(1, 1, ww, hh);
std::string multipleSelection = p.getAttribute("MultipleSelection");
if(multipleSelection.size())
;//but->menubutton()->callback(multiple_selection_menu_cb, but);
std::vector<Fl_Menu_Item> menu;
for(unsigned int j = 0; j < p.getChoices().size(); j++){
char *str = strdup(p.getChoices()[j].c_str());
_treeStrings.push_back(str);
bool divider = (p.getKind() == "file" &&
j == p.getChoices().size() - 1);
int choice = multipleSelection.size() ? FL_MENU_TOGGLE : 0;
if(multipleSelection.size() > j && multipleSelection[j] == '1')
choice |= FL_MENU_VALUE;
Fl_Menu_Item it = {str, 0, 0, 0, divider ? FL_MENU_DIVIDER : choice};
menu.push_back(it);
}
//if(p.getKind() == "file"){
// Fl_Menu_Item it = {"Choose...", 0, onelab_input_choice_file_chooser_cb, (void*)n};
// menu.push_back(it);
// Fl_Menu_Item it2 = {"Edit...", 0, onelab_input_choice_file_edit_cb, (void*)n};
// menu.push_back(it2);
// if(GuessFileFormatFromFileName(p.getValue()) >= 0){
// Fl_Menu_Item it3 = {"Merge...", 0, onelab_input_choice_file_merge_cb, (void*)n};
// menu.push_back(it3);
// }
//}
Fl_Menu_Item it = {0};
menu.push_back(it);
but->menubutton()->copy(&menu[0]);
but->value(p.getValue().c_str());
but->callback(onelab_string_input_choice_cb, (void*)path);
but->input()->when(FL_WHEN_ENTER_KEY);
but->align(FL_ALIGN_RIGHT);
if(highlight) but->input()->color(c);
return but;
}
示例12: make_window
Fl_Double_Window* SUBnoteUI::make_window() {
{ SUBparameters = new Fl_Double_Window(735, 390, "SUBsynth Parameters");
SUBparameters->user_data((void*)(this));
{ Fl_Scroll* o = new Fl_Scroll(5, 140, 435, 245);
o->type(1);
o->box(FL_THIN_UP_BOX);
{ Fl_Pack* o = harmonics = new Fl_Pack(10, 145, 425, 235);
harmonics->type(1);
for (int i=0;i<MAX_SUB_HARMONICS;i++){h[i]=new SUBnoteharmonic(0,0,15,o->h(),"");h[i]->init(pars,i);}
harmonics->end();
} // Fl_Pack* harmonics
o->end();
} // Fl_Scroll* o
{ Fl_Button* o = new Fl_Button(625, 365, 105, 20, "Close");
o->box(FL_THIN_UP_BOX);
o->labelfont(1);
o->labelsize(11);
o->callback((Fl_Callback*)cb_Close);
} // Fl_Button* o
{ Fl_Group* o = new Fl_Group(5, 5, 215, 135, "AMPLITUDE");
o->box(FL_THIN_UP_FRAME);
o->labeltype(FL_EMBOSSED_LABEL);
o->labelfont(1);
o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
{ Fl_Value_Slider* o = vol = new Fl_Value_Slider(10, 25, 140, 15, "Vol");
vol->tooltip("Volume");
vol->type(5);
vol->box(FL_FLAT_BOX);
vol->labelsize(11);
vol->maximum(127);
vol->step(1);
vol->callback((Fl_Callback*)cb_vol);
vol->align(FL_ALIGN_RIGHT);
o->value(pars->PVolume);
} // Fl_Value_Slider* vol
{ Fl_Value_Slider* o = vsns = new Fl_Value_Slider(10, 45, 140, 15, "V.Sns");
vsns->tooltip("Velocity Sensing Function (rightmost to disable)");
vsns->type(5);
vsns->box(FL_FLAT_BOX);
vsns->labelsize(11);
vsns->maximum(127);
vsns->step(1);
vsns->callback((Fl_Callback*)cb_vsns);
vsns->align(FL_ALIGN_RIGHT);
o->value(pars->PAmpVelocityScaleFunction);
} // Fl_Value_Slider* vsns
{ WidgetPDial* o = pan = new WidgetPDial(185, 20, 30, 30, "Pan");
pan->tooltip("Panning (leftmost is Random)");
pan->box(FL_ROUND_UP_BOX);
pan->color(FL_BACKGROUND_COLOR);
pan->selection_color(FL_INACTIVE_COLOR);
pan->labeltype(FL_NORMAL_LABEL);
pan->labelfont(0);
pan->labelsize(10);
pan->labelcolor(FL_FOREGROUND_COLOR);
pan->maximum(127);
pan->step(1);
pan->callback((Fl_Callback*)cb_pan);
pan->align(FL_ALIGN_BOTTOM);
pan->when(FL_WHEN_CHANGED);
o->value(pars->PPanning);
} // WidgetPDial* pan
{ EnvelopeUI* o = ampenv = new EnvelopeUI(10, 65, 205, 70, "SUBsynth - Amplitude Envelope");
ampenv->box(FL_FLAT_BOX);
ampenv->color((Fl_Color)51);
ampenv->selection_color(FL_BACKGROUND_COLOR);
ampenv->labeltype(FL_NORMAL_LABEL);
ampenv->labelfont(0);
ampenv->labelsize(14);
ampenv->labelcolor(FL_FOREGROUND_COLOR);
ampenv->align(FL_ALIGN_WRAP|FL_ALIGN_INSIDE);
ampenv->when(FL_WHEN_RELEASE);
o->init(pars->AmpEnvelope,master);
ampenv->end();
} // EnvelopeUI* ampenv
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(495, 325, 235, 35);
o->box(FL_THIN_UP_FRAME);
{ Fl_Counter* o = filterstages = new Fl_Counter(515, 340, 45, 15, "Filter Stages");
filterstages->tooltip("How many times the noise is filtered");
filterstages->type(1);
filterstages->labelfont(1);
filterstages->labelsize(10);
filterstages->minimum(1);
filterstages->maximum(5);
filterstages->step(1);
filterstages->textsize(10);
filterstages->callback((Fl_Callback*)cb_filterstages);
filterstages->align(FL_ALIGN_TOP);
o->value(pars->Pnumstages);
} // Fl_Counter* filterstages
{ Fl_Choice* o = magtype = new Fl_Choice(585, 340, 65, 15, "Mag.Type");
magtype->down_box(FL_BORDER_BOX);
magtype->labelfont(1);
magtype->labelsize(10);
magtype->textsize(11);
magtype->callback((Fl_Callback*)cb_magtype);
magtype->align(FL_ALIGN_TOP);
magtype->menu(menu_magtype);
//.........这里部分代码省略.........
示例13: make_window
Fl_Group* FilterUI::make_window() {
{ filterui = new Fl_Group(0, 0, 275, 75);
filterui->box(FL_FLAT_BOX);
filterui->color(FL_LIGHT1);
filterui->selection_color(FL_BACKGROUND_COLOR);
filterui->labeltype(FL_NO_LABEL);
filterui->labelfont(1);
filterui->labelsize(14);
filterui->labelcolor(FL_FOREGROUND_COLOR);
filterui->user_data((void*)(this));
filterui->align(FL_ALIGN_TOP);
filterui->when(FL_WHEN_RELEASE);
{ filterparamswindow = new Fl_Group(0, 0, 275, 75, "Filter Parameters");
filterparamswindow->box(FL_PLASTIC_UP_BOX);
filterparamswindow->color(FL_CYAN);
filterparamswindow->labeltype(FL_ENGRAVED_LABEL);
filterparamswindow->labelsize(10);
filterparamswindow->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
{ Fl_Choice* o = analogfiltertypechoice = new Fl_Choice(10, 50, 50, 15, "FilterType");
analogfiltertypechoice->tooltip("The Filter type");
analogfiltertypechoice->down_box(FL_BORDER_BOX);
analogfiltertypechoice->labelsize(10);
analogfiltertypechoice->textsize(10);
analogfiltertypechoice->callback((Fl_Callback*)cb_analogfiltertypechoice);
analogfiltertypechoice->align(FL_ALIGN_TOP_LEFT);
analogfiltertypechoice->menu(menu_analogfiltertypechoice);
o->value(pars->Ptype);
} // Fl_Choice* analogfiltertypechoice
{ Fl_Choice* o = svfiltertypechoice = new Fl_Choice(10, 50, 50, 15, "FilterType");
svfiltertypechoice->tooltip("The Filter type");
svfiltertypechoice->down_box(FL_BORDER_BOX);
svfiltertypechoice->labelsize(10);
svfiltertypechoice->textsize(10);
svfiltertypechoice->callback((Fl_Callback*)cb_svfiltertypechoice);
svfiltertypechoice->align(FL_ALIGN_TOP_LEFT);
svfiltertypechoice->menu(menu_svfiltertypechoice);
o->value(pars->Ptype);
} // Fl_Choice* svfiltertypechoice
{ Fl_Choice* o = filtertype = new Fl_Choice(10, 20, 60, 15, "Category");
filtertype->tooltip("The Category of the Filter (Analog/Formantic/etc.)");
filtertype->down_box(FL_BORDER_BOX);
filtertype->labelsize(10);
filtertype->textsize(10);
filtertype->callback((Fl_Callback*)cb_filtertype);
filtertype->align(FL_ALIGN_TOP_LEFT);
filtertype->menu(menu_filtertype);
o->value(pars->Pcategory);
} // Fl_Choice* filtertype
{ WidgetPDial* o = cfreqdial = new WidgetPDial(75, 25, 30, 30, "C.Freq");
cfreqdial->tooltip("Center Frequency of the Filter or the base position in the vowel\'s sequence");
cfreqdial->box(FL_ROUND_UP_BOX);
cfreqdial->color(FL_BACKGROUND_COLOR);
cfreqdial->selection_color(FL_INACTIVE_COLOR);
cfreqdial->labeltype(FL_NORMAL_LABEL);
cfreqdial->labelfont(0);
cfreqdial->labelsize(10);
cfreqdial->labelcolor(FL_FOREGROUND_COLOR);
cfreqdial->maximum(127);
cfreqdial->step(1);
cfreqdial->callback((Fl_Callback*)cb_cfreqdial);
cfreqdial->align(FL_ALIGN_BOTTOM);
cfreqdial->when(FL_WHEN_CHANGED);
o->value(pars->Pfreq);
} // WidgetPDial* cfreqdial
{ WidgetPDial* o = qdial = new WidgetPDial(110, 25, 30, 30, "Q");
qdial->tooltip("Filter resonance or bandwidth");
qdial->box(FL_ROUND_UP_BOX);
qdial->color(FL_BACKGROUND_COLOR);
qdial->selection_color(FL_INACTIVE_COLOR);
qdial->labeltype(FL_NORMAL_LABEL);
qdial->labelfont(0);
qdial->labelsize(10);
qdial->labelcolor(FL_FOREGROUND_COLOR);
qdial->maximum(127);
qdial->step(1);
qdial->callback((Fl_Callback*)cb_qdial);
qdial->align(FL_ALIGN_BOTTOM);
qdial->when(FL_WHEN_CHANGED);
o->value(pars->Pq);
} // WidgetPDial* qdial
{ WidgetPDial* o = freqtrdial = new WidgetPDial(215, 25, 30, 30, "freq.tr.");
freqtrdial->tooltip("Filter frequency tracking (left is negative, middle is 0, and right is positi\
ve)");
freqtrdial->box(FL_ROUND_UP_BOX);
freqtrdial->color(FL_BACKGROUND_COLOR);
freqtrdial->selection_color(FL_INACTIVE_COLOR);
freqtrdial->labeltype(FL_NORMAL_LABEL);
freqtrdial->labelfont(0);
freqtrdial->labelsize(10);
freqtrdial->labelcolor(FL_FOREGROUND_COLOR);
freqtrdial->maximum(127);
freqtrdial->step(1);
freqtrdial->callback((Fl_Callback*)cb_freqtrdial);
freqtrdial->align(FL_ALIGN_BOTTOM);
freqtrdial->when(FL_WHEN_CHANGED);
o->value(pars->Pfreqtrack);
} // WidgetPDial* freqtrdial
{ vsnsadial = new WidgetPDial(145, 25, 30, 30, "V.SnsA.");
vsnsadial->tooltip("Velocity sensing amount of the Filter");
vsnsadial->box(FL_ROUND_UP_BOX);
//.........这里部分代码省略.........
示例14:
SciCalc::SciCalc() {
Fl_Window* w;
{Fl_Window* o = win = new Fl_Window(181, 262, "eCalc");
w = o;
o->label_type(FL_NO_LABEL);
o->shortcut(0xff1b);
o->user_data((void*)(this));
o->align();
{Fl_Box* o = leddisplay = new Fl_Box(2, 2, 176, 24, "Welcome");
o->box(FL_THIN_DOWN_BOX);
o->label_font(fl_fonts+4);
o->color((Fl_Color)207);
o->label_color((Fl_Color)59);
o->label_size(14);
o->callback((Fl_Callback*)cb_leddisplay);
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = box_DEGRAD = new Fl_Box(24, 28, 35, 16);
o->box(FL_THIN_DOWN_BOX);
o->label_color((Fl_Color)1);
o->label_size(9);
o->callback((Fl_Callback*)cb_box_DEGRAD);
o->align(FL_ALIGN_INSIDE);
}
{Fl_Box* o = box_bracket = new Fl_Box(59, 28, 65, 16);
o->box(FL_THIN_DOWN_BOX);
o->label_color((Fl_Color)1);
o->label_size(9);
o->align(FL_ALIGN_INSIDE);
}
{Fl_Box* o = box_M = new Fl_Box(124, 28, 35, 16);
o->box(FL_THIN_DOWN_BOX);
o->label_color((Fl_Color)1);
o->label_size(9);
o->callback((Fl_Callback*)cb_box_M);
o->align(FL_ALIGN_INSIDE);
}
{Fl_Group* o = new Fl_Group(46, 46, 93, 22);
o->color((Fl_Color)46);
{Fl_Button* o = radio_2 = new Fl_Button(3, 3, 20, 15, "2");
o->type(Fl_Button::RADIO);
o->label_color((Fl_Color)1);
o->label_size(10);
o->shortcut(0x40062);
o->callback((Fl_Callback*)cb_radio_2);
o->tooltip("Binary mode");
}
{Fl_Button* o = radio_8 = new Fl_Button(24, 3, 21, 15, "8");
o->type(Fl_Button::RADIO);
o->label_color((Fl_Color)1);
o->label_size(10);
o->shortcut(0x4006f);
o->callback((Fl_Callback*)cb_radio_8);
o->tooltip("Octal mode");
}
{Fl_Button* o = radio_10 = new Fl_Button(46, 3, 21, 15, "10");
o->type(Fl_Button::RADIO);
o->label_color((Fl_Color)1);
o->label_size(10);
o->shortcut(0x40064);
o->value(1);
o->callback((Fl_Callback*)cb_radio_10);
o->tooltip("Decimal mode");
}
{Fl_Button* o = radio_16 = new Fl_Button(68, 3, 21, 15, "16");
o->type(Fl_Button::RADIO);
o->label_color((Fl_Color)1);
o->label_size(10);
o->shortcut(0x40068);
o->callback((Fl_Callback*)cb_radio_16);
o->tooltip("Hex mode");
}
o->end();
}
{Fl_Group* o = new Fl_Group(3, 163, 107, 94);
o->box(FL_BORDER_BOX);
o->color((Fl_Color)43);
{Fl_Button* o = but_7 = new Fl_Button(3, 4, 32, 20, "7");
o->label_font(fl_fonts+1);
o->label_size(14);
o->shortcut(0x37);
o->callback((Fl_Callback*)cb_but_7);
}
{Fl_Button* o = but_8 = new Fl_Button(38, 4, 32, 20, "8");
o->label_font(fl_fonts+1);
o->label_size(14);
o->shortcut(0x38);
o->callback((Fl_Callback*)cb_but_8);
}
{Fl_Button* o = but_9 = new Fl_Button(72, 4, 32, 20, "9");
o->label_font(fl_fonts+1);
o->label_size(14);
o->shortcut(0x39);
o->callback((Fl_Callback*)cb_but_9);
}
{Fl_Button* o = but_4 = new Fl_Button(3, 26, 32, 20, "4");
o->label_font(fl_fonts+1);
o->label_size(14);
o->shortcut(0x34);
o->callback((Fl_Callback*)cb_but_4);
//.........这里部分代码省略.........
示例15: grid
GridView::GridView(Grid *grid, const char* title)
: Fl_Double_Window(650, 450, title), grid(grid)
{
// Set color of window to white
color(FL_WHITE);
// Begin adding children to this window
begin();
// Set default state
state.state = NORMAL;
// Button dimensions for grid
const int buttonXOffset = 10;
const int buttonYOffset = 10;
const int buttonHeight = 20;
const int buttonWidth = 20;
// Width of inputs
const int input_width = 120;
// Minimum width and height are as if the grid is (20, 20)
int winWidth;
int winHeight;
// Get grid dimensions
int gridWidth = grid->getWidth();
int gridHeight = grid->getHeight();
winWidth = (gridWidth < 20) ? buttonWidth * 20 + buttonXOffset * 2 + 220
: buttonWidth * gridWidth + buttonXOffset * 2 + 120 + input_width;
winHeight = (gridHeight < 20) ? buttonHeight * 20 + buttonYOffset * 2
: buttonHeight * gridHeight + buttonYOffset * 2;
// x offset for the other inputs
const int x_offset = winWidth - input_width - 20;
// Set size so that the new grid fits
size(winWidth, winHeight);
// Generate all of the grid view buttons
for (int x = 0; x < gridWidth; ++x)
for (int y = 0; y < gridHeight; ++y) {
Fl_Button *button = new Fl_Button(buttonXOffset + x * buttonWidth,
buttonYOffset + y * buttonHeight,
buttonWidth - 2, buttonHeight - 2);
if (grid->getSquare(Point(x, y)) == EMPTY)
button->color(FL_WHITE);
else
button->color(FL_RED);
button->callback(GridView::StaticToggleGridSquare, this);
squares[Point(x, y)] = button;
}
// Add button to trigger pathfinding
Fl_Button *pathfindButton = new Fl_Button(x_offset, 20, input_width, 20, "Pathfind!");
pathfindButton->callback(GridView::StaticDoPathfind, this);
// Add button to trigger pathfinding in heuristic order
Fl_Button *pathfindHeuristicButton = new Fl_Button(x_offset, 50, input_width,
20, "w/ Heuristic");
pathfindHeuristicButton->callback(GridView::StaticDoPathfind, this);
// Add button and textbox to repopulate the grid
repopulation_input = new Fl_Int_Input(x_offset, 80, input_width, 20, "Num. to fill");
// Set default repopulation amount as 200
repopulation_input->value("200");
Fl_Button *repopulateButton = new Fl_Button(x_offset, 110, input_width,
20, "Repopulate!");
repopulateButton->callback(GridView::StaticRepopulate, this);
// Add button to clear the grid
Fl_Button *clearButton = new Fl_Button(x_offset, 140, input_width, 20, "Clear!");
clearButton->callback(GridView::StaticClear, this);
// Add success/fail label for pathfinding
result_output = new Fl_Output(x_offset - 10, 180, input_width + 20, 20);
// Add new grid width and height textboxes
width_input = new Fl_Int_Input(x_offset, 210, input_width, 20, "Width:");
width_input->value("20");
height_input = new Fl_Int_Input(x_offset, 240, input_width, 20, "Height:");
height_input->value("20");
// Add new grid button
Fl_Button *newGridButton = new Fl_Button(x_offset, 270, input_width, 20, "New Grid!");
newGridButton->callback(GridView::StaticNewGrid, this);
// Add waypoint drop-down menu
waypoints_selection = new Fl_Choice(x_offset, 300, 50, 20);
// Add start and end point by default
waypoints_selection->add("start");
//.........这里部分代码省略.........