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
2ac0ffef
Commit
2ac0ffef
authored
Dec 22, 2006
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perliminaries for filtered card list
parent
10b581f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
src/gui/control/graph.cpp
src/gui/control/graph.cpp
+14
-0
src/gui/control/graph.hpp
src/gui/control/graph.hpp
+7
-0
src/gui/set/stats_panel.cpp
src/gui/set/stats_panel.cpp
+19
-0
No files found.
src/gui/control/graph.cpp
View file @
2ac0ffef
...
...
@@ -14,6 +14,7 @@
DECLARE_TYPEOF_COLLECTION
(
GraphAxisP
);
DECLARE_TYPEOF_COLLECTION
(
GraphElementP
);
DECLARE_TYPEOF_COLLECTION
(
GraphGroup
);
DECLARE_TYPEOF_COLLECTION
(
int
);
typedef
map
<
String
,
UInt
>
map_String_UInt
;
DECLARE_TYPEOF
(
map_String_UInt
);
...
...
@@ -257,6 +258,19 @@ void GraphControl::onMouseDown(wxMouseEvent& ev) {
}
}
bool
GraphControl
::
hasSelection
(
size_t
axis
)
const
{
return
current_item
.
size
()
>=
axis
&&
current_item
[
axis
]
>=
0
;
}
void
GraphControl
::
getSelection
(
vector
<
String
>&
out
)
const
{
out
.
clear
();
if
(
!
graph
)
return
;
FOR_EACH_2_CONST
(
i
,
current_item
,
a
,
graph
->
getData
().
axes
)
{
if
(
i
>=
0
)
{
out
.
push_back
((
size_t
)
i
<
a
->
groups
.
size
()
?
a
->
groups
[
i
].
name
:
wxEmptyString
);
}
}
}
BEGIN_EVENT_TABLE
(
GraphControl
,
wxControl
)
EVT_PAINT
(
GraphControl
::
onPaint
)
EVT_SIZE
(
GraphControl
::
onSize
)
...
...
src/gui/control/graph.hpp
View file @
2ac0ffef
...
...
@@ -90,6 +90,8 @@ class Graph {
virtual
bool
findItem
(
const
RealPoint
&
pos
,
const
RealRect
&
rect
,
vector
<
int
>&
out
)
const
{
return
false
;
}
/// Change the data
virtual
void
setData
(
const
GraphDataP
&
d
)
{
data
=
d
;
}
/// Get the data
inline
const
GraphData
&
getData
()
const
{
return
*
data
;
}
protected:
/// Data of the graph
...
...
@@ -162,6 +164,11 @@ class GraphControl : public wxControl {
/// Update the data in the graph
void
setData
(
const
GraphDataP
&
data
);
/// Is there a selection on the given axis?
bool
hasSelection
(
size_t
axis
)
const
;
/// Get the current item, returns the selected value on each axis in out
void
getSelection
(
vector
<
String
>&
out
)
const
;
private:
/// Graph object
GraphP
graph
;
...
...
src/gui/set/stats_panel.cpp
View file @
2ac0ffef
...
...
@@ -18,6 +18,7 @@
#include <wx/splitter.h>
DECLARE_TYPEOF_COLLECTION
(
StatsDimensionP
);
DECLARE_TYPEOF_COLLECTION
(
String
);
DECLARE_TYPEOF_COLLECTION
(
CardP
);
// ----------------------------------------------------------------------------- : StatCategoryList
...
...
@@ -131,6 +132,24 @@ void StatsPanel::onCommand(int id) {
}
}
class
StatsFilter
:
public
CardListFilter
{
public:
StatsFilter
(
Set
&
set
,
const
vector
<
StatsDimensionP
>&
dims
,
const
vector
<
String
>&
values
)
:
set
(
set
),
dims
(
dims
),
values
(
values
)
{}
virtual
bool
keep
(
const
CardP
&
card
)
{
Context
&
ctx
=
set
.
getContext
(
card
);
FOR_EACH_2
(
d
,
dims
,
v
,
values
)
{
if
(
*
d
->
script
.
invoke
(
ctx
)
!=
v
)
return
false
;
}
return
true
;
}
private:
Set
&
set
;
vector
<
StatsDimensionP
>
dims
;
vector
<
String
>
values
;
};
// ----------------------------------------------------------------------------- : Selection
CardP
StatsPanel
::
selectedCard
()
const
{
...
...
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