本文整理汇总了C++中CToolBar::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ CToolBar::Create方法的具体用法?C++ CToolBar::Create怎么用?C++ CToolBar::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CToolBar
的用法示例。
在下文中一共展示了CToolBar::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
CToolBar* CToolBar::Load(CMainFrame* pMainFrame)
{
wxSize iconSize = CThemeProvider::GetIconSize(iconSizeSmall, true);
#ifdef __WXMAC__
// OS X only knows two hardcoded toolbar sizes.
if (iconSize.x >= 32) {
iconSize = wxSize(32, 32);
}
else {
iconSize = wxSize(24, 24);
}
#endif
CToolBar* toolbar = new CToolBar();
toolbar->m_pMainFrame = pMainFrame;
int style = wxTB_FLAT | wxTB_HORIZONTAL | wxTB_NODIVIDER;
#ifdef __WXMSW__
style |= wxTB_NOICONS;
#endif
if (!toolbar->Create(pMainFrame, XRCID("ID_TOOLBAR"), wxDefaultPosition, wxDefaultSize, style)) {
delete toolbar;
return 0;
}
toolbar->SetToolBitmapSize(iconSize);
toolbar->MakeTools();
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_REMOTE_IDLE, true);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_SERVER, true);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_SYNC_BROWSE, true);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_COMPARISON, true);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_APPLYFILTER, true);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_QUEUEPROCESSING, false);
CContextManager::Get()->RegisterHandler(toolbar, STATECHANGE_CHANGEDCONTEXT, false);
toolbar->RegisterOption(OPTION_SHOW_MESSAGELOG);
toolbar->RegisterOption(OPTION_SHOW_QUEUE);
toolbar->RegisterOption(OPTION_SHOW_TREE_LOCAL);
toolbar->RegisterOption(OPTION_SHOW_TREE_REMOTE);
toolbar->RegisterOption(OPTION_MESSAGELOG_POSITION);
toolbar->ToggleTool(XRCID("ID_TOOLBAR_FILTER"), CFilterManager::HasActiveFilters());
toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOGVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_MESSAGELOG) != 0);
toolbar->ToggleTool(XRCID("ID_TOOLBAR_QUEUEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_QUEUE) != 0);
toolbar->ToggleTool(XRCID("ID_TOOLBAR_LOCALTREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_LOCAL) != 0);
toolbar->ToggleTool(XRCID("ID_TOOLBAR_REMOTETREEVIEW"), COptions::Get()->GetOptionVal(OPTION_SHOW_TREE_REMOTE) != 0);
pMainFrame->SetToolBar(toolbar);
toolbar->Realize();
if (COptions::Get()->GetOptionVal(OPTION_MESSAGELOG_POSITION) == 2) {
toolbar->HideTool(XRCID("ID_TOOLBAR_LOGVIEW"));
}
return toolbar;
}
示例2: LoadToolBar
BOOL CCoolBarCtrl::LoadToolBar(UINT nIDToolBar)
{
CToolBar pToolBar;
if ( ! pToolBar.Create( this ) || ! pToolBar.LoadToolBar( nIDToolBar ) ) return FALSE;
for ( int i = 0 ; i < pToolBar.GetCount(); i++ )
{
UINT nID, nStyle;
int nImage;
pToolBar.GetButtonInfo( i, nID, nStyle, nImage );
Add( nID );
}
return TRUE;
}
示例3: CreateFileBar
bool CPromFrame::CreateFileBar(CToolBar& tb, UINT resourceID, const char *title)
{
if (!tb.Create(this) || !tb.LoadToolBar(resourceID)) {
TRACE0("Failed to create toolbar\n");
return false; // fail to create
}
tb.SetBarStyle(tb.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
if (title) {
tb.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
ShowControlBar(&tb,FALSE,FALSE);
DockControlBar(&tb);
tb.SetWindowText(title);
}
return true;
}