当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Box::box方法代码示例

本文整理汇总了C++中Fl_Box::box方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Box::box方法的具体用法?C++ Fl_Box::box怎么用?C++ Fl_Box::box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fl_Box的用法示例。


在下文中一共展示了Fl_Box::box方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: plotWindow

ImageWindow::ImageWindow() {
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(930, 580, "Total Counts");
    w = o;
    o->user_data((void*)(this));
    { new Fl_Button(30, 190, 285, 30, "Save Image");
    } // Fl_Button* o
    { new Fl_Button(30, 240, 285, 30, "Reset Image");
    } // Fl_Button* o
    { new Fl_Light_Button(85, 492, 175, 40, "Analyze Pointing");
    } // Fl_Light_Button* o
    { new Fl_Value_Output(127, 384, 115, 25, "RA");
    } // Fl_Value_Output* o
    { new Fl_Value_Output(127, 419, 115, 25, "Dec");
    } // Fl_Value_Output* o
    { new Fl_Value_Output(127, 455, 115, 25, "Roll");
    } // Fl_Value_Output* o
    { Fl_Box* o = new Fl_Box(25, 359, 300, 214, "Current Pointing");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { Fl_Choice* o = new Fl_Choice(456, 535, 155, 25, "Image Scaling");
      o->down_box(FL_BORDER_BOX);
    } // Fl_Choice* o
    { new Fl_Value_Output(199, 55, 115, 25, "Total Counts");
    } // Fl_Value_Output* o
    { Fl_Value_Output* o = new Fl_Value_Output(199, 97, 115, 25, "Average Count Rate");
      o->align(Fl_Align(132));
    } // Fl_Value_Output* o
    { Fl_Value_Output* o = new Fl_Value_Output(199, 140, 115, 25, "Bright Pixel Count Rate");
      o->align(Fl_Align(132));
    } // Fl_Value_Output* o
    { Fl_Box* o = new Fl_Box(23, 37, 300, 258, "Image Statistics");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { new Fl_Progress(30, 540, 290, 30);
    } // Fl_Progress* o
    { Fl_Box* o = new Fl_Box(365, 40, 530, 475, "Detector Image");
      o->box(FL_THIN_UP_FRAME);
      o->labelfont(1);
      o->align(Fl_Align(FL_ALIGN_TOP));
    } // Fl_Box* o
    { Fl_Choice* o = new Fl_Choice(760, 535, 155, 25, "Pixel Arrangement");
      o->down_box(FL_BORDER_BOX);
    } // Fl_Choice* o
	plot = new plotWindow (100,100,500,500);
    o->end();
    w->show();
  } // Fl_Double_Window* o
}
开发者ID:pOakley,项目名称:xcaldaq_client,代码行数:53,代码来源:ImageWindow.cpp

示例2: 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);
    }
开发者ID:limingjie,项目名称:csv2html,代码行数:28,代码来源:csv2html_gui.cpp

示例3: Init

void ModelerApplication::Init(ModelerViewCreator_f createView, 
                              const ModelerControl controls[], unsigned numControls)
{
    int i;

	m_animating   = false;
	m_numControls = numControls;

    // ********************************************************
    // Create the FLTK user interface
    // ********************************************************
    
    m_ui = new ModelerUserInterface();
    
    // Store pointers to the controls for manipulation
    m_controlLabelBoxes   = new Fl_Box*[numControls];
    m_controlValueSliders = new Fl_Value_Slider*[numControls];
    
    // Constants for user interface setup
    const int textHeight    = 20;
    const int sliderHeight  = 20;
    const int packWidth     = m_ui->m_controlsPack->w();

	m_ui->m_controlsPack->begin();
    // For each control, add appropriate objects to the user interface
    for (i=0; i<m_numControls; i++)
    {
        // Add the entry to the selection box
        m_ui->m_controlsBrowser->add(controls[i].m_name);

        // Add the label (but make it invisible for now)
        Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, controls[i].m_name);
		box->labelsize(10);
		box->hide();
		box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
        m_controlLabelBoxes[i] = box;

        // Add the slider (but make it invisible for now)
        Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight,0);
        slider->type(1);
        slider->range(controls[i].m_minimum, controls[i].m_maximum);
        slider->step(controls[i].m_stepsize);
        slider->value(controls[i].m_value);
        slider->hide(); 
        m_controlValueSliders[i] = slider;
        slider->callback((Fl_Callback*)ModelerApplication::SliderCallback);
    }
    m_ui->m_controlsPack->end();

	// Make sure that we remove the view from the
	// Fl_Group, otherwise, it'll blow up 
	// THIS BUG FIXED 04-18-01 ehsu
	m_ui->m_modelerWindow->remove(*(m_ui->m_modelerView));
	delete m_ui->m_modelerView;

	m_ui->m_modelerWindow->begin();
	m_ui->m_modelerView = createView(0, 0, m_ui->m_modelerWindow->w(), m_ui->m_modelerWindow->h() ,NULL);
	Fl_Group::current()->resizable(m_ui->m_modelerView);
	m_ui->m_modelerWindow->end();
}
开发者ID:COMP4411-Project-Group,项目名称:Modeller,代码行数:60,代码来源:modelerapp.cpp

