Page 1 of 1

PostPosted: Tue Apr 17, 2001 11:53 pm
by Velvis
I am using Ccontrols and was wondering if there is a way to have a dropdown control start already open, or simulate a pen tap on the control to make it drop down.

Any ideas?


PostPosted: Wed Apr 18, 2001 1:25 am
by stephane
You can make it drop down by borrowing a bit of code from the dropdown event handler, (function Chd() in Ccontrols2.c):
<pre id=code><font face=courier size=2 id=code>saveg();
Cdrp( hd1 ); // draw the dropdown list and select from it
Cdrt( hd1 ); // update the dropdown selection text</font id=code></pre id=code>
where hd1 is the handle of your dropdown control.

If you really need to draw the list without handling, take a look at the Cdrp() function, also in ccontrols2.c .



PostPosted: Wed Apr 18, 2001 10:19 am
by Velvis
When I use this method, it sets the dropdown but it doesnt use the choice I make. (ie I have a dropdown that when selected runs code) is this possible?

Thanks for your help.

PostPosted: Wed Apr 18, 2001 10:35 am
by Velvis
Nevermind, I figured it out. Thanks for your help.

PostPosted: Wed Apr 18, 2001 11:34 am
by stephane
Could you post what you did to resolve your problem, so others could benefit?



PostPosted: Wed Apr 18, 2001 1:32 pm
by Velvis
I was thinking of sharing it, but then figured it was so obvious... That only I wouldnt have known how to do it..

All I did was call the handler by adding:

to make the dropdown "work" simulating the result of tapping the dropdown