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
cbcaf5c8
Commit
cbcaf5c8
authored
Jul 09, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
controls to select packs on the RandomPackPanel
parent
eedd1faf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
src/gui/set/random_pack_panel.cpp
src/gui/set/random_pack_panel.cpp
+23
-2
src/gui/set/random_pack_panel.hpp
src/gui/set/random_pack_panel.hpp
+14
-0
No files found.
src/gui/set/random_pack_panel.cpp
View file @
cbcaf5c8
...
@@ -10,6 +10,11 @@
...
@@ -10,6 +10,11 @@
#include <gui/set/random_pack_panel.hpp>
#include <gui/set/random_pack_panel.hpp>
#include <gui/control/card_viewer.hpp>
#include <gui/control/card_viewer.hpp>
#include <gui/control/filtered_card_list.hpp>
#include <gui/control/filtered_card_list.hpp>
#include <data/game.hpp>
#include <data/pack.hpp>
#include <wx/spinctrl.h>
DECLARE_TYPEOF_COLLECTION
(
PackTypeP
);
// ----------------------------------------------------------------------------- : RandomPackPanel
// ----------------------------------------------------------------------------- : RandomPackPanel
...
@@ -26,9 +31,12 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id)
...
@@ -26,9 +31,12 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id)
wxSizer
*
s2
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
s2
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
s3
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxSizer
*
s3
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxSizer
*
s4
=
new
wxStaticBoxSizer
(
wxHORIZONTAL
,
this
,
_LABEL_
(
"pack selection"
));
wxSizer
*
s4
=
new
wxStaticBoxSizer
(
wxHORIZONTAL
,
this
,
_LABEL_
(
"pack selection"
));
s3
->
Add
(
s4
,
1
,
wxEXPAND
,
8
);
packsSizer
=
new
wxFlexGridSizer
(
0
,
2
,
4
,
8
);
packsSizer
->
AddGrowableCol
(
0
);
s4
->
Add
(
packsSizer
,
1
,
wxEXPAND
|
wxALL
,
4
);
s3
->
Add
(
s4
,
1
,
wxEXPAND
,
8
);
wxSizer
*
s5
=
new
wxStaticBoxSizer
(
wxHORIZONTAL
,
this
,
_LABEL_
(
"pack totals"
));
wxSizer
*
s5
=
new
wxStaticBoxSizer
(
wxHORIZONTAL
,
this
,
_LABEL_
(
"pack totals"
));
s3
->
Add
(
s5
,
1
,
wxEXPAND
|
wxLEFT
,
8
);
s3
->
Add
(
s5
,
1
,
wxEXPAND
|
wxLEFT
,
8
);
s3
->
Add
(
generate
,
0
,
wxALIGN_BOTTOM
|
wxLEFT
,
8
);
s3
->
Add
(
generate
,
0
,
wxALIGN_BOTTOM
|
wxLEFT
,
8
);
s2
->
Add
(
s3
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
4
);
s2
->
Add
(
s3
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
4
);
s2
->
Add
(
card_list
,
1
,
wxEXPAND
);
s2
->
Add
(
card_list
,
1
,
wxEXPAND
);
...
@@ -40,6 +48,19 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id)
...
@@ -40,6 +48,19 @@ RandomPackPanel::RandomPackPanel(Window* parent, int id)
void
RandomPackPanel
::
onChangeSet
()
{
void
RandomPackPanel
::
onChangeSet
()
{
preview
->
setSet
(
set
);
preview
->
setSet
(
set
);
card_list
->
setSet
(
set
);
card_list
->
setSet
(
set
);
// add pack controls
FOR_EACH
(
pack
,
set
->
game
->
pack_types
)
{
PackItem
i
;
i
.
pack
=
pack
;
i
.
label
=
new
wxStaticText
(
this
,
wxID_ANY
,
pack
->
name
);
i
.
value
=
new
wxSpinCtrl
(
this
,
wxID_ANY
,
_
(
"0"
),
wxDefaultPosition
,
wxSize
(
50
,
-
1
));
//i.value->SetSizeHints(0,0,50,100);
packsSizer
->
Add
(
i
.
label
,
0
,
wxALIGN_CENTER_VERTICAL
);
packsSizer
->
Add
(
i
.
value
,
0
,
wxEXPAND
|
wxALIGN_CENTER
);
packs
.
push_back
(
i
);
}
Layout
();
}
}
// ----------------------------------------------------------------------------- : UI
// ----------------------------------------------------------------------------- : UI
...
...
src/gui/set/random_pack_panel.hpp
View file @
cbcaf5c8
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
class
CardViewer
;
class
CardViewer
;
class
FilteredCardList
;
class
FilteredCardList
;
DECLARE_POINTER_TYPE
(
PackType
);
// ----------------------------------------------------------------------------- : RandomPackPanel
// ----------------------------------------------------------------------------- : RandomPackPanel
...
@@ -39,6 +40,19 @@ class RandomPackPanel : public SetWindowPanel {
...
@@ -39,6 +40,19 @@ class RandomPackPanel : public SetWindowPanel {
private:
private:
CardViewer
*
preview
;
///< Card preview
CardViewer
*
preview
;
///< Card preview
FilteredCardList
*
card_list
;
///< The list of cards
FilteredCardList
*
card_list
;
///< The list of cards
wxFlexGridSizer
*
packsSizer
;
wxFlexGridSizer
*
totalsSizer
;
struct
PackItem
{
PackTypeP
pack
;
wxStaticText
*
label
;
wxSpinCtrl
*
value
;
};
vector
<
PackItem
>
packs
;
struct
TotalItem
{
};
vector
<
TotalItem
>
totals
;
/// Generate the cards
/// Generate the cards
void
generate
();
void
generate
();
...
...
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