OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
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
19
namespace
owl
{
20
21
22
#include <
owl/preclass.h
>
23
24
25
class
_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
//
35
class
_OWLCLASS
TPictureWindow
:
public
TWindow
{
36
public
:
37
38
/// How to display the bitmap within the window
39
//
40
enum
TDisplayHow
{
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
52
TPictureWindow
(
53
TWindow
* parent,
54
TDib
* dib,
55
TDisplayHow,
56
const
tstring
& title,
57
TModule
* module = 0);
58
59
~TPictureWindow
();
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
//
93
inline
TDib*
94
TPictureWindow::GetDib
()
const
95
{
96
return
Dib;
97
}
98
99
//
100
// Return how the picture is displayed.
101
//
102
inline
TPictureWindow::TDisplayHow
103
TPictureWindow::GetHowToDisplay
()
const
104
{
105
return
HowToDisplay;
106
}
107
108
}
// OWL namespace
109
110
111
#endif
// OWL_PICTWIND_H
owl::TDC
TDC is the root class for GDI DC wrappers.
Definition
dc.h:64
owl::TDib
Pseudo-GDI object Device Independent Bitmap (DIB) class.
Definition
gdiobjec.h:795
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TPictureWindow
This class displays a dib in a window in different ways.
Definition
pictwind.h:35
owl::TPictureWindow::GetHowToDisplay
TDisplayHow GetHowToDisplay() const
Definition
pictwind.h:103
owl::TPictureWindow::GetDib
TDib * GetDib() const
Definition
pictwind.h:94
owl::TPictureWindow::TDisplayHow
TDisplayHow
How to display the bitmap within the window.
Definition
pictwind.h:40
owl::TPictureWindow::Stretch
@ Stretch
Stretch to fit or shrink to fit.
Definition
pictwind.h:43
owl::TPictureWindow::Center
@ Center
Always centered.
Definition
pictwind.h:42
owl::TPictureWindow::UpperLeft
@ UpperLeft
Displays the DIB in the upper left corner of the window.
Definition
pictwind.h:41
owl::TPictureWindow::TPictureWindow
TPictureWindow(TWindow *parent, TDib *dib, TDisplayHow=UpperLeft, LPCTSTR title=0, TModule *module=0)
Constructor for this class. Assumes ownership of the DIB passed in.
Definition
pictwind.cpp:22
owl::TRect
TRect is a mathematical class derived from tagRect.
Definition
geometry.h:308
owl::TWindowClassName
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition
module.h:50
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
owl::TWindow::TWindow
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
Definition
window.cpp:341
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::tstring
std::string tstring
Definition
defs.h:79
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
window.h
Base window class TWindow definition, including HWND encapsulation.
include
owl
pictwind.h
Generated by
1.18.0