summaryrefslogtreecommitdiffstats
path: root/tools/linguist/tutorial/tt3/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/tutorial/tt3/mainwindow.cpp')
-rw-r--r--tools/linguist/tutorial/tt3/mainwindow.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/linguist/tutorial/tt3/mainwindow.cpp b/tools/linguist/tutorial/tt3/mainwindow.cpp
new file mode 100644
index 000000000..a0aca2b9e
--- /dev/null
+++ b/tools/linguist/tutorial/tt3/mainwindow.cpp
@@ -0,0 +1,47 @@
+/****************************************************************
+**
+** Implementation of MainWindow class, translation tutorial 3
+**
+****************************************************************/
+
+#include "mainwindow.h"
+#include "printpanel.h"
+
+#include <qaccel.h>
+#include <qapplication.h>
+#include <qmenubar.h>
+#include <qmessagebox.h>
+#include <qpopupmenu.h>
+
+MainWindow::MainWindow( TQWidget *parent, const char *name )
+ : TQMainWindow( parent, name )
+{
+ setCaption( tr("Troll Print 1.0") );
+
+ PrintPanel *pp = new PrintPanel( this );
+ setCentralWidget( pp );
+
+ TQPopupMenu *file = new TQPopupMenu( this );
+ file->insertItem( tr("E&xit"), qApp, SLOT(tquit()),
+ tr("Ctrl+Q", "Quit") );
+ TQPopupMenu *help = new TQPopupMenu( this );
+ help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
+ help->insertItem( tr("About &TQt"), this, SLOT(aboutTQt()) );
+
+ menuBar()->insertItem( tr("&File"), file );
+ menuBar()->insertSeparator();
+ menuBar()->insertItem( tr("&Help"), help );
+ menuBar()->setSeparator( TQMenuBar::InWindowsStyle );
+}
+
+void MainWindow::about()
+{
+ TQMessageBox::information( this, tr("About Troll Print 1.0"),
+ tr("Troll Print 1.0.\n\n"
+ "Copyright 1999 Macroshaft, Inc.") );
+}
+
+void MainWindow::aboutTQt()
+{
+ TQMessageBox::aboutTQt( this );
+}