• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ToolBar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ToolBar的典型用法代码示例。如果您正苦于以下问题:C++ ToolBar类的具体用法?C++ ToolBar怎么用?C++ ToolBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getAction

SpectralLibraryMatchResults::~SpectralLibraryMatchResults()
{
   Service<DesktopServices> pDesktop;

   // remove toolbar button and menu item
   QAction* pAction = getAction();
   if (pAction != NULL)
   {
      ToolBar* pToolBar = static_cast<ToolBar*>(pDesktop->getWindow("Spectral", TOOLBAR));
      if (pToolBar != NULL)
      {
         pToolBar->removeItem(pAction);
         MenuBar* pMenuBar = pToolBar->getMenuBar();
         if (pMenuBar != NULL)
         {
            pMenuBar->removeMenuItem(pAction);
         }
      }
   }

   // dockwindow should still exist so detach from it
   DockWindow* pWindow = getDockWindow();
   if (pWindow != NULL)
   {
      pWindow->detach(SIGNAL_NAME(DockWindow, AboutToShowContextMenu),
         Slot(this, &SpectralLibraryMatchResults::updateContextMenu));
   }
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:28,代码来源:SpectralLibraryMatchResults.cpp


示例2: ToolBarFullFrame

/// This will make the floating ToolBarFrame appear at the specified location
void ToolBarStub::ShowWindowedToolBar(wxPoint * where /* = NULL */ ) 
{
   if (!mWindowedStatus) {
      
      if (!mToolBarFrame) {
         //Create a frame with a toolbar of type tbt inside it
         if (mType == MeterToolBarID)
            mToolBarFrame = new ToolBarFullFrame(mFrameParent, mType);
         else
            mToolBarFrame = new ToolBarMiniFrame(mFrameParent, mType);
         
         //Get the newly-created toolbar to get some info from it.
         ToolBar * tempTB = mToolBarFrame->GetToolBar();
         
         mTitle = tempTB->GetTitle();
         mSize = tempTB->GetSize();
      }

      //Move the frame to the mouse position
      if (where) {
         mToolBarFrame->DoMove(*where);
      }
      
      //Show the new window
      mToolBarFrame->DoShow();
   }

   mWindowedStatus = true;
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:30,代码来源:ToolBar.cpp


示例3: manage

ToolBar* MainWindow::get_toolbar(Properties& prop)
{
    // use the main toolbar by default
    ToolBar* toolbar = toolbar_;

    const char* tool = prop.get_string("tool");
    if (tool && *tool)
    {
        ToolMap::iterator i = toolMap_.find(tool);
        if (i == toolMap_.end())
        {
            toolbar = manage(new ToolBar);
            add_toolbar(tool, *toolbar);
            toolMap_.insert(i, make_pair(tool, toolbar));
        }
        else
        {
            toolbar = i->second;
            if (prop.get_word("separator", 0))
            {
                toolbar->add_separator();
            }
        }
    }
    return toolbar;
}
开发者ID:Panke,项目名称:zerobugs,代码行数:26,代码来源:main_win_toolbar.cpp


示例4: LayoutToolBars

//
// Set the visible/hidden state of a toolbar
//
void ToolDock::Expose( int type, bool show )
{
   ToolBar *t = mBars[ type ];

   // Maintain the docked array
   if( show )
   {
      if( mDockedBars.Index( t ) == wxNOT_FOUND )
      {
         mDockedBars.Add( t );
      }
   }
   else
   {
      if( mDockedBars.Index( t ) != wxNOT_FOUND )
      {
         mDockedBars.Remove( t );
      }
   }

   // Make it (dis)appear
   t->Expose( show );

   // Update the layout
   LayoutToolBars();
   Updated();
}
开发者ID:dot-Sean,项目名称:audio,代码行数:30,代码来源:ToolDock.cpp


示例5: pShowAction

QAction* SpectralLibraryMatchResults::createAction()
{
   // Add toolbar button and menu item to invoke the window
   QAction* pShowAction(NULL);
   ToolBar* pToolBar = static_cast<ToolBar*>(Service<DesktopServices>()->getWindow("Spectral", TOOLBAR));
   if (pToolBar != NULL)
   {
      MenuBar* pMenuBar = pToolBar->getMenuBar();
      if (pMenuBar != NULL)
      {
         QAction* pMenuAction = pMenuBar->getMenuItem("/Spectral/Support Tools");
         if (pMenuAction != NULL)
         {
            QMenu* pMenu = pMenuBar->getMenu(pMenuAction);
            if (pMenu != NULL)
            {
               pShowAction = pMenu->addAction("Spectral Library Match Results Window");
               if (pShowAction != NULL)
               {
                  QPixmap pixShowResults(ShowResultsIcon);
                  pShowAction->setIcon(QIcon(pixShowResults));
                  pShowAction->setCheckable(true);
                  pShowAction->setAutoRepeat(false);
                  pShowAction->setStatusTip("Toggles the display of the Spectral Library Match Results Window");
                  pToolBar->addSeparator();
                  pToolBar->addButton(pShowAction);
               }
            }
         }
      }
   }

   return pShowAction;
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:34,代码来源:SpectralLibraryMatchResults.cpp


示例6: pixEditLib

bool SpectralLibraryManager::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
    mpProgress = Service<PlugInManagerServices>()->getProgress(this);
    if (mpProgress != NULL)
    {
        Service<DesktopServices>()->createProgressDialog(getName(), mpProgress);
    }

    // Create edit library action
    if (isBatch() == false)
    {
        QPixmap pixEditLib(EditSpectralLibraryIcon);
        mpEditSpectralLibraryAction = new QAction(QIcon(pixEditLib),
                "&Edit Spectral Library", this);
        mpEditSpectralLibraryAction->setAutoRepeat(false);
        mpEditSpectralLibraryAction->setStatusTip("Display the editor for adding and removing "
                "signatures used by the Spectral Library Match algorithm plug-ins.");
        VERIFYNR(connect(mpEditSpectralLibraryAction, SIGNAL(triggered()), this, SLOT(editSpectralLibrary())));

        ToolBar* pToolBar = static_cast<ToolBar*>(Service<DesktopServices>()->getWindow("Spectral", TOOLBAR));
        if (pToolBar != NULL)
        {
            pToolBar->addSeparator();
            pToolBar->addButton(mpEditSpectralLibraryAction);
        }
    }

    return true;
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:29,代码来源:SpectralLibraryManager.cpp


示例7: GetActiveProject

void Theme::ApplyUpdatedImages()
{
   AudacityProject *p = GetActiveProject();
   for( int ii = 0; ii < ToolBarCount; ++ii )
   {
      ToolBar *pToolBar = p->mToolManager->GetToolBar(ii);
      if( pToolBar )
         pToolBar->ReCreateButtons();
   }
}
开发者ID:jengelh,项目名称:audacity,代码行数:10,代码来源:Theme.cpp


示例8: Expose

void ToolManager::Reset()
{
   int ndx;

   // Disconnect all docked bars
   for( ndx = 0; ndx < ToolBarCount; ndx++ )
   {
      wxWindow *parent;
      ToolDock *dock;
      ToolBar *bar = mBars[ ndx ];

      // Disconnect the bar
      if( bar->IsDocked() )
      {
         bar->GetDock()->Undock( bar );
         parent = NULL;
      }
      else
      {
         parent = bar->GetParent();
      }

      if( ndx == SelectionBarID )
      {
         dock = mBotDock;

         wxCommandEvent e;
         bar->GetEventHandler()->ProcessEvent(e);
      }
      else
      {
         dock = mTopDock;
         bar->ReCreateButtons();
      }

      bar->EnableDisableButtons();
#if 0
      if( bar->IsResizable() )
      {
         bar->SetSize(bar->GetBestFittingSize());
      }
#endif
      dock->Dock( bar );

      Expose( ndx, ndx ==  DeviceBarID ? false : true );

      if( parent )
      {
         parent->Destroy();
      }
   }

   LayoutToolBars();
   Updated();
} 
开发者ID:tuanmasterit,项目名称:audacity,代码行数:55,代码来源:ToolManager.cpp


示例9: UpdatePrefs

//
// Tell the toolbars that preferences have been updated
//
void ToolManager::UpdatePrefs()
{
   for( int ndx = 0; ndx < ToolBarCount; ndx++ )
   {
      ToolBar *bar = mBars[ ndx ];
      if( bar )
      {
         bar->UpdatePrefs();
      }
   }
}
开发者ID:GYGit,项目名称:Audacity,代码行数:14,代码来源:ToolManager.cpp


示例10: buildGui

void buildGui() {
	// status bar
	new StatusBar(0,0,CON_WIDTH,1);

	VBox *vbox=new VBox(0,2,1);
	// stats
	ToolBar *stats = new ToolBar(0,0,21,"Stats","Statistics about the current dungeon");
	stats->addWidget(new Label(0,0,wallRatioTxt,"Ratio of wall cells / total number of cells"));
	stats->addWidget(new Label(0,0,seedTxt,"Current random seed used to build the map"));
	vbox->addWidget(stats);
}
开发者ID:Chaduke,项目名称:bah.mod,代码行数:11,代码来源:dtool.cpp


示例11: GetSize

//This creates a toolbar of type t in the ToolBars array
void AudacityProject::LoadToolBar(enum ToolBarType t)
{

   //First, go through ToolBarArray and determine the current 
   //combined height of all toolbars.
   int tbheight = 0;
   int len = mToolBarArray.GetCount();
   for (int i = 0; i < len; i++)
      tbheight += mToolBarArray[i]->GetHeight();


   //Get the size of the current project window
   int width, height;
   GetSize(&width, &height);

   //Create a toolbar of the proper type
   ToolBar *toolbar;
   int h;
   switch (t) {
   case ControlToolBarID:
      h = gControlToolBarStub->GetHeight();
      toolbar = new ControlToolBar(this, -1, wxPoint(10, tbheight), wxSize(width - 10, h));
      ((wxMenuItemBase *)mViewMenu->FindItem(FloatControlToolBarID))->SetName(_("Float Control Toolbar"));
      mToolBarArray.Insert(toolbar, 0);
      break;

   case EditToolBarID:

      if (!gEditToolBarStub){
         gEditToolBarStub = new ToolBarStub(gParentWindow, EditToolBarID);
      }
      
      h = gEditToolBarStub->GetHeight();
      toolbar = new EditToolBar(this, -1, wxPoint(10, tbheight), wxSize(width - 10, h));
      
      
      mToolBarArray.Add(toolbar);
      break;

   case NoneID:
   default:
      toolbar = NULL;
      break;
   }

   //Add the new toolbar to the ToolBarArray and redraw screen
   mTotalToolBarHeight += toolbar->GetHeight() + 1;

   HandleResize();
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:51,代码来源:Project.cpp


示例12: ShowHide

//
// Toggles the visible/hidden state of a toolbar
//
void ToolManager::ShowHide( int type )
{
   ToolBar *t = mBars[ type ];

   // Handle docked and floaters differently
   if( t->IsDocked() )
   {
      t->GetDock()->ShowHide( type );
   }
   else
   {
      t->Expose( !t->IsVisible() );
   }
}
开发者ID:GYGit,项目名称:Audacity,代码行数:17,代码来源:ToolManager.cpp


示例13: ToolBarFrame

// ToolBarStub Constructer. Requires a ToolBarType.
// Whenever a ToolBarStub is around, there will be a floating
// ToolBarFrame.  It may be hidden or unhidden.
ToolBarStub::ToolBarStub(wxWindow * Parent, enum ToolBarType tbt) 
{
   //Create a frame with a toolbar of type tbt inside it
   mToolBarFrame = new ToolBarFrame(Parent, tbt);

   //Get the newly-created toolbar to get some info from it.
   ToolBar * tempTB = mToolBarFrame->GetToolBar();

   mType = tbt;
   mTitle = tempTB->GetTitle();
   mSize = tempTB->GetSize();
   mWindowedStatus = false;
   mLoadedStatus = true;
} 
开发者ID:ruthmagnus,项目名称:audacity,代码行数:17,代码来源:ToolBar.cpp


示例14: Expose

//
// Set the visible/hidden state of a toolbar
//
void ToolManager::Expose( int type, bool show )
{
   ToolBar *t = mBars[ type ];

   // Handle docked and floaters differently
   if( t->IsDocked() )
   {
      t->GetDock()->Expose( type, show );
   }
   else
   {
      t->Expose( show );
   }
}
开发者ID:GYGit,项目名称:Audacity,代码行数:17,代码来源:ToolManager.cpp


示例15: expandStrechableBars

void ToolBarAreaImpl::expandStrechableBars
(ToolBarRowPtr& row, int portion, int shift, int barIndex, int numStrechables, int lastSpace)
{
    ToolBar* bar = row->toolBars[barIndex];
    bar->desiredX += shift;
    if(bar->isStretchable()){
        int addition = (numStrechables > 1) ? portion : lastSpace;
        shift += addition;
        lastSpace -= addition;
        --numStrechables;
    }
    ++barIndex;
    if(barIndex < (int)row->toolBars.size()){
        expandStrechableBars(row, portion, shift, barIndex,  numStrechables, lastSpace);
    }
}
开发者ID:SeishoIrie,项目名称:choreonoid-deb,代码行数:16,代码来源:ToolBarArea.cpp


示例16: clearLibrary

SpectralLibraryManager::~SpectralLibraryManager()
{
    clearLibrary();

    // Remove the toolbar button
    Service<DesktopServices> pDesktop;
    ToolBar* pToolBar = static_cast<ToolBar*>(pDesktop->getWindow("Spectral", TOOLBAR));
    if (pToolBar != NULL)
    {
        if (mpEditSpectralLibraryAction != NULL)
        {
            VERIFYNR(disconnect(mpEditSpectralLibraryAction, SIGNAL(triggered()), this, SLOT(editSpectralLibrary())));
            pToolBar->removeItem(mpEditSpectralLibraryAction);
        }
    }
}
开发者ID:tclarke,项目名称:opticks-extras-Spectral,代码行数:16,代码来源:SpectralLibraryManager.cpp


示例17: IsVisible

//
// Returns the visibility of the specified toolbar
//
bool ToolManager::IsVisible( int type )
{
   ToolBar *t = mBars[ type ];

   return t->IsVisible();

   // If toolbar is floating
   if( !t->IsDocked() )
   {
      // Must return state of floater window
      return t->GetParent()->IsShown();
   }

   // Return state of docked toolbar
   return t->IsShown();
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:19,代码来源:ToolManager.cpp


示例18: toolName

bool
MainWindow::add_toolbar(const char* name, ToolBar& toolbar, bool defaultVisibility)
{
    assert(name);

    if (toolMap_.insert(make_pair(name, &toolbar)).second)
    {
        CHKPTR(toolbox_)->pack_start(toolbar, false, false);

        string toolName(name);
        MenuList& items = CHKPTR(toolMenu_)->items();

        items.push_back(Gtk::Menu_Helpers::CheckMenuElem(
            toolName,
            Gtk_BIND(Gtk_SLOT(this, &MainWindow::on_menu_toggle_toolbar),
                     &toolbar)));
        toolName = "toolbar." + toolName;

        if (debugger().properties()->get_word(toolName.c_str(), defaultVisibility))
        {
            Gtk_MENU_ITEM(items.back()).activate();
            toolbar.show_all();
        }
        return true;
    }
    return false;
}
开发者ID:Panke,项目名称:zerobugs,代码行数:27,代码来源:main_win_toolbar.cpp


示例19: ToolBarRow

void ToolBarAreaImpl::setNewToolBar(ToolBar* toolBar, vector<int>& numStrechablesOfRow)
{
    if(DEBUG_MODE){
        cout << "ToolBarAreaImpl::setNewToolBar()" << endl;
    }
    
    if(toolBar){

        ToolBarRowPtr toolBarRow;
        int rowIndex = -1;
        int width = toolBar->minimumSizeHint().width();

        for(size_t i=0; i < toolBarRows.size(); ++i){
            ToolBarRowPtr existingRow = toolBarRows[i];
            ToolBar* lastToolBar = existingRow->toolBars.back();
            if(lastToolBar){
                QRect r = lastToolBar->geometry();
                int lastX = r.x() + r.width();
                int lastSpace = self->width() - lastX;
                if(width <= lastSpace){
                    toolBar->desiredX = lastX + 1;
                    if(toolBar->isStretchable()){
                        width = std::min(toolBar->sizeHint().width(), lastSpace);
                    }
                    toolBarRow = existingRow;
                    rowIndex = i;
                    break;
                }
            }
        }
        if(!toolBarRow){
            toolBar->desiredX = 0;
            rowIndex = toolBarRows.size();
            toolBarRow.reset(new ToolBarRow(self));
            toolBarRows.push_back(toolBarRow);
            numStrechablesOfRow.push_back(0);
        }
        
        toolBarRow->toolBars.push_back(toolBar);
        if(toolBar->isStretchable()){
            numStrechablesOfRow[rowIndex]++;
        }
        toolBar->setParent(self);
        toolBar->setGeometry(toolBar->desiredX, 0, width, toolBar->sizeHint().height());
        toolBar->show();
    }
}
开发者ID:SeishoIrie,项目名称:choreonoid-deb,代码行数:47,代码来源:ToolBarArea.cpp


示例20: GetActiveProject

void ToolBarMiniFrame::OnMouseEvent(wxMouseEvent& evt)
{

   //The following is prototype code for allowing a double-click
   //close the toolbar.  Commented out in lieu of a close button
   //that is being tested.

#if 0
     if(evt.ButtonDClick(1))
      {
         AudacityProject * p  = GetActiveProject();
         ToolBar* tb = ToolBarFrame::GetToolBar();
         ToolBarStub *tbs= tb->GetToolBarStub();
         p->FloatToolBar(tbs);
      }
#endif
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:17,代码来源:ToolBar.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ToolBarItem类代码示例发布时间:2022-05-31
下一篇:
C++ Tool类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap