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
505d079c
Commit
505d079c
authored
Aug 08, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new card selection thingy also used for "export all card images"
parent
296f4942
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
24 deletions
+20
-24
src/data/format/formats.hpp
src/data/format/formats.hpp
+1
-1
src/data/format/image.cpp
src/data/format/image.cpp
+1
-1
src/gui/card_select_window.cpp
src/gui/card_select_window.cpp
+4
-2
src/gui/card_select_window.hpp
src/gui/card_select_window.hpp
+2
-1
src/gui/images_export_window.cpp
src/gui/images_export_window.cpp
+6
-14
src/gui/images_export_window.hpp
src/gui/images_export_window.hpp
+2
-2
src/gui/print_window.cpp
src/gui/print_window.cpp
+1
-2
src/gui/set/window.cpp
src/gui/set/window.cpp
+3
-1
No files found.
src/data/format/formats.hpp
View file @
505d079c
...
...
@@ -87,7 +87,7 @@ FileFormatP mtg_editor_file_format();
void
export_images
(
Window
*
parent
,
const
SetP
&
set
);
/// Export the image for each card in a list of cards
void
export_images
(
const
SetP
&
set
,
vector
<
CardP
>&
cards
,
void
export_images
(
const
SetP
&
set
,
const
vector
<
CardP
>&
cards
,
const
String
&
path
,
const
String
&
filename_template
,
FilenameConflicts
conflicts
);
/// Export the image of a single card
...
...
src/data/format/image.cpp
View file @
505d079c
...
...
@@ -66,7 +66,7 @@ Bitmap export_bitmap(const SetP& set, const CardP& card) {
// ----------------------------------------------------------------------------- : Multiple card export
void
export_images
(
const
SetP
&
set
,
vector
<
CardP
>&
cards
,
void
export_images
(
const
SetP
&
set
,
const
vector
<
CardP
>&
cards
,
const
String
&
path
,
const
String
&
filename_template
,
FilenameConflicts
conflicts
)
{
wxBusyCursor
busy
;
...
...
src/gui/card_select_window.cpp
View file @
505d079c
...
...
@@ -42,8 +42,9 @@ ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const
// ----------------------------------------------------------------------------- : ExportWindowBase
ExportWindowBase
::
ExportWindowBase
(
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
)
:
set
(
set
),
cards_choices
(
cards_choices
)
ExportWindowBase
::
ExportWindowBase
(
Window
*
parent
,
const
String
&
title
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
)
:
wxDialog
(
parent
,
wxID_ANY
,
title
)
,
set
(
set
),
cards_choices
(
cards_choices
)
,
active_choice
(
0
)
,
select_cards
(
nullptr
)
{}
...
...
@@ -56,6 +57,7 @@ wxSizer* ExportWindowBase::Create() {
bool
any_custom
=
false
;
FOR_EACH
(
choice
,
cards_choices
)
{
wxRadioButton
*
btn
=
new
wxRadioButton
(
this
,
ID_SELECTION_CHOICE
+
i
,
choice
->
label
);
btn
->
SetValue
(
i
==
0
);
btn
->
Enable
(
!
choice
->
the_cards
->
empty
()
||
choice
->
type
==
EXPORT_SEL_CUSTOM
);
s
->
Add
(
btn
,
0
,
wxALL
,
6
);
s
->
AddSpacer
(
-
4
);
...
...
src/gui/card_select_window.hpp
View file @
505d079c
...
...
@@ -42,7 +42,8 @@ typedef vector<ExportCardSelectionChoiceP> ExportCardSelectionChoices;
/// Base class for export windows, deals with card selection
class
ExportWindowBase
:
public
wxDialog
{
public:
ExportWindowBase
(
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
);
ExportWindowBase
(
Window
*
parent
,
const
String
&
window_title
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
);
/// Create the controls, return a sizer containing them
wxSizer
*
Create
();
...
...
src/gui/images_export_window.cpp
View file @
505d079c
...
...
@@ -21,8 +21,8 @@ DECLARE_TYPEOF_COLLECTION(CardP);
// ----------------------------------------------------------------------------- : ImagesExportWindow
ImagesExportWindow
::
ImagesExportWindow
(
Window
*
parent
,
const
SetP
&
set
)
:
CardSelectWindow
(
parent
,
set
,
wxEmptyString
,
_TITLE_
(
"select cards export"
),
false
)
ImagesExportWindow
::
ImagesExportWindow
(
Window
*
parent
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
choices
)
:
ExportWindowBase
(
parent
,
_TITLE_
(
"select cards export"
),
set
,
choices
)
{
// init controls
GameSettings
&
gs
=
settings
.
gameSettingsFor
(
*
set
->
game
);
...
...
@@ -42,17 +42,12 @@ ImagesExportWindow::ImagesExportWindow(Window* parent, const SetP& set)
s2
->
Add
(
new
wxStaticText
(
this
,
-
1
,
_LABEL_
(
"filename conflicts"
)),
0
,
wxALL
,
4
);
s2
->
Add
(
conflicts
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
4
);
s
->
Add
(
s2
,
0
,
wxEXPAND
|
wxALL
,
8
);
wxSizer
*
s3
=
new
wxStaticBoxSizer
(
wxVERTICAL
,
this
,
_LABEL_
(
"cards to export"
));
s3
->
Add
(
list
,
1
,
wxEXPAND
|
wxALL
,
4
);
wxSizer
*
s4
=
new
wxBoxSizer
(
wxHORIZONTAL
);
s4
->
Add
(
sel_all
,
0
,
wxEXPAND
|
wxRIGHT
,
4
);
s4
->
Add
(
sel_none
,
0
,
wxEXPAND
,
4
);
s3
->
Add
(
s4
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
8
);
wxSizer
*
s3
=
ExportWindowBase
::
Create
();
s
->
Add
(
s3
,
1
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
8
);
s
->
Add
(
CreateButtonSizer
(
wxOK
|
wxCANCEL
),
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
8
);
s
->
SetSizeHints
(
this
);
SetSizer
(
s
);
SetSize
(
500
,
500
);
SetSize
(
500
,
-
1
);
}
// ----------------------------------------------------------------------------- : Exporting the images
...
...
@@ -70,16 +65,13 @@ void ImagesExportWindow::onOk(wxCommandEvent&) {
String
name
=
wxFileSelector
(
_TITLE_
(
"export images"
),
_
(
""
),
_LABEL_
(
"filename is ignored"
),
_
(
""
),
_LABEL_
(
"filename is ignored"
)
+
_
(
"|*"
),
wxSAVE
,
this
);
if
(
name
.
empty
())
return
;
// Cards to export
vector
<
CardP
>
cards
;
getSelection
(
cards
);
// Export
export_images
(
set
,
cards
,
name
,
gs
.
images_export_filename
,
gs
.
images_export_conflicts
);
export_images
(
set
,
getSelection
()
,
name
,
gs
.
images_export_filename
,
gs
.
images_export_conflicts
);
// Done
EndModal
(
wxID_OK
);
}
BEGIN_EVENT_TABLE
(
ImagesExportWindow
,
CardSelectWindow
)
BEGIN_EVENT_TABLE
(
ImagesExportWindow
,
ExportWindowBase
)
EVT_BUTTON
(
wxID_OK
,
ImagesExportWindow
::
onOk
)
END_EVENT_TABLE
()
src/gui/images_export_window.hpp
View file @
505d079c
...
...
@@ -16,9 +16,9 @@
// ----------------------------------------------------------------------------- : ImagesExportWindow
/// A window for selecting a subset of the cards from a set to export to images
class
ImagesExportWindow
:
public
CardSelectWindow
{
class
ImagesExportWindow
:
public
ExportWindowBase
{
public:
ImagesExportWindow
(
Window
*
parent
,
const
SetP
&
set
);
ImagesExportWindow
(
Window
*
parent
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
choices
);
private:
DECLARE_EVENT_TABLE
();
...
...
src/gui/print_window.cpp
View file @
505d079c
...
...
@@ -251,8 +251,7 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
const
vector
<
CardP
>*
cards_to_print
(
Window
*
parent
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
choices
)
{
// Let the user choose cards
//CardSelectWindow wnd(parent, set, _LABEL_("select cards print"), _TITLE_("select cards"));
ExportWindowBase
wnd
(
set
,
choices
);
wnd
.
wxDialog
::
Create
(
parent
,
wxID_ANY
,
_TITLE_
(
"select cards"
));
ExportWindowBase
wnd
(
parent
,
_TITLE_
(
"select cards"
),
set
,
choices
);
wxSizer
*
s
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
s2
=
wnd
.
Create
();
s
->
Add
(
s2
,
1
,
wxEXPAND
|
wxALL
,
8
);
...
...
src/gui/set/window.cpp
View file @
505d079c
...
...
@@ -580,7 +580,9 @@ void SetWindow::onFileExportImage(wxCommandEvent&) {
}
void
SetWindow
::
onFileExportImages
(
wxCommandEvent
&
)
{
ImagesExportWindow
wnd
(
this
,
set
);
ExportCardSelectionChoices
choices
;
selectionChoices
(
choices
);
ImagesExportWindow
wnd
(
this
,
set
,
choices
);
wnd
.
ShowModal
();
}
...
...
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