Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pop-Up Toolbars?

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
174 Views, 11 Replies

Pop-Up Toolbars?

Okay, so I like toolbars. I just don't like them being at the far edges of
my 22" monitor. Nor do I like moving them out of the way all the time. So
I'm trying to make pop-up toolbars. So far I can get them to pop up with
key commands like Ctrl+D for dimensions then Ctrl+D+X to make them go away
again. (This would probably be more elegant in VB...)

Anyway here are my questions: In LISP - is it possible to capture the
current coordinates of the crosshairs so I can pass this to the "Show
Toolbar"?

And am I reinventing the wheel? Is there something already out there as
freeware or shareware that does the pop-up thing?


TIA


Paul
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

Try AutoSpeed 2000 (or 2002) from Hagerman and Associates. It's a fully
cusomizable "pop-up" menu that works from a hot key or third mouse button.
It's saved me a lot of space on my screen and works great. A little pricey
but I think it's one of the best productivity tools I've come across. Plus
there's a few cool tools that are built in, like dimensions, mechanical and
architectural routines.

Good luck,

- Tom C.

http://www.hagerman.com/TSM/autospeed.htm





"pkirill" wrote in message
news:D0BA870C236912E5E4963FAF39F7E2BC@in.WebX.maYIadrTaRb...
> Okay, so I like toolbars. I just don't like them being at the far edges
of
> my 22" monitor. Nor do I like moving them out of the way all the time.
So
> I'm trying to make pop-up toolbars. So far I can get them to pop up with
> key commands like Ctrl+D for dimensions then Ctrl+D+X to make them go away
> again. (This would probably be more elegant in VB...)
>
> Anyway here are my questions: In LISP - is it possible to capture the
> current coordinates of the crosshairs so I can pass this to the "Show
> Toolbar"?
>
> And am I reinventing the wheel? Is there something already out there as
> freeware or shareware that does the pop-up thing?
>
>
> TIA
>
>
> Paul
>
>
Message 2 of 12
Anonymous
in reply to: Anonymous

Paul,

I have not seen that... maybe...

Here is something that I started:

(defun popup_toolbar (menu tbname / pt left top tmp obj)
(setq pt (getpoint "\nToolbar location: "))
(setq left (fix (* (car pt)
(/ (cadr (getvar "screensize"))
(getvar "viewsize")))))
(setq top (fix (* (cadr pt)
(/ (cadr (getvar "screensize"))
(getvar "viewsize")))))
(vlax-for toolbar
(vla-get-toolbars
(vla-item (vla-get-menugroups (vlax-get-acad-object))
menu))
(setq tmp
(cons (list (strcase (vla-get-name toolbar)) toolbar) tmp)))
(setq obj (cadr (assoc (strcase tbname) tmp)))
(vla-put-visible obj :vlax-true)
(vla-put-left obj left)
(vla-put-top obj top)
(princ))

(defun c:test () (popup_toolbar "ACAD" "INSERT"))

The location is not very accurate but I'm only testing, maybe next what we
can do is to add this inside of a right click reactor and by passing the
cursor position.

Luis.
Message 4 of 12
Anonymous
in reply to: Anonymous

can I download it?
I dont see the link, just a mail request.


"Tom C." wrote in message
news:0F370174E2B7C3C95A4EBE2EE1E5F02C@in.WebX.maYIadrTaRb...
> Try AutoSpeed 2000 (or 2002) from Hagerman and Associates. It's a fully
> cusomizable "pop-up" menu that works from a hot key or third mouse button.
> It's saved me a lot of space on my screen and works great. A little
pricey
> but I think it's one of the best productivity tools I've come across.
Plus
> there's a few cool tools that are built in, like dimensions, mechanical
and
> architectural routines.
>
> Good luck,
>
> - Tom C.
>
> http://www.hagerman.com/TSM/autospeed.htm
>
>
>
>
>
Message 5 of 12
Anonymous
in reply to: Anonymous

