• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ HandleWindowEvent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中HandleWindowEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ HandleWindowEvent函数的具体用法?C++ HandleWindowEvent怎么用?C++ HandleWindowEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了HandleWindowEvent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:14,代码来源:spinbutt.cpp


示例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 );
}
开发者ID:beanhome,项目名称:dev,代码行数:50,代码来源:scrolbar_osx.cpp


示例3: event

void wxGLCanvas::OnInternalIdle()
{
    if (m_exposed)
    {
        wxPaintEvent event( GetId() );
        event.SetEventObject( this );
        HandleWindowEvent( event );

        m_exposed = false;
        GetUpdateRegion().Clear();
    }

    wxWindow::OnInternalIdle();
}
开发者ID:jonntd,项目名称:dynamica,代码行数:14,代码来源:glcanvas.cpp


示例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);
    }
}
开发者ID:slunski,项目名称:wxWidgets,代码行数:14,代码来源:filepicker.cpp


示例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);
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:14,代码来源:ctrlsub.cpp


示例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);
    }
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:50,代码来源:toplevel.cpp


示例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;
}
开发者ID:krossell,项目名称:wxWidgets,代码行数:16,代码来源:spinctrl.cpp


示例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
开发者ID:jonntd,项目名称:dynamica,代码行数:36,代码来源:spinctrl.cpp


示例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;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:17,代码来源:tbarbase.cpp


示例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
开发者ID:jonntd,项目名称:dynamica,代码行数:16,代码来源:spinctrl.cpp


示例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;
}
开发者ID:chromylei,项目名称:third_party,代码行数:16,代码来源:toplevel.cpp


示例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);
}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:16,代码来源:lboxcmn.cpp


示例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);
}
开发者ID:nE0sIghT,项目名称:wxWidgets,代码行数:16,代码来源:datectrl.cpp


示例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);
}
开发者ID:chromylei,项目名称:third_party,代码行数:47,代码来源:control.cpp


示例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
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:47,代码来源:listbox.cpp


示例16: WXUNUSED

bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
                               WXWORD pos, WXHWND control)
{
    wxCHECK_MSG( control, false, wxT("scrolling what?") );

    if ( wParam != SB_THUMBPOSITION )
    {
        // probable SB_ENDSCROLL - we don't react to it
        return false;
    }

    wxSpinEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
    event.SetPosition((short)pos);    // cast is important for negative values!
    event.SetEventObject(this);

    return HandleWindowEvent(event);
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:17,代码来源:spinbutt.cpp


示例17: switch

void wxSpinCtrl::OnChar (
  wxKeyEvent&                       rEvent
)
{
    switch (rEvent.GetKeyCode())
    {
        case WXK_RETURN:
            {
                wxCommandEvent              vEvent( wxEVT_COMMAND_TEXT_ENTER
                                                   ,m_windowId
                                                  );
                wxString                    sVal = wxGetWindowText(m_hWndBuddy);

                InitCommandEvent(vEvent);
                vEvent.SetString(sVal);
                vEvent.SetInt(GetValue());
                if (HandleWindowEvent(vEvent))
                    return;
                break;
            }

        case WXK_TAB:
            //
            // Always produce navigation event - even if we process TAB
            // ourselves the fact that we got here means that the user code
            // decided to skip processing of this TAB - probably to let it
            // do its default job.
            //
            {
                wxNavigationKeyEvent        vEventNav;

                vEventNav.SetDirection(!rEvent.ShiftDown());
                vEventNav.SetWindowChange(rEvent.ControlDown());
                vEventNav.SetEventObject(this);
                if (GetParent()->HandleWindowEvent(vEventNav))
                    return;
            }
            break;
    }

    //
    // No, we didn't process it
    //
    rEvent.Skip();
} // end of wxSpinCtrl::OnChar
开发者ID:jonntd,项目名称:dynamica,代码行数:45,代码来源:spinctrl.cpp


示例18: WXUNUSED

bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
    if ((param == LBN_SELCHANGE) && HasMultipleSelection())
    {
        CalcAndSendEvent();
        return true;
    }

    wxEventType evtType;
    int n;
    if ( param == LBN_SELCHANGE )
    {
        evtType = wxEVT_COMMAND_LISTBOX_SELECTED;
        n = SendMessage(GetHwnd(), LB_GETCARETINDEX, 0, 0);

        // NB: conveniently enough, LB_ERR is the same as wxNOT_FOUND
    }
    else if ( param == LBN_DBLCLK )
    {
        evtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
        n = HitTest(ScreenToClient(wxGetMousePosition()));
    }
    else
    {
        // some event we're not interested in
        return false;
    }

    // retrieve the affected item
    if ( n == wxNOT_FOUND )
        return false;

    wxCommandEvent event(evtType, m_windowId);
    event.SetEventObject(this);

    if ( HasClientObjectData() )
        event.SetClientObject( GetClientObject(n) );
    else if ( HasClientUntypedData() )
        event.SetClientData( GetClientData(n) );

    event.SetString(GetString(n));
    event.SetInt(n);

    return HandleWindowEvent(event);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:45,代码来源:listbox.cpp


示例19: event

bool wxNonOwnedWindow::Show(bool show)
{
    if ( !wxWindow::Show(show) )
        return false;

    if ( m_nowpeer )
        m_nowpeer->Show(show);

    if ( show )
    {
        // because apps expect a size event to occur at this moment
        wxSizeEvent event(GetSize() , m_windowId);
        event.SetEventObject(this);
        HandleWindowEvent(event);
    }

    return true ;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:18,代码来源:nonownedwnd_osx.cpp


示例20: event

void wxChoice::SendSelectionChangedEvent(wxEventType evt_type)
{
    if (!m_hasVMT)
        return;

    if (GetSelection() == -1)
        return;

    wxCommandEvent event( evt_type, GetId() );

    int n = GetSelection();
    event.SetInt( n );
    event.SetString( GetStringSelection() );
    event.SetEventObject( this );
    InitCommandEventWithItems( event, n );

    HandleWindowEvent( event );
}
开发者ID:ahlekoofe,项目名称:gamekit,代码行数:18,代码来源:choice.cpp



注:本文中的HandleWindowEvent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Handle_EXTI_Irq函数代码示例发布时间:2022-05-30
下一篇:
C++ HandleToUlong函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap