19#include <KoZoomAction.h>
22#include <tqstringlist.h>
24#include <tqvaluelist.h>
29 const TDEShortcut& cut, TQObject* parent, const char* name ):
36 const TDEShortcut& cut, TQObject* parent, const char* name ):
47 int zoom = t.remove( '%' ).toInt( &ok );
50 TQValueList<int> list;
51 if( zoom > 10 ) list.append( zoom );
54 TQRegExp regexp( "(\\d+)");
56 const TQStringList itemsList( items() );
57 for( TQStringList::ConstIterator it = itemsList.begin(); it != itemsList.end(); ++it )
60 const int val=regexp.cap(1).toInt( &ok );
63 if( ok && val>9 && list.contains( val )==0 )
71 for (TQValueList<int>::Iterator it = list.begin(); it != list.end(); ++it )
72 values.append( i18n( "%1%").arg(*it) );
75 TQString zoomStr = i18n( "%1%").arg( zoom );
81 setZoom( TQString::number( zoom ) );
90void KoZoomAction::init()
95 values << i18n( "%1%").arg( "33");
96 values << i18n( "%1%").arg( "50");
97 values << i18n( "%1%").arg( "75");
98 values << i18n( "%1%").arg( "100");
99 values << i18n( "%1%").arg( "125");
100 values << i18n( "%1%").arg( "150");
101 values << i18n( "%1%").arg( "200");
102 values << i18n( "%1%").arg( "250");
103 values << i18n( "%1%").arg( "350");
104 values << i18n( "%1%").arg( "400");
105 values << i18n( "%1%").arg( "450");
106 values << i18n( "%1%").arg( "500");
111 connect( this, TQ_SIGNAL( activated( const TQString& ) ),
112 TQ_SLOT( activated( const TQString& ) ) );
115#include "KoZoomAction.moc"
void zoomChanged(const TQString &zoom) Signal zoomChanged is triggered when user changes the zoom value, either by choosing it from the list...
void setZoom(const TQString &zoom) Sets the zoom.
KoZoomAction(const TQString &text, const TQIconSet &pix, const TDEShortcut &cut=TDEShortcut(), TQObject *parent=0, const char *name=0) Creates a new zoom action.
virtual TQString text() const
virtual void setEditable(bool)
virtual void setCurrentItem(int index)
virtual TQStringList items() const
virtual void setItems(const TQStringList &lst)
|