CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-16-2013, 05:34 PM   #1
SECC0
Veteran
 
SECC0's Avatar
portfolio
alex Zakharov
Russia
 
Join Date: Apr 2006
Posts: 66
.NET button props in max rollout

Hi all,
I have some problems with ".visible " property in dotnet button in max rollout
When I toggle it on and off it stay visible, but not active.
Other button properties like "pos" work well/
Example:
Code:
( rollout Roll "Wtf" width:241 height:86 ( checkbutton btn1 "PressMe" pos:[8,7] width:100 height:30 button btn2 "I see You" pos:[131,7] width:100 height:30 checkbutton btn3 "PressMeToo" pos:[8,40] width:100 height:30 dotNetControl btnNet "button" pos:[131,40] width:100 height:30 on btn1 changed state do btn2.visible = not state on btn3 changed state do btnNet.visible = not state ) createdialog roll )
 
Old 05-16-2013, 06:09 PM   #2
fajar
Frequenter
portfolio
fajar
Airdrie, Canada
 
Join Date: May 2009
Posts: 131
on btn1 changed state do if state then btn2.visible = false else btn2.visible = true
 
Old 05-16-2013, 06:25 PM   #3
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,338
Send a message via ICQ to denisT
something is broken in dotnetcontrol visibility. there is a workaround. make a dotnet button as dotnetobject and add it to dotnetcontrol. this way the visibility works.
Code:
try(destroydialog dialog) catch() rollout dialog "Toggle Visibility" width:200 ( checkbutton show_bt "Show >>" width:80 across:2 dotnetcontrol panel "UserControl" width:80 height:22 local bt on show_bt changed state do bt.Visible = not state on dialog open do ( bt = dotnetobject "Button" bt.Text = "Dotnet" bt.Dock = bt.Dock.Fill panel.controls.add bt ) ) createdialog dialog
 
Old 05-16-2013, 06:30 PM   #4
SECC0
Veteran
 
SECC0's Avatar
portfolio
alex Zakharov
Russia
 
Join Date: Apr 2006
Posts: 66
Quote:
Originally Posted by denisT
dotnet button as dotnetobject and add it to dotnetcontrol.


DotNet in dotnet in dotnet
Panel, yep, I tried it, but not this way. Your method works perfectly.
Thank you.

Last edited by SECC0 : 05-16-2013 at 06:46 PM.
 
Old 05-16-2013, 10:18 PM   #5
LoneRobot
Swami Lama's Lovechild
 
LoneRobot's Avatar
portfolio
Pete Addington
Technical Director
Nexus
United Kingdom
 
Join Date: Dec 2004
Posts: 1,784
Quote:
Originally Posted by denisT
something is broken in dotnetcontrol visibility. there is a workaround. make a dotnet button as dotnetobject and add it to dotnetcontrol.


Ah, nice, I'd found the visible property not working before, i'd got around it by adding and subtracting 1000 to the pos.x property on the checkbox handler. Yours is better.

Code:
rollout dialog "Toggle Visibility" width:200 ( checkbutton show_bt "Show >>" width:80 across:2 checked:true dotnetcontrol bt "button" width:80 height:22 on show_bt changed state do bt.pos.x += if state then 1000 else -1000 ) createdialog dialog
__________________
Regards,
Pete

Read my technical blog - lonerobot.net
 
Old 05-17-2013, 12:40 AM   #6
Gravey
3D Dude
Joel Hewitt
Sydney, Australia
 
Join Date: Dec 2005
Posts: 880
i'm sure i posted another solution for this some time ago using reflection to set the corrrect property, maybe it was for the enabled property. either way i'll try track it down and post a link.

EDIT: found the thread but it was only about getting the enabled property. here's the link anyway:
http://forums.cgsociety.org/showthr...p?f=98&t=927555

Last edited by Gravey : 05-17-2013 at 01:07 AM.
 
Old 05-17-2013, 07:20 AM   #7
lo
the frequentest!
portfolio
Rotem Shiffman
Tel Aviv, Israel
 
Join Date: Jul 2005
Posts: 2,827
The problem you have here is the opposite.

Changing the .visible state of the dotnetControl calls the getter/setter of System.Windows.Forms.Control.Visible. What we need to do is force it to call the getter/setter of MAXScript UI item .visible.
 
Old 05-17-2013, 10:17 AM   #8
SECC0
Veteran
 
SECC0's Avatar
portfolio
alex Zakharov
Russia
 
Join Date: Apr 2006
Posts: 66
Thank you guys for interesting solutions, I get it
 
Old 05-17-2013, 10:17 AM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:10 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.