KCharSelect class Reference (kdeui Library)

| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KCharSelect Class Reference

A Widget which allows the user to select a character of a specified font in a table Character-Selection Widget. More...

`#include <kcharselect.h>`

Inheritance diagram for KCharSelect:

[legend]
Collaboration diagram for KCharSelect:

[legend]
List of all members.

## Signals
void | highlighted (const QChar &c)
void | highlighted ()
void | activated (const QChar &c)
void | activated ()
void | fontChanged (const QString &_font)
void | focusItemChanged ()
void | focusItemChanged (const QChar &c)
void | doubleClicked ()
## Public Member Functions
| KCharSelect (QWidget *parent, const char *name, const QString &font=QString::null, const QChar &chr= ' ', int tableNum=0)
| Constructor.
virtual QSize | sizeHint () const
| Reimplemented.
virtual void | setFont (const QString &font)
| Sets the font which is displayed to `font`.
virtual void | setChar (const QChar &chr)
| Sets the currently selected character to `chr`.
virtual void | setTableNum (int tableNum)
| Sets the currently displayed table to `tableNum`.
virtual QChar | chr () const
| Returns the currently selected character.
virtual QString | font () const
| Returns the currently displayed font.
virtual int | tableNum () const
| Returns the currently displayed table.
virtual void | enableFontCombo (bool e)
| If `e` is set to TRUE, the combobox which allows the user to select the font which should be displayed is enabled, else disabled.
virtual void | enableTableSpinBox (bool e)
| If `e` is set to TRUE, the spinbox which allows the user to specify which characters of the font should be displayed, is enabled, else disabled.
virtual bool | isFontComboEnabled () const
| Returns wether the font combobox on the top is enabled or disabled.
virtual bool | isTableSpinBoxEnabled () const
| Returns wether the table spinbox on the top is enabled or disabled.
## Protected Slots
void | fontSelected (const QString &_font)
void | tableChanged (int _value)
void | charHighlighted (const QChar &c)
void | charHighlighted ()
void | charActivated (const QChar &c)
void | charActivated ()
void | charFocusItemChanged ()
void | charFocusItemChanged (const QChar &c)
void | charTableUp ()
void | charTableDown ()
void | slotDoubleClicked ()
## Protected Member Functions
virtual void | fillFontCombo ()
virtual void | virtual_hook (int id, void *data)
## Static Protected Member Functions
void | cleanupFontDatabase ()
## Protected Attributes
QComboBox * | fontCombo
QSpinBox * | tableSpinBox
KCharSelectTable * | charTable
QStringList | fontList
## Static Protected Attributes
QFontDatabase * | fontDataBase = 0

## Detailed Description

A Widget which allows the user to select a character of a specified font in a table Character-Selection Widget.

You can specify the font whoes characters should be displayed via setFont(). Using enableFontCombo() you can allow the user to choose the font from a combob-box. As only 256 characters are displayed at once in the table, using the spinbox on the top the user can choose starting from which chracater the table displayes them. This spinbox also can be enabled or disabled using enableTableSpinBox().

KCharSelect supports keyboard and mouse navigation. Click+Move selects always the character below the mouse cursor. Using the arrow keys the focus mark is moved around and with pressing RETURN or SPACE the cell which contains the focus mark gets selected.

To get the current selected character, use the chr() method. You can set the character which should be displayed with setChar() and the table number which should be displayed with setTableNum().

Version:
  Id
    kcharselect.h,v 1.21 2002/03/04 00:51:46 lunakl Exp

Author:
  Reginald Stadlbauer <reggie@kde.org>

Definition at line 134 of file kcharselect.h.

## Constructor & Destructor Documentation

KCharSelect::KCharSelect | ( | QWidget * | parent,
|  | const char * | name,
|  | const QString & | font = QString::null,
|  | const QChar & | chr = ' ',
|  | int | tableNum = 0
| ) |

| Constructor. `font` specifies which font should be displayed, `chr` which character should be selected and `tableNum` specifies the number of the table which should be displayed. Definition at line 333 of file kcharselect.cpp. References QString::isEmpty(), KStdAccel::name(), QLabel::setAlignment(), setFont(), QHBox::setSpacing(), setTableNum(), and KDialog::spacingHint().

## Member Function Documentation

QSize KCharSelect::sizeHint | ( |  | ) | const`[virtual]`

| Reimplemented. Definition at line 390 of file kcharselect.cpp.

void KCharSelect::setFont | ( | const QString & | font | ) | `[virtual]`

| Sets the font which is displayed to `font`. Definition at line 396 of file kcharselect.cpp. References QComboBox::setCurrentItem(), and KCharSelectTable::setFont(). Referenced by KCharSelect().

void KCharSelect::setChar | ( | const QChar & | chr | ) | `[virtual]`

| Sets the currently selected character to `chr`. Definition at line 411 of file kcharselect.cpp. References KCharSelectTable::setChar().

void KCharSelect::setTableNum | ( | int | tableNum | ) | `[virtual]`

| Sets the currently displayed table to `tableNum`. Definition at line 417 of file kcharselect.cpp. References KCharSelectTable::setTableNum(), and QSpinBox::setValue(). Referenced by KCharSelect().

virtual QChar KCharSelect::chr | ( |  | ) | const`[inline, virtual]`

| Returns the currently selected character. Definition at line 173 of file kcharselect.h. References KCharSelectTable::chr().

virtual QString KCharSelect::font | ( |  | ) | const`[inline, virtual]`

| Returns the currently displayed font. Definition at line 178 of file kcharselect.h. References QComboBox::currentText().

virtual int KCharSelect::tableNum | ( |  | ) | const`[inline, virtual]`

| Returns the currently displayed table. Definition at line 183 of file kcharselect.h. References QSpinBox::value().

virtual void KCharSelect::enableFontCombo | ( | bool | e | ) | `[inline, virtual]`

| If `e` is set to TRUE, the combobox which allows the user to select the font which should be displayed is enabled, else disabled. Definition at line 190 of file kcharselect.h.

virtual void KCharSelect::enableTableSpinBox | ( | bool | e | ) | `[inline, virtual]`

| If `e` is set to TRUE, the spinbox which allows the user to specify which characters of the font should be displayed, is enabled, else disabled. Definition at line 198 of file kcharselect.h.

virtual bool KCharSelect::isFontComboEnabled | ( |  | ) | const`[inline, virtual]`

| Returns wether the font combobox on the top is enabled or disabled. See also: enableFontCombo() Definition at line 206 of file kcharselect.h.

virtual bool KCharSelect::isTableSpinBoxEnabled | ( |  | ) | const`[inline, virtual]`

| Returns wether the table spinbox on the top is enabled or disabled. See also: enableTableSpinBox() Definition at line 214 of file kcharselect.h.

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

- kcharselect.h
- kcharselect.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:59:08 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001