OWLNext    7.0
Borland's Object Windows Library for the modern age
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
22namespace owl {
23
24#include <owl/preclass.h>
25
26// Forward ref.
27//
28class _OWLCLASS TBitmap;
29class _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//
36enum
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)
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)
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//
85class _OWLCLASS TToolbarRes : public TResource<TOOLBARTEMPLATE, RtToolbar> {
86 public:
89
90 TBitmap& GetBitmap();
91 int GetCount() const;
92 ushort* GetIds() const;
93 int GetWidth() const;
94 int GetHeight() const;
95
96 protected:
99 TOOLBARTEMPLATE& TBInfo() const;
100};
101
102//
103/// \class TToolbarBldr
104// ~~~~~ ~~~~~~~~~~~~
106 public:
109 void Build();
110
111 protected:
116};
117
118//
119/// \class TDialogRes
120// ~~~~~ ~~~~~~~~~~
121//
123 public:
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 //
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:
161};
162
163#include <owl/posclass.h>
164
165
166} // OWL namespace
167
168#endif // OWL_RESOURCE_H
169
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
TResource< DLGTEMPLATEEX, static_cast< int >(RtNewDialog)> * NewResource
Definition resource.h:160
TResource< DLGTEMPLATE, static_cast< int >(RtDialog)> * OldResource
Definition resource.h:159
TDlgResText
Enumeration of various strings stored with a dialog resource.
Definition resource.h:146
@ drtClassName
Class name of dialog.
Definition resource.h:148
@ drtMenuName
String of menu resource used by dialog.
Definition resource.h:147
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
Definition gadgetwi.h:122
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
TResource simplifies access to a resource by encapsulating the find, load, lock and free steps for ac...
Definition wsyscls.h:498
HINSTANCE Hinst
Definition resource.h:115
TToolbarRes * TbarRes
Definition resource.h:113
TGadgetWindow & Win
Definition resource.h:112
TBitmap * ToolbarBitmap
Definition resource.h:97
Definition of base most abstract GDI object class, and associated exception class.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Definition gdibase.h:70
@ AutoDelete
Definition gdibase.h:70
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
@ RtDialog
Definition resource.h:38
@ RtNewDialog
Definition resource.h:40
@ RtToolbar
Definition resource.h:39
#define _OWLCLASS
Definition defs.h:338
Structure describing the binary layout of toolbar resources.
Definition resource.h:70
ushort width
Width of each bitmap glyph.
Definition resource.h:72
ushort version
Resource version.
Definition resource.h:71
ushort ids[1]
Array of ids of glyphs+separators.
Definition resource.h:75
ushort height
Height of each bitmap glyph.
Definition resource.h:73
ushort count
Number of glyphs.
Definition resource.h:74
Classes for window system structure and type encapsulation.
Includes windowing system headers, with necessary macros defined.