summaryrefslogtreecommitdiff
path: root/dldialog/src/DLD_TV/dld_tvapp.h
blob: 2fe5a5761d3fb3d3cb7cce45ce394fd8c061741e (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/******************************************************************************
**
** $Id: dld_tvapp.h,v 1.6 1999/01/20 14:40:29 saturn Exp $
**
**	This program 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.
**
** (C) (C) 1999,2000 Harald Hoyer <DLDialog@parzelle.de> - All rights reserved -
**
******************************************************************************/

#ifndef DLD_TVAPP_H
#define DLD_TVAPP_H

#include "dld_tvlib.h"
#include "../dld_gui.h"
#include "dld_tvobj.h"
#define Uses_TRect
#define Uses_TDialog
#define Uses_TGroup
#define Uses_TDeskTop
#define Uses_TRect
#define Uses_TApplication
#include <tvision/tv.h>

class DLD_TVDialog;
class TStatusItem;

const int cmOpenCmd     = 105;
const int cmDOS_Cmd     = 107;

const int
  hcCancelBtn            = 35,
  hcFDosShell            = 16,
  hcFExit                = 17,
  hcFOFileOpenDBox       = 31,
  hcFOFiles              = 33,
  hcFOName               = 32,
  hcFOOpenBtn            = 34,
  hcFOpen                = 14,
  hcFile                 = 13,
  hcNocontext            = 0,
  hcOCColorsDBox         = 39,
  hcOColors              = 28,
  hcOMMouseDBox          = 38,
  hcOMouse               = 27,
  hcORestoreDesktop      = 30,
  hcOSaveDesktop         = 29,
  hcOpenBtn              = 36,
  hcOptions              = 26,
  hcPuzzle               = 3,
  hcSAbout               = 8,
  hcSAsciiTable          = 11,
  hcSCalculator          = 12,
  hcSCalendar            = 10,
  hcSPuzzle              = 9,
  hcSystem               = 7,
  hcViewer               = 2,
  hcWCascade             = 22,
  hcWClose               = 25,
  hcWNext                = 23,
  hcWPrevious            = 24,
  hcWSizeMove            = 19,
  hcWTile                = 21,
  hcWZoom                = 20,
  hcWindows              = 18;


/** the tvision implementation of DLD_Gui.
 *
 *	@author	        Harald Hoyer
 *	@version	$Version$
 */
class DLD_TVApp : public DLD_Gui, public TApplication
{
public:
   /// Constructor
   DLD_TVApp (const string& name, int oldsid, int argc, char **argv);

   /// Destructor
   virtual ~DLD_TVApp ();
   
   /// Virtual function.
   virtual DLD_Dialog *dialog (const string& name , const DLD_Out& out);
   
   /// Virtual function.x
   virtual int exec ();

   /// Virtual function.
   const string& name (const string& newname) {
      guiname = newname;
      return guiname;
   };

   /// Virtual function.
   const string& name () {
      return guiname;
   };

   /// Virtual function.
   virtual int print_status (const string& text);

   void idle();

   void del_child(DLD_TVDialog *dia);

   int add_child (DLD_TVDialog * nobj);

   void handleEvent( TEvent& event );

   ///
   DLD_TVDialog *mainDialog;

private:
///
   string guiname;

   ///
   static TStatusLine *initStatusLine( TRect r );
   ///
   static TMenuBar  *initMenuBar( TRect r );
   
   static TDeskTop *initDeskTop( TRect r );

   typedef DLD_TVDialog *DLD_TVDialog_Ptr;
   list<DLD_TVDialog_Ptr>  childlist;
   bool childlock;
   typedef list<DLD_TVDialog_Ptr>::iterator CI; 

   bool running;
   int oldsid;
};

#endif