本文整理汇总了C++中ToolBar::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ ToolBar::GetId方法的具体用法?C++ ToolBar::GetId怎么用?C++ ToolBar::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToolBar
的用法示例。
在下文中一共展示了ToolBar::GetId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadConfig
//.........这里部分代码省略.........
bar->SetSize( sz );
bar->Layout();
}
}
#endif
// Is order within range and unoccupied?
if( ( ord >= 0 ) &&
( ord < ToolBarCount ) &&
( order[ dock - 1 ][ ord ] == NoBarID ) )
{
// Insert at ordered location
order[ dock - 1 ][ ord ] = ndx;
}
else
{
// These must go at the end
unordered[ dock - 1 ].Add( ndx );
}
}
else
{
// Create the bar (with the top dock being temporary parent)
bar->Create( mTopDock );
// Construct a new floater
ToolFrame *f = new ToolFrame( mParent, this, bar, wxPoint( x, y ) );
// Set the width and height
if( width[ ndx ] != -1 && height[ ndx ] != -1 )
{
wxSize sz( width[ ndx ], height[ ndx ] );
f->SetSizeHints( sz );
f->SetSize( sz );
f->Layout();
}
// Show or hide it
bar->Expose( show[ ndx ] );
// Inform toolbar of change
bar->SetDocked( NULL, false );
}
// 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") );
}
// Add all toolbars to their target dock
for( dock = 0; dock < DockCount; dock++ )
{
ToolDock *d = ( dock + 1 == TopDockID ? mTopDock : mBotDock );
// Add all ordered toolbars
for( ord = 0; ord < ToolBarCount; ord++ )
{
ndx = order[ dock ][ ord ];
// Bypass empty slots
if( ndx != NoBarID )
{
ToolBar *t = mBars[ ndx ];
// Dock it
d->Dock( t );
// Hide the bar
if( !show[ t->GetId() ] )
{
d->ShowHide( t->GetId() );
}
}
}
// Add all unordered toolbars
for( ord = 0; ord < (int) unordered[ dock ].GetCount(); ord++ )
{
ToolBar *t = mBars[ unordered[ dock ][ ord ] ];
// Dock it
d->Dock( t );
// Hide the bar
if( !show[ t->GetId() ] )
{
d->ShowHide( t->GetId() );
}
}
}
// Restore original config path
gPrefs->SetPath( oldpath );
#if defined(__WXMAC__)
// Reinstate original transition
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, mTransition );
#endif
}
示例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();
}