aboutsummaryrefslogtreecommitdiff
path: root/include/cru
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-21 15:36:00 +0800
committercrupest <crupest@outlook.com>2021-12-21 15:36:00 +0800
commit63b39863b9d567068480f9c1d59177c92a8c6169 (patch)
tree06485cd94ca299bcc0d09fdc23fc9a73cad38eab /include/cru
parent061f9ad04131febcc66975fd3d95b332789da52f (diff)
downloadcru-63b39863b9d567068480f9c1d59177c92a8c6169.tar.gz
cru-63b39863b9d567068480f9c1d59177c92a8c6169.tar.bz2
cru-63b39863b9d567068480f9c1d59177c92a8c6169.zip
...
Diffstat (limited to 'include/cru')
-rw-r--r--include/cru/ui/components/Menu.hpp6
-rw-r--r--include/cru/ui/events/MouseEventArgs.hpp3
2 files changed, 8 insertions, 1 deletions
diff --git a/include/cru/ui/components/Menu.hpp b/include/cru/ui/components/Menu.hpp
index b0075574..b409c4c0 100644
--- a/include/cru/ui/components/Menu.hpp
+++ b/include/cru/ui/components/Menu.hpp
@@ -88,8 +88,14 @@ class PopupMenu : public Component {
controls::Popup* GetPopup() { return popup_; }
Menu* GetMenu() { return menu_; }
+ // position relative to screen left top.
void SetPosition(const Point& position);
void Show();
+ // position relative to screen left top.
+ void Show(const Point& position) {
+ SetPosition(position);
+ Show();
+ }
void Close();
private:
diff --git a/include/cru/ui/events/MouseEventArgs.hpp b/include/cru/ui/events/MouseEventArgs.hpp
index 6d6aba15..1e6ddc95 100644
--- a/include/cru/ui/events/MouseEventArgs.hpp
+++ b/include/cru/ui/events/MouseEventArgs.hpp
@@ -19,8 +19,9 @@ class MouseEventArgs : public UiEventArgs {
Point GetPoint() const { return point_.value_or(Point{}); }
Point GetPoint(render::RenderObject* render_target) const;
Point GetPointToContent(render::RenderObject* render_target) const;
+ Point GetPointOfScreen() const;
private:
std::optional<Point> point_;
};
-} // namespace cru::ui::event
+} // namespace cru::ui::events