But, the Text control entry on the GetDisplayTextSize FP says:
Note This function does not support multiline text strings. The function assumes that any special characters embedded in the string, such as tabs and line-feeds, appear as characters, subject to the character set used in the font.
And everything I'm trying to do is multi-line. Not sure this function would be of any help.
Can one of the NI experts explain why
SetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_SIZE_TO_TEXT, 1);
does absolutely nothing with regard to a text message control? Whether I try to do something passively or actively with this call, it does nothing. By passive, I mean set the text message control before writing a long string to it -- by actively, I mean calling it after I sent the long string to the control.
With message = about 300 chars,
PopupMsgCtrl = NewCtrl (panelPopup, CTRL_TEXT_MSG, "123456789012345678901234567890123456789012345", 12, 12);
SetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_WIDTH, textMessageWidth);
SetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_SIZE_TO_TEXT, 1);
SetCtrlVal (panelPopup, PopupMsgCtrl, message);
GetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_HEIGHT, &textMessageHeight);
textMessageHeight ends up about 41, instead of about 196
In this case,
PopupMsgCtrl = NewCtrl (panelPopup, CTRL_TEXT_MSG, "123456789012345678901234567890123456789012345", 12, 12);
SetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_WIDTH, textMessageWidth);
SetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_SIZE_TO_TEXT, 1);
SetCtrlVal (panelPopup, PopupMsgCtrl, message);
GetCtrlAttribute (panelPopup, PopupMsgCtrl, ATTR_HEIGHT, &textMessageHeight);
textMessageHeight ends up about 14, instead of about 196