OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
timegadg.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of class TTimeGadget
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_TIMEGADG_H)
10#define OWL_TIMEGADG_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/textgadg.h>
18#include <owl/time.h>
19
20
21namespace owl {
22
23#include <owl/preclass.h>
24
25//
26/// \class TTimeGadget
27// ~~~~~ ~~~~~~~~~~~
28/// A gadget for displaying a time and/or date message.
29//
31 public:
32
33/// Function prototype of callback invoked to retrieve the correct time.
34 typedef void (*TGetTimeFunc)(tstring&);
35
37 int id = 0,
39 TAlign = Center,
40 uint numChars = 12,
41 LPCTSTR text = 0,
42 TFont* font = 0);
43
45 TGetTimeFunc timeFunc,
46 int id,
48 TAlign,
49 uint numChars,
50 const tstring& text,
51 TFont* font = 0);
52
53 // Override from TGadget
54 //
55 void Created();
56 bool IdleAction(long count);
57
58 static void GetTTime(tstring&);
59 static void GetSystemTime(tstring&);
60 static void GetLocalTime(tstring&);
61
62 private:
63 TGetTimeFunc TimeFunc;
64};
65
66#include <owl/posclass.h>
67
68
69} // OWL namespace
70
71
72#endif // OWL_TIMEGADG_H
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
Definition gdiobjec.h:296
TBorderStyle
Gadget border styles.
Definition gadget.h:127
@ Recessed
Recessed into the window.
Definition gadget.h:131
TAlign
Enumerates the text-alignment attributes.
Definition textgadg.h:42
@ Center
Aligns the text horizontally at the center of the bounding rectangle.
Definition textgadg.h:44
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.
Definition textgadg.cpp:25
static void GetTTime(tstring &)
Retrieves the current time.
Definition timegadg.cpp:80
void Created()
Overriden from TGadget to inform gadget window to setup a timer.
Definition timegadg.cpp:52
bool IdleAction(long count)
Overridden from TGadget to display the current time.
Definition timegadg.cpp:62
static void GetLocalTime(tstring &)
Retrieves the local time using the Win32 API.
Definition timegadg.cpp:115
TTimeGadget(TGetTimeFunc timeFunc=&TTimeGadget::GetSystemTime, int id=0, TBorderStyle=Recessed, TAlign=Center, uint numChars=12, LPCTSTR text=0, TFont *font=0)
Constructor for TTimeGadget.
Definition timegadg.cpp:20
static void GetSystemTime(tstring &)
Retrieves the system time using the Win32 API.
Definition timegadg.cpp:94
void(*) TGetTimeFunc(tstring &)
Function prototype of callback invoked to retrieve the correct time.
Definition timegadg.h:34
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338
Definition of text gadget class TGadget.