48 int style,
uint timeOut, LPCTSTR title,
TModule* module)
67 Attr.Style = WS_POPUP | WS_VISIBLE | WS_BORDER;
74 Attr.Style |= WS_CAPTION;
76 Attr.H += ::GetSystemMetrics( SM_CYCAPTION );
81 int heightPercentDW = 100;
103 const int StaticPercent = 10;
104 Static =
new TStatic(
this, 1,
_T(
""), 0, 0, 0, 0, 0, module);
105 Static->GetWindowAttr().Style |= SS_CENTER;
106 heightPercentDW -= StaticPercent;
111 lmStatic.
Y.
Below(PictWindow, 1);
118 const int GaugePercent = 10;
119 Gauge =
new TGauge(
this,
_T(
"%d%%"), 2, 0, 0, 0, 0,
true, 0, module);
120 heightPercentDW -= GaugePercent;
126 lmGauge.
Y.
Below(Static, 1);
128 lmGauge.
Y.
Below(PictWindow, 1);
161 int deltaH = Gauge->GetWindowAttr().H;
189 CapturedMouse =
true;
201 CapturedMouse =
false;
Pseudo-GDI object Device Independent Bitmap (DIB) class.
TDib()
Protected ctor- derived classes need to fill in handle & get info.
int Width() const
Returns the width of the DIB.
int Height() const
Returns the height of the DIB.
void SetValue(int value)
Set the value of the gauge.
TGauge(TWindow *parent, LPCTSTR title, int id, int x, int y, int w, int h=0, bool isHorizontal=true, int margin=1, TModule *module=0)
General constructor for a TGauge object - Use this constructor if you are creating an object whose fe...
void SetRange(int minValue, int maxValue)
Sets the Min and Max data members to minValue and maxValue values returned by the constructor.
When specifying the layout metrics for a window, four layout constraints are needed.
TEdgeConstraint Y
Y contains the Y (top, center, bottom) edge constraint of the window.
TEdgeOrWidthConstraint Width
Contains the width size constraint, center edge constraint, or right edge (lmRight) constraint of the...
TEdgeOrHeightConstraint Height
Contains the height size constraint, center edge constraint, or bottom edge constraint of the window.
TEdgeConstraint X
X contains the X (left, center, right) edge constraint of the window.
Derived from TWindow, TLayoutWindow provides functionality for defining the layout metrics for a wind...
TLayoutWindow(TWindow *parent, LPCTSTR title=0, TModule *module=0)
Creates a TLayoutWindow object with specified parent, window caption, and library ID.
void SetChildLayoutMetrics(TWindow &child, const TLayoutMetrics &metrics)
Sets the metrics for the window and removes any existing ones.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
bool PumpWaitingMessages()
The inner message loop.
TDisplayHow
How to display the bitmap within the window.
@ UpperLeft
Displays the DIB in the upper left corner of the window.
TPictureWindow(TWindow *parent, TDib *dib, TDisplayHow=UpperLeft, LPCTSTR title=0, TModule *module=0)
Constructor for this class. Assumes ownership of the DIB passed in.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
TRect & Inflate(int dx, int dy)
Inflates a rectangle inflated by the given delta arguments.
int Width() const
Returns the width of this rectangle (right - left).
This class creates a layout window that contains a TPictureWindow and optionally, a TStatic and a TGa...
uint GetTimeOut() const
Returns the number of milliseconds for the splash window to automatically close.
void SetPercentDone(int percent)
Sets the percentage done for the gauge control.
void CleanupWindow() override
Before the window closes, and if the mouse has been captured, this releases it now.
void EvTimer(uint timerId)
Handler for the timer event. Closes the window.
void SetText(LPCTSTR text)
Changes the text within the static control.
void SetupWindow() override
After the window has been created, this centers the window and makes it topmost.
bool HasStyle(TStyle) const
Determines if the splash window has a particular style.
TSplashWindow(const TDib &dib, int width, int height, int style=None, uint timeOut=0, LPCTSTR title=0, TModule *module=0)
Constructor to create a splash screen.
~TSplashWindow() override
Deletes the child controls.
@ MakeGauge
Display a gauge to indicate progess.
@ MakeStatic
Display a text control.
@ ShrinkToFit
Resizes window to fit bitmap.
@ CaptureMouse
Capture mouse clicks.
TStatic * GetStatic()
Returns the static control used by the splash window.
void EvLButtonDown(uint modKeys, const TPoint &point)
If the user clicks on the splash screen and the CaptureMouse style is on, this closes the splash scre...
TGauge * GetGauge()
Returns the gauge used by the splash window.
TStatic(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, uint textLen=0, TModule *=nullptr)
Constructs a static control object with the supplied parent window (parent), control ID (Id),...
void SetText(LPCTSTR str)
Sets the static control's text to the string supplied in str.
static const TUIMetric CxScreen
static const TUIMetric CyScreen
bool SetCursor(TModule *module, TResId resId)
Sets the mouse cursor for the window, loading the given resId from the given module.
HWND SetCapture()
Sets the mouse capture to the current window.
bool KillTimer(UINT_PTR timerId)
Gets rid of the timer and removes any WM_TIMER messages from the message queue.
TApplication * GetApplication() const
Gets a pointer to the TApplication object associated with this.
bool SetWindowPos(HWND hWndInsertAfter, const TRect &rect, uint flags)
Changes the size of the window pointed to by rect.
virtual bool Create()
Creates the window interface element to be associated with this ObjectWindows interface element.
static void ReleaseCapture()
Releases the mouse capture from this window.
bool IsWindow() const
Returns true if an HWND is being used.
void GetWindowRect(TRect &rect) const
Gets the screen coordinates of the window's rectangle and copies them into rect.
UINT_PTR SetTimer(UINT_PTR timerId, uint timeout, TIMERPROC proc=0)
Creates a timer object associated with this window.
void UpdateWindow()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
virtual void SetupWindow()
Performs setup following creation of an associated MS-Windows window.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of class TGauge, a gauge control encapsulation & implementation.
Definition of abstract GDI object class and derived classes.
#define lmParent
Use to represent the parent in layout metrics.
@ lmTop
The top edge of the window.
@ lmLeft
The left edge of the window.
Definition of classes TLayoutMetrics & TLayoutWindow.
Object Windows Library (OWLNext Core).
const int PercentThreshold
Definition of class TPictureWindow.
Definition of class TSplashWindow.
Definition of class TStatic, the class for static controls and base for any control that manages simp...
void Below(TWindow *sibling, int margin=0)
Positions your window with respect to a sibling window.
void SameAs(TWindow *otherWin, TEdge edge)
Sets the edge of your window indicated by edge equivalent to the corresponding edge of the window in ...
void PercentOf(TWindow *otherWin, TEdge edge, int percent)
void SameAs(TWindow *otherWin, TEdge edge)
Definition of TUIMetric, a UI metrics provider class.