OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
20namespace owl {
21
22#include <owl/preclass.h>
23
24class _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//
34 public:
36 int id,
38 int numImages,
39 int startImage = 0,
40 bool sharedCels = false);
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//
75 public:
77 int id,
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//
95inline int TBitmapGadget::GetImage() const {
96 return CurrentImage;
97}
98
99
100} // OWL namespace
101
102#endif // OWL_BITMAPGA_H
Derived from TGadget, TBitmapGadget is a simple gadget that can display an array of bitmap images one...
Definition bitmapga.h:33
int GetImage() const
Returns the number of the currently selected image.
Definition bitmapga.h:95
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
Definition celarray.h:35
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
Class will send EvEnable message to window, so you can set bitmap, using SetCheck() method of TComman...
Definition bitmapga.h:74
TGadget is the base class for the following derived gadget classes:
Definition gadget.h:120
TBorderStyle
Gadget border styles.
Definition gadget.h:127
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
Base class TGadget and simple derived TSeparatorGadget.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
#define _OWLCLASS
Definition defs.h:338