Editor for wxGrid cells that adds a file/folder browser to the grid input field.
More...
#include <grid_text_button_helpers.h>
|
| GRID_CELL_PATH_EDITOR (DIALOG_SHIM *aParentDialog, WX_GRID *aGrid, wxString *aCurrentDir, const wxString &aExt, bool aNormalize=false, const wxString &aNormalizeBasePath=wxEmptyString) |
| Constructor. More...
|
|
wxGridCellEditor * | Clone () const override |
|
void | Create (wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override |
|
wxString | GetValue () const override |
|
void | SetSize (const wxRect &aRect) override |
|
void | StartingKey (wxKeyEvent &event) override |
|
void | BeginEdit (int aRow, int aCol, wxGrid *aGrid) override |
|
bool | EndEdit (int, int, const wxGrid *, const wxString &, wxString *aNewVal) override |
|
void | ApplyEdit (int aRow, int aCol, wxGrid *aGrid) override |
|
void | Reset () override |
|
Editor for wxGrid cells that adds a file/folder browser to the grid input field.
Definition at line 139 of file grid_text_button_helpers.h.
◆ GRID_CELL_PATH_EDITOR()
GRID_CELL_PATH_EDITOR::GRID_CELL_PATH_EDITOR |
( |
DIALOG_SHIM * |
aParentDialog, |
|
|
WX_GRID * |
aGrid, |
|
|
wxString * |
aCurrentDir, |
|
|
const wxString & |
aExt, |
|
|
bool |
aNormalize = false , |
|
|
const wxString & |
aNormalizeBasePath = wxEmptyString |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
aCurrentDir | is current directory the path editor will open at |
aExt | is the file extension(s) to filter by. If empty, the path editor will switch to folder mode instead of file. |
aNormalize | indicates whether to normalize the selected path (replace part of path with variables or relative path) |
aNormalizeBasePath | is the path to use when trying to base variables (generally current project path) |
Definition at line 153 of file grid_text_button_helpers.h.
155 :
156 m_dlg( aParentDialog ),
162 { }
wxString m_normalizeBasePath
Referenced by Clone().
◆ ApplyEdit()
void GRID_CELL_TEXT_BUTTON::ApplyEdit |
( |
int |
aRow, |
|
|
int |
aCol, |
|
|
wxGrid * |
aGrid |
|
) |
| |
|
overrideinherited |
◆ BeginEdit()
void GRID_CELL_TEXT_BUTTON::BeginEdit |
( |
int |
aRow, |
|
|
int |
aCol, |
|
|
wxGrid * |
aGrid |
|
) |
| |
|
overrideinherited |
◆ Clone()
wxGridCellEditor * GRID_CELL_PATH_EDITOR::Clone |
( |
| ) |
const |
|
inlineoverride |
◆ Combo()
wxComboCtrl * GRID_CELL_TEXT_BUTTON::Combo |
( |
| ) |
const |
|
inlineprotectedinherited |
◆ Create()
void GRID_CELL_PATH_EDITOR::Create |
( |
wxWindow * |
aParent, |
|
|
wxWindowID |
aId, |
|
|
wxEvtHandler * |
aEventHandler |
|
) |
| |
|
override |
◆ EndEdit()
bool GRID_CELL_TEXT_BUTTON::EndEdit |
( |
int |
, |
|
|
int |
, |
|
|
const wxGrid * |
, |
|
|
const wxString & |
, |
|
|
wxString * |
aNewVal |
|
) |
| |
|
overrideinherited |
◆ GetValue()
wxString GRID_CELL_TEXT_BUTTON::GetValue |
( |
| ) |
const |
|
overrideinherited |
◆ Reset()
void GRID_CELL_TEXT_BUTTON::Reset |
( |
| ) |
|
|
overrideinherited |
◆ SetSize()
void GRID_CELL_TEXT_BUTTON::SetSize |
( |
const wxRect & |
aRect | ) |
|
|
overrideinherited |
Definition at line 60 of file grid_text_button_helpers.cpp.
61{
62 wxRect rect( aRect );
63
64#if defined( __WXMAC__ )
65 rect.Inflate( 2 );
66#elif defined( __WXGTK__ )
67 rect.Inflate( -3 );
68
69
70
71
72#else
73 rect.Inflate( -1 );
74#endif
75
76 Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
77}
References GRID_CELL_TEXT_BUTTON::Combo().
◆ StartingKey()
void GRID_CELL_TEXT_BUTTON::StartingKey |
( |
wxKeyEvent & |
event | ) |
|
|
overrideinherited |
Definition at line 80 of file grid_text_button_helpers.cpp.
81{
82
83
84
85
86
87
88
89
90 wxTextEntry* textEntry =
static_cast<wxTextEntry*
>(
Combo() );
91 int ch;
92
93 bool isPrintable;
94
95#if wxUSE_UNICODE
96 ch = event.GetUnicodeKey();
97
98 if( ch != WXK_NONE )
99 isPrintable = true;
100 else
101#endif
102 {
103 ch = event.GetKeyCode();
104 isPrintable = ch >= WXK_SPACE && ch < WXK_START;
105 }
106
107 switch( ch )
108 {
109 case WXK_DELETE:
110
111 textEntry->Remove( 0, 1 );
112 break;
113
114 case WXK_BACK:
115
116 {
117 const long pos = textEntry->GetLastPosition();
118 textEntry->Remove( pos - 1, pos );
119 }
120 break;
121
122 default:
123 if( isPrintable )
124 textEntry->WriteText( static_cast<wxChar>( ch ) );
125 break;
126 }
127}
References GRID_CELL_TEXT_BUTTON::Combo().
◆ wxDECLARE_NO_COPY_CLASS()
◆ m_currentDir
wxString* GRID_CELL_PATH_EDITOR::m_currentDir |
|
protected |
◆ m_dlg
◆ m_ext
wxString GRID_CELL_PATH_EDITOR::m_ext |
|
protected |
◆ m_grid
WX_GRID* GRID_CELL_PATH_EDITOR::m_grid |
|
protected |
◆ m_normalize
bool GRID_CELL_PATH_EDITOR::m_normalize |
|
protected |
◆ m_normalizeBasePath
wxString GRID_CELL_PATH_EDITOR::m_normalizeBasePath |
|
protected |
◆ m_value
wxString GRID_CELL_TEXT_BUTTON::m_value |
|
protectedinherited |
The documentation for this class was generated from the following files: