-1->wxID_ANY, TRUE->true, FALSE->false and tabs replacements

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-01 18:27:09 +00:00
parent 52fa6f7d16
commit 5151c7af13
11 changed files with 119 additions and 117 deletions

View File

@@ -102,9 +102,9 @@ bool BrowserDB::Initialize(int Quiet)
if (!OnStartDB(Quiet)) if (!OnStartDB(Quiet))
{ {
wxLogMessage(_("\n\n-E-> BrowserDB::OnStartDB(%s) : Failed ! "),ODBCSource.c_str()); wxLogMessage(_("\n\n-E-> BrowserDB::OnStartDB(%s) : Failed ! "),ODBCSource.c_str());
return FALSE; return false;
} }
return TRUE; return true;
} // BrowserDB:Initialize } // BrowserDB:Initialize
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -117,7 +117,7 @@ bool BrowserDB::OnStartDB(int Quiet)
{ {
if (!Quiet) if (!Quiet)
wxLogMessage(_("\n-I-> BrowserDB::OnStartDB() : DB is already open.")); wxLogMessage(_("\n-I-> BrowserDB::OnStartDB() : DB is already open."));
return TRUE; return true;
} }
DbConnectInf.AllocHenv(); DbConnectInf.AllocHenv();
@@ -133,14 +133,14 @@ bool BrowserDB::OnStartDB(int Quiet)
p_Dlg->OnInit(); p_Dlg->OnInit();
p_Dlg->Fit(); p_Dlg->Fit();
bool OK = FALSE; bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK) if (p_Dlg->ShowModal() == wxID_OK)
{ {
(pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User; (pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User;
(pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password; (pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password;
UserName = p_Dlg->s_User; UserName = p_Dlg->s_User;
Password = p_Dlg->s_Password; Password = p_Dlg->s_Password;
OK = TRUE; OK = true;
} }
delete p_Dlg; delete p_Dlg;
if (OK) if (OK)
@@ -162,7 +162,7 @@ bool BrowserDB::OnStartDB(int Quiet)
wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time()); wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
} }
DbConnectInf.FreeHenv(); DbConnectInf.FreeHenv();
return FALSE; return false;
} }
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (!Quiet) if (!Quiet)
@@ -172,12 +172,12 @@ bool BrowserDB::OnStartDB(int Quiet)
wxLogMessage(_("-I-> BrowserDB::OnGetDataSourceODBC() - DatabaseName(%s) ; DataSource(%s)"),Temp1.c_str(),Temp2.c_str()); wxLogMessage(_("-I-> BrowserDB::OnGetDataSourceODBC() - DatabaseName(%s) ; DataSource(%s)"),Temp1.c_str(),Temp2.c_str());
wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time()); wxLogMessage(_("-I-> BrowserDB::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time());
} }
return TRUE; return true;
} }
else else
{ {
DbConnectInf.FreeHenv(); DbConnectInf.FreeHenv();
return FALSE; return false;
} }
} }
@@ -197,7 +197,7 @@ bool BrowserDB::OnCloseDB(int Quiet)
} }
if (!Quiet) if (!Quiet)
wxLogMessage(_("\n-I-> BrowserDB::OnCloseDB() : End ")); wxLogMessage(_("\n-I-> BrowserDB::OnCloseDB() : End "));
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -220,7 +220,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
wxLogMessage(Temp0); wxLogMessage(Temp0);
wxMessageBox(Temp0); wxMessageBox(Temp0);
#endif #endif
return FALSE; return false;
} }
else else
{ {
@@ -328,7 +328,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
wxLogMessage(_("-E-> BrowserDB::OnGetNext - DB_DATA_TYPE_?? (%d) in Col(%s)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,Temp0.c_str()); wxLogMessage(_("-E-> BrowserDB::OnGetNext - DB_DATA_TYPE_?? (%d) in Col(%s)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,Temp0.c_str());
} }
else else
return TRUE; return true;
Temp0.Printf(_("-E-> unknown Format(%d) - sql(%d)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,(cl_BrowserDB+i)->pColFor->i_sqlDataType); Temp0.Printf(_("-E-> unknown Format(%d) - sql(%d)"),(cl_BrowserDB+i)->pColFor->i_dbDataType,(cl_BrowserDB+i)->pColFor->i_sqlDataType);
wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
break; break;
@@ -336,7 +336,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
} // for } // for
} // else } // else
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -354,7 +354,7 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()")); wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()"));
return FALSE; return false;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
while (db_BrowserDB->GetNext()) while (db_BrowserDB->GetNext())
@@ -367,16 +367,16 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str()); Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str());
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
return FALSE; return false;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// SetColDefs ( 0,"NAME", DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), TRUE, TRUE); // Primary index // SetColDefs ( 0,"NAME",DB_DATA_TYPE_VARCHAR,Name,SQL_C_CHAR,sizeof(Name),true,true); // Primary index
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (!Quiet) if (!Quiet)
{ {
wxLogMessage(_("\n-I-> BrowserDB::OnSelect(%s) Records(%d): End - Time needed : %ld ms"),tb_Name.c_str(),i_Records,sw.Time()); wxLogMessage(_("\n-I-> BrowserDB::OnSelect(%s) Records(%d): End - Time needed : %ld ms"),tb_Name.c_str(),i_Records,sw.Time());
} }
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -391,13 +391,13 @@ bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet)
wxLogMessage(Temp0); wxLogMessage(Temp0);
else else
wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()")); wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()"));
return FALSE; return false;
} }
if (!Quiet) if (!Quiet)
{ {
// wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End - Time needed : %ld ms"),SQLStmt.c_str(),sw.Time()); // wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End - Time needed : %ld ms"),SQLStmt.c_str(),sw.Time());
} }
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -223,7 +223,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
int width, height; int width, height;
frame->GetClientSize(&width, &height); frame->GetClientSize(&width, &height);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
frame->p_Splitter = new DocSplitterWindow(frame,-1); frame->p_Splitter = new DocSplitterWindow(frame,wxID_ANY);
// p_Splitter->SetCursor(wxCursor(wxCURSOR_PENCIL)); // p_Splitter->SetCursor(wxCursor(wxCURSOR_PENCIL));
frame->pDoc = new MainDoc(); frame->pDoc = new MainDoc();
frame->pDoc->p_MainFrame = frame; frame->pDoc->p_MainFrame = frame;
@@ -248,23 +248,23 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
} }
frame->pDoc->p_Help = frame->p_Help; // Save the information to the document frame->pDoc->p_Help = frame->p_Help; // Save the information to the document
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
frame->Show(TRUE); // Show the frame frame->Show(true); // Show the frame
SetTopWindow(frame); // At this point the frame can be seen SetTopWindow(frame); // At this point the frame can be seen
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// If you need a "Splash Screen" because of a long OnNewDocument, do it here // If you need a "Splash Screen" because of a long OnNewDocument, do it here
if (!frame->pDoc->OnNewDocument()) if (!frame->pDoc->OnNewDocument())
frame->Close(TRUE); frame->Close(true);
// Kill a "Splash Screen" because OnNewDocument, if you have one // Kill a "Splash Screen" because OnNewDocument, if you have one
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_ProgramCfg->Flush(TRUE); // save the configuration p_ProgramCfg->Flush(true); // save the configuration
return TRUE; return true;
} // bool MainApp::OnInit(void) } // bool MainApp::OnInit(void)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// My frame constructor // My frame constructor
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
MainFrame::MainFrame(wxFrame *frame, wxChar *title, const wxPoint& pos, const wxSize& size): MainFrame::MainFrame(wxFrame *frame, wxChar *title, const wxPoint& pos, const wxSize& size):
wxFrame(frame, -1, title, pos, size) wxFrame(frame, wxID_ANY, title, pos, size)
{ {
p_Splitter = NULL; pDoc = NULL; p_Help = NULL; // Keep the Pointers clean ! p_Splitter = NULL; pDoc = NULL; p_Help = NULL; // Keep the Pointers clean !
//--- Everything else is done in MainApp::OnInit() -------------------------------------- //--- Everything else is done in MainApp::OnInit() --------------------------------------
@@ -275,7 +275,7 @@ MainFrame::~MainFrame(void)
{ {
// Close the help frame; this will cause the config data to get written. // Close the help frame; this will cause the config data to get written.
if (p_Help->GetFrame()) // returns NULL if no help frame active if (p_Help->GetFrame()) // returns NULL if no help frame active
p_Help->GetFrame()->Close(TRUE); p_Help->GetFrame()->Close(true);
delete p_Help; // Memory Leak delete p_Help; // Memory Leak
p_Help = NULL; p_Help = NULL;
// save the control's values to the config // save the control's values to the config
@@ -294,7 +294,7 @@ MainFrame::~MainFrame(void)
// Get() it doesn't try to create one if there is none (definitely not what // Get() it doesn't try to create one if there is none (definitely not what
// we want here!) // we want here!)
// delete wxConfigBase::Set((wxConfigBase *) NULL); // delete wxConfigBase::Set((wxConfigBase *) NULL);
p_ProgramCfg->Flush(TRUE); // saves Objekt p_ProgramCfg->Flush(true); // saves Objekt
if (pDoc) // If we have a Valid Document if (pDoc) // If we have a Valid Document
delete pDoc; // Cleanup (MainDoc::~MainDoc) delete pDoc; // Cleanup (MainDoc::~MainDoc)
} // MainFrame::~MainFrame(void) } // MainFrame::~MainFrame(void)
@@ -302,7 +302,7 @@ MainFrame::~MainFrame(void)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(true);
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -56,7 +56,7 @@ END_EVENT_TABLE()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// wxListCtrl(parent, id, pos, size, style) // wxListCtrl(parent, id, pos, size, style)
// wxGrid(parent,-1,wxPoint( 0, 0 ), wxSize( 400, 300 ) ); // wxGrid(parent,wxID_ANY,wxPoint( 0, 0 ), wxSize( 400, 300 ) );
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// DBGrid // DBGrid
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -65,7 +65,7 @@ END_EVENT_TABLE()
DBGrid::DBGrid(wxWindow *parent, const wxWindowID id,const wxPoint& pos,const wxSize& size, long style): DBGrid::DBGrid(wxWindow *parent, const wxWindowID id,const wxPoint& pos,const wxSize& size, long style):
wxGrid(parent, id, pos, size, style) wxGrid(parent, id, pos, size, style)
{ {
b_EditModus = FALSE; b_EditModus = false;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
popupMenu1 = new wxMenu(_T("")); popupMenu1 = new wxMenu(_T(""));
popupMenu1->Append(GRID_EDIT, _("Edit Modus")); popupMenu1->Append(GRID_EDIT, _("Edit Modus"));
@@ -99,7 +99,7 @@ int DBGrid::OnTableView(wxString Table)
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ? if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ?
{ // Yes, the Data of this Table shall be put into the Grid { // Yes, the Data of this Table shall be put into the Grid
int ValidTable = x; // Save the Tablenumber int ValidTable = x; // Save the Tablenumber
(db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table" (db_Br+i_Which)->OnSelect(Table,false); // Select * from "table"
// Set the local Pointer to the Column Information we are going to use // Set the local Pointer to the Column Information we are going to use
(db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf; (db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf;
if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ? if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ?
@@ -120,7 +120,7 @@ int DBGrid::OnTableView(wxString Table)
for (z=0;z<(db_Br+i_Which)->i_Records;z++) // Loop through the Records for (z=0;z<(db_Br+i_Which)->i_Records;z++) // Loop through the Records
{ {
Temp0.Printf(_T("%06d"),z+1); SetRowLabelValue(z,Temp0); // Set Row Lable Value Temp0.Printf(_T("%06d"),z+1); SetRowLabelValue(z,Temp0); // Set Row Lable Value
(db_Br+i_Which)->OnGetNext((ct_BrowserDB->pTableInf+ValidTable)->numCols,FALSE); (db_Br+i_Which)->OnGetNext((ct_BrowserDB->pTableInf+ValidTable)->numCols,false);
for (y=0;y<(ct_BrowserDB->pTableInf+ValidTable)->numCols;y++) // Loop through the Fields for (y=0;y<(ct_BrowserDB->pTableInf+ValidTable)->numCols;y++) // Loop through the Fields
{ // BrowserDB::OnGetNext Formats the field Value into tablename { // BrowserDB::OnGetNext Formats the field Value into tablename
SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName); SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName);
@@ -156,7 +156,7 @@ Weiter:
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnModusEdit(wxCommandEvent& WXUNUSED(event)) void DBGrid::OnModusEdit(wxCommandEvent& WXUNUSED(event))
{ {
b_EditModus = TRUE; // Needed by PopupMenu b_EditModus = true; // Needed by PopupMenu
EnableEditing(b_EditModus); // Activate in-place Editing EnableEditing(b_EditModus); // Activate in-place Editing
UpdateDimensions(); // Redraw the Grid UpdateDimensions(); // Redraw the Grid
// wxLogMessage(_("-I-> DBGrid::OnModusEdit() - End")); // wxLogMessage(_("-I-> DBGrid::OnModusEdit() - End"));
@@ -165,7 +165,7 @@ void DBGrid::OnModusEdit(wxCommandEvent& WXUNUSED(event))
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnModusBrowse(wxCommandEvent& WXUNUSED(event)) void DBGrid::OnModusBrowse(wxCommandEvent& WXUNUSED(event))
{ {
b_EditModus = FALSE; // Needed by PopupMenu b_EditModus = false; // Needed by PopupMenu
EnableEditing(b_EditModus); // Deactivate in-place Editing EnableEditing(b_EditModus); // Deactivate in-place Editing
UpdateDimensions(); // Redraw the Grid UpdateDimensions(); // Redraw the Grid
// wxLogMessage(_("-I-> DBGrid::OnModusBrowse() - End")); // wxLogMessage(_("-I-> DBGrid::OnModusBrowse() - End"));

View File

@@ -67,7 +67,7 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w
{ {
const int image_size = 16; const int image_size = 16;
// Make an image list containing small icons // Make an image list containing small icons
p_imageListNormal = new wxImageList(image_size, image_size, TRUE); p_imageListNormal = new wxImageList(image_size, image_size, true);
// should correspond to TreeIc_xxx enum // should correspond to TreeIc_xxx enum
#if !defined(__WXMSW__) #if !defined(__WXMSW__)
#include "bitmaps/logo.xpm" #include "bitmaps/logo.xpm"
@@ -104,7 +104,7 @@ DBTree::~DBTree()
// delete (pDoc->db_Br+i_Which); // delete (pDoc->db_Br+i_Which);
// wxLogMessage("DBTree::~DBTree() - Vor OnCloseDB()"); // wxLogMessage("DBTree::~DBTree() - Vor OnCloseDB()");
(pDoc->db_Br+i_Which)->OnCloseDB(FALSE); (pDoc->db_Br+i_Which)->OnCloseDB(false);
// wxLogMessage("DBTree::~DBTree() - Nach OnCloseDB()"); // wxLogMessage("DBTree::~DBTree() - Nach OnCloseDB()");
(pDoc->db_Br+i_Which)->db_BrowserDB = NULL; (pDoc->db_Br+i_Which)->db_BrowserDB = NULL;
(pDoc->db_Br+i_Which)->ct_BrowserDB = NULL; (pDoc->db_Br+i_Which)->ct_BrowserDB = NULL;
@@ -128,11 +128,11 @@ int DBTree::OnPopulate()
wxString SQL_TYPE, DB_TYPE; wxString SQL_TYPE, DB_TYPE;
SetFont(* pDoc->ft_Doc); SetFont(* pDoc->ft_Doc);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if ((pDoc->db_Br+i_Which)->Initialize(FALSE)) if ((pDoc->db_Br+i_Which)->Initialize(false))
{ {
wxStopWatch sw; wxStopWatch sw;
wxBeginBusyCursor(); wxBeginBusyCursor();
ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE); ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(false);
if (ct_BrowserDB) if (ct_BrowserDB)
{ // Use the wxDatabase Information { // Use the wxDatabase Information
Temp0.Printf(_T("%s - (%s) (%s)"), s_DSN.c_str(),ct_BrowserDB->catalog, ct_BrowserDB->schema); Temp0.Printf(_T("%s - (%s) (%s)"), s_DSN.c_str(),ct_BrowserDB->catalog, ct_BrowserDB->schema);
@@ -149,7 +149,7 @@ int DBTree::OnPopulate()
{ {
Temp1.Printf(_T("TN(%s"),(ct_BrowserDB->pTableInf+x)->tableName); Temp1.Printf(_T("TN(%s"),(ct_BrowserDB->pTableInf+x)->tableName);
//---- //----
(ct_BrowserDB->pTableInf+x)->pColInf = (pDoc->db_Br+i_Which)->OnGetColumns((ct_BrowserDB->pTableInf+x)->tableName,(ct_BrowserDB->pTableInf+x)->numCols,FALSE); (ct_BrowserDB->pTableInf+x)->pColInf = (pDoc->db_Br+i_Which)->OnGetColumns((ct_BrowserDB->pTableInf+x)->tableName,(ct_BrowserDB->pTableInf+x)->numCols,false);
//---- //----
if ((ct_BrowserDB->pTableInf+x)->pColInf) if ((ct_BrowserDB->pTableInf+x)->pColInf)
{ {
@@ -236,7 +236,7 @@ int DBTree::OnPopulate()
Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time()); Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time());
wxLogMessage(Temp0); wxLogMessage(Temp0);
pDoc->p_MainFrame->SetStatusText(Temp0, 0); pDoc->p_MainFrame->SetStatusText(Temp0, 0);
} // if((pDoc->db_Br+i_Which)->Initialize(FALSE)) } // if((pDoc->db_Br+i_Which)->Initialize(false))
else else
{ {
wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed")); wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed"));

View File

@@ -46,9 +46,9 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
SetBackgroundColour(_T("wheat")); SetBackgroundColour(_T("wheat"));
pDoc = p_Doc; pDoc = p_Doc;
wxLayoutConstraints* layout; wxLayoutConstraints* layout;
SetAutoLayout(TRUE); SetAutoLayout(true);
m_Label1 = new wxStaticText(this, -1, _("User ID:")); m_Label1 = new wxStaticText(this, wxID_ANY, _("User ID:"));
m_Label1->SetFont(* pDoc->ft_Doc); m_Label1->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints; layout = new wxLayoutConstraints;
layout->left.SameAs(this, wxLeft, 10); layout->left.SameAs(this, wxLeft, 10);
@@ -60,7 +60,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
int w; int w;
m_Label1->GetSize(&w, &chSize); m_Label1->GetSize(&w, &chSize);
m_UserName = new wxTextCtrl(this, -1, _T("")); m_UserName = new wxTextCtrl(this, wxID_ANY, _T(""));
m_UserName->SetFont(* pDoc->ft_Doc); m_UserName->SetFont(* pDoc->ft_Doc);
chSize = (int) (m_UserName->GetCharHeight()*ratio); chSize = (int) (m_UserName->GetCharHeight()*ratio);
@@ -73,7 +73,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
m_UserName->SetConstraints(layout); m_UserName->SetConstraints(layout);
m_Label2 = new wxStaticText(this, -1, _("Password:")); m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:"));
m_Label2->SetFont(* pDoc->ft_Doc); m_Label2->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints; layout = new wxLayoutConstraints;
layout->left.SameAs(m_Label1, wxLeft); layout->left.SameAs(m_Label1, wxLeft);
@@ -82,7 +82,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
layout->width.SameAs(m_Label1, wxWidth); layout->width.SameAs(m_Label1, wxWidth);
m_Label2->SetConstraints(layout); m_Label2->SetConstraints(layout);
m_Password = new wxTextCtrl(this, -1, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); m_Password = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
m_Password->SetFont(* pDoc->ft_Doc); m_Password->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints; layout = new wxLayoutConstraints;
layout->left.SameAs(m_UserName, wxLeft); layout->left.SameAs(m_UserName, wxLeft);
@@ -136,7 +136,7 @@ END_EVENT_TABLE()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DlgUser::OnOk(wxCommandEvent& WXUNUSED(event) ) void DlgUser::OnOk(wxCommandEvent& WXUNUSED(event) )
{ {
//canceled = FALSE; //canceled = false;
s_User = m_UserName->GetValue(); s_User = m_UserName->GetValue();
s_Password = m_Password->GetValue(); s_Password = m_Password->GetValue();
EndModal(wxID_OK); EndModal(wxID_OK);
@@ -145,7 +145,7 @@ void DlgUser::OnOk(wxCommandEvent& WXUNUSED(event) )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
//void DlgUser::OnCancel(wxCommandEvent& WXUNUSED(event) ) //void DlgUser::OnCancel(wxCommandEvent& WXUNUSED(event) )
// { // {
// canceled = TRUE; // canceled = true;
// EndModal(wxID_CANCEL); // EndModal(wxID_CANCEL);
// } // }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -63,8 +63,8 @@ MainDoc::MainDoc()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
MainDoc::~MainDoc() MainDoc::~MainDoc()
{ {
p_TabArea->Show(FALSE); // Deactivate the Window p_TabArea->Show(false); // Deactivate the Window
p_PageArea->Show(FALSE); // Deactivate the Window p_PageArea->Show(false); // Deactivate the Window
// ---------------------------------------------------------- // ----------------------------------------------------------
// -E-> The Tree Controls take to long to close : Why ?? // -E-> The Tree Controls take to long to close : Why ??
@@ -86,11 +86,11 @@ bool MainDoc::OnNewDocument()
wxStopWatch sw; wxStopWatch sw;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (!OnInitView()) if (!OnInitView())
return FALSE; return false;
p_PgmCtrl->OnPopulate(); p_PgmCtrl->OnPopulate();
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
wxLogMessage(_("-I-> MainDoc::OnNewDocument() - End - Time needed : %ld ms"),sw.Time()); wxLogMessage(_("-I-> MainDoc::OnNewDocument() - End - Time needed : %ld ms"),sw.Time());
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -102,7 +102,7 @@ bool MainDoc::OnInitView()
// create "workplace" window // create "workplace" window
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_TabArea = new wxTabbedWindow(); // Init the Pointer p_TabArea = new wxTabbedWindow(); // Init the Pointer
p_TabArea->Create(p_Splitter, -1); p_TabArea->Create(p_Splitter, wxID_ANY);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_PgmCtrl = new PgmCtrl(p_TabArea, TREE_CTRL_PGM,wxDefaultPosition, wxDefaultSize, p_PgmCtrl = new PgmCtrl(p_TabArea, TREE_CTRL_PGM,wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); wxTR_HAS_BUTTONS | wxSUNKEN_BORDER);
@@ -119,9 +119,9 @@ bool MainDoc::OnInitView()
// now create "output" window // now create "output" window
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_PageArea = new wxPagedWindow(); // Init the Pointer p_PageArea = new wxPagedWindow(); // Init the Pointer
p_PageArea->Create(p_Splitter, -1); p_PageArea->Create(p_Splitter, wxID_ANY);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_LogWin = new wxTextCtrl(p_PageArea,-1,wxEmptyString, p_LogWin = new wxTextCtrl(p_PageArea,wxID_ANY,wxEmptyString,
wxDefaultPosition, wxDefaultSize,wxTE_MULTILINE ); wxDefaultPosition, wxDefaultSize,wxTE_MULTILINE );
p_LogWin->SetFont(* ft_Doc); p_LogWin->SetFont(* ft_Doc);
// Don't forget ! This is always : i_TabArt = 0 ; i_ViewNr = 1; // Don't forget ! This is always : i_TabArt = 0 ; i_ViewNr = 1;
@@ -141,13 +141,13 @@ bool MainDoc::OnInitView()
p_Splitter->SplitHorizontally(p_TabArea,p_PageArea,Sash); p_Splitter->SplitHorizontally(p_TabArea,p_PageArea,Sash);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// if (!OnInitODBC()) // if (!OnInitODBC())
// return FALSE; // return false;
OnInitODBC(); OnInitODBC();
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN); Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN);
p_MainFrame->SetStatusText(Temp0, 0); p_MainFrame->SetStatusText(Temp0, 0);
wxLogMessage(Temp0); wxLogMessage(Temp0);
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -163,7 +163,7 @@ bool MainDoc::OnInitODBC()
if (!DbConnectInf.AllocHenv()) if (!DbConnectInf.AllocHenv())
{ {
return FALSE; return false;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -225,10 +225,10 @@ bool MainDoc::OnInitODBC()
message += _(" Program will exit!\n\n"); message += _(" Program will exit!\n\n");
message += _(" Ciao"); message += _(" Ciao");
wxMessageBox( message,_("-E-> Fatal situation")); wxMessageBox( message,_("-E-> Fatal situation"));
return FALSE; return false;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -238,18 +238,18 @@ bool MainDoc::OnChosenDSN(int Which)
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (p_DBTree != NULL) if (p_DBTree != NULL)
{ {
p_TabArea->Show(FALSE); // Deactivate the Window p_TabArea->Show(false); // Deactivate the Window
p_TabArea->RemoveTab(p_DBTree->i_ViewNr); p_TabArea->RemoveTab(p_DBTree->i_ViewNr);
p_TabArea->Show(TRUE); // Activate the Window p_TabArea->Show(true); // Activate the Window
OnChosenTbl(77,_T("")); OnChosenTbl(77,_T(""));
} }
//------------------------- //-------------------------
p_TabArea->Show(FALSE); // Deactivate the Window p_TabArea->Show(false); // Deactivate the Window
p_DBTree = new DBTree(p_TabArea, TREE_CTRL_DB,wxDefaultPosition, wxDefaultSize, p_DBTree = new DBTree(p_TabArea, TREE_CTRL_DB,wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); wxTR_HAS_BUTTONS | wxSUNKEN_BORDER);
p_TabArea->AddTab(p_DBTree,(p_DSN+Which)->Dsn,_T(" ? ")); p_TabArea->AddTab(p_DBTree,(p_DSN+Which)->Dsn,_T(" ? "));
p_DBTree->i_ViewNr = p_TabArea->GetTabCount()-1; p_DBTree->i_ViewNr = p_TabArea->GetTabCount()-1;
p_TabArea->Show(TRUE); // Deactivate the Window p_TabArea->Show(true); // Deactivate the Window
p_DBTree->i_Which = Which; p_DBTree->i_Which = Which;
p_DBTree->s_DSN = (p_DSN+Which)->Dsn; p_DBTree->s_DSN = (p_DSN+Which)->Dsn;
p_DBTree->i_TabArt = 0; p_DBTree->i_TabArt = 0;
@@ -258,7 +258,7 @@ bool MainDoc::OnChosenDSN(int Which)
p_TabArea->SetActiveTab(p_DBTree->i_ViewNr); p_TabArea->SetActiveTab(p_DBTree->i_ViewNr);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// wxLogMessage("OnChosenDSN(%d) - End",Which); // wxLogMessage("OnChosenDSN(%d) - End",Which);
return TRUE; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -270,25 +270,25 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
{ {
if (p_DBGrid->i_TabArt == 0) if (p_DBGrid->i_TabArt == 0)
{ {
p_TabArea->Show(FALSE); // Deactivate the Window p_TabArea->Show(false); // Deactivate the Window
p_TabArea->RemoveTab(p_DBGrid->i_ViewNr); p_TabArea->RemoveTab(p_DBGrid->i_ViewNr);
p_TabArea->Show(TRUE); // Activate the Window p_TabArea->Show(true); // Activate the Window
} }
if (p_DBGrid->i_TabArt == 1) if (p_DBGrid->i_TabArt == 1)
{ {
p_PageArea->Show(FALSE); // Deactivate the Window p_PageArea->Show(false); // Deactivate the Window
p_PageArea->RemoveTab(p_DBGrid->i_ViewNr); p_PageArea->RemoveTab(p_DBGrid->i_ViewNr);
p_PageArea->Show(TRUE); // Activate the Window p_PageArea->Show(true); // Activate the Window
} }
p_DBGrid = NULL; p_DBGrid = NULL;
delete p_DBGrid; delete p_DBGrid;
} }
if (Tab == 77) // Delete only if (Tab == 77) // Delete only
return TRUE; return true;
//------------------------- //-------------------------
if (Tab == 0) // Tabview if (Tab == 0) // Tabview
{ {
p_TabArea->Show(FALSE); // Deactivate the Window p_TabArea->Show(false); // Deactivate the Window
p_DBGrid = new DBGrid(p_TabArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize, p_DBGrid = new DBGrid(p_TabArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER); wxSUNKEN_BORDER);
p_TabArea->AddTab(p_DBGrid, Table, _T("")); p_TabArea->AddTab(p_DBGrid, Table, _T(""));
@@ -297,11 +297,11 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
p_DBGrid->db_Br = db_Br; p_DBGrid->db_Br = db_Br;
p_DBGrid->OnTableView(Table); p_DBGrid->OnTableView(Table);
p_TabArea->SetActiveTab(p_DBGrid->i_ViewNr); p_TabArea->SetActiveTab(p_DBGrid->i_ViewNr);
p_TabArea->Show(TRUE); // Activate the Window p_TabArea->Show(true); // Activate the Window
} }
if (Tab == 1) // Pageview if (Tab == 1) // Pageview
{ {
p_PageArea->Show(FALSE); // Deactivate the Window p_PageArea->Show(false); // Deactivate the Window
p_DBGrid = new DBGrid(p_PageArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize, p_DBGrid = new DBGrid(p_PageArea,GRID_CTRL_DB,wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER); wxSUNKEN_BORDER);
p_PageArea->AddTab(p_DBGrid, Table, _T("")); p_PageArea->AddTab(p_DBGrid, Table, _T(""));
@@ -309,13 +309,13 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
p_DBGrid->pDoc = this; p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br; p_DBGrid->db_Br = db_Br;
p_DBGrid->i_Which = p_DBTree->i_Which; p_DBGrid->i_Which = p_DBTree->i_Which;
p_PageArea->Show(TRUE); // Activate the Window p_PageArea->Show(true); // Activate the Window
p_DBGrid->OnTableView(Table); p_DBGrid->OnTableView(Table);
p_PageArea->SetActiveTab(p_DBGrid->i_ViewNr); p_PageArea->SetActiveTab(p_DBGrid->i_ViewNr);
} }
p_DBGrid->i_TabArt = Tab; p_DBGrid->i_TabArt = Tab;
//-------------------------- //--------------------------
return TRUE;; return true;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -84,9 +84,9 @@ public:
virtual bool OnSashPositionChange(int newSashPosition) virtual bool OnSashPositionChange(int newSashPosition)
{ {
if ( !wxSplitterWindow::OnSashPositionChange(newSashPosition) ) if ( !wxSplitterWindow::OnSashPositionChange(newSashPosition) )
return FALSE; return false;
pDoc->Sash = newSashPosition; pDoc->Sash = newSashPosition;
return TRUE; return true;
} }
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -72,7 +72,7 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
{ {
const int image_size = 16; const int image_size = 16;
// Make an image list containing small icons // Make an image list containing small icons
p_imageListNormal = new wxImageList(image_size, image_size, TRUE); p_imageListNormal = new wxImageList(image_size, image_size, true);
// should correspond to TreeIc_xxx enum // should correspond to TreeIc_xxx enum
p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(aLogo)).ConvertToImage().Rescale(image_size, image_size))); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(aLogo)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnClosed)).ConvertToImage().Rescale(image_size, image_size))); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnClosed)).ConvertToImage().Rescale(image_size, image_size)));
@@ -276,14 +276,14 @@ void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
//-------------------- //--------------------
// Temp0.Printf("i(%d) ; s_DSN(%s) ; s_User(%s) ; s_Password(%s)",i,p_Dlg.s_DSN,p_Dlg.s_User,p_Dlg.s_Password); // Temp0.Printf("i(%d) ; s_DSN(%s) ; s_User(%s) ; s_Password(%s)",i,p_Dlg.s_DSN,p_Dlg.s_User,p_Dlg.s_Password);
// wxMessageBox(Temp0); // wxMessageBox(Temp0);
bool OK = FALSE; bool OK = false;
if (p_Dlg->ShowModal() == wxID_OK) if (p_Dlg->ShowModal() == wxID_OK)
{ {
(pDoc->p_DSN+i)->Usr = p_Dlg->s_User; (pDoc->p_DSN+i)->Usr = p_Dlg->s_User;
(pDoc->p_DSN+i)->Pas = p_Dlg->s_Password; (pDoc->p_DSN+i)->Pas = p_Dlg->s_Password;
(pDoc->db_Br+i)->UserName = (pDoc->p_DSN+i)->Usr; (pDoc->db_Br+i)->UserName = (pDoc->p_DSN+i)->Usr;
(pDoc->db_Br+i)->Password = (pDoc->p_DSN+i)->Pas; (pDoc->db_Br+i)->Password = (pDoc->p_DSN+i)->Pas;
OK = TRUE; OK = true;
} }
delete p_Dlg; delete p_Dlg;
if (!OK) if (!OK)

View File

@@ -3,10 +3,10 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
//-- all #includes that the whole Project needs. ---------------------------- //-- all #includes that the whole Project needs. ----------------------------
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#include <wx/config.h> // to let wxWidgets choose a wxConfig class for your platform
#include <wx/confbase.h> // base config class #include <wx/config.h>
#include <wx/dbtable.h> #include <wx/dbtable.h>
#include <wx/generic/grid.h> #include <wx/grid.h>
#include <wx/file.h> #include <wx/file.h>
#include <wx/wxhtml.h> #include <wx/wxhtml.h>
#include <wx/image.h> #include <wx/image.h>
@@ -18,9 +18,10 @@
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/toolbar.h> #include <wx/toolbar.h>
#include <wx/treectrl.h> #include <wx/treectrl.h>
//--------------------------- //---------------------------
#include "tabpgwin.h" // Original name : "controlarea.h"
//--------------------------- #include "tabpgwin.h"
#include "dlguser.h" #include "dlguser.h"
#include "browsedb.h" #include "browsedb.h"
#include "dbtree.h" #include "dbtree.h"
@@ -28,4 +29,5 @@
#include "pgmctrl.h" #include "pgmctrl.h"
#include "doc.h" #include "doc.h"
#include "dbbrowse.h" #include "dbbrowse.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View File

@@ -7,9 +7,9 @@
// - restruction of Variable declaration // - restruction of Variable declaration
// - to prevent Warnings under MingW32 // - to prevent Warnings under MingW32
// Modified by: 19990909 : mj // Modified by: 19990909 : mj
// - mNoVertScroll TRUE = no / FALSE = Original Code // - mNoVertScroll true = no / false = Original Code
// the Original Code Paints a Vertical Scroll in wxPagedWindow // the Original Code Paints a Vertical Scroll in wxPagedWindow
// which is not needed in this Version. Use TRUE for this. // which is not needed in this Version. Use true for this.
// Created: 07/09/98 // Created: 07/09/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas // Copyright: (c) Aleksandras Gluchovas
@@ -182,13 +182,13 @@ void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool WXUNUSED(
//info.mpContent->GetEventHandler()->ProcessEvent( evt ); //info.mpContent->GetEventHandler()->ProcessEvent( evt );
info.mpContent->SetSize( x, y, width, height, 0 ); info.mpContent->SetSize( x, y, width, height, 0 );
info.mpContent->Show(TRUE); info.mpContent->Show(true);
info.mpContent->Refresh(); info.mpContent->Refresh();
} }
else else
{ {
info.mpContent->Show(FALSE); info.mpContent->Show(false);
} }
pTabNode = pTabNode->GetNext(); pTabNode = pTabNode->GetNext();
@@ -217,11 +217,11 @@ void wxTabbedWindow::AddTab( wxWindow* pContent,
if ( pContent->GetParent() == NULL ) if ( pContent->GetParent() == NULL )
pContent->Create( this, -1 ); pContent->Create( this, wxID_ANY );
mTabs.Append( (wxObject*)pTab ); mTabs.Append( (wxObject*)pTab );
RecalcLayout(TRUE); RecalcLayout(true);
OnTabAdded( pTab ); OnTabAdded( pTab );
} }
@@ -239,10 +239,10 @@ void wxTabbedWindow::AddTab( wxWindow* pContent,
pTab->mBitMap = *pImage; pTab->mBitMap = *pImage;
if ( pContent->GetParent() == NULL ) if ( pContent->GetParent() == NULL )
pContent->Create( this, -1 ); pContent->Create( this, wxID_ANY );
mTabs.Append( (wxObject*)pTab ); mTabs.Append( (wxObject*)pTab );
RecalcLayout(TRUE); RecalcLayout(true);
OnTabAdded( pTab ); OnTabAdded( pTab );
} }
@@ -282,7 +282,7 @@ wxWindow* wxTabbedWindow::GetActiveTab()
void wxTabbedWindow::SetActiveTab( int tabNo ) void wxTabbedWindow::SetActiveTab( int tabNo )
{ {
mActiveTab = tabNo; mActiveTab = tabNo;
RecalcLayout(TRUE); RecalcLayout(true);
Refresh(); Refresh();
} }
@@ -490,7 +490,7 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint )
if ( tabNo != mActiveTab ) if ( tabNo != mActiveTab )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mpContent->Show(FALSE); tab.mpContent->Show(false);
} }
pNode = pNode->GetNext(); pNode = pNode->GetNext();
@@ -656,7 +656,7 @@ void wxTabbedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) ) void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) )
{ {
SetBackgroundColour( wxColour( 192,192,192 ) ); SetBackgroundColour( wxColour( 192,192,192 ) );
RecalcLayout(TRUE); RecalcLayout(true);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -704,21 +704,21 @@ END_EVENT_TABLE()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
wxPagedWindow::wxPagedWindow() wxPagedWindow::wxPagedWindow()
: mScrollEventInProgress( FALSE ), : mScrollEventInProgress( false ),
mTabTrianGap(4), mTabTrianGap(4),
mWhiteBrush( wxColour(255,255,255), wxSOLID ), mWhiteBrush( wxColour(255,255,255), wxSOLID ),
mGrayBrush ( wxColour(192,192,192), wxSOLID ), mGrayBrush ( wxColour(192,192,192), wxSOLID ),
mCurentRowOfs( 0 ), mCurentRowOfs( 0 ),
mAdjustableTitleRowLen( 300 ), mAdjustableTitleRowLen( 300 ),
mIsDragged ( FALSE ), mIsDragged ( false ),
mDagOrigin ( 0 ), mDagOrigin ( 0 ),
mCursorChanged( FALSE ), mCursorChanged( false ),
mResizeCursor ( wxCURSOR_SIZEWE ), mResizeCursor ( wxCURSOR_SIZEWE ),
mNormalCursor ( wxCURSOR_ARROW ) mNormalCursor ( wxCURSOR_ARROW )
{ {
mTitleVertGap = 2; mTitleVertGap = 2;
mTitleHorizGap = 10; mTitleHorizGap = 10;
mNoVertScroll = TRUE; // Horizontale Scroll abschalten mNoVertScroll = true; // Horizontale Scroll abschalten
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -750,7 +750,7 @@ void wxPagedWindow::OnTabAdded( twTabInfo* WXUNUSED(pInfo) )
{ {
int units = GetWholeTabRowLen() / 20; int units = GetWholeTabRowLen() / 20;
mpTabScroll->SetScrollbar( 0, 1, units, 1, FALSE ); mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -964,18 +964,18 @@ void wxPagedWindow::RecalcLayout(bool andRepaint)
if ( !mpTabScroll ) if ( !mpTabScroll )
{ {
mpTabScroll = mpTabScroll =
new wxScrollBar( this, -1, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
mpHorizScroll = mpHorizScroll =
new wxScrollBar( this, -1, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL );
if (!mNoVertScroll) // Vertical Scroll (Original) if (!mNoVertScroll) // Vertical Scroll (Original)
mpVertScroll = new wxScrollBar( this, -1, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL ); mpVertScroll = new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL );
} }
{ {
int units = GetWholeTabRowLen() / 20; int units = GetWholeTabRowLen() / 20;
mpTabScroll->SetScrollbar( 0, 1, units, 1, FALSE ); mpTabScroll->SetScrollbar( 0, 1, units, 1, false );
} }
// resetup position of the active tab // resetup position of the active tab
@@ -1080,7 +1080,7 @@ void wxPagedWindow::OnLButtonDown( wxMouseEvent& event )
{ {
if ( mCursorChanged ) if ( mCursorChanged )
{ {
mIsDragged = TRUE; mIsDragged = true;
mDagOrigin = event.m_x; mDagOrigin = event.m_x;
mOriginalTitleRowLen = mAdjustableTitleRowLen; mOriginalTitleRowLen = mAdjustableTitleRowLen;
@@ -1098,8 +1098,8 @@ void wxPagedWindow::OnLButtonUp( wxMouseEvent& WXUNUSED(event) )
{ {
if ( mIsDragged ) if ( mIsDragged )
{ {
mIsDragged = FALSE; mIsDragged = false;
mCursorChanged = FALSE; mCursorChanged = false;
SetCursor( mNormalCursor ); SetCursor( mNormalCursor );
ReleaseMouse(); ReleaseMouse();
@@ -1126,7 +1126,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
{ {
SetCursor( mResizeCursor ); SetCursor( mResizeCursor );
mCursorChanged = TRUE; mCursorChanged = true;
} }
} }
else else
@@ -1134,7 +1134,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
{ {
SetCursor( mNormalCursor ); SetCursor( mNormalCursor );
mCursorChanged = FALSE; mCursorChanged = false;
} }
} }
else else
@@ -1149,7 +1149,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event )
wxWindowDC dc(this); wxWindowDC dc(this);
DrawDecorations( dc ); DrawDecorations( dc );
RecalcLayout(FALSE); RecalcLayout(false);
//Refresh(); //Refresh();
} }
@@ -1181,7 +1181,7 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event )
{ {
if ( !mScrollEventInProgress ) if ( !mScrollEventInProgress )
{ {
mScrollEventInProgress = TRUE; mScrollEventInProgress = true;
GetActiveTab()->GetEventHandler()->ProcessEvent( event ); GetActiveTab()->GetEventHandler()->ProcessEvent( event );
} }
@@ -1190,7 +1190,7 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event )
// event bounced back to us, from here we // event bounced back to us, from here we
// know that it has traveled the loop - thus it's processed! // know that it has traveled the loop - thus it's processed!
mScrollEventInProgress = FALSE; mScrollEventInProgress = false;
} }
} }
} // wxPagedWindow::OnScroll() } // wxPagedWindow::OnScroll()

View File

@@ -8,9 +8,9 @@
// - restruction of Variable declaration // - restruction of Variable declaration
// - to prevent Warnings under MingGW32 // - to prevent Warnings under MingGW32
// Modified by: 19990909 : mj // Modified by: 19990909 : mj
// - mNoVertScroll TRUE = no / FALSE = Original Code // - mNoVertScroll true = no / false = Original Code
// the Original Code Paints a Vertical Scroll in wxPagedWindow // the Original Code Paints a Vertical Scroll in wxPagedWindow
// which is not needed in this Version. Use TRUE for this. // which is not needed in this Version. Use true for this.
// Created: 07/09/98 // Created: 07/09/98
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) Aleksandras Gluchovas // Copyright: (c) Aleksandras Gluchovas
@@ -68,7 +68,7 @@ public:
public: public:
// public properties (invoke ReclaclLayout(TRUE) to apply changes) // public properties (invoke ReclaclLayout(true) to apply changes)
int mVertGap; // default: 3 int mVertGap; // default: 3
int mHorizGap; // default: 5 int mHorizGap; // default: 5
@@ -135,7 +135,7 @@ public:
// should be invoked to redisplay window with changed properties // should be invoked to redisplay window with changed properties
virtual void RecalcLayout( bool andRepaint = TRUE ); virtual void RecalcLayout( bool andRepaint = true );
// event handlers // event handlers
@@ -180,7 +180,7 @@ public:
int mTitleRowStart; int mTitleRowStart;
int mResizeNailGap; int mResizeNailGap;
int mTitleRowLen; // actual title row length int mTitleRowLen; // actual title row length
int mNoVertScroll; // No Vertical Scroll TRUE/FALSE int mNoVertScroll; // No Vertical Scroll true/false
void DrawPaperBar( twTabInfo& tab, int x, int y, void DrawPaperBar( twTabInfo& tab, int x, int y,
wxBrush& brush, wxPen& pen, wxDC& dc ); wxBrush& brush, wxPen& pen, wxDC& dc );
@@ -222,7 +222,7 @@ public:
virtual int HitTest( const wxPoint& pos ); virtual int HitTest( const wxPoint& pos );
virtual void RecalcLayout( bool andRepaint = TRUE ); virtual void RecalcLayout( bool andRepaint = true );
// event handlers // event handlers