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
839b0d37
Commit
839b0d37
authored
May 13, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added export toolbar button
parent
81e88a78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
src/gui/set/window.cpp
src/gui/set/window.cpp
+37
-2
src/gui/set/window.hpp
src/gui/set/window.hpp
+2
-0
No files found.
src/gui/set/window.cpp
View file @
839b0d37
...
...
@@ -55,13 +55,13 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
menuFile
->
Append
(
ID_FILE_OPEN
,
_
(
"open"
),
_MENU_
(
"open set"
),
_HELP_
(
"open set"
));
menuFile
->
Append
(
ID_FILE_SAVE
,
_
(
"save"
),
_MENU_
(
"save set"
),
_HELP_
(
"save set"
));
menuFile
->
Append
(
ID_FILE_SAVE_AS
,
_MENU_
(
"save set as"
),
_HELP_
(
"save set as"
));
IconMenu
*
menuExport
=
new
IconMenu
();
menuExport
=
new
IconMenu
();
menuExport
->
Append
(
ID_FILE_EXPORT_HTML
,
_
(
"export_html"
),
_MENU_
(
"export html"
),
_HELP_
(
"export html"
));
menuExport
->
Append
(
ID_FILE_EXPORT_IMAGE
,
_
(
"export_image"
),
_MENU_
(
"export image"
),
_HELP_
(
"export image"
));
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
,
_
(
"export"
),
_MENU_
(
"export"
),
_
(
"Export the set...
"
),
wxITEM_NORMAL
,
menuExport
);
menuFile
->
Append
(
wxID_ANY
,
_
(
"export"
),
_MENU_
(
"export"
),
_HELP_
(
"export
"
),
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();
...
...
@@ -115,6 +115,8 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
tb
->
AddTool
(
ID_FILE_OPEN
,
_
(
""
),
load_resource_tool_image
(
_
(
"open"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"open set"
),
_HELP_
(
"open set"
));
tb
->
AddTool
(
ID_FILE_SAVE
,
_
(
""
),
load_resource_tool_image
(
_
(
"save"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"save set"
),
_HELP_
(
"save set"
));
tb
->
AddSeparator
();
tb
->
AddTool
(
ID_FILE_EXPORT
,
_
(
""
),
load_resource_tool_image
(
_
(
"export"
)),
wxNullBitmap
,
wxITEM_CHECK
,
_TOOLTIP_
(
"export"
),
_HELP_
(
"export"
));
tb
->
AddSeparator
();
tb
->
AddTool
(
ID_EDIT_CUT
,
_
(
""
),
load_resource_tool_image
(
_
(
"cut"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"cut"
),
_HELP_
(
"cut"
));
tb
->
AddTool
(
ID_EDIT_COPY
,
_
(
""
),
load_resource_tool_image
(
_
(
"copy"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"copy"
),
_HELP_
(
"copy"
));
tb
->
AddTool
(
ID_EDIT_PASTE
,
_
(
""
),
load_resource_tool_image
(
_
(
"paste"
)),
wxNullBitmap
,
wxITEM_NORMAL
,
_TOOLTIP_
(
"paste"
),
_HELP_
(
"paste"
));
...
...
@@ -432,6 +434,38 @@ void SetWindow::onFileInspect(wxCommandEvent&) {
wnd.show();
}*/
#if defined(__WXMSW__)
#include "wx/msw/wrapcctl.h"
#endif
void
SetWindow
::
onFileExportMenu
(
wxCommandEvent
&
ev
)
{
// find position of export tool bar button
wxToolBar
*
tb
=
GetToolBar
();
int
pos
=
tb
->
GetToolPos
(
ev
.
GetId
());
wxRect
tool_rect
;
#if defined(__WXMSW__)
RECT
r
=
{
0
,
0
,
0
,
0
};
::
SendMessage
((
HWND
)
tb
->
GetHWND
(),
TB_GETITEMRECT
,
pos
,
(
LPARAM
)
&
r
);
tool_rect
.
x
=
r
.
left
;
tool_rect
.
y
=
r
.
top
;
tool_rect
.
width
=
r
.
right
-
r
.
left
;
tool_rect
.
height
=
r
.
bottom
-
r
.
top
;
#else
// TODO: This is probably not correct!
wxSize
tool_size
=
tb
->
GetToolSize
();
wxSize
tool_margin
=
tb
->
GetToolMargins
();
tool_rect
.
SetSize
(
tool_size
);
tool_rect
.
y
=
0
;
tool_rect
.
x
=
tool_size
.
x
*
pos
;
#endif
// tool down
tb
->
ToggleTool
(
ev
.
GetId
(),
true
);
// pop up a menu of export options
tb
->
PopupMenu
(
menuExport
,
tool_rect
.
x
,
tool_rect
.
GetBottom
());
// tool up
tb
->
ToggleTool
(
ev
.
GetId
(),
false
);
}
void
SetWindow
::
onFileExportImage
(
wxCommandEvent
&
)
{
CardP
card
=
current_panel
->
selectedCard
();
if
(
!
card
)
return
;
// no card selected
...
...
@@ -601,6 +635,7 @@ BEGIN_EVENT_TABLE(SetWindow, wxFrame)
EVT_MENU
(
ID_FILE_OPEN
,
SetWindow
::
onFileOpen
)
EVT_MENU
(
ID_FILE_SAVE
,
SetWindow
::
onFileSave
)
EVT_MENU
(
ID_FILE_SAVE_AS
,
SetWindow
::
onFileSaveAs
)
EVT_MENU
(
ID_FILE_EXPORT
,
SetWindow
::
onFileExportMenu
)
EVT_MENU
(
ID_FILE_EXPORT_IMAGE
,
SetWindow
::
onFileExportImage
)
EVT_MENU
(
ID_FILE_EXPORT_IMAGES
,
SetWindow
::
onFileExportImages
)
EVT_MENU
(
ID_FILE_EXPORT_HTML
,
SetWindow
::
onFileExportHTML
)
...
...
src/gui/set/window.hpp
View file @
839b0d37
...
...
@@ -39,6 +39,7 @@ class SetWindow : public wxFrame, public SetView {
// gui items
vector
<
SetWindowPanel
*>
panels
;
///< All panels on this window
SetWindowPanel
*
current_panel
;
IconMenu
*
menuExport
;
/// Number of items in the recent sets list
size_t
number_of_recentSets
;
...
...
@@ -104,6 +105,7 @@ class SetWindow : public wxFrame, public SetView {
void
onFileSave
(
wxCommandEvent
&
);
void
onFileSaveAs
(
wxCommandEvent
&
);
// void onFileInspect (wxCommandEvent&);
void
onFileExportMenu
(
wxCommandEvent
&
);
void
onFileExportImage
(
wxCommandEvent
&
);
void
onFileExportImages
(
wxCommandEvent
&
);
void
onFileExportHTML
(
wxCommandEvent
&
);
...
...
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