Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

wftk::LineEdit Class Reference

LineEdit: a single-line text box for user input. More...

#include <lineedit.h>

Inheritance diagram for wftk::LineEdit:

wftk::Widget wftk::ScreenArea wftk::MultiLineEdit wftk::Terminal List of all members.

Public Member Functions

 LineEdit (const std::string &text="", const Font &font=Font())
 Constructor.

const std::string & getText ()
 Return contents of this LineEdit.

void setTextColor (const Color &fontCol)
 Set text foreground color.

virtual void setText (const std::string &)
 Set the contents of this LineEdit.

virtual void clearText ()
 Clear the contents of this LineEdit.

virtual void timer ()
 timer is used to blink the cursor

virtual bool keyEvent (const SDL_keysym &, bool pressed)
 virtual function to handle keyboard events

virtual void gainedFocus ()
 virtual function to handle receipt of focus

virtual void lostFocus ()
 virtual function to handle loss of focus


Public Attributes

SigC::Signal0< void > keyInput
 signal emitted when a key event is received within this widget

SigC::Signal0< void > textChanged
 signal emitted after the text has changed.

SigC::Signal0< void > enterPressed
 signal emitted after enter is pressed


Protected Member Functions

virtual void draw (Surface &, const Point &, const Region &)
 The area drawn to must lie within the given region.

virtual void setPackingInfo ()
 recalculate the object's prefered size

void textUpdate ()

Protected Attributes

std::string text_
Font textFont_

Detailed Description

LineEdit: a single-line text box for user input.

Input size is limited graphically - when there isn't enough room onscreen for the cursor, the input box is locked until either enter or backspace is pressed.

Also plays the named sample "click" on keypress


Constructor & Destructor Documentation

wftk::LineEdit::LineEdit const std::string &  text = "",
const Font font = Font()
[explicit]
 

Constructor.

Parameters:
text Initial text for this LineEdit (defaults to empty string)
font Initial font for this LineEdit (defaults to wftk-default)


Member Function Documentation

void wftk::LineEdit::draw Surface surf,
const Point offset,
const Region r
[protected, virtual]
 

The area drawn to must lie within the given region.

This is protected so derived classes can call their parents' draw() in their own implementations.

Reimplemented from wftk::Widget.


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

Generated Thu Mar 18 20:06:05 2004.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.