LazyCoder Posted July 6, 2005 Posted July 6, 2005 Hello, As many people here I wanted to create an easy multi-select treeview. Maybe that's not the best way to do it (should I use several checkboxes?), but never mind, I think my problem is interesting anyway. Read and test my following test script and do the following: 1 - Try by making your selections using the mouse only: everything's alright 2 - Try making your selections using the keyboard only (arrows keys to switch between checkboxes and space key to validate): problem are coming Moreover versions v3.1.0.14 and v3.1.1.56 do behave differently in case 2)... Is that a bug for you or is my chec/uncheck management so strange?Test_MultiCheckbx.au3 A good program computing A into B is mostly one that won't crash in all the other cases...
GaryFrost Posted July 6, 2005 Posted July 6, 2005 When you move to item using keyboard the item gets focus and hasn't been checked yet and your else statement checks at that time. Case Else For $iIndex2 = 0 To 6 If ($iMsg = $agItem[$iIndex2]) Then If (BitAND(GuiCtrlRead($agItem[$iIndex2]), $GUI_CHECKED)) Then GUICtrlSetState($gOk, $GUI_ENABLE) $iState = $iState + 2^$iIndex2 $iChoices = $iChoices + 1 Else $iState = $iState - 2^$iIndex2 $iChoices = $iChoices - 1 If ($iState = 0) Then GUICtrlSetState($gOk, $GUI_DISABLE) EndIf EndIf ExitLoop EndIf Next SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
LazyCoder Posted July 6, 2005 Author Posted July 6, 2005 You're absolutely right I knew that but I let it that way for the differences of behavior between v3.1.1.0 (I made a mistake earlier) and v3.1.1.56 to be more obvious.My point was not this but the following (I should have been more accurate):For case 2), with v3.1.1.56:- Launch the script and press TAB key twice => 1st element has the focus- Press TAB key twice again => you graphically have the focus again BUT $iMsg <> $agItem[$iIndex2] ???How can that be you receive no message?Well, anyway, for those who need a multi-selector, here is mine...Note that in v3.1.1.0, this only really work using the mouse!Enjoy.Test_MultiCheckbxOK.au3 A good program computing A into B is mostly one that won't crash in all the other cases...
Holger Posted July 6, 2005 Posted July 6, 2005 (edited) Just a small pre-information:The first event on a treeitem comes up cause then this item is the first time _selected_.A general monitoring for a focus-change (focus-setting/killing) on a treeview is not implemented yet.Maybe I can change this 'first-selected-event-fire-on-tab-changing' or delete it.I will check it out now...So long HolgerEdit: Ok, the first 'false' focusing message can be deleted.There is an undocumented value to check for this ( I hate these undocumented things *g* ok, do such things too Edited July 6, 2005 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now