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