Page 1 of 1

SetGadgetColor: #PB_Default

Posted: Fri Oct 11, 2013 11:23 pm
by IdeasVacuum
Would be good to use #PB_Default with SetGadgetColor as we can with SetGadgetFont.

Re: SetGadgetColor: #PB_Default

Posted: Tue Oct 15, 2013 2:19 am
by Regenduft
Try before you sigh! ;)

Code: Select all

If OpenWindow(0, 0, 0, 200, 170, "SetGadgetColor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 10, 10, 180, 20, "String...")
  ListViewGadget(1, 10, 40, 180, 60)
  For i = 0 To 4
    AddGadgetItem(1, -1, "Text")
  Next i
  ContainerGadget(2, 10, 110, 180, 50, #PB_Container_Raised)

  SetGadgetColor(0, #PB_Gadget_BackColor, $00FFFF)
  SetGadgetColor(1, #PB_Gadget_FrontColor, $FFFFFF)
  SetGadgetColor(1, #PB_Gadget_BackColor, $000000)
  SetGadgetColor(2, #PB_Gadget_BackColor, $0000FF)

  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
  SetGadgetColor(0, #PB_Gadget_BackColor, #PB_Default)
  SetGadgetColor(1, #PB_Gadget_FrontColor, #PB_Default)
  SetGadgetColor(1, #PB_Gadget_BackColor, #PB_Default)
  SetGadgetColor(2, #PB_Gadget_BackColor, #PB_Default)
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
PB-Help (SetGadgetColor) wrote:To remove the custom color and go back to the default system color, set the 'Color' parameter to -1.

Code: Select all

Debug #PB_Default ; output = -1

Re: SetGadgetColor: #PB_Default

Posted: Tue Oct 15, 2013 2:55 am
by IdeasVacuum
...erm no, not to return to or set System Default Colour but to set a PB Default Colour and use that colour for all gadgets following - i.e. in a similar way to 2D drawing.

Re: SetGadgetColor: #PB_Default

Posted: Tue Oct 15, 2013 3:22 am
by Regenduft
I see, you mean using #PB_Default for the #Gadget parameter! Sorry, I got that wrong! Yes... that would be nice... :)