Jump to content

Recommended Posts

Posted

How to set a tree item state disable?

$tv     = GUICtrlCreateTreeView(10, 10, 200, 200, BitOr($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_HASLINES, $TVS_HASLINES, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES))
$tvitem1    = GUICtrlCreateTreeViewItem('Item1', $tv)
$tvitem2    = GUICtrlCreateTreeViewItem('Item2', $tvitem1)
$tvitem3    = GUICtrlCreateTreeViewItem('Item3', $tvitem1)
GUICtrlSetState($tvitem1, $GUI_EXPAND)
GUICtrlSetState($tvitem2, BitOR($GUI_DISABLE, $GUI_CHECKED))
GUICtrlSetState($tvitem3, BitOR($GUI_DISABLE, $GUI_UNCHECKED))

 

Posted

@musicstashall  That is an interesting enigma.  I didn't find any easy way to disable a tree view item beside deleting it.  So I started to figure a way to simulate a disable item and it is working quite good so far.  The idea is to keep an array of the items in the Tree View that says if the item is disabled or not.  When you disable an item you can grey it out by setting a grey color.  If you click on a disabled item, you set the selection to the current (or the last) enable item and skip the action of the disabled item.  I'll work more on it tomorrow.  But you could start by your own so we could compare our results :)

Posted (edited)

Ya seen it also.  Didn't find it appropriate to all situation either.  Just curious, how did you manage to simulate it ?  Would you show a basic script of yours ?

In any case, good scripting !

ps.  also curious about when/how you need to disable item.  Are you doing it only programmaticaly under some situations ?

Edited by Nine

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...