X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5036ea9074aeb8a3aa5efaa54919bce98049ee76..11a2ce5ad289cb21b35cc21131b46f75dd4af060:/src/msw/textctrl.cpp?ds=sidebyside diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 978fb173ce..882a6f60e9 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -362,6 +362,10 @@ void wxTextCtrl::AdoptAttributesFromHWND() m_windowStyle |= wxTE_READONLY; if (style & ES_WANTRETURN) m_windowStyle |= wxTE_PROCESS_ENTER; + if (style & ES_CENTER) + m_windowStyle |= wxTE_CENTRE; + if (style & ES_RIGHT) + m_windowStyle |= wxTE_RIGHT; } WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const @@ -410,6 +414,12 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const if ( style & wxTE_NOHIDESEL ) msStyle |= ES_NOHIDESEL; + if ( style & wxTE_CENTRE ) + msStyle |= ES_CENTER; + + if ( style & wxTE_RIGHT ) + msStyle |= ES_RIGHT; + return msStyle; } @@ -553,6 +563,15 @@ DWORD CALLBACK wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb) extern long wxEncodingToCodepage(wxFontEncoding encoding); // from utils.cpp +#ifdef __WXWINE__ +bool wxTextCtrl::StreamIn(const wxString& value, + wxFontEncoding WXUNUSED(encoding), + bool selectionOnly) +{ + return FALSE; +} +#else + #if wxUSE_UNICODE_MSLU bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding WXUNUSED(encoding), @@ -617,6 +636,9 @@ bool wxTextCtrl::StreamIn(const wxString& value, return TRUE; } +#endif + // __WXWINE__ + #endif // wxUSE_RICHEDIT void wxTextCtrl::WriteText(const wxString& value) @@ -654,7 +676,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly) } #endif // wxUSE_UNICODE_MSLU -#if !wxUSE_UNICODE +#if !wxUSE_UNICODE && !defined(__WXWINE__) // next check if the text we're inserting must be shown in a non // default charset -- this only works for RichEdit > 1.0 if ( GetRichVersion() > 1 ) @@ -1177,24 +1199,42 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* pMsg) } else // no Alt { - if ( wxIsCtrlDown() ) + // we want to process some Ctrl-foo and Shift-bar but no key + // combinations without either Ctrl or Shift nor with both of them + // pressed + const int ctrl = wxIsCtrlDown(), + shift = wxIsShiftDown(); + switch ( ctrl + shift ) { - switch ( vkey ) - { - case 'C': - case 'V': - case 'X': - case VK_INSERT: - case VK_DELETE: - case VK_HOME: - case VK_END: - return FALSE; - } - } - else if ( wxIsShiftDown() ) - { - if ( vkey == VK_INSERT || vkey == VK_DELETE ) - return FALSE; + default: + wxFAIL_MSG( _T("how many modifiers have we got?") ); + // fall through + + case 0: + case 2: + break; + + case 1: + // either Ctrl or Shift pressed + if ( ctrl ) + { + switch ( vkey ) + { + case 'C': + case 'V': + case 'X': + case VK_INSERT: + case VK_DELETE: + case VK_HOME: + case VK_END: + return FALSE; + } + } + else // Shift is pressed + { + if ( vkey == VK_INSERT || vkey == VK_DELETE ) + return FALSE; + } } } } @@ -1538,10 +1578,11 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { +#ifndef __WXWINE__ NMHDR *hdr = (NMHDR* )lParam; switch ( hdr->code ) { - case EN_MSGFILTER: + case EN_MSGFILTER: { const MSGFILTER *msgf = (MSGFILTER *)lParam; UINT msg = msgf->msg; @@ -1624,7 +1665,8 @@ bool wxTextCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } return TRUE; } - +#endif + // not processed, leave it to the base class return wxTextCtrlBase::MSWOnNotify(idCtrl, lParam, result); } @@ -1681,6 +1723,9 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour) bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) { +#ifdef __WXWINE__ + return FALSE; +#else if ( !IsRich() ) { // can't do it with normal text control @@ -1810,6 +1855,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) } return ok; +#endif } bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style)