projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no real changes, just minor refactoring and cleanup
[wxWidgets.git]
/
src
/
msw
/
wince
/
textctrlce.cpp
diff --git
a/src/msw/wince/textctrlce.cpp
b/src/msw/wince/textctrlce.cpp
index b7e5715c8cebd3211d4d0b28c80d0f22a0ce2dab..a9d97de8cc37dab3497b0666f942dafe2234100f 100644
(file)
--- a/
src/msw/wince/textctrlce.cpp
+++ b/
src/msw/wince/textctrlce.cpp
@@
-29,11
+29,9
@@
#include "wx/textctrl.h"
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#ifndef WX_PRECOMP
+ #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#endif
#endif
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
-
#include "wx/spinbutt.h"
#include "wx/textfile.h"
#include "wx/spinbutt.h"
#include "wx/textfile.h"
@@
-258,7
+256,7
@@
bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
}
sizeText.y = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
}
- Set
Best
Size(size);
+ Set
Initial
Size(size);
(void)::ShowWindow(GetBuddyHwnd(), SW_SHOW);
(void)::ShowWindow(GetBuddyHwnd(), SW_SHOW);
@@
-395,7
+393,7
@@
wxString wxTextCtrl::GetRange(long from, long to) const
return str;
}
return str;
}
-void wxTextCtrl::
SetValue(const wxString& value
)
+void wxTextCtrl::
DoSetValue(const wxString& value, int flags
)
{
// if the text is long enough, it's faster to just set it instead of first
// comparing it with the old one (chances are that it will be different
{
// if the text is long enough, it's faster to just set it instead of first
// comparing it with the old one (chances are that it will be different
@@
-403,7
+401,7
@@
void wxTextCtrl::SetValue(const wxString& value)
// edit controls mostly)
if ( (value.length() > 0x400) || (value != GetValue()) )
{
// edit controls mostly)
if ( (value.length() > 0x400) || (value != GetValue()) )
{
- DoWriteText(value, f
alse
);
+ DoWriteText(value, f
lags
);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
@@
-411,7
+409,8
@@
void wxTextCtrl::SetValue(const wxString& value)
else // same text
{
// still send an event for consistency
else // same text
{
// still send an event for consistency
- SendUpdateEvent();
+ if ( flags & SetValue_SendEvent )
+ SendUpdateEvent();
}
// we should reset the modified flag even if the value didn't really change
}
// we should reset the modified flag even if the value didn't really change
@@
-426,8
+425,9
@@
void wxTextCtrl::WriteText(const wxString& value)
DoWriteText(value);
}
DoWriteText(value);
}
-void wxTextCtrl::DoWriteText(const wxString& value,
bool selectionOnly
)
+void wxTextCtrl::DoWriteText(const wxString& value,
int flags
)
{
{
+ bool selectionOnly = (flags & SetValue_SelectionOnly) != 0;
wxString valueDos;
if ( m_windowStyle & wxTE_MULTILINE )
valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
wxString valueDos;
if ( m_windowStyle & wxTE_MULTILINE )
valueDos = wxTextFile::Translate(value, wxTextFileType_Dos);
@@
-438,7
+438,7
@@
void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly)
// call below which is confusing for the client code and so should be
// avoided
//
// call below which is confusing for the client code and so should be
// avoided
//
- if (
( selectionOnly && HasSelection()
) )
+ if (
selectionOnly && HasSelection(
) )
{
m_suppressNextUpdate = true;
}
{
m_suppressNextUpdate = true;
}
@@
-446,7
+446,7
@@
void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly)
::SendMessage(GetBuddyHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT,
0, (LPARAM)valueDos.c_str());
::SendMessage(GetBuddyHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT,
0, (LPARAM)valueDos.c_str());
- if ( !selectionOnly )
+ if ( !selectionOnly
&& !( flags & SetValue_SendEvent )
)
{
// Windows already sends an update event for single-line
// controls.
{
// Windows already sends an update event for single-line
// controls.
@@
-643,7
+643,7
@@
void wxTextCtrl::Replace(long from, long to, const wxString& value)
// Set selection and remove it
DoSetSelection(from, to, false);
// Set selection and remove it
DoSetSelection(from, to, false);
- DoWriteText(value,
true
);
+ DoWriteText(value,
SetValue_SelectionOnly
);
}
void wxTextCtrl::Remove(long from, long to)
}
void wxTextCtrl::Remove(long from, long to)