Add cut/copy/paste to a wxTextEntry instance.
More...
#include <textentry_tricks.h>
|
static void | OnCharHook (wxTextEntry *aTextEntry, wxKeyEvent &aEvent) |
|
|
static bool | isCtrl (int aChar, const wxKeyEvent &e) |
|
static bool | isShiftCtrl (int aChar, const wxKeyEvent &e) |
|
Add cut/copy/paste to a wxTextEntry instance.
While these are normally handled without our intervention, this is not always the case.
Definition at line 35 of file textentry_tricks.h.
◆ isCtrl()
static bool TEXTENTRY_TRICKS::isCtrl |
( |
int |
aChar, |
|
|
const wxKeyEvent & |
e |
|
) |
| |
|
staticprotected |
◆ isShiftCtrl()
static bool TEXTENTRY_TRICKS::isShiftCtrl |
( |
int |
aChar, |
|
|
const wxKeyEvent & |
e |
|
) |
| |
|
staticprotected |
◆ OnCharHook()
void TEXTENTRY_TRICKS::OnCharHook |
( |
wxTextEntry * |
aTextEntry, |
|
|
wxKeyEvent & |
aEvent |
|
) |
| |
|
static |
Definition at line 30 of file textentry_tricks.cpp.
32 if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() ==
'X' )
36 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() ==
'C' )
40 else if( aEvent.GetModifiers() == wxMOD_CONTROL && aEvent.GetKeyCode() ==
'V' )
44 else if( aEvent.GetKeyCode() == WXK_BACK )
47 aTextEntry->GetSelection( &start, &end );
51 aTextEntry->Remove( start, end );
52 aTextEntry->SetInsertionPoint( start );
54 else if ( start == end && start > 0 )
56 aTextEntry->Remove( start-1, start );
57 aTextEntry->SetInsertionPoint( start-1 );
60 else if( aEvent.GetKeyCode() == WXK_DELETE )
63 aTextEntry->GetSelection( &start, &end );
67 aTextEntry->Remove( start, end );
68 aTextEntry->SetInsertionPoint( start );
70 else if( start == end && start < aTextEntry->GetLastPosition() )
72 aTextEntry->Remove( start, start+1 );
Referenced by ACTION_MENU::OnMenuEvent().
The documentation for this struct was generated from the following files: