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
9dc4c95d
Commit
9dc4c95d
authored
Dec 11, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added TextCtrl control for things like card.notes and keyword stuff
parent
95949ef8
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
59 additions
and
29 deletions
+59
-29
src/gui/control/native_look_editor.cpp
src/gui/control/native_look_editor.cpp
+1
-3
src/gui/set/cards_panel.cpp
src/gui/set/cards_panel.cpp
+21
-15
src/gui/set/cards_panel.hpp
src/gui/set/cards_panel.hpp
+3
-2
src/gui/set/keywords_panel.cpp
src/gui/set/keywords_panel.cpp
+16
-0
src/gui/value/choice.cpp
src/gui/value/choice.cpp
+2
-1
src/gui/value/choice.hpp
src/gui/value/choice.hpp
+1
-1
src/gui/value/color.cpp
src/gui/value/color.cpp
+2
-1
src/gui/value/color.hpp
src/gui/value/color.hpp
+1
-1
src/gui/value/editor.hpp
src/gui/value/editor.hpp
+0
-5
src/mse.vcproj
src/mse.vcproj
+6
-0
src/util/index_map.hpp
src/util/index_map.hpp
+6
-0
No files found.
src/gui/control/native_look_editor.cpp
View file @
9dc4c95d
...
...
@@ -42,8 +42,6 @@ void NativeLookEditor::drawViewer(RotatedDC& dc, ValueViewer& v) {
draw_control_border
(
this
,
dc
.
getDC
(),
wxRect
(
s
.
left
-
1
,
s
.
top
-
1
,
s
.
width
+
2
,
s
.
height
+
2
));
// draw viewer
v
.
draw
(
dc
);
ValueEditor
*
e
=
v
.
getEditor
();
if
(
e
)
e
->
drawSelection
(
dc
);
}
void
NativeLookEditor
::
resizeViewers
()
{
...
...
@@ -66,7 +64,7 @@ void NativeLookEditor::resizeViewers() {
}
void
NativeLookEditor
::
onInit
()
{
// Give
fieldEdito
rs a chance to show/hide controls (scrollbar) when selecting other editors
// Give
viewe
rs a chance to show/hide controls (scrollbar) when selecting other editors
FOR_EACH_EDITOR
{
e
->
onShow
(
true
);
}
...
...
src/gui/set/cards_panel.cpp
View file @
9dc4c95d
...
...
@@ -9,9 +9,11 @@
#include <gui/set/cards_panel.hpp>
#include <gui/control/card_list.hpp>
#include <gui/control/card_editor.hpp>
#include <gui/control/text_ctrl.hpp>
#include <gui/icon_menu.hpp>
#include <gui/util.hpp>
#include <data/set.hpp>
#include <data/card.hpp>
#include <data/action/set.hpp>
#include <data/settings.hpp>
#include <util/window_id.hpp>
...
...
@@ -23,25 +25,27 @@ CardsPanel::CardsPanel(Window* parent, int id)
:
SetWindowPanel
(
parent
,
id
,
false
)
{
// init controls
// Panel* notesP
editor
=
new
CardEditor
(
this
,
ID_EDITOR
);
// splitter = new SplitterWindow(&this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0);
wxPanel
*
notesP
;
wxSplitterWindow
*
splitter
;
editor
=
new
CardEditor
(
this
,
ID_EDITOR
);
splitter
=
new
wxSplitterWindow
(
this
,
wxID_ANY
,
wxDefaultPosition
,
wxDefaultSize
,
0
);
// card_list = new EditCardList(splitter, ID_CARD_LIST);
card_list
=
new
CardListBase
(
this
,
ID_CARD_LIST
);
card_list
=
new
CardListBase
(
splitter
,
ID_CARD_LIST
);
notesP
=
new
Panel
(
splitter
,
wxID_ANY
);
notes
=
new
TextCtrl
(
notesP
,
ID_NOTES
);
// init sizer for notes panel
wxSizer
*
sn
=
new
wxBoxSizer
(
wxVERTICAL
);
sn
->
Add
(
new
wxStaticText
(
notesP
,
wxID_ANY
,
_
(
"Card notes:"
)),
0
,
wxEXPAND
,
2
);
sn
->
Add
(
notes
,
1
,
wxEXPAND
|
wxTOP
,
2
);
notesP
->
SetSizer
(
sn
);
// init splitter
// splitter->minimumPaneSize = 14
;
// splitter->sashGravity = 1.0
;
// splitter->splitHorizontally(cardL
ist, notesP, -40);
splitter
->
SetMinimumPaneSize
(
14
)
;
splitter
->
SetSashGravity
(
1.0
)
;
splitter
->
SplitHorizontally
(
card_l
ist
,
notesP
,
-
40
);
// init sizer
/* Sizer* s = new wxBoxSizer(wxHORIZONTAL);
s->Add(editor, 0, wxRIGHT, 2);
s->Add(splitter, 1, wxEXPAND);
s->SetSizeHints(this);
SetSizer(s);
*/
wxSizer
*
s
=
new
wxBoxSizer
(
wxHORIZONTAL
);
s
->
Add
(
editor
,
0
,
wxRIGHT
,
2
);
s
->
Add
(
card_list
,
1
,
wxEXPAND
);
s
->
Add
(
editor
,
0
,
wxRIGHT
,
2
);
s
->
Add
(
splitter
,
1
,
wxEXPAND
);
s
->
SetSizeHints
(
this
);
SetSizer
(
s
);
}
...
...
@@ -52,6 +56,7 @@ CardsPanel::~CardsPanel() {
void
CardsPanel
::
onChangeSet
()
{
editor
->
setSet
(
set
);
notes
->
setSet
(
set
);
card_list
->
setSet
(
set
);
/* // resize editor
Sizer* s = sizer;
...
...
@@ -230,4 +235,5 @@ CardP CardsPanel::selectedCard() const {
void
CardsPanel
::
selectCard
(
const
CardP
&
card
)
{
card_list
->
setCard
(
card
);
editor
->
setCard
(
card
);
notes
->
setValue
(
card
?
&
card
->
notes
:
nullptr
);
}
src/gui/set/cards_panel.hpp
View file @
9dc4c95d
...
...
@@ -15,6 +15,7 @@
class
wxSplitterWindow
;
class
CardListBase
;
class
DataEditor
;
class
TextCtrl
;
// ----------------------------------------------------------------------------- : CardsPanel
...
...
@@ -83,7 +84,7 @@ class CardsPanel : public SetWindowPanel {
bool findInValue(const CardP& crd_, virtual const ValueP& value, int firstChar, FindReplaceData& what, const FindHandler& handler);
*/
public:
// --------------------------------------------------- : Selection
virtual
CardP
selectedCard
()
const
;
virtual
void
selectCard
(
const
CardP
&
card
);
...
...
@@ -93,7 +94,7 @@ class CardsPanel : public SetWindowPanel {
wxSplitterWindow
*
splitter
;
DataEditor
*
editor
;
CardListBase
*
card_list
;
// DataTextCtrl*
notes;
TextCtrl
*
notes
;
// --------------------------------------------------- : Menus & tools
wxMenu
*
cardMenu
,
formatMenu
;
...
...
src/gui/set/keywords_panel.cpp
View file @
9dc4c95d
...
...
@@ -7,9 +7,25 @@
// ----------------------------------------------------------------------------- : Includes
#include <gui/set/keywords_panel.hpp>
#include <data/keyword.hpp>
#include <wx/listctrl.h>
// ----------------------------------------------------------------------------- : KeywordsList
/// A control that lists the keywords in a set or game
class
KeywordList
:
public
wxListView
{
public:
KeywordList
(
Window
*
parent
,
int
id
);
/// Set the list of keywords to show
void
setData
(
vector
<
KeywordP
>&
dat
);
bool
canSelectPrevious
()
const
;
bool
canSelectNext
()
const
;
void
selectPrevious
();
void
selectNext
();
};
// ----------------------------------------------------------------------------- : KeywordsPanel
KeywordsPanel
::
KeywordsPanel
(
Window
*
parent
,
int
id
)
...
...
src/gui/value/choice.cpp
View file @
9dc4c95d
...
...
@@ -102,7 +102,8 @@ void ChoiceValueEditor::onLoseFocus() {
drop_down
->
hide
(
false
);
}
void
ChoiceValueEditor
::
drawSelection
(
RotatedDC
&
dc
)
{
void
ChoiceValueEditor
::
draw
(
RotatedDC
&
dc
)
{
ChoiceValueViewer
::
draw
(
dc
);
if
(
nativeLook
())
{
draw_drop_down_arrow
(
&
editor
(),
dc
.
getDC
(),
style
().
getRect
().
grow
(
1
),
drop_down
->
IsShown
());
}
...
...
src/gui/value/choice.hpp
View file @
9dc4c95d
...
...
@@ -28,7 +28,7 @@ class ChoiceValueEditor : public ChoiceValueViewer, public ValueEditor {
virtual
void
onChar
(
wxKeyEvent
&
ev
);
virtual
void
onLoseFocus
();
virtual
void
draw
Selection
(
RotatedDC
&
dc
);
virtual
void
draw
(
RotatedDC
&
dc
);
virtual
void
determineSize
();
private:
...
...
src/gui/value/color.cpp
View file @
9dc4c95d
...
...
@@ -138,7 +138,8 @@ void ColorValueEditor::onLoseFocus() {
drop_down
->
hide
(
false
);
}
void
ColorValueEditor
::
drawSelection
(
RotatedDC
&
dc
)
{
void
ColorValueEditor
::
draw
(
RotatedDC
&
dc
)
{
ColorValueViewer
::
draw
(
dc
);
if
(
nativeLook
())
{
draw_drop_down_arrow
(
&
editor
(),
dc
.
getDC
(),
style
().
getRect
().
grow
(
1
),
drop_down
->
IsShown
());
}
...
...
src/gui/value/color.hpp
View file @
9dc4c95d
...
...
@@ -27,7 +27,7 @@ class ColorValueEditor : public ColorValueViewer, public ValueEditor {
virtual
void
onChar
(
wxKeyEvent
&
ev
);
virtual
void
onLoseFocus
();
virtual
void
draw
Selection
(
RotatedDC
&
dc
);
virtual
void
draw
(
RotatedDC
&
dc
);
virtual
void
determineSize
();
private:
...
...
src/gui/value/editor.hpp
View file @
9dc4c95d
...
...
@@ -99,11 +99,6 @@ class ValueEditor {
virtual
void
determineSize
()
{}
/// The editor is shown or hidden
virtual
void
onShow
(
bool
)
{}
/// Draw selection indicators
/** note: the drawing of the value is done by the viewer, only a selection indicator is drawn here
*/
virtual
void
drawSelection
(
RotatedDC
&
dc
)
{}
};
// ----------------------------------------------------------------------------- : Utility
...
...
src/mse.vcproj
View file @
9dc4c95d
...
...
@@ -585,6 +585,12 @@
<File
RelativePath=
".\gui\control\package_list.hpp"
>
</File>
<File
RelativePath=
".\gui\control\text_ctrl.cpp"
>
</File>
<File
RelativePath=
".\gui\control\text_ctrl.hpp"
>
</File>
</Filter>
<Filter
Name=
"symbol"
...
...
src/util/index_map.hpp
View file @
9dc4c95d
...
...
@@ -53,6 +53,12 @@ class IndexMap : private vector<Value> {
init_object
(
key
,
(
*
this
)[
key
->
index
]);
}
}
/// Change this map by adding an additional key and value
void
add
(
const
Key
&
key
,
const
Value
&
value
)
{
assert
(
get_key
(
value
)
==
key
);
if
(
key
->
index
>=
this
->
size
())
this
->
resize
(
key
->
index
+
1
);
(
*
this
)[
key
->
index
]
=
value
;
}
/// Retrieve a value given its key
inline
Value
operator
[]
(
const
Key
&
key
)
{
...
...
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