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
aa7322b1
Commit
aa7322b1
authored
Aug 02, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some provisions for sorting card list by multiple columns
parent
c11bcc1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/gui/control/card_list.cpp
src/gui/control/card_list.cpp
+8
-2
No files found.
src/gui/control/card_list.cpp
View file @
aa7322b1
...
...
@@ -187,8 +187,13 @@ bool CardListBase::compareItems(void* a, void* b) const {
FieldP
sort_field
=
column_fields
[
sort_by_column
];
ValueP
va
=
reinterpret_cast
<
Card
*>
(
a
)
->
data
[
sort_field
];
ValueP
vb
=
reinterpret_cast
<
Card
*>
(
b
)
->
data
[
sort_field
];
if
(
!
va
||
!
vb
)
return
va
<
vb
;
// got to do something, compare pointers
return
smart_less
(
va
->
getSortKey
(),
vb
->
getSortKey
()
);
if
(
!
va
||
!
vb
)
return
va
<
vb
;
// got to do something, compare pointers
// compare sort keys
int
cmp
=
smart_compare
(
va
->
getSortKey
(),
vb
->
getSortKey
()
);
if
(
cmp
!=
0
)
return
cmp
<
0
;
// equal values, compare alternate sort key
// TODO: sort by a second column
return
false
;
}
void
CardListBase
::
rebuild
()
{
...
...
@@ -265,6 +270,7 @@ void CardListBase::selectColumns() {
CardListColumnSelectDialog
wnd
(
this
,
set
->
game
);
if
(
wnd
.
ShowModal
()
==
wxID_OK
)
{
// rebuild all card lists for this game
storeColumns
();
FOR_EACH
(
card_list
,
card_lists
)
{
if
(
card_list
->
set
&&
card_list
->
set
->
game
==
set
->
game
)
{
card_list
->
rebuild
();
...
...
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