Wt examples: LettersWidget Class Reference

Wt examples 3.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes
LettersWidget Class Reference

`#include <LettersWidget.h>`

Inheritance diagram for LettersWidget:
[legend]

List of all members.

## Public Member Functions
| LettersWidget (Wt::WContainerWidget *parent=0)
void | reset ()
Wt::Signal< char > & | letterPushed ()
## Private Member Functions
void | processButton (Wt::WPushButton *b)
## Private Attributes
Wt::WTable * | impl_
std::vector< Wt::WPushButton * > | letterButtons_
Wt::Signal< char > | letterPushed_

## Detailed Description

Definition at line 19 of file LettersWidget.h.

## Constructor & Destructor Documentation

LettersWidget::LettersWidget | ( | Wt::WContainerWidget * | parent = `0` | ) |

Definition at line 14 of file LettersWidget.C.

      : WCompositeWidget(parent)
    {
      setImplementation(impl_ = new WTable());

      impl_->resize(13*30, WLength::Auto);

      for (unsigned int i = 0; i < 26; ++i) {
        std::string c(1, 'A' + i);
        WPushButton *character = new WPushButton(c,
                                                 impl_->elementAt(i / 13, i % 13));
        letterButtons_.push_back(character);
        character->resize(WLength(30), WLength::Auto);

        character->clicked().connect
          (boost::bind(&LettersWidget::processButton, this, character));
      }
    }

## Member Function Documentation

Wt::Signal<char>& LettersWidget::letterPushed | ( |  | ) | `[inline]`

Definition at line 26 of file LettersWidget.h.

    { return letterPushed_; }

void LettersWidget::processButton | ( | Wt::WPushButton * | b | ) | `[private]`

Definition at line 33 of file LettersWidget.C.

    {
      b->disable();
      letterPushed_.emit(b->text().toUTF8()[0]);
    }

void LettersWidget::reset | ( |  | ) |

Definition at line 39 of file LettersWidget.C.

    {
      for (unsigned int i = 0; i < letterButtons_.size(); ++i)
        letterButtons_[i]->enable();

      show();
    }

## Member Data Documentation

Wt::WTable* LettersWidget::impl_`[private]`

Definition at line 29 of file LettersWidget.h.

std::vector<Wt::WPushButton *> LettersWidget::letterButtons_`[private]`

Definition at line 30 of file LettersWidget.h.

Wt::Signal<char> LettersWidget::letterPushed_`[private]`

Definition at line 32 of file LettersWidget.h.

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

- /home/koen/project/wt/public-git/wt/examples/hangman/LettersWidget.h
- /home/koen/project/wt/public-git/wt/examples/hangman/LettersWidget.C