OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
resource.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Defines classes handling Windows resources
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_RESOURCE_H)
10
# define OWL_RESOURCE_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/gdibase.h
>
18
#include <
owl/wsysinc.h
>
19
#include <
owl/wsyscls.h
>
20
21
22
namespace
owl
{
23
24
#include <
owl/preclass.h
>
25
26
// Forward ref.
27
//
28
class
_OWLCLASS
TBitmap
;
29
class
_OWLCLASS
TGadgetWindow
;
30
31
//
32
// Compile-time constants for predefined resource types.
33
// Note: These values must correspond to the definitions
34
// in the Windows API.
35
//
36
enum
37
{
38
RtDialog
= 0x0005,
// RT_DIALOG
39
RtToolbar
= 0x00F1,
// RT_TOOLBAR
40
RtNewDialog
= 0x2005,
// RT_NEWDIALOG
41
};
42
43
//
44
//
45
//
46
# if !defined(DLGTEMPLATEEX_DEFINED)
47
struct
DLGTEMPLATEEX
{
48
ushort
version
;
49
ushort
signature
;
50
uint32
helpId
;
51
uint32
exStyle
;
52
uint32
style
;
53
ushort
itemCount
;
54
short
x
;
55
short
y
;
56
short
cx
;
57
short
cy
;
58
// wchar_t MenuName[]; // Name or ordinal
59
// wchar_t ClassName[]; // Name or ordinal
60
// wchar_t CaptionText[];
61
};
62
# define DLGTEMPLATEEX_DEFINED
63
# endif
64
65
//
66
/// Structure describing the binary layout of toolbar resources
67
/// \note Toolbar resource is only available in 32-bit
68
//
69
# if !defined(TOOLBARTEMPLATE_DEFINED)
70
struct
TOOLBARTEMPLATE
{
71
ushort
version
;
///< Resource version
72
ushort
width
;
///< Width of each bitmap glyph
73
ushort
height
;
///< Height of each bitmap glyph
74
ushort
count
;
///< Number of glyphs
75
ushort
ids
[1];
///< Array of ids of glyphs+separators
76
};
77
# define TOOLBARTEMPLATE_DEFINED
78
# endif
79
80
81
//
82
/// \class TToolbarRes
83
// ~~~~~ ~~~~~~~~~~~
84
//
85
class
_OWLCLASS
TToolbarRes
:
public
TResource
<TOOLBARTEMPLATE, RtToolbar> {
86
public
:
87
TToolbarRes
(HINSTANCE hInst,
TResId
id
,
TAutoDelete
del =
AutoDelete
);
88
~TToolbarRes
();
89
90
TBitmap
&
GetBitmap
();
91
int
GetCount
()
const
;
92
ushort
*
GetIds
()
const
;
93
int
GetWidth
()
const
;
94
int
GetHeight
()
const
;
95
96
protected
:
97
TBitmap
*
ToolbarBitmap
;
98
bool
ShouldDelete
;
99
TOOLBARTEMPLATE
&
TBInfo
()
const
;
100
};
101
102
//
103
/// \class TToolbarBldr
104
// ~~~~~ ~~~~~~~~~~~~
105
class
_OWLCLASS
TToolbarBldr
{
106
public
:
107
TToolbarBldr
(
TGadgetWindow
& win,
TResId
id
, HINSTANCE hinst = 0);
108
~TToolbarBldr
();
109
void
Build
();
110
111
protected
:
112
TGadgetWindow
&
Win
;
113
TToolbarRes
*
TbarRes
;
114
TResId
Id
;
115
HINSTANCE
Hinst
;
116
};
117
118
//
119
/// \class TDialogRes
120
// ~~~~~ ~~~~~~~~~~
121
//
122
class
_OWLCLASS
TDialogRes
{
123
public
:
124
TDialogRes
(HINSTANCE hInstance,
TResId
id
);
125
TDialogRes
(HINSTANCE hInstance,
TResId
id
, LANGID langid);
126
~TDialogRes
();
127
128
// Validate resource was found, loaded & locked
129
//
130
bool
IsOK
()
const
;
131
132
// Retrieve information about the underlying binary template
133
//
134
bool
IsDialogEx
()
const
;
135
DLGTEMPLATEEX
*
GetTemplateEx
()
const
;
136
DLGTEMPLATE*
GetTemplate
()
const
;
137
DWORD
GetSize
()
const
;
138
139
// Querry about info. stored in template
140
//
141
void
GetRect
(
TRect
& rect)
const
;
142
143
//
144
/// Enumeration of various strings stored with a dialog resource
145
//
146
enum
TDlgResText
{
147
drtMenuName
,
///< String of menu resource used by dialog
148
drtClassName
,
///< Class name of dialog
149
drtCaption
///< Caption of dialog
150
};
151
152
//
153
// Retrieve a particular string from the resource
154
//
155
int
GetText(LPTSTR buffer,
int
size,
156
TDlgResText which = drtCaption)
const
;
157
158
protected
:
159
TResource<DLGTEMPLATE, static_cast<int>
(
RtDialog
)>*
OldResource
;
160
TResource<DLGTEMPLATEEX, static_cast<int>
(
RtNewDialog
)>*
NewResource
;
161
};
162
163
#include <
owl/posclass.h
>
164
165
166
}
// OWL namespace
167
168
#endif
// OWL_RESOURCE_H
169
owl::TBitmap
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition
gdiobjec.h:510
owl::TDialogRes::GetSize
DWORD GetSize() const
Definition
resource.cpp:103
owl::TDialogRes::NewResource
TResource< DLGTEMPLATEEX, static_cast< int >(RtNewDialog)> * NewResource
Definition
resource.h:160
owl::TDialogRes::GetTemplateEx
DLGTEMPLATEEX * GetTemplateEx() const
Definition
resource.cpp:89
owl::TDialogRes::TDialogRes
TDialogRes(HINSTANCE hInstance, TResId id)
Definition
resource.cpp:30
owl::TDialogRes::OldResource
TResource< DLGTEMPLATE, static_cast< int >(RtDialog)> * OldResource
Definition
resource.h:159
owl::TDialogRes::IsDialogEx
bool IsDialogEx() const
Definition
resource.cpp:81
owl::TDialogRes::GetRect
void GetRect(TRect &rect) const
Definition
resource.cpp:113
owl::TDialogRes::TDlgResText
TDlgResText
Enumeration of various strings stored with a dialog resource.
Definition
resource.h:146
owl::TDialogRes::drtCaption
@ drtCaption
Caption of dialog.
Definition
resource.h:149
owl::TDialogRes::drtClassName
@ drtClassName
Class name of dialog.
Definition
resource.h:148
owl::TDialogRes::drtMenuName
@ drtMenuName
String of menu resource used by dialog.
Definition
resource.h:147
owl::TDialogRes::IsOK
bool IsOK() const
Definition
resource.cpp:70
owl::TDialogRes::GetTemplate
DLGTEMPLATE * GetTemplate() const
Definition
resource.cpp:96
owl::TGadgetWindow
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
Definition
gadgetwi.h:122
owl::TRect
TRect is a mathematical class derived from tagRect.
Definition
geometry.h:308
owl::TResId
Definition
wsyscls.h:206
owl::TResource
TResource simplifies access to a resource by encapsulating the find, load, lock and free steps for ac...
Definition
wsyscls.h:498
owl::TResource< TOOLBARTEMPLATE, RtToolbar >::TResource
TResource(HINSTANCE hModule, TResId resId)
Definition
wsyscls.h:619
owl::TToolbarBldr::TToolbarBldr
TToolbarBldr(TGadgetWindow &win, TResId id, HINSTANCE hinst=0)
Definition
resource.cpp:252
owl::TToolbarBldr::Hinst
HINSTANCE Hinst
Definition
resource.h:115
owl::TToolbarBldr::Id
TResId Id
Definition
resource.h:114
owl::TToolbarBldr::Build
void Build()
Definition
resource.cpp:275
owl::TToolbarBldr::TbarRes
TToolbarRes * TbarRes
Definition
resource.h:113
owl::TToolbarBldr::Win
TGadgetWindow & Win
Definition
resource.h:112
owl::TToolbarRes
Definition
resource.h:85
owl::TToolbarRes::TToolbarRes
TToolbarRes(HINSTANCE hInst, TResId id, TAutoDelete del=AutoDelete)
Definition
resource.cpp:173
owl::TToolbarRes::GetIds
ushort * GetIds() const
Definition
resource.cpp:226
owl::TToolbarRes::GetBitmap
TBitmap & GetBitmap()
Definition
resource.cpp:207
owl::TToolbarRes::GetCount
int GetCount() const
Definition
resource.cpp:217
owl::TToolbarRes::ToolbarBitmap
TBitmap * ToolbarBitmap
Definition
resource.h:97
owl::TToolbarRes::GetWidth
int GetWidth() const
Definition
resource.cpp:235
owl::TToolbarRes::TBInfo
TOOLBARTEMPLATE & TBInfo() const
Definition
resource.cpp:198
owl::TToolbarRes::GetHeight
int GetHeight() const
Definition
resource.cpp:244
owl::TToolbarRes::ShouldDelete
bool ShouldDelete
Definition
resource.h:98
gdibase.h
Definition of base most abstract GDI object class, and associated exception class.
owl::TAutoDelete
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Definition
gdibase.h:70
owl::AutoDelete
@ AutoDelete
Definition
gdibase.h:70
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::ushort
unsigned short ushort
Definition
number.h:24
owl::RtDialog
@ RtDialog
Definition
resource.h:38
owl::RtNewDialog
@ RtNewDialog
Definition
resource.h:40
owl::RtToolbar
@ RtToolbar
Definition
resource.h:39
owl::uint32
unsigned long uint32
Definition
number.h:34
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
owl::DLGTEMPLATEEX
Definition
resource.h:47
owl::DLGTEMPLATEEX::version
ushort version
Definition
resource.h:48
owl::DLGTEMPLATEEX::cy
short cy
Definition
resource.h:57
owl::DLGTEMPLATEEX::itemCount
ushort itemCount
Definition
resource.h:53
owl::DLGTEMPLATEEX::x
short x
Definition
resource.h:54
owl::DLGTEMPLATEEX::style
uint32 style
Definition
resource.h:52
owl::DLGTEMPLATEEX::cx
short cx
Definition
resource.h:56
owl::DLGTEMPLATEEX::exStyle
uint32 exStyle
Definition
resource.h:51
owl::DLGTEMPLATEEX::y
short y
Definition
resource.h:55
owl::DLGTEMPLATEEX::helpId
uint32 helpId
Definition
resource.h:50
owl::DLGTEMPLATEEX::signature
ushort signature
Definition
resource.h:49
owl::TOOLBARTEMPLATE
Structure describing the binary layout of toolbar resources.
Definition
resource.h:70
owl::TOOLBARTEMPLATE::width
ushort width
Width of each bitmap glyph.
Definition
resource.h:72
owl::TOOLBARTEMPLATE::version
ushort version
Resource version.
Definition
resource.h:71
owl::TOOLBARTEMPLATE::ids
ushort ids[1]
Array of ids of glyphs+separators.
Definition
resource.h:75
owl::TOOLBARTEMPLATE::height
ushort height
Height of each bitmap glyph.
Definition
resource.h:73
owl::TOOLBARTEMPLATE::count
ushort count
Number of glyphs.
Definition
resource.h:74
wsyscls.h
Classes for window system structure and type encapsulation.
wsysinc.h
Includes windowing system headers, with necessary macros defined.
include
owl
resource.h
Generated by
1.18.0