Notifications
Clear all
[Closed] Messagebox size
Feb 06, 2013 8:28 am
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,
Cheers!
2 Replies
Feb 06, 2013 8:28 am
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?
Feb 06, 2013 8:28 am
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.
The quick brown fox
jumps over the lazy dog." "Daily Pangram"
If not, something like this still won’t work?
struct defaultDialogStruct
(
inputText,
titleText,
returnVal,
fn getMessageHeight msg = 17 * (filterString msg "
" splitEmptyTokens:true).count,
fn getMessageWidth msg min = amax(append (for line in filterString msg "
" 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"
mb.init()
)
)
defaultDialog = defaultDialogStruct()
defaultDialog.messageBox "The quick brown fox jumps over the lazy dog.
The quick brown fox
jumps over the lazy dog." title:"Daily Pangram"