13#include <owl/statusba.rh>
27 TModeStrings() : NumModes(0), ModeBuff(
nullptr), ModeStrings(
nullptr) {}
37 int Count()
const {
return NumModes; }
63 if (*
i.Current() ==
_T(
'|')) {
70 ModeStrings =
new pchar[NumModes];
72 for (
int j = 0;
j < NumModes;
j++) {
82static tchar DefOnModes[] =
_T(
"EXT|CAPS|NUM|SCRL|OVR|REC");
90static int VkKeys[] = {
99static int GadgetIds[] = {
138 ModeIndicatorState = 0;
139 NumModeIndicators = 0;
148 HighlightLine =
false;
152 switch (BorderStyle) {
183 Margins.Left = Margins.Top = Margins.Right = Margins.Bottom = -1;
189 Gadgets->SetBorderStyle(BorderStyle);
197 for (
int i = 0;
i < GetModeOnStrings().Count();
i++)
198 if (ModeIndicators & (1 <<
i)) {
200 if (owl::VkKeys[
i] == 0) {
203 GetModeOnStrings()[
i], 0);
204 gadget->SetEnabled(
false);
233TStatusBar::InsertSizeGrip()
250TStatusBar::IsModeIndicator(TGadget*
gadget)
284 if (IsModeIndicator(
next))
285 switch (Spacing.
Units) {
309 gadget.SetBorderStyle(BorderStyle);
339 if ((ModeIndicators & mode) == 0) {
346 for (index = GetModeOnStrings().Count() - 1; (1 << index) > mode; index--)
347 if (ModeIndicators & (1 << index))
350 strOn = GetModeOnStrings()[index];
384 ModeIndicatorState |= mode;
386 ModeIndicatorState &= ~mode;
405 if (
rect.Contains(p))
#define PRECONDITION(condition)
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TGadget is the base class for the following derived gadget classes:
TBorderStyle
Gadget border styles.
@ Embossed
Painted with an embossed border.
@ WndRecessed
Input field and other window are recessed.
@ Recessed
Recessed into the window.
@ None
No border painted at all.
@ WndRaised
Inner and outer edge of the window are raised.
@ ButtonUp
Button in up position.
@ Plain
Plain window frame.
@ Grooved
Grouping groove.
@ Raised
Raised above the gadget window.
@ WellSet
Well option set (auto grows + 1)
@ ButtonDn
Button in down position.
TGadget * operator[](uint index)
Returns gadget at a given index.
TPlacement
Enumerates the placement of a gadget.
TGadget * GadgetWithId(int id) const
Returns the gadget with a given ID, or 0 if none is found.
virtual void Insert(TGadget &gadget, TPlacement=After, TGadget *sibling=nullptr)
Inserts a Gadget.
int LayoutUnitsToPixels(int units)
Converts layout units to pixels.
auto Remove(TGadget &) -> TGadget *override
Removes a gadget from the gadget window.
virtual void LayoutSession()
LayoutSession is typically called when a change occurs in the size of the margins or gadgets,...
Derived from TWindow, TLayoutWindow provides functionality for defining the layout metrics for a wind...
virtual void Layout()
Causes the window to resize and position its children according to the specified metrics.
Derived from TGadgetWindow, TMessageBar implements a message bar with one text gadget as wide as the ...
void SetText(const tstring &text)
Forwards the message in the message bar to the text gadget for formatting.
virtual void SetHintText(LPCTSTR text)
Sets the hint text displayed on the messagebar.
TModeGadget is a mode-tracking text gadget class.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
TSizeGripGadget is a gadget that is used on the far right of a status bar to provide re-sizing grip f...
The tagSIZE struct is defined as.
TModeIndicator
Enumerates the keyboard modes.
uint GetModeIndicators() const
Returns the bit flags for which indicator is on.
void EvOwlFrameSize(uint sizeType, const TSize &)
BGM SetModeIndicators is nearly useless; after construction, TStatusBar BGM pays almost no attention ...
void ToggleModeIndicator(TModeIndicator)
Toggles the ModeIndicator.
void Insert(TGadget &, TPlacement=After, TGadget *sibling=nullptr) override
By default, adds "gadget" after the existing text gadgets and before the mode indicator gadgets.
void PositionGadget(TGadget *previous, TGadget *next, TPoint &) override
Determines the position of the new gadget in relation to any previously existing gadgets and uses the...
TStatusBar(TWindow *parent=0, TGadget::TBorderStyle borderStyle=TGadget::Recessed, uint modeIndicators=0, TFont *font=0, TModule *module=0)
Constructs a TStatusBar object in the parent window and creates any new gadgets and mode indicator ga...
uint EvNCHitTest(const TPoint &point)
If the status bar has a size grip gadget and the mouse is over the gadget, simulates resizing of the ...
void SetModeIndicator(TModeIndicator, bool state)
Sets TModeIndicator to a given text gadget and set the status (on, by default) of the mode indicator.
void SetHintText(LPCTSTR text) override
Overriden method of TMessageBar to use our own text gadget Set (or clear if 0) menu/command item hint...
bool GetModeIndicator(TModeIndicator i) const
Returns the current status bar mode indicator.
Derived from TGadget, TTextGadget is a text gadget object.
@ Left
Aligns the text at the left edge of the bounding rectangle.
@ Center
Aligns the text horizontally at the center of the bounding rectangle.
static const TUIMetric CyBorder
static const TUIMetric CxBorder
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
void SetFlag(uint mask)
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
TWindow * GetParentO() const
Return the OWL's parent for this window.
TModule * GetModule() const
Returns a pointer to the module object.
TPoint MapScreenToClient(const TPoint &p) const
Functional-style version of ScreenToClient.
uint EvNCHitTest(const TPoint &)
The default message handler for WM_NCHITTEST.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
#define IDG_STATUS_SCRL
The ID for a scroll lock gadget.
#define IDG_SIZEGRIP
The ID for a size grip gadget.
#define IDG_STATUS_OVR
The ID for an overwrite gadget.
#define IDG_STATUS_CAPS
The ID for a capslock gadget.
#define IDG_STATUS_EXT
The ID for an extended selection gadget.
#define IDG_STATUS_NUM
The ID for a numlock gadget.
#define IDG_STATUS_REC
The ID for a record gadget.
@ wfInsertAtEdge
(Decoration) Window to be inserted against frame's edge
Definition of classes TLayoutMetrics & TLayoutWindow.
char * strnewdup(const char *s, size_t minAllocSize=0)
Definition of mode-tracking text gadget class TModeGadget.
Object Windows Library (OWLNext Core)
General definitions used by all ObjectWindows programs.
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of class TStatusBar.
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
Definition of TUIMetric, a UI metrics provider class.