// Purpose: wxTextEntry implementation for wxMSW
// Author: Vadim Zeitlin
// Created: 2007-09-26
-// RCS-ID: $Id$
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/textcompleter.h"
#include "wx/dynlib.h"
-#include <initguid.h>
-
#include "wx/msw/private.h"
#if wxUSE_UXTHEME
#define SHACF_FILESYS_DIRS 0x00000020
#endif
+// This must be the last header included to only affect the DEFINE_GUID()
+// occurrences below but not any GUIDs declared in the standard files included
+// above.
+#include <initguid.h>
+
namespace
{
// wxEVT_CHAR handler (as we must also let the other handlers
// defined at wx level run first).
//
- // Notice that we can't use wxEVT_COMMAND_TEXT_UPDATED here
+ // Notice that we can't use wxEVT_TEXT here
// neither as, due to our use of ACO_AUTOAPPEND, we get
// EN_CHANGE notifications from the control every time
// IAutoComplete auto-appends something to it.
void wxTextEntry::WriteText(const wxString& text)
{
- ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, (LPARAM)text.wx_str());
+ ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, wxMSW_CONV_LPARAM(text));
}
wxString wxTextEntry::DoGetValue() const
#ifdef HAS_AUTOCOMPLETE
+#if wxUSE_DYNLIB_CLASS
+
bool wxTextEntry::DoAutoCompleteFileNames(int flags)
{
typedef HRESULT (WINAPI *SHAutoComplete_t)(HWND, DWORD);
return true;
}
+#endif // wxUSE_DYNLIB_CLASS
+
wxTextAutoCompleteData *wxTextEntry::GetOrCreateCompleter()
{
if ( !m_autoCompleteData )
if ( margins.x != -1 )
{
- // left margin
+ // Set both horizontal margins to the given value, we don't distinguish
+ // between left and right margin at wx API level and it seems to be
+ // better to change both of them than only left one.
::SendMessage(GetEditHwnd(), EM_SETMARGINS,
- EC_LEFTMARGIN, MAKELONG(margins.x, 0));
+ EC_LEFTMARGIN | EC_RIGHTMARGIN,
+ MAKELONG(margins.x, margins.x));
}
if ( margins.y != -1 )