Okay, I just realised that #PB_Calendar_Normal will reset the
entire calendar
back to normal dates, not just one date... but the docs make it look as though
it sets one specific date as opposed to the whole calendar:
From
http://www.purebasic.com/documentation/ ... state.html :
CalendarGadget(): #PB_Calendar_Bold to make a date appear bold, #PB_Calendar_Normal otherwise.
How could I set a specific date back to normal then? Here's some code that
demonstrates the problem: it makes yesterday, today and tomorrow bold,
then waits 2 seconds, then is supposed to set tomorrow back to normal...
but it makes the entire calendar normal instead, even though I specified
tomorrow's date:
Code: Select all
If OpenWindow(0,200,200,220,200,#PB_Window_SystemMenu,"test")
If CreateGadgetList(WindowID())
CalendarGadget(0,10,10,200,180)
y=Year(Date()) : m=Month(Date()) : d=Day(Date())
SetGadgetItemState(0,Date(y,m,d-1,0,0,0),#PB_Calendar_Bold) ; Yesterday bold.
SetGadgetItemState(0,Date(y,m,d,0,0,0),#PB_Calendar_Bold) ; Today bold.
SetGadgetItemState(0,Date(y,m,d+1,0,0,0),#PB_Calendar_Bold) ; Tomorrow bold.
a=GetTickCount_() : Repeat : Sleep_(1) : WindowEvent() : Until GetTickCount_()>a+2000
SetGadgetItemState(0,Date(y,m,d+1,0,0,0),#PB_Calendar_Normal) ; Tomorrow normal?
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
EndIf