Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
einsteinathome
boinc
Commits
cd20b762
Commit
cd20b762
authored
Oct 14, 2015
by
Charlie Fenton
Browse files
MGR: Fix Select Columns dialog so it preserves column order
parent
1a9fc11f
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientgui/DlgHiddenColumns.cpp
View file @
cd20b762
...
...
@@ -141,7 +141,7 @@ CDlgHiddenColumns::~CDlgHiddenColumns() {
void
CDlgHiddenColumns
::
CreateCheckboxes
()
{
int
i
,
stdCount
,
actualCount
;
int
i
,
j
,
stdCount
,
actualCount
;
bool
val
;
CAdvancedFrame
*
pFrame
=
(
CAdvancedFrame
*
)
GetParent
();
wxASSERT
(
wxDynamicCast
(
pFrame
,
CAdvancedFrame
));
...
...
@@ -182,16 +182,48 @@ void CDlgHiddenColumns::CreateCheckboxes() {
wxStaticBoxSizer
*
tabStaticBoxSizer
=
new
wxStaticBoxSizer
(
tabStaticBox
,
wxVERTICAL
);
wxGridSizer
*
checkboxSizer
=
new
wxGridSizer
(
2
,
wxSize
(
0
,
3
));
CBOINCListCtrl
*
listCtrl
=
pView
->
GetListCtrl
();
wxInt32
iShownColumnCount
=
listCtrl
->
GetColumnCount
();
wxString
strHiddenColumns
;
wxArrayInt
aOrder
(
iShownColumnCount
);
#ifdef wxHAS_LISTCTRL_COLUMN_ORDER
aOrder
=
listCtrl
->
GetColumnsOrder
();
#else
for
(
i
=
0
;
i
<
iShownColumnCount
;
++
i
)
{
aOrder
[
i
]
=
i
;
}
#endif
// Create checkboxes for shown columns in current column order
stdCount
=
pView
->
m_aStdColNameOrder
->
GetCount
();
for
(
i
=
0
;
i
<
iShownColumnCount
;
++
i
)
{
wxString
columnLabel
=
pView
->
m_aStdColNameOrder
->
Item
(
pView
->
m_iColumnIndexToColumnID
[
aOrder
[
i
]]);
wxCheckBox
*
ckbox
=
new
wxCheckBox
(
tabStaticBox
,
wxID_ANY
,
columnLabel
);
checkboxSizer
->
Add
(
ckbox
,
0
,
wxLEFT
,
25
);
val
=
false
;
ckbox
->
SetValue
(
true
);
checkbox_list
->
push_back
(
ckbox
);
}
// Create checkboxes for hidden columns
for
(
i
=
0
;
i
<
stdCount
;
++
i
)
{
bool
found
=
false
;
for
(
j
=
0
;
j
<
iShownColumnCount
;
++
j
)
{
if
(
pView
->
m_iColumnIndexToColumnID
[
aOrder
[
j
]]
==
i
)
{
found
=
true
;
break
;
}
}
if
(
found
)
continue
;
wxString
columnLabel
=
pView
->
m_aStdColNameOrder
->
Item
(
i
);
wxCheckBox
*
ckbox
=
new
wxCheckBox
(
tabStaticBox
,
wxID_ANY
,
columnLabel
);
checkboxSizer
->
Add
(
ckbox
,
0
,
wxLEFT
,
25
);
val
=
false
;
if
(
pView
->
m_iColumnIDToColumnIndex
[
i
]
>=
0
)
val
=
true
;
ckbox
->
SetValue
(
val
);
ckbox
->
SetValue
(
false
);
checkbox_list
->
push_back
(
ckbox
);
}
m_checkbox_list
.
push_back
(
checkbox_list
);
tabStaticBoxSizer
->
Add
(
checkboxSizer
,
0
,
wxEXPAND
,
1
);
...
...
Write
Preview
Supports
Markdown
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