|
Back to Table of contents |
General information |
type: class
inherits: GlowFixedSizeWidgetWindow
module: glowTextFieldWindowGlowTextFieldWindow is a convenience class that implements a window for entering data in a text field.
GLOW programs may use this class to allow the user to input brief text data.
Methods |
Constructors and destructor
GlowTextFieldWindow(const GlowTextFieldWindowParams& params)
Creates a new GlowTextFieldWindow with options specified by the given params.GlowTextFieldWindow(const char* windowTitle, int x, int y, const char* labelText, int fieldWidth, const char* fieldText, const char* buttonText, GlowTextFieldWindowReceiver* receiver = 0)
Creates a new GlowTextFieldWindow with the given options. windowTitle gives the title of the window to create. x and y give the screen location of the window, or you can pass GlowWindow::autoPosition. labelText gives the text of the message. Include newline characters to create multi-line messages. fieldWidth gives the width of the text field in pixels, and fieldText gives an initial value for the text field. buttonText gives the labels for the buttons to use, as a single tab-delimited string. receiver denotes a receiver to report button presses to, or pass the null pointer if you do not want to bind a receiver.GlowTextFieldWindow(void)
Creates a new GlowTextFieldWindow but does not initialize it. The window will not be shown until its Init() method is called.void Init(const GlowTextFieldWindowParams& params)
Initializes the GlowTextFieldWindow with options specified by the given params.void Init(const char* windowTitle, int x, int y, const char* labelText, int fieldWidth, const char* fieldText, const char* buttonText, GlowTextFieldWindowReceiver* receiver = 0)
Initializes the GlowTextFieldWindow with the given options. windowTitle gives the title of the window to create. x and y give the screen location of the window, or you can pass GlowWindow::autoPosition. labelText gives the text of the message. Include newline characters to create multi-line messages. fieldWidth gives the width of the text field in pixels, and fieldText gives an initial value for the text field. buttonText gives the labels for the buttons to use, as a single tab-delimited string. receiver denotes a receiver to report button presses to, or pass the null pointer if you do not want to bind a receiver.Text field window methods
TSender<const GlowTextFieldWindowMessage&>& Notifier(void)
Accesses the notifier for this text field window, which can be bound to receivers.void SetEnterButton(int num)
Maps the enter key to the given button number. Remember that buttons are numbered beginning with 0. Give a negative number for no mapping.void SetEscapeButton(int num)
Maps the escape key to the given button number. Remember that buttons are numbered beginning with 0. Give a negative number for no mapping.Inherited methods
These methods are inherited from GlowWidgetRoot.GlowSubwindow* Subwindow(void) const
GlowColor GetBackColor(void) const
void SetBackColor(GlowColor c)
void SetKeyboardFocus(GlowWidget* widget)
GlowWidget* GetKeyboardFocus(void)
void AdvanceKeyboardFocus(void)
Inherited methods
These methods are inherited from GlowFixedSizeWindow.void ForceReshape(int width, int height)
You should not normally force-reshape a text field window. It is automatically set to the correct size on construction, and the size shouldn't be changed.Inherited methods
These methods are inherited from GlowWindow.void Maximize(void)
You should not normally try to maximize a fixed-size window. It will momentarily maximize, but will then snap to its original size.void Iconify(void)
const char* GetTitle(void) const
void SetTitle(const char* title)
const char* GetIconTitle(void) const
void SetIconTitle(const char* title)
Inherited methods
These methods are inherited from GlowSubwindow.int PositionX(void) const
Note: for a toplevel window, this returns the same value as GlobalPositionX.int PositionY(void) const
Note: for a toplevel window, this returns the same value as GlobalPositionY.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)
You should not normally try to reshape a fixed-size window. It will momentarily change size, but will then snap to its original size. Use ForceReshape() instead.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
Note: For a toplevel window, Parent() returns 0.GlowSubwindow* WhichWindow(void)
Note: For a toplevel window, WhichWindow() returns this.GlowSubwindow* ParentWindow(void) const
Note: For a toplevel window, ParentWindow() returns 0.GlowWindow* ToplevelWindow(void)
Note: For a toplevel window, ToplevelWindow() returns this.bool IsToplevel(void) const
Note: For a toplevel window, returns true.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 |
Event notification
virtual void OnButtonPressed(int response, const char* text, Glow::MouseButton mouseButton, Glow::Modifiers modifiers)
This method is called when one of the window's buttons is pressed. The default behavior sends a GlowTextFieldWindowMessage to all receivers bound to this window, and then closes (deletes) the window. Override this method to provide different behavior.Inherited methods
These overrideable methods are inherited from GlowSubwindow.virtual void OnMouseDown(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WRMouseDown().virtual void OnMouseUp(Glow::MouseButton mouseButton, int x, int y, Glow::Modifiers modifiers)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WRMouseUp().virtual void OnMenuDown(int x, int y)
virtual void OnMenuUp()
virtual void OnMouseMotion(int x, int y)
virtual void OnMouseDrag(int x, int y)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WRMouseDrag().virtual void OnMouseEnter(void)
virtual void OnMouseExit(void)
virtual void OnKeyboard(Glow::KeyCode key, int x, int y, Glow::Modifiers modifiers)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WRKeyboard().virtual void OnDirectMenuHit(const GlowMenuMessage& message)
virtual void OnReshape(int width, int height)
This method is used by GlowFixedSizeWindow to snap the size back to the canonical size and to resize the widget root. Normally, you should not override it.virtual void OnInvisible(void)
virtual void OnVisible(void)
Inherited methods
These overrideable methods are inherited from GlowComponent.virtual bool OnBeginPaint(void)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WRBeginPaint().virtual void OnEndPaint(void)
GlowTextFieldWindow overrides this method to call GlowWidgetRoot::WREndPaint().virtual void OnActivate(void)
virtual void OnDeactivate(void)
|
Back to Table of contents |
The GLOW Toolkit