OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
splashwi.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 TSplashWindow
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_SPLASHWI_H)
10
#define OWL_SPLASHWI_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/layoutwi.h
>
18
19
20
namespace
owl
{
21
22
#include <
owl/preclass.h
>
23
24
class
_OWLCLASS
TDib
;
25
class
_OWLCLASS
TPictureWindow
;
26
class
_OWLCLASS
TStatic
;
27
class
_OWLCLASS
TGauge
;
28
29
//
30
/// \class TSplashWindow
31
// ~~~~~ ~~~~~~~~~~~~~
32
/// This class creates a layout window that contains a TPictureWindow and
33
/// optionally, a TStatic and a TGauge.
34
///
35
/// The purpose is to display a temporary window that contains a bitmap
36
/// and other information.
37
///
38
/// The temporary window can be closed by
39
/// - a mouse click if the style has CaptureMouse turned on
40
/// - a passage of time if the TimeOut data member is non-zero
41
/// - explicitly deleting the TSplashWindow or calling its CloseWindow()
42
//
43
class
_OWLCLASS
TSplashWindow
:
public
TLayoutWindow
{
44
public
:
45
/// Styles for the splash window.
46
//
47
enum
TStyle
{
48
None
= 0x0000,
///< No styles are applied
49
ShrinkToFit
= 0x0001,
///< Resizes window to fit bitmap
50
MakeGauge
= 0x0002,
///< Display a gauge to indicate progess
51
MakeStatic
= 0x0004,
///< Display a text control
52
CaptureMouse
= 0x0008,
///< Capture mouse clicks
53
};
54
55
// Constructor/destructor
56
//
57
TSplashWindow
(
const
TDib
& dib,
58
int
width,
59
int
height,
60
int
style = None,
61
uint
timeOut = 0,
// in milliseconds
62
LPCTSTR title = 0,
63
TModule
* module = 0);
64
~TSplashWindow
()
override
;
65
66
// Methods
67
//
68
void
SetText(LPCTSTR text);
69
void
SetText
(
const
tstring
& text) {
SetText
(text.c_str());}
70
void
SetPercentDone(
int
percent);
71
72
// Overridden TWindow virtuals
73
//
74
auto
Create() ->
bool
override
;
75
76
protected
:
77
void
SetupWindow()
override
;
78
void
CleanupWindow()
override
;
79
80
// Respond to messages
81
//
82
void
EvLButtonDown(
uint
modKeys,
const
TPoint
& point);
83
void
EvTimer(
uint
timerId);
84
85
// Accessors
86
//
87
bool
HasStyle(TStyle)
const
;
88
uint
GetStyle()
const
;
89
TStatic
* GetStatic();
90
TGauge
* GetGauge();
91
uint
GetTimeOut()
const
;
92
93
private
:
94
uint
Style;
95
TStatic
* Static;
96
TGauge
* Gauge;
97
TPictureWindow
* PictWindow;
98
uint
TimeOut;
99
bool
CapturedMouse;
100
101
DECLARE_RESPONSE_TABLE
(
TSplashWindow
);
102
};
103
104
#include <
owl/posclass.h
>
105
106
107
//----------------------------------------------------------------------------
108
// Inline implementations
109
//
110
111
//
112
/// Determines if the splash window has a particular style.
113
//
114
inline
bool
TSplashWindow::HasStyle
(
TStyle
style)
const
115
{
116
return
ToBool
((
GetStyle
() & style) ==
static_cast<
uint
>
(style));
117
}
118
119
//
120
/// Returns the current style of the splash window.
121
//
122
inline
uint
TSplashWindow::GetStyle
()
const
123
{
124
return
Style;
125
}
126
127
//
128
/// Returns the static control used by the splash window. The static control is only
129
/// created if the style includes MakeStatic.
130
//
131
inline
TStatic
*
TSplashWindow::GetStatic
()
132
{
133
return
Static;
134
}
135
136
//
137
/// Returns the gauge used by the splash window. The gauge control is only created
138
/// if the style includes MakeGauge.
139
//
140
inline
TGauge
*
TSplashWindow::GetGauge
()
141
{
142
return
Gauge;
143
}
144
145
//
146
/// Returns the number of milliseconds for the splash window to automatically close.
147
//
148
inline
uint
TSplashWindow::GetTimeOut
()
const
149
{
150
return
TimeOut;
151
}
152
153
154
}
// OWL namespace
155
156
157
#endif
// OWL_SPLASHWI_H
owl::TDib
Pseudo-GDI object Device Independent Bitmap (DIB) class.
Definition
gdiobjec.h:795
owl::TGauge
A streamable class derived from TControl, TGauge defines the basic behavior of gauge controls.
Definition
gauge.h:44
owl::TLayoutWindow::TLayoutWindow
TLayoutWindow(TWindow *parent, LPCTSTR title=0, TModule *module=0)
Creates a TLayoutWindow object with specified parent, window caption, and library ID.
Definition
layoutwi.cpp:262
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TPictureWindow
This class displays a dib in a window in different ways.
Definition
pictwind.h:35
owl::TPoint
TPoint is a support class, derived from tagPOINT.
Definition
geometry.h:87
owl::TSplashWindow
This class creates a layout window that contains a TPictureWindow and optionally, a TStatic and a TGa...
Definition
splashwi.h:43
owl::TSplashWindow::GetTimeOut
uint GetTimeOut() const
Returns the number of milliseconds for the splash window to automatically close.
Definition
splashwi.h:148
owl::TSplashWindow::SetText
void SetText(const tstring &text)
Definition
splashwi.h:69
owl::TSplashWindow::HasStyle
bool HasStyle(TStyle) const
Determines if the splash window has a particular style.
Definition
splashwi.h:114
owl::TSplashWindow::TSplashWindow
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.
Definition
splashwi.cpp:47
owl::TSplashWindow::TStyle
TStyle
Styles for the splash window.
Definition
splashwi.h:47
owl::TSplashWindow::MakeGauge
@ MakeGauge
Display a gauge to indicate progess.
Definition
splashwi.h:50
owl::TSplashWindow::None
@ None
No styles are applied.
Definition
splashwi.h:48
owl::TSplashWindow::MakeStatic
@ MakeStatic
Display a text control.
Definition
splashwi.h:51
owl::TSplashWindow::ShrinkToFit
@ ShrinkToFit
Resizes window to fit bitmap.
Definition
splashwi.h:49
owl::TSplashWindow::CaptureMouse
@ CaptureMouse
Capture mouse clicks.
Definition
splashwi.h:52
owl::TSplashWindow::GetStyle
uint GetStyle() const
Returns the current style of the splash window.
Definition
splashwi.h:122
owl::TSplashWindow::GetStatic
TStatic * GetStatic()
Returns the static control used by the splash window.
Definition
splashwi.h:131
owl::TSplashWindow::GetGauge
TGauge * GetGauge()
Returns the gauge used by the splash window.
Definition
splashwi.h:140
owl::TStatic
An interface object that represents a static text interface element.
Definition
static.h:36
DECLARE_RESPONSE_TABLE
#define DECLARE_RESPONSE_TABLE(cls)
Definition
eventhan.h:436
layoutwi.h
Definition of classes TLayoutMetrics & TLayoutWindow.
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::ToBool
bool ToBool(const T &t)
Definition
defs.h:291
owl::tstring
std::string tstring
Definition
defs.h:79
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
splashwi.h
Generated by
1.18.0