summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/examples/kscribble/KScribbleApp.java
diff options
context:
space:
mode:
Diffstat (limited to 'kdejava/koala/examples/kscribble/KScribbleApp.java')
-rw-r--r--kdejava/koala/examples/kscribble/KScribbleApp.java86
1 files changed, 43 insertions, 43 deletions
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));
}