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
b07ce1a2
Commit
b07ce1a2
authored
Aug 04, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweaks to dimension list control
parent
ce99e785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
src/gui/control/gallery_list.cpp
src/gui/control/gallery_list.cpp
+6
-3
src/gui/set/stats_panel.cpp
src/gui/set/stats_panel.cpp
+25
-7
No files found.
src/gui/control/gallery_list.cpp
View file @
b07ce1a2
...
@@ -44,11 +44,14 @@ void GalleryList::selectColumn(size_t column) {
...
@@ -44,11 +44,14 @@ void GalleryList::selectColumn(size_t column) {
void
GalleryList
::
select
(
size_t
item
,
size_t
column
,
bool
event
)
{
void
GalleryList
::
select
(
size_t
item
,
size_t
column
,
bool
event
)
{
if
(
item
>=
itemCount
())
return
;
if
(
item
>=
itemCount
())
return
;
// select
// select
column
bool
changes
=
false
;
size_t
old_active_column
=
active_column
;
selectColumn
(
column
);
selectColumn
(
column
);
onSelect
(
item
,
active_column
,
changes
);
Column
&
col
=
columns
[
active_column
];
Column
&
col
=
columns
[
active_column
];
// filter?
bool
changes
=
col
.
selection
!=
item
;
onSelect
(
item
,
old_active_column
,
changes
);
// select
size_t
old_sel
=
col
.
selection
;
size_t
old_sel
=
col
.
selection
;
col
.
selection
=
item
;
col
.
selection
=
item
;
changes
|=
col
.
selection
!=
old_sel
;
changes
|=
col
.
selection
!=
old_sel
;
...
...
src/gui/set/stats_panel.cpp
View file @
b07ce1a2
...
@@ -144,6 +144,12 @@ class StatDimensionList : public GalleryList {
...
@@ -144,6 +144,12 @@ class StatDimensionList : public GalleryList {
const
int
dimension_count
;
const
int
dimension_count
;
size_t
prefered_dimension_count
;
size_t
prefered_dimension_count
;
void
restrictDimensions
(
size_t
dims
)
{
prefered_dimension_count
=
dims
;
active_column
=
min
(
active_column
,
dims
);
RefreshSelection
();
}
protected:
protected:
virtual
size_t
itemCount
()
const
;
virtual
size_t
itemCount
()
const
;
virtual
void
drawItem
(
DC
&
dc
,
int
x
,
int
y
,
size_t
item
);
virtual
void
drawItem
(
DC
&
dc
,
int
x
,
int
y
,
size_t
item
);
...
@@ -152,19 +158,32 @@ class StatDimensionList : public GalleryList {
...
@@ -152,19 +158,32 @@ class StatDimensionList : public GalleryList {
return
col
-
1
>=
prefered_dimension_count
?
0.2
:
0.7
;
return
col
-
1
>=
prefered_dimension_count
?
0.2
:
0.7
;
}
}
virtual
void
onSelect
(
size_t
item
,
size_t
col
,
bool
&
changes
)
{
virtual
void
onSelect
(
size_t
item
,
size_t
old_
col
,
bool
&
changes
)
{
// swap selection with another column?
// swap selection with another column?
for
(
size_t
j
=
1
;
j
<
columns
.
size
()
;
++
j
)
{
for
(
size_t
j
=
1
;
j
<
columns
.
size
()
;
++
j
)
{
if
(
j
!=
col
&&
columns
[
j
].
selection
=
=
item
)
{
if
(
j
!=
active_column
&&
columns
[
j
].
selection
==
item
&&
columns
[
active_column
].
selection
!
=
item
)
{
columns
[
j
].
selection
=
columns
[
col
].
selection
;
columns
[
j
].
selection
=
columns
[
active_column
].
selection
;
changes
=
true
;
changes
=
true
;
break
;
break
;
}
}
}
}
// update prefered dimension count?
// update prefered dimension count?
if
(
col
>
prefered_dimension_count
)
{
if
(
active_column
>
prefered_dimension_count
)
{
prefered_dimension_count
=
col
;
prefered_dimension_count
=
active_column
;
changes
=
true
;
changes
=
true
;
RefreshSelection
();
}
// decrease dimension count? (toggle last dimension)
if
(
!
changes
&&
old_col
==
active_column
)
{
if
(
active_column
==
prefered_dimension_count
&&
prefered_dimension_count
>
1
)
{
prefered_dimension_count
-=
1
;
selectColumn
(
prefered_dimension_count
);
changes
=
true
;
}
else
if
(
active_column
!=
prefered_dimension_count
)
{
active_column
=
prefered_dimension_count
=
active_column
;
RefreshSelection
();
changes
=
true
;
}
}
}
}
}
...
@@ -490,9 +509,8 @@ void StatsPanel::showLayout(GraphType layout) {
...
@@ -490,9 +509,8 @@ void StatsPanel::showLayout(GraphType layout) {
#if USE_DIMENSION_LISTS && !USE_SEPARATE_DIMENSION_LISTS
#if USE_DIMENSION_LISTS && !USE_SEPARATE_DIMENSION_LISTS
// make sure we have the right number of data dimensions
// make sure we have the right number of data dimensions
if
(
dimensions
->
prefered_dimension_count
!=
dimensionality
(
layout
))
{
if
(
dimensions
->
prefered_dimension_count
!=
dimensionality
(
layout
))
{
dimensions
->
prefered_dimension_count
=
dimensionality
(
layout
);
dimensions
->
restrictDimensions
(
dimensionality
(
layout
)
);
showCategory
(
&
layout
);
// full update
showCategory
(
&
layout
);
// full update
dimensions
->
RefreshSelection
();
return
;
return
;
}
}
#endif
#endif
...
...
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