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
eac09654
Commit
eac09654
authored
Oct 20, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added AboutWindow
parent
eb505a3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
196 additions
and
5 deletions
+196
-5
src/gui/about_window.cpp
src/gui/about_window.cpp
+107
-0
src/gui/about_window.hpp
src/gui/about_window.hpp
+55
-0
src/gui/control/card_list.cpp
src/gui/control/card_list.cpp
+8
-3
src/gui/set/window.cpp
src/gui/set/window.cpp
+4
-2
src/mse.vcproj
src/mse.vcproj
+22
-0
No files found.
src/gui/about_window.cpp
0 → 100644
View file @
eac09654
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
// ----------------------------------------------------------------------------- : Includes
#include <gui/about_window.hpp>
#include <gui/util.hpp>
#include <util/version.hpp>
#include <wx/dcbuffer.h>
// ----------------------------------------------------------------------------- : About window
AboutWindow
::
AboutWindow
(
Window
*
parent
)
:
wxDialog
(
parent
,
wxID_ANY
,
_
(
"About Magic Set Editor"
),
wxDefaultPosition
,
wxSize
(
510
,
340
),
wxCLIP_CHILDREN
|
wxDEFAULT_DIALOG_STYLE
)
,
logo
(
load_resource_image
(
_
(
"ABOUT"
)))
,
logo2
(
load_resource_image
(
_
(
"TWO"
)))
{
// init controls
wxButton
*
ok_button
=
new
HoverButton
(
this
,
wxID_OK
,
_
(
"BTN_OK"
));
wxSize
bs
=
ok_button
->
GetSize
(),
ws
=
GetClientSize
();
ok_button
->
Move
(
ws
.
GetWidth
()
-
bs
.
GetWidth
(),
ws
.
GetHeight
()
-
bs
.
GetHeight
());
// align bottom right
}
void
AboutWindow
::
onPaint
(
wxPaintEvent
&
ev
)
{
wxBufferedPaintDC
dc
(
this
);
dc
.
BeginDrawing
();
draw
(
dc
);
dc
.
EndDrawing
();
}
void
AboutWindow
::
draw
(
DC
&
dc
)
{
wxSize
ws
=
GetClientSize
();
// draw background
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
dc
.
SetBrush
(
Color
(
240
,
247
,
255
));
dc
.
DrawRectangle
(
0
,
0
,
ws
.
GetWidth
(),
ws
.
GetHeight
());
// draw logo
dc
.
DrawBitmap
(
logo
,
(
ws
.
GetWidth
()
-
logo
.
GetWidth
())
/
2
,
5
);
dc
.
DrawBitmap
(
logo2
,
ws
.
GetWidth
()
-
logo2
.
GetWidth
(),
ws
.
GetHeight
()
-
logo2
.
GetHeight
());
// draw version box
dc
.
SetPen
(
wxPen
(
Color
(
184
,
29
,
19
),
2
));
dc
.
SetBrush
(
Color
(
114
,
197
,
224
));
dc
.
DrawRectangle
(
28
,
104
,
245
,
133
);
dc
.
SetTextBackground
(
Color
(
114
,
197
,
224
));
dc
.
SetTextForeground
(
Color
(
0
,
0
,
0
));
// draw version info
dc
.
SetFont
(
wxFont
(
9
,
wxSWISS
,
wxNORMAL
,
wxNORMAL
,
false
,
_
(
"Arial"
)));
dc
.
DrawText
(
_
(
"Version: "
)
+
app_version
.
toString
()
+
version_suffix
,
34
,
110
);
dc
.
DrawText
(
_
(
"This is a development version!"
),
34
,
130
);
dc
.
DrawText
(
_
(
" it probably contains lots bugs,"
),
34
,
147
);
dc
.
DrawText
(
_
(
" it misses some very important features,"
),
34
,
164
);
dc
.
DrawText
(
_
(
" don't use it for anything important"
),
34
,
181
);
dc
.
DrawText
(
_
(
"Copyright
\xA9
2006 Twan van Laarhoven"
),
34
,
214
);
}
BEGIN_EVENT_TABLE
(
AboutWindow
,
wxDialog
)
EVT_PAINT
(
AboutWindow
::
onPaint
)
END_EVENT_TABLE
()
// ----------------------------------------------------------------------------- : Button with image and hover effect
HoverButton
::
HoverButton
(
Window
*
parent
,
int
id
,
const
String
&
name
)
:
normal
(
load_resource_image
(
name
+
_
(
"_NORMAL"
)))
,
hover
(
load_resource_image
(
name
+
_
(
"_HOVER"
)))
{
Create
(
parent
,
id
,
normal
,
wxDefaultPosition
,
wxSize
(
normal
.
GetWidth
(),
normal
.
GetHeight
()),
0
);
}
void
HoverButton
::
onMouseEnter
(
wxMouseEvent
&
)
{
SetBitmapLabel
(
hover
);
Refresh
(
false
);
}
void
HoverButton
::
onMouseLeave
(
wxMouseEvent
&
)
{
SetBitmapLabel
(
normal
);
Refresh
(
false
);
}
void
HoverButton
::
onFocus
(
wxFocusEvent
&
)
{}
void
HoverButton
::
onKillFocus
(
wxFocusEvent
&
)
{}
void
HoverButton
::
onPaint
(
wxPaintEvent
&
)
{
wxPaintDC
dc
(
this
);
dc
.
BeginDrawing
();
draw
(
dc
);
dc
.
EndDrawing
();
}
void
HoverButton
::
draw
(
DC
&
dc
)
{
// clear background (for transparent button images)
wxSize
ws
=
GetClientSize
();
dc
.
SetPen
(
*
wxTRANSPARENT_PEN
);
dc
.
SetBrush
(
Color
(
240
,
247
,
255
));
dc
.
DrawRectangle
(
0
,
0
,
ws
.
GetWidth
(),
ws
.
GetHeight
());
// draw button
dc
.
DrawBitmap
(
GetBitmapLabel
(),
0
,
0
);
}
BEGIN_EVENT_TABLE
(
HoverButton
,
wxBitmapButton
)
EVT_ENTER_WINDOW
(
HoverButton
::
onMouseEnter
)
EVT_LEAVE_WINDOW
(
HoverButton
::
onMouseLeave
)
EVT_PAINT
(
HoverButton
::
onPaint
)
EVT_SET_FOCUS
(
HoverButton
::
onFocus
)
EVT_KILL_FOCUS
(
HoverButton
::
onKillFocus
)
END_EVENT_TABLE
()
src/gui/about_window.hpp
0 → 100644
View file @
eac09654
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_GUI_ABOUT_WINDOW
#define HEADER_GUI_ABOUT_WINDOW
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
// ----------------------------------------------------------------------------- : About window
/// Nice about dialog
class
AboutWindow
:
public
wxDialog
{
public:
AboutWindow
(
Window
*
parent
);
private:
DECLARE_EVENT_TABLE
();
// graphics
Bitmap
logo
,
logo2
;
void
onPaint
(
wxPaintEvent
&
e
);
void
draw
(
DC
&
dc
);
};
// ----------------------------------------------------------------------------- : Button with image and hover effect
// A button that changes images on mouseenter/leave
class
HoverButton
:
public
wxBitmapButton
{
public:
HoverButton
(
Window
*
parent
,
int
id
,
const
String
&
name
);
private:
DECLARE_EVENT_TABLE
();
Bitmap
normal
,
hover
;
/// Bitmaps for the states of the button
void
onMouseEnter
(
wxMouseEvent
&
);
void
onMouseLeave
(
wxMouseEvent
&
);
void
onFocus
(
wxFocusEvent
&
ev
);
void
onKillFocus
(
wxFocusEvent
&
ev
);
void
onPaint
(
wxPaintEvent
&
);
protected:
virtual
void
draw
(
DC
&
dc
);
};
// ----------------------------------------------------------------------------- : EOF
#endif
src/gui/control/card_list.cpp
View file @
eac09654
...
@@ -51,9 +51,14 @@ void CardListBase::onChangeSet() {
...
@@ -51,9 +51,14 @@ void CardListBase::onChangeSet() {
void
CardListBase
::
onAction
(
const
Action
&
action
,
bool
undone
)
{
void
CardListBase
::
onAction
(
const
Action
&
action
,
bool
undone
)
{
TYPE_CASE
(
action
,
AddCardAction
)
{
TYPE_CASE
(
action
,
AddCardAction
)
{
// select the new card
if
(
undone
)
{
selectCard
(
action
.
card
,
false
/*list will be refreshed anyway*/
);
refreshList
();
refreshList
();
selectCardPos
((
long
)
sorted_card_list
.
size
()
-
1
,
true
);
}
else
{
// select the new card
selectCard
(
action
.
card
,
false
/*list will be refreshed anyway*/
);
refreshList
();
}
}
}
TYPE_CASE
(
action
,
RemoveCardAction
)
{
TYPE_CASE
(
action
,
RemoveCardAction
)
{
if
(
undone
)
{
if
(
undone
)
{
...
...
src/gui/set/window.cpp
View file @
eac09654
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
#include <gui/set/set_info_panel.hpp>
#include <gui/set/set_info_panel.hpp>
#include <gui/set/style_panel.hpp>
#include <gui/set/style_panel.hpp>
#include <gui/set/stats_panel.hpp>
#include <gui/set/stats_panel.hpp>
#include <gui/about_window.hpp>
#include <gui/new_window.hpp>
#include <gui/icon_menu.hpp>
#include <gui/icon_menu.hpp>
#include <util/window_id.hpp>
#include <util/window_id.hpp>
#include <data/game.hpp>
#include <data/game.hpp>
...
@@ -535,8 +537,8 @@ void SetWindow::onHelpIndex(wxCommandEvent&) {
...
@@ -535,8 +537,8 @@ void SetWindow::onHelpIndex(wxCommandEvent&) {
}
}
void
SetWindow
::
onHelpAbout
(
wxCommandEvent
&
)
{
void
SetWindow
::
onHelpAbout
(
wxCommandEvent
&
)
{
//
AboutWindow wnd(this);
AboutWindow
wnd
(
this
);
//
wnd.ShowModal();
wnd
.
ShowModal
();
}
}
// ----------------------------------------------------------------------------- : Window events - menu - for child panel
// ----------------------------------------------------------------------------- : Window events - menu - for child panel
...
...
src/mse.vcproj
View file @
eac09654
...
@@ -545,6 +545,28 @@
...
@@ -545,6 +545,28 @@
RelativePath=
".\gui\symbol\window.hpp"
>
RelativePath=
".\gui\symbol\window.hpp"
>
</File>
</File>
</Filter>
</Filter>
<Filter
Name=
"other"
Filter=
""
>
<File
RelativePath=
".\gui\about_window.cpp"
>
</File>
<File
RelativePath=
".\gui\about_window.hpp"
>
</File>
<File
RelativePath=
".\gui\new_window.cpp"
>
</File>
<File
RelativePath=
".\gui\new_window.hpp"
>
</File>
<File
RelativePath=
".\gui\welcome_window.cpp"
>
</File>
<File
RelativePath=
".\gui\welcome_window.hpp"
>
</File>
</Filter>
</Filter>
</Filter>
<Filter
<Filter
Name=
"resource"
Name=
"resource"
...
...
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