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


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

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


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

示例1: Fl_Box

MolBrowser::MolBrowser(VMDApp *vmdapp, MainFltkMenu *mm,
                       int x, int y, int xw, int yw)
: Fl_Multi_Browser(x, y, xw, yw), app(vmdapp) {
  mainmenu = mm;
  dragpending = 0;  
  align(FL_ALIGN_TOP_LEFT);
  column_widths(widths);
  color(VMDMENU_BROWSER_BG);
  selection_color(VMDMENU_BROWSER_SEL);

  VMDFLTKTOOLTIP(this, "Select molecule, toggle top/active/drawn/fixed, \nload/save coordinates or trajectory frames, \ndouble-click to rename molecule")

  new Fl_Box(x,   y-20,30,20,"ID");
  new Fl_Box(x+32,y-20,18,20,"T");
  new Fl_Box(x+50,y-20,18,20,"A");
  new Fl_Box(x+68,y-20,18,20,"D");
  new Fl_Box(x+86,y-20,18,20,"F");
  Fl_Box *b = new Fl_Box(x+102,y-20,220,20,"Molecule");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+262,y-20,80,20,"Atoms");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+342,y-20,60,20,"Frames");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  b = new Fl_Box(x+412,y-20,30,20,"Vol");
  b->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
  end();
}
开发者ID:quolc,项目名称:VMDLeap,代码行数:27,代码来源:MolBrowser.C

示例2:

    //constructeur
    Fl_Progress_Window()  : Fl_Window(238,105,"Progression...")
    {
        // Progress 1 Label
        Fl_Box *label = new Fl_Box(10,10,215,15,"Pourcentage Général:");
        label->labelsize(12);
        label->labelfont(1);
        label->labelcolor((Fl_Color)136);
        label->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

        //Progress1
        progress1 = new Fl_Progress(10,28,215,20,"0%");
        progress1->selection_color((Fl_Color)175);
        progress1->maximum(100);
        progress1->minimum(0);
        progress1->labelsize(12);

        // Progress filename (label progress 2)
        progress_filename = new Fl_Box(10,52,215,15, "Fichier:");
        progress_filename->labelsize(12);
        progress_filename->labelfont(1);
        progress_filename->labelcolor((Fl_Color)136);
        progress_filename->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);

        // Progress 2
        progress2 = new Fl_Progress(10,70,215,20,"0%");
        progress2->maximum(100);
        progress2->minimum(0);
        progress2->labelsize(12);
        progress2->selection_color((Fl_Color)175);

        //fin du window...
        this->set_modal();
        this->end();
    }
开发者ID:Asher256,项目名称:ultrasplitter,代码行数:35,代码来源:usplit.cpp

示例3: 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

示例4: 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

示例5: CBaseLuaWidget

