OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
controlg.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Class TControlGadget definition. TControlGadget is a gadget that takes a
7
/// TWindow and allows it to be inserted into a gadget window. In effect it is
8
/// an adapter that allows arbitrary controls to be used like gadgets in a tool
9
/// bar, status bar, etc.
10
//----------------------------------------------------------------------------
11
12
#if !defined(OWL_CONTROLG_H)
13
#define OWL_CONTROLG_H
14
15
#include <
owl/private/defs.h
>
16
#if defined(BI_HAS_PRAGMA_ONCE)
17
# pragma once
18
#endif
19
20
#include <
owl/gadget.h
>
21
22
23
namespace
owl
{
24
25
#include <
owl/preclass.h
>
26
27
/// \addtogroup gadgets
28
/// @{
29
/// \class TControlGadget
30
// ~~~~~ ~~~~~~~~~~~~~~
31
/// TControlGadget serves as a surrogate for TControl so that you can place TControl
32
/// objects such as edit controls, buttons, sliders, gauges, or third-party
33
/// controls, into a gadget window. If necessary, TControlGadget sets a parent
34
/// window and creates the control gadget. See TGadget for more information about
35
/// gadget objects.
36
//
37
class
_OWLCLASS
TControlGadget
:
public
TGadget
{
38
public
:
39
TControlGadget
(
TWindow
& control,
TBorderStyle
=
None
);
40
~TControlGadget
()
override
;
41
42
void
SetVisible
(
bool
visible)
override
;
43
44
protected
:
45
void
Created
()
override
;
46
void
Inserted
()
override
;
47
void
Removed
()
override
;
48
49
void
InvalidateRect
(
const
TRect
& rect,
bool
erase =
true
);
50
void
Update
();
// Paint now if possible
51
52
void
SetBounds
(
const
TRect
&)
override
;
53
void
GetDesiredSize
(
TSize
&)
override
;
54
55
public
:
56
TWindow
*
GetControl
()
const
;
57
void
SetControl
(
TWindow
* control);
58
59
protected_data
:
60
/// Points to the control window that is managed by this TControlGadget.
61
TWindow
* Control;
62
63
private
:
64
// Hidden to prevent accidental copying or assignment
65
//
66
TControlGadget
(
const
TControlGadget
&);
67
TControlGadget
& operator =(
const
TControlGadget
&);
68
};
69
/// @}
70
71
#include <
owl/posclass.h
>
72
73
//----------------------------------------------------------------------------
74
// Inline Implementations
75
//
76
77
//
78
/// Return the control that is simulating a gadget.
79
//
80
inline
TWindow
*
TControlGadget::GetControl
()
const
{
81
return
Control;
82
}
83
84
//
85
/// Set the control that is simulating a gadget.
86
//
87
inline
void
TControlGadget::SetControl
(
TWindow
* control) {
88
Control = control;
89
}
90
91
}
// OWL namespace
92
93
94
#endif
// OWL_CONTROLG_H
owl::TControlGadget::SetBounds
void SetBounds(const TRect &) override
Calls TGadget::SetBounds and passes the dimensions of the control gadget's rectangle.
Definition
controlg.cpp:59
owl::TControlGadget::GetControl
TWindow * GetControl() const
Return the control that is simulating a gadget.
Definition
controlg.h:80
owl::TControlGadget::Inserted
void Inserted() override
Called when the control gadget is inserted in the parent window.
Definition
controlg.cpp:144
owl::TControlGadget::InvalidateRect
void InvalidateRect(const TRect &rect, bool erase=true)
Invalidate a rectangle within this gadget by invalidating the rect in the control window in addition ...
Definition
controlg.cpp:196
owl::TControlGadget::Created
void Created() override
Virtual called after the window holding a gadget has been created.
Definition
controlg.cpp:108
owl::TControlGadget::TControlGadget
TControlGadget(TWindow &control, TBorderStyle=None)
Creates a TControlGadget object associated with the specified TControl window.
Definition
controlg.cpp:22
owl::TControlGadget::Removed
void Removed() override
Called when the control gadget is removed from the parent window.
Definition
controlg.cpp:167
owl::TControlGadget::SetVisible
void SetVisible(bool visible) override
Sets the visibility of this gadget and the encapsulated control.
Definition
controlg.cpp:45
owl::TControlGadget::Update
void Update()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
Definition
controlg.cpp:208
owl::TControlGadget::GetDesiredSize
void GetDesiredSize(TSize &) override
Calls TGadget::GetDesiredSize and passes the size of the control gadget.
Definition
controlg.cpp:80
owl::TControlGadget::SetControl
void SetControl(TWindow *control)
Set the control that is simulating a gadget.
Definition
controlg.h:87
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::TGadget::None
@ None
No border painted at all.
Definition
gadget.h:128
owl::TRect
TRect is a mathematical class derived from tagRect.
Definition
geometry.h:308
owl::TSize
The tagSIZE struct is defined as.
Definition
geometry.h:234
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
gadget.h
Base class TGadget and simple derived TSeparatorGadget.
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
protected_data
#define protected_data
Definition
defs.h:208
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
controlg.h
Generated by
1.18.0