本文整理汇总了C++中wxListEvent::GetEventObject方法的典型用法代码示例。如果您正苦于以下问题:C++ wxListEvent::GetEventObject方法的具体用法?C++ wxListEvent::GetEventObject怎么用?C++ wxListEvent::GetEventObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxListEvent
的用法示例。
在下文中一共展示了wxListEvent::GetEventObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnListSelected
void wxListbook::OnListSelected(wxListEvent& eventList)
{
if ( eventList.GetEventObject() != m_bookctrl )
{
eventList.Skip();
return;
}
const int selNew = eventList.GetIndex();
if ( selNew == m_selection )
{
// this event can only come from our own Select(m_selection) below
// which we call when the page change is vetoed, so we should simply
// ignore it
return;
}
SetSelection(selNew);
// change wasn't allowed, return to previous state
if (m_selection != selNew)
{
GetListView()->Select(m_selection);
GetListView()->Focus(m_selection);
}
}
示例2: OnExtensionListItemActivated
/**
* Edit property of an extension
*/
void DebuggerGUI::OnExtensionListItemActivated(wxListEvent& event)
{
wxListCtrl * list = dynamic_cast<wxListCtrl*>(event.GetEventObject());
if ( !list )
{
cout << "Received an event for a bad Extension wxListCtrl in debugger." << endl;
return;
}
boost::shared_ptr<gd::PlatformExtension> gdExtension = CppPlatform::Get().GetExtension(string(list->GetName().mb_str()));
boost::shared_ptr<ExtensionBase> extension = boost::dynamic_pointer_cast<ExtensionBase>(gdExtension);
if ( extension == boost::shared_ptr<ExtensionBase>() )
{
cout << "Unknown extension in debugger ( " << list->GetName() << " )" << endl;
return;
}
int propNb = event.GetIndex();
string uselessName, oldValue;
extension->GetPropertyForDebugger(scene, propNb, uselessName, oldValue);
string newValue = string(wxGetTextFromUser(_("Enter the new value"), _("Editing a value"), oldValue).mb_str());
if ( !extension->ChangeProperty(scene, propNb, newValue) )
{
gd::LogWarning(_("Unable to modify the value.\nThe value entered is either incorrect or the property is read-only."));
}
}
示例3: OnAutocompleteSelect
void CCManager::OnAutocompleteSelect(wxListEvent& event)
{
event.Skip();
m_AutocompSelectTimer.Start(AUTOCOMP_SELECT_DELAY, wxTIMER_ONE_SHOT);
wxObject* evtObj = event.GetEventObject();
#ifdef __WXMSW__
m_pAutocompPopup = static_cast<wxListView*>(evtObj);
#endif // __WXMSW__
if (!evtObj)
return;
wxWindow* evtWin = static_cast<wxWindow*>(evtObj)->GetParent();
if (!evtWin)
return;
m_DocPos = m_pPopup->GetParent()->ScreenToClient(evtWin->GetScreenPosition());
m_DocPos.x += evtWin->GetSize().x;
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
wxRect edRect = ed->GetRect();
if (!m_pPopup->IsShown())
{
cbStyledTextCtrl* stc = ed->GetControl();
int acMaxHeight = stc->AutoCompGetMaxHeight() + 1;
int textHeight = stc->TextHeight(stc->GetCurrentLine());
m_DocSize.x = edRect.width * 5 / 12;
m_DocSize.y = acMaxHeight * textHeight;
evtWin->Connect(wxEVT_SHOW, wxShowEventHandler(CCManager::OnAutocompleteHide), nullptr, this);
const int idx = wxDisplay::GetFromWindow(evtWin);
m_WindowBound = m_DocPos.x + m_DocSize.x;
if (idx != wxNOT_FOUND)
{
const wxPoint& corner = m_pPopup->GetParent()->ScreenToClient(wxDisplay(idx).GetGeometry().GetBottomRight());
m_DocSize.y = std::max(9 * textHeight, std::min(m_DocSize.y, corner.y - m_DocPos.y - 2));
m_DocSize.x = std::max(m_DocSize.y * 2 / 3, std::min(m_DocSize.x, corner.x - m_DocPos.x - 2));
m_WindowBound = std::min(corner.x - 2, m_WindowBound);
}
}
if ((m_DocPos.x + m_DocSize.x) > m_WindowBound)
m_DocPos.x -= evtWin->GetSize().x + m_DocSize.x; // show to the left instead
else
m_DocSize.x = std::min(m_WindowBound - m_DocPos.x, edRect.width * 5 / 12);
}