GLayout Class Reference

A GView with scroll bars. More...

#include <LgiClasses.h>

Inheritance diagram for GLayout:

GView GDocView GDropDown GFilterView GList GProgressPane GSplitter GTableLayout GTabView GToolBar GTree

List of all members.

Public Member Functions

char * GetClass ()
virtual void GetScrollPos (int &x, int &y)
 Gets the current scroll bar values.
virtual void SetScrollPos (int x, int y)
 Sets the current scroll bar values.
bool GetPourLargest ()
 Gets the "pour largest" setting.
void SetPourLargest (bool i)
 Sets the "pour largest" setting.
int OnEvent (GMessage *Msg)
 Handles the incoming events.
bool Pour (GRegion &r)
bool Attach (GViewI *p)
 Attaches the view to a parent view.
bool Detach ()
 Detachs a window from it's parent.
GRectGetClient (bool InClientSpace=true)
 Get the client region of the window relitive to itself (ie always 0,0-x,y).
void OnPosChange ()
 Called when the view position changes.
int OnNotify (GViewI *c, int f)
 Called when a child view or view with it's SetNotify() set to this window changes.

Protected Member Functions

virtual bool SetScrollBars (bool x, bool y)
 Sets which of the scroll bars is visible.

Protected Attributes

 The vertical scroll bar.
 The horizontal scroll bar.


class GView

Detailed Description

A GView with scroll bars.

This class adds scroll bars to the standard GView base class. The scroll bars can be directly accessed using the VScroll and HScroll member variables. Although you should always do a NULL check on the pointer before using, if the scroll bar is not activated using GLayout::SetScrollBars then VScroll and/or HScroll will by NULL. When the scroll bar is used to scroll the GLayout control you will receive an event on GView::OnNotify with the control ID of the scrollbar, which is either IDC_VSCROLL or IDC_HSCROLL.

Member Function Documentation

bool GLayout::Attach ( GViewI *  p  )  [virtual]

Attaches the view to a parent view.

Each GView starts in an un-attached state. When you attach it to a Parent GView the view gains a OS-specific handle and becomes visible on the screen (if the Visible() property is TRUE). However if a view is inserted into the Children list of a GView and it's parent pointer is set correctly it will still paint on the screen without the OS knowing about it. This is known in Lgi as a "virtual window" and is primarily used to cut down on windowing resources. Mouse clicks are handled by the parent window and passed down to the virtual children. Virtual children are somewhat limited. They can't receive focus, or participate in drag and drop operations. If you want to see an example have a look at the GToolBar code.

Reimplemented from GView.

Reimplemented in GTabView, and GSplitter.

Referenced by GTimeDrop::OnCreate(), and GProgressDlg::Push().

char* GLayout::GetClass (  )  [inline]

The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().

the Class' name for debugging

Reimplemented from GView.

Reimplemented in GDocView, GHtml, Html2::GHtml2, GList, GTableLayout, GTabView, GTextView3, GTextView4, GToolBar, GTree, and GSplitter.

int GLayout::OnNotify ( GViewI *  Ctrl,
int  Flags 

Called when a child view or view with it's SetNotify() set to this window changes.

The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.

Reimplemented from GView.

Reimplemented in GHtml, Html2::GHtml2, GList, GDropDown, GProgressPane, GTabView, GTextView3, GTextView4, and GTree.

bool GLayout::Pour ( GRegion r  )  [virtual]

Lay out all the children views into the client area according to their own internal rules. Space is given in a first come first served basis.

Reimplemented from GView.

Reimplemented in GProgressPane, GToolBar, and GSplitter.

References GView::FindLargest(), and GView::SetPos().

void GLayout::SetPourLargest ( bool  i  ) 

Sets the "pour largest" setting.

When "pour largest" is switched on the pour function automatically lays the control into the largest rectangle available. This is useful for putting a single GView into a splitter pane or a tab view and having it just take up all the space.

Referenced by GTabView::GTabView().

bool GLayout::SetScrollBars ( bool  x,
bool  y 
) [protected, virtual]

Sets which of the scroll bars is visible.

x  Make the horizontal scroll bar visible
y  Make the vertical scroll bar visible

References HScroll, IDC_HSCROLL, IDC_VSCROLL, GView::Invalidate(), OnPosChange(), GScrollBar::SetVertical(), GView::Visible(), and VScroll.

Referenced by Html2::GHtml2::Layout(), GHtml::Layout(), and GTextView3::OnPosChange().

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

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen