1//--------------------------------------------------------------------------------------------------
2// Name:        doc.h
3// Purpose:     a non-MFC Document (a do-it-yourself document)
4// Author:      Mark Johnson
5// Modified by: 19990808.mj10777
6// Created:     19990808
7// Copyright:   (c) Mark Johnson
8// Licence:     wxWindows license
9// RCS-ID:      $Id: doc.h 27561 2004-06-01 18:27:09Z ABX $
10
11//----------------------------------------------------------------------------------------
12//-- Some Global Vars --------------------------------------------------------------------
13//----------------------------------------------------------------------------------------
14class DSN
15{
16public:
17    wxString  Dsn;
18    wxString  Drv;
19    wxString  Pas;
20    wxString  Usr;
21};
22
23//----------------------------------------------------------------------------------------
24// Global structure for holding ODBC connection information
25//extern wxDbConnectInf DbConnectInf;
26
27//----------------------------------------------------------------------------------------
28extern wxConfigBase   *p_ProgramCfg;       // All Config and Path information
29extern wxLogTextCtrl  *p_LogBook;          // All Log messages
30extern wxString        LogBuf;             // String for all Logs
31
32//----------------------------------------------------------------------------------------
33class PgmCtrl;             // Declared in PgmCtrl.h file
34class DocSplitterWindow;   // Declared at the end of the file
35
36//----------------------------------------------------------------------------------------
37class MainDoc
38{
39public:
40    //---------------------------------------------------------------------------------------
41    MainDoc();
42    virtual ~MainDoc();
43    int Sash;
44    //---------------------------------------------------------------------------------------
45    //-- declare document Vars here ---------------------------------------------------------
46    //---------------------------------------------------------------------------------------
47    wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
48    BrowserDB *db_Br;  // Pointer to wxDB
49    DSN       *p_DSN;
50    int        i_DSN;  // Counter
51    wxString   s_BColour;
52    wxFont    *ft_Doc;
53    //---------------------------------------------------------------------------------------
54    DocSplitterWindow    *p_Splitter;
55    wxHtmlHelpController *p_Help;
56    wxFrame              *p_MainFrame;     // SDI Version
57    PgmCtrl              *p_PgmCtrl;
58    DBTree               *p_DBTree;
59    DBGrid               *p_DBGrid;
60    wxTextCtrl           *p_LogWin;
61    wxTabbedWindow       *p_TabArea;
62    wxPagedWindow        *p_PageArea;
63    int                   i_TabNr;         // Amount of active Views in Tab
64    int                   i_PageNr;        // Amount of active Views in Page
65    //---------------------------------------------------------------------------------------
66    //-- declare document Functions here ----------------------------------------------------
67    //---------------------------------------------------------------------------------------
68    bool OnNewDocument();
69    bool OnInitView();
70    bool OnInitODBC();
71    bool OnChosenDSN(int Which);
72    bool OnChosenTbl(int Tab,wxString Table);
73    //---------------------------------------------------------------------------------------
74    void OnLeer(wxString Aufrufer);  // Dummy Funktion
75    //---------------------------------------------------------------------------------------
76};
77
78//----------------------------------------------------------------------------------------
79class DocSplitterWindow: public wxSplitterWindow
80{
81public:
82    MainDoc *pDoc;
83    DocSplitterWindow(wxWindow *parent, wxWindowID id);
84    virtual bool OnSashPositionChange(int newSashPosition)
85    {
86        if ( !wxSplitterWindow::OnSashPositionChange(newSashPosition) )
87            return false;
88        pDoc->Sash = newSashPosition;
89        return true;
90    }
91    DECLARE_EVENT_TABLE()
92};
93//----------------------------------------------------------------------------------------
94