summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2018-09-30 20:57:15 +0200
committerfalkTX <falktx@gmail.com>2018-09-30 20:57:15 +0200
commit1770a175bd01a5d8287da8314d0720f8728ac20e (patch)
treec8b06b703d4100d9fd03aef369f832ebf70a8bac
parentb526e381cc065e44dc8ec7620c1725b203a3ee85 (diff)
Expose get/setIgnoringKeyRepeat in Window class
Fixes #15
-rw-r--r--dgl/Window.hpp6
-rw-r--r--dgl/src/Window.cpp22
2 files changed, 26 insertions, 2 deletions
diff --git a/dgl/Window.hpp b/dgl/Window.hpp
index fab14725..dbe3abfd 100644
--- a/dgl/Window.hpp
+++ b/dgl/Window.hpp
@@ -98,8 +98,6 @@ public:
bool isResizable() const noexcept;
void setResizable(bool yesNo);
- void setGeometryConstraints(uint width, uint height, bool aspect);
-
uint getWidth() const noexcept;
uint getHeight() const noexcept;
Size<uint> getSize() const noexcept;
@@ -109,11 +107,15 @@ public:
const char* getTitle() const noexcept;
void setTitle(const char* title);
+ void setGeometryConstraints(uint width, uint height, bool aspect);
void setTransientWinId(uintptr_t winId);
double getScaling() const noexcept;
void setScaling(double scaling) noexcept;
+ bool getIgnoringKeyRepeat() const noexcept;
+ void setIgnoringKeyRepeat(bool ignore) noexcept;
+
Application& getApp() const noexcept;
intptr_t getWindowId() const noexcept;
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
index 18c0d5f6..c8e230a7 100644
--- a/dgl/src/Window.cpp
+++ b/dgl/src/Window.cpp
@@ -710,6 +710,18 @@ struct Window::PrivateData {
// -------------------------------------------------------------------
+ bool getIgnoringKeyRepeat() const noexcept
+ {
+ return fView->ignoreKeyRepeat;
+ }
+
+ void setIgnoringKeyRepeat(bool ignore) noexcept
+ {
+ puglIgnoreKeyRepeat(fView, ignore);
+ }
+
+ // -------------------------------------------------------------------
+
void addWidget(Widget* const widget)
{
fWidgets.push_back(widget);
@@ -1333,6 +1345,16 @@ void Window::setScaling(double scaling) noexcept
pData->setScaling(scaling);
}
+bool Window::getIgnoringKeyRepeat() const noexcept
+{
+ return pData->getIgnoringKeyRepeat();
+}
+
+void Window::setIgnoringKeyRepeat(bool ignore) noexcept
+{
+ pData->setIgnoringKeyRepeat(ignore);
+}
+
Application& Window::getApp() const noexcept
{
return pData->fApp;