OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TGadgetList Class Reference

TGadgetList is a list of gadgets with management functions. More...

#include <owl/gadgetwi.h>

Inheritance diagram for owl::TGadgetList:
owl::TGadgetWindow owl::TControlBar owl::TDockableGadgetWindow owl::TGadgetControl owl::TMessageBar owl::TToolBox owl::TDockableControlBar owl::TStatusBar

Public Types

enum  TPlacement { Before , After }
 Enumerates the placement of a gadget. More...
 

Public Member Functions

 TGadgetList ()
 
virtual ~TGadgetList ()
 
virtual TGadgetRemove (TGadget &gadget)
 Removes (unlinks) a gadget.
 
virtual void Inserted (TGadget &gadget)
 A gadget has been inserted.
 
virtual void Removed (TGadget &gadget)
 A gadget has been removed.
 
uint GadgetCount () const
 Returns the number of gadgets in the list.
 
TGadgetFirstGadget () const
 Returns the first gadget of the list.
 
TGadgetNextGadget (TGadget &gadget) const
 Returns the next gadget in the list relative to a given gadget.
 
TGadgetGadgetFromPoint (const TPoint &point) const
 Returns the gadget that a given window-relative point is in, or 0 if none is found.
 
TGadgetGadgetWithId (int id) const
 Returns the gadget with a given ID, or 0 if none is found.
 
TGadgetoperator[] (uint index)
 Returns gadget at a given index.
 
virtual void Insert (TGadget &gadget, TPlacement=After, TGadget *sibling=nullptr)
 Inserts a Gadget.
 
virtual void InsertFrom (TGadgetList &list, TPlacement=After, TGadget *sibling=nullptr)
 Inserts a list of gadgets.
 

Detailed Description

TGadgetList is a list of gadgets with management functions.

Definition at line 35 of file gadgetwi.h.

Member Enumeration Documentation

◆ TPlacement

Enumerates the placement of a gadget.

The new gadget is inserted either before or after another gadget. You can control the placement of the new gadget by specifying a sibling gadget that the new gadget is inserted before or after. If the sibling argument in TGadgetWindow::Insert is 0 then the new gadget is inserted at the beginning or the end of the existing gadgets. By default, the new gadget is inserted at the end of the existing gadgets.

Enumerator
Before 
After 

Definition at line 47 of file gadgetwi.h.

Constructor & Destructor Documentation

◆ TGadgetList()

owl::TGadgetList::TGadgetList ( )

Definition at line 16 of file gadgetli.cpp.

◆ ~TGadgetList()

owl::TGadgetList::~TGadgetList ( )
virtual

Definition at line 26 of file gadgetli.cpp.

Member Function Documentation

◆ FirstGadget()

TGadget * owl::TGadgetList::FirstGadget ( ) const
inline

Returns the first gadget of the list.

Definition at line 400 of file gadgetwi.h.

◆ GadgetCount()

uint owl::TGadgetList::GadgetCount ( ) const
inline

Returns the number of gadgets in the list.

Definition at line 393 of file gadgetwi.h.

◆ GadgetFromPoint()

TGadget * owl::TGadgetList::GadgetFromPoint ( const TPoint & point) const

Returns the gadget that a given window-relative point is in, or 0 if none is found.

Definition at line 42 of file gadgetli.cpp.

◆ GadgetWithId()

TGadget * owl::TGadgetList::GadgetWithId ( int id) const

Returns the gadget with a given ID, or 0 if none is found.

Definition at line 56 of file gadgetli.cpp.

◆ Insert()

void owl::TGadgetList::Insert ( TGadget & gadget,
TPlacement placement = After,
TGadget * sibling = nullptr )
virtual

Inserts a Gadget.

Caller also needs to call LayoutSession() after inserting gadgets if this window has already been created.

You can specify a sibling Gadget that the new Gadget is to be inserted before or after

If "sibling" is 0 then the new Gadget is inserted at the beginning or the end. The default is to insert the new Gadget at the end

Reimplemented in owl::TGadgetWindow, owl::TStatusBar, and owl::TToolBox.

Definition at line 89 of file gadgetli.cpp.

References After, CHECK, Inserted(), and PRECONDITION.

◆ Inserted()

void owl::TGadgetList::Inserted ( TGadget & gadget)
virtual

A gadget has been inserted.

Derived class can override this to update internals

Reimplemented in owl::TGadgetWindow.

Definition at line 208 of file gadgetli.cpp.

◆ InsertFrom()

void owl::TGadgetList::InsertFrom ( TGadgetList & list,
TPlacement placement = After,
TGadget * sibling = nullptr )
virtual

Inserts a list of gadgets.

Caller also needs to call LayoutSession() after inserting gadgets if this window has already been created.

Gadgets are removed from the source list

Reimplemented in owl::TGadgetWindow.

Definition at line 125 of file gadgetli.cpp.

References After, CHECK, and Inserted().

◆ NextGadget()

TGadget * owl::TGadgetList::NextGadget ( TGadget & gadget) const
inline

Returns the next gadget in the list relative to a given gadget.

Definition at line 407 of file gadgetwi.h.

◆ operator[]()

TGadget * owl::TGadgetList::operator[] ( uint index)

Returns gadget at a given index.

Definition at line 68 of file gadgetli.cpp.

References FirstGadget(), NextGadget(), and PRECONDITION.

◆ Remove()

TGadget * owl::TGadgetList::Remove ( TGadget & gadget)
virtual

Removes (unlinks) a gadget.

Remove (unlinks) a gadget from this gadget window.

The gadget is returned but not destroyed. Returns 0 if gadget is not in this window. Caller also needs to call LayoutSession() after inserting/removing gadgets if this gadget window has already been created.

Reimplemented in owl::TGadgetWindow.

Definition at line 172 of file gadgetli.cpp.

References Removed().

◆ Removed()

void owl::TGadgetList::Removed ( TGadget & gadget)
virtual

A gadget has been removed.

Derived class can override this to update internals

Reimplemented in owl::TGadgetWindow.

Definition at line 217 of file gadgetli.cpp.


The documentation for this class was generated from the following files: