May 10, 2024, 01:52:00 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


problem with @groupbox

Started by stefanodel, January 08, 2011, 11:13:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stefanodel

Hello everybody,
I have a problem using @groupbox in a dialog.
the code is:


CONST GROUP_1 = 1
CONST RADIO_2 = 2
CONST RADIO_3 = 3
DIALOG d1
CREATEDIALOG d1,0,0,300,202,0x80CA0080,0,"Caption",&d1_handler
CONTROL d1,@GROUPBOX,"Group",43,33,198,123,0x50000007,GROUP_1
CONTROL d1,@RADIOBUTTON,"Radio1",74,80,70,20,0x50020009,RADIO_2
CONTROL d1,@RADIOBUTTON,"Radio2",74,116,70,20,0x50000009,RADIO_3

SHOWDIALOG d1
SETSTATE d1,3,1

SETFONT d1, "Arial", 14, 400, 0x00010000, GROUP_1

WAITUNTIL d1 = 0
END

SUB d1_handler
SELECT @MESSAGE
CASE @IDINITDIALOG
CENTERWINDOW d1
/* Initialize any controls here */
CASE @IDCLOSEWINDOW
CLOSEDIALOG d1,@IDOK
CASE @IDCONTROL
SELECT @CONTROLID
CASE RADIO_2
IF @NOTIFYCODE = 0
/*button clicked*/
ENDIF
CASE RADIO_3
IF @NOTIFYCODE = 0
/*button clicked*/
ENDIF
ENDSELECT
ENDSELECT
RETURN
ENDSUB


if in the code I use the command SETFONT to change the font of the title of groupbox

SETFONT d1, "Arial", 14, 400, 0x00010000, GROUP_1

I get two line border at the top of groupbox, if I remove from the code the line

SETFONT d1, "Arial", 14, 400, 0x00010000, GROUP_1

the behaviour of the topline of groupbox is correct.

I don't know how to solve this problem.

Thanks

Stefano

sapero

Stefano, move SETFONT to @IDINITDIALOG handler, to apply any visual changes before the control is displayed.

stefanodel

Quote from: sapero on January 08, 2011, 11:28:46 AM
Stefano, move SETFONT to @IDINITDIALOG handler, to apply any visual changes before the control is displayed.

Sapero,
thank you very much, now my little simple code is ok.

There is always something to learn from you!

Stefano