本文整理汇总了C++中wxPropertyGridEvent::CanVeto方法的典型用法代码示例。如果您正苦于以下问题:C++ wxPropertyGridEvent::CanVeto方法的具体用法?C++ wxPropertyGridEvent::CanVeto怎么用?C++ wxPropertyGridEvent::CanVeto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxPropertyGridEvent
的用法示例。
在下文中一共展示了wxPropertyGridEvent::CanVeto方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPropertyGridChanging
void ChannelInspectorT::OnPropertyGridChanging(wxPropertyGridEvent& Event)
{
if (m_ModelDoc==NULL) return;
const ArrayT<unsigned int>& Selection=m_ModelDoc->GetSelection(CHAN);
if (Selection.Size()!=1) return;
// Changing a property by pressing ENTER doesn't change the selection. In consequence the property refresh below does not result in
// any change since selected properties are not updated (because the user could be in the process of editing a value).
// Since the user is definitely finished editing this property we can safely clear the selection.
// ClearSelection();
const unsigned int ChanNr =Selection[0];
const wxString PropName=Event.GetPropertyName();
m_IsRecursiveSelfNotify=true;
bool ok=true;
if (PropName=="Name")
{
ok=m_Parent->SubmitCommand(new CommandRenameT(m_ModelDoc, CHAN, ChanNr, Event.GetValue().GetString()));
}
else if (PropName.StartsWith("Joints."))
{
ok=m_Parent->SubmitCommand(new CommandUpdateChannelT(m_ModelDoc, ChanNr, Event.GetProperty()->GetIndexInParent(), Event.GetValue().GetBool()));
}
else
{
// Changing child properties (e.g. "Pos.x" to "5") also generates events for the composite parent (e.g. "Pos" to "(5, 0, 0)")!
// That is, if the following line is uncommented, it produces false warnings as well:
// wxMessageBox("Unknown property label \""+Name+"\".", "Warning", wxOK | wxICON_ERROR);
}
wxASSERT(Event.CanVeto()); // EVT_PG_CHANGING events can be vetoed (as opposed to EVT_PG_CHANGED events).
if (!ok) Event.Veto();
m_IsRecursiveSelfNotify=false;
}