summaryrefslogtreecommitdiff
path: root/wx+/grid.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2021-07-15 15:01:41 +0000
committerB. Stack <bgstack15@gmail.com>2021-07-15 15:01:41 +0000
commitbc6f56c106b894409640a7730838bd52ec0c8044 (patch)
tree774b9ac395e65f9346210dcf804aa58f1b3975d1 /wx+/grid.h
parentMerge branch '11.11' into 'master' (diff)
parentadd upstream 11.12 (diff)
downloadFreeFileSync-bc6f56c106b894409640a7730838bd52ec0c8044.tar.gz
FreeFileSync-bc6f56c106b894409640a7730838bd52ec0c8044.tar.bz2
FreeFileSync-bc6f56c106b894409640a7730838bd52ec0c8044.zip
Merge branch '11.12' into 'master'
add upstream 11.12 See merge request opensource-tracking/FreeFileSync!35
Diffstat (limited to 'wx+/grid.h')
-rw-r--r--wx+/grid.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/wx+/grid.h b/wx+/grid.h
index 8ab03932..42fffd18 100644
--- a/wx+/grid.h
+++ b/wx+/grid.h
@@ -13,7 +13,6 @@
#include <set>
#include <vector>
#include <zen/stl_tools.h>
-//#include <zen/basic_math.h>
#include <wx/scrolwin.h>
@@ -56,7 +55,7 @@ struct GridClickEvent : public wxEvent
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
+ const wxPoint mousePos_; //Grid-relative coordinates
};
struct GridSelectEvent : public wxEvent
@@ -78,7 +77,7 @@ struct GridLabelClickEvent : public wxEvent
GridLabelClickEvent* Clone() const override { return new GridLabelClickEvent(*this); }
const ColumnType colType_; //may be ColumnType::none
- const wxPoint mousePos_; //client coordinates
+ const wxPoint mousePos_; //Grid-relative coordinates
};
struct GridColumnResizeEvent : public wxEvent
@@ -92,10 +91,10 @@ struct GridColumnResizeEvent : public wxEvent
struct GridContextMenuEvent : public wxEvent
{
- explicit GridContextMenuEvent(const wxPoint& mousePos) : wxEvent(0 /*winid*/, EVENT_GRID_CONTEXT_MENU), mousePos_(mousePos) {}
+ GridContextMenuEvent(const wxPoint& mousePos) : wxEvent(0 /*winid*/, EVENT_GRID_CONTEXT_MENU), mousePos_(mousePos) {}
GridContextMenuEvent* Clone() const override { return new GridContextMenuEvent(*this); }
- const wxPoint mousePos_; //client coordinates
+ const wxPoint mousePos_; //Grid-relative coordinates
};
//------------------------------------------------------------------------------------------------------------
@@ -203,15 +202,16 @@ public:
wxWindow& getMainWin ();
const wxWindow& getMainWin() const;
- ptrdiff_t getRowAtPos(int posY) const; //return -1 for invalid position, >= rowCount if out of range; absolute coordinates!
-
struct ColumnPosInfo
{
- ColumnType colType = ColumnType::none; //ColumnType::none no column at x position!
+ ColumnType colType = ColumnType::none; //ColumnType::none => no column at posX!
int cellRelativePosX = 0;
int colWidth = 0;
};
- ColumnPosInfo getColumnAtPos(int posX) const; //absolute position!
+ ColumnPosInfo getColumnAtWinPos(int posX) const;
+ ptrdiff_t getRowAtWinPos(int posY) const; //return -1 for invalid position, >= rowCount if out of range
+
+ std::pair<ptrdiff_t, ptrdiff_t> getVisibleRows(const wxRect& clientRect) const; //returns range [begin, end)
void refreshCell(size_t row, ColumnType colType);
@@ -222,7 +222,6 @@ public:
size_t getGridCursor() const; //returns row
void scrollTo(size_t row);
- size_t getTopRow() const;
void makeRowVisible(size_t row);
bgstack15