Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TDT4102
VS-Code
resources
Commits
da1afc79
Commit
da1afc79
authored
2 months ago
by
bartvbl
Browse files
Options
Downloads
Patches
Plain Diff
Added example to show how to use system dialogs
parent
17480e1b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/_folder_Examples/system dialogs/main.cpp
+39
-0
39 additions, 0 deletions
templates/_folder_Examples/system dialogs/main.cpp
with
39 additions
and
0 deletions
templates/_folder_Examples/system dialogs/main.cpp
0 → 100644
+
39
−
0
View file @
da1afc79
#include
"AnimationWindow.h"
#include
<iostream>
int
main
()
{
TDT4102
::
AnimationWindow
window
;
// Message box
window
.
show_message
(
"test title"
,
"Message"
,
TDT4102
::
MessageType
::
INFO
);
window
.
show_message
(
"test title"
,
"Message"
,
TDT4102
::
MessageType
::
ERROR
);
window
.
show_message
(
"test title"
,
"Message"
,
TDT4102
::
MessageType
::
QUESTION
);
window
.
show_message
(
"test title"
,
"Message"
,
TDT4102
::
MessageType
::
WARNING
);
// Yes no question dialog
bool
result
=
window
.
show_yesno_dialog
(
"test title"
,
"message question"
,
TDT4102
::
MessageType
::
QUESTION
);
result
=
window
.
show_yesno_dialog
(
"test title"
,
"message question"
,
TDT4102
::
MessageType
::
ERROR
);
result
=
window
.
show_yesno_dialog
(
"test title"
,
"message question"
,
TDT4102
::
MessageType
::
INFO
);
result
=
window
.
show_yesno_dialog
(
"test title"
,
"message question"
,
TDT4102
::
MessageType
::
WARNING
);
if
(
result
==
true
)
{
std
::
cout
<<
"You answered yes"
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"You answered no"
<<
std
::
endl
;
}
// System notifications
window
.
show_notification
(
"test notification"
,
"test notification message"
,
TDT4102
::
MessageType
::
INFO
);
window
.
show_notification
(
"test notification"
,
"test notification message"
,
TDT4102
::
MessageType
::
ERROR
);
window
.
show_notification
(
"test notification"
,
"test notification message"
,
TDT4102
::
MessageType
::
WARNING
);
window
.
show_notification
(
"test notification"
,
"test notification message"
,
TDT4102
::
MessageType
::
QUESTION
);
// File open and saving dialogs
std
::
filesystem
::
path
fileToOpen
=
window
.
show_open_file_dialog
(
"File to open"
);
std
::
filesystem
::
path
directoryToOpen
=
window
.
show_select_directory_dialog
(
"Directory to open"
);
std
::
filesystem
::
path
fileToSave
=
window
.
show_save_file_dialog
(
"File to save"
);
window
.
wait_for_close
();
return
0
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment