12-08-2011 12:53 PM
I'm using the following code to attempt to display some text inside a panel. I have tried (in the ATTR_TEXT_POINT_SIZE) to increase the text size but I see no difference in my string size. I've tried values between 72 and 254 but it always looks about font size 22. Any thoughts?
/*intialize a new panel containing one button that will be activated with keyboard ENTER key */
panelId2 = NewPanel(0,"Keyboard Test Panel", 150,150,600, 580);
controlId = NewCtrl(panelId2,CTRL_SQUARE_COMMAND_BUTTON, "Press ENTER to return to ATE",15,15);
InstallCtrlCallback(panelId2, controlId, ControlResponse, 0);
SetAttributeForCtrls(panelId2, ATTR_HEIGHT,550,1,controlId);
SetAttributeForCtrls(panelId2, ATTR_WIDTH,550,1,controlId);
SetAttributeForCtrls(panelId2, ATTR_TEXT_POINT_SIZE, 254,controlId);
SetPanelAttribute(panelId2,ATTR_VISIBLE,1);
And here is a second usage ...
/*intialize a new panel containing one button that will be clicked by the mouse*/
panelId2 = NewPanel(0,"Mouse Test Panel", 150,150,600,580); // was 150,150,185,270
controlId = NewCtrl(panelId2,CTRL_SQUARE_COMMAND_BUTTON, "Left-Mouse-Click inside this box",15,15);
InstallCtrlCallback (panelId2, controlId, ControlResponse,0);
SetAttributeForCtrls(panelId2, ATTR_WIDTH,550,1,controlId);
SetAttributeForCtrls(panelId2, ATTR_HEIGHT,550,1,controlId);
SetAttributeForCtrls(panelId2, ATTR_TEXT_POINT_SIZE, 254,controlId);
SetPanelAttribute(panelId2,ATTR_VISIBLE,1);
12-08-2011 02:44 PM
The problem here is that you are using an attribute not valid for buttons: you should use ATTR_LABEL_POINT_SIZE instead: you'd have got it if you had trapped the return code for the function.
I wonder why you are using SetAttributeForCtrls instead of a simpler SetCtrlAttribute since you are using one control only.
12-09-2011 03:30 PM
The ATTR_LABEL_POINT_SIZE didn't seem to work either. I then changed the calls to SetCtrlAttribute, and the inner panel (the one surrounding the text that I'm trying to enlarge) basically did a size-to-fit.
12-09-2011 04:32 PM - edited 12-09-2011 04:33 PM
One possible cause is that you are setting the panel as visible: in my tests I used DisplayPanel instead, which as you can see in the online help causes the panel to be redrawn thus honouring all attributes set in panel and controls. Try using DisplayPanel you too.