19#include "kivio_zoomaction.h"
20#include "tkcombobox.h"
27ZoomAction::ZoomAction(TQObject* parent, const char* name)
28: TTDESelectAction(parent,name)
32 lst << i18n( "%1%").arg( "33");
33 lst << i18n( "%1%").arg( "50");
34 lst << i18n( "%1%").arg( "75");
35 lst << i18n( "%1%").arg( "100");
36 lst << i18n( "%1%").arg( "125");
37 lst << i18n( "%1%").arg( "150");
38 lst << i18n( "%1%").arg( "200");
39 lst << i18n( "%1%").arg( "250");
40 lst << i18n( "%1%").arg( "350");
41 lst << i18n( "%1%").arg( "400");
42 lst << i18n( "%1%").arg( "450");
43 lst << i18n( "%1%").arg( "500");
47ZoomAction::~ZoomAction()
51void ZoomAction::slotActivated( const TQString& text )
53 TQRegExp regexp( "(\\d+)");
57 const int zoom=kMin(10000,kMax(10,regexp.cap(1).toInt(&ok)));
60 emit zoomActivated(zoom);
63void ZoomAction::insertItem( int zoom )
66 TQValueList<int> list;
68 const TQStringList itemsList(items());
69 TQRegExp regexp( "(\\d+)");
71 for (TQStringList::ConstIterator it = itemsList.begin() ; it != itemsList.end() ; ++it) {
73 const int val=regexp.cap(1).toInt(&ok);
75 if(ok && val>9 && list.contains(val)==0)
80 if(list.contains(zoom)==0)
86 for (TQValueList<int>::Iterator it = list.begin() ; it != list.end() ; ++it)
87 lst.append( i18n( "%1%").arg(*it) );
89 setCurrentItem(lst.findIndex(i18n( "%1%").arg(zoom)));
92void ZoomAction::setEditZoom( int zoom )
94 const TQString zt(i18n( "%1%").arg(zoom));
97#include "kivio_zoomaction.moc"
|