(Up to GView)

GLayout

The GLayout class forms a window that can arrange itself with other GLayout objects with the client area of an application. Examples of this are toolbars, status bars and splitters.

All classes derived from GLayout need to implement the Pour function. This function is called by the parent class to ask the object where abouts it wants to be located in the remaining space available. The order that the GLayout's are added to the parent is important, in terms of who gets first pickings at the area.


GLayout classes:
class GLayout :
    public GView
{
public:
    // Layout
    bool GetPourLargest()
    bool Pour(GdcComplexRegion &r)
    void SetPourLargest(bool I)

    // ScrollBars
    bool SetScrollBars(bool x, bool y)
    virtual void GetScrollPos(int &x, int &y)
    virtual void SetScrollPos(int x, int y)
};

GLayout::GetPourLargest

bool GetPourLargest()

Get the "Pour Largest" setting.


GLayout::Pour

bool Pour(GdcComplexRegion &r)

Argument Description
GdcComplexRegion &r The non-rectangular region available to the window.

Use these functions to search the area:

This is called to give the control a chance to position itself in the remaining screen area. It should look at the list of regions and decide where it should go. Then it should set it's own position and return true.

By default the control returns false if no layout is performed, in this case the control is ignored. Most of the time this is because it's a dialog control.


GLayout::SetPourLargest

void SetPourLargest(bool I)

Argument Description
bool I

Sets the "Pour Largest" setting. If this is TRUE then the GLayout control automatically takes up the largest region available.


GLayout::SetScrollBars

bool SetScrollBars(bool x, bool y)

Argument Description
bool x true for horizontal scroll bar
bool y true for vertical scrollbar

Switches on scroll bars for the window.

The scroll bars will notify you of user input through the OnNotify handler. To correctly identify the control you will need to set it's Id (using SetId()).


GLayout::GetScrollPos

virtual void GetScrollPos(int &x, int &y)

Argument Description
int &x
int &y

Get the current scroll bar position. 0 will be returned for a scrollbar that doesn't exist.


GLayout::SetScrollPos

virtual void SetScrollPos(int x, int y)

Argument Description
int x
int y

Set the scroll bar's values.


Built: 13/9/2001 2:28:29 PM
© 2001 Matthew Allen
Lgi HomePage