本文整理汇总了C++中Fl_Choice::align方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Choice::align方法的具体用法?C++ Fl_Choice::align怎么用?C++ Fl_Choice::align使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Choice
的用法示例。
在下文中一共展示了Fl_Choice::align方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_dlg
//-----------------------------------------------------------------------------
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();
}
示例2: Point
Panner::Panner ( int X, int Y, int W, int H, const char *L ) :
Fl_Group( X, Y, W, H, L )
{
_bg_image = 0;
_bg_image_scaled = 0;
_bg_image_projection = 0;
// _projection = POLAR;
_points.push_back( Point( 1, 0 ) );
static float ranges[] = { 1,3,5,10,15 };
{ Fl_Choice *o = _range_choice = new Fl_Choice(X + 40,Y + H - 18,75,18,"Range:");
o->box(FL_UP_FRAME);
o->down_box(FL_DOWN_FRAME);
o->textsize(9);
o->labelsize(9);
o->align(FL_ALIGN_LEFT);
o->add("1 Meter",0,0,&ranges[0]);
o->add("3 Meters",0,0,&ranges[1]);
o->add("5 Meters",0,0,&ranges[2]);
o->add("10 Meters",0,0,&ranges[3]);
o->add("15 Meters",0,0,&ranges[4]);
o->value(_range_mode);
o->callback( cb_mode, this );
}
{ Fl_Choice *o = _projection_choice = new Fl_Choice(X + W - 75,Y + H - 18,75,18,"Projection:");
o->box(FL_UP_FRAME);
o->down_box(FL_DOWN_FRAME);
o->textsize(9);
o->labelsize(9);
o->align(FL_ALIGN_LEFT);
o->add("Spherical");
o->add("Planar");
o->value(_projection_mode);
o->callback( cb_mode, this );
}
end();
}
示例3: PerfTest
int
main ( int argc, char **argv )
{
{
Fl_Single_Window *w = new Fl_Single_Window( 800, 600 );
{ Fl_Choice *o = new Fl_Choice( 0, 0, 200, 24, "Boxtype" );
o->align( FL_ALIGN_RIGHT );
o->callback( boxtype_cb, NULL );
o->add( "UP_BOX" );
o->add( "FLAT_BOX" );
o->add( "ROUNDED_BOX" );
o->add( "OVAL_BOX" );
}
{
Fl_Pack *o = new Fl_Pack( 0, 24, 800, 600 - 24 );
o->type( 0 );
{
PerfTest *o = new PerfTest( 0,0, 800, 400, "Xlib" );
}
{
PerfTest *o = new PerfTest( 0,0, 800, 400, "Cairo" );
o->use_cairo = true;
}
o->end();
}
w->end();
w->show();
}
/* { */
/* Fl_Single_Window *w = new Fl_Single_Window( 800, 600 ); */
/* PerfTest *o = new PerfTest( 0,0, 800, 600 ); */
/* w->end(); */
/* w->show(); */
/* } */
Fl::run();
}
示例4: 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;
}
示例5: make_window
void ColorFltkMenu::make_window() {
size(400, 305);
{
{ Fl_Hold_Browser* o = categorybrowser = new Fl_Hold_Browser(10, 55, 125, 100, "Categories");
o->align(FL_ALIGN_TOP);
o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
o->callback(category_cb, this);
VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
}
{ Fl_Hold_Browser* o = itembrowser = new Fl_Hold_Browser(140, 55, 120, 100, "Names");
o->align(FL_ALIGN_TOP);
o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
o->callback(item_cb, this);
VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
}
{ Fl_Hold_Browser* o = colorbrowser = new Fl_Hold_Browser(265, 55, 125, 100, "Colors");
o->align(FL_ALIGN_TOP);
o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
o->callback(color_cb, this);
VMDFLTKTOOLTIP(o, "Select color category then name to set active color")
}
new Fl_Box(10, 10, 190, 25, "Assign colors to categories:");
{ Fl_Tabs* o = new Fl_Tabs(0, 165, 400, 150);
#if defined(VMDMENU_WINDOW)
o->color(VMDMENU_WINDOW, FL_GRAY);
o->selection_color(VMDMENU_WINDOW);
#endif
{ Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Definitions");
#if defined(VMDMENU_WINDOW)
o->color(VMDMENU_WINDOW, FL_GRAY);
o->selection_color(VMDMENU_WINDOW);
#endif
{ Fl_Hold_Browser* o = colordefbrowser = new Fl_Hold_Browser(15, 195, 135, 100);
o->labeltype(FL_NO_LABEL);
o->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
o->callback(colordef_cb, this);
VMDFLTKTOOLTIP(o, "Select color name to adjust RGB color definition")
}
{ Fl_Value_Slider* o = redscale = new Fl_Value_Slider(160, 195, 225, 20);
o->type(FL_HORIZONTAL);
o->color(VMDMENU_COLOR_RSLIDER);
o->callback(rgb_cb, this);
VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
}
{ Fl_Value_Slider* o = greenscale = new Fl_Value_Slider(160, 215, 225, 20);
o->type(FL_HORIZONTAL);
o->color(VMDMENU_COLOR_GSLIDER);
o->callback(rgb_cb, this);
VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
}
{ Fl_Value_Slider* o = bluescale = new Fl_Value_Slider(160, 235, 225, 20);
o->type(FL_HORIZONTAL);
o->color(VMDMENU_COLOR_BSLIDER);
o->callback(rgb_cb, this);
VMDFLTKTOOLTIP(o, "Adjust slider to change RGB color definition")
}
{ Fl_Button* o = grayscalebutton = new Fl_Button(165, 265, 85, 25, "Grayscale");
o->type(FL_TOGGLE_BUTTON);
#if defined(VMDMENU_WINDOW)
o->color(VMDMENU_WINDOW, FL_GRAY);
#endif
VMDFLTKTOOLTIP(o, "Lock sliders for grayscale color")
}
defaultbutton = new Fl_Button(290, 265, 85, 25, "Default");
#if defined(VMDMENU_WINDOW)
defaultbutton->color(VMDMENU_WINDOW, FL_GRAY);
#endif
defaultbutton->callback(default_cb, this);
VMDFLTKTOOLTIP(defaultbutton, "Reset to original RGB color")
o->end();
}
{ Fl_Group* o = new Fl_Group(0, 185, 400, 125, "Color Scale");
#if defined(VMDMENU_WINDOW)
o->color(VMDMENU_WINDOW, FL_GRAY);
o->selection_color(VMDMENU_WINDOW);
#endif
o->hide();
{ Fl_Choice* o = scalemethod = new Fl_Choice(15, 220, 80, 25, "Method");
o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
o->down_box(FL_BORDER_BOX);
o->align(FL_ALIGN_TOP);
o->callback(scalemethod_cb, this);
}
offsetvalue = new Fl_Value_Slider(160, 205, 180, 20, "Offset");
offsetvalue->type(FL_HORIZONTAL);
offsetvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
offsetvalue->align(FL_ALIGN_LEFT);
offsetvalue->range(-1.0, 1.0);
offsetvalue->callback(scalesettings_cb, this);
{ Fl_Value_Slider* o = midpointvalue = new Fl_Value_Slider(160, 235, 180, 20, "Midpoint");
o->type(FL_HORIZONTAL);
midpointvalue->align(FL_ALIGN_LEFT);
midpointvalue->color(VMDMENU_SLIDER_BG, VMDMENU_SLIDER_FG);
o->range(0.0, 1.0);
o->callback(scalesettings_cb, this);
}
image = new ColorscaleImage(10, 265, 380, 25, app);
o->end();
}
//.........这里部分代码省略.........
示例6: make_window
Fl_Double_Window* make_window() {
Fl_Double_Window* w;
{Fl_Double_Window* o = new Fl_Double_Window(560, 489);
w = o;
o->type(241);
{Fl_Box* o = imbox = new Fl_Box(5, 30, 385, 455);
o->box(FL_ENGRAVED_BOX);
o->align(FL_ALIGN_CLIP);
Fl_Group::current()->resizable(o);
}
{Fl_Box* o = filename_box = new Fl_Box(5, 5, 385, 20, "No file loaded...");
o->box(FL_THIN_DOWN_BOX);
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Group* o = new Fl_Group(395, 5, 160, 480);
o->box(FL_THIN_DOWN_BOX);
{Fl_Button* o = new Fl_Button(10, 10, 140, 25, "Load File");
o->box(FL_THIN_UP_BOX);
o->callback((Fl_Callback*)cb_Load);
}
{Fl_Button* o = new Fl_Button(10, 40, 140, 25, "Exit");
o->box(FL_THIN_UP_BOX);
o->callback((Fl_Callback*)cb_Exit);
}
new Fl_Divider(10, 75, 140, 15, "label");
{Fl_Button* o = new Fl_Button(10, 100, 140, 25, "Fit To Box");
o->type(Fl_Button::TOGGLE);
o->box(FL_THIN_UP_BOX);
o->callback((Fl_Callback*)cb_Fit);
}
{Fl_Button* o = new Fl_Button(10, 130, 140, 25, "Tile");
o->type(Fl_Button::TOGGLE);
o->box(FL_THIN_UP_BOX);
o->callback((Fl_Callback*)cb_Tile);
}
{Fl_Choice* o = filter_choice = new Fl_Choice(10, 335, 140, 25, "Filter:"); o->begin();
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
o->tooltip("Choose filter");
{Fl_Item* o = new Fl_Item("None");
o->user_data((void*)(0));
}
{Fl_Item* o = new Fl_Item("Brightness");
o->user_data((void*)(FILTER_BRIGHTNESS));
}
{Fl_Item* o = new Fl_Item("Contrast");
o->user_data((void*)(FILTER_CONTRAST));
}
{Fl_Item* o = new Fl_Item("Grayscale");
o->user_data((void*)(FILTER_GRAYSCALE));
}
{Fl_Item* o = new Fl_Item("Gamma");
o->user_data((void*)(FILTER_GAMMA));
}
{Fl_Item* o = new Fl_Item("Fore Blend");
o->user_data((void*)(FILTER_FOREBLEND));
}
{Fl_Item* o = new Fl_Item("Back Blend");
o->user_data((void*)(FILTER_BACKBLEND));
}
o->end();
}
{Fl_Box* o = new Fl_Box(10, 160, 140, 160);
o->parent()->resizable(o);
}
{Fl_Value_Slider* o = Rslider = new Fl_Value_Slider(25, 380, 125, 15, "R");
o->type(Fl_Value_Slider::HORIZONTAL);
o->label_size(10);
o->text_size(10);
o->minimum(-3);
o->maximum(3);
o->value(1);
o->slider_size(5);
o->align(FL_ALIGN_LEFT);
o->tooltip("Red value for filter");
}
{Fl_Value_Slider* o = Gslider = new Fl_Value_Slider(25, 400, 125, 15, "G");
o->type(Fl_Value_Slider::HORIZONTAL);
o->label_size(10);
o->text_size(10);
o->minimum(-3);
o->maximum(3);
o->value(1);
o->slider_size(5);
o->align(FL_ALIGN_LEFT);
o->tooltip("Green value for filter");
}
{Fl_Value_Slider* o = Bslider = new Fl_Value_Slider(25, 420, 125, 15, "B");
o->type(Fl_Value_Slider::HORIZONTAL);
o->label_size(10);
o->text_size(10);
o->minimum(-3);
o->maximum(3);
o->value(1);
o->slider_size(5);
o->align(FL_ALIGN_LEFT);
o->tooltip("Blue value for filter");
}
{Fl_Button* o = new Fl_Button(10, 445, 140, 25, "Apply");
o->box(FL_THIN_UP_BOX);
o->callback((Fl_Callback*)cb_Apply);
//.........这里部分代码省略.........
示例7: main
int main (int argc, char **argv) {
Fl_Window* w;
fl_init_locale_support("ewmconf", PREFIX"/share/locale");
readConfiguration();
{Fl_Window* o = new Fl_Window(320, 370, _("Window manager settings"));
w = o;
{Fl_Tabs* o = new Fl_Tabs(2, 5, 318, 325);
o->color((Fl_Color)16);
{Fl_Group* o = new Fl_Group(1, 29, 316, 295, _("&Titlebar"));
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
{Fl_Choice* o = new Fl_Choice(83, 13, 105, 22, _("Text align:")); o->begin();
o->callback((Fl_Callback*)cb_Text);
new Fl_Item(_("Left"));
new Fl_Item(_("Right"));
new Fl_Item(_("Center"));
o->value(title_align);
o->end();
}
{Fl_Value_Input* o = new Fl_Value_Input(243, 13, 60, 22, _("Height:"));
o->minimum(10);
o->maximum(50);
o->step(1);
o->value(20);
o->callback((Fl_Callback*)cb_Height);
o->value(title_height);
}
{Fl_Button* o = titlebarLabelColorButton = new Fl_Button(85, 55, 60, 20, _("Titlebar label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarLabelColorButton);
o->align(132);
o->color((Fl_Color)title_normal_color_text);
}
{Fl_Button* o = titlebarColorButton = new Fl_Button(85, 120, 60, 20, _("Titlebar color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarColorButton);
o->align(132);
o->color((Fl_Color) title_normal_color);
}
{Fl_Group* o = new Fl_Group(153, 45, 160, 110);
{Fl_Button* o = titlebarActiveLabelColorButton = new Fl_Button(90, 10, 60, 20, _("Titlebar active label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarActiveLabelColorButton);
o->align(132);
o->color((Fl_Color) title_active_color_text);
}
{Fl_Button* o = titlebarActiveColorButton = new Fl_Button(90, 75, 60, 20, _("Titlebar active color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarActiveColorButton);
o->align(132);
o->color((Fl_Color)title_active_color);
}
o->end();
}
{Fl_Choice* o = titlebarDrawGrad = new Fl_Choice(85, 157, 163, 23, _("Box type:")); o->begin();
o->callback((Fl_Callback*)cb_titlebarDrawGrad);
o->align(132);
new Fl_Item(_("Flat"));
new Fl_Item(_("Horizontal shade"));
new Fl_Item(_("Thin down"));
new Fl_Item(_("Up box"));
new Fl_Item(_("Down box"));
new Fl_Item(_("Plastic"));
o->value(title_draw_grad);
o->end();
}
{Fl_Check_Button* o = useThemeButton = new Fl_Check_Button(8, 220, 300, 20, _("&Use theme"));
o->callback((Fl_Callback*)cb_useThemeButton);
o->value(use_theme);
}
{Fl_Input* o = themePathInput = new Fl_Input(65, 247, 210, 23, _("Path:"));
o->callback((Fl_Callback*)cb_themePathInput);
o->deactivate();
themePathInput->value(theme_path);
}
{Fl_Button* o = browse_btn = new Fl_Button(280, 247, 25, 23, _("..."));
o->callback((Fl_Callback*)cb_browse_btn);
o->deactivate();
}
{Fl_Divider* o = new Fl_Divider(8, 190, 300, 25, _("label"));
o->color((Fl_Color)16);
}
{Fl_Divider* o = new Fl_Divider(8, 85, 297, 25, _("label"));
o->color((Fl_Color)16);
}
o->end();
}
{Fl_Group* o = new Fl_Group(3, 20, 310, 305, _("&Resizing"));
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
o->hide();
{Fl_Check_Button* o = animateButton = new Fl_Check_Button(10, 10, 300, 20, _("Animate size changes"));
o->value(1);
o->callback((Fl_Callback*)cb_animateButton);
o->value(animate);
}
{Fl_Value_Slider* o = animateSlider = new Fl_Value_Slider(70, 35, 235, 20, _("Speed:"));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->box(FL_DOWN_BOX);
o->text_size(10);
o->minimum(5);
//.........这里部分代码省略.........
示例8: make_window
void DisplayFltkMenu::make_window() {
size(235, 445);
{
{ Fl_Counter* o = nearclip = new Fl_Counter(105, 25, 110, 25, "Near Clip");
o->align(FL_ALIGN_LEFT);
o->range(0.01, 1000.0);
o->step(0.05);
o->lstep(0.5);
o->precision(2);
o->callback(nearclip_cb, app);
VMDFLTKTOOLTIP(o, "Set near clipping plane (OpenGL display only)")
}
{ Fl_Counter* o = farclip = new Fl_Counter(105, 50, 110, 25, "Far Clip");
o->align(FL_ALIGN_LEFT);
o->range(0.01, 1000.0);
o->step(0.05);
o->lstep(0.5);
o->precision(2);
o->callback(farclip_cb, app);
VMDFLTKTOOLTIP(o, "Set far clipping plane (OpenGL display only)")
}
{ Fl_Counter* o = eyesep = new Fl_Counter(105, 75, 110, 25, "Eye Sep");
o->align(FL_ALIGN_LEFT);
o->range(0.0, 100.0);
o->step(0.01);
o->lstep(0.1);
o->precision(2);
o->callback(eyesep_cb, app);
VMDFLTKTOOLTIP(o, "Set stereo eye separation")
}
{ Fl_Counter* o = focal = new Fl_Counter(105, 100, 110, 25, "Focal Length");
o->align(FL_ALIGN_LEFT);
o->range(0.01, 1000.0);
o->step(0.05);
o->lstep(0.5);
o->precision(2);
o->callback(focal_cb, app);
VMDFLTKTOOLTIP(o, "Set stereo focal point")
}
{ Fl_Counter* o = screenh = new Fl_Counter(105, 135, 110, 25, "Screen Hgt");
o->align(FL_ALIGN_LEFT);
o->range(0.0, 100000.0);
o->step(0.1);
o->lstep(1.0);
o->precision(1);
o->callback(screenh_cb, app);
VMDFLTKTOOLTIP(o, "Set viewing frustum height")
}
{ Fl_Counter* o = screend = new Fl_Counter(105, 160, 110, 25, "Screen Dist");
o->align(FL_ALIGN_LEFT);
o->range(-100000.0, 100000.0);
o->step(0.1);
o->lstep(1.0);
o->precision(1);
o->callback(screend_cb, app);
VMDFLTKTOOLTIP(o, "Set viewing frustum distance")
}
{ Fl_Choice* o = cuemode = new Fl_Choice(105, 195, 110, 25, "Cue Mode");
o->color(VMDMENU_CHOOSER_BG);
o->selection_color(VMDMENU_CHOOSER_SEL);
o->box(FL_THIN_UP_BOX);
o->align(FL_ALIGN_LEFT);
o->callback(cuemode_cb, app);
VMDFLTKTOOLTIP(o, "Set depth cueing mode")
for (int m=0; m<app->display->num_cue_modes(); m++)
cuemode->add(app->display->cue_mode_name(m));
}
{ Fl_Counter* o = cuestart = new Fl_Counter(105, 220, 110, 25, "Cue Start");
o->align(FL_ALIGN_LEFT);
o->range(0.001, 1000.0);
o->step(0.05);
o->lstep(0.25);
o->precision(2);
o->callback(cuestart_cb, app);
VMDFLTKTOOLTIP(o, "Set linear depth cueing starting distance")
}
{ Fl_Counter* o = cueend = new Fl_Counter(105, 245, 110, 25, "Cue End");
o->align(FL_ALIGN_LEFT);
o->range(0.001, 1000.0);
o->step(0.05);
o->lstep(0.25);
o->precision(2);
o->callback(cueend_cb, app);
VMDFLTKTOOLTIP(o, "Set linear depth cueing end distance")
}
{ Fl_Counter* o = cuedensity = new Fl_Counter(105, 270, 110, 25, "Cue Density");
o->align(FL_ALIGN_LEFT);
o->range(0.001, 1000.0);
o->step(0.05);
o->lstep(0.1);
o->precision(2);
o->callback(cuedensity_cb, app);
VMDFLTKTOOLTIP(o, "Set exponential depth cueing density")
}
new Fl_Box(35, 305, 170, 25, "External Renderer Options");
{ Fl_Choice* o = shadowmode = new Fl_Choice(105, 330, 110, 25, "Shadows");
o->color(VMDMENU_CHOOSER_BG);
o->selection_color(VMDMENU_CHOOSER_SEL);
//.........这里部分代码省略.........
示例9: VMDFltkMenu
SaveTrajectoryFltkMenu::SaveTrajectoryFltkMenu(VMDApp *vmdapp)
: VMDFltkMenu("save", "Save Trajectory", vmdapp) {
size(450, 250);
{ Fl_Choice* o = molchooser = new Fl_Choice(120, 10, 320, 25, "Save data from: ");
o->box(FL_THIN_UP_BOX);
o->down_box(FL_BORDER_BOX);
o->color(VMDMENU_CHOOSER_BG);
o->selection_color(VMDMENU_CHOOSER_SEL);
o->callback(molchooser_cb, this);
}
{ Fl_Input *o = selectinput = new Fl_Input(120, 45, 295, 25, "Selected atoms:");
o->selection_color(VMDMENU_VALUE_SEL);
}
{ Fl_Choice* o = repchooser = new Fl_Choice(415, 45, 25, 25);
o->down_box(FL_BORDER_BOX);
o->align(FL_ALIGN_TOP_LEFT);
o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
o->callback(repchooser_cb, this);
}
{ Fl_Choice* o = filetypechooser = new Fl_Choice(20, 90, 115, 25, "File type:");
o->down_box(FL_BORDER_BOX);
o->align(FL_ALIGN_TOP_LEFT);
o->color(VMDMENU_CHOOSER_BG, VMDMENU_CHOOSER_SEL);
}
savebutton = new Fl_Return_Button(345, 90, 95, 25, "Save...");
savebutton->callback(save_cb, this);
{ Fl_Group* o = timestepgroup = new Fl_Group(20, 145, 165, 95, "Frames: ");
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT);
{ Fl_Button* o = saveinbackgroundbutton = new Fl_Round_Button(30, 215, 150, 20, "Save in background");
o->down_box(FL_ROUND_DOWN_BOX);
o->type(FL_RADIO_BUTTON);
}
{ Fl_Button* o = allatoncebutton = new Fl_Round_Button(30, 195, 150, 20, "Save all at once");
o->down_box(FL_ROUND_DOWN_BOX);
o->type(FL_RADIO_BUTTON);
}
{ Fl_Input* o = firstinput = new Fl_Int_Input(25, 170, 45, 20, "First:");
o->align(FL_ALIGN_TOP);
o->selection_color(VMDMENU_VALUE_SEL);
}
{ Fl_Input* o = lastinput = new Fl_Int_Input(80, 170, 45, 20, "Last:");
o->align(FL_ALIGN_TOP);
o->selection_color(VMDMENU_VALUE_SEL);
}
{ Fl_Input* o = strideinput = new Fl_Int_Input(135, 170, 45, 20, "Stride:");
o->align(FL_ALIGN_TOP);
o->selection_color(VMDMENU_VALUE_SEL);
}
o->end();
datasetbrowser = new Fl_Multi_Browser(195, 145, 240, 95, "Volumetric Datasets");
datasetbrowser->align(5);
datasetbrowser->color(VMDMENU_BROWSER_BG, VMDMENU_BROWSER_SEL);
}
end();
allatoncebutton->value(1);
selected_molid = -1;
datasetbrowser->deactivate();
command_wanted(Command::PLUGIN_UPDATE);
command_wanted(Command::MOL_NEW);
command_wanted(Command::MOL_RENAME);
command_wanted(Command::MOL_DEL);
command_wanted(Command::MOL_ADDREP);
command_wanted(Command::MOL_DELREP);
command_wanted(Command::MOL_MODREP);
command_wanted(Command::MOL_MODREPITEM);
command_wanted(Command::ANIM_DELETE);
}
示例10: 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;
}
示例11: 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);
}
//.........这里部分代码省略.........