Print Page | Close Window

Task Panel Group click event?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=16559
Printed Date: 28 April 2024 at 2:30pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Task Panel Group click event?
Posted By: pate
Subject: Task Panel Group click event?
Date Posted: 07 April 2010 at 11:35am
Hi All,
 
In task Panel, is there some way to detect a click on a Group header?  All I can see is an ItemClick event.  I want to close the other groups that are open when I expand another one.  The only way I have found to detect this is the wndTaskPanel_GroupExpanded event, but when I set the other groups to Expanded = False from that sub, they in turn call this same routine and it gets stuck in a recursive loop.  I have implemented a workaround with a form level boolean to exit the sub at the top while this is going on, but there has to be an easier way than this.  Any ideas?
 
-Melvyn
 
VB6
CodeJock 13.2.1



Replies:
Posted By: jpbro
Date Posted: 07 April 2010 at 1:09pm
There may be better events to use (I'm not sure, I don't use the TaskPanel), but you can prevent the recursion from causing problems as follows:


Static s_Changing As Boolean

If Not s_Changing Then
   s_Changing = True

   ' Change your expanded property here

   s_Changing = False
End If



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: pate
Date Posted: 07 April 2010 at 1:24pm
Thanks for the reply.  Yes, that is prtty much what I am doing now, just with a global variable instead of a static variable but works the same.  Seems like a real good place for a new event (GroupClick) or a new property (ExpandSelectedGroupOnly).
 
-Melvyn


Posted By: Carlos Rocha
Date Posted: 07 April 2010 at 6:15pm
https://forum.codejock.com/forum_posts.asp?TID=9980 - https://forum.codejock.com/forum_posts.asp?TID=9980

-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8


Posted By: pate
Date Posted: 08 April 2010 at 1:48am
CodeJock, what say you?  I know it is not a sexy feature, but I think it is really needed to be able to use this control effectively.
 
-Melvyn


Posted By: jpbro
Date Posted: 08 April 2010 at 2:19pm
I agree that more events are necessary - maybe you would like to start a sticky TODO list for the TaskPanel control?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Baldur
Date Posted: 14 May 2010 at 5:29am
To prevent recursion, you have to check the current state first.
If the current state is the correct state, don't change it to the same state again. This will call recursivly the events.
This happens not only to codejock-controls.
 
if mycontrols.state <> wantedstate then
   mycontrols.state = wantedstate
end if
 
in this case, the recursion doesn't matter.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net