#include <LgiClasses.h>
Public Member Functions | |
const 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. | |
GRect & | GetClient (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 | |
GScrollBar * | VScroll |
The vertical scroll bar. | |
GScrollBar * | HScroll |
The horizontal scroll bar. | |
Friends | |
class | GView |
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.
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().
const 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().
Reimplemented from GView.
Reimplemented in GDocView, GEdit, GHtml, Html2::GHtml2, GList, GTableLayout, GTabView, GTextView3, GTextView4, GToolBar, GTree, and GSplitter.
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::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().
Referenced by GSplitter::Pour().
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.
References GView::Attach().
Referenced by GSplitter::Attach(), GTimeDrop::OnCreate(), and GProgressDlg::Push().
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.
References GView::OnNotify().
Referenced by GTree::OnNotify(), GList::OnNotify(), Html2::GHtml2::OnNotify(), and GHtml::OnNotify().