7#if !defined(OWL_TIMEGADG_H)
24 TTextGadget(id, border, align, numChars, text, font),
42 :
TTextGadget(id, border, align, numChars, text, font),
98 LCID lcid = ::GetUserDefaultLCID();
99 SYSTEMTIME systemTime;
102 if (::GetTimeFormat(lcid, LOCALE_NOUSEROVERRIDE, &systemTime,
nullptr, timeBuffer, 100)) {
103 if (::GetDateFormat(lcid, LOCALE_NOUSEROVERRIDE, &systemTime,
nullptr, dateBuffer, 100)) {
104 newTime += dateBuffer;
106 newTime += timeBuffer;
119 LCID lcid = ::GetUserDefaultLCID();
120 SYSTEMTIME systemTime;
123 if (::GetTimeFormat(lcid, LOCALE_NOUSEROVERRIDE, &systemTime,
nullptr, timeBuffer, 100)) {
124 if (::GetDateFormat(lcid, LOCALE_NOUSEROVERRIDE, &systemTime,
nullptr, dateBuffer, 100)) {
125 newTime += dateBuffer;
127 newTime += timeBuffer;
Pointer to an array of type T.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
virtual bool IdleAction(long idleCount)
Called during idle time to allow the gadget to perform any idle actions.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
virtual void Created()
This is the virtual called after the window holding a gadget has been created.
void SetShrinkWrap(bool shrinkWrapWidth, bool shrinkWrapHeight)
Simple set accessor to set whether shrinkwrapping is performed horizontally and/or vertically.
TBorderStyle
Gadget border styles.
bool EnableTimer()
Inform GadgetWindow to start a Timer notification.
TAlign
Enumerates the text-alignment attributes.
void SetText(LPCTSTR text)
Set the text for this gadget.
TTextGadget(int id=0, TBorderStyle=Recessed, TAlign=Left, uint numChars=10, LPCTSTR text=0, TFont *font=0)
Constructs a TTextGadget object with the specified ID, border style, and alignment.
static void GetTTime(tstring &)
Retrieves the current time.
void Created()
Overriden from TGadget to inform gadget window to setup a timer.
bool IdleAction(long count)
Overridden from TGadget to display the current time.
static void GetLocalTime(tstring &)
Retrieves the local time using the Win32 API.
TTimeGadget(TGetTimeFunc timeFunc=&TTimeGadget::GetSystemTime, int id=0, TBorderStyle=Recessed, TAlign=Center, uint numChars=12, LPCTSTR text=0, TFont *font=0)
Constructor for TTimeGadget.
static void GetSystemTime(tstring &)
Retrieves the system time using the Win32 API.
void(*) TGetTimeFunc(tstring &)
Function prototype of callback invoked to retrieve the correct time.
The TTime class encapsulates time functions and characteristics.
tstring AsString() const
Returns a string object containing the time.
Object Windows Library (OWLNext Core).
Various types of smart pointer templatized classes.
Definition of class TTimeGadget.