PDA

View Full Version : Status Bar Reactor


dkh007.66346
2005-06-20, 04:00 AM
I'm trying to setup an OSMODE reactor. This is for the next version of the Status Bar Buttons. While I'm testing it, I have it ECHO back the current reactor state.


(defun sysv (a b)
(cond ((null *osm*) (setq *osm* (getvar "OSMODE"))))
(cond ((= (car b) "OSMODE")
(if (/= *osm* (getvar "OSMODE"))
(princ (strcat "nCurrent OSMODE: " (itoa (setq *osm* (getvar "OSMODE")))))
)
))
)
(defun C:IOSMODE ()
(vl-load-com)
(setq *osm* (getvar "OSMODE")
*vlrchg* (vlr-sysvar-reactor nil '((:vlr-sysvarwillchange . sysv)))
*vlrsys* (vlr-sysvar-reactor nil '((:vlr-sysvarchanged . sysv)))
)
(princ)
)

But as soon as I put in any code that checks the state of the buttons, it will not click the correct button. Any thoughts on setting a better OSMODE reactor.

RobertB
2005-06-20, 10:48 PM
My question is... what are you really trying to accomplish? I'm drawing a blank on why I would want a reactor attached to OSMode. Too many situations demand different settings, IMHO.

dkh007.66346
2005-06-21, 01:30 AM
My question is... what are you really trying to accomplish? I'm drawing a blank on why I would want a reactor attached to OSMode. Too many situations demand different settings, IMHO.
My thought behind creating the OSMODE reactor is for use with the Status Bar Buttons. This was a wish list (see the Status Bar thread from last week) to have it change if you make any changes in the OSNAP dialog. If there is a better way to have the status bar change, I'm open to suggestions.

noozybkk
2005-06-21, 06:55 AM
Wow, you're still thinking about my little request.

You are very conscientious. Thanks.

dkh007.66346
2005-06-21, 12:51 PM
Wow, you're still thinking about my little request.

You are very conscientious. Thanks.
This has turned out to be a good challenge and an excellent learning opportunity. But reactors is one of those items that I still have a long way to go.

madcadder
2005-06-21, 04:02 PM
My thought behind creating the OSMODE reactor is for use with the Status Bar Buttons. This was a wish list (see the Status Bar thread from last week) to have it change if you make any changes in the OSNAP dialog. If there is a better way to have the status bar change, I'm open to suggestions.
I have a thought. I run a mode macro across the bottom of my screen that tells me:
Last saved time and date,
cmdecho,
groups,
psltscale,
ltscale,
dimescale,
textstyle,

with all that and the little icons from Manusoft my status bar is full (per StatusBarShot.jpg). I could place one icon there; maybe two squeezing the coords a little more.

So to the idea. Button displays osmode number, tool tip displays all the names in a row, right click brings up a menu string that allows you to toggle on/off the selected osnap from the list (using the check marks sim to !. to show the selected snaps per OsnapShot.jpg)

RobertB
2005-06-21, 04:21 PM
My thought behind creating the OSMODE reactor is for use with the Status Bar Buttons. This was a wish list (see the Status Bar thread from last week) to have it change if you make any changes in the OSNAP dialog. If there is a better way to have the status bar change, I'm open to suggestions.Now I understand better. I don't use Owen's stuff, so I can't really help there. However, you haven't shown us what code doesn't work; only the code that does work. Can't really help if we don't see what's broken. ;)

dkh007.66346
2005-06-21, 05:14 PM
Now I understand better. I don't use Owen's stuff, so I can't really help there. However, you haven't shown us what code doesn't work; only the code that does work. Can't really help if we don't see what's broken. ;)
Let me pull something together, that is a functional snippet. The full code is quite involved...

dkh007.66346
2005-06-24, 01:38 PM
I found a work around using the reactor. I just check the state of each OSMODE and then toggle the button. I know this does not mean much with out seeing the rest of the code. When I get a free moment, I'll still put something together. However, version 1.3 is ready for download.


(if (= (logand (getvar "OSMODE") 1) 1)
(vlax-put-property (vl-bb-ref '*SBB:Button_END) 'Pressed :vlax-true)
(vlax-put-property (vl-bb-ref '*SBB:Button_END) 'Pressed :vlax-false)
)