#define SHACF_FILESYS_ONLY 0x00000010
#endif
+#ifndef SHACF_FILESYS_DIRS
+ #define SHACF_FILESYS_DIRS 0x00000020
+#endif
+
namespace
{
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
-bool wxTextEntry::DoAutoCompleteFileNames()
+#if wxUSE_DYNLIB_CLASS
+
+bool wxTextEntry::DoAutoCompleteFileNames(int flags)
{
typedef HRESULT (WINAPI *SHAutoComplete_t)(HWND, DWORD);
static SHAutoComplete_t s_pfnSHAutoComplete = (SHAutoComplete_t)-1;
if ( !s_pfnSHAutoComplete )
return false;
- HRESULT hr = (*s_pfnSHAutoComplete)(GetEditHwnd(), SHACF_FILESYS_ONLY);
+ DWORD dwFlags = 0;
+ if ( flags & wxFILE )
+ dwFlags |= SHACF_FILESYS_ONLY;
+ else if ( flags & wxDIR )
+ dwFlags |= SHACF_FILESYS_DIRS;
+ else
+ {
+ wxFAIL_MSG(wxS("No flags for file name auto completion?"));
+ return false;
+ }
+
+ HRESULT hr = (*s_pfnSHAutoComplete)(GetEditHwnd(), dwFlags);
if ( FAILED(hr) )
{
wxLogApiError(wxT("SHAutoComplete()"), hr);
return true;
}
+#endif // wxUSE_DYNLIB_CLASS
+
wxTextAutoCompleteData *wxTextEntry::GetOrCreateCompleter()
{
if ( !m_autoCompleteData )
// We still need to define stubs as we declared these overrides in the header.
-bool wxTextEntry::DoAutoCompleteFileNames()
+bool wxTextEntry::DoAutoCompleteFileNames(int flags)
{
- return wxTextEntryBase::DoAutoCompleteFileNames();
+ return wxTextEntryBase::DoAutoCompleteFileNames(flags);
}
bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
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 )