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


C++ Fl_Tabs::children方法代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:17,代码来源:uMS.cpp

示例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());
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:18,代码来源:uMS.cpp

示例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();
    
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:76,代码来源:uMS.cpp


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