May 04, 2024, 12:24:00 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Beginner Questions ...

Started by tbohon, January 04, 2007, 07:22:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tbohon

Given a simple dialog:

CONST STATIC_1 = 1
CONST STATIC_2 = 2
CONST STATIC_3 = 3
CONST STATIC_4 = 4
CONST EDIT_5 = 5
CONST EDIT_6 = 6
CONST EDIT_7 = 7
DIALOG d1
CREATEDIALOG d1,0,0,409,256,0x80C80080,0,"Caption",&d1_handler
CONTROL d1,@STATIC,"HEADER",33,15,70,20,0x5000010B,STATIC_1
CONTROL d1,@STATIC,"Field 1",87,69,70,20,0x5000010B,STATIC_2
CONTROL d1,@STATIC,"Field 2",87,97,70,20,0x5000010B,STATIC_3
CONTROL d1,@STATIC,"Field 3",87,126,70,20,0x5000010B,STATIC_4
CONTROL d1,@EDIT,"Edit1",157,68,70,20,0x50800000,EDIT_5
CONTROL d1,@EDIT,"Edit2",159,96,70,20,0x50800000,EDIT_6
CONTROL d1,@EDIT,"Edit3",160,124,70,20,0x50800000,EDIT_7

SUB d1_handler
   SELECT @MESSAGE
      CASE @IDINITDIALOG
         CENTERWINDOW d1
         /* Initialize any controls here */
      CASE @IDCLOSEWINDOW
         CLOSEDIALOG d1,@IDOK
      CASE @IDCONTROL
         SELECT @CONTROLID
            CASE EDIT_5
            /* respond to edit notifications here */
            CASE EDIT_6
            /* respond to edit notifications here */
            CASE EDIT_7
            /* respond to edit notifications here */
         ENDSELECT
   ENDSELECT
RETURN
ENDSUB


How do I do the following?

1.  Set the 'HEADER' to one font while leaving the field labels at the default?

2.  Change the background of the dialog itself?

3.  Change the background of an individual edit control?

4.  Change the color of a static text box?


I've been beating my head into the desk for some time now trying to make these happen - I'm pretty sure they're possible from what I read in the documentation but I can't seem to get the right statements in the right locations.  My guess is that I'm just not putting the various pieces together correctly - old age is my excuse and I'm sticking to it ... !   ;D

Thanks in advance.

Tom
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

Ionic Wind Support Team


CONST STATIC_1 = 1
CONST STATIC_2 = 2
CONST STATIC_3 = 3
CONST STATIC_4 = 4
CONST EDIT_5 = 5
CONST EDIT_6 = 6
CONST EDIT_7 = 7
DIALOG d1
CREATEDIALOG d1,0,0,409,256,0x80C80080,0,"Caption",&d1_handler
'a static control to cover the entire dialog
CONTROL d1,@STATIC,"",0,0,409,256,0x50000000,9999
'
CONTROL d1,@STATIC,"HEADER",33,15,70,20,0x5000010B,STATIC_1
CONTROL d1,@STATIC,"Field 1",87,69,70,20,0x5000010B,STATIC_2
CONTROL d1,@STATIC,"Field 2",87,97,70,20,0x5000010B,STATIC_3
CONTROL d1,@STATIC,"Field 3",87,126,70,20,0x5000010B,STATIC_4
CONTROL d1,@EDIT,"Edit1",157,68,70,20,0x50800000,EDIT_5
CONTROL d1,@EDIT,"Edit2",159,96,70,20,0x50800000,EDIT_6
CONTROL d1,@EDIT,"Edit3",160,124,70,20,0x50800000,EDIT_7

DOMODAL d1

SUB d1_handler
   SELECT @MESSAGE
      CASE @IDINITDIALOG
         CENTERWINDOW d1
         /* Initialize any controls here */
SETFONT d1,"Arial",12,800,0,STATIC_1
         SETCONTROLCOLOR d1,STATIC_2,RGB(0,0,0),RGB(255,0,0)
         SETCONTROLCOLOR d1,EDIT_5,RGB(0,0,0),RGB(255,255,0)
'set the background static color
SETCONTROLCOLOR d1,9999,RGB(0,0,255),RGB(0,0,255)
      CASE @IDCLOSEWINDOW
         CLOSEDIALOG d1,@IDOK
      CASE @IDCONTROL
         SELECT @CONTROLID
            CASE EDIT_5
            /* respond to edit notifications here */
            CASE EDIT_6
            /* respond to edit notifications here */
            CASE EDIT_7
            /* respond to edit notifications here */
         ENDSELECT
   ENDSELECT
RETURN
ENDSUB
Ionic Wind Support Team

tbohon

January 05, 2007, 08:49:01 AM #2 Last Edit: January 05, 2007, 08:57:15 AM by tbohon
Thanks, Paul.  I was using SETCONTROLCOLOR but apparently not correctly ... or, more likely, not in the correct place in the code.  :-\

Appreciate it!

Tom


Edit:  On further examination, I see the trick - a static control to cover the entire dialog.  Clever, very very clever ...  ;)

Thanks again.
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)