My end goal here is to make a custom messagebox as I want to gain control over its position.
I want to get two things figured out here.
1. How do I fit the dialog to the size of the contents like the attached maxscript messagebox.png for this dialog?
2. Is it possible to have the \t characters line up like the messagebox also?
Here's the label inside a basic rollout.
clearlistener()
(
try destroyDialog rolloutName catch()
rollout rolloutName "rolloutName" (
dotNetControl lbl_msg "Label" --width:(rolloutName.width-20) height:100
fn dotNetControlsInt =
(
show lbl_msg
-- TheFont = dotnetobject "System.Drawing.Font" "Arial" 10
-- lbl_msg.font = TheFont
lbl_msg.BackColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #background) * 255)[1] as integer) (((colorMan.getColor #background) * 255)[2] as integer) (((colorMan.getColor #background) * 255)[3] as integer)
lbl_msg.ForeColor = (dotNetClass "System.Drawing.Color").fromARGB (((colorMan.getColor #text) * 255)[1] as integer) (((colorMan.getColor #text) * 255)[2] as integer) (((colorMan.getColor #text) * 255)[3] as integer)
lbl_msg.UseCompatibleTextRendering = true
lbl_msg.AutoSize = true
lbl_msg.TabIndex = 4
lbl_msg.TabStop = true
lbl_msg.Size = dotnetObject "System.Drawing.Size" 500 600
labelText = "This\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\nThis\t\tis\n_a_\t\ttest.\n"
-- My effort to get the tabs to line up. Yes, its really useless.
lbl_msg.Text = substituteString labelText "\t" "\x0009" -- A Unicode attempt.
lbl_msg.Text = substituteString labelText "\t" " " -- The more useless attempt.
)
on rolloutName open do dotNetControlsInt()
)
createDialog rolloutName 500 250
)
By 3dwannab · 2021-09-19
miauu · 2021-09-20