CLuaImage::CLuaImage(const char *file) : CBaseLuaWidget(""), m_iImageW(0), m_iImageH(0)
{
    Fl_Shared_Image *img = Fl_Shared_Image::get(file);
    
    if (img)
    {
        if ((img->w() > MaxImageW()) || (img->h() > MaxImageH()))
        {
            int neww, newh;
            GetScaledImageSize(img->w(), img->h(), MaxImageW(), MaxImageH(), neww, newh);
            Fl_Image *temp = img->copy(neww, newh);
            img->release();
            img = (Fl_Shared_Image *)temp;
        }

        Fl_Box *imgbox = new Fl_Box(0, 0, img->w(), img->h());
        imgbox->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
        imgbox->image(img);
        GetGroup()->add(imgbox);
        
        m_iImageW = img->w();
        m_iImageH = img->h();
    }
    else
        GetGroup()->hide();
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:26,代码来源:luaimage.cpp

示例6: editbookmark

void editbookmark(bookmark * const ptr) {

	if (!bookedit_win) {
		bookedit_win = new Fl_Double_Window(350, 180, _("Edit bookmark"));
		{ bookedit_name = new Fl_Input(60, 20, 265, 25, _("Name:"));
		} // Fl_Input* bookedit_name
		{ bookedit_url = new Fl_Input(60, 55, 265, 25, _("URL:"));
		} // Fl_Input* bookedit_url
		{ Fl_Box* o = new Fl_Box(60, 80, 265, 50, _("The changes get applied immediately."));
			o->align(FL_ALIGN_WRAP);
		} // Fl_Box* o
		{ Fl_Button * o = new Fl_Button(60, 130, 115, 30, _("OK"));
			o->callback(bookedit_ok);
			bookedit_okbtn = o;
		} // Fl_Button* o
		{ Fl_Button* o = new Fl_Button(195, 130, 115, 30, _("Cancel"));
			o->callback(bookedit_cancel);
		} // Fl_Button* o
		bookedit_win->end();
	} // Fl_Double_Window* bookedit_win

	bookedit_name->value(ptr->name);
	bookedit_url->value(ptr->url);
	bookedit_url->activate();

	if (!ptr->url)
		bookedit_url->deactivate();

	bookedit_okbtn->user_data(ptr);

	bookedit_win->show();
}
开发者ID:BertieJim,项目名称:fifth,代码行数:32,代码来源:bookmarks.cpp

示例7: SetStructures

FolderWindow::FolderWindow(int x, int y, int wid, int hgt, const char *label, int folderIndex): Fl_Group(x, y, wid, hgt, label)
{
    
    Fl_Button* diagramButton = new Fl_Button(x+20,y+10,90,30,"Diagram");
    diagramButton->callback(DiagramCallback);
    Fl_Button* statsButton = new Fl_Button(x+120,y+10,90,30,"Statistics");
    statsButton->callback(StatsCallback);
    
    Fl_Button* closeButton = new Fl_Button(x+wid-25,y+5,20,20,"");
    closeButton->callback(FolderWindow::CloseFolderCallback);
    closeButton->label("@1+");
    
    Fl_Box* fileLabel = new Fl_Box(x+20,y+40,120,30,"Files");
    fileLabel->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
    
    folderScroll = new Fl_Scroll(x+10, y+70, 280, 310);
    folderScroll->type(Fl_Scroll::VERTICAL_ALWAYS);
    folderPack = new Fl_Pack(x+10, y+70, 260, 310);
    folderPack->type(Fl_Pack::VERTICAL);
    
    folderScroll->color(FL_WHITE);
    folderPack->color(FL_WHITE);
    
    this->resizable(folderScroll);
    this->color(FL_WHITE);
    this->selection_color(FL_WHITE);
    //size_range(300, 400, 300);
    
    //title = (char*)malloc(sizeof(char) * 64);
    SetStructures(folderIndex);
}
开发者ID:themize,项目名称:RNAStructViz,代码行数:31,代码来源:FolderWindow.cpp

示例8: 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

示例9: start_dialog

static int start_dialog(int argc, char** argv) {
	LaunchWindow* win = new LaunchWindow(370, 195, _("Run Command"));
	win->begin();
		Fl_Box* icon = new Fl_Box(10, 10, 55, 55);
		icon->image(image_run);

		Fl_Box* txt = new Fl_Box(70, 10, 290, 69, _("Enter the name of the application "
													"you would like to run or the URL you would like to view"));
		txt->align(132|FL_ALIGN_INSIDE);

		dialog_input = new Fl_Input(70, 90, 290, 25, _("Open:"));

		Resource rc;
		char     buf[128];

		if(rc.load("ede-launch-history") && rc.get("History", "open", buf, sizeof(buf))) {
			dialog_input->value(buf);

			/* make text appear selected */
			dialog_input->position(0, dialog_input->size());
		}

		in_term = new Fl_Check_Button(70, 125, 290, 25, _("Run in terminal"));
		in_term->down_box(FL_DOWN_BOX);

		Fl_Button* ok = new Fl_Button(175, 160, 90, 25, _("&OK"));
		ok->callback(ok_cb, win);
		Fl_Button* cancel = new Fl_Button(270, 160, 90, 25, _("&Cancel"));
		cancel->callback(cancel_cb, win);
	win->end();
	win->window_icon(run_xpm);
	win->show(argc, argv);

	return Fl::run();
}
开发者ID:edeproject,项目名称:svn,代码行数:35,代码来源:ede-launch.cpp

示例10: 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

示例11: 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

示例12: main

int main() {
	fl_open_display();

	Fl_Double_Window* win = new Fl_Double_Window(295, 144, "Notify test");
	win->begin();
		txt = new Fl_Input(10, 15, 275, 25);
		txt->align(FL_ALIGN_TOP_LEFT);

		color_button = new Fl_Button(260, 50, 25, 25, "Color");
		color_button->align(FL_ALIGN_LEFT);
		color_button->callback(color_cb);
		Fl_Box* bx = new Fl_Box(10, 50, 164, 85, "Type some text and choose color, then press Send. "
		"Desktop should get notified about this.");
		bx->align(FL_ALIGN_WRAP);

		Fl_Button* send_button = new Fl_Button(195, 110, 90, 25, "&Send");
		send_button->callback(send_cb);
	win->end();
	win->show();
	return Fl::run();
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:21,代码来源:notify.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: pickGroupProperty

void ModelerUserInterface::pickGroupProperty(GroupProperty* group) {
	// Remove the event listeners for old controls
	// TODO: we really need to have a PropertyEditor class that handles this
	// automatically...
	if (currentGroup) {
		PropertyList* props = currentGroup->getProperties();
		for (PropertyList::iterator iter = props->begin();
			 iter != props->end();
			 iter++)
		{
			if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateRangeSlider);
			} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateColorChooser);
			} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateCheckbox);
			} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
				prop->unlisten((SignalListener)updateChoice);
			}
		}

		// Clear out the old controls
		m_controlsPack->clear();

		currentGroup = NULL;
	}

	// Reset the scrollbar
	m_controlsScroll->position(0, 0);

	// If there's no group, exit
	if (!group) {
		m_controlsScroll->redraw();
		return;
	}

	// Constants for slider dimensions
	const int packWidth = m_controlsPack->w();
	const int textHeight = 20;
	const int sliderHeight = 20;
	const int chooserHeight = 100;
	const int buttonHeight = 20;

	// Show them
	// For each control, add appropriate objects to the user interface
	currentGroup = group;
	PropertyList* props = group->getProperties();
	for (PropertyList::iterator iter = props->begin();
		 iter != props->end();
		 iter++)
    {
		// Ignore it if it's a group property (those belong in the tree).
		if (dynamic_cast<GroupProperty*>(*iter))
			continue;

		// And now we'll create a UI element for the property.
		// The big if-statement below uses dynamic_cast<PropertyType*>(ptr),
		// to see if a property has a given type.  dynamic_cast will
		// return 0 if ptr is not of type PropertyType.

		// Add a slider if the property is a RangeProperty
		if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
			// Add the label
			Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
			box->labelsize(14);
			box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
			box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
			m_controlsPack->add(box);

			// Add the slider
			Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight);
			slider->type(1);
			slider->range(prop->getMin(), prop->getMax());
			slider->step(prop->getStep());
			slider->value(prop->getValue());
			m_controlsPack->add(slider);

			// Use the step size to determine the number of decimal places
			// shown in the slider's label.
			if (prop->getStep() > 0) {
			  slider->precision((int)-log(prop->getStep()));
			}

			// Have the slider notify the program when it changes
			slider->callback((Fl_Callback*)SliderCallback, (void*) prop);

			

			// Have the property notify the slider when it changes
			prop->listen((SignalListener)updateRangeSlider, (void*) slider);

		// Add a color picker if the property is an RGB property
		} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
			// Add the label
			Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
			box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
			box->labelsize(14);
			box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
			m_controlsPack->add(box);

