mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
Icons for export and print;
match_rule script function git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@356 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -61,14 +61,14 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
|||||||
menuExport->Append(ID_FILE_EXPORT_IMAGES, _("export_images"), _MENU_("export images"), _HELP_("export images"));
|
menuExport->Append(ID_FILE_EXPORT_IMAGES, _("export_images"), _MENU_("export images"), _HELP_("export images"));
|
||||||
menuExport->Append(ID_FILE_EXPORT_APPR, _("export_apprentice"), _MENU_("export apprentice"),_HELP_("export apprentice"));
|
menuExport->Append(ID_FILE_EXPORT_APPR, _("export_apprentice"), _MENU_("export apprentice"),_HELP_("export apprentice"));
|
||||||
menuExport->Append(ID_FILE_EXPORT_MWS, _("export_mws"), _MENU_("export mws"), _HELP_("export mws"));
|
menuExport->Append(ID_FILE_EXPORT_MWS, _("export_mws"), _MENU_("export mws"), _HELP_("export mws"));
|
||||||
menuFile->Append(ID_FILE_EXPORT, _MENU_("export"), _("Export the set..."), menuExport);
|
menuFile->Append(ID_FILE_EXPORT, _("export"), _MENU_("export"), _("Export the set..."), wxITEM_NORMAL, menuExport);
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
// menuFile->Append(ID_FILE_INSPECT, _("Inspect Internal Data..."), _("Shows a the data in the set using a tree structure"));
|
// menuFile->Append(ID_FILE_INSPECT, _("Inspect Internal Data..."), _("Shows a the data in the set using a tree structure"));
|
||||||
// menuFile->AppendSeparator();
|
// menuFile->AppendSeparator();
|
||||||
menuFile->Append(ID_FILE_RELOAD, _MENU_("reload data"), _HELP_("reload data"));
|
menuFile->Append(ID_FILE_RELOAD, _MENU_("reload data"), _HELP_("reload data"));
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
menuFile->Append(ID_FILE_PRINT_PREVIEW, _MENU_("print preview"), _HELP_("print preview"));
|
menuFile->Append(ID_FILE_PRINT_PREVIEW, _("print_preview"), _MENU_("print preview"), _HELP_("print preview"));
|
||||||
menuFile->Append(ID_FILE_PRINT, _MENU_("print"), _HELP_("print"));
|
menuFile->Append(ID_FILE_PRINT, _("print"), _MENU_("print"), _HELP_("print"));
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
// recent files go here
|
// recent files go here
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
|
|||||||
@@ -22,11 +22,14 @@ cursor/rot_text CURSOR "cursor/rot_text.cur"
|
|||||||
tool/new IMAGE "tool/new.png"
|
tool/new IMAGE "tool/new.png"
|
||||||
tool/open IMAGE "tool/open.png"
|
tool/open IMAGE "tool/open.png"
|
||||||
tool/save IMAGE "tool/save.png"
|
tool/save IMAGE "tool/save.png"
|
||||||
|
tool/export IMAGE "tool/export.png"
|
||||||
tool/export_html IMAGE "tool/export_html.png"
|
tool/export_html IMAGE "tool/export_html.png"
|
||||||
tool/export_image IMAGE "tool/export_image.png"
|
tool/export_image IMAGE "tool/export_image.png"
|
||||||
tool/export_images IMAGE "tool/export_images.png"
|
tool/export_images IMAGE "tool/export_images.png"
|
||||||
tool/export_mws IMAGE "tool/export_mws.png"
|
tool/export_mws IMAGE "tool/export_mws.png"
|
||||||
tool/export_apprentice IMAGE "tool/export_apprentice.png"
|
tool/export_apprentice IMAGE "tool/export_apprentice.png"
|
||||||
|
tool/print IMAGE "tool/print.png"
|
||||||
|
tool/print_preview IMAGE "tool/print_preview.png"
|
||||||
|
|
||||||
tool/undo IMAGE "tool/undo.png"
|
tool/undo IMAGE "tool/undo.png"
|
||||||
tool/redo IMAGE "tool/redo.png"
|
tool/redo IMAGE "tool/redo.png"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 260 B |
Binary file not shown.
|
After Width: | Height: | Size: 273 B |
Binary file not shown.
|
After Width: | Height: | Size: 336 B |
@@ -367,6 +367,38 @@ SCRIPT_FUNCTION(filter) {
|
|||||||
return filter_rule(ctx)->eval(ctx);
|
return filter_rule(ctx)->eval(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------- : Rules : regex match
|
||||||
|
|
||||||
|
class ScriptMatchRule : public ScriptValue {
|
||||||
|
public:
|
||||||
|
virtual ScriptType type() const { return SCRIPT_FUNCTION; }
|
||||||
|
virtual String typeName() const { return _("match_rule"); }
|
||||||
|
virtual ScriptValueP eval(Context& ctx) const {
|
||||||
|
SCRIPT_PARAM(String, input);
|
||||||
|
SCRIPT_RETURN(regex.Matches(input));
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRegEx regex; ///< Regex to match
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a regular expression rule for filtering strings
|
||||||
|
ScriptValueP match_rule(Context& ctx) {
|
||||||
|
intrusive_ptr<ScriptMatchRule> ret(new ScriptMatchRule);
|
||||||
|
// match
|
||||||
|
SCRIPT_PARAM(String, match);
|
||||||
|
if (!ret->regex.Compile(match, wxRE_ADVANCED)) {
|
||||||
|
throw ScriptError(_("Error while compiling regular expression: '")+match+_("'"));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
SCRIPT_FUNCTION(match_rule) {
|
||||||
|
return match_rule(ctx);
|
||||||
|
}
|
||||||
|
SCRIPT_FUNCTION(match) {
|
||||||
|
return match_rule(ctx)->eval(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Rules : sort
|
// ----------------------------------------------------------------------------- : Rules : sort
|
||||||
|
|
||||||
/// Sort a string using a specification using the shortest cycle metric, see spec_sort
|
/// Sort a string using a specification using the shortest cycle metric, see spec_sort
|
||||||
@@ -558,8 +590,10 @@ void init_script_basic_functions(Context& ctx) {
|
|||||||
// advanced string rules
|
// advanced string rules
|
||||||
ctx.setVariable(_("replace"), script_replace);
|
ctx.setVariable(_("replace"), script_replace);
|
||||||
ctx.setVariable(_("filter"), script_filter);
|
ctx.setVariable(_("filter"), script_filter);
|
||||||
|
ctx.setVariable(_("match"), script_match);
|
||||||
ctx.setVariable(_("sort"), script_sort);
|
ctx.setVariable(_("sort"), script_sort);
|
||||||
ctx.setVariable(_("replace rule"), script_replace_rule);
|
ctx.setVariable(_("replace rule"), script_replace_rule);
|
||||||
ctx.setVariable(_("filter rule"), script_filter_rule);
|
ctx.setVariable(_("filter rule"), script_filter_rule);
|
||||||
|
ctx.setVariable(_("match rule"), script_match_rule);
|
||||||
ctx.setVariable(_("sort rule"), script_sort_rule);
|
ctx.setVariable(_("sort rule"), script_sort_rule);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user