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
2c81e5d4
Commit
2c81e5d4
authored
May 19, 2007
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all card lists share the widths of the columns
parent
ec4829f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
src/gui/control/card_list.cpp
src/gui/control/card_list.cpp
+27
-2
src/gui/control/card_list.hpp
src/gui/control/card_list.hpp
+7
-4
No files found.
src/gui/control/card_list.cpp
View file @
2c81e5d4
...
@@ -28,6 +28,7 @@ DECLARE_TYPEOF_COLLECTION(FieldP);
...
@@ -28,6 +28,7 @@ DECLARE_TYPEOF_COLLECTION(FieldP);
DECLARE_POINTER_TYPE
(
ChoiceValue
);
DECLARE_POINTER_TYPE
(
ChoiceValue
);
DECLARE_TYPEOF
(
map
<
int
COMMA
FieldP
>
);
DECLARE_TYPEOF
(
map
<
int
COMMA
FieldP
>
);
DECLARE_TYPEOF_NO_REV
(
IndexMap
<
FieldP
COMMA
StyleP
>
);
DECLARE_TYPEOF_NO_REV
(
IndexMap
<
FieldP
COMMA
StyleP
>
);
DECLARE_TYPEOF_COLLECTION
(
CardListBase
*
);
// ----------------------------------------------------------------------------- : Events
// ----------------------------------------------------------------------------- : Events
...
@@ -35,12 +36,19 @@ DEFINE_EVENT_TYPE(EVENT_CARD_SELECT);
...
@@ -35,12 +36,19 @@ DEFINE_EVENT_TYPE(EVENT_CARD_SELECT);
// ----------------------------------------------------------------------------- : CardListBase
// ----------------------------------------------------------------------------- : CardListBase
vector
<
CardListBase
*>
CardListBase
::
card_lists
;
CardListBase
::
CardListBase
(
Window
*
parent
,
int
id
,
long
additional_style
)
CardListBase
::
CardListBase
(
Window
*
parent
,
int
id
,
long
additional_style
)
:
ItemList
(
parent
,
id
,
additional_style
)
:
ItemList
(
parent
,
id
,
additional_style
)
{}
{
// add to the list of card lists
card_lists
.
push_back
(
this
);
}
CardListBase
::~
CardListBase
()
{
CardListBase
::~
CardListBase
()
{
storeColumns
();
storeColumns
();
// remove from list of card lists
card_lists
.
erase
(
remove
(
card_lists
.
begin
(),
card_lists
.
end
(),
this
));
}
}
void
CardListBase
::
onBeforeChangeSet
()
{
void
CardListBase
::
onBeforeChangeSet
()
{
...
@@ -245,7 +253,12 @@ void CardListBase::storeColumns() {
...
@@ -245,7 +253,12 @@ void CardListBase::storeColumns() {
void
CardListBase
::
selectColumns
()
{
void
CardListBase
::
selectColumns
()
{
CardListColumnSelectDialog
wnd
(
this
,
set
->
game
);
CardListColumnSelectDialog
wnd
(
this
,
set
->
game
);
if
(
wnd
.
ShowModal
()
==
wxID_OK
)
{
if
(
wnd
.
ShowModal
()
==
wxID_OK
)
{
rebuild
();
// columns have changed
// rebuild all card lists for this game
FOR_EACH
(
card_list
,
card_lists
)
{
if
(
card_list
->
set
&&
card_list
->
set
->
game
==
set
->
game
)
{
card_list
->
rebuild
();
}
}
}
}
}
}
...
@@ -281,6 +294,16 @@ void CardListBase::onColumnRightClick(wxListEvent&) {
...
@@ -281,6 +294,16 @@ void CardListBase::onColumnRightClick(wxListEvent&) {
m
->
Append
(
ID_SELECT_COLUMNS
,
_
(
"&Select Columns..."
),
_
(
"Select what columns should be shown and in what order."
));
m
->
Append
(
ID_SELECT_COLUMNS
,
_
(
"&Select Columns..."
),
_
(
"Select what columns should be shown and in what order."
));
PopupMenu
(
m
);
PopupMenu
(
m
);
}
}
void
CardListBase
::
onColumnResize
(
wxListEvent
&
ev
)
{
storeColumns
();
int
col
=
ev
.
GetColumn
();
int
width
=
GetColumnWidth
(
col
);
FOR_EACH
(
card_list
,
card_lists
)
{
if
(
card_list
!=
this
&&
card_list
->
set
&&
card_list
->
set
->
game
==
set
->
game
)
{
card_list
->
SetColumnWidth
(
col
,
width
);
}
}
}
void
CardListBase
::
onSelectColumns
(
wxCommandEvent
&
)
{
void
CardListBase
::
onSelectColumns
(
wxCommandEvent
&
)
{
selectColumns
();
selectColumns
();
...
@@ -335,6 +358,8 @@ void CardListBase::onContextMenu(wxContextMenuEvent&) {
...
@@ -335,6 +358,8 @@ void CardListBase::onContextMenu(wxContextMenuEvent&) {
BEGIN_EVENT_TABLE
(
CardListBase
,
ItemList
)
BEGIN_EVENT_TABLE
(
CardListBase
,
ItemList
)
EVT_LIST_COL_RIGHT_CLICK
(
wxID_ANY
,
CardListBase
::
onColumnRightClick
)
EVT_LIST_COL_RIGHT_CLICK
(
wxID_ANY
,
CardListBase
::
onColumnRightClick
)
EVT_LIST_COL_DRAGGING
(
wxID_ANY
,
CardListBase
::
onColumnResize
)
EVT_LIST_COL_END_DRAG
(
wxID_ANY
,
CardListBase
::
onColumnResize
)
EVT_CHAR
(
CardListBase
::
onChar
)
EVT_CHAR
(
CardListBase
::
onChar
)
EVT_MOTION
(
CardListBase
::
onDrag
)
EVT_MOTION
(
CardListBase
::
onDrag
)
EVT_MENU
(
ID_SELECT_COLUMNS
,
CardListBase
::
onSelectColumns
)
EVT_MENU
(
ID_SELECT_COLUMNS
,
CardListBase
::
onSelectColumns
)
...
...
src/gui/control/card_list.hpp
View file @
2c81e5d4
...
@@ -112,17 +112,20 @@ class CardListBase : public ItemList, public SetView {
...
@@ -112,17 +112,20 @@ class CardListBase : public ItemList, public SetView {
/// Find the field that determines the color, if any.
/// Find the field that determines the color, if any.
ChoiceFieldP
findColorField
();
ChoiceFieldP
findColorField
();
/// Store the column sizes in the settings
void
storeColumns
();
public:
public:
/// Open a dialog for selecting columns to be shown
/// Open a dialog for selecting columns to be shown
void
selectColumns
();
void
selectColumns
();
private:
private:
/// Store the column sizes in the settings
void
storeColumns
();
/// All card lists; used to exchange column sizes
static
vector
<
CardListBase
*>
card_lists
;
// --------------------------------------------------- : Window events
// --------------------------------------------------- : Window events
DECLARE_EVENT_TABLE
();
DECLARE_EVENT_TABLE
();
void
onColumnRightClick
(
wxListEvent
&
ev
);
void
onColumnRightClick
(
wxListEvent
&
ev
);
void
onColumnResize
(
wxListEvent
&
ev
);
void
onSelectColumns
(
wxCommandEvent
&
ev
);
void
onSelectColumns
(
wxCommandEvent
&
ev
);
void
onChar
(
wxKeyEvent
&
ev
);
void
onChar
(
wxKeyEvent
&
ev
);
void
onDrag
(
wxMouseEvent
&
ev
);
void
onDrag
(
wxMouseEvent
&
ev
);
...
...
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