Messagebox size

Become a member of the CGSociety

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

Thread Tools Display Modes
  02 February 2013
Messagebox size

Hi there,
I hope someone can help me with a small problem concerning the messagebox in 3DsMax 2011.
It seems, that the boxes size is dependent on the message length. But when the string is created dynamically with variables in it, the box is not large enough to hold the complete text.

Is there a way to work around this problem or do I overlook something?

Thank your very much,

  02 February 2013
That's very strange - I have one that gets created dynamically with variables and a bunch of if statements that seems to fit fine. Is it horizontally or vertically that doesn't fit? Or both?

  02 February 2013
Strange, indeed, what about breaking the string with newlines, would that help? Does this work for you:

dnMBox = dotNetClass "System.Windows.Forms.MessageBox"
 dnMBox.Show "The quick brown fox jumps over the lazy dog.\n\n\n\nThe quick brown fox\njumps over the lazy dog." "Daily Pangram"

If not, something like this still won't work?

struct defaultDialogStruct
 	fn getMessageHeight msg = 17 * (filterString msg "\n" splitEmptyTokens:true).count,
 	fn getMessageWidth msg min = amax(append (for line in filterString msg "\n" collect (getTextExtent line)[1]) min),
 	mb = rollout mb titleText
 		label lblText inputText width:(getMessageWidth inputText 100) height:(getMessageHeight inputText) pos:[10,10]
 		button btnOK "OK" width:75 height:23
 		label lblPaddingBlock "" offset:[0,-12]
 		fn init = (createDialog mb width:(getMessageWidth inputText 100 + 20) modal:true; OK)
 		on mb open do setFocus btnOK
 		on btnOK pressed do destroyDialog mb
 	fn messageBox message title: =
 		inputText = message
 		titleText = if title != unsupplied then title else "Warning"
 defaultDialog = defaultDialogStruct()
 defaultDialog.messageBox "The quick brown fox jumps over the lazy dog.\n\n\n\nThe quick brown fox\njumps over the lazy dog." title:"Daily Pangram"
Scripts :: linkedin
  02 February 2013
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
Society of Digital Artists

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

All times are GMT. The time now is 10:23 PM.

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