diff options
author | B Stack <bgstack15@gmail.com> | 2019-03-13 10:36:44 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-03-13 10:36:44 +0000 |
commit | 2c01454a3fea1c29df0aeb208862243cb928b74c (patch) | |
tree | dc226d83311470a23cdf0c02064feb525fcc5096 /wx+/grid.h | |
parent | Merge branch '10.9' into 'master' (diff) | |
parent | 10.10 (diff) | |
download | FreeFileSync-2c01454a3fea1c29df0aeb208862243cb928b74c.tar.gz FreeFileSync-2c01454a3fea1c29df0aeb208862243cb928b74c.tar.bz2 FreeFileSync-2c01454a3fea1c29df0aeb208862243cb928b74c.zip |
Merge branch '10.10' into 'master'10.10
10.10
Latest changes:
* New option: synchronize selection
* Dynamically disable unsuitable context menu options
* Support MTP devices without move command
* Fall back to copy/delete when implicitly moving to different device (e.g. symlink)
* Fixed incorrect statistics after parallel move
* Fixed menu button not triggering context menu
* Fixed crash on focus change while message popup is dismissed
* Fixed crash when trying to shrink empty image
* Fixed invisible dialogs when monitor is turned off in multi-monitor setup
* Work around GetFileInformationByHandle error code 58 on WD My Cloud EX
* Changing deletion handling now correctly triggers updated config
* Support root-relative FTP file paths (e.g. FreeNAS)
* Move and rename MTP items as a transaction
* Exclude AppleDouble files (._) via default filter on macOS
* Support home path for FTP folder picker
* Use server default permissions when creating SFTP folder
* Use native OpenSSL AES-CTR rather than libssh2 fallback
* Added context information for cloud connection errors
* Updated translation files
See merge request opensource-tracking/FreeFileSync!7
Diffstat (limited to 'wx+/grid.h')
-rw-r--r-- | wx+/grid.h | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -22,6 +22,10 @@ namespace zen enum class ColumnType { NONE = -1 }; //user-defiend column type enum class HoverArea { NONE = -1 }; //user-defined area for mouse selections for a given row (may span multiple columns or split a single column into multiple areas) +//wxContextMenuEvent? => automatically generated by wxWidgets when right mouse down/up is not handled; even OS-dependent in which case event is generated +//=> inappropriate! client decides when to show context! => simulate right mouse click when WXK_WINDOWS_MENU button is pressed +//=> same behavior as earlier wxWidgets: https://github.com/wxWidgets/wxWidgets/commit/2c69d27c0d225d3a331c773da466686153185320#diff-9f11c8f2cb1f734f7c0c1071aba491a5 + //------------------------ events ------------------------------------------------ extern const wxEventType EVENT_GRID_MOUSE_LEFT_DOUBLE; // extern const wxEventType EVENT_GRID_MOUSE_LEFT_DOWN; // @@ -38,21 +42,21 @@ extern const wxEventType EVENT_GRID_COL_RESIZE; //generates: GridColumnResizeEve //example: wnd.Connect(EVENT_GRID_COL_LABEL_LEFT_CLICK, GridClickEventHandler(MyDlg::OnLeftClick), nullptr, this); -struct GridClickEvent : public wxMouseEvent +struct GridClickEvent : public wxEvent { - GridClickEvent(wxEventType et, const wxMouseEvent& me, ptrdiff_t row, HoverArea hoverArea) : - wxMouseEvent(me), row_(row), hoverArea_(hoverArea) { SetEventType(et); } + GridClickEvent(wxEventType et, ptrdiff_t row, HoverArea hoverArea, const wxPoint& mousePos) : + wxEvent(0 /*winid*/, et), row_(row), hoverArea_(hoverArea), mousePos_(mousePos) {} GridClickEvent* Clone() const override { return new GridClickEvent(*this); } const ptrdiff_t row_; //-1 for invalid position, >= rowCount if out of range const HoverArea hoverArea_; //may be HoverArea::NONE + const wxPoint mousePos_; //client coordinates }; - -struct GridSelectEvent : public wxCommandEvent +struct GridSelectEvent : public wxEvent { GridSelectEvent(size_t rowFirst, size_t rowLast, bool positive, const GridClickEvent* mouseClick) : - wxCommandEvent(EVENT_GRID_SELECT_RANGE), rowFirst_(rowFirst), rowLast_(rowLast), positive_(positive), + wxEvent(0 /*winid*/, EVENT_GRID_SELECT_RANGE), rowFirst_(rowFirst), rowLast_(rowLast), positive_(positive), mouseClick_(mouseClick ? *mouseClick : std::optional<GridClickEvent>()) { assert(rowFirst <= rowLast); } GridSelectEvent* Clone() const override { return new GridSelectEvent(*this); } @@ -62,17 +66,17 @@ struct GridSelectEvent : public wxCommandEvent const std::optional<GridClickEvent> mouseClick_; //filled unless selection was performed via keyboard shortcuts }; -struct GridLabelClickEvent : public wxMouseEvent +struct GridLabelClickEvent : public wxEvent { - GridLabelClickEvent(wxEventType et, const wxMouseEvent& me, ColumnType colType) : wxMouseEvent(me), colType_(colType) { SetEventType(et); } + GridLabelClickEvent(wxEventType et, ColumnType colType) : wxEvent(0 /*winid*/, et), colType_(colType) {} GridLabelClickEvent* Clone() const override { return new GridLabelClickEvent(*this); } const ColumnType colType_; //may be ColumnType::NONE }; -struct GridColumnResizeEvent : public wxCommandEvent +struct GridColumnResizeEvent : public wxEvent { - GridColumnResizeEvent(int offset, ColumnType colType) : wxCommandEvent(EVENT_GRID_COL_RESIZE), colType_(colType), offset_(offset) {} + GridColumnResizeEvent(int offset, ColumnType colType) : wxEvent(0 /*winid*/, EVENT_GRID_COL_RESIZE), colType_(colType), offset_(offset) {} GridColumnResizeEvent* Clone() const override { return new GridColumnResizeEvent(*this); } const ColumnType colType_; @@ -224,6 +228,7 @@ private: void onPaintEvent(wxPaintEvent& event); void onSizeEvent(wxSizeEvent& event) { updateWindowSizes(); event.Skip(); } void onKeyDown(wxKeyEvent& event); + void onKeyUp (wxKeyEvent& event); void updateWindowSizes(bool updateScrollbar = true); |