Page 1 of 1

Pb color with DateGadget

Posted: Tue Dec 03, 2024 2:31 pm
by Yves86
Hi,
I want to use setgadgetcolor with a DateGadget, but it does'nt work with Window11. On MasOS only the BackColor work for the calendar and not for the string.

Does anybody have an idea ?
Thanks

Code: Select all

Enumeration 
  #wcal
  #cal
EndEnumeration

If OpenWindow(#wcal, 0, 0, 250, 250,"DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  DateGadget(#cal, 10, 10, 100, 25)
  SetGadgetColor(#cal, #PB_Gadget_FrontColor, #Blue)
  SetGadgetColor(#cal, #PB_Gadget_BackColor, #Yellow)
  SetGadgetColor(#cal, #PB_Gadget_TitleBackColor, #Yellow)
  SetGadgetColor(#cal, #PB_Gadget_TitleFrontColor, #Red)
  SetGadgetColor(#cal, #PB_Gadget_GrayTextColor, #Green)
  
  AddKeyboardShortcut(#Wcal,#PB_Shortcut_Escape,Key_esc)
  Repeat
    event_c = WaitWindowEvent() 
    Select event_c 
      Case #PB_Event_Gadget
        Event_Gadgetc = EventGadget()
        Select Event_Gadgetc
          Case #cal
            Debug Str(GetGadgetState(#cal)) + "  >> " + FormatDate("%dd/%mm/%yyyy",GetGadgetState(#cal)) + " -- " + GetGadgetText(#cal)
        EndSelect
      Case #PB_Event_CloseWindow
        Break
      Case #PB_Event_Menu
        Select EventMenu()
          Case key_esc
            Break
        EndSelect
    EndSelect
  ForEver
  RemoveKeyboardShortcut(#Wcal,Key_esc)
  CloseWindow(#Wcal)
EndIf

// Edit: Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: Pb color with DateGadget

Posted: Tue Dec 03, 2024 2:57 pm
by Kiffi
No Bug

Uncheck "Enable modern theme support" in the Compiler Options

Image

Re: Pb color with DateGadget

Posted: Tue Dec 03, 2024 3:06 pm
by Yves86
Thank you Kiffi.
It's OK