diff options
Diffstat (limited to 'src/newui/button.cpp')
-rw-r--r-- | src/newui/button.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/newui/button.cpp b/src/newui/button.cpp index 0631510e..1795b18a 100644 --- a/src/newui/button.cpp +++ b/src/newui/button.cpp @@ -39,32 +39,32 @@ namespace Ideal { -Button::Button(ButtonBar *parent, const TQString text, const TQIconSet &icon, +Button::Button(ButtonBar *tqparent, const TQString text, const TQIconSet &icon, const TQString &description) - :TQPushButton(icon, text, parent), m_buttonBar(parent), m_description(description), - m_place(parent->place()), m_realText(text), m_realIconSet(icon) + :TQPushButton(icon, text, tqparent), m_buttonBar(tqparent), m_description(description), + m_place(tqparent->place()), m_realText(text), m_realIconSet(icon) { hide(); setFlat(true); setToggleButton(true); - setFocusPolicy(NoFocus); + setFocusPolicy(TQ_NoFocus); setDescription(m_description); - setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); - resize(sizeHint()); + tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); + resize(tqsizeHint()); fixDimensions(Ideal::Bottom); TQToolTip::add(this, m_realText); m_assignAccelAction = new KAction(i18n("Assign Accelerator..."), 0, - this, TQT_SLOT(assignAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(assignAccel()), TQT_TQOBJECT(this)); m_clearAccelAction = new KAction(i18n("Clear Accelerator"), 0, - this, TQT_SLOT(clearAccel()), this); + TQT_TQOBJECT(this), TQT_SLOT(clearAccel()), TQT_TQOBJECT(this)); KConfig *config = kapp->config(); config->setGroup("UI"); - TQString accel = config->readEntry(TQString("button_%1").arg(text), ""); + TQString accel = config->readEntry(TQString("button_%1").tqarg(text), ""); if (!accel.isEmpty()) - setRealText(TQString("&%1 %2").arg(accel).arg(m_realText)); + setRealText(TQString("&%1 %2").tqarg(accel).tqarg(m_realText)); } Button::~Button() @@ -78,13 +78,13 @@ Button::~Button() if (r.search(m_realText) > -1) { TQString text = m_realText; - if (text.contains(r2)) + if (text.tqcontains(r2)) text.remove(r2); - config->writeEntry(TQString("button_%1").arg(text), r.cap(1)); + config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1)); } else { - config->writeEntry(TQString("button_%1").arg(m_realText), ""); + config->writeEntry(TQString("button_%1").tqarg(m_realText), ""); } } @@ -131,11 +131,11 @@ void Button::drawButton(TQPainter *p) pm.fill(eraseColor()); TQPainter p2(&pm); - style().drawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), colorGroup(),flags); + tqstyle().tqdrawControl(TQStyle::CE_PushButton,&p2,this, TQRect(0,0,pm.width(),pm.height()), tqcolorGroup(),flags); - style().drawControl(TQStyle::CE_PushButtonLabel, &p2, this, + tqstyle().tqdrawControl(TQStyle::CE_PushButtonLabel, &p2, this, TQRect(0,0,pm.width(),pm.height()), - colorGroup(), flags, TQStyleOption()); + tqcolorGroup(), flags, TQStyleOption()); switch (m_place) { @@ -178,7 +178,7 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top)) { setFixedWidth(height()); - setMinimumHeight(sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); setMaximumHeight(32767); } break; @@ -187,19 +187,19 @@ void Button::fixDimensions(Place oldPlace) if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right)) { setFixedHeight(width()); - setMinimumWidth(sizeHint().height()); + setMinimumWidth(tqsizeHint().height()); setMaximumWidth(32767); } break; } } -TQSize Button::sizeHint() const +TQSize Button::tqsizeHint() const { - return sizeHint(text()); + return tqsizeHint(text()); } -TQSize Button::sizeHint(const TQString &text) const +TQSize Button::tqsizeHint(const TQString &text) const { constPolish(); int w = 0, h = 0; @@ -208,10 +208,10 @@ TQSize Button::sizeHint(const TQString &text) const int iw = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; int ih = iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).height(); w += iw; - h = QMAX( h, ih ); + h = TQMAX( h, ih ); } if ( isMenuButton() ) - w += style().pixelMetric(TQStyle::PM_MenuButtonIndicator, this); + w += tqstyle().tqpixelMetric(TQStyle::PM_MenuButtonIndicator, this); if ( pixmap() ) { TQPixmap *pm = (TQPixmap *)pixmap(); w += pm->width(); @@ -220,16 +220,16 @@ TQSize Button::sizeHint(const TQString &text) const TQString s( text ); bool empty = s.isEmpty(); if ( empty ) - s = TQString::fromLatin1("XXXX"); + s = TQString::tqfromLatin1("XXXX"); TQFontMetrics fm = fontMetrics(); TQSize sz = fm.size( ShowPrefix, s ); if(!empty || !w) w += sz.width(); if(!empty || !h) - h = QMAX(h, sz.height()); + h = TQMAX(h, sz.height()); } - return (style().sizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). + return (tqstyle().tqsizeFromContents(TQStyle::CT_ToolButton, this, TQSize(w, h)). expandedTo(TQApplication::globalStrut())); } @@ -239,12 +239,12 @@ void Button::updateSize() { case Ideal::Left: case Ideal::Right: - setMinimumHeight(sizeHint().width()); - resize(sizeHint().height(), sizeHint().width()); + setMinimumHeight(tqsizeHint().width()); + resize(tqsizeHint().height(), tqsizeHint().width()); break; case Ideal::Top: case Ideal::Bottom: - resize(sizeHint().width(), sizeHint().height()); + resize(tqsizeHint().width(), tqsizeHint().height()); break; } } @@ -304,7 +304,7 @@ void Button::contextMenuEvent(TQContextMenuEvent *e) TQPopupMenu menu; m_assignAccelAction->plug(&menu); - if (m_realText.contains(TQRegExp("^&[0-9]\\s"))) + if (m_realText.tqcontains(TQRegExp("^&[0-9]\\s"))) m_clearAccelAction->plug(&menu); emit contextMenu( &menu ); @@ -319,7 +319,7 @@ void Button::assignAccel() if (ok) { TQString text = realTextWithoutAccel(); - text = TQString("&%1 %2").arg(num).arg(text); + text = TQString("&%1 %2").tqarg(num).tqarg(text); setRealText(text); } } @@ -340,7 +340,7 @@ TQString Button::realTextWithoutAccel() const { TQString text = m_realText; TQRegExp r("^&[0-9]\\s"); - if (text.contains(r)) + if (text.tqcontains(r)) text.remove(r); return text; } |