+ switch (wParam)
+ {
+ case SB_LINEUP:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_LINEUP;
+ break;
+
+ case SB_LINEDOWN:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_LINEDOWN;
+ break;
+
+ case SB_PAGEUP:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_PAGEUP;
+ break;
+
+ case SB_PAGEDOWN:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_PAGEDOWN;
+ break;
+
+ case SB_SLIDERPOSITION:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_THUMBRELEASE;
+ break;
+
+ case SB_SLIDERTRACK:
+ vEvent.m_eventType = wxEVT_SCROLLWIN_THUMBTRACK;
+ break;
+
+ default:
+ return FALSE;
+ }
+ return GetEventHandler()->ProcessEvent(vEvent);
+} // end of wxWindow::OS2OnScroll
+
+// ===========================================================================
+// global functions
+// ===========================================================================
+
+void wxGetCharSize(
+ WXHWND hWnd
+, int* pX
+, int* pY
+,wxFont* pTheFont
+)
+{
+ // TODO: we'll do this later
+} // end of wxGetCharSize
+
+//
+// Returns 0 if was a normal ASCII value, not a special key. This indicates that
+// the key should be ignored by WM_KEYDOWN and processed by WM_CHAR instead.
+//
+int wxCharCodeOS2ToWX(
+ int nKeySym
+)
+{
+ int nId = 0;
+
+ switch (nKeySym)
+ {
+ case VK_BACKTAB: nId = WXK_BACK; break;
+ case VK_TAB: nId = WXK_TAB; break;
+ case VK_CLEAR: nId = WXK_CLEAR; break;
+ case VK_ENTER: nId = WXK_RETURN; break;
+ case VK_SHIFT: nId = WXK_SHIFT; break;
+ case VK_CTRL: nId = WXK_CONTROL; break;
+ case VK_PAUSE: nId = WXK_PAUSE; break;
+ case VK_SPACE: nId = WXK_SPACE; break;
+ case VK_ESC: nId = WXK_ESCAPE; break;
+ case VK_END: nId = WXK_END; break;
+ case VK_HOME : nId = WXK_HOME; break;
+ case VK_LEFT : nId = WXK_LEFT; break;
+ case VK_UP: nId = WXK_UP; break;
+ case VK_RIGHT: nId = WXK_RIGHT; break;
+ case VK_DOWN : nId = WXK_DOWN; break;
+ case VK_PRINTSCRN: nId = WXK_PRINT; break;
+ case VK_INSERT: nId = WXK_INSERT; break;
+ case VK_DELETE: nId = WXK_DELETE; break;
+ case VK_F1: nId = WXK_F1; break;
+ case VK_F2: nId = WXK_F2; break;
+ case VK_F3: nId = WXK_F3; break;
+ case VK_F4: nId = WXK_F4; break;
+ case VK_F5: nId = WXK_F5; break;
+ case VK_F6: nId = WXK_F6; break;
+ case VK_F7: nId = WXK_F7; break;
+ case VK_F8: nId = WXK_F8; break;
+ case VK_F9: nId = WXK_F9; break;
+ case VK_F10: nId = WXK_F10; break;
+ case VK_F11: nId = WXK_F11; break;
+ case VK_F12: nId = WXK_F12; break;
+ case VK_F13: nId = WXK_F13; break;
+ case VK_F14: nId = WXK_F14; break;
+ case VK_F15: nId = WXK_F15; break;
+ case VK_F16: nId = WXK_F16; break;
+ case VK_F17: nId = WXK_F17; break;
+ case VK_F18: nId = WXK_F18; break;
+ case VK_F19: nId = WXK_F19; break;
+ case VK_F20: nId = WXK_F20; break;
+ case VK_F21: nId = WXK_F21; break;
+ case VK_F22: nId = WXK_F22; break;
+ case VK_F23: nId = WXK_F23; break;
+ case VK_F24: nId = WXK_F24; break;
+ case VK_NUMLOCK: nId = WXK_NUMLOCK; break;
+ case VK_SCRLLOCK: nId = WXK_SCROLL; break;
+ default:
+ {
+ return 0;
+ }
+ }
+ return nId;
+} // end of wxCharCodeOS2ToWX
+
+int wxCharCodeWXToOS2(
+ int nId
+, bool* bIsVirtual
+)
+{
+ int nKeySym = 0;
+
+ *bIsVirtual = TRUE;
+ switch (nId)
+ {
+ case WXK_CLEAR: nKeySym = VK_CLEAR; break;
+ case WXK_SHIFT: nKeySym = VK_SHIFT; break;
+ case WXK_CONTROL: nKeySym = VK_CTRL; break;
+ case WXK_PAUSE: nKeySym = VK_PAUSE; break;
+ case WXK_END: nKeySym = VK_END; break;
+ case WXK_HOME : nKeySym = VK_HOME; break;
+ case WXK_LEFT : nKeySym = VK_LEFT; break;
+ case WXK_UP: nKeySym = VK_UP; break;
+ case WXK_RIGHT: nKeySym = VK_RIGHT; break;
+ case WXK_DOWN : nKeySym = VK_DOWN; break;
+ case WXK_PRINT: nKeySym = VK_PRINTSCRN; break;
+ case WXK_INSERT: nKeySym = VK_INSERT; break;
+ case WXK_DELETE: nKeySym = VK_DELETE; break;
+ case WXK_F1: nKeySym = VK_F1; break;
+ case WXK_F2: nKeySym = VK_F2; break;
+ case WXK_F3: nKeySym = VK_F3; break;
+ case WXK_F4: nKeySym = VK_F4; break;
+ case WXK_F5: nKeySym = VK_F5; break;
+ case WXK_F6: nKeySym = VK_F6; break;
+ case WXK_F7: nKeySym = VK_F7; break;
+ case WXK_F8: nKeySym = VK_F8; break;
+ case WXK_F9: nKeySym = VK_F9; break;
+ case WXK_F10: nKeySym = VK_F10; break;
+ case WXK_F11: nKeySym = VK_F11; break;
+ case WXK_F12: nKeySym = VK_F12; break;
+ case WXK_F13: nKeySym = VK_F13; break;
+ case WXK_F14: nKeySym = VK_F14; break;
+ case WXK_F15: nKeySym = VK_F15; break;
+ case WXK_F16: nKeySym = VK_F16; break;
+ case WXK_F17: nKeySym = VK_F17; break;
+ case WXK_F18: nKeySym = VK_F18; break;
+ case WXK_F19: nKeySym = VK_F19; break;
+ case WXK_F20: nKeySym = VK_F20; break;
+ case WXK_F21: nKeySym = VK_F21; break;
+ case WXK_F22: nKeySym = VK_F22; break;
+ case WXK_F23: nKeySym = VK_F23; break;
+ case WXK_F24: nKeySym = VK_F24; break;
+ case WXK_NUMLOCK: nKeySym = VK_NUMLOCK; break;
+ case WXK_SCROLL: nKeySym = VK_SCRLLOCK; break;
+ default:
+ {
+ *bIsVirtual = FALSE;
+ nKeySym = nId;
+ break;
+ }
+ }
+ return nKeySym;
+} // end of wxCharCodeWXToOS2
+
+wxWindow* wxGetActiveWindow()
+{
+ HWND hWnd = ::WinQueryActiveWindow(HWND_DESKTOP);
+
+ if (hWnd != 0)
+ {
+ return wxFindWinFromHandle((WXHWND)hWnd);
+ }
+ return NULL;
+} // end of wxGetActiveWindow
+
+#ifdef __WXDEBUG__
+const char* wxGetMessageName(
+ int nMessage)
+{
+ switch (nMessage)
+ {
+ case 0x0000: return "WM_NULL";
+ case 0x0001: return "WM_CREATE";
+ case 0x0002: return "WM_DESTROY";
+ case 0x0004: return "WM_ENABLE";
+ case 0x0005: return "WM_SHOW";
+ case 0x0006: return "WM_MOVE";
+ case 0x0007: return "WM_SIZE";
+ case 0x0008: return "WM_ADJUSTWINDOWPOS";
+ case 0x0009: return "WM_CALCVALIDRECTS";
+ case 0x000A: return "WM_SETWINDOWPARAMS";
+ case 0x000B: return "WM_QUERYWINDOWPARAMS";
+ case 0x000C: return "WM_HITTEST";
+ case 0x000D: return "WM_ACTIVATE";
+ case 0x000F: return "WM_SETFOCUS";
+ case 0x0010: return "WM_SETSELECTION";
+ case 0x0011: return "WM_PPAINT";
+ case 0x0012: return "WM_PSETFOCUS";
+ case 0x0013: return "WM_PSYSCOLORCHANGE";
+ case 0x0014: return "WM_PSIZE";
+ case 0x0015: return "WM_PACTIVATE";
+ case 0x0016: return "WM_PCONTROL";
+ case 0x0020: return "WM_COMMAND";
+ case 0x0021: return "WM_SYSCOMMAND";
+ case 0x0022: return "WM_HELP";
+ case 0x0023: return "WM_PAINT";
+ case 0x0024: return "WM_TIMER";
+ case 0x0025: return "WM_SEM1";
+ case 0x0026: return "WM_SEM2";
+ case 0x0027: return "WM_SEM3";
+ case 0x0028: return "WM_SEM4";
+ case 0x0029: return "WM_CLOSE";
+ case 0x002A: return "WM_QUIT";
+ case 0x002B: return "WM_SYSCOLORCHANGE";
+ case 0x002D: return "WM_SYSVALUECHANGE";
+ case 0x002E: return "WM_APPTERMINATENOTIFY";
+ case 0x002F: return "WM_PRESPARAMCHANGED";
+ // Control notification messages
+ case 0x0030: return "WM_CONTROL";
+ case 0x0031: return "WM_VSCROLL";
+ case 0x0032: return "WM_HSCROLL";
+ case 0x0033: return "WM_INITMENU";
+ case 0x0034: return "WM_MENUSELECT";
+ case 0x0035: return "WM_MENUSEND";
+ case 0x0036: return "WM_DRAWITEM";
+ case 0x0037: return "WM_MEASUREITEM";
+ case 0x0038: return "WM_CONTROLPOINTER";
+ case 0x003A: return "WM_QUERYDLGCODE";
+ case 0x003B: return "WM_INITDLG";
+ case 0x003C: return "WM_SUBSTITUTESTRING";
+ case 0x003D: return "WM_MATCHMNEMONIC";
+ case 0x003E: return "WM_SAVEAPPLICATION";
+ case 0x0129: return "WM_CTLCOLORCHANGE";
+ case 0x0130: return "WM_QUERYCTLTYPE";
+ // Frame messages
+ case 0x0040: return "WM_FLASHWINDOW";
+ case 0x0041: return "WM_FORMATFRAME";
+ case 0x0042: return "WM_UPDATEFRAME";
+ case 0x0043: return "WM_FOCUSCHANGE";
+ case 0x0044: return "WM_SETBORDERSIZE";
+ case 0x0045: return "WM_TRACKFRAME";
+ case 0x0046: return "WM_MINMAXFRAME";
+ case 0x0047: return "WM_SETICON";
+ case 0x0048: return "WM_QUERYICON";
+ case 0x0049: return "WM_SETACCELTABLE";
+ case 0x004A: return "WM_QUERYACCELTABLE";
+ case 0x004B: return "WM_TRANSLATEACCEL";
+ case 0x004C: return "WM_QUERYTRACKINFO";
+ case 0x004D: return "WM_QUERYBORDERSIZE";
+ case 0x004E: return "WM_NEXTMENU";
+ case 0x004F: return "WM_ERASEBACKGROUND";
+ case 0x0050: return "WM_QUERYFRAMEINFO";
+ case 0x0051: return "WM_QUERYFOCUSCHAIN";
+ case 0x0052: return "WM_OWNERPOSCHANGE";
+ case 0x0053: return "WM_CACLFRAMERECT";
+ case 0x0055: return "WM_WINDOWPOSCHANGED";
+ case 0x0056: return "WM_ADJUSTFRAMEPOS";
+ case 0x0059: return "WM_QUERYFRAMECTLCOUNT";
+ case 0x005B: return "WM_QUERYHELPINFO";
+ case 0x005C: return "WM_SETHELPINFO";
+ case 0x005D: return "WM_ERROR";
+ case 0x005E: return "WM_REALIZEPALETTE";
+ // Clipboard messages
+ case 0x0060: return "WM_RENDERFMT";
+ case 0x0061: return "WM_RENDERALLFMTS";
+ case 0x0062: return "WM_DESTROYCLIPBOARD";
+ case 0x0063: return "WM_PAINTCLIPBOARD";
+ case 0x0064: return "WM_SIZECLIPBOARD";
+ case 0x0065: return "WM_HSCROLLCLIPBOARD";
+ case 0x0066: return "WM_VSCROLLCLIPBOARD";
+ case 0x0067: return "WM_DRAWCLIPBOARD";
+ // mouse messages
+ case 0x0070: return "WM_MOUSEMOVE";
+ case 0x0071: return "WM_BUTTON1DOWN";
+ case 0x0072: return "WM_BUTTON1UP";
+ case 0x0073: return "WM_BUTTON1DBLCLK";
+ case 0x0074: return "WM_BUTTON2DOWN";
+ case 0x0075: return "WM_BUTTON2UP";
+ case 0x0076: return "WM_BUTTON2DBLCLK";
+ case 0x0077: return "WM_BUTTON3DOWN";
+ case 0x0078: return "WM_BUTTON3UP";
+ case 0x0079: return "WM_BUTTON3DBLCLK";
+ case 0x007D: return "WM_MOUSEMAP";
+ case 0x007E: return "WM_VRNDISABLED";
+ case 0x007F: return "WM_VRNENABLED";
+ case 0x0410: return "WM_CHORD";
+ case 0x0411: return "WM_BUTTON1MOTIONSTART";
+ case 0x0412: return "WM_BUTTON1MOTIONEND";
+ case 0x0413: return "WM_BUTTON1CLICK";
+ case 0x0414: return "WM_BUTTON2MOTIONSTART";
+ case 0x0415: return "WM_BUTTON2MOTIONEND";
+ case 0x0416: return "WM_BUTTON2CLICK";
+ case 0x0417: return "WM_BUTTON3MOTIONSTART";
+ case 0x0418: return "WM_BUTTON3MOTIONEND";
+ case 0x0419: return "WM_BUTTON3CLICK";
+ case 0x0420: return "WM_BEGINDRAG";
+ case 0x0421: return "WM_ENDDRAG";
+ case 0x0422: return "WM_SINGLESELECT";
+ case 0x0423: return "WM_OPEN";
+ case 0x0424: return "WM_CONTEXTMENU";
+ case 0x0425: return "WM_CONTEXTHELP";
+ case 0x0426: return "WM_TEXTEDIT";
+ case 0x0427: return "WM_BEGINSELECT";
+ case 0x0228: return "WM_ENDSELECT";
+ case 0x0429: return "WM_PICKUP";
+ case 0x04C0: return "WM_PENFIRST";
+ case 0x04FF: return "WM_PENLAST";
+ case 0x0500: return "WM_MMPMFIRST";
+ case 0x05FF: return "WM_MMPMLAST";
+ case 0x0600: return "WM_STDDLGFIRST";
+ case 0x06FF: return "WM_STDDLGLAST";
+ case 0x0BD0: return "WM_BIDI_FIRST";
+ case 0x0BFF: return "WM_BIDI_LAST";
+ // keyboard input
+ case 0x007A: return "WM_CHAR";
+ case 0x007B: return "WM_VIOCHAR";
+ // DDE messages
+ case 0x00A0: return "WM_DDE_INITIATE";
+ case 0x00A1: return "WM_DDE_REQUEST";
+ case 0x00A2: return "WM_DDE_ACK";
+ case 0x00A3: return "WM_DDE_DATA";
+ case 0x00A4: return "WM_DDE_ADVISE";
+ case 0x00A5: return "WM_DDE_UNADVISE";
+ case 0x00A6: return "WM_DDE_POKE";
+ case 0x00A7: return "WM_DDE_EXECUTE";
+ case 0x00A8: return "WM_DDE_TERMINATE";
+ case 0x00A9: return "WM_DDE_INITIATEACK";
+ case 0x00AF: return "WM_DDE_LAST";
+ // Buttons
+ case 0x0120: return "BM_CLICK";
+ case 0x0121: return "BM_QUERYCHECKINDEX";
+ case 0x0122: return "BM_QUERYHILITE";
+ case 0x0123: return "BM_SETHILITE";
+ case 0x0124: return "BM_QUERYCHECK";
+ case 0x0125: return "BM_SETCHECK";
+ case 0x0126: return "BM_SETDEFAULT";
+ case 0x0128: return "BM_AUTOSIZE";
+ // Combo boxes
+ case 0x029A: return "CBID_LIST";
+ case 0x029B: return "CBID_EDIT";
+ case 0x0170: return "CBM_SHOWLIST";
+ case 0x0171: return "CBM_HILITE";
+ case 0x0172: return "CBM_ISLISTSHOWING";
+ // Edit fields
+ case 0x0140: return "EM_QUERYCHANGED";
+ case 0x0141: return "EM_QUERYSEL";
+ case 0x0142: return "EM_SETSEL";
+ case 0x0143: return "EM_SETTEXTLIMIT";
+ case 0x0144: return "EM_CUT";
+ case 0x0145: return "EM_COPY";
+ case 0x0146: return "EM_CLEAR";
+ case 0x0147: return "EM_PASTE";
+ case 0x0148: return "EM_QUERYFIRSTCHAR";
+ case 0x0149: return "EM_SETFIRSTCHAR";
+ case 0x014A: return "EM_QUERYREADONLY";
+ case 0x014B: return "EM_SETREADONLY";
+ case 0x014C: return "EM_SETINSERTMODE";
+ // Listboxes
+ case 0x0160: return "LM_QUERYITEMCOUNT";
+ case 0x0161: return "LM_INSERTITEM";
+ case 0x0162: return "LM_SETOPENINDEX";
+ case 0x0163: return "LM_DELETEITEM";
+ case 0x0164: return "LM_SELECTITEM";
+ case 0x0165: return "LM_QUERYSELECTION";
+ case 0x0166: return "LM_SETITEMTEXT";
+ case 0x0167: return "LM_QUERYITEMTEXTLENGTH";
+ case 0x0168: return "LM_QUERYITEMTEXT";
+ case 0x0169: return "LM_SETITEMHANDLE";
+ case 0x016A: return "LM_QUERYITEMHANDLE";
+ case 0x016B: return "LM_SEARCHSTRING";
+ case 0x016C: return "LM_SETITEMHEIGHT";
+ case 0x016D: return "LM_QUERYTOPINDEX";
+ case 0x016E: return "LM_DELETEALL";
+ case 0x016F: return "LM_INSERTMULITEMS";
+ case 0x0660: return "LM_SETITEMWIDTH";
+ // Menus
+ case 0x0180: return "MM_INSERTITEM";
+ case 0x0181: return "MM_DELETEITEM";
+ case 0x0182: return "MM_QUERYITEM";
+ case 0x0183: return "MM_SETITEM";
+ case 0x0184: return "MM_QUERYITEMCOUNT";
+ case 0x0185: return "MM_STARTMENUMODE";
+ case 0x0186: return "MM_ENDMENUMODE";
+ case 0x0188: return "MM_REMOVEITEM";
+ case 0x0189: return "MM_SELECTITEM";
+ case 0x018A: return "MM_QUERYSELITEMID";
+ case 0x018B: return "MM_QUERYITEMTEXT";
+ case 0x018C: return "MM_QUERYITEMTEXTLENGTH";
+ case 0x018D: return "MM_SETITEMHANDLE";
+ case 0x018E: return "MM_SETITEMTEXT";
+ case 0x018F: return "MM_ITEMPOSITIONFROMID";
+ case 0x0190: return "MM_ITEMIDFROMPOSITION";
+ case 0x0191: return "MM_QUERYITEMATTR";
+ case 0x0192: return "MM_SETITEMATTR";
+ case 0x0193: return "MM_ISITEMVALID";
+ case 0x0194: return "MM_QUERYITEMRECT";
+ case 0x0431: return "MM_QUERYDEFAULTITEMID";
+ case 0x0432: return "MM_SETDEFAULTITEMID";
+ // Scrollbars
+ case 0x01A0: return "SBM_SETSCROLLBAR";
+ case 0x01A1: return "SBM_SETPOS";
+ case 0x01A2: return "SBM_QUERYPOS";
+ case 0x01A3: return "SBM_QUERYRANGE";
+ case 0x01A6: return "SBM_SETTHUMBSIZE";
+
+ // Help messages
+ case 0x0F00: return "WM_HELPBASE";
+ case 0x0FFF: return "WM_HELPTOP";
+ // Beginning of user defined messages
+ case 0x1000: return "WM_USER";
+
+ // wxWindows user defined types
+
+ // listview
+ // case 0x1000 + 0: return "LVM_GETBKCOLOR";
+ case 0x1000 + 1: return "LVM_SETBKCOLOR";
+ case 0x1000 + 2: return "LVM_GETIMAGELIST";
+ case 0x1000 + 3: return "LVM_SETIMAGELIST";
+ case 0x1000 + 4: return "LVM_GETITEMCOUNT";
+ case 0x1000 + 5: return "LVM_GETITEMA";
+ case 0x1000 + 75: return "LVM_GETITEMW";
+ case 0x1000 + 6: return "LVM_SETITEMA";
+ case 0x1000 + 76: return "LVM_SETITEMW";
+ case 0x1000 + 7: return "LVM_INSERTITEMA";
+ case 0x1000 + 77: return "LVM_INSERTITEMW";
+ case 0x1000 + 8: return "LVM_DELETEITEM";
+ case 0x1000 + 9: return "LVM_DELETEALLITEMS";
+ case 0x1000 + 10: return "LVM_GETCALLBACKMASK";
+ case 0x1000 + 11: return "LVM_SETCALLBACKMASK";
+ case 0x1000 + 12: return "LVM_GETNEXTITEM";
+ case 0x1000 + 13: return "LVM_FINDITEMA";
+ case 0x1000 + 83: return "LVM_FINDITEMW";
+ case 0x1000 + 14: return "LVM_GETITEMRECT";
+ case 0x1000 + 15: return "LVM_SETITEMPOSITION";
+ case 0x1000 + 16: return "LVM_GETITEMPOSITION";
+ case 0x1000 + 17: return "LVM_GETSTRINGWIDTHA";
+ case 0x1000 + 87: return "LVM_GETSTRINGWIDTHW";
+ case 0x1000 + 18: return "LVM_HITTEST";
+ case 0x1000 + 19: return "LVM_ENSUREVISIBLE";
+ case 0x1000 + 20: return "LVM_SCROLL";
+ case 0x1000 + 21: return "LVM_REDRAWITEMS";
+ case 0x1000 + 22: return "LVM_ARRANGE";
+ case 0x1000 + 23: return "LVM_EDITLABELA";
+ case 0x1000 + 118: return "LVM_EDITLABELW";
+ case 0x1000 + 24: return "LVM_GETEDITCONTROL";
+ case 0x1000 + 25: return "LVM_GETCOLUMNA";
+ case 0x1000 + 95: return "LVM_GETCOLUMNW";
+ case 0x1000 + 26: return "LVM_SETCOLUMNA";
+ case 0x1000 + 96: return "LVM_SETCOLUMNW";
+ case 0x1000 + 27: return "LVM_INSERTCOLUMNA";
+ case 0x1000 + 97: return "LVM_INSERTCOLUMNW";
+ case 0x1000 + 28: return "LVM_DELETECOLUMN";
+ case 0x1000 + 29: return "LVM_GETCOLUMNWIDTH";
+ case 0x1000 + 30: return "LVM_SETCOLUMNWIDTH";
+ case 0x1000 + 31: return "LVM_GETHEADER";
+ case 0x1000 + 33: return "LVM_CREATEDRAGIMAGE";
+ case 0x1000 + 34: return "LVM_GETVIEWRECT";
+ case 0x1000 + 35: return "LVM_GETTEXTCOLOR";
+ case 0x1000 + 36: return "LVM_SETTEXTCOLOR";
+ case 0x1000 + 37: return "LVM_GETTEXTBKCOLOR";
+ case 0x1000 + 38: return "LVM_SETTEXTBKCOLOR";
+ case 0x1000 + 39: return "LVM_GETTOPINDEX";
+ case 0x1000 + 40: return "LVM_GETCOUNTPERPAGE";
+ case 0x1000 + 41: return "LVM_GETORIGIN";
+ case 0x1000 + 42: return "LVM_UPDATE";
+ case 0x1000 + 43: return "LVM_SETITEMSTATE";
+ case 0x1000 + 44: return "LVM_GETITEMSTATE";
+ case 0x1000 + 45: return "LVM_GETITEMTEXTA";
+ case 0x1000 + 115: return "LVM_GETITEMTEXTW";
+ case 0x1000 + 46: return "LVM_SETITEMTEXTA";
+ case 0x1000 + 116: return "LVM_SETITEMTEXTW";
+ case 0x1000 + 47: return "LVM_SETITEMCOUNT";
+ case 0x1000 + 48: return "LVM_SORTITEMS";
+ case 0x1000 + 49: return "LVM_SETITEMPOSITION32";
+ case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT";
+ case 0x1000 + 51: return "LVM_GETITEMSPACING";
+ case 0x1000 + 52: return "LVM_GETISEARCHSTRINGA";
+ case 0x1000 + 117: return "LVM_GETISEARCHSTRINGW";
+ case 0x1000 + 53: return "LVM_SETICONSPACING";
+ case 0x1000 + 54: return "LVM_SETEXTENDEDLISTVIEWSTYLE";
+ case 0x1000 + 55: return "LVM_GETEXTENDEDLISTVIEWSTYLE";
+ case 0x1000 + 56: return "LVM_GETSUBITEMRECT";
+ case 0x1000 + 57: return "LVM_SUBITEMHITTEST";
+ case 0x1000 + 58: return "LVM_SETCOLUMNORDERARRAY";
+ case 0x1000 + 59: return "LVM_GETCOLUMNORDERARRAY";
+ case 0x1000 + 60: return "LVM_SETHOTITEM";
+ case 0x1000 + 61: return "LVM_GETHOTITEM";
+ case 0x1000 + 62: return "LVM_SETHOTCURSOR";
+ case 0x1000 + 63: return "LVM_GETHOTCURSOR";
+ case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT";
+ case 0x1000 + 65: return "LVM_SETWORKAREA";
+
+ // tree view
+ case 0x1100 + 0: return "TVM_INSERTITEMA";
+ case 0x1100 + 50: return "TVM_INSERTITEMW";
+ case 0x1100 + 1: return "TVM_DELETEITEM";
+ case 0x1100 + 2: return "TVM_EXPAND";
+ case 0x1100 + 4: return "TVM_GETITEMRECT";
+ case 0x1100 + 5: return "TVM_GETCOUNT";
+ case 0x1100 + 6: return "TVM_GETINDENT";
+ case 0x1100 + 7: return "TVM_SETINDENT";
+ case 0x1100 + 8: return "TVM_GETIMAGELIST";
+ case 0x1100 + 9: return "TVM_SETIMAGELIST";
+ case 0x1100 + 10: return "TVM_GETNEXTITEM";
+ case 0x1100 + 11: return "TVM_SELECTITEM";
+ case 0x1100 + 12: return "TVM_GETITEMA";
+ case 0x1100 + 62: return "TVM_GETITEMW";
+ case 0x1100 + 13: return "TVM_SETITEMA";
+ case 0x1100 + 63: return "TVM_SETITEMW";
+ case 0x1100 + 14: return "TVM_EDITLABELA";
+ case 0x1100 + 65: return "TVM_EDITLABELW";
+ case 0x1100 + 15: return "TVM_GETEDITCONTROL";
+ case 0x1100 + 16: return "TVM_GETVISIBLECOUNT";
+ case 0x1100 + 17: return "TVM_HITTEST";
+ case 0x1100 + 18: return "TVM_CREATEDRAGIMAGE";
+ case 0x1100 + 19: return "TVM_SORTCHILDREN";
+ case 0x1100 + 20: return "TVM_ENSUREVISIBLE";
+ case 0x1100 + 21: return "TVM_SORTCHILDRENCB";
+ case 0x1100 + 22: return "TVM_ENDEDITLABELNOW";
+ case 0x1100 + 23: return "TVM_GETISEARCHSTRINGA";
+ case 0x1100 + 64: return "TVM_GETISEARCHSTRINGW";
+ case 0x1100 + 24: return "TVM_SETTOOLTIPS";
+ case 0x1100 + 25: return "TVM_GETTOOLTIPS";
+
+ // header
+ case 0x1200 + 0: return "HDM_GETITEMCOUNT";
+ case 0x1200 + 1: return "HDM_INSERTITEMA";
+ case 0x1200 + 10: return "HDM_INSERTITEMW";
+ case 0x1200 + 2: return "HDM_DELETEITEM";
+ case 0x1200 + 3: return "HDM_GETITEMA";
+ case 0x1200 + 11: return "HDM_GETITEMW";
+ case 0x1200 + 4: return "HDM_SETITEMA";
+ case 0x1200 + 12: return "HDM_SETITEMW";
+ case 0x1200 + 5: return "HDM_LAYOUT";
+ case 0x1200 + 6: return "HDM_HITTEST";
+ case 0x1200 + 7: return "HDM_GETITEMRECT";
+ case 0x1200 + 8: return "HDM_SETIMAGELIST";
+ case 0x1200 + 9: return "HDM_GETIMAGELIST";
+ case 0x1200 + 15: return "HDM_ORDERTOINDEX";
+ case 0x1200 + 16: return "HDM_CREATEDRAGIMAGE";
+ case 0x1200 + 17: return "HDM_GETORDERARRAY";
+ case 0x1200 + 18: return "HDM_SETORDERARRAY";
+ case 0x1200 + 19: return "HDM_SETHOTDIVIDER";
+
+ // tab control
+ case 0x1300 + 2: return "TCM_GETIMAGELIST";
+ case 0x1300 + 3: return "TCM_SETIMAGELIST";
+ case 0x1300 + 4: return "TCM_GETITEMCOUNT";
+ case 0x1300 + 5: return "TCM_GETITEMA";
+ case 0x1300 + 60: return "TCM_GETITEMW";
+ case 0x1300 + 6: return "TCM_SETITEMA";
+ case 0x1300 + 61: return "TCM_SETITEMW";
+ case 0x1300 + 7: return "TCM_INSERTITEMA";
+ case 0x1300 + 62: return "TCM_INSERTITEMW";
+ case 0x1300 + 8: return "TCM_DELETEITEM";
+ case 0x1300 + 9: return "TCM_DELETEALLITEMS";
+ case 0x1300 + 10: return "TCM_GETITEMRECT";
+ case 0x1300 + 11: return "TCM_GETCURSEL";
+ case 0x1300 + 12: return "TCM_SETCURSEL";
+ case 0x1300 + 13: return "TCM_HITTEST";
+ case 0x1300 + 14: return "TCM_SETITEMEXTRA";
+ case 0x1300 + 40: return "TCM_ADJUSTRECT";
+ case 0x1300 + 41: return "TCM_SETITEMSIZE";
+ case 0x1300 + 42: return "TCM_REMOVEIMAGE";
+ case 0x1300 + 43: return "TCM_SETPADDING";
+ case 0x1300 + 44: return "TCM_GETROWCOUNT";
+ case 0x1300 + 45: return "TCM_GETTOOLTIPS";
+ case 0x1300 + 46: return "TCM_SETTOOLTIPS";
+ case 0x1300 + 47: return "TCM_GETCURFOCUS";
+ case 0x1300 + 48: return "TCM_SETCURFOCUS";
+ case 0x1300 + 49: return "TCM_SETMINTABWIDTH";
+ case 0x1300 + 50: return "TCM_DESELECTALL";
+
+ // toolbar
+ case WM_USER+1000+1: return "TB_ENABLEBUTTON";
+ case WM_USER+1000+2: return "TB_CHECKBUTTON";
+ case WM_USER+1000+3: return "TB_PRESSBUTTON";
+ case WM_USER+1000+4: return "TB_HIDEBUTTON";
+ case WM_USER+1000+5: return "TB_INDETERMINATE";
+ case WM_USER+1000+9: return "TB_ISBUTTONENABLED";
+ case WM_USER+1000+10: return "TB_ISBUTTONCHECKED";
+ case WM_USER+1000+11: return "TB_ISBUTTONPRESSED";
+ case WM_USER+1000+12: return "TB_ISBUTTONHIDDEN";
+ case WM_USER+1000+13: return "TB_ISBUTTONINDETERMINATE";
+ case WM_USER+1000+17: return "TB_SETSTATE";
+ case WM_USER+1000+18: return "TB_GETSTATE";
+ case WM_USER+1000+19: return "TB_ADDBITMAP";
+ case WM_USER+1000+20: return "TB_ADDBUTTONS";
+ case WM_USER+1000+21: return "TB_INSERTBUTTON";
+ case WM_USER+1000+22: return "TB_DELETEBUTTON";
+ case WM_USER+1000+23: return "TB_GETBUTTON";
+ case WM_USER+1000+24: return "TB_BUTTONCOUNT";
+ case WM_USER+1000+25: return "TB_COMMANDTOINDEX";
+ case WM_USER+1000+26: return "TB_SAVERESTOREA";
+ case WM_USER+1000+76: return "TB_SAVERESTOREW";
+ case WM_USER+1000+27: return "TB_CUSTOMIZE";
+ case WM_USER+1000+28: return "TB_ADDSTRINGA";
+ case WM_USER+1000+77: return "TB_ADDSTRINGW";
+ case WM_USER+1000+29: return "TB_GETITEMRECT";
+ case WM_USER+1000+30: return "TB_BUTTONSTRUCTSIZE";
+ case WM_USER+1000+31: return "TB_SETBUTTONSIZE";
+ case WM_USER+1000+32: return "TB_SETBITMAPSIZE";
+ case WM_USER+1000+33: return "TB_AUTOSIZE";
+ case WM_USER+1000+35: return "TB_GETTOOLTIPS";
+ case WM_USER+1000+36: return "TB_SETTOOLTIPS";
+ case WM_USER+1000+37: return "TB_SETPARENT";
+ case WM_USER+1000+39: return "TB_SETROWS";
+ case WM_USER+1000+40: return "TB_GETROWS";
+ case WM_USER+1000+42: return "TB_SETCMDID";
+ case WM_USER+1000+43: return "TB_CHANGEBITMAP";
+ case WM_USER+1000+44: return "TB_GETBITMAP";
+ case WM_USER+1000+45: return "TB_GETBUTTONTEXTA";
+ case WM_USER+1000+75: return "TB_GETBUTTONTEXTW";
+ case WM_USER+1000+46: return "TB_REPLACEBITMAP";
+ case WM_USER+1000+47: return "TB_SETINDENT";
+ case WM_USER+1000+48: return "TB_SETIMAGELIST";
+ case WM_USER+1000+49: return "TB_GETIMAGELIST";
+ case WM_USER+1000+50: return "TB_LOADIMAGES";
+ case WM_USER+1000+51: return "TB_GETRECT";
+ case WM_USER+1000+52: return "TB_SETHOTIMAGELIST";
+ case WM_USER+1000+53: return "TB_GETHOTIMAGELIST";
+ case WM_USER+1000+54: return "TB_SETDISABLEDIMAGELIST";
+ case WM_USER+1000+55: return "TB_GETDISABLEDIMAGELIST";
+ case WM_USER+1000+56: return "TB_SETSTYLE";
+ case WM_USER+1000+57: return "TB_GETSTYLE";
+ case WM_USER+1000+58: return "TB_GETBUTTONSIZE";
+ case WM_USER+1000+59: return "TB_SETBUTTONWIDTH";
+ case WM_USER+1000+60: return "TB_SETMAXTEXTROWS";
+ case WM_USER+1000+61: return "TB_GETTEXTROWS";
+ case WM_USER+1000+41: return "TB_GETBITMAPFLAGS";
+
+ default:
+ static char s_szBuf[128];
+ sprintf(s_szBuf, "<unknown message = %d>", nMessage);
+ return s_szBuf;
+ }
+ return NULL;
+} // end of wxGetMessageName
+
+#endif // __WXDEBUG__
+
+static void TranslateKbdEventToMouse(
+ wxWindow* pWin
+, int* pX
+, int* pY
+, ULONG* pFlags
+)
+{
+ //
+ // Construct the key mask
+ ULONG& fwKeys = *pFlags;
+
+ fwKeys = VK_BUTTON2;
+ if ((::WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x100) != 0)
+ fwKeys |= VK_CTRL;
+ if ((::WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x100) != 0)
+ fwKeys |= VK_SHIFT;
+
+ //
+ // Simulate right mouse button click
+ //
+ POINTL vPoint;
+
+ ::WinQueryMsgPos(vHabmain, &vPoint);
+ *pX = vPoint.x;
+ *pY = vPoint.y;
+
+ pWin->ScreenToClient(pX, pY);
+} // end of TranslateKbdEventToMouse
+
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(
+ wxPoint& rPt
+)
+{
+ return wxFindWindowAtPoint(wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(
+ const wxPoint& rPt
+)
+{
+ POINTL vPt2;
+
+ vPt2.x = rPt.x;
+ vPt2.y = rPt.y;
+
+ HWND hWndHit = ::WinWindowFromPoint(HWND_DESKTOP, &vPt2, FALSE);
+ wxWindow* pWin = wxFindWinFromHandle((WXHWND)hWndHit) ;
+ HWND hWnd = hWndHit;
+
+ //
+ // Try to find a window with a wxWindow associated with it
+ //
+ while (!pWin && (hWnd != 0))
+ {
+ hWnd = ::WinQueryWindow(hWnd, QW_PARENT);
+ pWin = wxFindWinFromHandle((WXHWND)hWnd) ;
+ }
+ return pWin;
+}
+
+// Get the current mouse position.
+wxPoint wxGetMousePosition()
+{
+ POINTL vPt;
+
+ ::WinQueryPointerPos(HWND_DESKTOP, &vPt);
+ return wxPoint(vPt.x, vPt.y);