本文整理汇总了C++中Fl_Tabs::children方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Tabs::children方法的具体用法?C++ Fl_Tabs::children怎么用?C++ Fl_Tabs::children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Tabs
的用法示例。
在下文中一共展示了Fl_Tabs::children方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
}
}
示例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: 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();
}