示例4: 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;
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:56,代码来源:about_panel.cpp

示例5: make_window

Fl_Group* SUBnoteharmonic::make_window() {
  { harmonic = new Fl_Group(0, 0, 90, 225);
    harmonic->box(FL_FLAT_BOX);
    harmonic->color(FL_BACKGROUND_COLOR);
    harmonic->selection_color(FL_BACKGROUND_COLOR);
    harmonic->labeltype(FL_NO_LABEL);
    harmonic->labelfont(0);
    harmonic->labelsize(14);
    harmonic->labelcolor(FL_FOREGROUND_COLOR);
    harmonic->user_data((void*)(this));
    harmonic->align(FL_ALIGN_TOP);
    harmonic->when(FL_WHEN_RELEASE);
    { Fl_Slider* o = mag = new Fl_Slider(0, 15, 10, 115);
      mag->tooltip("harmonic\'s magnitude");
      mag->type(4);
      mag->box(FL_FLAT_BOX);
      mag->selection_color((Fl_Color)222);
      mag->maximum(127);
      mag->step(1);
      mag->value(127);
      mag->callback((Fl_Callback*)cb_mag);
      o->value(127-pars->Phmag[n]);
      if (pars->Phmag[n]==0) o->selection_color(0);
    } // Fl_Slider* mag
    { Fl_Slider* o = bw = new Fl_Slider(0, 135, 10, 75);
      bw->tooltip("harmonic\'s bandwidth");
      bw->type(4);
      bw->box(FL_FLAT_BOX);
      bw->selection_color((Fl_Color)222);
      bw->maximum(127);
      bw->step(1);
      bw->value(64);
      bw->callback((Fl_Callback*)cb_bw);
      o->value(127-pars->Phrelbw[n]);
    } // Fl_Slider* bw
    { Fl_Box* o = new Fl_Box(10, 170, 5, 5);
      o->box(FL_FLAT_BOX);
      o->color(FL_DARK2);
      if (n+1==MAX_SUB_HARMONICS) o->hide();
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 210, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    { Fl_Box* o = new Fl_Box(0, 0, 10, 15, "01");
      o->labelfont(1);
      o->labelsize(9);
      o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
      char tmp[10];snprintf(tmp,10,"%d",n+1);o->label(strdup(tmp));
    } // Fl_Box* o
    harmonic->end();
  } // Fl_Group* harmonic
  return harmonic;
}
开发者ID:ishkabbible,项目名称:ZASF,代码行数:56,代码来源:SUBnoteUI.c

示例6: main

int main(int argc, char **argv)
{
	Fl_Window *window = new Fl_Window(340,180);
	Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
	box->box(FL_UP_BOX);
	box->labelfont(FL_BOLD+FL_ITALIC);
	box->labelsize(36);
	box->labeltype(FL_SHADOW_LABEL);
	window->end();
	window->show(argc, argv);
	return Fl::run();
}
开发者ID:arktools,项目名称:mingw-cross-env,代码行数:12,代码来源:fltk-test.cpp

示例7: main

int main(int argc, char *argv[]) {
    	Fl_Window *window = new Fl_Window (800,700,"TETRIS");
	window->color(56);
	Board *b = new Board();
	Fl_Box *scorebox = new Fl_Box(tilesize*xmaxtiles+10,50,300,200,"Score: 0\0");
	scorebox->box(FL_UP_BOX);
	scorebox->labelfont(FL_BOLD+FL_ITALIC);
    scorebox->labelsize(36);
    scorebox->labeltype(FL_ENGRAVED_LABEL);
	b->setScoreBox(&scorebox); 
	Fl_Box *exi = new Fl_Box(tilesize*2,ymaxtiles*15,300,200,"Press Escape to Exit");
	exi->box(FL_UP_BOX);
	exi->labelfont(FL_BOLD+FL_ITALIC);
	exi->labelsize(36);
	exi->labeltype(FL_ENGRAVED_LABEL);
	window->end(); 
   	window->show();
   	
	Fl::add_timeout(0.1, timeractions,b);
    	return(Fl::run());
}
开发者ID:vaibhavb007,项目名称:advanced_graphics,代码行数:21,代码来源:tetris.cpp

示例8: main

int main() {
	Fl_Window* win = new Fl_Window(290, 180, "Icon chooser test");
	win->begin();
	Fl_Box* ibox = image_box = new Fl_Box(80, 10, 135, 110);
	ibox->box(FL_THIN_DOWN_BOX);
	Fl_Button* run = new Fl_Button(95, 145, 90, 25, "&Run");
	run->callback(run_cb);
	Fl_Button* close = new Fl_Button(190, 145, 90, 25, "&Close");
	close->callback(close_cb, win);
	win->end();
	win->show();
	return  Fl::run();
}
开发者ID:edeproject,项目名称:svn,代码行数:13,代码来源:icon_chooser.cpp

示例9: main

int main(int argc, char **argv)
{
    Fl_Window *window = new Fl_Window(20,20,300,180);

    //Set type to DIALOG
    window->window_type(Fl_WM::DIALOG);

    window->begin();
    Fl_Box *box = new Fl_Box(20,40,260,100,"Hello World");
    box->box(FL_UP_BOX);
    box->label_font(FL_HELVETICA_BOLD_ITALIC);
    box->label_size(36);
    box->label_type(FL_SHADOW_LABEL);
    window->end();
    window->show(argc, argv);

    return Fl::run();
}
开发者ID:edeproject,项目名称:efltk,代码行数:18,代码来源:hello.cpp

示例10: main

int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(340,180,"世界へようこそ!");
  Fl_Box *box = new Fl_Box(20,40,300,100,"ようこそ、世界!"); 
  Fl::set_font(FL_HELVETICA, "Kochi Mincho");

  window->begin();

  // Fl_Widget(x, y, width, height, label)

  //box->box(FL_UP_BOX);
  box->box(FL_NO_BOX);
  box->labelsize(36);
  box->labeltype(FL_SHADOW_LABEL);

  window->end();
  window->show(argc, argv);

  return Fl::run();
}
开发者ID:tiborh,项目名称:cplusplus,代码行数:19,代码来源:hello_jp.cpp

