本文整理汇总了C++中Fl_Tabs类的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Tabs类的具体用法?C++ Fl_Tabs怎么用?C++ Fl_Tabs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Fl_Tabs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRenameCommunity
void OnRenameCommunity(Fl_Widget* pWidget,void * pParam)
{
Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
const char * scName=fl_input("Enter a new name", "");
if(scName==NULL)
return ;
char * sName = new char[strlen(scName)*2];
strcpy(sName,scName);
Fl_Widget* pW = (Fl_Widget*)pTab->value();
pW->label(scName);
}
示例2: OnSave
//callback for save
void OnSave(Fl_Widget* pWidget,void * pParam)
{
Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
std::ostringstream os;
for(int i = 0;i<pTab->children();i++)
{
CScopeTabPane * pTabPane = (CScopeTabPane*)(pTab->child(i));
std::string sHost;
int nPort;
pTabPane->GetMOOSInfo(sHost,nPort);
os<<pTabPane->label()<<":"<<nPort<<"@"<<sHost<<",";
}
//here we try to load previous preferences
Fl_Preferences app( Fl_Preferences::USER, "MOOS", "uMS" );
app.set("Communities",os.str().c_str());
}
示例3: OnAddCommunity
//callback for add Community
void OnAddCommunity(Fl_Widget* pWidget,void * pParam)
{
const char * scName=fl_input("New Community Name", "");
if(scName==NULL)
return ;
char * sName = new char[strlen(scName)*2];
strcpy(sName,scName);
Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
Fl_Group* pG = (Fl_Group*)pTab->value();
pTab->begin();
MakeCommunityPane(10,30,pG->w()-20,pG->h()-10,sName);
pTab->end();
}
示例4: Fl_Window
CAppManager::CAppManager()
{
const int mainw = 560, mainh = 330;
m_pMainWindow = new Fl_Window(mainw, mainh, "Nixstaller - App Manager");
m_pAppList = new Fl_Hold_Browser(20, 40, 180, 240, "Installed applications");
m_pAppList->align(FL_ALIGN_TOP);
GetRegisterEntries(&m_AppVec);
for (std::vector<app_entry_s *>::iterator it=m_AppVec.begin(); it!=m_AppVec.end(); it++)
m_pAppList->add(MakeCString((*it)->name));
m_pAppList->callback(AppListCB, this);
m_pAppList->value(1);
Fl_Tabs *pTabs = new Fl_Tabs((m_pAppList->x()+m_pAppList->w())+20, 20, 300, 260);
Fl_Group *pInfoTab = new Fl_Group((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 260, "Info");
m_pInfoOutput = new Fl_Help_View((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 240);
m_pInfoOutput->align(FL_ALIGN_TOP);
pInfoTab->end();
Fl_Group *pFilesTab = new Fl_Group((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 260, "Files");
m_pFilesTextDisplay = new Fl_Text_Display((m_pAppList->x()+m_pAppList->w())+20, 40, 300, 240);
m_pFilesTextBuffer = new Fl_Text_Buffer;
m_pFilesTextDisplay->buffer(m_pFilesTextBuffer);
pFilesTab->end();
pTabs->end();
m_pUninstallButton = new Fl_Button(20, (m_pAppList->y()+m_pAppList->h())+20, 120, 25, "Uninstall");
m_pUninstallButton->callback(UninstallCB, this);
m_pExitButton = new Fl_Button((mainw-140), (m_pAppList->y()+m_pAppList->h())+20, 120, 25, "Exit");
m_pExitButton->callback(ExitCB);
UpdateInfo(true);
m_pUninstallWindow = new CUninstallWindow(this);
m_pMainWindow->end();
}
示例5: OnRemoveCommunity
//callback for delete
void OnRemoveCommunity(Fl_Widget* pWidget,void * pParam)
{
Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
if(pTab->children()>1)
{
if(fl_choice("Really delete Scope of \"%s\" ?", "No", "Yes", NULL, pTab->value()->label()))
{
Fl_Group* pG = (Fl_Group*)pTab->value();
pG->clear();
pTab->remove(pG);
pTab->value(pTab->child(0));
delete pG;
}
}
}
示例6: icon_dialog_icon_edit
void icon_dialog_icon_edit(Desktop *self, DesktopIcon *d) {
const char *lbl = d ? _("Edit desktop icon") : _("Create desktop icon");
DesktopFile *df = NULL;
char *buf = NULL;
old_desktop_path = "";
curr_icon = d;
if(d) {
df = new DesktopFile();
if(!df->load(d->get_path())) {
delete df;
df = NULL;
int ret = ask(_("Unable to load .desktop file for this icon. Would you like to create a new icon instead?"));
if(!ret) return;
/* force NULL on icon, so we can run dialog in 'create' mode */
d = NULL;
}
buf = new char[BUFSIZE];
old_desktop_path = d->get_path();
}
win = new Fl_Window(450, 220, lbl);
Fl_Tabs *tabs = new Fl_Tabs(10, 10, 430, 165);
tabs->begin();
Fl_Group *g1 = new Fl_Group(15, 30, 415, 140, _("Basic"));
g1->begin();
img = new Fl_Button(20, 45, 80, 75);
img->callback(img_browse_cb);
img->tooltip(_("Click to select icon"));
if(d) {
E_ASSERT(df != NULL);
if(df->icon(buf, BUFSIZE)) {
IconLoader::set(img, buf, ICON_SIZE_HUGE);
img_path = buf;
}
}
/* handles even the case when we are creating the new icon */
if(!img->image()) {
IconLoader::set(img, DEFAULT_ICON, ICON_SIZE_HUGE);
img_path = DEFAULT_ICON;
}
name = new Fl_Input(210, 45, 215, 25, _("Name:"));
if(d && df->name(buf, BUFSIZE)) name->value(buf);
comment = new Fl_Input(210, 75, 215, 25, _("Comment:"));
if(d && df->comment(buf, BUFSIZE)) comment->value(buf);
execute = new Fl_Input(210, 105, 185, 25, _("Execute:"));
if(d && df->exec(buf, BUFSIZE)) execute->value(buf);
browse = new Fl_Button(400, 105, 25, 25, "...");
browse->callback(file_browse_cb);
icon_type = new Fl_Choice(210, 135, 215, 25, _("Type:"));
icon_type->down_box(FL_BORDER_BOX);
icon_type->menu(menu_items);
g1->end();
Fl_Group *g2 = new Fl_Group(15, 30, 420, 140, _("Details"));
g2->hide();
g2->begin();
run_in_terminal = new Fl_Check_Button(195, 80, 235, 25, _("Run in terminal"));
run_in_terminal->down_box(FL_DOWN_BOX);
if(df) run_in_terminal->value(df->terminal());
workdir = new Fl_Input(195, 45, 205, 25, _("Working directory:"));
if(df && df->path(buf, BUFSIZE)) workdir->value(buf);
Fl_Button *browsedir = new Fl_Button(405, 45, 25, 25, "...");
browsedir->callback(dir_browse_cb);
start_notify = new Fl_Check_Button(195, 110, 235, 25, _("Use startup notification"));
start_notify->down_box(FL_DOWN_BOX);
if(df) start_notify->value(df->startup_notify());
g2->end();
tabs->end();
ok = new Fl_Button(255, 185, 90, 25, _("&OK"));
ok->callback(ok_cb, self);
cancel = new Fl_Button(350, 185, 90, 25, _("&Cancel"));
cancel->callback(cancel_cb);
win->end();
win->set_modal();
delete df;
delete buf;
Fl::focus(name);
win->show();
}
示例7: _deltaFontSize
fieldWindow::fieldWindow(int deltaFontSize) : _deltaFontSize(deltaFontSize)
{
FL_NORMAL_SIZE -= deltaFontSize;
int width0 = 34 * FL_NORMAL_SIZE + WB;
int height0 = 12 * BH + 4 * WB;
int width = (CTX::instance()->fieldSize[0] < width0) ? width0 :
CTX::instance()->fieldSize[0];
int height = (CTX::instance()->fieldSize[1] < height0) ? height0 :
CTX::instance()->fieldSize[1];
win = new paletteWindow
(width, height, CTX::instance()->nonModalWindows ? true : false, "Size fields");
win->box(GMSH_WINDOW_BOX);
int x = WB, y = WB, w = (int)(1.5 * BB), h = height - 2 * WB - 3 * BH;
Fl_Menu_Button *new_btn = new Fl_Menu_Button(x, y, w, BH, "New");
FieldManager &fields = *GModel::current()->getFields();
std::map<std::string, FieldFactory*>::iterator it;
for(it = fields.map_type_name.begin(); it != fields.map_type_name.end(); it++)
new_btn->add(it->first.c_str());
new_btn->callback(field_new_cb);
y += BH;
browser = new Fl_Hold_Browser(x, y + WB, w, h - 2 * WB);
browser->callback(field_browser_cb);
y += h;
delete_btn = new Fl_Button(x, y, w, BH, "Delete");
delete_btn->callback(field_delete_cb, this);
y += BH;
put_on_view_btn = new Fl_Menu_Button(x, y, w, BH, "Visualize");
put_on_view_btn->callback(field_put_on_view_cb, this);
x += w + WB;
y = WB;
w = width - x - WB;
h = height - y - WB;
empty_message = new Fl_Box(x, y, w, h, "Create a new field\n\n"
"- or -\n\nSelect a field in the browser");
empty_message->align(FL_ALIGN_CENTER);
editor_group = new Fl_Group(x, y, w, h);
title = new Fl_Box(x, y, w, BH, "field_name");
title->labelfont(FL_BOLD);
title->labelsize(FL_NORMAL_SIZE + 3);
y += BH + WB;
h -= BH + WB;
Fl_Tabs *tabs = new Fl_Tabs(x, y , w, h);
y += BH;
h -= BH;
x += WB;
w -= 2 * WB;
Fl_Group *options_tab = new Fl_Group(x, y, w, h, "Options");
options_scroll = new Fl_Scroll(x, y + WB, w, h - BH - 3 * WB);
options_scroll->end();
Fl_Button *apply_btn = new Fl_Return_Button
(x + w - BB, y + h - BH - WB, BB, BH, "Apply");
apply_btn->callback(field_apply_cb, this);
background_btn = new Fl_Round_Button
(x, y + h - BH - WB, w - BB - WB, BH, "Set as background field");
background_btn->tooltip("Only a single field can be set as background field.\n"
"To combine multiple fields use the Min or Max fields.");
options_tab->end();
Fl_Group *help_tab = new Fl_Group(x, y, w, h, "Help");
help_display = new Fl_Help_View(x, y + WB, w, h - 2 * WB);
help_display->textfont(FL_HELVETICA);
help_display->textsize(FL_NORMAL_SIZE);
help_tab->end();
tabs->end();
editor_group->end();
win->resizable(new Fl_Box((int)(1.5 * BB) + 2 * WB, BH + 2 * WB,
width - 3 * WB - (int)(1.5 * BB),
height - 3 * BH - 5 * WB));
editor_group->resizable(tabs);
tabs->resizable(options_tab);
options_tab->resizable(new Fl_Box(3 * BB + 4 * WB, BH + 2 * WB,
width - 9 * WB - 5 * BB,
height - 3 * BH - 5 * WB));
win->size_range(width0, height0);
win->position(CTX::instance()->fieldPosition[0], CTX::instance()->fieldPosition[1]);
win->end();
FL_NORMAL_SIZE += deltaFontSize;
loadFieldViewList();
editField(NULL);
//.........这里部分代码省略.........
示例8: main
int main(int argc, char ** argv)
{
program=(char*)malloc(4096);
params=(char*)malloc(40960);
exe_root=(char*)malloc(4096);
if( GetModuleFileName(NULL, exe_root, 4096)!=0)//os specific method win32
{
if(strrchr(exe_root, '\\')!=NULL)
(strrchr(exe_root, '\\'))[0]=0;
}
else
{
puts("Failed to find exe_root");
return 1;
}
enc_filename=(char*)malloc(4096);
dec_filename=(char*)malloc(4096);
enc_outname=(char*)malloc(4096);
dec_outname=(char*)malloc(4096);
enc_working=(char*)malloc(4096);
dec_working=(char*)malloc(4096);
memset(enc_filename, 0, 4096);
memset(dec_filename, 0, 4096);
memset(enc_outname, 0, 4096);
memset(dec_outname, 0, 4096);
memset(enc_working, 0, 4096);
memset(dec_working, 0, 4096);
window = new Fl_Window(640,480, "GPackGUI r1");/*lazy, rev goes here*/
Fl_Tabs *tabs = new Fl_Tabs(0, 0, 640, 480);
Fl_Group *dec_tab = new Fl_Group(0, 30, 640, 450, "Decode");
Fl_Group *enc_tab = new Fl_Group(0, 30, 640, 450, "Encode");
Fl_Group *help_tab = new Fl_Group(0, 30, 640, 450, "Help");
tabs->add(dec_tab);
tabs->add(enc_tab);
tabs->add(help_tab);
/*decode tab*****************************************************************/
/*setup text display*/
decode_buff = new Fl_Text_Buffer();
d_disp = new Fl_Text_Display(0, 310, 640, 170, "");
d_disp->buffer(decode_buff);
//window->resizable(*d_disp);
decode_buff->text(
"\n"
);
dec_tab->add(d_disp);
/*dec_filename description*/
Fl_Box *d_filename_desc = new Fl_Box(20, 70, 600, 25, "1) Select a grp file from an existing merge");
dec_tab->add(d_filename_desc);
/*dec_filename button*/
Fl_Button *d_filename_b = new Fl_Button(20, 100, 80, 25, "Browse");
d_filename_b->callback(d_filename_f,0);
dec_tab->add(d_filename_b);
/*dec_filename path*/
d_filename_box = new Fl_Box(105, 100, 535, 25, "No grp file selected");
dec_tab->add(d_filename_box);
/*dec_outname description*/
Fl_Box *d_outname_desc = new Fl_Box(20, 160, 600, 25, "2) Select an output directory (optional)");
dec_tab->add(d_outname_desc);
/*dec_filename button*/
Fl_Button *d_outname_b = new Fl_Button(20, 190, 80, 25, "Browse");
d_outname_b->callback(d_outname_f,0);
dec_tab->add(d_outname_b);
/*dec_filename path*/
dec_outname_box = new Fl_Box(105, 190, 535, 25, "Default to same directory as merged files");
dec_tab->add(dec_outname_box);
/*dec_exec description*/
Fl_Box *d_exec_desc = new Fl_Box(20, 250, 600, 25, "3) Execute");
dec_tab->add(d_exec_desc);
/*dec_exec button*/
d_exec_b = new Fl_Button(20, 280, 80, 25, "Make it so");
d_exec_b->callback(d_exec_f,0);
dec_tab->add(d_exec_b);
/*encode tab*****************************************************************/
/*setup text display*/
encode_buff = new Fl_Text_Buffer();
e_disp = new Fl_Text_Display(0, 400, 640, 80, "");
e_disp->buffer(encode_buff);
//window->resizable(*e_disp);
encode_buff->text(
"\n"
);
//.........这里部分代码省略.........
示例9: show_icon_properties_dialog
void show_icon_properties_dialog(DesktopIcon* dicon) {
// fetch usefull data
DesktopIconData data;
study_and_fill(dicon, &data);
// now construct dialog and fill it
edelib::Window* win = new edelib::Window(315, 395, _("Icon properties"));
win->begin();
Fl_Tabs* tabs = new Fl_Tabs(10, 10, 295, 340);
tabs->begin();
Fl_Group* g1 = new Fl_Group(15, 35, 285, 310, _("General"));
g1->begin();
Fl_Button* icon_button = new Fl_Button(20, 50, 75, 75);
icon_button->image(data.image);
icon_button->callback((Fl_Callback*)icon_change_cb, &data);
icon_button->tooltip(_("Click to change icon"));
Fl_Input* prog_name = new Fl_Input(100, 75, 195, 25);
prog_name->value(data.label);
Fl_Output* prog_mime = new Fl_Output(100, 150, 195, 25, _("Type:"));
prog_mime->box(FL_FLAT_BOX);
prog_mime->color(FL_BACKGROUND_COLOR);
prog_mime->value(data.type.c_str());
Fl_Output* prog_location = new Fl_Output(100, 180, 195, 25, _("Location:"));
prog_location->box(FL_FLAT_BOX);
prog_location->color(FL_BACKGROUND_COLOR);
prog_location->value(data.location);
Fl_Output* prog_size = new Fl_Output(100, 210, 195, 25, _("Size:"));
prog_size->box(FL_FLAT_BOX);
prog_size->color(FL_BACKGROUND_COLOR);
prog_size->value(data.size.c_str());
Fl_Output* prog_date_mod = new Fl_Output(100, 240, 195, 25, _("Modified:"));
prog_date_mod->box(FL_FLAT_BOX);
prog_date_mod->color(FL_BACKGROUND_COLOR);
prog_date_mod->value(data.time_mod.c_str());
Fl_Output* prog_date_acessed = new Fl_Output(100, 270, 195, 25, "Accessed:");
prog_date_acessed->box(FL_FLAT_BOX);
prog_date_acessed->color(FL_BACKGROUND_COLOR);
prog_date_acessed->value(data.time_access.c_str());
g1->end();
Fl_Group* g2 = new Fl_Group(15, 35, 285, 310, _("URL"));
g2->hide();
g2->begin();
Fl_Input* prog_url = new Fl_Input(20, 65, 245, 25, _("URL:"));
prog_url->align(FL_ALIGN_TOP_LEFT);
Fl_Button* prog_browse = new Fl_Button(270, 65, 25, 25);
prog_browse->tooltip(_("Browse location"));
// set icon for browse button
if(!edelib::IconLoader::set(prog_browse, "document-open", edelib::ICON_SIZE_TINY))
prog_browse->label("...");
g2->end();
tabs->end();
Fl_Button* ok_button = new Fl_Button(120, 360, 90, 25, _("&OK"));
ok_button->callback(ok_cb, win);
Fl_Button* cancel_button = new Fl_Button(215, 360, 90, 25, _("&Cancel"));
cancel_button->callback(close_cb, win);
win->end();
win->show();
while(win->shown())
Fl::wait();
}
示例10: Fl_Double_Window
ModelerUserInterface::ModelerUserInterface() {
// Make this instance the current one
instance = this;
// Initialize pointers to NULL
m_nativeChooser = NULL;
model = NULL;
currentGroup = NULL;
renderGroup = NULL;
defaultCam = NULL;
ps = NULL;
movieWidth = 720;
movieHeight = 480;
// Set appearance to GTK+ for a nice look
Fl::scheme("gtk+");
// Set the animation speed to 24 frames/second
framesPerSecond = 24;
// We're not animating yet.
animating = false;
simulating = false;
rendering = false;
drawing = false;
// Set the color scheme
Fl::set_color(FL_BACKGROUND_COLOR, 240, 240, 240);
Fl::set_color(FL_BACKGROUND2_COLOR, 255, 255, 255);
Fl::set_color(FL_FOREGROUND_COLOR, 0, 0, 0);
Fl::set_color(FL_INACTIVE_COLOR, 128, 128, 128);
Fl::set_color(FL_SELECTION_COLOR, 51, 153, 255);
// Create all of the UI elements
// (autogenerated by FLUID, the FLTK UI Designer)
Fl_Double_Window* w;
const char* title = "Animator";
{ Fl_Double_Window* o = m_controlsWindow = new Fl_Double_Window(800, 625, title);
w = o;
o->callback((Fl_Callback*)cb_m_controlsWindow, (void*)(this));
o->when(FL_WHEN_NEVER);
{ Fl_Menu_Bar* o = m_controlsMenuBar = new Fl_Menu_Bar(0, 0, 800, 25);
o->menu(menu_m_controlsMenuBar);
}
// Contains the controls on the left
{ leftPane = new Fl_Group(0, 25, 250, 600);
int tabSpace = 0, controlSpace = 0;
int controlTop = 25 + 600 - controlSpace;
// Modeler and Curves tabs
{ Fl_Tabs* t = new Fl_Tabs(0, 25, 250, 600 - controlSpace);
// Make the tab area stretch.
leftPane->resizable(t);
t->when(FL_WHEN_CHANGED);
t->callback((Fl_Callback*)TabsCallback, this);
// Curves tab
{ Fl_Group* o = new Fl_Group(0, 50, 250, 575 - controlSpace, "Curves");
o->box(FL_FLAT_BOX);
o->color(FL_BACKGROUND_COLOR);
{ Fl_Tree* o = curvesTree = new Fl_Tree(0, 50, 250, 575 - controlSpace);
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback*)CurveTreeCallback);
o->marginleft(-5);
o->end();
}
o->end();
}
// Modeler tab
{ Fl_Tile* o = m_controlSplitPane =
new Fl_Tile(0, 50 + tabSpace, 250, 575 + tabSpace - controlSpace, "Modeler");
// Make only the content area of the tabs resize.
t->resizable(o);
o->box(FL_FLAT_BOX);
{ Fl_Tree* o = m_controlsTree = new Fl_Tree(0, 50 + tabSpace, 250, 100);
o->when(FL_WHEN_CHANGED);
o->callback((Fl_Callback*)TreeCallback);
o->marginleft(-5);
o->end();
}
{ Fl_Scroll* o = m_controlsScroll =
new Fl_Scroll(0, 150 + tabSpace, 250, 475 - tabSpace - controlSpace);
o->type(Fl_Scroll::VERTICAL);
o->when(FL_WHEN_CHANGED);
{ Fl_Pack* o = m_controlsPack =
new Fl_Pack(10, 150 + tabSpace, 215, 475 - tabSpace - controlSpace);
Fl_Group::current()->resizable(o);
o->spacing(2);
o->end();
}
o->end();
}
o->end();
} // end Modeler group/tab
t->end();
} // end tabs
leftPane->end();
} // left pane
{ // TODO: remove this extra brace!
//.........这里部分代码省略.........
示例11: paletteWindow
geometryContextWindow::geometryContextWindow(int deltaFontSize)
{
FL_NORMAL_SIZE -= deltaFontSize;
int width = 31 * FL_NORMAL_SIZE;
int height = 4 * WB + 8 * BH;
win = new paletteWindow(width, height, CTX::instance()->nonModalWindows ? true : false,
"Contextual Geometry Definitions");
win->box(GMSH_WINDOW_BOX);
{
Fl_Tabs *o = new Fl_Tabs(WB, WB, width - 2 * WB, height - 2 * WB);
// 0: Parameter
{
group[0] = new Fl_Group
(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Parameter");
input[0] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "Name");
input[0]->value("lc");
input[1] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Value");
input[1]->value("0.1");
input[24] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Label");
input[24]->value("");
input[25] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Path");
input[25]->value("Parameters");
for(int i = 0; i < 2; i++) input[i]->align(FL_ALIGN_RIGHT);
for(int i = 24; i < 26; i++) input[i]->align(FL_ALIGN_RIGHT);
{
Fl_Return_Button *o = new Fl_Return_Button
(width - BB - 2 * WB, 2 * WB + 7 * BH, BB, BH, "Add");
o->callback(con_geometry_define_parameter_cb);
}
group[0]->end();
}
// 1: Point
{
group[1] = new Fl_Group
(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Point");
input[2] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "X coordinate");
input[2]->value("0");
input[3] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Y coordinate");
input[3]->value("0");
input[4] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Z coordinate");
input[4]->value("0");
input[5] = new Fl_Input(2 * WB, 2 * WB + 4 * BH, IW, BH, "Prescribed mesh element size at point");
input[5]->value("1.0");
for(int i = 2; i < 6; i++) {
input[i]->align(FL_ALIGN_RIGHT);
}
value[0] = new Fl_Value_Input(2 * WB, 2 * WB + 5 * BH, IW/3, BH);
value[1] = new Fl_Value_Input(2 * WB + IW/3, 2 * WB + 5 * BH, IW/3, BH);
value[2] = new Fl_Value_Input(2 * WB + 2*IW/3, 2 * WB + 5 * BH, IW/3, BH,
"Snapping grid spacing");
for(int i = 0; i < 3; i++) {
value[i]->align(FL_ALIGN_RIGHT);
value[i]->callback(con_geometry_snap_cb);
}
{
Fl_Return_Button *o = new Fl_Return_Button
(width - BB - 2 * WB, 2 * WB + 7 * BH, BB, BH, "Add");
o->callback(con_geometry_define_point_cb);
}
group[1]->end();
}
// 2: Translation
{
group[2] = new Fl_Group
(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Translation");
input[6] = new Fl_Input(2 * WB, 2 * WB + 1 * BH, IW, BH, "X component");
input[6]->value("0");
input[7] = new Fl_Input(2 * WB, 2 * WB + 2 * BH, IW, BH, "Y component");
input[7]->value("0");
input[8] = new Fl_Input(2 * WB, 2 * WB + 3 * BH, IW, BH, "Z component");
input[8]->value("1");
for(int i = 6; i < 9; i++) {
input[i]->align(FL_ALIGN_RIGHT);
}
group[2]->end();
}
// 3: Rotation
{
group[3] = new Fl_Group
(WB, WB + BH, width - 2 * WB, height - 2 * WB - BH, "Rotation");
input[9] = new Fl_Input
(2 * WB, 2 * WB + 1 * BH, IW, BH, "X coordinate of an axis point");
input[9]->value("0");
input[10] = new Fl_Input
(2 * WB, 2 * WB + 2 * BH, IW, BH, "Y coordinate of an axis point");
input[10]->value("0");
input[11] = new Fl_Input
(2 * WB, 2 * WB + 3 * BH, IW, BH, "Z coordinate of an axis point");
input[11]->value("0");
input[12] = new Fl_Input
(2 * WB, 2 * WB + 4 * BH, IW, BH, "X component of axis direction");
input[12]->value("0");
input[13] = new Fl_Input
(2 * WB, 2 * WB + 5 * BH, IW, BH, "Y component of axis direction");
input[13]->value("1");
input[14] = new Fl_Input
(2 * WB, 2 * WB + 6 * BH, IW, BH, "Z component of axis direction");
input[14]->value("0");
//.........这里部分代码省略.........
示例12: main
//heres the money.....
int main(int argc, char* argv[])
{
//make the frame
Fl_Double_Window *w = new Fl_Double_Window( 820, 460, "uMS" );
w->size_range(DEFAULT_WIDTH,DEFAULT_HEIGHT);
//OK - lets build a whole set of panes
std::string sWho;
{
//note scoping
Fl_Preferences app( Fl_Preferences::USER, "MOOS", "uMS" );
char Space[2048];
app.get("Communities",Space,"Unnamed:[email protected]",sizeof(Space));
sWho = std::string(Space);
}
Fl_Tabs* pTab = new Fl_Tabs(10, 10, 800, 400);
while(!sWho.empty())
{
std::string sChunk = MOOSChomp(sWho,",");
std::string sName = MOOSChomp(sChunk,":");
int nPort = atoi(MOOSChomp(sChunk,"@").c_str());
std::string sHost = sChunk;
if(!sChunk.empty() && nPort>0)
{
Fl_Group *pG = MakeCommunityPane(10,30,800,390,(char*)sName.c_str());
CScopeTabPane * pTabPane = (CScopeTabPane*)(pG);
pTabPane->SetMOOSInfo(sHost,nPort);
Fl_Group::current()->resizable(pG);
}
}
if(pTab->children()==0)
{
MakeCommunityPane(10,30,800,390,"Unnamed");
}
w->end();
//and add some buttons to control them....
w->begin();
{
//add
Fl_Button * pNewCommunityButton = new Fl_Button(10,420,160,30,"Add Community");
pNewCommunityButton->callback(OnAddCommunity,pTab);
//delete
Fl_Button * pDelCommunityButton = new Fl_Button(180,420,160,30,"Remove Community");
pDelCommunityButton->callback(OnRemoveCommunity,pTab);
//save
Fl_Button * pSaveButton = new Fl_Button(350,420,160,30,"Save Layout");
pSaveButton->callback(OnSave,pTab);
pSaveButton->callback();
//rename
Fl_Button * pRenameButton = new Fl_Button(520,420,160,30,"Rename");
pRenameButton->callback(OnRenameCommunity,pTab);
pRenameButton->callback();
}
w->end();
//need to do more work on resizing - maybe even read the manual
w->resizable(pTab);
//and GO!
w->show(argc, argv);
return Fl::run();
}
示例13: make_codingstyle_window
Fl_Window* make_codingstyle_window() {
Fl_Window* w;
{Fl_Window* o = new Fl_Window(310, 255);
w = o;
o->shortcut(0xff1b);
{Fl_Tabs* o = new Fl_Tabs(0, 0, 303, 220);
o->color((Fl_Color)0xfffffffe);
{Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Brace Style"));
{Fl_Group* o = new Fl_Group(14, 22, 282, 122, _("Brace Style"));
o->box(FL_ENGRAVED_BOX);
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
{Fl_Box* o = new Fl_Box(20, 6, 47, 20, _("if ( x ) {"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(20, 25, 45, 20, _("++y;"));
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(20, 41, 36, 20, _("}"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(114, 6, 47, 20, _("if ( x )"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(114, 25, 36, 20, _("{"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(115, 42, 46, 20, _("++y;"));
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(114, 59, 36, 20, _("}"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Round_Button* o = pStyle1 = new Fl_Round_Button(16, 84, 66, 25, _("Style 1"));
o->type(Fl_Round_Button::RADIO);
o->value(1);
o->callback((Fl_Callback*)cb_pStyle1);
}
{Fl_Box* o = new Fl_Box(201, 6, 47, 20, _("if ( x )"));
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(201, 25, 36, 20, _("{"));
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(227, 42, 34, 22, _("++y;"));
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Box* o = new Fl_Box(201, 59, 36, 20, _("}"));
o->align(FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
}
{Fl_Round_Button* o = pStyle2 = new Fl_Round_Button(109, 84, 66, 25, _("Style 2"));
o->type(Fl_Round_Button::RADIO);
o->callback((Fl_Callback*)cb_pStyle2);
}
{Fl_Round_Button* o = pStyle3 = new Fl_Round_Button(200, 84, 66, 25, _("Style 3"));
o->type(Fl_Round_Button::RADIO);
o->callback((Fl_Callback*)cb_pStyle3);
}
o->end();
}
{Fl_Check_Button* o = pNoSpaceParens = new Fl_Check_Button(15, 147, 195, 22, _("No space before parentheses"));
o->callback((Fl_Callback*)cb_pNoSpaceParens);
}
{Fl_Check_Button* o = pBraceFuncs = new Fl_Check_Button(15, 170, 174, 22, _("Apply to function braces"));
o->value(1);
o->callback((Fl_Callback*)cb_pBraceFuncs);
}
o->end();
}
{Fl_Group* o = new Fl_Group(1, 24, 301, 195, _("Other"));
o->hide();
{Fl_Group* o = new Fl_Group(11, 22, 284, 90, _("Indentation"));
o->box(FL_ENGRAVED_BOX);
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
{Fl_Value_Input* o = pTabSize = new Fl_Value_Input(129, 33, 60, 22, _("Tab size for indents"));
o->maximum(12);
o->value(2);
o->callback((Fl_Callback*)cb_pTabSize);
}
{Fl_Check_Button* o = pIndentTabs = new Fl_Check_Button(13, 7, 114, 22, _("Indent with tabs"));
o->callback((Fl_Callback*)cb_pIndentTabs);
}
{Fl_Check_Button* o = pIndentCode = new Fl_Check_Button(14, 58, 151, 22, _("Indent code blocks"));
o->callback((Fl_Callback*)cb_pIndentCode);
}
o->end();
}
{Fl_Check_Button* o = pReturnParens = new Fl_Check_Button(10, 120, 220, 22, _("Always use parentheses on return"));
o->callback((Fl_Callback*)cb_pReturnParens);
}
o->end();
}
o->end();
}
{Fl_Button* o = new Fl_Button(115, 227, 59, 23, _("Cancel"));
o->callback((Fl_Callback*)cb_Cancel);
}
{Fl_Button* o = new Fl_Button(180, 227, 59, 23, _("Save"));
o->callback((Fl_Callback*)cb_Save);
}
{Fl_Button* o = new Fl_Button(245, 227, 59, 23, _("Use"));
//.........这里部分代码省略.........
示例14: main
int main (int argc, char **argv) {
Fl_Window* w;
fl_init_locale_support("eiconsconf", PREFIX"/share/locale");
readIconsConfiguration();
{Fl_Window* o = iconsConfWindow = new Fl_Window(265, 314, _("Icons settings"));
w = o;
o->shortcut(0xff1b);
{Fl_Button* o = new Fl_Button(25, 280, 75, 25, _("&OK"));
o->callback((Fl_Callback*)cb_OK);
}
{Fl_Button* o = new Fl_Button(185, 280, 75, 25, _("&Cancel"));
o->callback((Fl_Callback*)cb_Cancel);
}
{Fl_Button* o = new Fl_Button(105, 280, 75, 25, _("&Apply"));
o->callback((Fl_Callback*)cb_Apply);
}
{Fl_Tabs* o = new Fl_Tabs(3, 5, 257, 265);
o->color((Fl_Color)0xfffffffe);
{Fl_Group* o = new Fl_Group(1, 23, 255, 241, _("Look&&feel"));
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
{Fl_Button* o = colorButton = new Fl_Button(165, 17, 60, 18, _("Background color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_colorButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->color((Fl_Color) label_background);
if(label_trans) o->deactivate();
}
{Fl_Button* o = colorButton1 = new Fl_Button(165, 47, 60, 18, _("Label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_colorButton1);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->color((Fl_Color) label_foreground);
}
{Fl_Value_Slider* o = maxWidthSlider = new Fl_Value_Slider(115, 95, 125, 20, _("Maximum width: "));
o->type(Fl_Value_Slider::HORIZONTAL);
o->minimum(48);
o->maximum(200);
o->step(1);
o->value(50);
o->slider_size(10);
o->callback((Fl_Callback*)cb_maxWidthSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_maxwidth);
}
{Fl_Value_Slider* o = fontsizeSlider = new Fl_Value_Slider(115, 125, 125, 20, _("Font height: "));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->minimum(8);
o->maximum(48);
o->step(1);
o->value(10);
o->slider_size(10);
o->callback((Fl_Callback*)cb_fontsizeSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_fontsize);
}
{Fl_Value_Slider* o = gridspaceSlider = new Fl_Value_Slider(115, 155, 125, 20, _("Grid spacing: "));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->minimum(1);
o->maximum(50);
o->step(1);
o->value(10);
o->slider_size(10);
o->callback((Fl_Callback*)cb_gridspaceSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_gridspacing);
}
{Fl_Check_Button* o = autoArrButton = new Fl_Check_Button(25, 215, 222, 20, _("Auto arrange icons"));
o->callback((Fl_Callback*)cb_autoArrButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
o->value(auto_arr);
}
{Fl_Check_Button* o = engageButton = new Fl_Check_Button(25, 190, 222, 20, _("Engage with just one click"));
o->callback((Fl_Callback*)cb_engageButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
o->value(label_engage_1click);
}
{Fl_Check_Button* o = bg_color_check = new Fl_Check_Button(227, 17, 20, 18);
o->callback((Fl_Callback*)cb_bg_color_check);
o->tooltip(_("Clear this, to get transparent background."));
if(!label_trans) o->set_value();
}
o->end();
}
o->end();
}
o->end();
o->resizable(o);
}
w->show(argc, argv);
return Fl::run();
}
示例15: 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);
//.........这里部分代码省略.........