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
67cf9bfb
Commit
67cf9bfb
authored
May 13, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Icons for export and print;
match_rule script function
parent
8a143327
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
3 deletions
+40
-3
src/gui/set/window.cpp
src/gui/set/window.cpp
+3
-3
src/resource/msw/mse.rc
src/resource/msw/mse.rc
+3
-0
src/resource/msw/tool/export.png
src/resource/msw/tool/export.png
+0
-0
src/resource/msw/tool/print.png
src/resource/msw/tool/print.png
+0
-0
src/resource/msw/tool/print_preview.png
src/resource/msw/tool/print_preview.png
+0
-0
src/script/functions/basic.cpp
src/script/functions/basic.cpp
+34
-0
No files found.
src/gui/set/window.cpp
View file @
67cf9bfb
...
...
@@ -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_APPR
,
_
(
"export_apprentice"
),
_MENU_
(
"export apprentice"
),
_HELP_
(
"export apprentice"
));
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->Append(ID_FILE_INSPECT, _("Inspect Internal Data..."), _("Shows a the data in the set using a tree structure"));
// menuFile->AppendSeparator();
menuFile
->
Append
(
ID_FILE_RELOAD
,
_MENU_
(
"reload data"
),
_HELP_
(
"reload data"
));
menuFile
->
AppendSeparator
();
menuFile
->
Append
(
ID_FILE_PRINT_PREVIEW
,
_MENU_
(
"print preview"
),
_HELP_
(
"print preview"
));
menuFile
->
Append
(
ID_FILE_PRINT
,
_MENU_
(
"print"
),
_HELP_
(
"print"
));
menuFile
->
Append
(
ID_FILE_PRINT_PREVIEW
,
_
(
"print_preview"
),
_MENU_
(
"print preview"
),
_HELP_
(
"print preview"
));
menuFile
->
Append
(
ID_FILE_PRINT
,
_
(
"print"
),
_MENU_
(
"print"
),
_HELP_
(
"print"
));
menuFile
->
AppendSeparator
();
// recent files go here
menuFile
->
AppendSeparator
();
...
...
src/resource/msw/mse.rc
View file @
67cf9bfb
...
...
@@ -22,11 +22,14 @@ cursor/rot_text CURSOR "cursor/rot_text.cur"
tool/new IMAGE "tool/new.png"
tool/open IMAGE "tool/open.png"
tool/save IMAGE "tool/save.png"
tool/export IMAGE "tool/export.png"
tool/export_html IMAGE "tool/export_html.png"
tool/export_image IMAGE "tool/export_image.png"
tool/export_images IMAGE "tool/export_images.png"
tool/export_mws IMAGE "tool/export_mws.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/redo IMAGE "tool/redo.png"
...
...
src/resource/msw/tool/export.png
0 → 100644
View file @
67cf9bfb
260 Bytes
src/resource/msw/tool/print.png
0 → 100644
View file @
67cf9bfb
273 Bytes
src/resource/msw/tool/print_preview.png
0 → 100644
View file @
67cf9bfb
336 Bytes
src/script/functions/basic.cpp
View file @
67cf9bfb
...
...
@@ -367,6 +367,38 @@ SCRIPT_FUNCTION(filter) {
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
/// 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
ctx
.
setVariable
(
_
(
"replace"
),
script_replace
);
ctx
.
setVariable
(
_
(
"filter"
),
script_filter
);
ctx
.
setVariable
(
_
(
"match"
),
script_match
);
ctx
.
setVariable
(
_
(
"sort"
),
script_sort
);
ctx
.
setVariable
(
_
(
"replace rule"
),
script_replace_rule
);
ctx
.
setVariable
(
_
(
"filter rule"
),
script_filter_rule
);
ctx
.
setVariable
(
_
(
"match rule"
),
script_match_rule
);
ctx
.
setVariable
(
_
(
"sort rule"
),
script_sort_rule
);
}
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