GLOW API version 1.0 reference

Back to
Table of contents


class GlowSubwindowInWidget

General information

type: class
inherits: GlowSubwindow
module: glowWidget

GlowSubwindowInWidget is a special subwindow base class intended for use in widgets. You should use this type of subwindow if it is to be located under a widget in the hierarchy. Its special behavior is to redirect keyboard events to the widget root for rerouting to the current keyboard focus.

GLOW programs that include custom widgets containing subwindows should use this class.

Methods

Constructors and destructor

GlowSubwindowInWidget(GlowWidget* parent, const GlowSubwindowParams& params)

Creates a new GlowSubwindowInWidget with options specified by the given params, and adds it to parent's children. Also creates the corresponding GLUT subwindow.

GlowSubwindowInWidget(GlowWidget* parent, int x, int y, int width, int height, Glow::BufferType mode, Glow::EventMask eventMask)

Creates a new GlowSubwindowInWidget with options specified by the given params, and adds it to parent's children. x and y denote the pixel location of the top left corner of the subwindow, in its parent window's coordinates. width and height specify the width and height in pixels. mode describes the type of frame buffer to use. eventMask specifies which events the subwindow wishes to receive when active. Use the event constants described in Glow for the event mask.

GlowSubwindowInWidget(void)

Creates a new GlowSubwindowInWidget but does not initialize it. A subwindow created in this way may not be used until its Init() method is called.

void Init(GlowWidget* parent, const GlowSubwindowParams& params)

Initializes the GlowSubwindowInWidget with options specified by the given params, and adds it to parent's children.

void Init(GlowWidget* parent, int x, int y, int width, int height, Glow::BufferType mode, Glow::EventMask eventMask)

Initializes the GlowSubwindowInWidget with options specified by the given params, and adds it to parent's children. x and y denote the pixel location of the top left corner of the subwindow, in its parent window's coordinates. width and height specify the width and height in pixels. mode describes the type of frame buffer to use. eventMask specifies which events the subwindow wishes to receive when active. Use the event constants described in Glow for the event mask.

virtual ~GlowSubwindowInWidget(void)

The destructor for GlowSubwindowInWidget simply calls the destructor for GlowSubwindow.

Subwindow-in-widget operations
You can perform a few special operations on such a subwindow.

GlowWidget* ParentWidget(void)

Returns the parent widget. This is the same object as returned by Parent(), but cast to a widget.

GlowWidgetRoot* Root(void)

Returns the widget root.

int WidgetPositionX(void)

Returns the position of the left edge of the subwindow in the parent widget's pixel coordinates.

int WidgetPositionY(void)

Returns the position of the top edge of the subwindow in the parent widget's pixel coordinates.

Inherited methods
These methods are inherited from GlowSubwindow.

int PositionX(void) const

int PositionY(void) const

int GlobalPositionX(void) const

int GlobalPositionY(void) const

int Width(void) const

int Height(void) const

void Move(int x, int y)

void Reshape(int width, int height)

void Raise(void)

void Lower(void)

void Show(void)

void Hide(void)

void Refresh(void)

void SetRefreshEnabled(bool enabled)

bool IsRefreshEnabled(void) const

void SetAutoSwapBuffersEnabled(bool enabled)

bool IsAutoSwapBuffersEnabled(void) const

void NormalizeCoordinates(int x, int y, GLfloat& xn, GLfloat& yn) const

Glow::BufferType GetBufferType(void) const

GlowMenu* GetMenu(Glow::MouseButton mouseButton) const

void SetMenu(Glow::MouseButton mouseButton, GlowMenu* menu = 0)

void UnsetMenu(Glow::MouseButton mouseButton)

int GetCursor(void) const

void SetCursor(int cursor)

Glow::EventMask GetEventMask(void) const

Glow::EventMask GetInactiveEventMask(void) const

void SetEventMask(Glow::EventMask mask)

void SetInactiveEventMask(Glow::EventMask mask)

int GlutWindowNum(void) const

void MakeCurGlutWindow(void)

int GlutInfo(int whichInfo) const

Inherited methods
These methods are inherited from GlowComponent.

void Close(void)

GlowComponent* Parent(void) const

GlowSubwindow* WhichWindow(void)

Note: For a subwindow, WhichWindow() returns this.

GlowSubwindow* ParentWindow(void) const

GlowWindow* ToplevelWindow(void)

bool IsToplevel(void) const

GlowComponent* Next(void) const

GlowComponent* Prev(void) const

int NumChildren(void) const

GlowComponent* FirstChild(void) const

GlowComponent* LastChild(void) const

void ReorderChild(GlowComponent* child, GlowComponent* pos)

void KillChildren(void)

void Activate(void)

void Deactivate(void)

bool IsActive(void)

bool IsInactive(void)

bool IsActiveStandby(void)

void Paint(void)

Overrideable methods

Inherited methods
These overrideable methods are inherited from GlowSubwindow.

virtual void OnMouseDown(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)

virtual void OnMouseUp(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)

virtual void OnMenuDown(int x, int y)

virtual void OnMenuUp()

virtual void OnMouseMotion(int x, int y)

virtual void OnMouseDrag(int x, int y)

virtual void OnMouseEnter(void)

virtual void OnMouseExit(void)

virtual void OnKeyboard(Glow::KeyCode key, int x, int y, Glow::Modifiers modifiers)

This method is used by GlowSubwindowInWidget to redirect the keyboard events to the widget root. Normally it should not be overridden unless the subwindow needs to intercept such events.

virtual void OnDirectMenuHit(const GlowMenuMessage& message)

virtual void OnReshape(int width, int height)

virtual void OnInvisible(void)

virtual void OnVisible(void)

Inherited methods
These overrideable methods are inherited from GlowComponent.

virtual bool OnBeginPaint(void)

virtual void OnEndPaint(void)

virtual void OnActivate(void)

virtual void OnDeactivate(void)


Back to
Table of contents


The GLOW Toolkit