本文整理汇总了C++中Fl_Box类的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Box类的具体用法?C++ Fl_Box怎么用?C++ Fl_Box使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fl_Box类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
/*-----------------------------------main------------------------------*/
int
main (int argc, char **argv) {
int h_menu;
int x, y, w, h;
int width = 600;
int height = 400;
window = new Fl_Window(width,height);
h_menu = 30;
Fl_Menu_Bar menubar (0,0,width,h_menu);
menubar.menu(big_menu);
menubar.callback(test_cb);
menubar.color(FL_WHITE);
menubar.selection_color(FL_BLUE);
window->size_range(300,20);
window->color(FL_GREEN);
x = 170;
y = 20 + h_menu;
w = width - 190;
h = height - h_menu - 40;
Fl_Box *box = new Fl_Box (FL_BORDER_BOX, x,y,w,h, "Hello, World!");
box->color(FL_YELLOW);
window->end();
window->show(argc, argv);
window->make_current();
return Fl::run();
}
示例2: Fl_Multi_Browser
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();
}
示例3: 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();
}
示例4: 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);
}
示例5: ModelerUserInterface
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();
}
示例6: 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();
}
示例7: Fl_Group
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);
}
示例8: 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();
}
示例9: next_cb
void next_cb(Fl_Widget*, void* tb)
{
Fl_Box* tipbox = (Fl_Box*)tb;
curr_tip++;
if(curr_tip >= TIPS_NUM)
curr_tip = 0;
tipbox->label(tiplist[curr_tip]);
tipbox->redraw_label();
}
示例10: prev_cb
void prev_cb(Fl_Widget*, void* tb)
{
Fl_Box* tipbox = (Fl_Box*)tb;
if(curr_tip == 0)
curr_tip = TIPS_NUM - 1;
else
curr_tip--;
tipbox->label(tiplist[curr_tip]);
tipbox->redraw_label();
}
示例11: main
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(300,180);
Fl_Box *box = new Fl_Box(FL_UP_BOX,20,40,260,100,"Hello, World!");
box->labelfont(FL_BOLD+FL_ITALIC);
box->labelsize(36);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->show(argc, argv);
return Fl::run();
}
示例12: run_main
int run_main (int argc, ACE_TCHAR *argv[])
{
ACE_START_TEST (ACE_TEXT ("FlReactor_Test"));
Fl_Window window (300, 370);
Test_Window tw (10, 75, window.w () - 20, window.h ()-90);
window.resizable (&tw);
Fl_Hor_Slider slider (60, 5, window.w () - 70, 30, "Sides:");
slider.align (FL_ALIGN_LEFT);
slider.callback (sides_cb, &tw);
slider.value (tw.sides ());
slider.step (1);
slider.bounds (3, 10);
ACE_FlReactor reactor;
ACE_Reactor r (&reactor);
Fl_Box *box = new Fl_Box (FL_UP_BOX, 10, 40,
window.w () - 20, 30,
"Setting up");
box->labelfont (FL_BOLD);
Acceptor acceptor (&tw, box);
ACE_INET_Addr address;
if (acceptor.open (address, &r) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"open acceptor"),
-1);
acceptor.acceptor ().get_local_addr (address);
const int bufsiz = 128;
char buf[bufsiz];
address.addr_to_string (buf, bufsiz, 0);
char msg[2 * bufsiz];
ACE_OS::sprintf (msg, "Listening on <%s>\n", buf);
box->label (msg);
box->redraw ();
window.end ();
window.show (argc, argv);
tw.show ();
return Fl::run ();
ACE_END_TEST;
}
示例13: Fl_Progress_Window
//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();
}
示例14: 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();
}
示例15: 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();
}