本文整理汇总了C++中ToolBar::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolBar::GetType方法的具体用法?C++ ToolBar::GetType怎么用?C++ ToolBar::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolBar
的用法示例。
在下文中一共展示了ToolBar::GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxDynamicCast
////////////////////////////////////////////////////////////
// This fetches a pointer to the control toolbar. It may
// either be embedded in the current window or floating out
// in the open.
////////////////////////////////////////////////////////////
ControlToolBar *AudacityProject::GetControlToolBar()
{
ToolBar *tb = NULL;
bool GetToolBarFromFrame = false;
if (mToolBarArray.GetCount() != 0) {
tb = mToolBarArray[0];
if ((tb->GetType()) != ControlToolBarID)
GetToolBarFromFrame = true;
} else {
GetToolBarFromFrame = true;
}
if (GetToolBarFromFrame && gControlToolBarStub)
tb = gControlToolBarStub->GetToolBar();
return wxDynamicCast(tb, ControlToolBar);
}
示例2: ReadConfig
//.........这里部分代码省略.........
f->SetSizeHints( sz );
f->SetSize( sz );
f->Layout();
if( (x!=-1) && (y!=-1) )
bar->SetPositioned();
}
// Required on Linux Xfce
wxSize msz(width[ndx],height[ndx]-1);
bar->GetParent()->SetMinSize(msz);
// Inform toolbar of change
bar->SetDocked( NULL, false );
// Show or hide it
Expose( ndx, show[ ndx ] );
}
// Change back to the bar root
//gPrefs->SetPath( wxT("..") ); <-- Causes a warning...
// May or may not have gone into a subdirectory,
// so use an absolute path.
gPrefs->SetPath( wxT("/GUI/ToolBars") );
}
mTopDock->GetConfiguration().PostRead(topLegacy);
mBotDock->GetConfiguration().PostRead(botLegacy);
// Add all toolbars to their target dock
for( dock = 0; dock < DockCount; dock++ )
{
ToolDock *d = ( dock + 1 == TopDockID ? mTopDock : mBotDock );
d->LoadConfig();
// Add all unordered toolbars
bool deviceWasPositioned = false;
for( int ord = 0; ord < (int) unordered[ dock ].GetCount(); ord++ )
{
ToolBar *t = mBars[ unordered[ dock ][ ord ] ].get();
if (deviceWasPositioned &&
t->GetType() == DeviceBarID)
continue;
if (someFound &&
t->GetType() == ScrubbingBarID) {
// Special case code to put the NEW scrubbing toolbar where we
// want it, when audacity.cfg is present from an older version
ToolBar *lastRoot {};
// Change from the ideal configuration to the constrained one,
// just as when dragging and dropping
ToolBarConfiguration dummy;
mTopDock->WrapConfiguration(dummy);
// Start a NEW row with just the scrubbing toolbar
auto &configuration = mTopDock->GetConfiguration();
for (const auto place : configuration)
if (place.position.rightOf == nullptr)
lastRoot = place.pTree->pBar;
ToolBarConfiguration::Position position {
nullptr, lastRoot, false
};
mTopDock->Dock(t, false, position);
// Reposition the device toolbar, if it was docked above,
// right of scrubbing
const auto deviceToolBar = mBars[ DeviceBarID ].get();
if (deviceToolBar->GetDock() == mTopDock) {
deviceToolBar->GetDock()->Undock(deviceToolBar);
position = { t, nullptr };
mTopDock->Dock(deviceToolBar, false, position);
// Remember not to place the device toolbar again
deviceWasPositioned = true;
}
Expose( t->GetId(), show[ t->GetId() ] );
continue;
}
// Dock it
d->Dock( t, false );
// Show or hide the bar
Expose( t->GetId(), show[ t->GetId() ] );
}
}
// Restore original config path
gPrefs->SetPath( oldpath );
#if defined(__WXMAC__)
// Reinstate original transition
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, mTransition );
#endif
if (!someFound)
Reset();
}