summaryrefslogtreecommitdiff
path: root/sigalatvision/tutorial/tvguid02.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sigalatvision/tutorial/tvguid02.cc')
-rw-r--r--sigalatvision/tutorial/tvguid02.cc57
1 files changed, 57 insertions, 0 deletions
diff --git a/sigalatvision/tutorial/tvguid02.cc b/sigalatvision/tutorial/tvguid02.cc
new file mode 100644
index 0000000..7263bfb
--- /dev/null
+++ b/sigalatvision/tutorial/tvguid02.cc
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------*/
+/* */
+/* Turbo Vision 1.0 */
+/* TVGUID02 Demo Source File */
+/* Copyright (c) 1991 by Borland International */
+/* */
+/*---------------------------------------------------------*/
+
+#define Uses_TApplication
+#define Uses_TKeys
+#define Uses_TRect
+#define Uses_TStatusLine
+#define Uses_TStatusItem
+#define Uses_TStatusDef
+#define Uses_TDeskTop
+#include <tvision/tv.h>
+
+// tv.h ensures that the correct *.h files are included for each
+// of the above classes and their bases.
+
+class TMyApp : public TApplication
+{
+
+public:
+ TMyApp();
+ static TStatusLine *initStatusLine( TRect r );
+ // new for tvguid02
+};
+
+TMyApp::TMyApp() :
+ TProgInit( &TMyApp::initStatusLine,
+ &TMyApp::initMenuBar,
+ &TMyApp::initDeskTop
+ )
+{
+}
+
+// new for tvguid02:
+TStatusLine *TMyApp::initStatusLine(TRect r)
+{
+ r.a.y = r.b.y - 1; // move top to 1 line above bottom
+ return new TStatusLine( r,
+ *new TStatusDef( 0, 0xFFFF ) +
+ // set range of help contexts
+ *new TStatusItem( "~Alt-X~ Exit", kbAltX, cmQuit ) +
+ // define an item
+ *new TStatusItem( "~Alt-F3~ Close", kbAltF3, cmClose )
+ // and another one
+ );
+}
+
+int main()
+{
+ TMyApp myApp;
+ myApp.run();
+ return 0;
+}