OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
floatfra.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
/// Definition of class TFloatingFrame.
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_FLOATFRA_H)
10
#define OWL_FLOATFRA_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/framewin.h
>
18
#include <
owl/tinycapt.h
>
19
20
21
namespace
owl
{
22
23
#include <
owl/preclass.h
>
24
25
/// \addtogroup frame
26
/// @{
27
//
28
/// \class TFloatingFrame
29
// ~~~~~ ~~~~~~~~~~~~~~
30
/// Derived from TFrameWindow and TTinyCaption, TFloatingFrame implements a floating
31
/// frame that can be positioned anywhere in the parent window. Except for the
32
/// addition of a tiny caption bar, the default behavior of TFrameWindow and
33
/// TFloatingFrame is the same. Therefore, an application that uses TFrameWindow can
34
/// easily gain the functionality of TFloatingFrame by just changing the name of the
35
/// class to TFloatingFrame.
36
///
37
/// If there is a client window, the floating frame shrinks to fit the client
38
/// window, leaving room for margins on the top, bottom, left, and right of the
39
/// frame. Because the floating frame expects the client window to paint its own
40
/// background, it does nothing in response to a WM_ERASEBKGND message. However, if
41
/// there is no client window, the floating frame erases the client area background
42
/// using TColor::SysUIFace.
43
///
44
/// If popupPalette is true then, dragFrame is enabled, styles are set to popup
45
/// with a tiny close box, and a border.
46
///
47
/// When dragFrame mode is enabled the floating frame adds an extra non-client
48
/// margin around the outside to allow moving of the frame. This works well with
49
/// a thin frame and is nice when the client area is too full to allow dragging
50
/// from there.
51
//
52
class
_OWLCLASS
TFloatingFrame
:
public
TFrameWindow
,
public
TTinyCaption
{
53
public
:
54
TFloatingFrame
(
TWindow
* parent,
55
LPCTSTR title = 0,
56
TWindow
* clientWnd = 0,
57
bool
shrinkToClient =
false
,
58
int
captionHeight =
DefaultCaptionHeight
,
59
bool
popupPalette =
false
,
60
TModule
* module = 0);
61
62
TFloatingFrame
(
63
TWindow
* parent,
64
const
tstring
& title,
65
TWindow
* client = 0,
66
bool
shrinkToClient =
false
,
67
int
captionHeight =
DefaultCaptionHeight
,
68
bool
popupPalette =
false
,
69
TModule
* = 0);
70
71
void
SetMargins
(
const
TSize
& margin);
72
void
SetDragFrame
(
bool
dragFrame);
73
74
// Nameless union to declare a constant that is class scoped.
75
//
76
enum
{
77
DefaultCaptionHeight
= 0
78
};
79
80
protected
:
81
82
void
Init(
int
captionHeight,
bool
popupPalette);
83
84
// Override TWindow & TFrameWindow virtuals
85
//
86
auto
GetCommandTarget() -> HWND
override
;
87
void
EvCommandEnable(
TCommandEnabler
&)
override
;
88
auto
EvCommand(
uint
id
, HWND hWndCtl,
uint
notifyCode) ->
TResult
override
;
89
90
/// Event handler helper
91
//
92
TEventStatus
DoNCHitTest(
const
TPoint
& screenPt,
uint
& evRes);
93
94
// Event Handlers
95
//
96
void
EvSysCommand(
uint
cmdType,
const
TPoint
& p);
97
uint
EvNCCalcSize(
bool
calcValidRects, NCCALCSIZE_PARAMS & calcSize);
98
void
EvNCPaint(HRGN);
99
uint
EvNCHitTest(
const
TPoint
& screenPt);
100
bool
EvNCActivate(
bool
active);
101
uint
EvMouseActivate(HWND hTopLevel,
uint
hitCode,
TMsgId
);
102
void
EvActivateApp(
bool
active, DWORD taskId);
103
104
private
:
105
TSize
Margin;
///< Left and right, top and bottom
106
bool
DragFrame;
///< True if frame edges are used to drag, not size window
107
bool
AppearActive;
///< Current fake-activation appearance flag
108
109
DECLARE_RESPONSE_TABLE
(
TFloatingFrame
);
110
DECLARE_STREAMABLE_OWL
(
TFloatingFrame
, 1);
111
};
112
/// @}
113
114
DECLARE_STREAMABLE_INLINES
(
owl::TFloatingFrame
);
115
116
#include <
owl/posclass.h
>
117
118
//----------------------------------------------------------------------------
119
// Inline implementations
120
//
121
122
//
123
/// Sets the margins of the floating palette window to the size specified in margin
124
/// and sets the height of the tiny caption bar.
125
//
126
inline
void
TFloatingFrame::SetMargins
(
const
TSize
& margin)
127
{
128
Margin = margin;
129
}
130
131
//
132
/// Sets the flag for additional dragging area.
133
//
134
inline
void
TFloatingFrame::SetDragFrame
(
bool
dragFrame)
135
{
136
DragFrame = dragFrame;
137
}
138
139
}
// OWL namespace
140
141
142
#endif
// OWL_FLOATFRA_H
owl::TCommandEnabler
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
Definition
window.h:209
owl::TFloatingFrame
Derived from TFrameWindow and TTinyCaption, TFloatingFrame implements a floating frame that can be po...
Definition
floatfra.h:52
owl::TFloatingFrame::SetMargins
void SetMargins(const TSize &margin)
Sets the margins of the floating palette window to the size specified in margin and sets the height o...
Definition
floatfra.h:126
owl::TFloatingFrame::SetDragFrame
void SetDragFrame(bool dragFrame)
Sets the flag for additional dragging area.
Definition
floatfra.h:134
owl::TFloatingFrame::TFloatingFrame
TFloatingFrame(TWindow *parent, LPCTSTR title=0, TWindow *clientWnd=0, bool shrinkToClient=false, int captionHeight=DefaultCaptionHeight, bool popupPalette=false, TModule *module=0)
Constructs a TFloatingFrame object attached to the specified parent window.
Definition
floatfra.cpp:46
owl::TFloatingFrame::DefaultCaptionHeight
@ DefaultCaptionHeight
Definition
floatfra.h:77
owl::TFrameWindow::TFrameWindow
TFrameWindow(TWindow *parent, LPCTSTR title=nullptr, TWindow *clientWnd=nullptr, bool shrinkToClient=false, TModule *module=nullptr)
Constructs a window object with the parent window supplied in parent, which is zero if this is the ma...
Definition
framewin.cpp:91
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
owl::TPoint
TPoint is a support class, derived from tagPOINT.
Definition
geometry.h:87
owl::TSize
The tagSIZE struct is defined as.
Definition
geometry.h:234
owl::TTinyCaption::TTinyCaption
TTinyCaption()
Constructs a TTinyCaption object attached to the given parent window.
Definition
tinycapt.cpp:45
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
DECLARE_RESPONSE_TABLE
#define DECLARE_RESPONSE_TABLE(cls)
Definition
eventhan.h:436
framewin.h
Definition of class TFrameWindow.
DECLARE_STREAMABLE_OWL
#define DECLARE_STREAMABLE_OWL(cls, ver)
Definition
objstrm.h:1529
DECLARE_STREAMABLE_INLINES
#define DECLARE_STREAMABLE_INLINES(cls)
Definition
objstrm.h:1538
owl::TEventStatus
TEventStatus
Mixin window event implementation return status.
Definition
window.h:107
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::TMsgId
UINT TMsgId
Message ID type.
Definition
dispatch.h:53
owl::TResult
LRESULT TResult
Result type.
Definition
dispatch.h:52
owl::tstring
std::string tstring
Definition
defs.h:79
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
tinycapt.h
include
owl
floatfra.h
Generated by
1.18.0