Oops - made a little mistake in the code - Else not on proper line and
toggled the flag twice.

If llToggleState then
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Remove  ID ON_BUTTON_ID
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Add  {Off_button_definition - position same x/y} 
Else
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Remove  ID OFF_BUTTON_ID
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Add  {On_button_definition - position same x/y}
End If
llToggleState = NOT llToggleState

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Terry
McDonnell
Sent: 27 September 2006 11:46
To: Terry McDonnell
Subject: RE: [MI-L] Icon Image Buttons in dialogs

Rakesh

I've been lookimg at this and had thought it would be easier.  The only
way I can see is, in the button's handler routine, to use

If llToggleState then
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Remove  ID ON_BUTTON_ID
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Add  {Off_button_definition - position same x/y) Else
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Remove  ID OFF_BUTTON_ID
        Alter ButtonPad ID PUSH_BUTT_PAD_ID
                Add  {On_button_definition - position same x/y)  
      llToggleState = NOT llToggleState
End If
llToggleState = NOT llToggleState

Thus replacing the button with another one, that with a different icon.
Both toggle buttons share the same handler routine.  If problem then
llToggleState can be used to determine the other actions, specific to
each button (well, actually, whether the button depressed or not).

Maybe set redraw off for this then on again.

Anyway, just a suggestion, and not tested

HTH

Terry McDonnell

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rakesh
Rao
Sent: 26 September 2006 13:46
To: Terry McDonnell
Subject: [MI-L] Icon Image Buttons in dialogs


Hello,

I am trying to build a MapBasic dialog box with icons in Push buttons
which act like toggles. 
One push and it is On and Push again, it is Off. I need to be able to
dynamically change the icon of each button as it is depressed (like in
VB) by changing the bmp's. How do I do this? 
What control I must use?

Any help is appreciated and thanks in advance.

Regards
- Rakesh Rao [ rakesh.rao (at)4d-technologies.com ]
- Four Dimension Technologies
  [www.4d-technologies.com]
- Get GeoTools, Work smarter: www.4d-technologies.com/geotools
- Free Lisp downloads @ TechCenter: www.4d-technologies.com/techcenter
- View GDF files within the AutoCAD environment, Use GDFViewer with
GeoTools
------- End of forwarded message -------

- Rakesh Rao [ rakesh.rao (at)4d-technologies.com ]
- Four Dimension Technologies
  [www.4d-technologies.com]
- Get GeoTools, Work smarter: www.4d-technologies.com/geotools
- Free Lisp downloads @ TechCenter: www.4d-technologies.com/techcenter
- View GDF files in AutoCAD, Get GDFViewer with GeoTools

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l




_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l




_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to