本文整理汇总了C++中wxAuiToolBarEvent::GetToolId方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiToolBarEvent::GetToolId方法的具体用法?C++ wxAuiToolBarEvent::GetToolId怎么用?C++ wxAuiToolBarEvent::GetToolId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxAuiToolBarEvent
的用法示例。
在下文中一共展示了wxAuiToolBarEvent::GetToolId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnHistoryToolClicked
void SQLCommandPanel::OnHistoryToolClicked(wxAuiToolBarEvent& event)
{
wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
if ( auibar ) {
clAuiToolStickness ts(auibar, event.GetToolId());
wxRect rect = auibar->GetToolRect(event.GetId());
wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
pt = ScreenToClient(pt);
DbExplorerSettings settings;
clConfig conf(DBE_CONFIG_FILE);
conf.ReadItem(&settings);
settings.GetRecentFiles();
wxArrayString sqls = settings.GetSqlHistory();
wxMenu menu;
for(size_t i=0; i<sqls.GetCount(); ++i) {
menu.Append(wxID_HIGHEST+i, sqls.Item(i));
}
int pos = GetPopupMenuSelectionFromUser(menu, pt);
if ( pos == wxID_NONE )
return;
size_t index = pos - wxID_HIGHEST;
if ( index > sqls.GetCount() )
return;
m_scintillaSQL->SetText( sqls.Item(index) );
CallAfter( &SQLCommandPanel::ExecuteSql );
}
}
示例2: OnSetupRemoteUpload
void PHPWorkspaceView::OnSetupRemoteUpload(wxAuiToolBarEvent& event)
{
if ( !event.IsDropDownClicked() ) {
CallAfter( &PHPWorkspaceView::DoOpenSSHAccountManager );
} else {
SSHWorkspaceSettings settings;
settings.Load();
wxMenu menu;
if ( !settings.IsRemoteUploadSet() ) {
// We never setup remote upload for this workspace
menu.AppendCheckItem(ID_TOGGLE_AUTOMATIC_UPLOAD, _("Enable automatic upload"));
menu.Enable(ID_TOGGLE_AUTOMATIC_UPLOAD, false);
menu.Check(ID_TOGGLE_AUTOMATIC_UPLOAD, false);
} else {
menu.AppendCheckItem(ID_TOGGLE_AUTOMATIC_UPLOAD, _("Enable automatic upload"));
menu.Check(ID_TOGGLE_AUTOMATIC_UPLOAD, settings.IsRemoteUploadEnabled());
menu.Connect(ID_TOGGLE_AUTOMATIC_UPLOAD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PHPWorkspaceView::OnToggleAutoUpload), NULL, this);
}
wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
if ( auibar ) {
clAuiToolStickness ts(auibar, event.GetToolId());
wxRect rect = auibar->GetToolRect(event.GetId());
wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
pt = ScreenToClient(pt);
PopupMenu(&menu, pt);
}
}
}
示例3: DoOnDropdown
void GitConsole::DoOnDropdown(wxAuiToolBarEvent& e, const wxString& commandName, int id)
{
if(!e.IsDropDownClicked()) {
e.Skip();
return;
}
GitEntry data;
{
clConfig conf("git.conf");
conf.ReadItem(&data);
} // Force conf out of scope, else its dtor clobbers the GitConsole::OnDropDownMenuEvent Save()
GitCommandsEntries& ce = data.GetGitCommandsEntries(commandName);
vGitLabelCommands_t entries = ce.GetCommands();
int lastUsed = ce.GetLastUsedCommandIndex();
wxArrayString arr;
wxMenu menu;
for(size_t n = 0; n < entries.size(); ++n) {
wxMenuItem* item = menu.AppendRadioItem(n, entries.at(n).label);
item->Check(n == (size_t)lastUsed);
arr.Add(entries.at(n).command);
}
menu.Bind(wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(GitConsole::OnDropDownMenuEvent),
this,
0,
arr.GetCount(),
new GitCommandData(arr, commandName, id));
wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(e.GetEventObject());
if(auibar) {
clAuiToolStickness ts(auibar, e.GetToolId());
wxRect rect = auibar->GetToolRect(e.GetId());
wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
pt = ScreenToClient(pt);
PopupMenu(&menu, pt);
}
menu.Unbind(wxEVT_COMMAND_MENU_SELECTED,
wxCommandEventHandler(GitConsole::OnDropDownMenuEvent),
this,
0,
arr.GetCount(),
new GitCommandData(arr, commandName, id));
}
示例4: OnTemplatesBtnClick
void SQLCommandPanel::OnTemplatesBtnClick(wxAuiToolBarEvent& event)
{
wxMenu menu;
menu.Append(XRCID("IDR_SQLCOMMAND_SELECT"),_("Insert SELECT SQL template"),_("Insert SELECT SQL statement template into editor."));
menu.Append(XRCID("IDR_SQLCOMMAND_INSERT"),_("Insert INSERT SQL template"),_("Insert INSERT SQL statement template into editor."));
menu.Append(XRCID("IDR_SQLCOMMAND_UPDATE"),_("Insert UPDATE SQL template"),_("Insert UPDATE SQL statement template into editor."));
menu.Append(XRCID("IDR_SQLCOMMAND_DELETE"),_("Insert DELETE SQL template"),_("Insert DELETE SQL statement template into editor."));
menu.Connect(wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction)&SQLCommandPanel::OnPopupClick, NULL, this);
wxAuiToolBar* auibar = dynamic_cast<wxAuiToolBar*>(event.GetEventObject());
if ( auibar ) {
clAuiToolStickness ts(auibar, event.GetToolId());
wxRect rect = auibar->GetToolRect(event.GetId());
wxPoint pt = auibar->ClientToScreen(rect.GetBottomLeft());
pt = ScreenToClient(pt);
PopupMenu(&menu, pt);
}
}
示例5: OnToolDropDown
void wxGISApplication::OnToolDropDown(wxAuiToolBarEvent& event)
{
if(event.IsDropDownClicked())
{
wxGISCommand* pCmd = GetCommand(event.GetToolId());
m_pDropDownCommand = dynamic_cast<IDropDownCommand*>(pCmd);
if(m_pDropDownCommand)
{
wxMenu* pMenu = m_pDropDownCommand->GetDropDownMenu();
if(pMenu)
{
PushEventHandler(pMenu);
PopupMenu(pMenu, event.GetItemRect().GetBottomLeft());
PopEventHandler();
delete pMenu;
return;
}
}
}
event.Skip();
}