本文整理汇总了C++中Fl_Choice::menu方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Choice::menu方法的具体用法?C++ Fl_Choice::menu怎么用?C++ Fl_Choice::menu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Choice
的用法示例。
在下文中一共展示了Fl_Choice::menu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
window = new Fl_Double_Window(400,400);
input = new Fl_Input(25,375,350,25);
input->static_value("The quick brown fox jumps over the lazy dog.");
input->when(FL_WHEN_CHANGED);
input->callback(input_cb);
sizes= new Fl_Value_Slider(50,350,350,25,"Size:");
sizes->type(Fl_Slider::HORIZONTAL);
sizes->clear_flag(FL_ALIGN_MASK);
sizes->set_flag(FL_ALIGN_LEFT);
sizes->range(1,64);
sizes->step(1);
sizes->value(14);
sizes->callback(size_cb);
fonts=new Fl_Value_Slider(50,325,350,25,"Font:");
fonts->type(Fl_Slider::HORIZONTAL);
fonts->clear_flag(FL_ALIGN_MASK);
fonts->set_flag(FL_ALIGN_LEFT);
fonts->range(0,15);
fonts->step(1);
fonts->value(0);
fonts->callback(font_cb);
Fl_Group *g = new Fl_Group(25,300,350,25);
leftb = new Fl_Toggle_Button(0,0,50,25,"left");
leftb->callback(button_cb);
rightb = new Fl_Toggle_Button(50,0,50,25,"right");
rightb->callback(button_cb);
topb = new Fl_Toggle_Button(100,0,50,25,"top");
topb->callback(button_cb);
bottomb = new Fl_Toggle_Button(150,0,50,25,"bottom");
bottomb->callback(button_cb);
insideb = new Fl_Toggle_Button(200,0,50,25,"inside");
insideb->callback(button_cb);
wrapb = new Fl_Toggle_Button(250,0,50,25,"wrap");
wrapb->callback(button_cb);
clipb = new Fl_Toggle_Button(300,0,50,25,"clip");
clipb->callback(button_cb);
g->end();
Fl_Choice *c = new Fl_Choice(100,250,200,25);
c->menu(choices);
text= new Fl_Box(100,75,200,100,input->value());
text->box(FL_ENGRAVED_BOX);
text->clear_flag(FL_ALIGN_MASK);
text->set_flag(FL_ALIGN_CENTER);
window->resizable(text);
window->end();
window->show(argc,argv);
return Fl::run();
}
示例2: PaintView
//----------------------------------------------------
// Constructor. Creates all of the widgets.
// Add new widgets here
//----------------------------------------------------
ImpressionistUI::ImpressionistUI() {
// Create the main window
m_mainWindow = new Fl_Window(600, 300, "Impressionist");
m_mainWindow->user_data((void*)(this)); // record self to be used by static callback functions
// install menu bar
m_menubar = new Fl_Menu_Bar(0, 0, 600, 25);
m_menubar->menu(menuitems);
// Create a group that will hold two sub windows inside the main
// window
Fl_Group* group = new Fl_Group(0, 25, 600, 275);
// install paint view window
m_paintView = new PaintView(300, 25, 300, 275, "This is the paint view");//0jon
m_paintView->box(FL_DOWN_FRAME);
// install original view window
m_origView = new OriginalView(0, 25, 300, 275, "This is the orig view");//300jon
m_origView->box(FL_DOWN_FRAME);
// m_origView->deactivate();
group->end();
Fl_Group::current()->resizable(group);
m_mainWindow->end();
// init values
m_nSize = 10;
m_nAngle = 45;
m_nAlpha = 255;
m_nBackgroundAlpha = 100;
// brush dialog definition
m_brushDialog = new Fl_Window(400, 325, "Brush Dialog");
// Add a brush type choice to the dialog
m_BrushTypeChoice = new Fl_Choice(50,10,150,25,"&Brush");
m_BrushTypeChoice->user_data((void*)(this)); // record self to be used by static callback functions
m_BrushTypeChoice->menu(brushTypeMenu);
m_BrushTypeChoice->callback(cb_brushChoice);
m_ClearCanvasButton = new Fl_Button(240,10,150,25,"&Clear Canvas");
m_ClearCanvasButton->user_data((void*)(this));
m_ClearCanvasButton->callback(cb_clear_canvas_button);
m_transparentBackgroundButton = new Fl_Button(130,280,150,25,"&Show Background");
m_transparentBackgroundButton->user_data((void*)(this));
m_transparentBackgroundButton->callback(cb_transparentBackground);
m_edgeImageButton = new Fl_Button(130,180,150,25,"&Toggle Edge Image");
m_edgeImageButton->user_data((void*)(this));
m_edgeImageButton->callback(cb_edgeImage);
//Add angle choice menu
Fl_Choice * myChoice = new Fl_Choice(95,60,150,25,"&Angle Choice");
myChoice->user_data((void*)(this)); // record self to be used by static callback functions
myChoice->menu(angleChoiceMenu);
myChoice->callback(cb_angleChoice);
// Add brush size slider to the dialog
m_BrushSizeSlider = new Fl_Value_Slider(10, 100, 300, 20, "Size");
m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions
m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER);
m_BrushSizeSlider->labelfont(FL_COURIER);
m_BrushSizeSlider->labelsize(12);
m_BrushSizeSlider->minimum(1);
m_BrushSizeSlider->maximum(40);
m_BrushSizeSlider->step(1);
m_BrushSizeSlider->value(m_nSize);
m_BrushSizeSlider->align(FL_ALIGN_RIGHT);
m_BrushSizeSlider->callback(cb_sizeSlides);
// Add brush angle slider to the dialog
m_BrushSizeSlider = new Fl_Value_Slider(10, 120, 300, 20, "Angle");
m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions
m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER);
m_BrushSizeSlider->labelfont(FL_COURIER);
m_BrushSizeSlider->labelsize(12);
m_BrushSizeSlider->minimum(0);
m_BrushSizeSlider->maximum(180);
m_BrushSizeSlider->step(1);
m_BrushSizeSlider->value(m_nAngle);
m_BrushSizeSlider->align(FL_ALIGN_RIGHT);
m_BrushSizeSlider->callback(cb_angleSlides);
// Add brush angle slider to the dialog
m_BrushSizeSlider = new Fl_Value_Slider(10, 140, 300, 20, "Opacity");
m_BrushSizeSlider->user_data((void*)(this)); // record self to be used by static callback functions
m_BrushSizeSlider->type(FL_HOR_NICE_SLIDER);
m_BrushSizeSlider->labelfont(FL_COURIER);
m_BrushSizeSlider->labelsize(12);
m_BrushSizeSlider->minimum(0);
m_BrushSizeSlider->maximum(255);
m_BrushSizeSlider->step(1);
m_BrushSizeSlider->value(m_nAlpha);
m_BrushSizeSlider->align(FL_ALIGN_RIGHT);
m_BrushSizeSlider->callback(cb_alphaSlides);
//.........这里部分代码省略.........
示例3: make_window
Fl_Double_Window* IntersectionInterface::make_window() {
Fl_Double_Window* w;
{ Fl_Double_Window* o = m_intersectionWindow = new Fl_Double_Window(420, 265, "Intersection UI");
w = o;
o->user_data((void*)(this));
{ Fl_Group* o = new Fl_Group(5, 25, 145, 30);
o->end();
}
{ Fl_Choice* o = m_iShapeType = new Fl_Choice(5, 25, 145, 30, "Object type");
o->down_box(FL_BORDER_BOX);
o->align(FL_ALIGN_TOP_LEFT);
o->menu(menu_m_iShapeType);
}
{ Fl_Value_Slider* o = m_dXAt = new Fl_Value_Slider(5, 75, 200, 25, "At x pos");
o->type(5);
o->minimum(-1.5);
o->maximum(1.5);
o->callback((Fl_Callback*)cb_m_dXAt);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Value_Slider* o = m_dYAt = new Fl_Value_Slider(5, 115, 200, 25, "At y pos");
o->type(5);
o->minimum(-1.5);
o->maximum(1.5);
o->callback((Fl_Callback*)cb_m_dYAt);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Value_Slider* o = m_dZAt = new Fl_Value_Slider(5, 155, 200, 25, "At z pos");
o->type(5);
o->minimum(-1.5);
o->maximum(1.5);
o->callback((Fl_Callback*)cb_m_dZAt);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Value_Slider* o = m_dTheta = new Fl_Value_Slider(5, 195, 200, 25, "Vec theta");
o->type(5);
o->maximum(360);
o->step(1);
o->callback((Fl_Callback*)cb_m_dTheta);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Value_Slider* o = m_dPhi = new Fl_Value_Slider(5, 235, 200, 25, "Vec phi");
o->type(5);
o->minimum(-90);
o->maximum(90);
o->step(1);
o->value(45);
o->callback((Fl_Callback*)cb_m_dPhi);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Button* o = new Fl_Button(330, 25, 85, 25, "Write test");
o->callback((Fl_Callback*)cb_Write);
}
{ Fl_Value_Slider* o = m_dXRot = new Fl_Value_Slider(215, 75, 200, 25, "View rotation");
o->type(5);
o->maximum(360);
o->step(1);
o->callback((Fl_Callback*)cb_m_dXRot);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Value_Slider* o = m_dYRot = new Fl_Value_Slider(215, 115, 200, 25, "View height");
o->type(5);
o->minimum(-90);
o->maximum(90);
o->step(1);
o->callback((Fl_Callback*)cb_m_dYRot);
o->align(FL_ALIGN_TOP_LEFT);
}
{ Fl_Check_Button* o = m_bGrid = new Fl_Check_Button(215, 155, 25, 25, "Show grid");
o->down_box(FL_DOWN_BOX);
o->value(1);
o->callback((Fl_Callback*)cb_m_bGrid);
}
{ Fl_Check_Button* o = m_bRay = new Fl_Check_Button(215, 195, 25, 25, "Show ray");
o->down_box(FL_DOWN_BOX);
o->value(1);
o->callback((Fl_Callback*)cb_m_bRay);
}
{ Fl_Check_Button* o = m_bRayShadow = new Fl_Check_Button(215, 235, 25, 25, "Show ray shadow");
o->down_box(FL_DOWN_BOX);
o->value(1);
o->callback((Fl_Callback*)cb_m_bRayShadow);
}
m_iSeed = new Fl_Value_Input(240, 30, 85, 20, "Seed");
o->end();
o->resizable(o);
}
return w;
}