Naming the checkbutton with a GLOBAL VARIABLE ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2007   #1
Naming the checkbutton with a GLOBAL VARIABLE ?

Hey!

I'm having troubles with this :S


I'm using two GLOBAL VARIABLES, one holds a BOOLEAN VALUE and one a STRING VALUE ...

When creating a checkbutton I use both the variables to create the checkbutton ( BOOLEAN for checked and STRING for name ) and what I don't understand is that the BOOLEAN works but not the string

here is what I mean :


GLOBAL X = "String"
GLOBAL Y = TRUE



Rollout
(
checkbutton chk1 "test" checked:true
checkbutton chk2 X checked: Y
)


so basicly the TRUE transfers on the CHECKED fine, but the string won't fit

there is what I tried
-----------------------------------------------
GLOBAL X = "String"
GLOBAL Y = TRUE



Rollout
(
checkbutton chk1 "test" checked:true
checkbutton chk2 (X as string) checked: Y
)
-----------------------------------------------
GLOBAL X = "String"
GLOBAL Y = TRUE



Rollout
(
checkbutton chk1 "test" checked:true
checkbutton chk2 name:X checked: Y
)
-----------------------------------------------
GLOBAL X = "String"
GLOBAL Y = TRUE



Rollout
(
checkbutton chk1 "test" checked:true
checkbutton chk2 name:(X as string) checked: Y
)


and I keep getting
-- Syntax error: at keyword parameter, expected name



Thanks for your help !
__________________
EulerRnD.com

Last edited by EricDLegare : 05 May 2007 at 02:02 AM.
 
Old 05 May 2007   #2
Unfortunately you can't change the checkbox's label so no variable can be used to assign it.
The 'solution' is to just not call it anything and position a "label" object. Or at least that was all I could figure out last week when faced with the same dilema.

The other option is to dynamically generate the rollout, however you wouldn't be able to dynamically update without destroying and recreating the rollout.

global checkboxname = "asdf" 
execute ("
   rollout "+checkboxname+" \""+checkboxname+"\" 
   (
	  checkbox chk1 \""+checkboxname+"\"
   )
")
 
execute("createdialog "+checkboxname)

Last edited by thatoneguy : 05 May 2007 at 04:31 AM.
 
Old 05 May 2007   #3
Originally Posted by thatoneguy: Unfortunately you can't change the checkbox's label so no variable can be used to assign it.[/CODE]


Wa ?

I mean, when I do a

on checkbutton changed state do
(
checkbutton.caption = "test"
)

this works :S

but I can't use checkbutton.caption = "test" right under the rollout why

GLOBAL X = "String"
GLOBAL Y = TRUE

Rollout
(
checkbutton chk1 "test" checked:true
checkbutton chk2 "" checked: Y
chk2.caption = X as string

)
__________________
EulerRnD.com
 
Old 05 May 2007   #4
caption! Aha! hahaha thanks! That's not in the Maxscript documentation for checkbox so I could never figure out a value to call. Well then... I'm a mile and a half off on this one. I wonder why they neglected to include it under properties. Bobo?

OK well back to the problem at hand. Your code won't operate because I don't think you can execute code inside of a rollout except for interface objects, on .... and functions.


GLOBAL X = "asdf"
GLOBAL Y = TRUE
Rollout New "1234"
(
 checkbutton chk1 "test" checked:true
 checkbutton chk2 "" checked: Y
)
createdialog new
new.chk2.caption = X as string  

Last edited by thatoneguy : 05 May 2007 at 08:51 PM.
 
Old 05 May 2007   #5
Well it seams like this works :

GLOBAL X = "String"
GLOBAL Y = TRUE

Rollout NAME
(
checkbutton chk1 "test" checked:true
checkbutton chk2 "" checked: Y

on NAME open do
(
chk2.caption = X
)

)



( I am creating and killing rollouts but I want to keep the checked and caption values of the checkbuttons )


Well thanks a lot
__________________
EulerRnD.com
 
Old 05 May 2007   #6
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



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 04:56 PM.


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