October 29, 2025, 12:47:24 PM

News:

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


Controlcolor problem

Started by Andy, May 06, 2016, 08:39:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

May 06, 2016, 08:39:18 AM Last Edit: May 06, 2016, 08:57:12 AM by Andy
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.
:)

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

A shot in the dark...
The User Manual says about RadioButtons SETCONTROLCOLOR: " If there is a manifest file the text color does not change".
Support Amateur Radio  -  Have a ham  for dinner!

Andy

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.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Egil

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.
Support Amateur Radio  -  Have a ham  for dinner!

LarryMc

just remember that WITHOUT the manifest file SYSBUTTONs  and PROGRESSBARs appear different.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Egil

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?

Support Amateur Radio  -  Have a ham  for dinner!

Andy

Egil,

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

Thanks,
Andy.


Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.