We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-06-29 08:19 PM - last edited on 2021-09-14 09:30 AM by Noemi Balogh
2021-10-06 06:02 PM
Hi, the best way to show checkboxes on the listbox lines is to set the special icons defined in DGListBox.hpp with the ListBox::SetTabItemIcon (short listItem, short tabIndex, const DG::Icon& icon) member function. You can use these type of check icons:
enum SpecialIcons {
NoIcon = DG_NO_ICON,
DragIcon = DG_LIST_DRAGICON,
CheckedIcon = DG_LIST_CHECKEDICON,
UncheckedIcon = DG_LIST_UNCHECKEDICON,
MixedCheckedIcon = DG_LIST_MIXEDCHECKEDICON,
GrayCheckedIcon = DG_LIST_GRAYCHECKEDICON,
GrayUncheckedIcon = DG_LIST_GRAYUNCHECKEDICON,
GrayMixedCheckedIcon = DG_LIST_GRAYMIXEDCHECKEDICON,
FramelessCheckIcon = DG_LIST_FRAMELESSCHECKICON,
FramelessGrayCheckIcon = DG_LIST_FRAMELESSGRAYCHECKICON
};
Whenever the data changes, the corresponding icon should be set on the tabfield.
On a click event the dialog can determine from the click position whether the icon was clicked or not.
Here is an example:
list.SetTabItemIcon (rowIndex, checkColumn, DG::Icon (SysResModule, DG::ListBox::CheckedIcon));
Putting a checkbox item on the list row with the SetOnTabItem member function is not advised, because the checkbox controls have some background colored frame around which result a bit ugly lookout.