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
7161dbff
Commit
7161dbff
authored
2 months ago
by
bartvbl
Browse files
Options
Downloads
Patches
Plain Diff
Reverted changes. Windows is just windows I guess
parent
4c923911
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dependencies/subprojects/animationwindow/src/AnimationWindow.cpp
+4
-45
4 additions, 45 deletions
...ncies/subprojects/animationwindow/src/AnimationWindow.cpp
with
4 additions
and
45 deletions
dependencies/subprojects/animationwindow/src/AnimationWindow.cpp
+
4
−
45
View file @
7161dbff
...
...
@@ -15,7 +15,6 @@
#include
"internal/FontCache.h"
#include
"internal/KeyboardKeyConverter.h"
#include
"internal/nuklear_configured.h"
#include
"internal/portable-file-dialogs.h"
#include
"widgets/Button.h"
static
bool
sdlHasBeenInitialised
=
false
;
...
...
@@ -338,52 +337,12 @@ void TDT4102::AnimationWindow::add(TDT4102::Widget& widgetToAdd) {
widgets
.
emplace_back
(
widgetToAdd
);
}
namespace
TDT4102
::
internal
{
pfd
::
icon
messageTypeToPFDIcon
(
TDT4102
::
MessageType
type
)
{
pfd
::
icon
messageIcon
=
pfd
::
icon
::
info
;
if
(
type
==
TDT4102
::
MessageType
::
ERROR
)
{
messageIcon
=
pfd
::
icon
::
error
;
}
else
if
(
type
==
TDT4102
::
MessageType
::
WARNING
)
{
messageIcon
=
pfd
::
icon
::
warning
;
}
else
if
(
type
==
TDT4102
::
MessageType
::
QUESTION
)
{
messageIcon
=
pfd
::
icon
::
question
;
}
return
messageIcon
;
}
}
void
TDT4102
::
AnimationWindow
::
show_message
(
std
::
string
title
,
std
::
string
message
,
TDT4102
::
MessageType
type
)
const
{
pfd
::
icon
messageIcon
=
internal
::
messageTypeToPFDIcon
(
type
);
pfd
::
message
(
title
,
message
,
pfd
::
choice
::
ok
,
messageIcon
);
}
bool
TDT4102
::
AnimationWindow
::
show_yesno_dialog
(
std
::
string
title
,
std
::
string
message
,
TDT4102
::
MessageType
type
)
const
{
pfd
::
icon
messageIcon
=
internal
::
messageTypeToPFDIcon
(
type
);
pfd
::
button
pressedButton
=
pfd
::
message
(
title
,
message
,
pfd
::
choice
::
yes_no
,
messageIcon
).
result
();
return
pressedButton
==
pfd
::
button
::
yes
;
}
void
TDT4102
::
AnimationWindow
::
show_notification
(
std
::
string
title
,
std
::
string
message
,
TDT4102
::
MessageType
type
)
const
{
pfd
::
icon
messageIcon
=
internal
::
messageTypeToPFDIcon
(
type
);
pfd
::
notify
(
title
,
message
,
messageIcon
);
}
std
::
filesystem
::
path
TDT4102
::
AnimationWindow
::
show_open_file_dialog
(
std
::
string
title
,
std
::
filesystem
::
path
initialDirectory
)
const
{
std
::
vector
<
std
::
string
>
selectedFiles
=
pfd
::
open_file
(
title
,
initialDirectory
.
string
()).
result
();
if
(
selectedFiles
.
empty
())
{
throw
std
::
runtime_error
(
"No file was selected!"
);
}
return
std
::
filesystem
::
path
(
selectedFiles
.
at
(
0
));
}
std
::
filesystem
::
path
TDT4102
::
AnimationWindow
::
show_select_directory_dialog
(
std
::
string
title
,
std
::
filesystem
::
path
initialDirectory
)
const
{
std
::
string
selectedFile
=
pfd
::
select_folder
(
title
,
initialDirectory
.
string
()).
result
();
return
std
::
filesystem
::
path
(
selectedFile
);
void
TDT4102
::
AnimationWindow
::
show_info_dialog
(
const
std
::
string
&
message
)
const
{
SDL_ShowSimpleMessageBox
(
SDL_MESSAGEBOX_INFORMATION
,
"Information"
,
message
.
c_str
(),
windowHandle
);
}
std
::
filesystem
::
path
TDT4102
::
AnimationWindow
::
show_save_file_dialog
(
std
::
string
title
,
std
::
filesystem
::
path
initialDirectory
)
const
{
std
::
string
selectedFile
=
pfd
::
save_file
(
title
,
initialDirectory
.
string
()).
result
();
return
std
::
filesystem
::
path
(
selectedFile
);
void
TDT4102
::
AnimationWindow
::
show_error_dialog
(
const
std
::
string
&
message
)
const
{
SDL_ShowSimpleMessageBox
(
SDL_MESSAGEBOX_ERROR
,
"Error"
,
message
.
c_str
(),
windowHandle
);
}
TDT4102
::
Point
TDT4102
::
AnimationWindow
::
getWindowDimensions
()
const
{
...
...
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