//.........这里部分代码省略.........
开发者ID:thebandrews,项目名称:modeler_impl,代码行数:101,代码来源:modelerui.cpp

示例15: main

int main(int argc, char** argv)
{
	// Check config option, if showing is disabled, exit
	Fl_Config conf("EDE Team", "etip");
	if(argc == 2 && (!strcmp(argv[1], "-f") || !strcmp(argv[1], "--force")))
	{
		// nothing, to simplify omiting those '!'
	}
	else
	{
		bool show = true;
		conf.set_section("Tips");
		conf.read("Show", show, true);
		if (!show)
			return 0;
	}
	
	conf_global = &conf;
	srand(time(NULL));
	fl_init_locale_support("etip", PREFIX"/share/locale");

	Fl_Window* win = new Fl_Window(420, 169, _("Tips..."));
	win->shortcut(0xff1b);
	win->begin();

	Fl_Group* gr = new Fl_Group(5, 5, 410, 130);
	gr->box(FL_DOWN_BOX);
	Fl_Box* img = new Fl_Box(5, 5, 70, 65);
	Fl_Image pix(hint_xpm);
	img->image(pix);

	Fl_Box* title = new Fl_Box(80, 10, 320, 25, random_txt(title_tips, TITLE_TIPS_NUM));
	title->label_font(fl_fonts+1);
	title->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
	title->box(FL_FLAT_BOX);

	Fl_Box* tiptxt = new Fl_Box(80, 45, 320, 75, random_txt(tiplist, TIPS_NUM));
	tiptxt->align(FL_ALIGN_LEFT|FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
	tiptxt->box(FL_FLAT_BOX);
	gr->end();

	Fl_Check_Button* ch = new Fl_Check_Button(5, 140, 150, 25, _(" Do not bother me"));
	show_check = ch;

	Fl_Button* prev = new Fl_Button(160, 140, 80, 25, "<-");
	prev->label_font(fl_fonts+1);
	prev->callback(prev_cb, tiptxt);

	Fl_Button* next = new Fl_Button(245, 140, 80, 25, "->");
	next->label_font(fl_fonts+1);
	next->callback(next_cb, tiptxt);
	
	Fl_Button* close = new Fl_Button(335, 140, 80, 25, _("&Close"));
	close->callback(close_cb, win);

	win->end();

	win->set_modal();
	win->show();
	return Fl::run();
}
开发者ID:GustavoMOG,项目名称:ede12,代码行数:61,代码来源:etip.cpp


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