本文整理汇总了C++中HandleWindowEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ HandleWindowEvent函数的具体用法?C++ HandleWindowEvent怎么用?C++ HandleWindowEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HandleWindowEvent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WXUNUSED
bool wxSpinButton::OS2OnScroll( int WXUNUSED(nOrientation),
WXWORD WXUNUSED(wParam),
WXWORD wPos,
WXHWND hControl )
{
wxCHECK_MSG(hControl, false, wxT("scrolling what?") );
wxSpinEvent vEvent( wxEVT_SCROLL_THUMBTRACK, m_windowId );
int nVal = (int)wPos; // cast is important for negative values!
vEvent.SetPosition(nVal);
vEvent.SetEventObject(this);
return(HandleWindowEvent(vEvent));
} // end of wxSpinButton::OS2OnScroll
示例2: GetPeer
void wxScrollBar::TriggerScrollEvent( wxEventType scrollEvent )
{
int position = GetPeer()->GetValue();
int minPos = 0 ;
int maxPos = GetPeer()->GetMaximum();
int nScrollInc = 0;
if ( scrollEvent == wxEVT_SCROLL_LINEUP )
{
nScrollInc = -1;
}
else if ( scrollEvent == wxEVT_SCROLL_LINEDOWN )
{
nScrollInc = 1;
}
else if ( scrollEvent == wxEVT_SCROLL_PAGEUP )
{
nScrollInc = -m_pageSize;
}
else if ( scrollEvent == wxEVT_SCROLL_PAGEDOWN )
{
nScrollInc = m_pageSize;
}
int new_pos = position + nScrollInc;
if (new_pos < minPos)
new_pos = minPos;
else if (new_pos > maxPos)
new_pos = maxPos;
if ( nScrollInc )
SetThumbPosition( new_pos );
wxScrollEvent event( scrollEvent, m_windowId );
if ( m_windowStyle & wxHORIZONTAL )
event.SetOrientation( wxHORIZONTAL );
else
event.SetOrientation( wxVERTICAL );
event.SetPosition( new_pos );
event.SetEventObject( this );
wxWindow* window = GetParent();
if (window && window->MacIsWindowScrollbar( this ))
// this is hardcoded
window->MacOnScroll( event );
else
HandleWindowEvent( event );
}
示例3: event
void wxGLCanvas::OnInternalIdle()
{
if (m_exposed)
{
wxPaintEvent event( GetId() );
event.SetEventObject( this );
HandleWindowEvent( event );
m_exposed = false;
GetUpdateRegion().Clear();
}
wxWindow::OnInternalIdle();
}
示例4: UpdatePathFromDialog
void wxFileButton::OnDialogOK(wxCommandEvent& ev)
{
// the wxFileDialog associated with the GtkFileChooserButton has been closed
// using the OK button, thus the selected file has changed...
if (ev.GetId() == wxID_OK)
{
// ...update our path
UpdatePathFromDialog(m_dialog);
// ...and fire an event
wxFileDirPickerEvent event(wxEVT_FILEPICKER_CHANGED, this, GetId(), m_path);
HandleWindowEvent(event);
}
}
示例5: GetSelection
void wxControlWithItemsBase::SendSelectionChangedEvent(wxEventType eventType)
{
const int n = GetSelection();
if ( n == wxNOT_FOUND )
return;
wxCommandEvent event(eventType, m_windowId);
event.SetInt(n);
event.SetEventObject(this);
event.SetString(GetStringSelection());
InitCommandEventWithItems(event, n);
HandleWindowEvent(event);
}
示例6: wxCHECK_RET
void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
wxCHECK_RET( m_widget, wxT("invalid frame") );
// deal with the position first
int old_x = m_x;
int old_y = m_y;
if ( !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
{
// -1 means "use existing" unless the flag above is specified
if ( x != -1 )
m_x = x;
if ( y != -1 )
m_y = y;
}
else // wxSIZE_ALLOW_MINUS_ONE
{
m_x = x;
m_y = y;
}
if ( m_x != old_x || m_y != old_y )
{
gtk_window_move( GTK_WINDOW(m_widget), m_x, m_y );
}
const wxSize oldSize(m_width, m_height);
if (width >= 0)
m_width = width;
if (height >= 0)
m_height = height;
ConstrainSize();
if (m_width < 1) m_width = 1;
if (m_height < 1) m_height = 1;
if (m_width != oldSize.x || m_height != oldSize.y)
{
m_deferShowAllowed = true;
m_useCachedClientSize = false;
int w, h;
GTKDoGetSize(&w, &h);
gtk_window_resize(GTK_WINDOW(m_widget), w, h);
DoGetClientSize(&m_clientWidth, &m_clientHeight);
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
HandleWindowEvent(event);
}
}
示例7: WXUNUSED
// process a WM_COMMAND generated by the buddy text control
bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id))
{
if ( (cmd == EN_CHANGE) && (!m_blockEvent ))
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
event.SetEventObject(this);
wxString val = wxGetWindowText(m_hwndBuddy);
event.SetString(val);
event.SetInt(GetValue());
return HandleWindowEvent(event);
}
// not processed
return false;
}
示例8: WXUNUSED
bool wxSpinCtrl::ProcessTextCommand( WXWORD wCmd,
WXWORD WXUNUSED(wId) )
{
switch (wCmd)
{
case SPBN_CHANGE:
{
wxCommandEvent vEvent( wxEVT_COMMAND_TEXT_UPDATED, GetId() );
vEvent.SetEventObject(this);
wxString sVal = wxGetWindowText(m_hWndBuddy);
vEvent.SetString(sVal);
vEvent.SetInt(GetValue());
return (HandleWindowEvent(vEvent));
}
case SPBN_SETFOCUS:
case SPBN_KILLFOCUS:
{
wxFocusEvent vEvent( wCmd == EN_KILLFOCUS ? wxEVT_KILL_FOCUS : wxEVT_SET_FOCUS
,m_windowId
);
vEvent.SetEventObject(this);
return(HandleWindowEvent(vEvent));
}
default:
break;
}
//
// Not processed
//
return false;
} // end of wxSpinCtrl::ProcessTextCommand
示例9: event
// Only allow toggle if returns true
bool wxToolBarBase::OnLeftClick(int toolid, bool toggleDown)
{
wxCommandEvent event(wxEVT_TOOL, toolid);
event.SetEventObject(this);
// we use SetInt() to make wxCommandEvent::IsChecked() return toggleDown
event.SetInt((int)toggleDown);
// and SetExtraLong() for backwards compatibility
event.SetExtraLong((long)toggleDown);
// Send events to this toolbar instead (and thence up the window hierarchy)
HandleWindowEvent(event);
return true;
}
示例10: vEvent
void wxSpinCtrl::OnSpinChange(
wxSpinEvent& rEventSpin
)
{
wxCommandEvent vEvent( wxEVT_COMMAND_SPINCTRL_UPDATED
,GetId()
);
vEvent.SetEventObject(this);
vEvent.SetInt(rEventSpin.GetPosition());
(void)HandleWindowEvent(vEvent);
if (rEventSpin.GetSkipped())
{
vEvent.Skip();
}
} // end of wxSpinCtrl::OnSpinChange
示例11: event
bool wxTopLevelWindowX11::Show(bool show)
{
if (show)
{
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
HandleWindowEvent(event);
m_needResizeInIdle = false;
}
bool ret = wxWindowX11::Show(show);
return ret;
}
示例12: event
bool wxListBoxBase::SendEvent(wxEventType evtType, int item, bool selected)
{
wxCommandEvent event(evtType, GetId());
event.SetEventObject(this);
event.SetInt(item);
event.SetString(GetString(item));
event.SetExtraLong(selected);
if ( HasClientObjectData() )
event.SetClientObject(GetClientObject(item));
else if ( HasClientUntypedData() )
event.SetClientData(GetClientData(item));
return HandleWindowEvent(event);
}
示例13: event
bool wxDatePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch)
{
wxDateTime dt;
if ( dtch.dwFlags == GDT_VALID )
dt.SetFromMSWSysDate(dtch.st);
// filter out duplicate DTN_DATETIMECHANGE events which the native
// control sends us when using wxDP_DROPDOWN style
if ( (m_date.IsValid() == dt.IsValid()) &&
(!m_date.IsValid() || dt == m_date) )
return false;
m_date = dt;
wxDateEvent event(this, dt, wxEVT_DATE_CHANGED);
return HandleWindowEvent(event);
}
示例14: wxDUMMY_INITIALIZE
bool wxControl::MSWOnNotify(int idCtrl,
WXLPARAM lParam,
WXLPARAM* result)
{
wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL);
NMHDR *hdr = (NMHDR*) lParam;
switch ( hdr->code )
{
case NM_CLICK:
eventType = wxEVT_COMMAND_LEFT_CLICK;
break;
case NM_DBLCLK:
eventType = wxEVT_COMMAND_LEFT_DCLICK;
break;
case NM_RCLICK:
eventType = wxEVT_COMMAND_RIGHT_CLICK;
break;
case NM_RDBLCLK:
eventType = wxEVT_COMMAND_RIGHT_DCLICK;
break;
case NM_SETFOCUS:
eventType = wxEVT_COMMAND_SET_FOCUS;
break;
case NM_KILLFOCUS:
eventType = wxEVT_COMMAND_KILL_FOCUS;
break;
case NM_RETURN:
eventType = wxEVT_COMMAND_ENTER;
break;
default:
return wxWindow::MSWOnNotify(idCtrl, lParam, result);
}
wxCommandEvent event(wxEVT_NULL, m_windowId);
event.SetEventType(eventType);
event.SetEventObject(this);
return HandleWindowEvent(event);
}
示例15: WXUNUSED
bool wxListBox::OS2Command(
WXUINT uParam
, WXWORD WXUNUSED(wId))
{
wxEventType eEvtType;
if (uParam == LN_SELECT)
{
eEvtType = wxEVT_LISTBOX;
}
else if (uParam == LN_ENTER)
{
eEvtType = wxEVT_LISTBOX_DCLICK;
}
else
{
//
// Some event we're not interested in
//
return false;
}
wxCommandEvent vEvent( eEvtType
,m_windowId
);
vEvent.SetEventObject(this);
wxArrayInt aSelections;
int n;
int nCount = GetSelections(aSelections);
if (nCount > 0)
{
n = aSelections[0];
if (HasClientObjectData())
vEvent.SetClientObject(GetClientObject(n));
else if ( HasClientUntypedData() )
vEvent.SetClientData(GetClientData(n));
vEvent.SetString(GetString(n));
}
else
{
n = -1;
}
vEvent.SetInt(n);
return HandleWindowEvent(vEvent);
} // end of wxListBox::OS2Command