• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kcharselect.h
1/* This file is part of the KDE libraries
2
3 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef kcharselect_h
22#define kcharselect_h
23
24#include <tqgridview.h>
25#include <tqvbox.h>
26#include <tqcombobox.h>
27#include <tqspinbox.h>
28#include <tqstring.h>
29#include <tqpoint.h>
30#include <tqstringlist.h>
31
32#include <tdelibs_export.h>
33
34class TQFont;
35class TQFontDatabase;
36class TQMouseEvent;
37class TQSpinBox;
38class KCharSelectTablePrivate;
39class KCharSelectPrivate;
40
51class TDEUI_EXPORT KCharSelectTable : public TQGridView
52{
53 TQ_OBJECT
54
55public:
56 KCharSelectTable( TQWidget *parent, const char *name, const TQString &_font,
57 const TQChar &_chr, int _tableNum );
58
59 virtual TQSize sizeHint() const;
60 virtual void resizeEvent( TQResizeEvent * );
61
62 virtual void setFont( const TQString &_font );
63 virtual void setChar( const TQChar &_chr );
64 virtual void setTableNum( int _tableNum );
65
66 virtual TQChar chr() { return vChr; }
67
68protected:
69 virtual void paintCell( class TQPainter *p, int row, int col );
70
71 virtual void mousePressEvent( TQMouseEvent *e ) { mouseMoveEvent( e ); }
72 virtual void mouseDoubleClickEvent ( TQMouseEvent *e ){ mouseMoveEvent( e ); emit doubleClicked();}
73 virtual void mouseReleaseEvent( TQMouseEvent *e ) { mouseMoveEvent( e ); emit activated( chr() ); emit activated(); }
74 virtual void mouseMoveEvent( TQMouseEvent *e );
75
76 virtual void keyPressEvent( TQKeyEvent *e );
77
78 void gotoLeft();
79 void gotoRight();
80 void gotoUp();
81 void gotoDown();
82
83 TQString vFont;
84 TQChar vChr;
85 int vTableNum;
86 TQPoint vPos;
87 TQChar focusItem;
88 TQPoint focusPos;
89 int temp;
90
91signals:
92 void highlighted( const TQChar &c );
93 void highlighted();
94 void activated( const TQChar &c );
95 void activated();
96 void focusItemChanged();
97 void focusItemChanged( const TQChar &c );
98 void tableUp();
99 void tableDown();
100 void doubleClicked();
101
102private:
103 virtual void setFont(const TQFont &f) { TQGridView::setFont(f); }
104 void setToolTips();
105protected:
106 virtual void virtual_hook( int id, void* data );
107private:
108 KCharSelectTablePrivate* const d;
109};
110
140class TDEUI_EXPORT KCharSelect : public TQVBox
141{
142 TQ_OBJECT
143 TQ_PROPERTY( TQString fontFamily READ font WRITE setFont )
144 TQ_PROPERTY( int tableNum READ tableNum WRITE setTableNum )
145 TQ_PROPERTY( bool fontComboEnabled READ isFontComboEnabled WRITE enableFontCombo )
146 TQ_PROPERTY( bool tableSpinBoxEnabled READ isTableSpinBoxEnabled WRITE enableTableSpinBox )
147
148public:
154 KCharSelect( TQWidget *parent, const char *name,
155 const TQString &font = TQString::null, const TQChar &chr = ' ', int tableNum = 0 );
156 ~KCharSelect();
160 virtual TQSize sizeHint() const;
161
165 virtual void setFont( const TQString &font );
166
170 virtual void setChar( const TQChar &chr );
171
175 virtual void setTableNum( int tableNum );
176
180 virtual TQChar chr() const { return charTable->chr(); }
181
185 virtual TQString font() const { return fontCombo->currentText(); }
186
190 virtual int tableNum() const { return tableSpinBox->value(); }
191
197 virtual void enableFontCombo( bool e ) { fontCombo->setEnabled( e ); }
198
205 virtual void enableTableSpinBox( bool e ) { tableSpinBox->setEnabled( e ); }
206
213 virtual bool isFontComboEnabled() const { return fontCombo->isEnabled(); }
214
221 virtual bool isTableSpinBoxEnabled() const { return tableSpinBox->isEnabled(); }
222
223protected:
224 virtual void fillFontCombo();
225 static void cleanupFontDatabase();
226
227 TQComboBox *fontCombo;
228 TQSpinBox *tableSpinBox;
229 KCharSelectTable *charTable;
230 TQStringList fontList;
231 static TQFontDatabase * fontDataBase;
232
233protected slots:
234 void fontSelected( const TQString &_font );
235 void tableChanged( int _value );
236 void charHighlighted( const TQChar &c ) { emit highlighted( c ); }
237 void charHighlighted() { emit highlighted(); }
238 void charActivated( const TQChar &c ) { emit activated( c ); }
239 void charActivated() { emit activated(); }
240 void charFocusItemChanged() { emit focusItemChanged(); }
241 void charFocusItemChanged( const TQChar &c ) { emit focusItemChanged( c ); }
242 void charTableUp() { if ( tableNum() < 255 ) setTableNum( tableNum() + 1 ); }
243 void charTableDown() { if ( tableNum() > 0 ) setTableNum( tableNum() - 1 ); }
244 void slotDoubleClicked() { emit doubleClicked(); }
245 void slotUnicodeEntered();
246 void slotUpdateUnicode( const TQChar &c );
247signals:
248 void highlighted( const TQChar &c );
249 void highlighted();
250 void activated( const TQChar &c );
251 void activated();
252 void fontChanged( const TQString &_font );
253 void focusItemChanged();
254 void focusItemChanged( const TQChar &c );
255 void doubleClicked();
256
257private:
258 virtual void setFont(const TQFont &f) { TQVBox::setFont(f); }
259protected:
260 virtual void virtual_hook( int id, void* data );
261private:
262 class KCharSelectPrivate;
263 KCharSelectPrivate* const d;
264};
265
266#endif
KCharSelectTable
Character selection table.
Definition: kcharselect.h:52
KCharSelect
Character selection widget.
Definition: kcharselect.h:141
KCharSelect::enableFontCombo
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 ...
Definition: kcharselect.h:197
KCharSelect::isTableSpinBoxEnabled
virtual bool isTableSpinBoxEnabled() const
Returns wether the table spinbox on the top is enabled or disabled.
Definition: kcharselect.h:221
KCharSelect::chr
virtual TQChar chr() const
Returns the currently selected character.
Definition: kcharselect.h:180
KCharSelect::isFontComboEnabled
virtual bool isFontComboEnabled() const
Returns wether the font combobox on the top is enabled or disabled.
Definition: kcharselect.h:213
KCharSelect::enableTableSpinBox
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...
Definition: kcharselect.h:205
KCharSelect::tableNum
virtual int tableNum() const
Returns the currently displayed table.
Definition: kcharselect.h:190
KCharSelect::font
virtual TQString font() const
Returns the currently displayed font.
Definition: kcharselect.h:185

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.