MeshLib C++ Docs
Loading...
Searching...
No Matches
MRModalDialog.h
Go to the documentation of this file.
1#pragma once
2
3#include "exports.h"
4
5#include <functional>
6#include <string>
7
8namespace MR
9{
12
13
16{
18 float windowWidth = 0.f;
21 std::string headline;
23 bool closeButton = false;
25 std::string text;
28 bool* dontShowAgain = nullptr;
30 bool closeOnClickOutside = false;
32 std::function<void ()> onWindowClose;
33};
34
38{
39public:
40 MRVIEWER_API ModalDialog( std::string label, ModalDialogSettings settings );
41
44 MRVIEWER_API bool beginPopup();
46 MRVIEWER_API void endPopup();
47
49 [[nodiscard]] MRVIEWER_API static float windowWidth();
50
51private:
52 void setStyle_();
53 void unsetStyle_();
54
55private:
56 std::string label_;
57 ModalDialogSettings settings_;
58};
59
60}
Helper class to display modal dialogs. ModalDialogSettings.
Definition MRModalDialog.h:38
std::function< void()> onWindowClose
Callback for the window close event.
Definition MRModalDialog.h:32
MRVIEWER_API void endPopup()
Render the dialog's footer ("Don't show again" checkbox) and finish the dialog.
bool closeOnClickOutside
If set, close the dialog on mouse click outside of it.
Definition MRModalDialog.h:30
MRVIEWER_API ModalDialog(std::string label, ModalDialogSettings settings)
bool * dontShowAgain
Definition MRModalDialog.h:28
MRVIEWER_API bool beginPopup()
std::string text
Render a centered text under the headline.
Definition MRModalDialog.h:25
bool closeButton
Add a close button next in the top right corner of the dialog.
Definition MRModalDialog.h:23
static MRVIEWER_API float windowWidth()
Returns the current window width in pixels.
std::string headline
Definition MRModalDialog.h:21
float windowWidth
Dialog window width. If the value is zero or negative, defaults to cModalWindowWidth * UI::scale().
Definition MRModalDialog.h:18
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Settings for ModalDialog.
Definition MRModalDialog.h:16