Added InfoDialog dialog. It is used to display an information.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@273 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/rfbplayer/InfoDialog.h b/rfbplayer/InfoDialog.h
new file mode 100644
index 0000000..bbe9b26
--- /dev/null
+++ b/rfbplayer/InfoDialog.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2004 TightVNC Team. All Rights Reserved.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+// -=- InfoDialog.h
+
+#include <rfb_win32/Dialog.h>
+
+class InfoDialog : public rfb::win32::Dialog {
+public:
+ InfoDialog(char *_info_message, char *_title = "Information")
+ : Dialog(GetModuleHandle(0)), info_message(_info_message), title(_title) {}
+ // - Show the dialog and return true if OK was clicked,
+ // false in case of error or Cancel
+ virtual bool showDialog(HWND parent = 0) {
+ return Dialog::showDialog(MAKEINTRESOURCE(IDD_INFO), parent);
+ }
+protected:
+
+ // Dialog methods (protected)
+ virtual void initDialog() {
+ SetWindowText(handle, title);
+ setItemString(IDC_INFO_EDIT, info_message);
+ }
+ char *info_message;
+ char *title;
+};
\ No newline at end of file
diff --git a/rfbplayer/resource.h b/rfbplayer/resource.h
index 22df827..5f2d9bb 100644
--- a/rfbplayer/resource.h
+++ b/rfbplayer/resource.h
@@ -12,6 +12,7 @@
#define IDD_ABOUT 138
#define IDD_USERPF_LIST 139
#define IDD_UPF_EDIT 140
+#define IDD_INFO 141
#define IDC_GOTO_EDIT 1003
#define IDC_PIXELFORMAT 1004
#define IDC_ASK_PF 1006
@@ -40,6 +41,7 @@
#define IDC_REDSHIFT_EDIT 1026
#define IDC_GREENSHIFT_EDIT 1027
#define IDC_BLUESHIFT_EDIT 1028
+#define IDC_INFO_EDIT 1076
#define ID_OPENFILE 40011
#define ID_CLOSEFILE 40012
#define ID_EXIT 40013
@@ -64,7 +66,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 141
+#define _APS_NEXT_RESOURCE_VALUE 142
#define _APS_NEXT_COMMAND_VALUE 40045
#define _APS_NEXT_CONTROL_VALUE 1031
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/rfbplayer/rfbplayer.dsp b/rfbplayer/rfbplayer.dsp
index cf44895..ea43f26 100644
--- a/rfbplayer/rfbplayer.dsp
+++ b/rfbplayer/rfbplayer.dsp
@@ -152,6 +152,10 @@
# End Source File
# Begin Source File
+SOURCE=.\InfoDialog.h
+# End Source File
+# Begin Source File
+
SOURCE=.\OptionsDialog.h
# End Source File
# Begin Source File
diff --git a/rfbplayer/rfbplayer.rc b/rfbplayer/rfbplayer.rc
index e8dd344..f3f8460 100644
--- a/rfbplayer/rfbplayer.rc
+++ b/rfbplayer/rfbplayer.rc
@@ -318,6 +318,17 @@
LTEXT "Blue shifts :",IDC_STATIC,112,86,43,13,SS_CENTERIMAGE
END
+IDD_INFO DIALOG DISCARDABLE 0, 0, 295, 207
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Information"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "&OK",IDOK,122,186,50,14
+ EDITTEXT IDC_INFO_EDIT,7,7,281,172,ES_MULTILINE | ES_AUTOVSCROLL |
+ ES_AUTOHSCROLL | ES_READONLY | ES_WANTRETURN |
+ WS_VSCROLL | WS_HSCROLL
+END
+
/////////////////////////////////////////////////////////////////////////////
//
@@ -408,6 +419,14 @@
TOPMARGIN, 7
BOTTOMMARGIN, 119
END
+
+ IDD_INFO, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 288
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 200
+ END
END
#endif // APSTUDIO_INVOKED