예제 #1
0
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
{
    switch ( msg )
    {
        case WM_CHAR:
            // for compatibility with wxTextCtrl, generate a special message
            // when Enter is pressed
            if ( wParam == VK_RETURN )
            {
                if (SendMessage(GetHwnd(), CB_GETDROPPEDSTATE, 0, 0))
                    return false;

                wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);

                const int sel = GetSelection();
                event.SetInt(sel);
                event.SetString(GetValue());
                InitCommandEventWithItems(event, sel);

                if ( ProcessCommand(event) )
                {
                    // don't let the event through to the native control
                    // because it doesn't need it and may generate an annoying
                    // beep if it gets it
                    return true;
                }
            }
            // fall through

        case WM_SYSCHAR:
            return HandleChar(wParam, lParam);

        case WM_SYSKEYDOWN:
        case WM_KEYDOWN:
            return HandleKeyDown(wParam, lParam);

        case WM_SYSKEYUP:
        case WM_KEYUP:
            return HandleKeyUp(wParam, lParam);

        case WM_SETFOCUS:
            return HandleSetFocus((WXHWND)wParam);

        case WM_KILLFOCUS:
            return HandleKillFocus((WXHWND)wParam);

        case WM_CUT:
        case WM_COPY:
        case WM_PASTE:
            return HandleClipboardEvent(msg);
    }

    return false;
}
예제 #2
0
// WindowProc -- Dispatches and routes window messages
LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message) 
    {
    case WM_CREATE:
        if (HandleCreate())
            return 0L;
        break;
    case WM_ERASEBKGND:
        if (HandleEraseBackground())
            return 1L;
        break;
    case WM_SETFOCUS:
        if (HandleSetFocus((HWND)wParam))
            return 0L;
        break;
    case WM_PAINT:
        if (HandlePaint())
            return 0L;
        break;
    case WM_GETMINMAXINFO:
        if (HandleGetMinMaxInfo((LPMINMAXINFO) lParam))
            return 0L;
        break;
    case WM_DESTROY:
        if (HandleDestroy())
            return 0L;
        break;
    case WM_CLOSE:
        if (HandleClose())
            return 0L;
        break;
    case WM_SIZE:
        if (HandleSize(wParam == SIZE_MINIMIZED))
            return 0L;
        break;
    case WM_COMMAND:
        if (HandleCommand(LOWORD(wParam)))
            return 0L;
        break;
    case WM_COPYDATA:
        if (HandleCopyData((HWND)wParam, (PCOPYDATASTRUCT)lParam))
            return 0L;
        break;
    }

    LRESULT lr = cef_host_window::WindowProc(message, wParam, lParam);

    return lr;
}
예제 #3
0
파일: combobox.cpp 프로젝트: gitrider/wxsj2
bool wxComboBox::ProcessEditMsg(
  WXUINT                            uMsg
, WXWPARAM                          wParam
, WXLPARAM                          lParam)
{
    SHORT                           vFlag;
    switch (uMsg)
    {
        case WM_CHAR:
            vFlag = SHORT1FROMMP(wParam);
            switch(vFlag)
            {
                case KC_CHAR:
                    return (HandleChar( wParam
                                       ,lParam
                                       ,true /* isASCII */
                                      ));

                case KC_PREVDOWN:
                    return (HandleKeyDown( wParam
                                          ,lParam
                                         ));

                case KC_KEYUP:
                    return (HandleKeyUp( wParam
                                        ,lParam
                                       ));
            }
            break;

        case WM_SETFOCUS:
            if (SHORT1FROMMP((MPARAM)lParam) == TRUE)
                return(HandleSetFocus((WXHWND)(HWND)wParam));
            else
                return(HandleKillFocus((WXHWND)(HWND)wParam));
            break;
    }
    return false;
} // end of WinGuiBase_CComboBox::ProcessEditMsg