本文整理汇总了C++中wxWindow::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ wxWindow::GetName方法的具体用法?C++ wxWindow::GetName怎么用?C++ wxWindow::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxWindow
的用法示例。
在下文中一共展示了wxWindow::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Properties
void WindowTestCase::Properties()
{
m_window->SetLabel("label");
CPPUNIT_ASSERT_EQUAL("label", m_window->GetLabel());
m_window->SetName("name");
CPPUNIT_ASSERT_EQUAL("name", m_window->GetName());
//As we used wxID_ANY we should have a negative id
CPPUNIT_ASSERT(m_window->GetId() < 0);
m_window->SetId(wxID_HIGHEST + 10);
CPPUNIT_ASSERT_EQUAL(wxID_HIGHEST + 10, m_window->GetId());
}
示例2: OnCommand
void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
{
if (!m_propertySheet)
return;
if (win.GetName().empty())
return;
if (wxStrcmp(win.GetName(), wxT("ok")) == 0)
OnOk(event);
else if (wxStrcmp(win.GetName(), wxT("cancel")) == 0)
OnCancel(event);
else if (wxStrcmp(win.GetName(), wxT("help")) == 0)
OnHelp(event);
else if (wxStrcmp(win.GetName(), wxT("update")) == 0)
OnUpdate(event);
else if (wxStrcmp(win.GetName(), wxT("revert")) == 0)
OnRevert(event);
else
{
// Find a validator to route the command to.
wxNode *node = m_propertySheet->GetProperties().GetFirst();
while (node)
{
wxProperty *prop = (wxProperty *)node->GetData();
if (prop->GetWindow() && (prop->GetWindow() == &win))
{
wxPropertyValidator *validator = FindPropertyValidator(prop);
if (validator && validator->IsKindOf(CLASSINFO(wxPropertyFormValidator)))
{
wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator;
formValidator->OnCommand(prop, this, m_propertyWindow, event);
return;
}
}
node = node->GetNext();
}
}
}