IonicWind Software

IWBasic => General Questions => Topic started by: Andy on May 06, 2016, 08:39:18 AM

Title: Controlcolor problem
Post by: Andy on May 06, 2016, 08:39:18 AM
This makes no sense to me, but I might be missing something....

I decided to floodfill a simple window with black rgb 0,0,0.

and make some radio buttons white text on black background... but It's not working... I must be missing the obvious as I've done this 1000's of times before.

Both radio_1 and _2 (nor the others when I floodfill the window black) display black for the text.

Here I have commented out the floodfill line as I try to find the problem.

'Sub Routine to select Add a Value type
SUB AddValueType(),int
OPENWINDOW dy3,0,0,700,390,@CAPTION|@MINBOX|@MAXBOX|@SIZE|@TOPMOST,0," Please select the type of your new entry.",&AddTypeHnd
'FLOODFILL dy3,0,0,rgb(0,0,0)

CONTROL dy3,@RADIOBUTTON,"String",40,40,80,25,@CTEDITLEFT|@TABSTOP,RADIO_1
CONTROL dy3,@RADIOBUTTON,"DWord",40,80,80,25,@CTEDITLEFT|@TABSTOP,RADIO_2
CONTROL dy3,@RADIOBUTTON,"QWord",40,120,80,25,@CTEDITLEFT|@TABSTOP,RADIO_3
CONTROL dy3,@RADIOBUTTON,"Binary",40,160,80,25,@CTEDITLEFT|@TABSTOP,RADIO_4
CONTROL dy3,@RADIOBUTTON,"Expandable String",40,200,150,25,@CTEDITLEFT|@TABSTOP,RADIO_5
CONTROL dy3,@RADIOBUTTON,"Multi String",40,240,150,25,@CTEDITLEFT|@TABSTOP,RADIO_6

CONTROL dy3,@BUTTON,"Select",490,300,80,25,0x50800009|@CTLBTNDEFAULT|@TABSTOP,BUTTON_1
CONTROL dy3,@BUTTON,"Cancel",580,300,80,25,0x50800009|@CTLBTNDEFAULT|@TABSTOP,BUTTON_2

SETFONT dy3,"Arial",10,500,0,button_1
SETFONT dy3,"Arial",10,500,0,button_2
SETFONT dy3,"Arial",12,500,0,radio_1
SETFONT dy3,"Arial",12,500,0,radio_2
SETFONT dy3,"Arial",12,500,0,radio_3
SETFONT dy3,"Arial",12,500,0,radio_4
SETFONT dy3,"Arial",12,500,0,radio_5
SETFONT dy3,"Arial",12,500,0,radio_6

SETCONTROLCOLOR dy3,radio_1,rgb(255,255,255),rgb(0,0,0)
SETCONTROLCOLOR dy3,radio_2,rgb(255,255,255),rgb(155,155,155)
SETCONTROLCOLOR dy3,radio_3,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_4,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_5,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_6,rgb(0,0,0),rgb(255,255,255)

SETSTATE dy3,radio_1,1
Dstate = 0
state = 1

WAITUNTIL dy3=0

RETURN 0
ENDSUB



Both radio_1 and 2 are setting the background colours correctly, but not the foreground colours  ???

I copied the code / handler into a new source file, amended the window so it was not a sub and the colours are correct.  ???

window dy3

CONST button_1 = 500
CONST button_2 = 501
CONST radio_1 = 201
CONST radio_2 = 202
CONST radio_3 = 510
CONST radio_4 = 511
CONST radio_5 = 512
CONST radio_6 = 514


'Sub Routine to select Add a Value type
OPENWINDOW dy3,0,0,700,390,@CAPTION|@MINBOX|@MAXBOX|@SIZE|@TOPMOST,0," Please select the type of your new entry.",&AddTypeHnd
'FLOODFILL dy3,0,0,rgb(0,0,0)

CONTROL dy3,@RADIOBUTTON,"String",40,40,80,25,@CTEDITLEFT|@TABSTOP,RADIO_1
CONTROL dy3,@RADIOBUTTON,"DWord",40,80,80,25,@CTEDITLEFT|@TABSTOP,RADIO_2
CONTROL dy3,@RADIOBUTTON,"QWord",40,120,80,25,@CTEDITLEFT|@TABSTOP,RADIO_3
CONTROL dy3,@RADIOBUTTON,"Binary",40,160,80,25,@CTEDITLEFT|@TABSTOP,RADIO_4
CONTROL dy3,@RADIOBUTTON,"Expandable String",40,200,150,25,@CTEDITLEFT|@TABSTOP,RADIO_5
CONTROL dy3,@RADIOBUTTON,"Multi String",40,240,150,25,@CTEDITLEFT|@TABSTOP,RADIO_6

CONTROL dy3,@BUTTON,"Select",490,300,80,25,0x50800009|@CTLBTNDEFAULT|@TABSTOP,BUTTON_1
CONTROL dy3,@BUTTON,"Cancel",580,300,80,25,0x50800009|@CTLBTNDEFAULT|@TABSTOP,BUTTON_2