Wow that's pretty intense. I was just going to use
(command "-toolbar" TBNAME "S" "F" <# rows here>)
and then put
(command "-toolbar" TBNAME "H")
in the buttons on said toolbar to give me an "autohide".

I tried your routine and it works perfectly except the toolbar comes in way
to the lower right of where I click - often off the screen.


"Luis Esquivel" wrote in message
news:CED2589B013632056AB465EAA89A4A51@in.WebX.maYIadrTaRb...
> Paul,
>
> I have not seen that... maybe...
>
> Here is something that I started:
>
> (defun popup_toolbar (menu tbname / pt left top tmp obj)
> (setq pt (getpoint "\nToolbar location: "))
> (setq left (fix (* (car pt)
> (/ (cadr (getvar "screensize"))
> (getvar "viewsize")))))
> (setq top (fix (* (cadr pt)
> (/ (cadr (getvar "screensize"))
> (getvar "viewsize")))))
> (vlax-for toolbar
> (vla-get-toolbars
> (vla-item (vla-get-menugroups (vlax-get-acad-object))
> menu))
> (setq tmp
> (cons (list (strcase (vla-get-name toolbar)) toolbar) tmp)))
> (setq obj (cadr (assoc (strcase tbname) tmp)))
> (vla-put-visible obj :vlax-true)
> (vla-put-left obj left)
> (vla-put-top obj top)
> (princ))
>
> (defun c:test () (popup_toolbar "ACAD" "INSERT"))
>
> The location is not very accurate but I'm only testing, maybe next what we
> can do is to add this inside of a right click reactor and by passing the
> cursor position.
>
> Luis.
>
>
Message 6 of 12
Anonymous
in reply to: Anonymous

As I mentioned Paul, I just did a quick test, without concerning of the end
location of the toolbar, I don't have more time to spent on it, but if you
go and take a look at the help of "vla-put-left" , "vla-put-top" or maybe
"vla-float" you can fix that easy.

Regards,
Luis.

"pkirill" wrote in message
news:064657C3C079A39E98B2DDC3F7712BA6@in.WebX.maYIadrTaRb...
> Wow that's pretty intense. I was just going to use
> (command "-toolbar" TBNAME "S" "F" <# rows here>)
> and then put
> (command "-toolbar" TBNAME "H")
> in the buttons on said toolbar to give me an "autohide".
>
> I tried your routine and it works perfectly except the toolbar comes in
way
> to the lower right of where I click - often off the screen.
>
>
> "Luis Esquivel" wrote in message
> news:CED2589B013632056AB465EAA89A4A51@in.WebX.maYIadrTaRb...
> > Paul,
> >
> > I have not seen that... maybe...
> >
> > Here is something that I started:
> >
> > (defun popup_toolbar (menu tbname / pt left top tmp obj)
> > (setq pt (getpoint "\nToolbar location: "))
> > (setq left (fix (* (car pt)
> > (/ (cadr (getvar "screensize"))
> > (getvar "viewsize")))))
> > (setq top (fix (* (cadr pt)
> > (/ (cadr (getvar "screensize"))
> > (getvar "viewsize")))))
> > (vlax-for toolbar
> > (vla-get-toolbars
> > (vla-item (vla-get-menugroups (vlax-get-acad-object))
> > menu))
> > (setq tmp
> > (cons (list (strcase (vla-get-name toolbar)) toolbar) tmp)))
> > (setq obj (cadr (assoc (strcase tbname) tmp)))
> > (vla-put-visible obj :vlax-true)
> > (vla-put-left obj left)
> > (vla-put-top obj top)
> > (princ))
> >
> > (defun c:test () (popup_toolbar "ACAD" "INSERT"))
> >
> > The location is not very accurate but I'm only testing, maybe next what
we
> > can do is to add this inside of a right click reactor and by passing the
> > cursor position.
> >
> > Luis.
> >
> >
>
>
Message 7 of 12
Anonymous
in reply to: Anonymous

Gotcha - wasn't trying to get you to finish it - I'm just thankful for the
head start!

I really have to dig into the whole vla- business. I've been putting it off
for way too long!


"Luis Esquivel" wrote in message
news:6F39E1DAA329216ECA71FB6D7DD4075F@in.WebX.maYIadrTaRb...
> As I mentioned Paul, I just did a quick test, without concerning of the
end
> location of the toolbar, I don't have more time to spent on it, but if you
> go and take a look at the help of "vla-put-left" , "vla-put-top" or maybe
> "vla-float" you can fix that easy.
>
> Regards,
> Luis.
>
> "pkirill" wrote in message
> news:064657C3C079A39E98B2DDC3F7712BA6@in.WebX.maYIadrTaRb...
> > Wow that's pretty intense. I was just going to use
> > (command "-toolbar" TBNAME "S" "F" <# rows here>)
> > and then put
> > (command "-toolbar" TBNAME "H")
> > in the buttons on said toolbar to give me an "autohide".
> >
> > I tried your routine and it works perfectly except the toolbar comes in
> way
> > to the lower right of where I click - often off the screen.
> >
> >
> > "Luis Esquivel" wrote in message
> > news:CED2589B013632056AB465EAA89A4A51@in.WebX.maYIadrTaRb...
> > > Paul,
> > >
> > > I have not seen that... maybe...
> > >
> > > Here is something that I started:
> > >
> > > (defun popup_toolbar (menu tbname / pt left top tmp obj)
> > > (setq pt (getpoint "\nToolbar location: "))
> > > (setq left (fix (* (car pt)
> > > (/ (cadr (getvar "screensize"))
> > > (getvar "viewsize")))))
> > > (setq top (fix (* (cadr pt)
> > > (/ (cadr (getvar "screensize"))
> > > (getvar "viewsize")))))
> > > (vlax-for toolbar
> > > (vla-get-toolbars
> > > (vla-item (vla-get-menugroups (vlax-get-acad-object))
> > > menu))
> > > (setq tmp
> > > (cons (list (strcase (vla-get-name toolbar)) toolbar) tmp)))
> > > (setq obj (cadr (assoc (strcase tbname) tmp)))
> > > (vla-put-visible obj :vlax-true)
> > > (vla-put-left obj left)
> > > (vla-put-top obj top)
> > > (princ))
> > >
> > > (defun c:test () (popup_toolbar "ACAD" "INSERT"))
> > >
> > > The location is not very accurate but I'm only testing, maybe next
what
> we
> > > can do is to add this inside of a right click reactor and by passing
the
> > > cursor position.
> > >
> > > Luis.
> > >
> > >
> >
> >
>
>
Message 8 of 12
Anonymous
in reply to: Anonymous

> Gotcha - wasn't trying to get you to finish it - I'm just thankful for the
> head start!

Hey I did not try to be rude with you, sorry.

> I really have to dig into the whole vla- business. I've been putting it
off
> for way too long!

The more you wait harder the change...

Luis.
Message 9 of 12
Anonymous
in reply to: Anonymous

(setq ptt (grread T))

(setq ptz (cadr ptt))

(command "zoom" "c" ptz "10x")

this is how I read my cursor position for a zoom center command

could the grread be use for your situation ?

"Luis Esquivel" wrote in message
news:4ADB931B50A885CA92C77A8B0772920C@in.WebX.maYIadrTaRb...
>
> > Gotcha - wasn't trying to get you to finish it - I'm just thankful for
the
> > head start!
>
> Hey I did not try to be rude with you, sorry.
>
> > I really have to dig into the whole vla- business. I've been putting it
> off
> > for way too long!
>
> The more you wait harder the change...
>
> Luis.
>
>
>
Message 10 of 12
Anonymous
in reply to: Anonymous

Actually we need this:

(defun factor-fuzz ()
(/ (cadr (getvar "screensize"))
(getvar "viewsize")))

(defun pixels (pt)
(list (fix (* (car pt) (factor-fuzz)))
(fix (* (cadr pt) (factor-fuzz)))))

;; here is a test to get our points as required by vla-put-left, vla-put-top
and vla-float
(defun c:test ()
(while (= 5 (car (setq code (grread 1 1))))
;; do the conversion from units-to-pixels...
(if (and (setq pt (cadr code)) (listp pt))
(print (pixels pt)))))

Have fun,
Luis.
Message 11 of 12
Anonymous
in reply to: Anonymous

> Hey I did not try to be rude with you, sorry.

Didn't think you were!

> The more you wait harder the change...

Isn't that the truth! The older the dog, the harder the tricks...


"Luis Esquivel" wrote in message
news:4ADB931B50A885CA92C77A8B0772920C@in.WebX.maYIadrTaRb...
>
> > Gotcha - wasn't trying to get you to finish it - I'm just thankful for
the
> > head start!
>
> Hey I did not try to be rude with you, sorry.
>
> > I really have to dig into the whole vla- business. I've been putting it
> off
> > for way too long!
>
> The more you wait harder the change...
>
> Luis.
>
>
>
Message 12 of 12
Anonymous
in reply to: Anonymous

Hey - great! That's part of what I need. I think maybe I can use this
combined with Luis' screen size/ viewsize tip to get what I need. Just
figured out that I can't use the actual coordinates because they are not
relative to the screen... Possibly this won't work.. We'll see!
"richard grainer" wrote in message
news:256492F202AB043FEFE64AF58704AF8D@in.WebX.maYIadrTaRb...
> (setq ptt (grread T))
>
> (setq ptz (cadr ptt))
>
> (command "zoom" "c" ptz "10x")
>
> this is how I read my cursor position for a zoom center command
>
> could the grread be use for your situation ?
>
> "Luis Esquivel" wrote in message
> news:4ADB931B50A885CA92C77A8B0772920C@in.WebX.maYIadrTaRb...
> >
> > > Gotcha - wasn't trying to get you to finish it - I'm just thankful for
> the
> > > head start!
> >
> > Hey I did not try to be rude with you, sorry.
> >
> > > I really have to dig into the whole vla- business. I've been putting
it
> > off
> > > for way too long!
> >
> > The more you wait harder the change...
> >
> > Luis.
> >
> >
> >
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost