blob: a95f57bebc083032c47f5c52ae6cbb40e56ea1fa [file] [log] [blame]
Constantin Kaplinskyb30ae7f2006-05-25 05:04:46 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18//
19// InfoDialog.h
20//
21
22#ifndef __INFODIALOG_H__
23#define __INFODIALOG_H__
24
25#include "TXDialog.h"
26#include "TXLabel.h"
27#include "TXButton.h"
28
29extern char buildtime[];
30
31class InfoDialog : public TXDialog, public TXButtonCallback {
32public:
33 InfoDialog(Display* dpy)
34 : TXDialog(dpy, 1, 1, _("VNC connection info")),
35 infoLabel(dpy, "", this, 1, 1, TXLabel::left),
36 okButton(dpy, "OK", this, this, 60)
37 {
38 infoLabel.xPad = 8;
39 infoLabel.move(0, yPad*4);
40 setBorderWidth(1);
41 }
42
43 void setText(char* infoText) {
44 infoLabel.setText(infoText);
45 resize(infoLabel.width(),
46 infoLabel.height() + okButton.height() + yPad*12);
47
48 okButton.move((width() - okButton.width()) / 2,
49 height() - yPad*4 - okButton.height());
50 }
51
52 virtual void buttonActivate(TXButton* b) {
53 unmap();
54 }
55
56 TXLabel infoLabel;
57 TXButton okButton;
58};
59
60#endif