summaryrefslogtreecommitdiffstats
path: root/tools/linguist/tutorial/tt3/mainwindow.cpp
blob: efaaac932d657f74dc877695fa24c09ac8156bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/****************************************************************
**
** Implementation of MainWindow class, translation tutorial 3
**
****************************************************************/

#include "mainwindow.h"
#include "printpanel.h"

#include <ntqaccel.h>
#include <ntqapplication.h>
#include <ntqmenubar.h>
#include <ntqmessagebox.h>
#include <ntqpopupmenu.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"), tqApp, SLOT(quit()),
		      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 );
}