2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// Name: doc.cpp
|
2000-02-12 09:11:17 -05:00
|
|
|
|
// Purpose: Holds information for DBBrowser - (a do-it-yourself document)
|
2001-02-12 14:23:44 -05:00
|
|
|
|
// Author: Mark Johnson
|
2000-01-28 10:25:32 -05:00
|
|
|
|
// Modified by: 19990808.mj10777
|
|
|
|
|
// BJO : Bart A.M. JOURQUIN
|
|
|
|
|
// Created: 19990808
|
|
|
|
|
// Copyright: (c) Mark Johnson
|
|
|
|
|
// Licence: wxWindows license
|
2000-01-31 08:20:36 -05:00
|
|
|
|
// RCS-ID: $Id$
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2005-09-23 08:56:45 -04:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
// For compilers that support precompilation, includes "wx/wx.h".
|
|
|
|
|
#include "wx/wxprec.h"
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
|
#ifdef __BORLANDC__
|
2000-01-31 05:43:24 -05:00
|
|
|
|
#pragma hdrstop
|
2000-01-28 10:25:32 -05:00
|
|
|
|
#endif
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
|
#ifndef WX_PRECOMP
|
2000-01-31 05:43:24 -05:00
|
|
|
|
#include "wx/wx.h"
|
2000-01-28 10:25:32 -05:00
|
|
|
|
#endif
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
//-- all #includes that every .cpp needs ----19990807.mj10777 ----------------
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
|
#include "std.h" // sorgsam Pflegen !
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
//-- Some Global Vars for all Files (extern in ?.h needed) -------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
|
// Global structure for holding ODBC connection information
|
2001-02-03 12:55:00 -05:00
|
|
|
|
extern wxDbConnectInf DbConnectInf;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
|
wxConfigBase *p_ProgramCfg; // All Config and Path information
|
|
|
|
|
wxLogTextCtrl *p_LogBook; // All Log messages
|
|
|
|
|
wxString LogBuf; // String for all Logs
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
MainDoc::MainDoc()
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
|
db_Br = NULL;
|
|
|
|
|
p_DSN = NULL;
|
|
|
|
|
i_DSN = 0;
|
|
|
|
|
p_Splitter = NULL;
|
|
|
|
|
p_MainFrame = NULL;
|
|
|
|
|
p_PgmCtrl = NULL; // Is not active
|
|
|
|
|
p_DBTree = NULL;
|
|
|
|
|
p_DBGrid = NULL;
|
|
|
|
|
p_LogWin = NULL;
|
|
|
|
|
p_TabArea = NULL;
|
|
|
|
|
p_PageArea = NULL;
|
|
|
|
|
i_TabNr = 0;
|
|
|
|
|
i_PageNr = 0;
|
2004-01-11 17:08:25 -05:00
|
|
|
|
s_BColour = _T("WHEAT");
|
2002-01-08 18:27:54 -05:00
|
|
|
|
ft_Doc = new wxFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
MainDoc::~MainDoc()
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(false); // Deactivate the Window
|
|
|
|
|
p_PageArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------
|
|
|
|
|
// -E-> The Tree Controls take to long to close : Why ??
|
|
|
|
|
// ----------------------------------------------------------
|
|
|
|
|
delete ft_Doc; ft_Doc = NULL;
|
|
|
|
|
delete p_PgmCtrl; p_PgmCtrl = NULL;
|
|
|
|
|
delete [] p_DSN;
|
|
|
|
|
delete p_DBTree;
|
|
|
|
|
delete p_TabArea; p_TabArea = NULL;
|
|
|
|
|
delete p_PageArea; p_PageArea = NULL;
|
|
|
|
|
delete p_Splitter; p_Splitter = NULL;
|
|
|
|
|
delete [] db_Br; db_Br = NULL;
|
|
|
|
|
// wxMessageBox("~MainDoc");
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
bool MainDoc::OnNewDocument()
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
|
wxStopWatch sw;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
if (!OnInitView())
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return false;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_PgmCtrl->OnPopulate();
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
wxLogMessage(_("-I-> MainDoc::OnNewDocument() - End - Time needed : %ld ms"),sw.Time());
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
bool MainDoc::OnInitView()
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2004-01-11 17:08:25 -05:00
|
|
|
|
Sash = p_ProgramCfg->Read(_T("/MainFrame/Sash"), 200);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// wxMessageBox("OnInitView() - Begin ","-I->MainDoc::OnInitView");
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// create "workplace" window
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_TabArea = new wxTabbedWindow(); // Init the Pointer
|
2005-03-07 17:17:01 -05:00
|
|
|
|
p_TabArea->Create(p_Splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_PgmCtrl = new PgmCtrl(p_TabArea, TREE_CTRL_PGM,wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER);
|
|
|
|
|
p_PgmCtrl->i_TabArt = 0; // 0 = Tab ; 1 = Page
|
|
|
|
|
p_PgmCtrl->i_ViewNr = p_TabArea->GetTabCount()-1;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-01-11 17:08:25 -05:00
|
|
|
|
wxBitmap *p_FolderClose = new wxBitmap(_T("PgmCtrl")); //, wxBITMAP_TYPE_BMP_RESOURCE); // BJO20000115
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-01-11 17:08:25 -05:00
|
|
|
|
p_TabArea->AddTab(p_PgmCtrl,_T("PgmCtrl"),p_FolderClose);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
delete p_FolderClose; // Memory leak
|
|
|
|
|
p_FolderClose = NULL;
|
2004-02-08 06:53:48 -05:00
|
|
|
|
wxUnusedVar(p_FolderClose);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// now create "output" window
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_PageArea = new wxPagedWindow(); // Init the Pointer
|
2005-03-07 17:17:01 -05:00
|
|
|
|
p_PageArea->Create(p_Splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_LogWin = new wxTextCtrl(p_PageArea,wxID_ANY,wxEmptyString,
|
2001-02-01 15:24:44 -05:00
|
|
|
|
wxDefaultPosition, wxDefaultSize,wxTE_MULTILINE );
|
|
|
|
|
p_LogWin->SetFont(* ft_Doc);
|
|
|
|
|
// Don't forget ! This is always : i_TabArt = 0 ; i_ViewNr = 1;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_LogBook = new wxLogTextCtrl(p_LogWin); // make p_LogWin the LogBook
|
|
|
|
|
p_LogBook->SetActiveTarget(p_LogBook);
|
|
|
|
|
p_LogBook->SetTimestamp( NULL );
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-01-11 17:08:25 -05:00
|
|
|
|
p_PageArea->AddTab(p_LogWin,_("LogBook"), _T("what is this?") );
|
2001-02-01 15:24:44 -05:00
|
|
|
|
i_TabNr = p_TabArea->GetTabCount()-1; // Add one when a new AddTab is done;
|
|
|
|
|
i_PageNr = p_PageArea->GetTabCount()-1; // Add one when a new AddTab is done;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_PgmCtrl->pDoc = this;
|
|
|
|
|
p_TabArea->SetActiveTab(i_PageNr);
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
p_Splitter->Initialize(p_TabArea);
|
|
|
|
|
p_Splitter->SplitHorizontally(p_TabArea,p_PageArea,Sash);
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// if (!OnInitODBC())
|
2004-06-01 14:27:09 -04:00
|
|
|
|
// return false;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
OnInitODBC();
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-07-19 05:39:38 -04:00
|
|
|
|
#if wxUSE_STATUSBAR
|
2001-02-01 15:24:44 -05:00
|
|
|
|
Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN);
|
|
|
|
|
p_MainFrame->SetStatusText(Temp0, 0);
|
|
|
|
|
wxLogMessage(Temp0);
|
2004-07-19 05:39:38 -04:00
|
|
|
|
#endif // wxUSE_STATUSBAR
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
bool MainDoc::OnInitODBC()
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2004-11-04 16:36:32 -05:00
|
|
|
|
wxChar Dsn[SQL_MAX_DSN_LENGTH+1];
|
|
|
|
|
wxChar DsDesc[254+1]; // BJO20002501 instead of 512
|
2005-01-31 13:18:18 -05:00
|
|
|
|
Temp0 = wxEmptyString;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
i_DSN = 0; // Counter
|
2004-02-08 06:53:48 -05:00
|
|
|
|
int i;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// Initialize the ODBC Environment for Database Operations
|
2001-02-03 12:55:00 -05:00
|
|
|
|
|
|
|
|
|
if (!DbConnectInf.AllocHenv())
|
2001-02-01 15:24:44 -05:00
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return false;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
2001-02-03 12:55:00 -05:00
|
|
|
|
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-11-04 16:36:32 -05:00
|
|
|
|
const wxChar sep = 3; // separator character used in string between DSN and DsDesc
|
2004-08-02 13:52:12 -04:00
|
|
|
|
wxSortedArrayString s_SortDSNList, s_SortDsDescList;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// BJO-20000127
|
|
|
|
|
// In order to have same sort result on both Dsn and DsDesc, create a 'keyed' string.
|
|
|
|
|
// The key will be removed after sorting
|
|
|
|
|
wxString KeyString;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-11-04 16:36:32 -05:00
|
|
|
|
while (wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, SQL_MAX_DSN_LENGTH, DsDesc, 254))
|
2001-02-01 15:24:44 -05:00
|
|
|
|
{
|
|
|
|
|
i_DSN++; // How many Dsn have we ?
|
2004-01-11 17:08:25 -05:00
|
|
|
|
KeyString.Printf(_T("%s%c%s"),Dsn, sep, DsDesc);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
s_SortDSNList.Add(Dsn);
|
|
|
|
|
s_SortDsDescList.Add(KeyString);
|
|
|
|
|
}
|
2005-01-31 13:18:18 -05:00
|
|
|
|
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// Allocate n ODBC-DSN objects to hold the information
|
2004-08-02 13:52:12 -04:00
|
|
|
|
// Allocate n wxDatabase objects to hold the column information
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DSN = new DSN[i_DSN]; //BJO
|
2004-08-02 13:52:12 -04:00
|
|
|
|
db_Br = new BrowserDB[i_DSN];
|
2001-02-01 15:24:44 -05:00
|
|
|
|
for (i=0;i<i_DSN;i++)
|
|
|
|
|
{
|
2004-08-02 13:52:12 -04:00
|
|
|
|
KeyString = s_SortDsDescList[i];
|
2001-02-01 15:24:44 -05:00
|
|
|
|
KeyString = KeyString.AfterFirst(sep);
|
2004-08-02 13:52:12 -04:00
|
|
|
|
|
|
|
|
|
// ODBC-DSN object
|
|
|
|
|
(p_DSN+i)->Dsn = s_SortDSNList[i];
|
|
|
|
|
(p_DSN+i)->Drv = KeyString;
|
2005-01-31 13:18:18 -05:00
|
|
|
|
(p_DSN+i)->Usr = wxEmptyString;
|
|
|
|
|
(p_DSN+i)->Pas = wxEmptyString;
|
2004-01-11 17:08:25 -05:00
|
|
|
|
Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str());
|
2001-02-01 15:24:44 -05:00
|
|
|
|
wxLogMessage(Temp0);
|
2004-08-02 13:52:12 -04:00
|
|
|
|
|
|
|
|
|
// wxDataBase object
|
2001-02-01 15:24:44 -05:00
|
|
|
|
(db_Br+i)->p_LogWindow = p_LogWin;
|
|
|
|
|
(db_Br+i)->ODBCSource = (p_DSN+i)->Dsn;
|
|
|
|
|
(db_Br+i)->UserName = (p_DSN+i)->Usr;
|
|
|
|
|
(db_Br+i)->Password = (p_DSN+i)->Pas;
|
|
|
|
|
(db_Br+i)->pDoc = this;
|
|
|
|
|
(db_Br+i)->i_Which = i;
|
|
|
|
|
}
|
2001-02-03 12:55:00 -05:00
|
|
|
|
|
|
|
|
|
DbConnectInf.FreeHenv();
|
|
|
|
|
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
if (!i_DSN)
|
|
|
|
|
{
|
2004-01-11 17:08:25 -05:00
|
|
|
|
wxString message = _("No Dataset names found in ODBC!\n");
|
|
|
|
|
message += _(" Program will exit!\n\n");
|
|
|
|
|
message += _(" Ciao");
|
|
|
|
|
wxMessageBox( message,_("-E-> Fatal situation"));
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return false;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
bool MainDoc::OnChosenDSN(int Which)
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// wxLogMessage("OnChosenDSN(%d) - Begin",Which);
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
if (p_DBTree != NULL)
|
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_TabArea->RemoveTab(p_DBTree->i_ViewNr);
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(true); // Activate the Window
|
2005-01-31 13:18:18 -05:00
|
|
|
|
OnChosenTbl(77,wxEmptyString);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
|
|
|
|
//-------------------------
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBTree = new DBTree(p_TabArea, TREE_CTRL_DB,wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER);
|
2004-01-11 17:08:25 -05:00
|
|
|
|
p_TabArea->AddTab(p_DBTree,(p_DSN+Which)->Dsn,_T(" ? "));
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBTree->i_ViewNr = p_TabArea->GetTabCount()-1;
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(true); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBTree->i_Which = Which;
|
|
|
|
|
p_DBTree->s_DSN = (p_DSN+Which)->Dsn;
|
|
|
|
|
p_DBTree->i_TabArt = 0;
|
|
|
|
|
p_DBTree->pDoc = this;
|
|
|
|
|
p_DBTree->OnPopulate();
|
|
|
|
|
p_TabArea->SetActiveTab(p_DBTree->i_ViewNr);
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// wxLogMessage("OnChosenDSN(%d) - End",Which);
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
bool MainDoc::OnChosenTbl(int Tab,wxString Table)
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// wxLogMessage("OnChosenTbl(%d,%s)",Tab,Table.c_str());
|
|
|
|
|
//-------------------------
|
|
|
|
|
if (p_DBGrid != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (p_DBGrid->i_TabArt == 0)
|
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_TabArea->RemoveTab(p_DBGrid->i_ViewNr);
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(true); // Activate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
|
|
|
|
if (p_DBGrid->i_TabArt == 1)
|
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_PageArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_PageArea->RemoveTab(p_DBGrid->i_ViewNr);
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_PageArea->Show(true); // Activate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
|
|
|
|
p_DBGrid = NULL;
|
|
|
|
|
delete p_DBGrid;
|
|
|
|
|
}
|
|
|
|
|
if (Tab == 77) // Delete only
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2001-02-01 15:24:44 -05:00
|
|
|
|
//-------------------------
|
|
|
|
|
if (Tab == 0) // Tabview
|
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBGrid = new DBGrid(p_TabArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
wxSUNKEN_BORDER);
|
2005-01-31 13:18:18 -05:00
|
|
|
|
p_TabArea->AddTab(p_DBGrid, Table, wxEmptyString);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBGrid->i_ViewNr = p_TabArea->GetTabCount()-1;
|
|
|
|
|
p_DBGrid->pDoc = this;
|
|
|
|
|
p_DBGrid->db_Br = db_Br;
|
|
|
|
|
p_DBGrid->OnTableView(Table);
|
|
|
|
|
p_TabArea->SetActiveTab(p_DBGrid->i_ViewNr);
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_TabArea->Show(true); // Activate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
}
|
|
|
|
|
if (Tab == 1) // Pageview
|
|
|
|
|
{
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_PageArea->Show(false); // Deactivate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBGrid = new DBGrid(p_PageArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
|
|
|
|
|
wxSUNKEN_BORDER);
|
2005-01-31 13:18:18 -05:00
|
|
|
|
p_PageArea->AddTab(p_DBGrid, Table, wxEmptyString);
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBGrid->i_ViewNr = p_PageArea->GetTabCount()-1;
|
|
|
|
|
p_DBGrid->pDoc = this;
|
|
|
|
|
p_DBGrid->db_Br = db_Br;
|
|
|
|
|
p_DBGrid->i_Which = p_DBTree->i_Which;
|
2004-06-01 14:27:09 -04:00
|
|
|
|
p_PageArea->Show(true); // Activate the Window
|
2001-02-01 15:24:44 -05:00
|
|
|
|
p_DBGrid->OnTableView(Table);
|
|
|
|
|
p_PageArea->SetActiveTab(p_DBGrid->i_ViewNr);
|
|
|
|
|
}
|
|
|
|
|
p_DBGrid->i_TabArt = Tab;
|
|
|
|
|
//--------------------------
|
2004-06-01 14:27:09 -04:00
|
|
|
|
return true;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
|
void MainDoc::OnLeer(wxString Aufrufer)
|
2000-01-28 10:25:32 -05:00
|
|
|
|
{
|
2001-02-01 15:24:44 -05:00
|
|
|
|
// Temp0.Printf(_("\nMainDoc::OnLeer(%s) : auch diese funktion steht eines Tages zur Verf<72>gung !"),Aufrufer.c_str());
|
|
|
|
|
Temp0.Printf(_("\nMainDoc::OnLeer(%s) : even this function will one day be available !"),Aufrufer.c_str());
|
|
|
|
|
wxLogMessage(Temp0); Temp0.Empty();
|
|
|
|
|
return;
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-01-28 10:25:32 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
BEGIN_EVENT_TABLE(DocSplitterWindow, wxSplitterWindow)
|
2000-02-12 09:11:17 -05:00
|
|
|
|
END_EVENT_TABLE()
|
2001-02-01 15:24:44 -05:00
|
|
|
|
|
2000-02-12 09:11:17 -05:00
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
|
DocSplitterWindow::DocSplitterWindow(wxWindow *parent, wxWindowID id) : wxSplitterWindow(parent, id)
|
|
|
|
|
{ // Define a constructor for my p_Splitter
|
2000-01-28 10:25:32 -05:00
|
|
|
|
}
|
|
|
|
|
//----------------------------------------------------------------------------------------
|