Page 1 of 1
Color in DateGadget do not Work
Posted: Sun Mar 11, 2018 12:50 pm
by Cyllceaux
Code: Select all
OpenWindow(0,100,100,100,100,"Test")
DateGadget(1,0,0,100,22,"%dd.%mm.%yyyy",Date(),#PB_Date_CheckBox)
SetGadgetColor(1,#PB_Gadget_BackColor,#Red)
SetGadgetColor(1,#PB_Gadget_FrontColor,#Red)
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Both color do not work. The Textfield AND the Calendar are still white
Re: Color in DateGadget do not Work
Posted: Sun Mar 11, 2018 12:54 pm
by RSBasic
Code: Select all
EnableExplicit
Procedure WindowCallback(hWnd, uMsg, wParam, lParam)
Protected *NMDATETIMECHANGE.NMDATETIMECHANGE
Select uMsg
Case #WM_NOTIFY
*NMDATETIMECHANGE = lParam
Select *NMDATETIMECHANGE\nmhdr\hwndfrom
Case GadgetID(0)
If *NMDATETIMECHANGE\nmhdr\code = #DTN_DROPDOWN
SetWindowTheme_(FindWindowEx_(FindWindow_("DropDown", 0), #Null, "SysMonthCal32", #Null), @"", @"")
EndIf
EndSelect
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
DateGadget(0, 15, 50, 200, 17, "%dd/%mm/%yyyy", Date())
SetGadgetColor(0, #PB_Gadget_BackColor, #Red)
SetGadgetColor(0, #PB_Gadget_FrontColor, #Red)
SetWindowCallback(@WindowCallback())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf
Re: Color in DateGadget do not Work
Posted: Sun Mar 11, 2018 12:59 pm
by Dude
Oops, thought you wrote CalendarGadget(). My bad.

Re: Color in DateGadget do not Work
Posted: Sun Mar 11, 2018 1:02 pm
by Cyllceaux
Which manual?
http://www.purebasic.com/documentation/ ... adget.html nope
https://www.purebasic.com/german/docume ... adget.html nope
This gadget supports the SetGadgetColor() and GetGadgetColor() functions with the following values as 'ColorType' to color the dropdown calendar (the edit area cannot be colored)
I mean the dropdown calendar
Re: Color in DateGadget do not Work
Posted: Thu Mar 15, 2018 8:41 pm
by RASHAD
It looks like wrong information in the manual
For Windows
Code: Select all
OpenWindow(0, 0,0,400,300, "", #PB_Window_SystemMenu| #PB_Window_ScreenCentered)
DateGadget(0, 10, 90, 100, 25,"%mm/%dd/%yyyy")
SetGadgetColor(0,#PB_Gadget_FrontColor , #Red)
SetGadgetColor(0, #PB_Gadget_BackColor,RGB(255,255,128))
StringGadget(1, 10, 10, 100, 25, "")
SetGadgetColor(1, #PB_Gadget_BackColor,RGB(255,255,128))
StringGadget(2, 10, 50, 100, 25, "")
SetGadgetColor(2, #PB_Gadget_BackColor,RGB(255,255,128))
ButtonGadget(3,10,265,60,25,"TEST")
SetThemeAppProperties_(1)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
EndSelect
EndSelect
Until Quit = 1
Re: Color in DateGadget do not Work
Posted: Sat Apr 15, 2023 3:27 pm
by Fred
https://learn.microsoft.com/en-us/windo ... setmccolor when Visual Styles are enable, coloring doesn't work anymore.
I tried to remove the theme only for the dropdown window, but it creates other issue (size isn't good anymore). So it's more a Windows change here
Code: Select all
if (((LPNMHDR)lParam)->code == DTN_DROPDOWN)
{
if (MonthCalWindow = (HWND)SendMessage(((LPNMHDR)lParam)->hwndFrom, DTM_GETMONTHCAL, 0, 0))
{
SetWindowTheme(MonthCalWindow, L"", L"");
}
}
Re: Color in DateGadget do not Work
Posted: Fri Sep 15, 2023 9:18 pm
by Andre
Any suggestion for a new remark for DateGadget() docs?