OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
pictwind.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 TPictureWindow
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_PICTWIND_H)
10#define OWL_PICTWIND_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/window.h>
18
19namespace owl {
20
21
22#include <owl/preclass.h>
23
24
25class _OWLCLASS TDib;
26
27/// \addtogroup ctrl
28/// @{
29/// \class TPictureWindow
30// ~~~~~ ~~~~~~~~~~~~~~
31/// This class displays a dib in a window in different ways.
32/// The dib is owned by the window and will be deleted when the window is
33/// deleted.
34//
36 public:
37
38 /// How to display the bitmap within the window
39 //
41 UpperLeft = 0, ///< Displays the DIB in the upper left corner of the window
42 Center, ///< Always centered
43 Stretch, ///< Stretch to fit or shrink to fit
44 // Scroll, // implies Upperleft ///TH to be implemented
45 };
46
47 // constructor and destructor
48 //
49 TPictureWindow(TWindow* parent, TDib* dib, TDisplayHow = UpperLeft,
50 LPCTSTR title = 0, TModule* module = 0);
51
53 TWindow* parent,
54 TDib* dib,
55 TDisplayHow,
56 const tstring& title,
57 TModule* module = 0);
58
60
61 // Use new dib and return old dib
62 //
63 TDib* SetDib(TDib* newDib);
64 TDib* GetDib() const;
65
66 void SetHowToDisplay(TDisplayHow how);
67 TDisplayHow GetHowToDisplay() const;
68
69 // overridden from TWindow for CS_HREDRAW and CS_VREDRAW
70 //
71 virtual auto GetWindowClassName() -> TWindowClassName;
72 void GetWindowClass(WNDCLASS& wndClass);
73
74 protected:
75 void Paint(TDC& dc, bool erase, TRect& rect);
76
77 private:
78 TDib* Dib;
79 TDisplayHow HowToDisplay;
80};
81/// @}
82
83#include <owl/posclass.h>
84
85
86//----------------------------------------------------------------------------
87// Inline implementations
88//
89
90//
91// Return the dib.
92//
93inline TDib*
95{
96 return Dib;
97}
98
99//
100// Return how the picture is displayed.
101//
104{
105 return HowToDisplay;
106}
107
108} // OWL namespace
109
110
111#endif // OWL_PICTWIND_H
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
Pseudo-GDI object Device Independent Bitmap (DIB) class.
Definition gdiobjec.h:795
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
This class displays a dib in a window in different ways.
Definition pictwind.h:35
TDisplayHow GetHowToDisplay() const
Definition pictwind.h:103
TDib * GetDib() const
Definition pictwind.h:94
TDisplayHow
How to display the bitmap within the window.
Definition pictwind.h:40
@ Stretch
Stretch to fit or shrink to fit.
Definition pictwind.h:43
@ Center
Always centered.
Definition pictwind.h:42
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:47
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
#define _OWLCLASS
Definition defs.h:338
Base window class TWindow definition, including HWND encapsulation.