10-02-2006 03:36 AM
10-02-2006 03:45 AM
Hello Mawie,
The callback function is indeed only fired when the user is operating the slide directly.
I suggest you use the function CallCtrlCallback after each line in which you change the slide value to fire the callback function yourself:
SetCtrlVal (pnlHandle, PNL_SLIDE, 100);
CallCtrlCallback (pnlHandle, PNL_SLIDE, EVENT_VAL_CHANGED, 0, 0, NULL);
10-02-2006 03:59 AM
Thanks Wim S,
your solution works fine, thanks.
Unfortunatly I am not the only one who will use this custom control and think that the programmers might forget to add the CallCtrlCallback function after each call of SetCtrlVal.
So if you or anyone else has another solution that helps to keep the usage of my custom control as simple as the use of every other control, I would appreciate.
MaWie
10-02-2006 04:16 AM
I'm afraid you will have to create your own SetCtrlVal function for your control. This is not so uncommon for custom controls. If you use the password control, which is also a custom control, the user will have to use the PasswordCtrl_GetAttribute function to get the password entered by the user, instead of just using the GetCtrlVal function:
PasswordCtrl_GetAttribute (pnlHandle, PNL_PASSWORD, ATTR_PASSWORD_VAL, password_str);
You could write your own function (eg. CustomCtrl_SetCtrlVal) to change the value of the custom slide.
10-02-2006 08:01 AM
Thanks for you help, I think a new function (as in the password control) is a good compromise.