bool HandleSysCommand(WXWPARAM wParam, WXLPARAM lParam);
bool HandleCtlColor(WXHBRUSH *hBrush,
- WXHDC hdc,
- WXHWND hWnd,
- WXUINT nCtlColor,
- WXUINT message,
- WXWPARAM wParam,
- WXLPARAM lParam);
+ WXHDC hdc,
+ WXHWND hWnd,
+ WXUINT nCtlColor,
+ WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam);
bool HandlePaletteChanged(WXHWND hWndPalChange);
bool HandleQueryNewPalette();
WXHMENU m_hMenu; // Menu, if any
+ // the return value of WM_GETDLGCODE handler
+ long m_lDlgCode;
+
// implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const;
if (m_windowStyle & wxTE_PASSWORD) // hidden input
msStyle |= ES_PASSWORD;
+ // we always want the characters and the arrows
+ m_lDlgCode = DLGC_WANTCHARS | DLGC_WANTARROWS;
+
+ // we may have several different cases:
+ // 1. normal case: both TAB and ENTER are used for dialog navigation
+ // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
+ // control in the dialog
+ // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
+ // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
+ // the next control
+ if ( m_windowStyle & wxTE_PROCESS_ENTER )
+ m_lDlgCode |= DLGC_WANTMESSAGE;
+ if ( m_windowStyle & wxTE_PROCESS_TAB )
+ m_lDlgCode |= DLGC_WANTTAB;
+
const wxChar *windowClass = _T("EDIT");
#if wxUSE_RICHEDIT
event.Skip();
}
-long wxTextCtrl::MSWGetDlgCode()
-{
- // we always want the characters and the arrows
- long lRc = DLGC_WANTCHARS | DLGC_WANTARROWS;
-
- // we may have several different cases:
- // 1. normal case: both TAB and ENTER are used for dialog navigation
- // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
- // control in the dialog
- // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
- // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
- // the next control
- if ( m_windowStyle & wxTE_PROCESS_ENTER )
- lRc |= DLGC_WANTMESSAGE;
- if ( m_windowStyle & wxTE_PROCESS_TAB )
- lRc |= DLGC_WANTTAB;
-
- return lRc;
-}
-
bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
{
switch (param)
msflags |= WS_BORDER;
}
+ // calculate the value to return from WM_GETDLGCODE handler
+ if ( GetWindowStyleFlag() & wxWANTS_CHARS )
+ {
+ // want everything: i.e. all keys and WM_CHAR message
+ m_lDlgCode = DLGC_WANTARROWS | DLGC_WANTCHARS |
+ DLGC_WANTTAB | DLGC_WANTMESSAGE;
+
+ }
+ else
+ {
+ // default behaviour
+ m_lDlgCode = 0;
+ }
+
MSWCreate(m_windowId, parent, wxCanvasClassName, this, NULL,
pos.x, pos.y,
WidthDefault(size.x), HeightDefault(size.y),
break;
case WM_GETDLGCODE:
- if ( GetWindowStyleFlag() & wxWANTS_CHARS )
+ if ( m_lDlgCode )
{
- rc.result = DLGC_WANTARROWS | DLGC_WANTCHARS | DLGC_WANTTAB;
+ rc.result = m_lDlgCode;
processed = TRUE;
}
+ //else: get the dlg code from the DefWindowProc()
break;
case WM_KEYDOWN: