GScrollBar Class Reference

Scroll bar control. More...

#include <GScrollBar.h>

Inheritance diagram for GScrollBar:

GControl GView

List of all members.

Public Member Functions

 GScrollBar ()
 Call this constructor for embeded scrollbar say in a window.
char * GetClass ()
 GScrollBar (int id, int x, int y, int cx, int cy, char *name)
 Call this constructor for a control based scrollbar, say in a dialog.
bool Vertical ()
 True if vertical.
void SetVertical (bool v)
 Makes the scrollar vertical.
int64 Value ()
 Gets the current position of the scrollbar.
void Value (int64 p)
 Sets the position of the scrollbar.
void Limits (int64 &Low, int64 &High)
 Gets the limits.
void SetLimits (int64 Low, int64 High)
 Sets the limits.
int Page ()
 Gets the page size.
void SetPage (int p)
 Sets the page size.
bool Valid ()
 Returns true if the range is valid.
bool Attach (GViewI *p)
 Attaches the view to a parent view.
void OnPaint (GSurface *pDC)
 Called to paint the onscreen representation of the view.
void OnPosChange ()
 Called when the view position changes.
void OnMouseClick (GMouse &m)
 The mouse was clicked over this view.
void OnMouseMove (GMouse &m)
 The mouse moves over the control.
bool OnKey (GKey &k)
 A key was pressed while this view has focus.
void OnMouseWheel (double Lines)
 The mouse wheel was scrolled.
void OnPulse ()
 Called every so often by the timer system.
int OnEvent (GMessage *Msg)
 Called to process every message received by this window.
virtual void OnChange (int Pos)
 Called when the value changes.
virtual void OnConfigure ()
 Called when the Limits or Page changes.

Static Public Member Functions

static int GetScrollSize ()
 Returns the size of the bar, i.e. the width if vertical or the height if horizontal.

Friends

class GLayout


Detailed Description

Scroll bar control.

This control can be used as an actual free standing window or to address built in controls on a GLayout view.


Member Function Documentation

bool GScrollBar::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.

References SetVertical(), GView::X(), and GView::Y().

char* GScrollBar::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().

Returns:
the Class' name for debugging

Reimplemented from GView.

void GScrollBar::OnPulse (  ) 

Called every so often by the timer system.

See also:
SetPulse()

Reimplemented from GView.

References GView::GetMouse(), GMouse::x, and GMouse::y.


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

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