SETFONT dy3,"Arial",10,500,0,button_1
SETFONT dy3,"Arial",10,500,0,button_2
SETFONT dy3,"Arial",12,500,0,radio_1
SETFONT dy3,"Arial",12,500,0,radio_2
SETFONT dy3,"Arial",12,500,0,radio_3
SETFONT dy3,"Arial",12,500,0,radio_4
SETFONT dy3,"Arial",12,500,0,radio_5
SETFONT dy3,"Arial",12,500,0,radio_6

SETCONTROLCOLOR dy3,radio_1,rgb(255,255,255),rgb(0,0,0)
SETCONTROLCOLOR dy3,radio_2,rgb(255,255,255),rgb(155,155,155)
SETCONTROLCOLOR dy3,radio_3,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_4,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_5,rgb(0,0,0),rgb(255,255,255)
SETCONTROLCOLOR dy3,radio_6,rgb(0,0,0),rgb(255,255,255)

SETSTATE dy3,radio_1,1
Dstate = 0
state = 1

WAITUNTIL dy3=0
end

SUB AddTypeHnd(),int
SELECT @MESSAGE
CASE @IDCREATE
  CENTERWINDOW dy3

   CASE @IDCONTROL
        SELECT @CONTROLID

         CASE BUTTON_1 'OK
              if @notifycode = 0
                 closewindow dy3
                 end
              endif

         CASE BUTTON_2 'Cancel
              if @notifycode = 0
                 closewindow dy3
                 end
              endif

CASE radio_1 'String
             if @notifycode = 0
 SETSTATE dy3,radio_1,1
 SETSTATE dy3,radio_2,0
 SETSTATE dy3,radio_3,0
 SETSTATE dy3,radio_4,0
 state = 1
             endif

CASE radio_2 'DWord
            if @notifycode = 0
SETSTATE dy3,radio_1,0
SETSTATE dy3,radio_2,1
SETSTATE dy3,radio_3,0
SETSTATE dy3,radio_4,0
state = 2
               Dstate = 1
            endif

CASE radio_3 'QWord
            if @notifycode = 0
SETSTATE dy3,radio_1,0
SETSTATE dy3,radio_2,0
SETSTATE dy3,radio_3,1
SETSTATE dy3,radio_4,0
state = 3
               Dstate = 2
            endif

CASE radio_4 'Binary
            if @notifycode = 0
SETSTATE dy3,radio_1,0
SETSTATE dy3,radio_2,0
SETSTATE dy3,radio_3,0
SETSTATE dy3,radio_4,1
state = 4
            endif

CASE radio_5 'Expandable String
            if @notifycode = 0
SETSTATE dy3,radio_1,0
SETSTATE dy3,radio_2,0
SETSTATE dy3,radio_3,0
SETSTATE dy3,radio_4,0
SETSTATE dy3,radio_6,0
SETSTATE dy3,radio_5,1
state = 5
            endif

CASE radio_6 'Multi String
            if @notifycode = 0
SETSTATE dy3,radio_1,0
SETSTATE dy3,radio_2,0
SETSTATE dy3,radio_3,0
SETSTATE dy3,radio_4,0
SETSTATE dy3,radio_5,0
SETSTATE dy3,radio_6,1
state = 6
            endif

       ENDSELECT


CASE @IDCLOSEWINDOW
          CLOSEWINDOW dy3
          end
 
ENDSELECT
RETURN 0
ENDSUB


Andy.
:)

Title: Re: Controlcolor problem
Post by: Egil on May 06, 2016, 09:07:46 AM
A shot in the dark...
The User Manual says about RadioButtons SETCONTROLCOLOR: " If there is a manifest file the text color does not change".
Title: Re: Controlcolor problem
Post by: Andy on May 06, 2016, 09:12:13 AM
Egil,

That's pure genius! I deleted the manifest file and the colours are correct now.

BTW, good to see you back again!

Thanks,
Andy.
:)
Title: Re: Controlcolor problem
Post by: Egil on May 06, 2016, 09:21:56 AM
Just came in the door and saw your post.
Only here for the weekend. My great-granddaughter is going to be babtized sunday. Then back to Trondheim for another week.
Title: Re: Controlcolor problem
Post by: LarryMc on May 06, 2016, 09:43:52 AM
just remember that WITHOUT the manifest file SYSBUTTONs  and PROGRESSBARs appear different.
Title: Re: Controlcolor problem
Post by: Egil on May 06, 2016, 10:47:40 AM
Quote from: LarryMc on May 06, 2016, 09:43:52 AM
just remember that WITHOUT the manifest file SYSBUTTONs  and PROGRESSBARs appear different.

Why not forget about the manifest file and draw your own buttons? Or even better, purchase a copy of LarryMc's Button Designer?

Title: Re: Controlcolor problem
Post by: Andy on May 06, 2016, 09:12:37 PM
Egil,

I have LarryMc's custom button library, and touching up the buttons will be the last finishing touch.

Thanks,
Andy.