ScriptSpot home

Forum topic · General Scripting

Place form in Viewport

By Dinesh Salunke · 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)
Vojtech Cada

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()
Reply to Vojtech Cada
Jos Balcaen

thanx

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

Reply to Branko Živković
Jos Balcaen

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!

Reply to Jos Balcaen
Branko Živković

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

Reply to Vojtech Cada
Dinesh Salunke

Thanks Swordslayer for the replay

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

Jos Balcaen

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

Reply to Jos Balcaen
Dinesh Salunke

answer to what???

hello jos,

Anyone? I'd like to know the answer too

answer to what ???