diff --git a/demos/dbbrowse/browsedb.cpp b/demos/dbbrowse/browsedb.cpp index f5ee9c86f6..b616eff639 100644 --- a/demos/dbbrowse/browsedb.cpp +++ b/demos/dbbrowse/browsedb.cpp @@ -102,9 +102,9 @@ bool BrowserDB::Initialize(int Quiet) if (!OnStartDB(Quiet)) { wxLogMessage(_("\n\n-E-> BrowserDB::OnStartDB(%s) : Failed ! "),ODBCSource.c_str()); - return FALSE; + return false; } - return TRUE; + return true; } // BrowserDB:Initialize //---------------------------------------------------------------------------------------- @@ -117,7 +117,7 @@ bool BrowserDB::OnStartDB(int Quiet) { if (!Quiet) wxLogMessage(_("\n-I-> BrowserDB::OnStartDB() : DB is already open.")); - return TRUE; + return true; } DbConnectInf.AllocHenv(); @@ -133,14 +133,14 @@ bool BrowserDB::OnStartDB(int Quiet) p_Dlg->OnInit(); p_Dlg->Fit(); - bool OK = FALSE; + bool OK = false; if (p_Dlg->ShowModal() == wxID_OK) { (pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User; (pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password; UserName = p_Dlg->s_User; Password = p_Dlg->s_Password; - OK = TRUE; + OK = true; } delete p_Dlg; 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()); } DbConnectInf.FreeHenv(); - return FALSE; + return false; } //-------------------------------------------------------------------------------------- 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::OnStartDB(%s) : End - Time needed : %ld ms"),ODBCSource.c_str(),sw.Time()); } - return TRUE; + return true; } else { DbConnectInf.FreeHenv(); - return FALSE; + return false; } } @@ -197,7 +197,7 @@ bool BrowserDB::OnCloseDB(int Quiet) } if (!Quiet) wxLogMessage(_("\n-I-> BrowserDB::OnCloseDB() : End ")); - return TRUE; + return true; } //---------------------------------------------------------------------------------------- @@ -220,7 +220,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) wxLogMessage(Temp0); wxMessageBox(Temp0); #endif - return FALSE; + return false; } 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()); } 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); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); break; @@ -336,7 +336,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet)) } // for } // else - return TRUE; + return true; } //---------------------------------------------------------------------------------------- @@ -354,7 +354,7 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet) Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); wxLogMessage(Temp0); wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()")); - return FALSE; + return false; } //--------------------------------------------------------------------------------------- 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 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); 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) { 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); else wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()")); - return FALSE; + return false; } if (!Quiet) { // wxLogMessage(_("\n-I-> BrowserDB::OnExecSql(%s) - End - Time needed : %ld ms"),SQLStmt.c_str(),sw.Time()); } - return TRUE; + return true; } //---------------------------------------------------------------------------------------- diff --git a/demos/dbbrowse/dbbrowse.cpp b/demos/dbbrowse/dbbrowse.cpp index a2021652d8..f30622aaba 100644 --- a/demos/dbbrowse/dbbrowse.cpp +++ b/demos/dbbrowse/dbbrowse.cpp @@ -223,7 +223,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start int 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)); frame->pDoc = new MainDoc(); 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->Show(TRUE); // Show the frame + frame->Show(true); // Show the frame 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 (!frame->pDoc->OnNewDocument()) - frame->Close(TRUE); + frame->Close(true); // Kill a "Splash Screen" because OnNewDocument, if you have one //--------------------------------------------------------------------------------------- - p_ProgramCfg->Flush(TRUE); // save the configuration - return TRUE; + p_ProgramCfg->Flush(true); // save the configuration + return true; } // bool MainApp::OnInit(void) //---------------------------------------------------------------------------------------- // My frame constructor //---------------------------------------------------------------------------------------- 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 ! //--- 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. 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 p_Help = NULL; // 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 // we want here!) // 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 delete pDoc; // Cleanup (MainDoc::~MainDoc) } // MainFrame::~MainFrame(void) @@ -302,7 +302,7 @@ MainFrame::~MainFrame(void) //---------------------------------------------------------------------------------------- void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } //---------------------------------------------------------------------------------------- diff --git a/demos/dbbrowse/dbgrid.cpp b/demos/dbbrowse/dbgrid.cpp index 638c82c8bb..409f79b4c0 100644 --- a/demos/dbbrowse/dbgrid.cpp +++ b/demos/dbbrowse/dbgrid.cpp @@ -56,7 +56,7 @@ END_EVENT_TABLE() //---------------------------------------------------------------------------------------- // 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 //---------------------------------------------------------------------------------------- @@ -65,7 +65,7 @@ END_EVENT_TABLE() DBGrid::DBGrid(wxWindow *parent, const wxWindowID id,const wxPoint& pos,const wxSize& size, long style): wxGrid(parent, id, pos, size, style) { - b_EditModus = FALSE; + b_EditModus = false; //--------------------------------------------------------------------------------------- popupMenu1 = new wxMenu(_T("")); 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 ? { // Yes, the Data of this Table shall be put into the Grid 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 (db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf; 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 { 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 { // BrowserDB::OnGetNext Formats the field Value into tablename SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName); @@ -156,7 +156,7 @@ Weiter: //---------------------------------------------------------------------------------------- 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 UpdateDimensions(); // Redraw the Grid // wxLogMessage(_("-I-> DBGrid::OnModusEdit() - End")); @@ -165,7 +165,7 @@ void DBGrid::OnModusEdit(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 UpdateDimensions(); // Redraw the Grid // wxLogMessage(_("-I-> DBGrid::OnModusBrowse() - End")); diff --git a/demos/dbbrowse/dbtree.cpp b/demos/dbbrowse/dbtree.cpp index e2ee978102..072b9073b8 100644 --- a/demos/dbbrowse/dbtree.cpp +++ b/demos/dbbrowse/dbtree.cpp @@ -67,7 +67,7 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w { const int image_size = 16; // 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 #if !defined(__WXMSW__) #include "bitmaps/logo.xpm" @@ -104,7 +104,7 @@ DBTree::~DBTree() // delete (pDoc->db_Br+i_Which); // wxLogMessage("DBTree::~DBTree() - Vor OnCloseDB()"); - (pDoc->db_Br+i_Which)->OnCloseDB(FALSE); + (pDoc->db_Br+i_Which)->OnCloseDB(false); // wxLogMessage("DBTree::~DBTree() - Nach OnCloseDB()"); (pDoc->db_Br+i_Which)->db_BrowserDB = NULL; (pDoc->db_Br+i_Which)->ct_BrowserDB = NULL; @@ -128,11 +128,11 @@ int DBTree::OnPopulate() wxString SQL_TYPE, DB_TYPE; SetFont(* pDoc->ft_Doc); //--------------------------------------------------------------------------------------- - if ((pDoc->db_Br+i_Which)->Initialize(FALSE)) + if ((pDoc->db_Br+i_Which)->Initialize(false)) { wxStopWatch sw; wxBeginBusyCursor(); - ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE); + ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(false); if (ct_BrowserDB) { // Use the wxDatabase Information 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); //---- - (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) { @@ -236,7 +236,7 @@ int DBTree::OnPopulate() Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time()); wxLogMessage(Temp0); pDoc->p_MainFrame->SetStatusText(Temp0, 0); - } // if((pDoc->db_Br+i_Which)->Initialize(FALSE)) + } // if((pDoc->db_Br+i_Which)->Initialize(false)) else { wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed")); diff --git a/demos/dbbrowse/dlguser.cpp b/demos/dbbrowse/dlguser.cpp index 8696ef5304..98b4c0d1ba 100644 --- a/demos/dbbrowse/dlguser.cpp +++ b/demos/dbbrowse/dlguser.cpp @@ -46,9 +46,9 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : SetBackgroundColour(_T("wheat")); pDoc = p_Doc; 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); layout = new wxLayoutConstraints; layout->left.SameAs(this, wxLeft, 10); @@ -60,7 +60,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) : int w; 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); 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_Label2 = new wxStaticText(this, -1, _("Password:")); + m_Label2 = new wxStaticText(this, wxID_ANY, _("Password:")); m_Label2->SetFont(* pDoc->ft_Doc); layout = new wxLayoutConstraints; 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); 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); layout = new wxLayoutConstraints; layout->left.SameAs(m_UserName, wxLeft); @@ -136,7 +136,7 @@ END_EVENT_TABLE() //---------------------------------------------------------------------------------------- void DlgUser::OnOk(wxCommandEvent& WXUNUSED(event) ) { - //canceled = FALSE; + //canceled = false; s_User = m_UserName->GetValue(); s_Password = m_Password->GetValue(); EndModal(wxID_OK); @@ -145,7 +145,7 @@ void DlgUser::OnOk(wxCommandEvent& WXUNUSED(event) ) //---------------------------------------------------------------------------------------- //void DlgUser::OnCancel(wxCommandEvent& WXUNUSED(event) ) // { -// canceled = TRUE; +// canceled = true; // EndModal(wxID_CANCEL); // } //---------------------------------------------------------------------------------------- diff --git a/demos/dbbrowse/doc.cpp b/demos/dbbrowse/doc.cpp index a9ccf11ac8..b16d76bd01 100644 --- a/demos/dbbrowse/doc.cpp +++ b/demos/dbbrowse/doc.cpp @@ -63,8 +63,8 @@ MainDoc::MainDoc() //---------------------------------------------------------------------------------------- MainDoc::~MainDoc() { - p_TabArea->Show(FALSE); // Deactivate the Window - p_PageArea->Show(FALSE); // Deactivate the Window + p_TabArea->Show(false); // Deactivate the Window + p_PageArea->Show(false); // Deactivate the Window // ---------------------------------------------------------- // -E-> The Tree Controls take to long to close : Why ?? @@ -86,11 +86,11 @@ bool MainDoc::OnNewDocument() wxStopWatch sw; //--------------------------------------------------------------------------------------- if (!OnInitView()) - return FALSE; + return false; p_PgmCtrl->OnPopulate(); //--------------------------------------------------------------------------------------- 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 //--------------------------------------------------------------------------------------- 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, wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); @@ -119,9 +119,9 @@ bool MainDoc::OnInitView() // now create "output" window //--------------------------------------------------------------------------------------- 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 ); p_LogWin->SetFont(* ft_Doc); // 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); //--------------------------------------------------------------------------------------- // if (!OnInitODBC()) - // return FALSE; + // return false; OnInitODBC(); //--------------------------------------------------------------------------------------- Temp0.Printf(_("-I-> MainDoc::OnInitView() - End - %d DSN's found"),i_DSN); p_MainFrame->SetStatusText(Temp0, 0); wxLogMessage(Temp0); - return TRUE; + return true; } //---------------------------------------------------------------------------------------- @@ -163,7 +163,7 @@ bool MainDoc::OnInitODBC() if (!DbConnectInf.AllocHenv()) { - return FALSE; + return false; } //--------------------------------------------------------------------------------------- @@ -225,10 +225,10 @@ bool MainDoc::OnInitODBC() message += _(" Program will exit!\n\n"); message += _(" Ciao"); 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) { - p_TabArea->Show(FALSE); // Deactivate the Window + p_TabArea->Show(false); // Deactivate the Window p_TabArea->RemoveTab(p_DBTree->i_ViewNr); - p_TabArea->Show(TRUE); // Activate the Window + p_TabArea->Show(true); // Activate the Window 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, wxTR_HAS_BUTTONS | wxSUNKEN_BORDER); p_TabArea->AddTab(p_DBTree,(p_DSN+Which)->Dsn,_T(" ? ")); 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->s_DSN = (p_DSN+Which)->Dsn; p_DBTree->i_TabArt = 0; @@ -258,7 +258,7 @@ bool MainDoc::OnChosenDSN(int Which) p_TabArea->SetActiveTab(p_DBTree->i_ViewNr); //--------------------------------------------------------------------------------------- // 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) { - p_TabArea->Show(FALSE); // Deactivate the Window + p_TabArea->Show(false); // Deactivate the Window 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) { - p_PageArea->Show(FALSE); // Deactivate the Window + p_PageArea->Show(false); // Deactivate the Window p_PageArea->RemoveTab(p_DBGrid->i_ViewNr); - p_PageArea->Show(TRUE); // Activate the Window + p_PageArea->Show(true); // Activate the Window } p_DBGrid = NULL; delete p_DBGrid; } if (Tab == 77) // Delete only - return TRUE; + return true; //------------------------- 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, wxSUNKEN_BORDER); 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->OnTableView(Table); 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 { - 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, wxSUNKEN_BORDER); p_PageArea->AddTab(p_DBGrid, Table, _T("")); @@ -309,13 +309,13 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table) p_DBGrid->pDoc = this; p_DBGrid->db_Br = db_Br; 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_PageArea->SetActiveTab(p_DBGrid->i_ViewNr); } p_DBGrid->i_TabArt = Tab; //-------------------------- - return TRUE;; + return true; } //---------------------------------------------------------------------------------------- diff --git a/demos/dbbrowse/doc.h b/demos/dbbrowse/doc.h index ce3141d677..86672c449c 100644 --- a/demos/dbbrowse/doc.h +++ b/demos/dbbrowse/doc.h @@ -84,9 +84,9 @@ public: virtual bool OnSashPositionChange(int newSashPosition) { if ( !wxSplitterWindow::OnSashPositionChange(newSashPosition) ) - return FALSE; + return false; pDoc->Sash = newSashPosition; - return TRUE; + return true; } DECLARE_EVENT_TABLE() }; diff --git a/demos/dbbrowse/pgmctrl.cpp b/demos/dbbrowse/pgmctrl.cpp index 786b0dea8f..c5893e9d5d 100644 --- a/demos/dbbrowse/pgmctrl.cpp +++ b/demos/dbbrowse/pgmctrl.cpp @@ -72,7 +72,7 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const { const int image_size = 16; // 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 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))); @@ -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); // wxMessageBox(Temp0); - bool OK = FALSE; + bool OK = false; if (p_Dlg->ShowModal() == wxID_OK) { (pDoc->p_DSN+i)->Usr = p_Dlg->s_User; (pDoc->p_DSN+i)->Pas = p_Dlg->s_Password; (pDoc->db_Br+i)->UserName = (pDoc->p_DSN+i)->Usr; (pDoc->db_Br+i)->Password = (pDoc->p_DSN+i)->Pas; - OK = TRUE; + OK = true; } delete p_Dlg; if (!OK) diff --git a/demos/dbbrowse/std.h b/demos/dbbrowse/std.h index 7f15c825e6..e27fecd2ff 100644 --- a/demos/dbbrowse/std.h +++ b/demos/dbbrowse/std.h @@ -3,10 +3,10 @@ //--------------------------------------------------------------------------- //-- all #includes that the whole Project needs. ---------------------------- //--------------------------------------------------------------------------- -#include // to let wxWidgets choose a wxConfig class for your platform -#include // base config class + +#include #include -#include +#include #include #include #include @@ -18,9 +18,10 @@ #include #include #include + //--------------------------- -#include "tabpgwin.h" // Original name : "controlarea.h" -//--------------------------- + +#include "tabpgwin.h" #include "dlguser.h" #include "browsedb.h" #include "dbtree.h" @@ -28,4 +29,5 @@ #include "pgmctrl.h" #include "doc.h" #include "dbbrowse.h" + //--------------------------------------------------------------------------- diff --git a/demos/dbbrowse/tabpgwin.cpp b/demos/dbbrowse/tabpgwin.cpp index 6de25f0824..b8cde25969 100644 --- a/demos/dbbrowse/tabpgwin.cpp +++ b/demos/dbbrowse/tabpgwin.cpp @@ -7,9 +7,9 @@ // - restruction of Variable declaration // - to prevent Warnings under MingW32 // 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 -// 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 // RCS-ID: $Id$ // 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->SetSize( x, y, width, height, 0 ); - info.mpContent->Show(TRUE); + info.mpContent->Show(true); info.mpContent->Refresh(); } else { - info.mpContent->Show(FALSE); + info.mpContent->Show(false); } pTabNode = pTabNode->GetNext(); @@ -217,11 +217,11 @@ void wxTabbedWindow::AddTab( wxWindow* pContent, if ( pContent->GetParent() == NULL ) - pContent->Create( this, -1 ); + pContent->Create( this, wxID_ANY ); mTabs.Append( (wxObject*)pTab ); - RecalcLayout(TRUE); + RecalcLayout(true); OnTabAdded( pTab ); } @@ -239,10 +239,10 @@ void wxTabbedWindow::AddTab( wxWindow* pContent, pTab->mBitMap = *pImage; if ( pContent->GetParent() == NULL ) - pContent->Create( this, -1 ); + pContent->Create( this, wxID_ANY ); mTabs.Append( (wxObject*)pTab ); - RecalcLayout(TRUE); + RecalcLayout(true); OnTabAdded( pTab ); } @@ -282,7 +282,7 @@ wxWindow* wxTabbedWindow::GetActiveTab() void wxTabbedWindow::SetActiveTab( int tabNo ) { mActiveTab = tabNo; - RecalcLayout(TRUE); + RecalcLayout(true); Refresh(); } @@ -490,7 +490,7 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint ) if ( tabNo != mActiveTab ) { twTabInfo& tab = *((twTabInfo*)(pNode->GetData())); - tab.mpContent->Show(FALSE); + tab.mpContent->Show(false); } pNode = pNode->GetNext(); @@ -656,7 +656,7 @@ void wxTabbedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) ) void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) ) { SetBackgroundColour( wxColour( 192,192,192 ) ); - RecalcLayout(TRUE); + RecalcLayout(true); } //--------------------------------------------------------------------------- @@ -704,21 +704,21 @@ END_EVENT_TABLE() //--------------------------------------------------------------------------- wxPagedWindow::wxPagedWindow() -: mScrollEventInProgress( FALSE ), +: mScrollEventInProgress( false ), mTabTrianGap(4), mWhiteBrush( wxColour(255,255,255), wxSOLID ), mGrayBrush ( wxColour(192,192,192), wxSOLID ), mCurentRowOfs( 0 ), mAdjustableTitleRowLen( 300 ), - mIsDragged ( FALSE ), + mIsDragged ( false ), mDagOrigin ( 0 ), - mCursorChanged( FALSE ), + mCursorChanged( false ), mResizeCursor ( wxCURSOR_SIZEWE ), mNormalCursor ( wxCURSOR_ARROW ) { mTitleVertGap = 2; 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; - 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 ) { mpTabScroll = - new wxScrollBar( this, -1, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); + new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); mpHorizScroll = - new wxScrollBar( this, -1, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); + new wxScrollBar( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_HORIZONTAL ); 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; - mpTabScroll->SetScrollbar( 0, 1, units, 1, FALSE ); + mpTabScroll->SetScrollbar( 0, 1, units, 1, false ); } // resetup position of the active tab @@ -1080,7 +1080,7 @@ void wxPagedWindow::OnLButtonDown( wxMouseEvent& event ) { if ( mCursorChanged ) { - mIsDragged = TRUE; + mIsDragged = true; mDagOrigin = event.m_x; mOriginalTitleRowLen = mAdjustableTitleRowLen; @@ -1098,8 +1098,8 @@ void wxPagedWindow::OnLButtonUp( wxMouseEvent& WXUNUSED(event) ) { if ( mIsDragged ) { - mIsDragged = FALSE; - mCursorChanged = FALSE; + mIsDragged = false; + mCursorChanged = false; SetCursor( mNormalCursor ); ReleaseMouse(); @@ -1126,7 +1126,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event ) { SetCursor( mResizeCursor ); - mCursorChanged = TRUE; + mCursorChanged = true; } } else @@ -1134,7 +1134,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event ) { SetCursor( mNormalCursor ); - mCursorChanged = FALSE; + mCursorChanged = false; } } else @@ -1149,7 +1149,7 @@ void wxPagedWindow::OnMouseMove( wxMouseEvent& event ) wxWindowDC dc(this); DrawDecorations( dc ); - RecalcLayout(FALSE); + RecalcLayout(false); //Refresh(); } @@ -1181,7 +1181,7 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event ) { if ( !mScrollEventInProgress ) { - mScrollEventInProgress = TRUE; + mScrollEventInProgress = true; GetActiveTab()->GetEventHandler()->ProcessEvent( event ); } @@ -1190,7 +1190,7 @@ void wxPagedWindow::OnScroll( wxScrollEvent& event ) // event bounced back to us, from here we // know that it has traveled the loop - thus it's processed! - mScrollEventInProgress = FALSE; + mScrollEventInProgress = false; } } } // wxPagedWindow::OnScroll() diff --git a/demos/dbbrowse/tabpgwin.h b/demos/dbbrowse/tabpgwin.h index f6f63e74e1..00efb89929 100644 --- a/demos/dbbrowse/tabpgwin.h +++ b/demos/dbbrowse/tabpgwin.h @@ -8,9 +8,9 @@ // - restruction of Variable declaration // - to prevent Warnings under MingGW32 // 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 -// 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 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas @@ -68,7 +68,7 @@ public: public: - // public properties (invoke ReclaclLayout(TRUE) to apply changes) + // public properties (invoke ReclaclLayout(true) to apply changes) int mVertGap; // default: 3 int mHorizGap; // default: 5 @@ -135,7 +135,7 @@ public: // should be invoked to redisplay window with changed properties - virtual void RecalcLayout( bool andRepaint = TRUE ); + virtual void RecalcLayout( bool andRepaint = true ); // event handlers @@ -180,7 +180,7 @@ public: int mTitleRowStart; int mResizeNailGap; 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, wxBrush& brush, wxPen& pen, wxDC& dc ); @@ -222,7 +222,7 @@ public: virtual int HitTest( const wxPoint& pos ); - virtual void RecalcLayout( bool andRepaint = TRUE ); + virtual void RecalcLayout( bool andRepaint = true ); // event handlers