18#if defined(__BORLANDC__)
96 SettingClient =
false;
104 ClientWnd =
new TWindow(
this,
_T(
"\007"));
106 if (ClientWnd->GetWindowAttr().Style &
WS_BORDER) {
127 delete BarCreatorFunct;
128 delete BarInserterFunct;
135 *BarCreatorFunct =
funct;
141 *BarInserterFunct =
funct;
227 SettingClient =
true;
229 SettingClient =
false;
231 if (
oldWnd->GetCaption() &&
oldWnd->GetCaption()[0] == 007) {
253 if (
child == ClientWnd && !SettingClient)
273 if (
child != ClientWnd &&
child->GetHandle() &&
295 if (
id ==
static_cast<uint>(-1))
324 for (
i =
static_cast<int>(
::_tcslen(buf)) - 1;
i >= 0;
i--)
325 if (buf[
i] ==
_T(
'.'))
330#if defined(BI_DBCS_SUPPORT)
333 if (
i >= 3 && buf[
i-3] ==
'(' && buf[
i-2] ==
'&' && buf[
i] ==
')')
340 if (buf[
i] ==
_T(
'&')) {
357 if (
len == 0 && MergeModule !=
nullptr)
358 len = MergeModule->LoadString(
id,
resStr, 256);
361 _T(
"TDecoratedFrame::GetHintText LoadString(")
374 if (
numBytes == 0 && MergeModule !=
nullptr)
375 numBytes = MergeModule->LoadString(
id, buf, size);
378 _T(
"TDecoratedFrame::GetHintText LoadString(")
407 if (TrackMenuSelection) {
408 if (flags == 0xFFFF &&
hMenu ==
nullptr) {
522 TRACEX(
OwlCmd, 1,
_T(
"TDecoratedFrame:EvCommand - id(") <<
id <<
_T(
"), ctl(") <<\
570 const auto i = std::find_if(
c.begin(),
c.end(), [&](
TWindow&
w)
571 { return ((&w != search.Decoration) && (GetLocation_(w) == search.Location)); });
572 search.Sibling = (
i !=
c.end()) ? &(*
i) :
nullptr;
588 search.Sibling = ClientWnd;
645 if (
hint.length() > 0)
956 const auto i =
find_if(
c.begin(),
c.end(), [](
TWindow&
w) { return w.ChildWithId(IDW_TOOLBAR); });
957 if (
i ==
c.end())
return nullptr;
1018#if OWL_PERSISTENT_STREAMS
1035TDecoratedFrame::Streamer::Write(opstream&
os)
const
Class definition for TBarDescr.
#define WARNX(group, condition, level, message)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
Descriptor of Bar Implementation.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
@ Unchecked
Command is not enabled.
@ Checked
Command is enabled.
Derived from TGadgetWindow, TControlBar implements a control bar that provides mnemonic access for it...
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
void SetBarInserter(const TBarInsertFunctor &funct)
void EvMenuSelect(uint menuItemId, uint flags, HMENU hMenu)
Responds to user menu selection.
TBarInsertFunctor * GetBarInserter()
auto RestoreBar() -> bool override
Restores the default control bar of the frame window.
void RemoveChild(TWindow *) override
Makes sure that both bases get a chance to see the child removed.
void EvEnterIdle(uint source, HWND hWndDlg)
Responds to a window message that tells an application's main window that a dialog box or a menu is e...
void SetBarCreator(const TGadgetWndFunctor &funct)
TDecoratedFrame(TWindow *parent, LPCTSTR title, TWindow *clientWnd, bool trackMenuSelection=false, TModule *module=0)
Constructs a TDecoratedFrame object with the specified parent window (parent), window caption (title)...
virtual TGadgetWindow * GetControlBar()
Search for child with ID = IDW_TOOLBAR, and if found check that it is GadgetWindow and return it;.
TGadgetWndFunctor * GetBarCreator()
auto MergeBar(const TBarDescr &) -> bool override
Merges the given bar descriptor with this frame's own bar descriptor and displays the resulting contr...
auto SetClientWindow(TWindow *) -> TWindow *override
Overrides TFrameWindows virtual function.
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
Automates hiding and showing of decorations.
void Init(TWindow *parent, LPCTSTR title, TWindow *client, bool trackMenuSelection, TModule *)
Initialization shared by the constructors.
virtual bool CreateBar()
SetupWindow() call this function to create control bar, if it is MainWindow and if BarDescriptor exis...
void EvSize(uint sizeType, const TSize &size)
Forward our size event to the layout window base, and not the frame base.
~TDecoratedFrame() override
void EvCommandEnable(TCommandEnabler &) override
Handles checking and unchecking of menu items that are associated with decorations.
auto PreProcessMsg(MSG &) -> bool override
Override TFrameWindow member function to give decorations an opportunity to do pre-processing (e....
TLocation
Enumeration describing the possible locations of a Gadgetwindow [Used mainly for location of Toolbar ...
@ Bottom
Refers to bottom edge of frame.
@ None
No location specified.
@ Top
Refers to top edge of frame.
@ Left
Refers to left edge of frame.
@ Right
Refers to right edge of frame.
virtual tstring GetHintText(uint id, THintText hintType) const
Retrieves the text specified by the resource id.
void CleanupWindow() override
void SetupWindow() override
Override SetupWindow in order to layout & position decorations Calls TLayoutWindow::Layout to size an...
virtual void Insert(TWindow &decoration, TLocation location=Top)
Insert a decoration window into position at one of the four edges.
Derived from TWindow, TFrameWindow controls such window-specific behavior as keyboard navigation and ...
void Init(TWindow *clientWnd, bool shrinkToClient)
Normal initialization of a default constructed TFrameWindow.
virtual TWindow * GetClientWindow()
Returns a pointer to the client window.
void EvCommandEnable(TCommandEnabler &) override
Handle WM_COMMAND_ENABLE to provide command enable distribution and default support for windows witho...
void CleanupWindow() override
Cleans up any associated icons.
auto PreProcessMsg(MSG &) -> bool override
Overrides TWindow's virtual function.
void BroadcastResizeToChildren(uint sizeType, const TSize &size)
Tell child windows frame has minimized/maximized/restored (They may want to change enabled state or r...
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
Handle WM_COMMAND to provide extra processing for commands: Extra processing for commands: starts wit...
virtual TWindow * SetClientWindow(TWindow *clientWnd)
Sets the client window to the specified window.
const TBarDescr * GetBarDescr() const
Returns a pointer to the control bar descriptor.
TFrameWindow()
< String-aware overload
void SetupWindow() override
Calls TWindow::SetUpWindow to create windows in a child list.
void RemoveChild(TWindow *) override
If someone removes our client with a RemoveChild() call, update our client and restore focus ptrs.
Functor with 1 parameter, return R.
Functor with 3 parameters, return R.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
When specifying the layout metrics for a window, four layout constraints are needed.
Derived from TWindow, TLayoutWindow provides functionality for defining the layout metrics for a wind...
TLayoutWindow(TWindow *parent, LPCTSTR title=0, TModule *module=0)
Creates a TLayoutWindow object with specified parent, window caption, and library ID.
void EvSize(uint sizeType, const TSize &size)
Responds to a change in size by calling Layout() to resize the window.
virtual void Layout()
Causes the window to resize and position its children according to the specified metrics.
bool GetChildLayoutMetrics(const TWindow &child, TLayoutMetrics &metrics)
Gets the layout metrics of the child window.
void SetChildLayoutMetrics(TWindow &child, const TLayoutMetrics &metrics)
Sets the metrics for the window and removes any existing ones.
void RemoveChild(TWindow *) override
Overrides TWindow virtual to allow cleanup of child metrics.
bool RemoveChildLayoutMetrics(const TWindow &child)
Removes child (layout) metrics for a given child (if found) and updates other children as necessary.
Derived from TGadgetWindow, TMessageBar implements a message bar with one text gadget as wide as the ...
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
static int GetMenuString(HMENU, UINT, TCHAR *, int, UINT)
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
void EvEnterIdle(uint source, HWND hWndDlg)
The default message handler for WM_ENTERIDLE.
TWindow()
Protected constructor for use by immediate virtually derived classes.
auto GetChildren()
Returns a TWindow::TChildrenRange that can be iterated by standard means.
void Init(TWindow *parent, LPCTSTR title, TModule *module)
Normal initialization of a default constructed TWindow.
TModule * GetModule() const
Returns a pointer to the module object.
HMENU GetMenu() const
Returns the handle to the menu of the indicated window.
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
TRect GetClientRect() const
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
bool IsFlagSet(uint mask)
Returns the state of the bit flag in Attr.Flags whose mask is supplied.
TWindow * GetFirstChild()
Returns a pointer to the first child window, which is the first window created in the interface objec...
HWND GetHandle() const
Returns the handle of the window.
auto ChildWithId(int id) const -> const TWindow *
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition of class TControlBar.
Definition of class TDecoratedFrame, a TFrameWindow that can manage decorations around the client win...
#define TBarInsert_FUNCTOR(func)
#define TGadgetWnd_FUNCTOR(func)
#define DEFINE_RESPONSE_TABLE2(cls, base1, base2)
Macro to define a response table for a class with two bases.
C++ Functor template implementation.
#define lmParent
Use to represent the parent in layout metrics.
@ lmTop
The top edge of the window.
@ lmBottom
The bottom edge of the window.
@ lmRight
The right edge of the window.
@ lmLeft
The left edge of the window.
void ReadBaseObject(Base *base, ipstream &in)
void ReadVirtualBase(Base *base, ipstream &in)
#define IMPLEMENT_STREAMABLE3(cls, base1, base2, base3)
void WriteVirtualBase(Base *base, opstream &out)
void WriteBaseObject(Base *base, opstream &out)
@ htStatus
Text displayed on status bar.
@ htTooltip
Shorter text displayed in a tooltip.
TAbsLocation
General use absolute 2-D rectangular location enum.
@ alTop
Refers to top edge of frame.
int LoadString(uint id, TCHAR *buf, int maxChars) const
Loads a string resource identified by id into the buffer pointed to by buff.
@ wfMainWindow
This frame window is the main window.
@ wfInsertAtEdge
(Decoration) Window to be inserted against frame's edge
Definition of class TMessageBar.
Object Windows Library (OWLNext Core)
TFunctor3< bool, TDecoratedFrame &, TGadgetWindow &, TAbsLocation > TBarInsertFunctor
LRESULT TResult
Result type.
bool EvBarInserter(TDecoratedFrame &frame, TGadgetWindow &destWindow, TAbsLocation loc)
const unsigned int IDW_FIRSTMDICHILD
child window IDs, 32 max to 32032
TFunctor1< TGadgetWindow *, TWindow * > TGadgetWndFunctor
#define COUNTOF(s)
Array element count Important: Only use this with an argument of array type.
#define TYPESAFE_DOWNCAST(object, toClass)