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
56f1d900
Commit
56f1d900
authored
Aug 08, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HTML export widow also uses cards selector
parent
505d079c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
12 deletions
+21
-12
doc/type/export_template.txt
doc/type/export_template.txt
+1
-0
src/gui/card_select_window.cpp
src/gui/card_select_window.cpp
+2
-2
src/gui/card_select_window.hpp
src/gui/card_select_window.hpp
+1
-1
src/gui/html_export_window.cpp
src/gui/html_export_window.cpp
+11
-6
src/gui/html_export_window.hpp
src/gui/html_export_window.hpp
+3
-2
src/gui/set/window.cpp
src/gui/set/window.cpp
+3
-1
No files found.
doc/type/export_template.txt
View file @
56f1d900
...
@@ -35,6 +35,7 @@ During the evaluation of the script the following variables are available:
...
@@ -35,6 +35,7 @@ During the evaluation of the script the following variables are available:
| @game@ The current game.
| @game@ The current game.
| @style@ The current stylesheet.
| @style@ The current stylesheet.
| @set@ The set being exported.
| @set@ The set being exported.
| @cards@ The cards selected by the user.
| @options@ The values of the @option fields@.
| @options@ The values of the @option fields@.
| @directory@ Name of the directory created (if @create directory@ is set).
| @directory@ Name of the directory created (if @create directory@ is set).
...
...
src/gui/card_select_window.cpp
View file @
56f1d900
...
@@ -42,8 +42,8 @@ ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const
...
@@ -42,8 +42,8 @@ ExportCardSelectionChoice::ExportCardSelectionChoice(const String& label, const
// ----------------------------------------------------------------------------- : ExportWindowBase
// ----------------------------------------------------------------------------- : ExportWindowBase
ExportWindowBase
::
ExportWindowBase
(
Window
*
parent
,
const
String
&
title
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
)
ExportWindowBase
::
ExportWindowBase
(
Window
*
parent
,
const
String
&
title
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
,
long
style
)
:
wxDialog
(
parent
,
wxID_ANY
,
title
)
:
wxDialog
(
parent
,
wxID_ANY
,
title
,
wxDefaultPosition
,
wxDefaultSize
,
style
)
,
set
(
set
),
cards_choices
(
cards_choices
)
,
set
(
set
),
cards_choices
(
cards_choices
)
,
active_choice
(
0
)
,
active_choice
(
0
)
,
select_cards
(
nullptr
)
,
select_cards
(
nullptr
)
...
...
src/gui/card_select_window.hpp
View file @
56f1d900
...
@@ -43,7 +43,7 @@ typedef vector<ExportCardSelectionChoiceP> ExportCardSelectionChoices;
...
@@ -43,7 +43,7 @@ typedef vector<ExportCardSelectionChoiceP> ExportCardSelectionChoices;
class
ExportWindowBase
:
public
wxDialog
{
class
ExportWindowBase
:
public
wxDialog
{
public:
public:
ExportWindowBase
(
Window
*
parent
,
const
String
&
window_title
,
ExportWindowBase
(
Window
*
parent
,
const
String
&
window_title
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
);
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
,
long
style
=
wxDEFAULT_DIALOG_STYLE
);
/// Create the controls, return a sizer containing them
/// Create the controls, return a sizer containing them
wxSizer
*
Create
();
wxSizer
*
Create
();
...
...
src/gui/html_export_window.cpp
View file @
56f1d900
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include <gui/control/native_look_editor.hpp>
#include <gui/control/native_look_editor.hpp>
#include <data/set.hpp>
#include <data/set.hpp>
#include <data/game.hpp>
#include <data/game.hpp>
#include <data/card.hpp>
#include <data/settings.hpp>
#include <data/settings.hpp>
#include <data/export_template.hpp>
#include <data/export_template.hpp>
#include <util/window_id.hpp>
#include <util/window_id.hpp>
...
@@ -24,8 +25,8 @@ DECLARE_POINTER_TYPE(ExportTemplate);
...
@@ -24,8 +25,8 @@ DECLARE_POINTER_TYPE(ExportTemplate);
// ----------------------------------------------------------------------------- : HtmlExportWindow
// ----------------------------------------------------------------------------- : HtmlExportWindow
HtmlExportWindow
::
HtmlExportWindow
(
Window
*
parent
,
const
SetP
&
set
)
HtmlExportWindow
::
HtmlExportWindow
(
Window
*
parent
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
choices
)
:
wxDialog
(
parent
,
wxID_ANY
,
_TITLE_
(
"export html"
),
wxDefaultPosition
,
wxDefaultSize
,
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
|
wxCLIP_CHILDREN
)
:
ExportWindowBase
(
parent
,
_TITLE_
(
"export html"
),
set
,
choices
,
wxDEFAULT_DIALOG_STYLE
|
wxRESIZE_BORDER
|
wxCLIP_CHILDREN
)
,
set
(
set
)
,
set
(
set
)
{
{
// init controls
// init controls
...
@@ -36,8 +37,11 @@ HtmlExportWindow::HtmlExportWindow(Window* parent, const SetP& set)
...
@@ -36,8 +37,11 @@ HtmlExportWindow::HtmlExportWindow(Window* parent, const SetP& set)
wxSizer
*
s
=
new
wxBoxSizer
(
wxVERTICAL
);
wxSizer
*
s
=
new
wxBoxSizer
(
wxVERTICAL
);
s
->
Add
(
new
wxStaticText
(
this
,
wxID_ANY
,
_LABEL_
(
"html template"
)),
0
,
wxALL
,
4
);
s
->
Add
(
new
wxStaticText
(
this
,
wxID_ANY
,
_LABEL_
(
"html template"
)),
0
,
wxALL
,
4
);
s
->
Add
(
list
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
4
);
s
->
Add
(
list
,
0
,
wxEXPAND
|
wxALL
&
~
wxTOP
,
4
);
wxSizer
*
s2
=
new
wxStaticBoxSizer
(
wxVERTICAL
,
this
,
_LABEL_
(
"html export options"
));
wxSizer
*
s2
=
new
wxBoxSizer
(
wxHORIZONTAL
);
s2
->
Add
(
options
,
2
,
wxEXPAND
,
0
);
s2
->
Add
(
ExportWindowBase
::
Create
(),
2
,
wxEXPAND
);
wxSizer
*
s3
=
new
wxStaticBoxSizer
(
wxVERTICAL
,
this
,
_LABEL_
(
"html export options"
));
s3
->
Add
(
options
,
2
,
wxEXPAND
,
0
);
s2
->
Add
(
s3
,
7
,
wxEXPAND
|
wxLEFT
,
8
);
s
->
Add
(
s2
,
1
,
wxEXPAND
|
wxALL
,
4
);
s
->
Add
(
s2
,
1
,
wxEXPAND
|
wxALL
,
4
);
s
->
Add
(
CreateButtonSizer
(
wxOK
|
wxCANCEL
)
,
0
,
wxEXPAND
|
wxALL
,
8
);
s
->
Add
(
CreateButtonSizer
(
wxOK
|
wxCANCEL
)
,
0
,
wxEXPAND
|
wxALL
,
8
);
s
->
SetSizeHints
(
this
);
s
->
SetSizeHints
(
this
);
...
@@ -72,6 +76,7 @@ void HtmlExportWindow::onOk(wxCommandEvent&) {
...
@@ -72,6 +76,7 @@ void HtmlExportWindow::onOk(wxCommandEvent&) {
// run export script
// run export script
Context
&
ctx
=
set
->
getContext
();
Context
&
ctx
=
set
->
getContext
();
LocalScope
scope
(
ctx
);
LocalScope
scope
(
ctx
);
ctx
.
setVariable
(
_
(
"cards"
),
to_script
(
&
getSelection
()));
ctx
.
setVariable
(
_
(
"options"
),
to_script
(
&
settings
.
exportOptionsFor
(
*
exp
)));
ctx
.
setVariable
(
_
(
"options"
),
to_script
(
&
settings
.
exportOptionsFor
(
*
exp
)));
ctx
.
setVariable
(
_
(
"directory"
),
to_script
(
info
.
directory_relative
));
ctx
.
setVariable
(
_
(
"directory"
),
to_script
(
info
.
directory_relative
));
ScriptValueP
result
=
exp
->
script
.
invoke
(
ctx
);
ScriptValueP
result
=
exp
->
script
.
invoke
(
ctx
);
...
@@ -98,12 +103,12 @@ void HtmlExportWindow::onTemplateSelect(wxCommandEvent&) {
...
@@ -98,12 +103,12 @@ void HtmlExportWindow::onTemplateSelect(wxCommandEvent&) {
void
HtmlExportWindow
::
onUpdateUI
(
wxUpdateUIEvent
&
ev
)
{
void
HtmlExportWindow
::
onUpdateUI
(
wxUpdateUIEvent
&
ev
)
{
switch
(
ev
.
GetId
())
{
switch
(
ev
.
GetId
())
{
case
wxID_OK
:
case
wxID_OK
:
ev
.
Enable
(
list
->
hasSelection
());
ev
.
Enable
(
list
->
hasSelection
()
&&
!
getSelection
().
empty
()
);
break
;
break
;
}
}
}
}
BEGIN_EVENT_TABLE
(
HtmlExportWindow
,
wxDialog
)
BEGIN_EVENT_TABLE
(
HtmlExportWindow
,
ExportWindowBase
)
EVT_GALLERY_SELECT
(
ID_EXPORT_LIST
,
HtmlExportWindow
::
onTemplateSelect
)
EVT_GALLERY_SELECT
(
ID_EXPORT_LIST
,
HtmlExportWindow
::
onTemplateSelect
)
EVT_BUTTON
(
wxID_OK
,
HtmlExportWindow
::
onOk
)
EVT_BUTTON
(
wxID_OK
,
HtmlExportWindow
::
onOk
)
EVT_UPDATE_UI
(
wxID_ANY
,
HtmlExportWindow
::
onUpdateUI
)
EVT_UPDATE_UI
(
wxID_ANY
,
HtmlExportWindow
::
onUpdateUI
)
...
...
src/gui/html_export_window.hpp
View file @
56f1d900
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
// ----------------------------------------------------------------------------- : Includes
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/prec.hpp>
#include <gui/card_select_window.hpp>
class
PackageList
;
class
PackageList
;
class
ExportOptionsEditor
;
class
ExportOptionsEditor
;
...
@@ -17,9 +18,9 @@ DECLARE_POINTER_TYPE(Set);
...
@@ -17,9 +18,9 @@ DECLARE_POINTER_TYPE(Set);
// ----------------------------------------------------------------------------- : HtmlExportWindow
// ----------------------------------------------------------------------------- : HtmlExportWindow
class
HtmlExportWindow
:
public
wxDialog
{
class
HtmlExportWindow
:
public
ExportWindowBase
{
public:
public:
HtmlExportWindow
(
Window
*
parent
,
const
SetP
&
set
);
HtmlExportWindow
(
Window
*
parent
,
const
SetP
&
set
,
const
ExportCardSelectionChoices
&
cards_choices
);
private:
private:
PackageList
*
list
;
///< List of templates
PackageList
*
list
;
///< List of templates
...
...
src/gui/set/window.cpp
View file @
56f1d900
...
@@ -587,7 +587,9 @@ void SetWindow::onFileExportImages(wxCommandEvent&) {
...
@@ -587,7 +587,9 @@ void SetWindow::onFileExportImages(wxCommandEvent&) {
}
}
void
SetWindow
::
onFileExportHTML
(
wxCommandEvent
&
)
{
void
SetWindow
::
onFileExportHTML
(
wxCommandEvent
&
)
{
HtmlExportWindow
wnd
(
this
,
set
);
ExportCardSelectionChoices
choices
;
selectionChoices
(
choices
);
HtmlExportWindow
wnd
(
this
,
set
,
choices
);
wnd
.
ShowModal
();
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