diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kofficeui/tkcoloractions.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kofficeui/tkcoloractions.cpp')
-rw-r--r-- | lib/kofficeui/tkcoloractions.cpp | 442 |
1 files changed, 221 insertions, 221 deletions
diff --git a/lib/kofficeui/tkcoloractions.cpp b/lib/kofficeui/tkcoloractions.cpp index 40859916..1f17efb6 100644 --- a/lib/kofficeui/tkcoloractions.cpp +++ b/lib/kofficeui/tkcoloractions.cpp @@ -22,18 +22,18 @@ #include "tkcoloractions.h" #include "tktoolbarbutton.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kcolordialog.h> #include <ktoolbar.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kdebug.h> -#include <qapplication.h> +#include <tqapplication.h> -TKColorPopupMenu::TKColorPopupMenu( QWidget* parent, const char* name ) -: KPopupMenu(parent,name) +TKColorPopupMenu::TKColorPopupMenu( TQWidget* tqparent, const char* name ) +: KPopupMenu(tqparent,name) { } @@ -43,7 +43,7 @@ TKColorPopupMenu::~TKColorPopupMenu() void TKColorPopupMenu::updateItemSize() { - styleChange(style()); + styleChange(tqstyle()); } /****************************************************************************************/ class TKSelectColorActionPrivate @@ -53,32 +53,32 @@ public: { } bool defaultColorMenu; - QColor defaultColor; + TQColor defaultColor; }; -TKSelectColorAction::TKSelectColorAction( const QString& text, Type type, QObject* parent, const char* name, bool menuDefaultColor ) -: TKAction(parent,name) +TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, TQObject* tqparent, const char* name, bool menuDefaultColor ) +: TKAction(tqparent,name) { d=new TKSelectColorActionPrivate(); d->defaultColorMenu=menuDefaultColor; - d->defaultColor=QColor(); + d->defaultColor=TQColor(); setText(text); m_type = type; init(); } -TKSelectColorAction::TKSelectColorAction( const QString& text, Type type, - QObject* receiver, const char* slot, - QObject* parent, const char* name, bool menuDefaultColor) -: TKAction(parent,name) +TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, + TQObject* receiver, const char* slot, + TQObject* tqparent, const char* name, bool menuDefaultColor) +: TKAction(tqparent,name) { d=new TKSelectColorActionPrivate(); d->defaultColorMenu=menuDefaultColor; - d->defaultColor=QColor(); + d->defaultColor=TQColor(); setText(text); m_type = type; - connect( this, SIGNAL( activated() ), receiver, slot ); + connect( this, TQT_SIGNAL( activated() ), receiver, slot ); init(); } @@ -87,10 +87,10 @@ void TKSelectColorAction::init() m_pStandardColor = new TKColorPanel(); m_pRecentColor = new TKColorPanel(); - connect(m_pStandardColor,SIGNAL(colorSelected(const QColor&)),SLOT(panelColorSelected(const QColor&))); - connect(m_pStandardColor,SIGNAL(reject()),SLOT(panelReject())); - connect(m_pRecentColor,SIGNAL(colorSelected(const QColor&)),SLOT(panelColorSelected(const QColor&))); - connect(m_pRecentColor,SIGNAL(reject()),SLOT(panelReject())); + connect(m_pStandardColor,TQT_SIGNAL(colorSelected(const TQColor&)),TQT_SLOT(panelColorSelected(const TQColor&))); + connect(m_pStandardColor,TQT_SIGNAL(reject()),TQT_SLOT(panelReject())); + connect(m_pRecentColor,TQT_SIGNAL(colorSelected(const TQColor&)),TQT_SLOT(panelColorSelected(const TQColor&))); + connect(m_pRecentColor,TQT_SIGNAL(reject()),TQT_SLOT(panelReject())); m_pRecentColor->clear(); @@ -102,17 +102,17 @@ void TKSelectColorAction::init() switch (m_type) { case TextColor: - m_pMenu->insertItem(i18n("More Text Colors..."),this,SLOT(selectColorDialog())); + m_pMenu->insertItem(i18n("More Text Colors..."),this,TQT_SLOT(selectColorDialog())); setCurrentColor(black); setIcon("textcolor"); break; case LineColor: - m_pMenu->insertItem(i18n("More Line Colors..."),this,SLOT(selectColorDialog())); + m_pMenu->insertItem(i18n("More Line Colors..."),this,TQT_SLOT(selectColorDialog())); setCurrentColor(black); setIcon("color_line"); break; case FillColor: - m_pMenu->insertItem(i18n("More Fill Colors..."),this,SLOT(selectColorDialog())); + m_pMenu->insertItem(i18n("More Fill Colors..."),this,TQT_SLOT(selectColorDialog())); setCurrentColor(white); setIcon("color_fill"); break; @@ -122,11 +122,11 @@ void TKSelectColorAction::init() if(d->defaultColorMenu) { m_pMenu->insertSeparator(); - m_pMenu->insertItem(i18n("Default Color"),this,SLOT(defaultColor())); + m_pMenu->insertItem(i18n("Default Color"),this,TQT_SLOT(defaultColor())); } - connect(m_pStandardColor,SIGNAL(sizeChanged()),m_pMenu,SLOT(updateItemSize())); - connect(m_pRecentColor,SIGNAL(sizeChanged()),m_pMenu,SLOT(updateItemSize())); + connect(m_pStandardColor,TQT_SIGNAL(sizeChanged()),m_pMenu,TQT_SLOT(updateItemSize())); + connect(m_pRecentColor,TQT_SIGNAL(sizeChanged()),m_pMenu,TQT_SLOT(updateItemSize())); } TKSelectColorAction::~TKSelectColorAction() @@ -137,7 +137,7 @@ TKSelectColorAction::~TKSelectColorAction() void TKSelectColorAction::initToolBarButton(TKToolBarButton* b) { - QWhatsThis::add( b, whatsThis() ); + TQWhatsThis::add( b, whatsThis() ); TKAction::initToolBarButton(b); b->setDelayedPopup( popupMenu() ); updatePixmap(b); @@ -150,7 +150,7 @@ void TKSelectColorAction::defaultColor() emit activated(); } -void TKSelectColorAction::setDefaultColor(const QColor &_col) +void TKSelectColorAction::setDefaultColor(const TQColor &_col) { d->defaultColor=_col; } @@ -158,29 +158,29 @@ void TKSelectColorAction::setDefaultColor(const QColor &_col) void TKSelectColorAction::updatePixmap() { for( int id = 0; id < containerCount(); ++id ) { - QWidget* w = container(id); + TQWidget* w = container(id); if ( w->inherits("KToolBar") ) { - QWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); + TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); if ( r->inherits("TKToolBarButton") ) { updatePixmap(static_cast<TKToolBarButton*>(r)); } } - else if(w->inherits("QPopupMenu") ) { - QPixmap pix =iconSet(KIcon::Small).pixmap(QIconSet::Automatic,QIconSet::Active); + else if(w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) ) { + TQPixmap pix =iconSet(KIcon::Small).pixmap(TQIconSet::Automatic,TQIconSet::Active); if ( pix.isNull() ) return; - QPainter p(&pix); + TQPainter p(&pix); switch (m_type) { case TextColor: - p.fillRect(QRect(0,12,16,5), m_pCurrentColor); + p.fillRect(TQRect(0,12,16,5), m_pCurrentColor); break; case LineColor: - p.fillRect(QRect(0,13,16,5), m_pCurrentColor); - p.fillRect(QRect(3,12,1,1), m_pCurrentColor); + p.fillRect(TQRect(0,13,16,5), m_pCurrentColor); + p.fillRect(TQRect(3,12,1,1), m_pCurrentColor); break; case FillColor: - p.fillRect(QRect(0,13,16,5), m_pCurrentColor); - p.fillRect(QRect(1,10,5,3), m_pCurrentColor); + p.fillRect(TQRect(0,13,16,5), m_pCurrentColor); + p.fillRect(TQRect(1,10,5,3), m_pCurrentColor); break; case Color: break; @@ -198,19 +198,19 @@ void TKSelectColorAction::updatePixmap(TKToolBarButton* b) // Not much point in painting with an invalid color if (!m_pCurrentColor.isValid()) return; - QPixmap pix =b->getActivePixmap(); - QPainter p(&pix); + TQPixmap pix =b->getActivePixmap(); + TQPainter p(&pix); switch (m_type) { case TextColor: - p.fillRect(QRect(0,12,16,5), m_pCurrentColor); + p.fillRect(TQRect(0,12,16,5), m_pCurrentColor); break; case LineColor: - p.fillRect(QRect(0,13,16,5), m_pCurrentColor); - p.fillRect(QRect(3,12,1,1), m_pCurrentColor); + p.fillRect(TQRect(0,13,16,5), m_pCurrentColor); + p.fillRect(TQRect(3,12,1,1), m_pCurrentColor); break; case FillColor: - p.fillRect(QRect(0,13,16,5), m_pCurrentColor); - p.fillRect(QRect(1,10,5,3), m_pCurrentColor); + p.fillRect(TQRect(0,13,16,5), m_pCurrentColor); + p.fillRect(TQRect(1,10,5,3), m_pCurrentColor); break; case Color: break; @@ -219,7 +219,7 @@ void TKSelectColorAction::updatePixmap(TKToolBarButton* b) b->setPixmap(pix); } -void TKSelectColorAction::setCurrentColor( const QColor& color ) +void TKSelectColorAction::setCurrentColor( const TQColor& color ) { if ( color == m_pCurrentColor ) return; @@ -229,18 +229,18 @@ void TKSelectColorAction::setCurrentColor( const QColor& color ) updatePixmap(); } -void TKSelectColorAction::setActiveColor( const QColor& color ) +void TKSelectColorAction::setActiveColor( const TQColor& color ) { m_pStandardColor->setActiveColor(color); } void TKSelectColorAction::selectColorDialog() { - QColor c = color(); + TQColor c = color(); if ( d->defaultColorMenu ) { - if ( KColorDialog::getColor(c,d->defaultColor, qApp->activeWindow()) == QDialog::Accepted ) + if ( KColorDialog::getColor(c,d->defaultColor, TQT_TQWIDGET(tqApp->activeWindow())) == TQDialog::Accepted ) { setCurrentColor(c); m_pRecentColor->insertColor(m_pCurrentColor); @@ -250,7 +250,7 @@ void TKSelectColorAction::selectColorDialog() } else { - if ( KColorDialog::getColor(c, qApp->activeWindow()) == QDialog::Accepted ) + if ( KColorDialog::getColor(c, TQT_TQWIDGET(tqApp->activeWindow())) == TQDialog::Accepted ) { setCurrentColor(c); m_pRecentColor->insertColor(m_pCurrentColor); @@ -272,7 +272,7 @@ void TKSelectColorAction::activate() emit activated(); } -void TKSelectColorAction::panelColorSelected( const QColor& color ) +void TKSelectColorAction::panelColorSelected( const TQColor& color ) { m_pMenu->hide(); setCurrentColor(color); @@ -297,8 +297,8 @@ public: }; /****************************************************************************************/ -TKColorPanel::TKColorPanel( QWidget* parent, const char* name ) -: QWidget(parent,name) +TKColorPanel::TKColorPanel( TQWidget* tqparent, const char* name ) +: TQWidget(tqparent,name) { d = new TKColorPanel::TKColorPanelPrivate(); m_activeColor = black; @@ -315,7 +315,7 @@ void TKColorPanel::setNumCols( int col ) m_iWidth = col; resetGrid(); - QDictIterator<TKColorPanelButton> it(m_pColorDict); + TQDictIterator<TKColorPanelButton> it(m_pColorDict); while ( it.current() ) { addToGrid(it.current()); ++it; @@ -333,7 +333,7 @@ void TKColorPanel::resetGrid() m_iY = 0; delete m_pLayout; - m_pLayout = new QGridLayout(this,0,m_iWidth+1,0,0); + m_pLayout = new TQGridLayout(this,0,m_iWidth+1,0,0); emit sizeChanged(); } @@ -348,16 +348,16 @@ void TKColorPanel::clear() resetGrid(); } -void TKColorPanel::insertColor( const QColor& color, const QString& text ) +void TKColorPanel::insertColor( const TQColor& color, const TQString& text ) { if (m_pColorDict[color.name()]) return; insertColor(color); - QToolTip::add(m_pColorDict[color.name()],text); + TQToolTip::add(m_pColorDict[color.name()],text); } -void TKColorPanel::insertColor( const QColor& color ) +void TKColorPanel::insertColor( const TQColor& color ) { if (m_pColorDict[color.name()]) return; @@ -368,7 +368,7 @@ void TKColorPanel::insertColor( const QColor& color ) if ( m_activeColor == color ) f->setActive(true); - connect(f,SIGNAL(selected(const QColor&)),SLOT(selected(const QColor&))); + connect(f,TQT_SIGNAL(selected(const TQColor&)),TQT_SLOT(selected(const TQColor&))); addToGrid(f); } @@ -385,7 +385,7 @@ void TKColorPanel::addToGrid( TKColorPanelButton* f ) emit sizeChanged(); } -void TKColorPanel::setActiveColor( const QColor& color ) +void TKColorPanel::setActiveColor( const TQColor& color ) { TKColorPanelButton* b = m_pColorDict[m_activeColor.name()]; if (b) @@ -398,19 +398,19 @@ void TKColorPanel::setActiveColor( const QColor& color ) b->setActive(true); } -void TKColorPanel::mouseReleaseEvent( QMouseEvent* ) +void TKColorPanel::mouseReleaseEvent( TQMouseEvent* ) { reject(); } -void TKColorPanel::showEvent( QShowEvent *e ) +void TKColorPanel::showEvent( TQShowEvent *e ) { if ( !d->panelCreated ) fillPanel(); - QWidget::showEvent(e); + TQWidget::showEvent(e); } -void TKColorPanel::selected( const QColor& color ) +void TKColorPanel::selected( const TQColor& color ) { emit colorSelected(color); } @@ -421,161 +421,161 @@ void TKColorPanel::fillPanel() blockSignals(true); // don't emit sizeChanged() all the time // ### TODO: names without space (e.g. red) are lower case in rgb.txt - insertColor(QColor( 255, 0, 0 ), i18n( "color", "Red")); - insertColor(QColor( 255, 165, 0 ), i18n( "color", "Orange")); - insertColor(QColor( 255, 0, 255 ), i18n( "color", "Magenta")); - insertColor(QColor( 0, 0, 255 ), i18n( "color", "Blue")); - insertColor(QColor( 0, 255, 255 ), i18n( "color", "Cyan")); - insertColor(QColor( 0, 255, 0 ), i18n( "color", "Green")); - insertColor(QColor( 255, 255, 0 ), i18n( "color", "Yellow")); - insertColor(QColor( 165, 42, 42 ), i18n( "color", "Brown")); - insertColor(QColor( 139, 0, 0 ), i18n( "color", "DarkRed")); - insertColor(QColor( 255, 140, 0 ), i18n( "color", "DarkOrange")); - insertColor(QColor( 139, 0, 139 ), i18n( "color", "DarkMagenta")); - insertColor(QColor( 0, 0, 139 ), i18n( "color", "DarkBlue")); - insertColor(QColor( 0, 139, 139 ), i18n( "color", "DarkCyan")); - insertColor(QColor( 0, 100, 0 ), i18n( "color", "DarkGreen")); - insertColor(QColor( 130, 127, 0 ), i18n( "color", "DarkYellow")); // ### not in rgb.txt - - insertColor(QColor( 255, 255, 255 ), i18n( "color", "White")); - insertColor(QColor( 229, 229, 229 ), i18n( "color", "Gray 90%")); // ### not in rgb.txt - insertColor(QColor( 204, 204, 204 ), i18n( "color", "Gray 80%")); // ### not in rgb.txt - insertColor(QColor( 178, 178, 178 ), i18n( "color", "Gray 70%")); // ### not in rgb.txt - insertColor(QColor( 153, 153, 153 ), i18n( "color", "Gray 60%")); // ### not in rgb.txt - insertColor(QColor( 127, 127, 127 ), i18n( "color", "Gray 50%")); // ### not in rgb.txt - insertColor(QColor( 102, 102, 102 ), i18n( "color", "Gray 40%")); // ### not in rgb.txt - insertColor(QColor( 76, 76, 76 ), i18n( "color", "Gray 30%")); // ### not in rgb.txt - insertColor(QColor( 51, 51, 51 ), i18n( "color", "Gray 20%")); // ### not in rgb.txt - insertColor(QColor( 25, 25, 25 ), i18n( "color", "Gray 10%")); // ### not in rgb.txt - insertColor(QColor( 0, 0, 0 ), i18n( "color", "Black")); - - insertColor(QColor( 255, 255, 240 ), i18n( "color", "Ivory")); - insertColor(QColor( 255, 250, 250 ), i18n( "color", "Snow")); - insertColor(QColor( 245, 255, 250 ), i18n( "color", "MintCream")); - insertColor(QColor( 255, 250, 240 ), i18n( "color", "FloralWhite")); - insertColor(QColor( 255, 255, 224 ), i18n( "color", "LightYellow")); - insertColor(QColor( 240, 255, 255 ), i18n( "color", "Azure")); - insertColor(QColor( 248, 248, 255 ), i18n( "color", "GhostWhite")); - insertColor(QColor( 240, 255, 240 ), i18n( "color", "Honeydew")); - insertColor(QColor( 255, 245, 238 ), i18n( "color", "Seashell")); - insertColor(QColor( 240, 248, 255 ), i18n( "color", "AliceBlue")); - insertColor(QColor( 255, 248, 220 ), i18n( "color", "Cornsilk")); - insertColor(QColor( 255, 240, 245 ), i18n( "color", "LavenderBlush")); - insertColor(QColor( 253, 245, 230 ), i18n( "color", "OldLace")); - insertColor(QColor( 245, 245, 245 ), i18n( "color", "WhiteSmoke")); - insertColor(QColor( 255, 250, 205 ), i18n( "color", "LemonChiffon")); - insertColor(QColor( 224, 255, 255 ), i18n( "color", "LightCyan")); - insertColor(QColor( 250, 250, 210 ), i18n( "color", "LightGoldenrodYellow")); - insertColor(QColor( 250, 240, 230 ), i18n( "color", "Linen")); - insertColor(QColor( 245, 245, 220 ), i18n( "color", "Beige")); - insertColor(QColor( 255, 239, 213 ), i18n( "color", "PapayaWhip")); - insertColor(QColor( 255, 235, 205 ), i18n( "color", "BlanchedAlmond")); - insertColor(QColor( 250, 235, 215 ), i18n( "color", "AntiqueWhite")); - insertColor(QColor( 255, 228, 225 ), i18n( "color", "MistyRose")); - insertColor(QColor( 230, 230, 250 ), i18n( "color", "Lavender")); - insertColor(QColor( 255, 228, 196 ), i18n( "color", "Bisque")); - insertColor(QColor( 255, 228, 181 ), i18n( "color", "Moccasin")); - insertColor(QColor( 255, 222, 173 ), i18n( "color", "NavajoWhite")); - insertColor(QColor( 255, 218, 185 ), i18n( "color", "PeachPuff")); - insertColor(QColor( 238, 232, 170 ), i18n( "color", "PaleGoldenrod")); - insertColor(QColor( 245, 222, 179 ), i18n( "color", "Wheat")); - insertColor(QColor( 220, 220, 220 ), i18n( "color", "Gainsboro")); - insertColor(QColor( 240, 230, 140 ), i18n( "color", "Khaki")); - insertColor(QColor( 175, 238, 238 ), i18n( "color", "PaleTurquoise")); - insertColor(QColor( 255, 192, 203 ), i18n( "color", "Pink")); - insertColor(QColor( 238, 221, 130 ), i18n( "color", "LightGoldenrod")); - insertColor(QColor( 211, 211, 211 ), i18n( "color", "LightGray")); - insertColor(QColor( 255, 182, 193 ), i18n( "color", "LightPink")); - insertColor(QColor( 176, 224, 230 ), i18n( "color", "PowderBlue")); - insertColor(QColor( 127, 255, 212 ), i18n( "color", "Aquamarine")); - insertColor(QColor( 216, 191, 216 ), i18n( "color", "Thistle")); - insertColor(QColor( 173, 216, 230 ), i18n( "color", "LightBlue")); - insertColor(QColor( 152, 251, 152 ), i18n( "color", "PaleGreen")); - insertColor(QColor( 255, 215, 0 ), i18n( "color", "Gold")); - insertColor(QColor( 173, 255, 47 ), i18n( "color", "GreenYellow")); - insertColor(QColor( 176, 196, 222 ), i18n( "color", "LightSteelBlue")); - insertColor(QColor( 144, 238, 144 ), i18n( "color", "LightGreen")); - insertColor(QColor( 221, 160, 221 ), i18n( "color", "Plum")); - insertColor(QColor( 190, 190, 190 ), i18n( "color", "Gray")); - insertColor(QColor( 222, 184, 135 ), i18n( "color", "BurlyWood")); - insertColor(QColor( 135, 206, 250 ), i18n( "color", "LightSkyblue")); - insertColor(QColor( 255, 160, 122 ), i18n( "color", "LightSalmon")); - insertColor(QColor( 135, 206, 235 ), i18n( "color", "SkyBlue")); - insertColor(QColor( 210, 180, 140 ), i18n( "color", "Tan")); - insertColor(QColor( 238, 130, 238 ), i18n( "color", "Violet")); - insertColor(QColor( 244, 164, 96 ), i18n( "color", "SandyBrown")); - insertColor(QColor( 233, 150, 122 ), i18n( "color", "DarkSalmon")); - insertColor(QColor( 189, 183, 107 ), i18n( "color", "DarkKhaki")); - insertColor(QColor( 127, 255, 0 ), i18n( "color", "Chartreuse")); - insertColor(QColor( 169, 169, 169 ), i18n( "color", "DarkGray")); - insertColor(QColor( 124, 252, 0 ), i18n( "color", "LawnGreen")); - insertColor(QColor( 255, 105, 180 ), i18n( "color", "HotPink")); - insertColor(QColor( 250, 128, 114 ), i18n( "color", "Salmon")); - insertColor(QColor( 240, 128, 128 ), i18n( "color", "LightCoral")); - insertColor(QColor( 64, 224, 208 ), i18n( "color", "Turquoise")); - insertColor(QColor( 143, 188, 143 ), i18n( "color", "DarkSeagreen")); - insertColor(QColor( 218, 112, 214 ), i18n( "color", "Orchid")); - insertColor(QColor( 102, 205, 170 ), i18n( "color", "MediumAquamarine")); - insertColor(QColor( 255, 127, 80 ), i18n( "color", "Coral")); - insertColor(QColor( 154, 205, 50 ), i18n( "color", "YellowGreen")); - insertColor(QColor( 218, 165, 32 ), i18n( "color", "Goldenrod")); - insertColor(QColor( 72, 209, 204 ), i18n( "color", "MediumTurquoise")); - insertColor(QColor( 188, 143, 143 ), i18n( "color", "RosyBrown")); - insertColor(QColor( 219, 112, 147 ), i18n( "color", "PaleVioletRed")); - insertColor(QColor( 0, 250, 154 ), i18n( "color", "MediumSpringGreen")); - insertColor(QColor( 255, 99, 71 ), i18n( "color", "Tomato")); - insertColor(QColor( 0, 255, 127 ), i18n( "color", "SpringGreen")); - insertColor(QColor( 205, 133, 63 ), i18n( "color", "Peru")); - insertColor(QColor( 100, 149, 237 ), i18n( "color", "CornflowerBlue")); - insertColor(QColor( 132, 112, 255 ), i18n( "color", "LightSlateBlue")); - insertColor(QColor( 147, 112, 219 ), i18n( "color", "MediumPurple")); - insertColor(QColor( 186, 85, 211 ), i18n( "color", "MediumOrchid")); - insertColor(QColor( 95, 158, 160 ), i18n( "color", "CadetBlue")); - insertColor(QColor( 0, 206, 209 ), i18n( "color", "DarkTurquoise")); - insertColor(QColor( 0, 191, 255 ), i18n( "color", "DeepSkyblue")); - insertColor(QColor( 119, 136, 153 ), i18n( "color", "LightSlateGray")); - insertColor(QColor( 184, 134, 11 ), i18n( "color", "DarkGoldenrod")); - insertColor(QColor( 123, 104, 238 ), i18n( "color", "MediumSlateBlue")); - insertColor(QColor( 205, 92, 92 ), i18n( "color", "IndianRed")); - insertColor(QColor( 210, 105, 30 ), i18n( "color", "Chocolate")); - insertColor(QColor( 60, 179, 113 ), i18n( "color", "MediumSeaGreen")); - insertColor(QColor( 50, 205, 50 ), i18n( "color", "LimeGreen")); - insertColor(QColor( 32, 178, 170 ), i18n( "color", "LightSeaGreen")); - insertColor(QColor( 112, 128, 144 ), i18n( "color", "SlateGray")); - insertColor(QColor( 30, 144, 255 ), i18n( "color", "DodgerBlue")); - insertColor(QColor( 255, 69, 0 ), i18n( "color", "OrangeRed")); - insertColor(QColor( 255, 20, 147 ), i18n( "color", "DeepPink")); - insertColor(QColor( 70, 130, 180 ), i18n( "color", "SteelBlue")); - insertColor(QColor( 106, 90, 205 ), i18n( "color", "SlateBlue")); - insertColor(QColor( 107, 142, 35 ), i18n( "color", "OliveDrab")); - insertColor(QColor( 65, 105, 225 ), i18n( "color", "RoyalBlue")); - insertColor(QColor( 208, 32, 144 ), i18n( "color", "VioletRed")); - insertColor(QColor( 153, 50, 204 ), i18n( "color", "DarkOrchid")); - insertColor(QColor( 160, 32, 240 ), i18n( "color", "Purple")); - insertColor(QColor( 105, 105, 105 ), i18n( "color", "DimGray")); - insertColor(QColor( 138, 43, 226 ), i18n( "color", "BlueViolet")); - insertColor(QColor( 160, 82, 45 ), i18n( "color", "Sienna")); - insertColor(QColor( 199, 21, 133 ), i18n( "color", "MediumVioletRed")); - insertColor(QColor( 176, 48, 96 ), i18n( "color", "Maroon")); - insertColor(QColor( 46, 139, 87 ), i18n( "color", "SeaGreen")); - insertColor(QColor( 85, 107, 47 ), i18n( "color", "DarkOliveGreen")); - insertColor(QColor( 34, 139, 34 ), i18n( "color", "ForestGreen")); - insertColor(QColor( 139, 69, 19 ), i18n( "color", "SaddleBrown")); - insertColor(QColor( 148, 0, 211 ), i18n( "color", "DarkViolet")); - insertColor(QColor( 178, 34, 34 ), i18n( "color", "FireBrick")); - insertColor(QColor( 72, 61, 139 ), i18n( "color", "DarkSlateBlue")); - insertColor(QColor( 47, 79, 79 ), i18n( "color", "DarkSlateGray")); - insertColor(QColor( 25, 25, 112 ), i18n( "color", "MidnightBlue")); - insertColor(QColor( 0, 0, 205 ), i18n( "color", "MediumBlue")); - insertColor(QColor( 0, 0, 128 ), i18n( "color", "Navy")); + insertColor(TQColor( 255, 0, 0 ), i18n( "color", "Red")); + insertColor(TQColor( 255, 165, 0 ), i18n( "color", "Orange")); + insertColor(TQColor( 255, 0, 255 ), i18n( "color", "Magenta")); + insertColor(TQColor( 0, 0, 255 ), i18n( "color", "Blue")); + insertColor(TQColor( 0, 255, 255 ), i18n( "color", "Cyan")); + insertColor(TQColor( 0, 255, 0 ), i18n( "color", "Green")); + insertColor(TQColor( 255, 255, 0 ), i18n( "color", "Yellow")); + insertColor(TQColor( 165, 42, 42 ), i18n( "color", "Brown")); + insertColor(TQColor( 139, 0, 0 ), i18n( "color", "DarkRed")); + insertColor(TQColor( 255, 140, 0 ), i18n( "color", "DarkOrange")); + insertColor(TQColor( 139, 0, 139 ), i18n( "color", "DarkMagenta")); + insertColor(TQColor( 0, 0, 139 ), i18n( "color", "DarkBlue")); + insertColor(TQColor( 0, 139, 139 ), i18n( "color", "DarkCyan")); + insertColor(TQColor( 0, 100, 0 ), i18n( "color", "DarkGreen")); + insertColor(TQColor( 130, 127, 0 ), i18n( "color", "DarkYellow")); // ### not in rgb.txt + + insertColor(TQColor( 255, 255, 255 ), i18n( "color", "White")); + insertColor(TQColor( 229, 229, 229 ), i18n( "color", "Gray 90%")); // ### not in rgb.txt + insertColor(TQColor( 204, 204, 204 ), i18n( "color", "Gray 80%")); // ### not in rgb.txt + insertColor(TQColor( 178, 178, 178 ), i18n( "color", "Gray 70%")); // ### not in rgb.txt + insertColor(TQColor( 153, 153, 153 ), i18n( "color", "Gray 60%")); // ### not in rgb.txt + insertColor(TQColor( 127, 127, 127 ), i18n( "color", "Gray 50%")); // ### not in rgb.txt + insertColor(TQColor( 102, 102, 102 ), i18n( "color", "Gray 40%")); // ### not in rgb.txt + insertColor(TQColor( 76, 76, 76 ), i18n( "color", "Gray 30%")); // ### not in rgb.txt + insertColor(TQColor( 51, 51, 51 ), i18n( "color", "Gray 20%")); // ### not in rgb.txt + insertColor(TQColor( 25, 25, 25 ), i18n( "color", "Gray 10%")); // ### not in rgb.txt + insertColor(TQColor( 0, 0, 0 ), i18n( "color", "Black")); + + insertColor(TQColor( 255, 255, 240 ), i18n( "color", "Ivory")); + insertColor(TQColor( 255, 250, 250 ), i18n( "color", "Snow")); + insertColor(TQColor( 245, 255, 250 ), i18n( "color", "MintCream")); + insertColor(TQColor( 255, 250, 240 ), i18n( "color", "FloralWhite")); + insertColor(TQColor( 255, 255, 224 ), i18n( "color", "LightYellow")); + insertColor(TQColor( 240, 255, 255 ), i18n( "color", "Azure")); + insertColor(TQColor( 248, 248, 255 ), i18n( "color", "GhostWhite")); + insertColor(TQColor( 240, 255, 240 ), i18n( "color", "Honeydew")); + insertColor(TQColor( 255, 245, 238 ), i18n( "color", "Seashell")); + insertColor(TQColor( 240, 248, 255 ), i18n( "color", "AliceBlue")); + insertColor(TQColor( 255, 248, 220 ), i18n( "color", "Cornsilk")); + insertColor(TQColor( 255, 240, 245 ), i18n( "color", "LavenderBlush")); + insertColor(TQColor( 253, 245, 230 ), i18n( "color", "OldLace")); + insertColor(TQColor( 245, 245, 245 ), i18n( "color", "WhiteSmoke")); + insertColor(TQColor( 255, 250, 205 ), i18n( "color", "LemonChiffon")); + insertColor(TQColor( 224, 255, 255 ), i18n( "color", "LightCyan")); + insertColor(TQColor( 250, 250, 210 ), i18n( "color", "LightGoldenrodYellow")); + insertColor(TQColor( 250, 240, 230 ), i18n( "color", "Linen")); + insertColor(TQColor( 245, 245, 220 ), i18n( "color", "Beige")); + insertColor(TQColor( 255, 239, 213 ), i18n( "color", "PapayaWhip")); + insertColor(TQColor( 255, 235, 205 ), i18n( "color", "BlanchedAlmond")); + insertColor(TQColor( 250, 235, 215 ), i18n( "color", "AntiqueWhite")); + insertColor(TQColor( 255, 228, 225 ), i18n( "color", "MistyRose")); + insertColor(TQColor( 230, 230, 250 ), i18n( "color", "Lavender")); + insertColor(TQColor( 255, 228, 196 ), i18n( "color", "Bisque")); + insertColor(TQColor( 255, 228, 181 ), i18n( "color", "Moccasin")); + insertColor(TQColor( 255, 222, 173 ), i18n( "color", "NavajoWhite")); + insertColor(TQColor( 255, 218, 185 ), i18n( "color", "PeachPuff")); + insertColor(TQColor( 238, 232, 170 ), i18n( "color", "PaleGoldenrod")); + insertColor(TQColor( 245, 222, 179 ), i18n( "color", "Wheat")); + insertColor(TQColor( 220, 220, 220 ), i18n( "color", "Gainsboro")); + insertColor(TQColor( 240, 230, 140 ), i18n( "color", "Khaki")); + insertColor(TQColor( 175, 238, 238 ), i18n( "color", "PaleTurquoise")); + insertColor(TQColor( 255, 192, 203 ), i18n( "color", "Pink")); + insertColor(TQColor( 238, 221, 130 ), i18n( "color", "LightGoldenrod")); + insertColor(TQColor( 211, 211, 211 ), i18n( "color", "LightGray")); + insertColor(TQColor( 255, 182, 193 ), i18n( "color", "LightPink")); + insertColor(TQColor( 176, 224, 230 ), i18n( "color", "PowderBlue")); + insertColor(TQColor( 127, 255, 212 ), i18n( "color", "Aquamarine")); + insertColor(TQColor( 216, 191, 216 ), i18n( "color", "Thistle")); + insertColor(TQColor( 173, 216, 230 ), i18n( "color", "LightBlue")); + insertColor(TQColor( 152, 251, 152 ), i18n( "color", "PaleGreen")); + insertColor(TQColor( 255, 215, 0 ), i18n( "color", "Gold")); + insertColor(TQColor( 173, 255, 47 ), i18n( "color", "GreenYellow")); + insertColor(TQColor( 176, 196, 222 ), i18n( "color", "LightSteelBlue")); + insertColor(TQColor( 144, 238, 144 ), i18n( "color", "LightGreen")); + insertColor(TQColor( 221, 160, 221 ), i18n( "color", "Plum")); + insertColor(TQColor( 190, 190, 190 ), i18n( "color", "Gray")); + insertColor(TQColor( 222, 184, 135 ), i18n( "color", "BurlyWood")); + insertColor(TQColor( 135, 206, 250 ), i18n( "color", "LightSkyblue")); + insertColor(TQColor( 255, 160, 122 ), i18n( "color", "LightSalmon")); + insertColor(TQColor( 135, 206, 235 ), i18n( "color", "SkyBlue")); + insertColor(TQColor( 210, 180, 140 ), i18n( "color", "Tan")); + insertColor(TQColor( 238, 130, 238 ), i18n( "color", "Violet")); + insertColor(TQColor( 244, 164, 96 ), i18n( "color", "SandyBrown")); + insertColor(TQColor( 233, 150, 122 ), i18n( "color", "DarkSalmon")); + insertColor(TQColor( 189, 183, 107 ), i18n( "color", "DarkKhaki")); + insertColor(TQColor( 127, 255, 0 ), i18n( "color", "Chartreuse")); + insertColor(TQColor( 169, 169, 169 ), i18n( "color", "DarkGray")); + insertColor(TQColor( 124, 252, 0 ), i18n( "color", "LawnGreen")); + insertColor(TQColor( 255, 105, 180 ), i18n( "color", "HotPink")); + insertColor(TQColor( 250, 128, 114 ), i18n( "color", "Salmon")); + insertColor(TQColor( 240, 128, 128 ), i18n( "color", "LightCoral")); + insertColor(TQColor( 64, 224, 208 ), i18n( "color", "Turquoise")); + insertColor(TQColor( 143, 188, 143 ), i18n( "color", "DarkSeagreen")); + insertColor(TQColor( 218, 112, 214 ), i18n( "color", "Orchid")); + insertColor(TQColor( 102, 205, 170 ), i18n( "color", "MediumAquamarine")); + insertColor(TQColor( 255, 127, 80 ), i18n( "color", "Coral")); + insertColor(TQColor( 154, 205, 50 ), i18n( "color", "YellowGreen")); + insertColor(TQColor( 218, 165, 32 ), i18n( "color", "Goldenrod")); + insertColor(TQColor( 72, 209, 204 ), i18n( "color", "MediumTurquoise")); + insertColor(TQColor( 188, 143, 143 ), i18n( "color", "RosyBrown")); + insertColor(TQColor( 219, 112, 147 ), i18n( "color", "PaleVioletRed")); + insertColor(TQColor( 0, 250, 154 ), i18n( "color", "MediumSpringGreen")); + insertColor(TQColor( 255, 99, 71 ), i18n( "color", "Tomato")); + insertColor(TQColor( 0, 255, 127 ), i18n( "color", "SpringGreen")); + insertColor(TQColor( 205, 133, 63 ), i18n( "color", "Peru")); + insertColor(TQColor( 100, 149, 237 ), i18n( "color", "CornflowerBlue")); + insertColor(TQColor( 132, 112, 255 ), i18n( "color", "LightSlateBlue")); + insertColor(TQColor( 147, 112, 219 ), i18n( "color", "MediumPurple")); + insertColor(TQColor( 186, 85, 211 ), i18n( "color", "MediumOrchid")); + insertColor(TQColor( 95, 158, 160 ), i18n( "color", "CadetBlue")); + insertColor(TQColor( 0, 206, 209 ), i18n( "color", "DarkTurquoise")); + insertColor(TQColor( 0, 191, 255 ), i18n( "color", "DeepSkyblue")); + insertColor(TQColor( 119, 136, 153 ), i18n( "color", "LightSlateGray")); + insertColor(TQColor( 184, 134, 11 ), i18n( "color", "DarkGoldenrod")); + insertColor(TQColor( 123, 104, 238 ), i18n( "color", "MediumSlateBlue")); + insertColor(TQColor( 205, 92, 92 ), i18n( "color", "IndianRed")); + insertColor(TQColor( 210, 105, 30 ), i18n( "color", "Chocolate")); + insertColor(TQColor( 60, 179, 113 ), i18n( "color", "MediumSeaGreen")); + insertColor(TQColor( 50, 205, 50 ), i18n( "color", "LimeGreen")); + insertColor(TQColor( 32, 178, 170 ), i18n( "color", "LightSeaGreen")); + insertColor(TQColor( 112, 128, 144 ), i18n( "color", "SlateGray")); + insertColor(TQColor( 30, 144, 255 ), i18n( "color", "DodgerBlue")); + insertColor(TQColor( 255, 69, 0 ), i18n( "color", "OrangeRed")); + insertColor(TQColor( 255, 20, 147 ), i18n( "color", "DeepPink")); + insertColor(TQColor( 70, 130, 180 ), i18n( "color", "SteelBlue")); + insertColor(TQColor( 106, 90, 205 ), i18n( "color", "SlateBlue")); + insertColor(TQColor( 107, 142, 35 ), i18n( "color", "OliveDrab")); + insertColor(TQColor( 65, 105, 225 ), i18n( "color", "RoyalBlue")); + insertColor(TQColor( 208, 32, 144 ), i18n( "color", "VioletRed")); + insertColor(TQColor( 153, 50, 204 ), i18n( "color", "DarkOrchid")); + insertColor(TQColor( 160, 32, 240 ), i18n( "color", "Purple")); + insertColor(TQColor( 105, 105, 105 ), i18n( "color", "DimGray")); + insertColor(TQColor( 138, 43, 226 ), i18n( "color", "BlueViolet")); + insertColor(TQColor( 160, 82, 45 ), i18n( "color", "Sienna")); + insertColor(TQColor( 199, 21, 133 ), i18n( "color", "MediumVioletRed")); + insertColor(TQColor( 176, 48, 96 ), i18n( "color", "Maroon")); + insertColor(TQColor( 46, 139, 87 ), i18n( "color", "SeaGreen")); + insertColor(TQColor( 85, 107, 47 ), i18n( "color", "DarkOliveGreen")); + insertColor(TQColor( 34, 139, 34 ), i18n( "color", "ForestGreen")); + insertColor(TQColor( 139, 69, 19 ), i18n( "color", "SaddleBrown")); + insertColor(TQColor( 148, 0, 211 ), i18n( "color", "DarkViolet")); + insertColor(TQColor( 178, 34, 34 ), i18n( "color", "FireBrick")); + insertColor(TQColor( 72, 61, 139 ), i18n( "color", "DarkSlateBlue")); + insertColor(TQColor( 47, 79, 79 ), i18n( "color", "DarkSlateGray")); + insertColor(TQColor( 25, 25, 112 ), i18n( "color", "MidnightBlue")); + insertColor(TQColor( 0, 0, 205 ), i18n( "color", "MediumBlue")); + insertColor(TQColor( 0, 0, 128 ), i18n( "color", "Navy")); blockSignals(false); // Signals allowed again emit sizeChanged(); // one call should be enough ;) } /****************************************************************************************/ -TKColorPanelButton::TKColorPanelButton( const QColor& color, QWidget* parent, const char* name ) -: QFrame(parent,name), m_Color(color), m_bActive(false) +TKColorPanelButton::TKColorPanelButton( const TQColor& color, TQWidget* tqparent, const char* name ) +: TQFrame(tqparent,name), m_Color(color), m_bActive(false) { setFixedSize(16,16); setFrameStyle( NoFrame ); @@ -585,23 +585,23 @@ TKColorPanelButton::~TKColorPanelButton() { } -void TKColorPanelButton::enterEvent( QEvent* ) +void TKColorPanelButton::enterEvent( TQEvent* ) { if (!m_bActive) setFrameStyle( Panel | Sunken ); } -void TKColorPanelButton::leaveEvent( QEvent* ) +void TKColorPanelButton::leaveEvent( TQEvent* ) { if (!m_bActive) setFrameStyle( NoFrame ); } -void TKColorPanelButton::paintEvent( QPaintEvent* ev ) +void TKColorPanelButton::paintEvent( TQPaintEvent* ev ) { - QFrame::paintEvent(ev); + TQFrame::paintEvent(ev); - QPainter p(this,this); + TQPainter p(this,this); p.fillRect(2,2,12,12,m_Color); p.setPen(gray); p.drawRect(2,2,12,12); @@ -614,7 +614,7 @@ void TKColorPanelButton::setActive( bool f ) setFrameStyle( m_bActive ? Panel | Sunken : NoFrame ); } -void TKColorPanelButton::mouseReleaseEvent( QMouseEvent* ) +void TKColorPanelButton::mouseReleaseEvent( TQMouseEvent* ) { emit selected(m_Color); } |