projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clear the frame statusbar when the mouse leaves the toolbar or enters a tool without...
[wxWidgets.git]
/
src
/
univ
/
textctrl.cpp
diff --git
a/src/univ/textctrl.cpp
b/src/univ/textctrl.cpp
index 805c207216b6ed18530833553228958746dfc3f6..e1cedbad1289db234de92cd2f1980d2823e106a0 100644
(file)
--- a/
src/univ/textctrl.cpp
+++ b/
src/univ/textctrl.cpp
@@
-118,7
+118,7
@@
// ----------------------------------------------------------------------------
#ifdef __GNUG__
// ----------------------------------------------------------------------------
#ifdef __GNUG__
- #pragma implementation "textctrl.h"
+ #pragma implementation "
univ
textctrl.h"
#endif
#include "wx/wxprec.h"
#endif
#include "wx/wxprec.h"
@@
-150,6
+150,10
@@
#include "wx/cmdproc.h"
#include "wx/cmdproc.h"
+#if wxUSE_CLIPBOARD
+#include "wx/dataobj.h"
+#endif
+
// turn extra wxTextCtrl-specific debugging on/off
#define WXDEBUG_TEXT
// turn extra wxTextCtrl-specific debugging on/off
#define WXDEBUG_TEXT
@@
-661,11
+665,14
@@
bool wxTextCtrl::Create(wxWindow *parent,
style |= wxALWAYS_SHOW_SB;
}
style |= wxALWAYS_SHOW_SB;
}
+ // wxTE_WORDWRAP is 0 for now so we don't need the code below
+#if 0
if ( style & wxTE_WORDWRAP )
{
// wrapping words means wrapping, hence no horz scrollbar
style &= ~wxHSCROLL;
}
if ( style & wxTE_WORDWRAP )
{
// wrapping words means wrapping, hence no horz scrollbar
style &= ~wxHSCROLL;
}
+#endif // 0
// TODO: support wxTE_NO_VSCROLL (?)
// TODO: support wxTE_NO_VSCROLL (?)
@@
-1413,6
+1420,10
@@
void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to)
}
else // valid sel range
{
}
else // valid sel range
{
+ // remember the 'to' position as the current position, used to move the
+ // caret there later
+ wxTextPos toOrig = to;
+
OrderPositions(from, to);
wxCHECK_RET( to <= GetLastPosition(),
OrderPositions(from, to);
wxCHECK_RET( to <= GetLastPosition(),
@@
-1458,8
+1469,8
@@
void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to)
}
//else: nothing to do
}
//else: nothing to do
- // the insertion point is put at the
end of selection
- DoSetInsertionPoint(to);
+ // the insertion point is put at the
location where the caret was moved
+ DoSetInsertionPoint(to
Orig
);
}
}
}
}
@@
-4705,7
+4716,7
@@
wxTextPos wxStdTextCtrlInputHandler::HitTest(const wxTextCtrl *text,
return pos;
}
return pos;
}
-bool wxStdTextCtrlInputHandler::HandleKey(wx
Control *control
,
+bool wxStdTextCtrlInputHandler::HandleKey(wx
InputConsumer *consumer
,
const wxKeyEvent& event,
bool pressed)
{
const wxKeyEvent& event,
bool pressed)
{
@@
-4822,22
+4833,22
@@
bool wxStdTextCtrlInputHandler::HandleKey(wxControl *control,
if ( (action != wxACTION_NONE) && (action != wxACTION_TEXT_PREFIX_SEL) )
{
if ( (action != wxACTION_NONE) && (action != wxACTION_TEXT_PREFIX_SEL) )
{
- con
trol
->PerformAction(action, -1, str);
+ con
sumer
->PerformAction(action, -1, str);
return TRUE;
}
return TRUE;
}
- return wxStdInputHandler::HandleKey(con
trol
, event, pressed);
+ return wxStdInputHandler::HandleKey(con
sumer
, event, pressed);
}
}
-bool wxStdTextCtrlInputHandler::HandleMouse(wx
Control *control
,
+bool wxStdTextCtrlInputHandler::HandleMouse(wx
InputConsumer *consumer
,
const wxMouseEvent& event)
{
if ( event.LeftDown() )
{
wxASSERT_MSG( !m_winCapture, _T("left button going down twice?") );
const wxMouseEvent& event)
{
if ( event.LeftDown() )
{
wxASSERT_MSG( !m_winCapture, _T("left button going down twice?") );
- wxTextCtrl *text = wxStaticCast(con
trol
, wxTextCtrl);
+ wxTextCtrl *text = wxStaticCast(con
sumer->GetInputWindow()
, wxTextCtrl);
m_winCapture = text;
m_winCapture->CaptureMouse();
m_winCapture = text;
m_winCapture->CaptureMouse();
@@
-4853,7
+4864,7
@@
bool wxStdTextCtrlInputHandler::HandleMouse(wxControl *control,
else if ( event.LeftDClick() )
{
// select the word the cursor is on
else if ( event.LeftDClick() )
{
// select the word the cursor is on
- con
trol
->PerformAction(wxACTION_TEXT_SEL_WORD);
+ con
sumer
->PerformAction(wxACTION_TEXT_SEL_WORD);
}
else if ( event.LeftUp() )
{
}
else if ( event.LeftUp() )
{
@@
-4866,10
+4877,10
@@
bool wxStdTextCtrlInputHandler::HandleMouse(wxControl *control,
}
}
}
}
- return wxStdInputHandler::HandleMouse(con
trol
, event);
+ return wxStdInputHandler::HandleMouse(con
sumer
, event);
}
}
-bool wxStdTextCtrlInputHandler::HandleMouseMove(wx
Control *control
,
+bool wxStdTextCtrlInputHandler::HandleMouseMove(wx
InputConsumer *consumer
,
const wxMouseEvent& event)
{
if ( m_winCapture )
const wxMouseEvent& event)
{
if ( m_winCapture )
@@
-4883,13
+4894,13
@@
bool wxStdTextCtrlInputHandler::HandleMouseMove(wxControl *control,
}
}
}
}
- return wxStdInputHandler::HandleMouseMove(con
trol
, event);
+ return wxStdInputHandler::HandleMouseMove(con
sumer
, event);
}
}
-bool wxStdTextCtrlInputHandler::HandleFocus(wx
Control *control
,
+bool wxStdTextCtrlInputHandler::HandleFocus(wx
InputConsumer *consumer
,
const wxFocusEvent& event)
{
const wxFocusEvent& event)
{
- wxTextCtrl *text = wxStaticCast(con
trol
, wxTextCtrl);
+ wxTextCtrl *text = wxStaticCast(con
sumer->GetInputWindow()
, wxTextCtrl);
// the selection appearance changes depending on whether we have the focus
text->RefreshSelection();
// the selection appearance changes depending on whether we have the focus
text->RefreshSelection();