本文整理汇总了C++中GetToolBar函数的典型用法代码示例。如果您正苦于以下问题:C++ GetToolBar函数的具体用法?C++ GetToolBar怎么用?C++ GetToolBar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetToolBar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: defined
wxMenuBar::~wxMenuBar()
{
// In Windows CE (not .NET), the menubar is always associated
// with a toolbar, which destroys the menu implicitly.
#if defined(WINCE_WITHOUT_COMMANDBAR) && defined(__POCKETPC__)
if (GetToolBar())
{
wxToolMenuBar* toolMenuBar = wxDynamicCast(GetToolBar(), wxToolMenuBar);
if (toolMenuBar)
toolMenuBar->SetMenuBar(NULL);
}
#else
// we should free Windows resources only if Windows doesn't do it for us
// which happens if we're attached to a frame
if (m_hMenu && !IsAttached())
{
#if defined(WINCE_WITH_COMMANDBAR)
::DestroyWindow((HWND) m_commandBar);
m_commandBar = (WXHWND) NULL;
#else
::DestroyMenu((HMENU)m_hMenu);
#endif
m_hMenu = (WXHMENU)NULL;
}
#endif
}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:26,代码来源:menu.cpp
示例2: GetSize
void wxFrame::PositionToolBar()
{
int cw, ch;
GetSize( &cw , &ch ) ;
if ( GetStatusBar() && GetStatusBar()->IsShown())
{
int statusX, statusY;
GetStatusBar()->GetClientSize(&statusX, &statusY);
ch -= statusY;
}
if (GetToolBar())
{
int tx, ty, tw, th;
tx = ty = 0 ;
GetToolBar()->GetSize(& tw, & th);
if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
{
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
// means, pretend we don't have toolbar/status bar, so we
// have the original client size.
GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
}
else
{
// Use the 'real' position
GetToolBar()->SetSize(tx , ty , cw , th, wxSIZE_NO_ADJUSTMENTS );
}
}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:33,代码来源:frame.cpp
示例3: wxLogDebug
// Disables menuitems and toolbar tools that need to have an item selected in the
// listctrl first
void main_frame::on_update_ui_main_listctrl( wxUpdateUIEvent &event )
{
wxLogDebug( wxT( "Entering main_frame::on_update_ui_main_listctrl()" ) );
// True if there is some items selected in the listctrl.
bool enabled = (bool)m_main_listctrl->GetSelectedItemCount();
wxLogDebug( wxT( "Number of items selected in listctrl =%d" ), m_main_listctrl->GetSelectedItemCount() );
// Now set the tools and menuitems to that either true or false.
// The GetToolBar() and GetMenu() are the handy ways to get a pointer to the frame's
// toolbar and menubar. Do the menu first:
GetMenuBar()->Enable( wxID_PROPERTIES, enabled );
GetMenuBar()->Enable( wxID_DELETE, enabled );
GetMenuBar()->Enable( XRCID( "main_frame_update_selected_tool_or_menuitem" ), enabled );
// But it is possible that the user turned off the toolbar, so check to see if it there
// it a pointer by querying whether a call to wxFrame::GetToolBar() returns anything.
// Note we can't use the configuration setting to check it, since that value is
// written to config file when options dialog is closed.
if ( GetToolBar() )
{
GetToolBar()->EnableTool( wxID_PROPERTIES, enabled );
GetToolBar()->EnableTool( wxID_DELETE, enabled );
GetToolBar()->EnableTool( XRCID( "main_frame_update_selected_tool_or_menuitem" ), enabled );
}
}
开发者ID:TimofonicJunkRoom,项目名称:plucker-1,代码行数:29,代码来源:main_frame.cpp
示例4: defined
bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
{
#if wxUSE_MENUS
#if defined(WINCE_WITHOUT_COMMANDBAR)
if (GetToolBar() && GetToolBar()->FindById(id))
return GetToolBar()->MSWCommand(cmd, id);
#endif
// we only need to handle the menu and accelerator commands from the items
// of our menu bar, base wxWindow class already handles the rest
if ( !control && (cmd == 0 /* menu */ || cmd == 1 /* accel */) )
{
#if wxUSE_MENUS_NATIVE
if ( !wxCurrentPopupMenu )
#endif // wxUSE_MENUS_NATIVE
{
wxMenuItem * const mitem = FindItemInMenuBar((signed short)id);
if ( mitem )
return ProcessCommand(mitem);
}
}
#endif // wxUSE_MENUS
return wxFrameBase::HandleCommand(id, cmd, control);;
}
开发者ID:mark711,项目名称:Cafu,代码行数:26,代码来源:frame.cpp
示例5: GetToolBar
// Not part of the wxBookctrl API, but must be called in OnIdle or
// by application to realize the toolbar and select the initial page.
void wxToolbook::Realize()
{
if (m_needsRealizing)
{
GetToolBar()->SetToolBitmapSize(m_maxBitmapSize);
int remap = wxSystemOptions::GetOptionInt(wxT("msw.remap"));
wxSystemOptions::SetOption(wxT("msw.remap"), 0);
GetToolBar()->Realize();
wxSystemOptions::SetOption(wxT("msw.remap"), remap);
}
m_needsRealizing = false;
if (m_selection == -1)
m_selection = 0;
if (GetPageCount() > 0)
{
int sel = m_selection;
m_selection = -1;
SetSelection(sel);
}
DoSize();
}
开发者ID:jonntd,项目名称:dynamica,代码行数:28,代码来源:toolbkg.cpp
示例6: wxCHECK_MSG
bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
{
WXHMENU submenu = menu ? menu->GetHMenu() : 0;
wxCHECK_MSG( submenu, false, wxT("can't append invalid menu to menubar") );
if ( !wxMenuBarBase::Append(menu, title) )
return false;
menu->wxMenuBase::SetTitle(title);
#if defined(WINCE_WITHOUT_COMMANDBAR)
if (IsAttached())
#else
if (GetHmenu())
#endif
{
#if defined(WINCE_WITHOUT_COMMANDBAR)
if (!GetToolBar())
return false;
TBBUTTON tbButton;
memset(&tbButton, 0, sizeof(TBBUTTON));
tbButton.iBitmap = I_IMAGENONE;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_DROPDOWN | TBSTYLE_NO_DROPDOWN_ARROW | TBSTYLE_AUTOSIZE;
size_t pos = GetMenuCount();
HMENU hPopupMenu = (HMENU) menu->GetHMenu() ;
tbButton.dwData = (DWORD)hPopupMenu;
wxString label = wxStripMenuCodes(title);
tbButton.iString = (int) label.wx_str();
tbButton.idCommand = NewControlId();
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton))
{
wxLogLastError(wxT("TB_INSERTBUTTON"));
return false;
}
#else
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
(UINT_PTR)submenu, title.wx_str()) )
{
wxLogLastError(wxT("AppendMenu"));
}
#endif
#if wxUSE_ACCEL
if ( menu->HasAccels() )
{
// need to rebuild accelerator table
RebuildAccelTable();
}
#endif // wxUSE_ACCEL
if (IsAttached())
Refresh();
}
return true;
}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:59,代码来源:menu.cpp
示例7: GetStatusBar
void wxFrame::PositionToolBar()
{
int cw, ch;
wxTopLevelWindow::DoGetClientSize( &cw , &ch );
int statusX = 0 ;
int statusY = 0 ;
#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown())
{
GetStatusBar()->GetSize(&statusX, &statusY);
ch -= statusY;
}
#endif
#ifdef __WXOSX_IPHONE__
// TODO integrate this in a better way, on iphone the status bar is not a child of the content view
// but the toolbar is
ch -= 20;
#endif
if (GetToolBar())
{
int tx, ty, tw, th;
tx = ty = 0 ;
GetToolBar()->GetSize(&tw, &th);
if (GetToolBar()->HasFlag(wxTB_LEFT))
{
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
// means, pretend we don't have toolbar/status bar, so we
// have the original client size.
GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
}
else if (GetToolBar()->HasFlag(wxTB_RIGHT))
{
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
// means, pretend we don't have toolbar/status bar, so we
// have the original client size.
tx = cw - tw;
GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
}
else if (GetToolBar()->HasFlag(wxTB_BOTTOM))
{
tx = 0;
ty = ch - th;
GetToolBar()->SetSize(tx, ty, cw, th, wxSIZE_NO_ADJUSTMENTS );
}
else
{
#if !wxOSX_USE_NATIVE_TOOLBAR
// Use the 'real' position
GetToolBar()->SetSize(tx , ty , cw , th, wxSIZE_NO_ADJUSTMENTS );
#endif
}
}
}
开发者ID:mark711,项目名称:Cafu,代码行数:59,代码来源:frame.cpp
示例8: GetToolBar
void CMainFrame::SaveTBDefault()
// Saves the initial Toolbar configuration in a vector of TBBUTTON
{
int nCount = GetToolBar()->GetButtonCount();
for (int i = 0; i < nCount; i++)
{
TBBUTTON tbb;
GetToolBar()->GetButton(i, &tbb);
m_vTBBDefault.push_back(tbb);
}
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:12,代码来源:Mainfrm.cpp
示例9: SetSendSTEEvents
bool wxSTEditorFrame::Destroy()
{
SetSendSTEEvents(false);
if (GetToolBar() && (GetToolBar() == GetOptions().GetToolBar())) // remove for safety
GetOptions().SetToolBar(NULL);
if (GetMenuBar() && (GetMenuBar() == GetOptions().GetMenuBar())) // remove for file history
GetOptions().SetMenuBar(NULL);
if (GetStatusBar() && (GetStatusBar() == GetOptions().GetStatusBar()))
GetOptions().SetStatusBar(NULL);
return wxFrame::Destroy();
}
开发者ID:burzumishi,项目名称:caprice32wx,代码行数:12,代码来源:steframe.cpp
示例10:
wxMaximaFrame::~wxMaximaFrame()
{
wxString perspective = m_manager.SavePerspective();
wxConfig::Get()->Write(wxT("AUI/perspective"), perspective);
#if defined __WXMAC__
wxConfig::Get()->Write(wxT("AUI/toolbar"), (GetToolBar()->IsShown()));
#else
wxConfig::Get()->Write(wxT("AUI/toolbar"), (GetToolBar() != NULL));
#endif
m_manager.UnInit();
}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:13,代码来源:wxMaximaFrame.cpp
示例11: GetToolBar
void FrameMain::EnableToolBar(agi::OptionValue const& opt) {
if (opt.GetBool()) {
if (!GetToolBar()) {
toolbar::AttachToolbar(this, "main", context.get(), "Default");
GetToolBar()->Realize();
}
}
else if (wxToolBar *old_tb = GetToolBar()) {
SetToolBar(nullptr);
delete old_tb;
Layout();
}
}
开发者ID:Leinad4Mind,项目名称:Aegisub,代码行数:13,代码来源:frame_main.cpp
示例12: WidgetCount
void SeparateTabWidget::setCurrentIndex (int index)
{
if (index >= WidgetCount ())
index = WidgetCount () - 1;
auto rootWM = Core::Instance ().GetRootWindowsManager ();
auto tabManager = rootWM->GetTabManager (Window_);
MainStackedWidget_->setCurrentIndex (-1);
if (CurrentToolBar_)
{
RemoveWidgetFromSeparateTabWidget (CurrentToolBar_);
CurrentToolBar_ = nullptr;
}
MainTabBar_->setCurrentIndex (index);
if (auto bar = tabManager->GetToolBar (index))
{
AddWidget2SeparateTabWidget (bar);
bar->show ();
CurrentToolBar_ = bar;
}
MainStackedWidget_->setCurrentIndex (index);
CurrentIndex_ = index;
if (CurrentWidget_ != Widget (index))
{
PreviousWidget_ = CurrentWidget_;
CurrentWidget_ = Widget (index);
emit currentChanged (index);
}
}
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:33,代码来源:separatetabwidget.cpp
示例13: GetPageCount
wxWindow *wxToolbook::DoRemovePage(size_t page)
{
const size_t page_count = GetPageCount();
wxWindow *win = wxBookCtrlBase::DoRemovePage(page);
if ( win )
{
GetToolBar()->DeleteTool(page + 1);
if (m_selection >= (int)page)
{
// force new sel valid if possible
int sel = m_selection - 1;
if (page_count == 1)
sel = wxNOT_FOUND;
else if ((page_count == 2) || (sel == -1))
sel = 0;
// force sel invalid if deleting current page - don't try to hide it
m_selection = (m_selection == (int)page) ? wxNOT_FOUND : m_selection - 1;
if ((sel != wxNOT_FOUND) && (sel != m_selection))
SetSelection(sel);
}
}
return win;
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:28,代码来源:toolbkg.cpp
示例14: GetToolBar
int wxToolbook::HitTest(const wxPoint& pt, long *flags) const
{
int pagePos = wxNOT_FOUND;
if ( flags )
*flags = wxBK_HITTEST_NOWHERE;
// convert from wxToolbook coordinates to wxToolBar ones
const wxToolBarBase * const tbar = GetToolBar();
const wxPoint tbarPt = tbar->ScreenToClient(ClientToScreen(pt));
// is the point over the toolbar?
if ( wxRect(tbar->GetSize()).Contains(tbarPt) )
{
const wxToolBarToolBase * const
tool = tbar->FindToolForPosition(tbarPt.x, tbarPt.y);
if ( tool )
{
pagePos = tbar->GetToolPos(tool->GetId());
if ( flags )
*flags = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL;
}
}
else // not over the toolbar
{
if ( flags && GetPageRect().Contains(pt) )
*flags |= wxBK_HITTEST_ONPAGE;
}
return pagePos;
}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:32,代码来源:toolbkg.cpp
示例15: wxMDIParentFrame
// Define my frame constructor
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long style)
: wxMDIParentFrame(parent, id, title, pos, size, style)
{
m_nWinCreated = 0;
SetIcon(wxICON(sample));
// Make a menubar
wxMenu *file_menu = new wxMenu;
file_menu->Append(MDI_NEW_WINDOW, wxT("&New test\tCtrl+N"));
file_menu->Append(MDI_QUIT, wxT("&Exit\tAlt+X"));
wxMenu *help_menu = new wxMenu;
help_menu->Append(MDI_ABOUT, wxT("&About"));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, wxT("&File"));
menu_bar->Append(help_menu, wxT("&Help"));
// Associate the menu bar with the frame
SetMenuBar(menu_bar);
#if wxUSE_STATUSBAR
CreateStatusBar();
#endif // wxUSE_STATUSBAR
CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
InitToolBar(GetToolBar());
}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:33,代码来源:svgtest.cpp
示例16: GetToolBar
void CMainFrame::DoPopupMenu()
{
// Creates the popup menu for the "View Menu" toolbar button
// Position the popup menu
CToolBar& TB = GetToolBar();
CRect rc = TB.GetItemRect(TB.CommandToIndex(IDM_VIEWMENU));
TB.MapWindowPoints(NULL, (LPPOINT)&rc, 2);
TPMPARAMS tpm;
tpm.cbSize = sizeof(TPMPARAMS);
tpm.rcExclude = rc;
// Load the popup menu
CMenu TopMenu(IDM_VIEWMENU);
CMenu PopupMenu = TopMenu.GetSubMenu(0);
// Put a radio check in the currently checked item
MENUITEMINFO mii;
ZeroMemory(&mii, sizeof(MENUITEMINFO));
for (int i = 3 ; i < 7 ; i++)
{
ZeroMemory(&mii, GetSizeofMenuItemInfo());
mii.cbSize = GetSizeofMenuItemInfo();
mii.fMask = MIIM_STATE | MIIM_ID;
CMenu SubMenu = GetFrameMenu().GetSubMenu(1);
SubMenu.GetMenuItemInfo(i, mii, TRUE);
if (mii.fState & MFS_CHECKED)
TopMenu.CheckMenuRadioItem(IDM_VIEW_SMALLICON, IDM_VIEW_REPORT, mii.wID, 0);
}
// Start the popup menu
PopupMenu.TrackPopupMenuEx(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_VERTICAL, rc.left, rc.bottom, *this, &tpm);
}
开发者ID:the-reverend,项目名称:Win32xx,代码行数:35,代码来源:Mainfrm.cpp
示例17: wxMDIParentFrame
// Define my frame constructor
MyFrame::MyFrame(wxWindow *parent,
const wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
const long style)
: wxMDIParentFrame(parent, id, title, pos, size,
style | wxNO_FULL_REPAINT_ON_RESIZE)
{
textWindow = new wxTextCtrl(this, wxID_ANY, _T("A help window"),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxSUNKEN_BORDER);
#if wxUSE_TOOLBAR
CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
InitToolBar(GetToolBar());
#endif // wxUSE_TOOLBAR
// Accelerators
wxAcceleratorEntry entries[3];
entries[0].Set(wxACCEL_CTRL, (int) 'N', MDI_NEW_WINDOW);
entries[1].Set(wxACCEL_CTRL, (int) 'X', MDI_QUIT);
entries[2].Set(wxACCEL_CTRL, (int) 'A', MDI_ABOUT);
wxAcceleratorTable accel(3, entries);
SetAcceleratorTable(accel);
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:27,代码来源:mdi.cpp
示例18: Freeze
void CamuleDlg::Create_Toolbar(bool orientation)
{
Freeze();
// Create ToolBar from the one designed by wxDesigner (BigBob)
wxToolBar *current = GetToolBar();
wxASSERT(current == m_wndToolbar);
if (current) {
bool oldorientation = ((current->GetWindowStyle() & wxTB_VERTICAL) == wxTB_VERTICAL);
if (oldorientation != orientation) {
current->Destroy();
SetToolBar(NULL); // Remove old one if present
m_wndToolbar = NULL;
} else {
current->ClearTools();
}
}
if (!m_wndToolbar) {
m_wndToolbar = CreateToolBar(
(orientation ? wxTB_VERTICAL : wxTB_HORIZONTAL) |
wxNO_BORDER | wxTB_TEXT | wxTB_3DBUTTONS |
wxTB_FLAT | wxCLIP_CHILDREN | wxTB_NODIVIDER);
m_wndToolbar->SetToolBitmapSize(wxSize(32, 32));
}
Apply_Toolbar_Skin(m_wndToolbar);
Thaw();
}
开发者ID:marcoll,项目名称:amule,代码行数:33,代码来源:amuleDlg.cpp
示例19: GetToolBar
void wxFrame::PositionToolBar()
{
wxToolBar* tb = GetToolBar();
if (tb)
{
int cw, ch;
GetClientSize(& cw, &ch);
int tw, th;
tb->GetSize(& tw, & th);
if (tb->GetWindowStyleFlag() & wxTB_VERTICAL)
{
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
// means, pretend we don't have toolbar/status bar, so we
// have the original client size.
th = ch + th;
}
else
{
// Use the 'real' position
tw = cw;
}
tb->SetSize(0, 0, -1, -1, wxSIZE_NO_ADJUSTMENTS);
}
}
开发者ID:hgwells,项目名称:tive,代码行数:27,代码来源:frame.cpp
示例20: GetToolBar
void wxFrame::DoGetClientSize(int *x, int *y) const
{
wxTopLevelWindow::DoGetClientSize( x , y );
#if wxUSE_STATUSBAR
if ( GetStatusBar() && GetStatusBar()->IsShown() && y )
*y -= WX_MAC_STATUSBAR_HEIGHT;
#endif
#if wxUSE_TOOLBAR
wxToolBar *toolbar = GetToolBar();
if ( toolbar && toolbar->IsShown() )
{
int w, h;
toolbar->GetSize(&w, &h);
if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
{
if ( x )
*x -= w;
}
else
{
#if !wxMAC_USE_NATIVE_TOOLBAR
if ( y )
*y -= h;
#endif
}
}
#endif
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:31,代码来源:frame.cpp
注:本文中的GetToolBar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论