示例11: AddDividerBox

//==== Create & Init Box Divider  ====//
void GroupLayout::AddDividerBox( const string& text, int used_w )
{
    assert( m_Group && m_Screen );

    //==== Add Divider Box ====//
    int dw = FitWidth( used_w, m_ButtonWidth );

    Fl_Box* flbox = new Fl_Box( m_X, m_Y, dw, m_DividerHeight );
    flbox->box( FL_BORDER_BOX );
    flbox->color( ( Fl_Color )12 );
    flbox->labelfont( 1 );
    flbox->labelcolor( FL_BACKGROUND2_COLOR );
    flbox->copy_label( text.c_str() );
    m_Group->add( flbox );
    AddX( dw );

    AddY( m_DividerHeight );
    NewLineX();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:20,代码来源:GroupLayout.cpp

示例12: bt

void bt(const char *name)
{
  int x = N%COLS;
  int y = N/COLS;
  N++;
  x = x*W+10;
  y = y*H+10;

  Fl_Box *a = new Fl_Box(x,y,W-20,H-20,name);
  a->user_data((void*)(name+1));
  a->align(FL_ALIGN_BOTTOM);
  a->label_size(11);

  Fl_Box *b = new Fl_Box(x,y,W-20,H-20,name);
  b->user_data((void*)(name+1));
  b->align(FL_ALIGN_CLIP);
  b->box(FL_THIN_UP_BOX);
  b->label_type(FL_SYMBOL_LABEL);
  b->label_color(FL_DARK3);
}
开发者ID:edeproject,项目名称:efltk,代码行数:20,代码来源:symbols.cpp

示例13: create_dlg

//-----------------------------------------------------------------------------
void XYZDlg::create_dlg()
{
	wnd = new Fl_Double_Window(325, 125, mgl_gettext("Change data sizes"));
	box = new Fl_Box(10, 10, 305, 40);
	box->box(UDAV_THIN_UP_BOX);
	box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

	mx = new Fl_Spinner(30, 55, 75, 25, "mx");
	mx->tooltip(mgl_gettext("New size of data on 1st dimension (x-direction)"));
	my = new Fl_Spinner(135, 55, 75, 25, "my");
	my->tooltip(mgl_gettext("New size of data on 2nd dimension (y-direction)"));
	mz = new Fl_Spinner(240, 55, 75, 25, "mz");
	mz->tooltip(mgl_gettext("New size of data on 3d dimension (z-direction)"));
	ch = new Fl_Check_Button(15, 90, 95, 25);

	Fl_Button *o;
	o = new Fl_Button(125, 90, 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(230, 90, 85, 25, mgl_gettext("Change"));o->callback(xyz_dlg_cb,wnd);
	o->box(UDAV_UP_BOX);	o->down_box(UDAV_DOWN_BOX);
	o->tooltip(mgl_gettext("Change (resize) data"));
	wnd->end();
}
开发者ID:ClinicalGraphics,项目名称:MathGL,代码行数:25,代码来源:table.cpp

示例14: addControl

void ModelerUI::addControl(const char* szName, float fMin, float fMax, float fStepSize, float fInitVal) 
{
	Fl_Group* pgrpCurrBak = Fl_Group::current();
	Fl_Group::current(m_ppckPack);
	
	const int k_iTextHeight = 20;
	const int k_iSliderHeight = 20;

	// Setup the label box
	Fl_Box* box = new Fl_Box(0, 0, m_ppckPack->w(), k_iTextHeight, szName);
	box->labelsize(10);
	box->hide();
	box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
		
	// Setup the slider
	Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, m_ppckPack->w(), k_iSliderHeight, 0);
	slider->type(1);
	slider->hide();
	slider->user_data(this);
	slider->callback(cb_sliders);
	slider->range(fMin, fMax);
	slider->step(fStepSize);
	slider->value(fInitVal);

	Fl_Group::current(pgrpCurrBak);

	// Add this entry to the browser
	string strName = "@C0"; // FLTK color encoding, we'll use @[email protected]
	strName += szName;
	m_pbrsBrowser->add(strName.c_str());
	
	// Setup the curve
	m_pwndGraphWidget->addCurve(fInitVal, fMin, fMax);

	++m_iCurrControlCount;
}
开发者ID:johnmave126,项目名称:Animator,代码行数:36,代码来源:modelerui.cpp

示例15: update_calendar

void EDE_Calendar::update_calendar() {
	unsigned int i;
	
	// Find first day of week
	edelib::Date d=active_date_;
	d.set(d.year(), d.month(), 1);
	int day_of_week = d.day_of_week()-1;
	
	// Show/hide first filler
	if (day_of_week>0)
		m_filler[0]->show();
	else
		m_filler[0]->hide();
	
	// Days
	int row=2;
	for (i=0; i<d.days_in_month(); i++) {
		Fl_Box* btn = m_dayButtons[i]; // shortcut
		btn->show();
		
		// Set button color
		Fl_Color daycolor = color(); // base color is the color of calendar

		if (day_of_week==0) // Special color for sunday
			daycolor = fl_color_average(daycolor, FL_BLUE, 0.8);
		
		if (i==(uint)today_date_.day()-1 && d.month()==today_date_.month() && d.year()==today_date_.year()) 
			btn->color(fl_color_average(daycolor, FL_RED, 0.5)); // today
		else if (i==(uint)active_date_.day()-1)
			btn->color(fl_lighter(daycolor));
		else
			btn->color(daycolor);
		
		// Set downbox for active day
		if (i==(uint)active_date_.day()-1)
			btn->box(FL_DOWN_BOX);
		else
			btn->box(FL_FLAT_BOX);

		day_of_week++;
		if (day_of_week==7) { day_of_week=0; row++; }
	}
	
	// Hide remaining buttons
	for (i=d.days_in_month(); i<31; i++)
		m_dayButtons[i]->hide();
	
	// Show/hide second filler
	if (day_of_week<6)
		m_filler[1]->show();
	else
		m_filler[1]->hide();
		
	// Show/hide third filler
	if (row<7)
		m_filler[2]->show();
	else
		m_filler[2]->hide();
	
	// Set title
	static char title[30]; // No month name should be larger than 24 chars, even when localized
			// and we can't show it anyway cause the box is too small
	snprintf (title, 30, "%s, %d", d.month_name(), d.year());
	m_monthNameBox->copy_label(title);
	
	
	// Calculate tooltip (distance between today and active date)
	static char tooltip_str[1024];
	tooltip_str[0] = '\0';
	
	if (today_date_ != active_date_) {
		long dist = date_distance(today_date_, active_date_);
		long weeks = dist/7;
		int wdays = dist%7;
		int months=0;
		int mdays=0;
		int years=0;
		int ymonths=0;
		
		// Find lower date, first part of tooltip
		edelib::Date d1,d2;
		if (today_date_ < active_date_) {
			d1=today_date_;
			d2=active_date_;
			snprintf(tooltip_str, 1023, _("In %ld days"), dist);
		} else {
			d2=today_date_;
			d1=active_date_;
			snprintf(tooltip_str, 1023, _("%ld days ago"), dist);
		}
		
		// If necessary, calculate distance in m/d and y/m/d format
		if (dist>30) {
			months = d2.month() - d1.month() + (d2.year() - d1.year())*12; 
			mdays = d2.day() - d1.day();
			if (mdays<1) {
				mdays += d2.days_in_month();
				months--;
			}
		}
//.........这里部分代码省略.........
开发者ID:GustavoMOG,项目名称:ede,代码行数:101,代码来源:EDE_Calendar.cpp


注:本文中的Fl_Box::box方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。