OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
bitmapga.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1993, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Definition of class TBitmapGadget
7
/// Definition of class TDynamicBitmapGadget
8
//----------------------------------------------------------------------------
9
10
#if !defined(OWL_BITMAPGA_H)
11
#define OWL_BITMAPGA_H
12
13
#include <
owl/private/defs.h
>
14
#if defined(BI_HAS_PRAGMA_ONCE)
15
# pragma once
16
#endif
17
18
#include <
owl/gadget.h
>
19
20
namespace
owl
{
21
22
#include <
owl/preclass.h
>
23
24
class
_OWLCLASS
TCelArray
;
25
26
/// \addtogroup gadgets
27
/// @{
28
/// \class TBitmapGadget
29
// ~~~~~ ~~~~~~~~~~~~~
30
/// Derived from TGadget, TBitmapGadget is a simple gadget that can display an array
31
/// of bitmap images one at a time.
32
//
33
class
_OWLCLASS
TBitmapGadget
:
public
TGadget
{
34
public
:
35
TBitmapGadget
(
TResId
imageResIdOrIndex,
36
int
id
,
37
TBorderStyle
borderStyle,
38
int
numImages,
39
int
startImage = 0,
40
bool
sharedCels =
false
);
41
~TBitmapGadget
();
42
43
int
SelectImage
(
int
imageNum,
bool
immediate);
44
int
GetImage
()
const
;
45
46
void
SysColorChange
();
47
48
protected
:
49
void
Paint
(
TDC
& dc);
50
51
void
SetBounds
(
const
TRect
& boundRect);
52
void
GetDesiredSize
(
TSize
& size);
53
54
virtual
TCelArray
*
CreateCelArray
(
TResId
resId,
int
numImages)
const
;
55
56
private
:
57
TResId
ResId;
///< Resource id of the bitmap image; 0 if the common TGadgetWindow bitmap image is
58
///< used for this gadget.
59
TCelArray
* ImageArray;
///< Bitmap images.
60
int
ImageIndex;
///< Beginning index image to use in the common TGadgetWindow bitmap image for this
61
///< gadget (ie. selecting image 0 selects the image at this index.
62
int
CurrentImage;
///< 0-based index of the current image to display.
63
int
NumImages;
///< Number of equally sized images contained in the bitmap.
64
TPoint
BitmapOrigin;
///< Point that bitmap image should be drawn at.
65
};
66
67
//
68
/// \class TDynamicBitmapGadget
69
// ~~~~~ ~~~~~~~~~~~~~~~~~~~~
70
/// Class will send EvEnable message to window,
71
/// so you can set bitmap, using SetCheck() method of
72
/// TCommandEnabler
73
//
74
class
_OWLCLASS
TDynamicBitmapGadget
:
public
TBitmapGadget
{
75
public
:
76
TDynamicBitmapGadget
(
TResId
imageResIdOrIndex,
77
int
id
,
78
TBorderStyle
borderStyle,
79
int
numImages,
80
int
startImage = 0,
81
bool
sharedCels =
false
);
82
public
:
83
virtual
void
CommandEnable
();
84
};
85
/// @}
86
87
88
#include <
owl/posclass.h
>
89
90
//
91
// Inline implementations
92
//
93
/// Returns the number of the currently selected image.
94
//
95
inline
int
TBitmapGadget::GetImage
()
const
{
96
return
CurrentImage;
97
}
98
99
100
}
// OWL namespace
101
102
#endif
// OWL_BITMAPGA_H
owl::TBitmapGadget::SetBounds
void SetBounds(const TRect &boundRect)
Set the bounding rect for this button gadget.
Definition
bitmapga.cpp:100
owl::TBitmapGadget::SysColorChange
void SysColorChange()
When the system colors have been changed, SysColorChange is called by the gadget window's EvSysColorC...
Definition
bitmapga.cpp:75
owl::TBitmapGadget::GetImage
int GetImage() const
Returns the number of the currently selected image.
Definition
bitmapga.h:95
owl::TBitmapGadget::TBitmapGadget
TBitmapGadget(TResId imageResIdOrIndex, int id, TBorderStyle borderStyle, int numImages, int startImage=0, bool sharedCels=false)
Construct a bitmap gadget.
Definition
bitmapga.cpp:31
owl::TBitmapGadget::Paint
void Paint(TDC &dc)
Paint this bitmap gadget. Uses normal borders, plus draws the image centered.
Definition
bitmapga.cpp:164
owl::TBitmapGadget::SelectImage
int SelectImage(int imageNum, bool immediate)
Choose the relative image to display.
Definition
bitmapga.cpp:144
owl::TBitmapGadget::CreateCelArray
virtual TCelArray * CreateCelArray(TResId resId, int numImages) const
Definition
bitmapga.cpp:84
owl::TBitmapGadget::GetDesiredSize
void GetDesiredSize(TSize &size)
Find out how big this bitmap gadget wants to be.
Definition
bitmapga.cpp:128
owl::TCelArray
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
Definition
celarray.h:35
owl::TDC
TDC is the root class for GDI DC wrappers.
Definition
dc.h:64
owl::TDynamicBitmapGadget::TDynamicBitmapGadget
TDynamicBitmapGadget(TResId imageResIdOrIndex, int id, TBorderStyle borderStyle, int numImages, int startImage=0, bool sharedCels=false)
TDynamicBitmapGadget Constructor.
Definition
bitmapga.cpp:223
owl::TDynamicBitmapGadget::CommandEnable
virtual void CommandEnable()
Definition
bitmapga.cpp:233
owl::TGadget::TGadget
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
Definition
gadget.cpp:88
owl::TGadget::TBorderStyle
TBorderStyle
Gadget border styles.
Definition
gadget.h:127
owl::TPoint
TPoint is a support class, derived from tagPOINT.
Definition
geometry.h:87
owl::TRect
TRect is a mathematical class derived from tagRect.
Definition
geometry.h:308
owl::TResId
Definition
wsyscls.h:206
owl::TSize
The tagSIZE struct is defined as.
Definition
geometry.h:234
gadget.h
Base class TGadget and simple derived TSeparatorGadget.
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
bitmapga.h
Generated by
1.18.0