ScriptSpot

Forum topic · General Scripting

Place form in Viewport

By sdinesh86 · 2012-05-30

Description

Hello,

For a long time now i trying to find answer to a problem,

TASK : Place a Maxform (dotnet maxform) at the bottom of the active viewport.

PROBLEM : i am not finding a way to get and convert the X Y of viewport to the screen space.

Can anyone please help me out with this.

Here is a link to what i want to achieve

http://www.paulneale.com/tutorials/dotNet/form/index.htm#settingProperti…

Comments (11)

Swordslayer · 2012-06-13

You should be able to work out the rest, here is how to get the dimensions and position of the active viewport:

viewportScreenPos = mouse.screenpos - mouse.pos
viewportSize = getViewSize()

thanx

jos · 2012-06-14

works perfect! Guess it's not possible to change the position of a rollout? (if the active viewport is changed)

barigazy · 2012-06-14

use form.opacity propertie.(range from 0 to 1)

jos · 2012-06-14

if I use the form.opacity = 0 the complete form is gone inclusive the controls. But found he solution!


--dont use
form=dotNetObject "maxCustomControls.maxForm"
-- but use
form=dotNetObject "form"

with the maxform you'll get a standard gray backgroundcolor.
with this code you have have controls without form


form=dotNetObject "form"
--Set the background color
form.backColor=(dotNetClass "system.drawing.color").black
--Set the transparent color
form.TransparencyKey=(dotNetClass "system.drawing.color").black
form.Opacity=1

barigazy, thanx for the help!

barigazy · 2012-06-14

Use float value for opacity propertie 0.1, 0.2 etc.
I send you a mail.
What do you think about that look.

jos · 2012-06-14

omg! thats totaly creasy! looking out for the release!

sdinesh86 · 2012-06-15

Thanks Swordslayer for the replay

That helped me a lot, finally i can move on. :)

jos · 2012-06-12

Anyone? I'd like to know the answer too.

answer to what???

sdinesh86 · 2012-06-29

hello jos,

Anyone? I'd like to know the answer too

answer to what ???