diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /kdejava/koala/examples/kscribble | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'kdejava/koala/examples/kscribble')
-rw-r--r-- | kdejava/koala/examples/kscribble/KPenBrushDlg.java | 26 | ||||
-rw-r--r-- | kdejava/koala/examples/kscribble/KScribbleApp.java | 86 | ||||
-rw-r--r-- | kdejava/koala/examples/kscribble/KScribbleDoc.java | 36 | ||||
-rw-r--r-- | kdejava/koala/examples/kscribble/KScribbleView.java | 110 |
4 files changed, 129 insertions, 129 deletions
diff --git a/kdejava/koala/examples/kscribble/KPenBrushDlg.java b/kdejava/koala/examples/kscribble/KPenBrushDlg.java index aabb0d3e..4da95f40 100644 --- a/kdejava/koala/examples/kscribble/KPenBrushDlg.java +++ b/kdejava/koala/examples/kscribble/KPenBrushDlg.java @@ -17,18 +17,18 @@ import org.kde.koala.*; * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 1.2 code generation */ -public class KPenBrushDlg extends QDialog { +public class KPenBrushDlg extends TQDialog { - private QSpinBox width_spbox; - private QLabel width_label; - private QPushButton default_btn; - private QPushButton ok_btn; - private QPushButton cancel_btn; + private TQSpinBox width_spbox; + private TQLabel width_label; + private TQPushButton default_btn; + private TQPushButton ok_btn; + private TQPushButton cancel_btn; - public KPenBrushDlg(int curr, QWidget parent, String name) { + public KPenBrushDlg(int curr, TQWidget parent, String name) { super (parent,name,true,WStyle_ContextHelp); initDialog(); - QWhatsThis.add(width_spbox,i18n("Select brush width")); + TQWhatsThis.add(width_spbox,i18n("Select brush width")); width_spbox.setValue(curr); connect(default_btn, SIGNAL("clicked()"), this, SLOT("slotDefault()")); @@ -45,30 +45,30 @@ public class KPenBrushDlg extends QDialog { void initDialog(){ this.resize(370,210); this.setMinimumSize(0,0); - width_spbox= new QSpinBox(this,"width_spbox"); + width_spbox= new TQSpinBox(this,"width_spbox"); width_spbox.setGeometry(150,50,100,25); width_spbox.setMinimumSize(0,0); width_spbox.setValue(1); width_spbox.setRange(1,99); - width_label= new QLabel(this,"width_label"); + width_label= new TQLabel(this,"width_label"); width_label.setGeometry(20,50,120,25); width_label.setMinimumSize(0,0); width_label.setText(i18n("Pen width:")); - default_btn= new QPushButton(this,"default"); + default_btn= new TQPushButton(this,"default"); default_btn.setGeometry(30,160,100,30); default_btn.setMinimumSize(0,0); default_btn.setText(i18n("&Default")); default_btn.setAutoDefault(true); - ok_btn= new QPushButton(this,"ok"); + ok_btn= new TQPushButton(this,"ok"); ok_btn.setGeometry(140,160,100,30); ok_btn.setMinimumSize(0,0); ok_btn.setText(i18n("&OK")); ok_btn.setAutoDefault(true); - cancel_btn= new QPushButton(this,"cancel"); + cancel_btn= new TQPushButton(this,"cancel"); cancel_btn.setGeometry(250,160,100,30); cancel_btn.setMinimumSize(0,0); cancel_btn.setText(i18n("&Cancel")); diff --git a/kdejava/koala/examples/kscribble/KScribbleApp.java b/kdejava/koala/examples/kscribble/KScribbleApp.java index 0085f655..d7ce2a68 100644 --- a/kdejava/koala/examples/kscribble/KScribbleApp.java +++ b/kdejava/koala/examples/kscribble/KScribbleApp.java @@ -38,16 +38,16 @@ public class KScribbleApp extends KMainWindow implements Resource { ArrayList recentFiles = null; // menus - private QPopupMenu pFileMenu; - private QPopupMenu pEditMenu; - private QPopupMenu pPenMenu; - private QPopupMenu pViewMenu; - private QPopupMenu pWindowMenu; - private QPopupMenu pHelpMenu; - private QPopupMenu pRecentFileMenu; - - private QWorkspace pWorkspace; - private QPrinter printer; + private TQPopupMenu pFileMenu; + private TQPopupMenu pEditMenu; + private TQPopupMenu pPenMenu; + private TQPopupMenu pViewMenu; + private TQPopupMenu pWindowMenu; + private TQPopupMenu pHelpMenu; + private TQPopupMenu pRecentFileMenu; + + private TQWorkspace pWorkspace; + private TQPrinter printer; private int untitledCount = 0; private ArrayList pDocList; private KApplication kapp; @@ -55,12 +55,12 @@ public class KScribbleApp extends KMainWindow implements Resource { /** construtor of KScribbleApp, calls all init functions to create the application. */ - public KScribbleApp(QWidget parent, String name) { + public KScribbleApp(TQWidget parent, String name) { super(parent,name, 0); kapp = KApplication.kApplication(); config=kapp.config(); - printer = new QPrinter(); + printer = new TQPrinter(); untitledCount=0; pDocList = new ArrayList(); setAcceptDrops(true); @@ -114,13 +114,13 @@ public class KScribbleApp extends KMainWindow implements Resource { /////////////////////////////////////////////////////////////////// // MENUBAR - pRecentFileMenu = new QPopupMenu(this); + pRecentFileMenu = new TQPopupMenu(this); connect(pRecentFileMenu, SIGNAL("activated(int)"), SLOT("slotFileOpenRecent(int)")); /////////////////////////////////////////////////////////////////// // menuBar entry file-Menu - pFileMenu = new QPopupMenu(this); + pFileMenu = new TQPopupMenu(this); pFileMenu.insertItem(KDE.BarIconSet("filenew"),i18n("&New"), ID_FILE_NEW,-1); @@ -138,7 +138,7 @@ public class KScribbleApp extends KMainWindow implements Resource { /////////////////////////////////////////////////////////////////// // menuBar entry edit-Menu - pEditMenu = new QPopupMenu(this); + pEditMenu = new TQPopupMenu(this); pEditMenu.insertItem(KDE.BarIconSet("undo"), i18n("&Undo"), ID_EDIT_UNDO,-1); pEditMenu.insertSeparator(); pEditMenu.insertItem(KDE.BarIconSet("editcut"), i18n("Cu&t"), ID_EDIT_CUT,-1); @@ -148,27 +148,27 @@ public class KScribbleApp extends KMainWindow implements Resource { /////////////////////////////////////////////////////////////////// // menuBar entry pen-Menu - pPenMenu = new QPopupMenu(); + pPenMenu = new TQPopupMenu(); pPenMenu.insertItem(i18n("&Color"), ID_PEN_COLOR,-1); pPenMenu.insertItem(i18n("&Brush"), ID_PEN_BRUSH,-1); /////////////////////////////////////////////////////////////////// // menuBar entry view-Menu - pViewMenu = new QPopupMenu(this); + pViewMenu = new TQPopupMenu(this); pViewMenu.setCheckable(true); pViewMenu.insertItem(i18n("&Toolbar"), ID_VIEW_TOOLBAR,-1); pViewMenu.insertItem(i18n("&Statusbar"), ID_VIEW_STATUSBAR,-1); /////////////////////////////////////////////////////////////////// // menuBar entry window-Menu - pWindowMenu = new QPopupMenu(this); + pWindowMenu = new TQPopupMenu(this); pWindowMenu.setCheckable(true); /////////////////////////////////////////////////////////////////// // menuBar entry helpMenu - QPopupMenu pHelpMenu = helpMenu(i18n("Java KScribble " + Main.VERSION + "\n\n(c) 2002 by\n" + + TQPopupMenu pHelpMenu = helpMenu(i18n("Java KScribble " + Main.VERSION + "\n\n(c) 2002 by\n" + "Ralf Nolden\nRalf.Nolden@post.rwth-aachen.de"),true); /////////////////////////////////////////////////////////////////// @@ -224,8 +224,8 @@ public class KScribbleApp extends KMainWindow implements Resource { toolBar().insertButton(KDE.BarIcon("help"), ID_HELP_CONTENTS, SIGNAL("clicked()"), this, SLOT("appHelpActivated()"), true,i18n("Help"),-1); - QToolButton btnwhat = QWhatsThis.whatsThisButton(toolBar()); - QToolTip.add(btnwhat, i18n("What's this...?")); + TQToolButton btnwhat = TQWhatsThis.whatsThisButton(toolBar()); + TQToolTip.add(btnwhat, i18n("What's this...?")); toolBar().insertWidget(ID_HELP_WHATS_THIS, btnwhat.sizeHint().width(), btnwhat); /////////////////////////////////////////////////////////////////// @@ -257,11 +257,11 @@ public class KScribbleApp extends KMainWindow implements Resource { //////////////////////////////////////////////////////////////////// // here the main view of the KTMainWindow is created by a background box and - // the QWorkspace instance for MDI view. - QVBox view_back = new QVBox( this ); - view_back.setFrameStyle( QFrame.StyledPanel | QFrame.Sunken ); - pWorkspace = new QWorkspace( view_back, "" ); - connect(pWorkspace, SIGNAL("windowActivated(QWidget)"), this, SLOT("setWndTitle(QWidget)")); + // the TQWorkspace instance for MDI view. + TQVBox view_back = new TQVBox( this ); + view_back.setFrameStyle( TQFrame.StyledPanel | TQFrame.Sunken ); + pWorkspace = new TQWorkspace( view_back, "" ); + connect(pWorkspace, SIGNAL("windowActivated(TQWidget)"), this, SLOT("setWndTitle(TQWidget)")); // setView(view_back); setCentralWidget(view_back); } @@ -333,7 +333,7 @@ public class KScribbleApp extends KMainWindow implements Resource { // Open the file else { - String format= QImageIO.imageFormat(file); + String format= TQImageIO.imageFormat(file); if(!doc.openDocument(file,format)) KMessageBox.error (this,i18n("Could not open document !"), i18n("Error !"),KMessageBox.Notify); addRecentFile(file); @@ -355,9 +355,9 @@ public class KScribbleApp extends KMainWindow implements Resource { pWindowMenu.insertItem(i18n("&New Window"), ID_WINDOW_NEW_WINDOW); pWindowMenu.insertItem(i18n("&Cascade"), - pWorkspace, SLOT("cascade()" ),new QKeySequence(0) , ID_WINDOW_CASCADE ); + pWorkspace, SLOT("cascade()" ),new TQKeySequence(0) , ID_WINDOW_CASCADE ); pWindowMenu.insertItem(i18n("&Tile"), - pWorkspace, SLOT("tile()" ),new QKeySequence(0) , ID_WINDOW_TILE ); + pWorkspace, SLOT("tile()" ),new TQKeySequence(0) , ID_WINDOW_TILE ); if ( pWorkspace.windowList().isEmpty() ) { @@ -371,20 +371,20 @@ public class KScribbleApp extends KMainWindow implements Resource { ArrayList windows = pWorkspace.windowList(); for ( int i = 0; i < windows.size(); ++i ) { - int id = pWindowMenu.insertItem((i+1)+ ((QWidget)windows.get(i)).caption(), + int id = pWindowMenu.insertItem((i+1)+ ((TQWidget)windows.get(i)).caption(), this, SLOT( "windowMenuActivated( int )" ) ); pWindowMenu.setItemParameter( id, i ); - pWindowMenu.setItemChecked( id, pWorkspace.activeWindow() == (QWidget)windows.get(i) ); + pWindowMenu.setItemChecked( id, pWorkspace.activeWindow() == (TQWidget)windows.get(i) ); } } void windowMenuActivated( int id ) { - QWidget w = (QWidget)pWorkspace.windowList().get( id ); + TQWidget w = (TQWidget)pWorkspace.windowList().get( id ); if ( w != null ) w.setFocus(); } - void setWndTitle(QWidget qw){ + void setWndTitle(TQWidget qw){ setCaption(pWorkspace.activeWindow() != null ? pWorkspace.activeWindow().caption() : ""); } @@ -624,7 +624,7 @@ public class KScribbleApp extends KMainWindow implements Resource { } // Read the size information and resize from settings. - QSize size = new QSize(); + TQSize size = new TQSize(); config.readSizeEntry("Geometry",size); if(!size.isEmpty()) { resize(size); @@ -739,7 +739,7 @@ public class KScribbleApp extends KMainWindow implements Resource { void slotFileOpen() { slotStatusMsg(i18n("Opening file...")); - String fileToOpen=KFileDialog.getOpenFileName(QDir.currentDirPath(), + String fileToOpen=KFileDialog.getOpenFileName(TQDir.currentDirPath(), KImageIO.pattern(KImageIO.Reading), this, i18n("Open File...")); if(fileToOpen != null && fileToOpen.length() > 0) { openDocumentFile(new KURL(fileToOpen)); @@ -767,7 +767,7 @@ public class KScribbleApp extends KMainWindow implements Resource { void slotFileSaveAs() { slotStatusMsg(i18n("Saving file with a new filename...")); - String newName=KFileDialog.getSaveFileName(QDir.currentDirPath(), + String newName=KFileDialog.getSaveFileName(TQDir.currentDirPath(), KImageIO.pattern(KImageIO.Writing), this, i18n("Save as...")); if(newName != null) { @@ -775,7 +775,7 @@ public class KScribbleApp extends KMainWindow implements Resource { if( m != null ) { KScribbleDoc doc = m.getDocument(); - String format=new QFileInfo(newName).extension(); + String format=new TQFileInfo(newName).extension(); format=format.toUpperCase(); if(!doc.saveDocument(newName,format)) { @@ -883,7 +883,7 @@ public class KScribbleApp extends KMainWindow implements Resource { void slotPenColor() { slotStatusMsg(i18n("Selecting pen color...")); - QColor myColor = new QColor(); + TQColor myColor = new TQColor(); int result = KColorDialog.getColor( myColor, this ); if ( result == KColorDialog.Accepted ) { @@ -1011,9 +1011,9 @@ public class KScribbleApp extends KMainWindow implements Resource { /** accepts drops and opens a new document for each drop */ - protected void dropEvent( QDropEvent e){ - QImage img = new QImage(); - if ( QImageDrag.decode(e, img) ) { + protected void dropEvent( TQDropEvent e){ + TQImage img = new TQImage(); + if ( TQImageDrag.decode(e, img) ) { KScribbleDoc doc = new KScribbleDoc(); untitledCount+=1; String fileName= i18n("Untitled") + untitledCount; @@ -1031,8 +1031,8 @@ public class KScribbleApp extends KMainWindow implements Resource { } } /** accepts drag events for images */ - protected void dragEnterEvent( QDragEnterEvent e){ - e.accept(QImageDrag.canDecode(e)); + protected void dragEnterEvent( TQDragEnterEvent e){ + e.accept(TQImageDrag.canDecode(e)); } diff --git a/kdejava/koala/examples/kscribble/KScribbleDoc.java b/kdejava/koala/examples/kscribble/KScribbleDoc.java index d51af4e1..bbb5c10b 100644 --- a/kdejava/koala/examples/kscribble/KScribbleDoc.java +++ b/kdejava/koala/examples/kscribble/KScribbleDoc.java @@ -13,15 +13,15 @@ import org.kde.koala.*; * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 1.2 code generation */ -public class KScribbleDoc extends QObject { +public class KScribbleDoc extends TQObject { /** the list of the views currently connected to the document */ private ArrayList pViewList; private String m_title; private String m_filename; - private QSize size; - private QPen pen; - public QPointArray polyline; + private TQSize size; + private TQPen pen; + public TQPointArray polyline; public KPixmap buffer; /** the modified flag of the current document */ @@ -83,7 +83,7 @@ public class KScribbleDoc extends QObject { void setPathName(String name) { m_filename=name; - m_title= new QFileInfo(name).fileName(); + m_title= new TQFileInfo(name).fileName(); } String pathName() { @@ -91,7 +91,7 @@ public class KScribbleDoc extends QObject { } /** returns the current pen in use */ - QPen currentPen() { + TQPen currentPen() { return pen; } @@ -101,7 +101,7 @@ public class KScribbleDoc extends QObject { } /** returns the pen color */ - QColor penColor(){ + TQColor penColor(){ return pen.color(); } @@ -111,7 +111,7 @@ public class KScribbleDoc extends QObject { } /** sets the pen color */ - void setPenColor( QColor c ){ + void setPenColor( TQColor c ){ pen.setColor( c ); } @@ -134,7 +134,7 @@ public class KScribbleDoc extends QObject { void setPixmap(KPixmap pix) { buffer=pix; }; - void resizeDocument(QSize m_size) { + void resizeDocument(TQSize m_size) { size=m_size; }; @@ -159,11 +159,11 @@ public class KScribbleDoc extends QObject { boolean newDocument() { ///////////////////////////////////////////////// // TODO: Add your document initialization code here - size=new QSize(300,200 ); - pen= new QPen(); + size=new TQSize(300,200 ); + pen= new TQPen(); pen.setColor(Qt.black()); pen.setWidth(3); - polyline= new QPointArray(3); + polyline= new TQPointArray(3); if (buffer == null) { buffer = new KPixmap(); } @@ -176,7 +176,7 @@ public class KScribbleDoc extends QObject { public boolean openDocument(String filename, String format) { - QFile f = new QFile( filename ); + TQFile f = new TQFile( filename ); // if ( !f.open( IO_ReadOnly ) ) // return false; ///////////////////////////////////////////////// @@ -189,7 +189,7 @@ public class KScribbleDoc extends QObject { modified=false; m_filename=filename; - m_title=new QFileInfo(f).fileName(); + m_title=new TQFileInfo(f).fileName(); return true; } @@ -203,7 +203,7 @@ public class KScribbleDoc extends QObject { }; boolean saveDocument(String filename, String format /*=0*/) { - QFile f = new QFile( filename ); + TQFile f = new TQFile( filename ); // if ( !f.open( IO_WriteOnly ) ) // return false; @@ -217,7 +217,7 @@ public class KScribbleDoc extends QObject { modified=false; m_filename=filename; - m_title=new QFileInfo(f).fileName(); + m_title=new TQFileInfo(f).fileName(); return true; } @@ -249,7 +249,7 @@ public class KScribbleDoc extends QObject { { case KMessageBox.Yes: if(title().indexOf(i18n("Untitled")) > 0) { - saveName= KFileDialog.getSaveFileName(QDir.currentDirPath(), + saveName= KFileDialog.getSaveFileName(TQDir.currentDirPath(), i18n("*|All files"), pFrame, i18n("Save as...")); if(saveName == null || saveName.length() == 0) return false; @@ -286,7 +286,7 @@ public class KScribbleDoc extends QObject { } /** get the document size */ - QSize docSize() { + TQSize docSize() { return size; } diff --git a/kdejava/koala/examples/kscribble/KScribbleView.java b/kdejava/koala/examples/kscribble/KScribbleView.java index 464227ec..05bc0d47 100644 --- a/kdejava/koala/examples/kscribble/KScribbleView.java +++ b/kdejava/koala/examples/kscribble/KScribbleView.java @@ -2,16 +2,16 @@ import org.kde.qt.*; import org.kde.koala.*; /** The KScribbleView class provides the view widget for the KScribble instance. - * The View instance inherits QWidget as a base class and represents the view object of a KMainWindow. As KScribbleView is part of the + * The View instance inherits TQWidget as a base class and represents the view object of a KMainWindow. As KScribbleView is part of the * docuement-view model, it needs a reference to the document object connected with it by the KScribble class to manipulate and display * the document structure provided by the KScribbleDoc class. * * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. * @version KDevelop version 0.4 code generation */ -public class KScribbleView extends QScrollView { +public class KScribbleView extends TQScrollView { - private QClipboard cb; + private TQClipboard cb; private KScribbleDoc doc; private static final int IDLE = 0; private static final int DRAW = 1; @@ -19,25 +19,25 @@ public class KScribbleView extends QScrollView { private static final int PASTE = 3; private static final int DRAG = 4; - private QPixmap tmp = new QPixmap(); + private TQPixmap tmp = new TQPixmap(); private int action = IDLE; - private QRect select = new QRect(); + private TQRect select = new TQRect(); private KIconLoader k = new KIconLoader(); - private QImageDrag qid; + private TQImageDrag qid; - public KScribbleView(KScribbleDoc pDoc, QWidget parent, String name, int wflags) { + public KScribbleView(KScribbleDoc pDoc, TQWidget parent, String name, int wflags) { super(parent, name,wflags | WPaintClever | WNorthWestGravity | WRepaintNoErase); setBackgroundMode(PaletteBase); - cb = QApplication.clipboard(); + cb = TQApplication.clipboard(); viewport().setAcceptDrops(true); setDragAutoScroll(true); doc=pDoc; action=IDLE; viewport().setCursor( Qt.crossCursor() ); - QSize size=doc.docSize(); + TQSize size=doc.docSize(); resizeContents(size.width(), size.height()); resize(size); @@ -52,7 +52,7 @@ public class KScribbleView extends QScrollView { return doc; } - protected void keyPressEvent( QKeyEvent e ) { + protected void keyPressEvent( TQKeyEvent e ) { switch (e.key()) { case Key_Right: scrollBy( 10, 0 ); @@ -85,7 +85,7 @@ public class KScribbleView extends QScrollView { /** cuts out a selection */ void cutSelection() { select=select.normalize(); - QPixmap cb_pix = new QPixmap(); + TQPixmap cb_pix = new TQPixmap(); cb_pix.resize(select.size()); // copy selection to cb_pix and copy to clipboard bitBlt(cb_pix,0, 0, doc.buffer, select.x()+contentsX(), select.y()+contentsY(), cb_pix.width(),cb_pix.height()); @@ -109,7 +109,7 @@ public class KScribbleView extends QScrollView { /** copies a selection to the clipboard */ void copySelection(){ select=select.normalize(); - QPixmap cb_pix = new QPixmap(); + TQPixmap cb_pix = new TQPixmap(); cb_pix.resize(select.size()); // copy selection to cb_pix and copy to clipboard bitBlt(cb_pix, 0, 0,doc.buffer, select.x()+contentsX(), select.y()+contentsY(), cb_pix.width(),cb_pix.height()); @@ -118,9 +118,9 @@ public class KScribbleView extends QScrollView { viewport().repaint(0,0,visibleWidth(), visibleHeight(), false); } - public void print(QPrinter pPrinter) { + public void print(TQPrinter pPrinter) { if (pPrinter.setup(this)) { - QPainter p = new QPainter(); + TQPainter p = new TQPainter(); p.begin(pPrinter); /////////////////////////////// @@ -131,7 +131,7 @@ public class KScribbleView extends QScrollView { } } - protected void viewportMousePressEvent( QMouseEvent e ) { + protected void viewportMousePressEvent( TQMouseEvent e ) { if ( e.button() == LeftButton && action == IDLE) { action=DRAW; doc.polyline.setPoint(0,viewportToContents(e.pos())); @@ -141,7 +141,7 @@ public class KScribbleView extends QScrollView { } else if ( e.button() == RightButton && action == IDLE) { action = SELECT; - QPoint pt=e.pos(); + TQPoint pt=e.pos(); int x = pt.x() > contentsWidth() ? contentsWidth() : pt.x(); int y = pt.y() > contentsHeight() ? contentsHeight() : pt.y(); select.setLeft(x-1); @@ -157,8 +157,8 @@ public class KScribbleView extends QScrollView { if(select.contains(e.pos(), true)) { // point inside the selection tmp.resize(select.size()); bitBlt(tmp, 0, 0, doc.buffer, select.x()+contentsX(), select.y()+contentsY(), tmp.width(),tmp.height()); - QImage img =tmp.convertToImage(); - QDragObject d = new QImageDrag( img, viewport(), "" ); + TQImage img =tmp.convertToImage(); + TQDragObject d = new TQImageDrag( img, viewport(), "" ); d.setPixmap(KDE.BarIcon("filenew")); d.drag(); } @@ -171,8 +171,8 @@ public class KScribbleView extends QScrollView { action = IDLE; viewport().setCursor( Qt.crossCursor() ); } - QPoint mv_pt = new QPoint(viewport().height(), viewport().width()); - if(new QRect(0,0,mv_pt.x(),mv_pt.y()).contains(e.pos())) + TQPoint mv_pt = new TQPoint(viewport().height(), viewport().width()); + if(new TQRect(0,0,mv_pt.x(),mv_pt.y()).contains(e.pos())) select.moveCenter(e.pos()); else { select.moveBottomRight(mv_pt); @@ -181,30 +181,30 @@ public class KScribbleView extends QScrollView { } } - protected void viewportMouseReleaseEvent( QMouseEvent e ) { + protected void viewportMouseReleaseEvent( TQMouseEvent e ) { if ( action == DRAW ) { action = IDLE; doc.updateAllViews(this); } if ( action == SELECT) { - QPoint pt=e.pos(); + TQPoint pt=e.pos(); int x = pt.x() > 0 ? pt.x() : 0; int y = pt.y() > 0 ? pt.y() : 0; select.setRight(x); select.setBottom(y); - QSize size=doc.docSize(); - select = select.intersect(new QRect(0,0,size.width(), size.height())); + TQSize size=doc.docSize(); + select = select.intersect(new TQRect(0,0,size.width(), size.height())); } } /** On paste actions inserts the pasted clipboard contents */ - protected void viewportMouseDoubleClickEvent(QMouseEvent e) { + protected void viewportMouseDoubleClickEvent(TQMouseEvent e) { if( action == PASTE ) { action = IDLE; select.moveCenter(e.pos()); viewport().setCursor( Qt.crossCursor() ); - QPixmap cb_pix = new QPixmap(); + TQPixmap cb_pix = new TQPixmap(); cb_pix.resize(cb.pixmap().size()); cb_pix=cb.pixmap(); bitBlt( doc.buffer,contentsX()+select.x(), contentsY()+select.y(),cb_pix, 0, 0, select.width(), select.height()); @@ -215,9 +215,9 @@ public class KScribbleView extends QScrollView { } - protected void viewportMouseMoveEvent( QMouseEvent e ) { + protected void viewportMouseMoveEvent( TQMouseEvent e ) { if ( action == DRAW ) { - QPainter painter = new QPainter(); + TQPainter painter = new TQPainter(); painter.begin( doc.buffer ); painter.setPen( doc.currentPen() ); doc.polyline.setPoint(2, doc.polyline.at(1)); @@ -226,7 +226,7 @@ public class KScribbleView extends QScrollView { painter.drawPolyline( doc.polyline ); painter.end(); - QRect r = doc.polyline.boundingRect(); + TQRect r = doc.polyline.boundingRect(); r = r.normalize(); r.setLeft( r.left() - doc.penWidth() ); r.setTop( r.top() - doc.penWidth() ); @@ -238,38 +238,38 @@ public class KScribbleView extends QScrollView { doc.updateAllViews(this); } if ( action == SELECT ) { - QPoint pt=e.pos(); + TQPoint pt=e.pos(); select.setWidth(select.x()+pt.x()); select.setHeight(select.y()+pt.y()); select.setRight(pt.x()); select.setBottom(pt.y()); - QSize size=doc.docSize(); - select = select.intersect(new QRect(0,0,size.width(), size.height())); + TQSize size=doc.docSize(); + select = select.intersect(new TQRect(0,0,size.width(), size.height())); viewport().repaint(0,0,visibleWidth(), visibleHeight(), false); } if( action == PASTE ) { - QPoint mv_pt = new QPoint(viewport().height(), viewport().width()); - if(new QRect(0,0,mv_pt.x(),mv_pt.y()).contains(e.pos())) + TQPoint mv_pt = new TQPoint(viewport().height(), viewport().width()); + if(new TQRect(0,0,mv_pt.x(),mv_pt.y()).contains(e.pos())) select.moveCenter(e.pos()); else { select.moveBottomRight(mv_pt); } - QRect pm_rect=cb.pixmap().rect(); + TQRect pm_rect=cb.pixmap().rect(); select.setWidth(pm_rect.width()); select.setHeight(pm_rect.height()); - QSize size=doc.docSize(); - select = select.intersect(new QRect(0,0,size.width(), size.height())); + TQSize size=doc.docSize(); + select = select.intersect(new TQRect(0,0,size.width(), size.height())); viewport().repaint(0,0,visibleWidth(), visibleHeight(), false); doc.setModified(); doc.updateAllViews(this); } } - //void KScribbleView::viewportResizeEvent( QResizeEvent *e ) + //void KScribbleView::viewportResizeEvent( TQResizeEvent *e ) //{ //} - protected void viewportPaintEvent( QPaintEvent e ) { + protected void viewportPaintEvent( TQPaintEvent e ) { bitBlt( viewport(),0, 0, doc.buffer, contentsX(), contentsY(), doc.buffer.width(),doc.buffer.width()); if( action == PASTE ) @@ -279,35 +279,35 @@ public class KScribbleView extends QScrollView { } if( action == PASTE || action == DRAG ) { - QSize size=doc.docSize(); - select = select.intersect(new QRect(0,0,size.width(), size.height())); + TQSize size=doc.docSize(); + select = select.intersect(new TQRect(0,0,size.width(), size.height())); if(select.intersects(e.rect())) bitBlt(viewport(), select.x(), select.y(), tmp, 0, 0, select.width(), select.height()); } if( action == PASTE || action == DRAG || action == SELECT ) { if(select.intersects(e.rect())) { - QPainter paint_area = new QPainter(); + TQPainter paint_area = new TQPainter(); paint_area.begin(viewport()); - paint_area.setPen(new QPen(Qt.black(), 0, DashLine)); + paint_area.setPen(new TQPen(Qt.black(), 0, DashLine)); paint_area.drawRect( select ); paint_area.end(); } } - // not implemented for QScrollView yet + // not implemented for TQScrollView yet // super.viewportPaintEvent(e); } - protected void viewportDragEnterEvent ( QDragEnterEvent e) { - e.accept(QImageDrag.canDecode(e)); + protected void viewportDragEnterEvent ( TQDragEnterEvent e) { + e.accept(TQImageDrag.canDecode(e)); action = DRAG; } - protected void viewportDragMoveEvent ( QDragMoveEvent e) { - QImage img = new QImage(); + protected void viewportDragMoveEvent ( TQDragMoveEvent e) { + TQImage img = new TQImage(); - if ( QImageDrag.canDecode(e) ){ - QImageDrag.decode(e, img); + if ( TQImageDrag.canDecode(e) ){ + TQImageDrag.decode(e, img); tmp.resize(img.size()); tmp.convertFromImage(img); select.setWidth(tmp.width()); @@ -317,15 +317,15 @@ public class KScribbleView extends QScrollView { } } - protected void viewportDragLeaveEvent ( QDragLeaveEvent e ) { + protected void viewportDragLeaveEvent ( TQDragLeaveEvent e ) { action = IDLE; viewport().repaint(0,0,visibleWidth(), visibleHeight(), false); } - protected void viewportDropEvent ( QDropEvent e) { - QImage img = new QImage(); - if ( QImageDrag.canDecode(e) ) { - QImageDrag.decode(e, img); + protected void viewportDropEvent ( TQDropEvent e) { + TQImage img = new TQImage(); + if ( TQImageDrag.canDecode(e) ) { + TQImageDrag.decode(e, img); tmp.resize(img.size()); tmp.convertFromImage(img); select.setWidth(tmp.width()); |