Hey people...
I want to share an overhead I wrote for (grread ...) to imitate some kind of Dialog.
It was/is a try to pack "all" returns of the grread-function into a form where the position of the mouse, over a shape defines wich direction is taken.
A shape and his action its defined by the following functions:
Note:
* all of them are lambda-expr or a symbol to a function
* all of them are optional, expect "mouseover"
* All of the functions are running in her own namespace, no symbol is hidden, expect "SUPER" (this was the main goal)
* "SUPER" and "this" are something special (see below)
* the text between "[ ... ]" are the given arguments
- mouseover [this MousePoint]
- entering [this MousePoint]
- leaving [this MousePoint]
- mouseMove [this MousePoint]
- leftclick [this MousePoint]
- rightclick [this code]
- keypressed [this code]
- zommed [this MousePoint Scale]
**** ALL the coordinates given as "MousePoint" are plan to the DCS, relativ to the current (getvar 'viewcenter) and scaled up/down to the domain 0 to 100, where (0 100) [x,y] matches the upper-mid of the Display and (0 -100) the lower-mid. (except __blockref__ is set - see below) ***
The shapes are nested in a form like this:(
(__MainLoop__ (Shape01 Shape02) ;;;MainLoop is also something special ;)
(mouseover (lambda (this Pt / ) 'T))
)
(Shape01 nil ;no SubShape
(mouseover (lambda (this Pt / ) ........ ))
...
)
(Shape02 (SubShape)
...
)
(SubShape nil
...
)
(otherData "WhatsUp"
(nothing "oh yeah")
(aLot "oh yeah")
)
)
It seems that the text I wrote is too long The full-Text can be found in the attachmentAttached is the function
Mor:DisplayEngine - (load "Mor_DisplayEngine.vlx") and 2 Examples
The
first example needs 2 files:
- MOr_Menu.lsp (is a parser)
- Example_01.lsp
After loading them execute (C:E_01).
To show the possiblities of __blockRef__ u are going to be asked to select a BlockReference.
If u select one, also try to select a non-uniform-scaled and/or rotated BlockRef
Change also the UCS, (3D)View.
If no BlockRef is selected, the whole stuff is displayed realtiv Screen and the ViewCenter.
The
second example is a stupid one, just to show how (super '__trans__) works.
** example_02 returns a lambda-expr (other than above) use it like:
(setq whatEver (load "example_02.lsp"))
(whatEver)
So far so good...
Tell me what u think! any feedback is good feedback.
greets reltro