Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
5edd47df
Commit
5edd47df
authored
Dec 22, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actions for changing the style
parent
8e23b08e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
src/gui/set/style_panel.cpp
src/gui/set/style_panel.cpp
+44
-2
src/gui/set/style_panel.hpp
src/gui/set/style_panel.hpp
+7
-0
No files found.
src/gui/set/style_panel.cpp
View file @
5edd47df
...
...
@@ -13,7 +13,9 @@
#include <util/window_id.hpp>
#include <data/set.hpp>
#include <data/game.hpp>
#include <data/card.hpp>
#include <data/stylesheet.hpp>
#include <data/action/set.hpp>
// ----------------------------------------------------------------------------- : StylePanel
...
...
@@ -41,14 +43,54 @@ StylePanel::StylePanel(Window* parent, int id)
void
StylePanel
::
onChangeSet
()
{
list
->
showData
<
StyleSheet
>
(
set
->
game
->
name
()
+
_
(
"-*"
));
list
->
select
(
set
->
stylesheet
->
name
());
list
->
select
(
set
->
stylesheet
->
name
()
,
false
);
editor
->
setSet
(
set
);
preview
->
setSet
(
set
);
card
.
reset
();
use_for_all
->
Enable
(
false
);
}
void
StylePanel
::
onAction
(
const
Action
&
action
,
bool
undone
)
{
TYPE_CASE_
(
action
,
ChangeSetStyleAction
)
{
list
->
select
(
set
->
stylesheetFor
(
card
)
->
name
(),
false
);
// updateSize();
}
TYPE_CASE
(
action
,
ChangeCardStyleAction
)
{
if
(
action
.
card
==
card
)
{
// preview->onAction(action, undone); // update the preview control before we determine our new size
list
->
select
(
set
->
stylesheetFor
(
card
)
->
name
(),
false
);
// updateSize();
}
}
}
// ----------------------------------------------------------------------------- : Selection
void
StylePanel
::
selectCard
(
const
CardP
&
card
)
{
this
->
card
=
card
;
preview
->
setCard
(
card
);
list
->
select
(
set
->
stylesheetFor
(
card
)
->
name
());
list
->
select
(
set
->
stylesheetFor
(
card
)
->
name
(),
false
);
use_for_all
->
Enable
(
card
&&
card
->
stylesheet
);
}
// ----------------------------------------------------------------------------- : Events
void
StylePanel
::
onStyleSelect
(
wxCommandEvent
&
)
{
if
(
list
->
hasSelection
())
{
StyleSheetP
stylesheet
=
list
->
getSelection
<
StyleSheet
>
();
if
(
stylesheet
==
set
->
stylesheet
)
{
// select no special style when selecting the same style as the set default
stylesheet
=
StyleSheetP
();
}
set
->
actions
.
add
(
new
ChangeCardStyleAction
(
card
,
stylesheet
));
}
}
void
StylePanel
::
onUseForAll
(
wxCommandEvent
&
)
{
set
->
actions
.
add
(
new
ChangeSetStyleAction
(
*
set
,
card
));
}
BEGIN_EVENT_TABLE
(
StylePanel
,
wxPanel
)
EVT_GALLERY_SELECT
(
wxID_ANY
,
StylePanel
::
onStyleSelect
)
EVT_BUTTON
(
ID_STYLE_USE_FOR_ALL
,
StylePanel
::
onUseForAll
)
END_EVENT_TABLE
()
src/gui/set/style_panel.hpp
View file @
5edd47df
...
...
@@ -24,15 +24,22 @@ class StylePanel : public SetWindowPanel {
StylePanel
(
Window
*
parent
,
int
id
);
virtual
void
onChangeSet
();
virtual
void
onAction
(
const
Action
&
,
bool
undone
);
// --------------------------------------------------- : Selection
virtual
void
selectCard
(
const
CardP
&
card
);
private:
DECLARE_EVENT_TABLE
();
CardViewer
*
preview
;
///< Card preview
PackageList
*
list
;
///< List of stylesheets
StylingEditor
*
editor
;
///< Editor for styling information
wxButton
*
use_for_all
;
CardP
card
;
///< Card we are working on
void
onStyleSelect
(
wxCommandEvent
&
);
void
onUseForAll
(
wxCommandEvent
&
);
};
// ----------------------------------------------------------------------------- : EOF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment