Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

TreeView state-icon size & removal of blank space of state-icon

dushyant
Enthusiast

Hi

I'm trying to remove the gap between the normal-icon and the arrow(collapse/expand) icon of a treeView item. If I don't set the state-icon, there appears a blank space creating a gap. I tried setting a state-icon and then setting its size to zero, but that did not help.

treeView.SetItemStateIcon(treeItemIndex, DG::Icon (ACAPI_GetOwnResModule(), (short) DashIconId));
treeView.SetStateIconSize(0, 0); // omit state icon by setting its size to zero

 

How can I avoid the state-icon and get rid of that blank space?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Please try to set the icon sizes in the grc file like so:

SingleSelTreeView 10 10 100 100 LargePlain 18 18 0 0 noLabelEdit noDragDrop 0.

Here 18 18 are the normal icon sizes and 0 0 are state icon sizes.

View solution in original post

4 REPLIES 4
Miklos Vegh
Graphisoft
Graphisoft

Hi try to set the empty icon as the state icon of the treeview control.

treeView.SetItemStateIcon(treeItemIndex, DG::Icon ());
treeView.SetStateIconSize(0, 0);

DG::Icon has an empty constructor that sets the iconId to DG_NO_ICON.

@Miklos Vegh  That did not help.. No change.. The same gap appears.

Solution

Please try to set the icon sizes in the grc file like so:

SingleSelTreeView 10 10 100 100 LargePlain 18 18 0 0 noLabelEdit noDragDrop 0.

Here 18 18 are the normal icon sizes and 0 0 are state icon sizes.

Yes, that worked! 🙂

Thanks a lot!