本文整理汇总了C++中wxUpdateUIEvent::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ wxUpdateUIEvent::GetId方法的具体用法?C++ wxUpdateUIEvent::GetId怎么用?C++ wxUpdateUIEvent::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxUpdateUIEvent
的用法示例。
在下文中一共展示了wxUpdateUIEvent::GetId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessUpdateUIEvent
void EditHandler::ProcessUpdateUIEvent(wxWindow *owner, wxUpdateUIEvent &event)
{
LEditor *editor = dynamic_cast<LEditor*>(owner);
if (event.GetId() == wxID_COPY || event.GetId() == XRCID("trim_trailing") || event.GetId() == XRCID("to_lower") || event.GetId() == XRCID("to_upper")) {
event.Enable(editor);
} else if (event.GetId() == wxID_CUT) {
event.Enable(editor);
} else if (event.GetId() == wxID_PASTE) {
#ifdef __WXGTK__
event.Enable(editor);
#else
event.Enable(editor && editor->CanPaste());
#endif
} else if (event.GetId() == wxID_UNDO) {
event.Enable(editor && editor->CanUndo());
} else if (event.GetId() == wxID_REDO) {
event.Enable(editor && editor->CanRedo());
} else if (event.GetId() == wxID_SELECTALL) {
event.Enable(editor && editor->GetLength() > 0);
} else if (event.GetId() == wxID_DUPLICATE || event.GetId() == wxID_DELETE) {
event.Enable(true);
} else {
event.Enable(false);
}
event.Skip(false);
}
示例2: OnUpdateButtons
void CResolverPage::OnUpdateButtons(wxUpdateUIEvent& e)
{
bool bEnable = false;
if ((e.GetId() == ID_BTN_DELETE) || (e.GetId() == ID_BTN_EXPORT)) {
if (m_dvResolvers->GetSelectedItemsCount() > 0) {
// Can only delete/export regex resolvers or orphaned addressbooks
const CResolver *pR = m_model.getEntry(
m_pUIModel->GetRow(m_dvResolvers->GetSelection()));
if (pR) {
bEnable = (!pR->isAvailable() || (pR->getType() == RT_ONLINE_REGEX));
}
}
}
else if (e.GetId() == ID_BTN_MOVE_UP) {
bEnable = (m_pUIModel->GetRowCount() > 1) &&
(m_dvResolvers->GetSelectedItemsCount() > 0) &&
(m_pUIModel->GetRow(m_dvResolvers->GetSelection()) > 0);
}
else if (e.GetId() == ID_BTN_MOVE_DOWN) {
bEnable = (m_pUIModel->GetRowCount() > 1) &&
(m_dvResolvers->GetSelectedItemsCount() > 0) &&
(m_pUIModel->GetRow(m_dvResolvers->GetSelection()) < m_pUIModel->GetRowCount()-1);;
}
else if (e.GetId() == ID_BTN_ONOFF) {
if (m_dvResolvers->GetSelectedItemsCount() > 0) {
const CResolver *pR = m_model.getEntry(
m_pUIModel->GetRow(m_dvResolvers->GetSelection()));
bEnable = pR->isAvailable();
e.SetText(pR->isEnabled() ? _("Dis&able") : _("En&able"));
}
}
e.Enable(bEnable);
}
示例3: OnMenuUpdateUI
void wxGISFeatureDetailsPanel::OnMenuUpdateUI(wxUpdateUIEvent& event)
{
if (event.GetId() == ID_WG_RESET_SORT || event.GetId() >= ID_WG_ENCODING_START)
return;
if(m_listCtrl->GetSelectedItemCount() == 0)
event.Enable(false);
else
event.Enable(true);
}
示例4: UpdateUI
/// Updates the radio button enable and selected states
void DragButtonList::UpdateUI(wxUpdateUIEvent& event)
{
if (event.GetId() > wxID_HIGHEST && event.GetId() <= (int) mEnableStates.GetCount() + wxID_HIGHEST) {
event.Enable(mEnableStates[event.GetId() - wxID_HIGHEST - 1]);
}
if (event.GetId() == (int) mSelected + wxID_HIGHEST + 1) {
((wxRadioButton *) event.GetEventObject())->SetValue(true); //toggles the others automatically
}
}
示例5: OnUpdateMenuItem
void AbstractApp::OnUpdateMenuItem(wxUpdateUIEvent& event) {
if (event.GetId() == wxID_ABOUT ||
event.GetId() == wxID_PREFERENCES ||
event.GetId() == TrenchBroom::View::CommandIds::Menu::HelpShowHelp)
event.Enable(true);
else
event.Enable(false);
if (GetTopWindow() != NULL)
event.Skip();
}
示例6: OnCommandUI
void wxGxObjectDialog::OnCommandUI(wxUpdateUIEvent& event)
{
wxGISCommand* pCmd = GetCommand(event.GetId());
if(pCmd)
{
if(pCmd->GetKind() == enumGISCommandCheck)
event.Check(pCmd->GetChecked());
event.Enable(pCmd->GetEnabled());
m_toolBar->SetToolShortHelp(event.GetId(), pCmd->GetTooltip());
}
}
示例7: OnQuickOptionsUpdateUI
void ThreadSearchView::OnQuickOptionsUpdateUI(wxUpdateUIEvent &event)
{
ThreadSearchFindData &findData = m_ThreadSearchPlugin.GetFindData();
if (event.GetId() == controlIDs.Get(ControlIDs::idOptionWholeWord))
event.Check(findData.GetMatchWord());
else if (event.GetId() == controlIDs.Get(ControlIDs::idOptionStartWord))
event.Check(findData.GetStartWord());
else if (event.GetId() == controlIDs.Get(ControlIDs::idOptionMatchCase))
event.Check(findData.GetMatchCase());
else if (event.GetId() == controlIDs.Get(ControlIDs::idOptionRegEx))
event.Check(findData.GetRegEx());
}
示例8: OnToolUpdate
void ErdPanel::OnToolUpdate(wxUpdateUIEvent& event)
{
if(event.GetId() == XRCID("IDT_ERD_TOOL"))
event.Check(m_nToolMode == modeDESIGN);
else if(event.GetId() == XRCID("IDT_ERD_TABLE"))
event.Check(m_nToolMode == modeTABLE);
else if(event.GetId() == XRCID("IDT_ERD_LINE"))
event.Check(m_nToolMode == modeLine);
else if(event.GetId() == XRCID("IDT_ERD_VIEW"))
event.Check(m_nToolMode == modeVIEW);
else
event.Skip();
}
示例9: OnUpdateSelectTrackWidth
void PCB_EDIT_FRAME::OnUpdateSelectTrackWidth( wxUpdateUIEvent& aEvent )
{
if( aEvent.GetId() == ID_AUX_TOOLBAR_PCB_TRACK_WIDTH )
{
if( m_SelTrackWidthBox->GetSelection() != (int) GetBoard()->GetTrackWidthIndex() )
m_SelTrackWidthBox->SetSelection( GetBoard()->GetTrackWidthIndex() );
}
else
{
bool check = ( ( ( ID_POPUP_PCB_SELECT_WIDTH1 +
(int) GetBoard()->GetTrackWidthIndex() ) == aEvent.GetId() ) &&
!GetDesignSettings().m_UseConnectedTrackWidth );
aEvent.Check( check );
}
}
示例10: OnUpdateEditingPart
void LIB_EDIT_FRAME::OnUpdateEditingPart( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( m_component != NULL );
if( m_component != NULL && aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}
示例11: OnUpdateUI
void wxWebPanelBase::OnUpdateUI(wxUpdateUIEvent& evt)
{
int id = evt.GetId();
switch (id)
{
case wxID_UNDO:
evt.Enable(false); // TODO: undo needs to be implemented
break;
case wxID_REDO:
evt.Enable(false); // TODO: undo needs to be implemented
break;
case wxID_CUT:
evt.Enable(m_browser->CanCutSelection());
break;
case wxID_COPY:
evt.Enable(m_browser->CanCopySelection());
break;
case ID_CopyLink:
evt.Enable(m_browser->CanCopyLinkLocation());
break;
case wxID_PASTE:
evt.Enable(m_browser->CanPaste());
break;
/* Text searching is not yet implemented.
case ID_FindAgain:
evt.Enable(m_find_text.Length() > 0 ? true : false);
break;
*/
}
}
示例12: OnButtonUpdate
void SubmodelsPanelT::OnButtonUpdate(wxUpdateUIEvent& UE)
{
switch (UE.GetId())
{
case ID_BUTTON_LOAD:
{
UE.Enable(true);
break;
}
case ID_BUTTON_UP:
{
UE.Enable(false);
break;
}
case ID_BUTTON_DOWN:
{
UE.Enable(false);
break;
}
case ID_BUTTON_UNLOAD:
{
UE.Enable(m_List->GetSelectedItemCount()>0);
break;
}
}
}
示例13: onUpdateUI
void HtmlExportWindow::onUpdateUI(wxUpdateUIEvent& ev) {
switch (ev.GetId()) {
case wxID_OK:
ev.Enable(list->hasSelection() && !getSelection().empty());
break;
}
}
示例14: OnUpdateOptionsToolbar
void FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar( wxUpdateUIEvent& aEvent )
{
int id = aEvent.GetId();
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();
bool state = false;
switch( id )
{
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
state = displ_opts->m_DisplayModTextFill == SKETCH;
break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
state = displ_opts->m_DisplayModEdgeFill == SKETCH;
break;
case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:
state = displ_opts->m_ContrastModeDisplay;
break;
default:
wxMessageBox( wxT( "FOOTPRINT_EDIT_FRAME::OnUpdateOptionsToolbar error" ) );
break;
}
aEvent.Check( state );
}
示例15: OnUpdateVerticalToolbar
void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent )
{
aEvent.Enable( GetBoard()->m_Modules != NULL );
if( aEvent.GetEventObject() == m_drawToolBar )
aEvent.Check( GetToolId() == aEvent.GetId() );
}