Enhanced stock labels usage. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-01-31 18:18:18 +00:00
parent faa9724741
commit 5d2ac6b8c6
21 changed files with 140 additions and 142 deletions

View File

@@ -70,7 +70,7 @@ wxChar *GetExtendedDBErrorMsg(wxChar *ErrFile, int ErrLine)
if (pDbList->PtrDb->errorList[i])
{
msg.Append(pDbList->PtrDb->errorList[i]);
if (wxStrcmp(pDbList->PtrDb->errorList[i],_T("")) != 0)
if (wxStrcmp(pDbList->PtrDb->errorList[i],wxEmptyString) != 0)
msg.Append(_T("\n"));
}
}
@@ -83,9 +83,9 @@ wxChar *GetExtendedDBErrorMsg(wxChar *ErrFile, int ErrLine)
BrowserDB::BrowserDB()
{
PointerToNULL(0);
ODBCSource = _T(""); // ODBC data source name (created with ODBC Administrator under Win95/NT)
UserName = _T(""); // database username - must already exist in the data source
Password = _T(""); // password database username
ODBCSource = wxEmptyString; // ODBC data source name (created with ODBC Administrator under Win95/NT)
UserName = wxEmptyString; // database username - must already exist in the data source
Password = wxEmptyString; // password database username
OnFillSqlTyp();
OnFilldbTyp();
} // BrowserDB Constructor
@@ -126,7 +126,7 @@ bool BrowserDB::OnStartDB(int Quiet)
// Connect to datasource
//---------------------------------------------------------------------------------------
DlgUser *p_Dlg;
p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,_T(""));
p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,wxEmptyString);
p_Dlg->s_DSN = ODBCSource;
p_Dlg->s_User = UserName;
p_Dlg->s_Password = Password;
@@ -153,9 +153,9 @@ bool BrowserDB::OnStartDB(int Quiet)
// wxLogMessage(">>>%s<<<>>>%s<<<",UserName.c_str(),Password.c_str());
if (db_BrowserDB == NULL)
{
DbConnectInf.SetDsn(wxT(""));
DbConnectInf.SetUserID(wxT(""));
DbConnectInf.SetPassword(wxT(""));
DbConnectInf.SetDsn(wxEmptyString);
DbConnectInf.SetUserID(wxEmptyString);
DbConnectInf.SetPassword(wxEmptyString);
if (!Quiet)
{
wxLogMessage(_("\n-E-> BrowserDB::OnConnectDataSource() DB CONNECTION ERROR : Unable to connect to the data source.\n\nCheck the name of your data source to verify it has been correctly entered/spelled.\n\nWith some databases, the user name and password must\nbe created with full rights to the table prior to making a connection\n(using tools provided by the database manufacturer)"));
@@ -251,7 +251,7 @@ bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
switch(i_dbDataType)
{
case DB_DATA_TYPE_VARCHAR:
wxStrcpy(s_temp,_T(""));
wxStrcpy(s_temp,wxEmptyString);
if (!db_BrowserDB->GetData((UWORD)(i+1),(SWORD)((cl_BrowserDB+i)->pColFor->i_dbDataType),&s_temp[0],sizeof(s_temp), &cb))
{
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
@@ -490,7 +490,7 @@ void BrowserDB::OnFillSqlTyp()
i_SqlTyp[21] = SQL_NUMERIC; s_SqlTyp[21] = _T("SQL_NUMERIC");
i_SqlTyp[22] = SQL_LONGVARCHAR; s_SqlTyp[22] = _T("SQL_LONGVARCHAR");
i_SqlTyp[23] = SQL_REAL; s_SqlTyp[23] = _T("SQL_REAL");
i_SqlTyp[0] = 23; s_SqlTyp[0] = _T("");
i_SqlTyp[0] = 23; s_SqlTyp[0] = wxEmptyString;
}
//----------------------------------------------------------------------------------------
@@ -500,6 +500,6 @@ void BrowserDB::OnFilldbTyp()
i_dbTyp[2] = DB_DATA_TYPE_INTEGER; s_dbTyp[2] = _T("DB_DATA_TYPE_INTEGER");
i_dbTyp[3] = DB_DATA_TYPE_FLOAT; s_dbTyp[3] = _T("DB_DATA_TYPE_FLOAT");
i_dbTyp[4] = DB_DATA_TYPE_DATE; s_dbTyp[4] = _T("DB_DATA_TYPE_DATE");
i_dbTyp[0] = 4; s_dbTyp[0] = _T("");
i_dbTyp[0] = 4; s_dbTyp[0] = wxEmptyString;
}
//----------------------------------------------------------------------------------------

View File

@@ -26,6 +26,8 @@
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/stockitem.h"
//----------------------------------------------------------------------------------------
#ifndef __WXMSW__
#include "bitmaps/logo.xpm"
@@ -39,9 +41,9 @@
//-- Some Global Vars for this file ------------------------------------------------------
//----------------------------------------------------------------------------------------
BEGIN_EVENT_TABLE(MainFrame, wxFrame)
EVT_MENU(QUIT, MainFrame::OnQuit) // Program End
EVT_MENU(ABOUT, MainFrame::OnAbout) // Program Discription
EVT_MENU(HELP, MainFrame::OnHelp) // Program Help
EVT_MENU(wxID_EXIT, MainFrame::OnQuit) // Program End
EVT_MENU(wxID_ABOUT, MainFrame::OnAbout) // Program Discription
EVT_MENU(wxID_HELP, MainFrame::OnHelp) // Program Help
END_EVENT_TABLE()
//----------------------------------------------------------------------------------------
@@ -97,14 +99,14 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
// Win-Registry : Workplace\HKEY_CURRENT_USERS\Software\%GetVendorName()\%GetAppName()
//---------------------------------------------------------------------------------------
SetVendorName(_T("mj10777")); // Needed to get Configuration Information
SetAppName(_T("DBBrowse")); // "" , also needed for s_LangHelp
SetAppName(_T("DBBrowse")); // "" , also needed for s_LangHelp
//---------------------------------------------------------------------------------------
// we're using wxConfig's "create-on-demand" feature: it will create the
// config object when it's used for the first time. It has a number of
// advantages compared with explicitly creating our wxConfig:
// 1) we don't pay for it if we don't use it
// 2) there is no danger to create it twice
// application and vendor name are used by wxConfig to construct the name
// of the config file/registry key and must be set before the first call
// to Get() if you want to override the default values (the application
@@ -120,7 +122,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
{
Temp0.Empty();
p_ProgramCfg->Read(_T("/Local/langid"),&Temp0); // >const char *langid< can't be used here
if (Temp0 == _T(""))
if (Temp0.empty())
langid = _T("std"); // Standard language is "std" = english
else
langid = Temp0;
@@ -206,12 +208,12 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
// Make a menubar
wxMenu *file_menu = new wxMenu;
wxMenu *help_menu = new wxMenu;
help_menu->Append(HELP, _("&Help"));
help_menu->Append(wxID_HELP, wxGetStockLabel(wxID_HELP));
help_menu->AppendSeparator();
help_menu->Append(ABOUT, _("&About"));
file_menu->Append(QUIT, _("E&xit"));
help_menu->Append(wxID_ABOUT, _("&About"));
file_menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT));
wxMenuBar *menu_bar = new wxMenuBar;
menu_bar->Append(file_menu, _("&File"));
menu_bar->Append(help_menu, _("&Help"));

View File

@@ -15,7 +15,7 @@ class MainFrame: public wxFrame
public:
MainFrame(wxFrame *frame, wxChar *title, const wxPoint& pos, const wxSize& size);
~MainFrame(void);
public:
// menu callbacks
void OnAbout(wxCommandEvent& event);
@@ -46,9 +46,6 @@ public:
//----------------------------------------------------------------------------------------
// ID for the menu quit command
//----------------------------------------------------------------------------------------
#define QUIT 777
#define ABOUT 778
#define HELP 779
#define TREE_CTRL_PGM 102
#define GRID_CTRL 103
#define TREE_CTRL_DB 104

View File

@@ -67,9 +67,9 @@ wxGrid(parent, id, pos, size, style)
{
b_EditModus = false;
//---------------------------------------------------------------------------------------
popupMenu1 = new wxMenu(_T(""));
popupMenu1 = new wxMenu;
popupMenu1->Append(GRID_EDIT, _("Edit Modus"));
popupMenu2 = new wxMenu(_T(""));
popupMenu2 = new wxMenu;
popupMenu2->Append(GRID_BROWSE, _("Browse Modus"));
}
@@ -192,7 +192,7 @@ void DBGrid::OnEditorHidden( wxGridEvent& ev )
//----------------------------------------------------------------------------------------
void DBGrid::OnSelectCell( wxGridEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
logBuf << _T("Selected cell at row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();
wxLogMessage( _T("%s"), logBuf.c_str() );

View File

@@ -38,7 +38,7 @@
//----------------------------------------------------------------------------------------
static inline const wxChar *bool2String(bool b)
{
return b ? _T("") : _T("not ");
return b ? wxEmptyString : _T("not ");
}
//----------------------------------------------------------------------------------------
@@ -174,7 +174,7 @@ int DBTree::OnPopulate()
Temp2.Printf(_T("(%d) - %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
Docu = AppendItem(Folder,Temp2,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1));
Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
if (Temp2 == _T(""))
if (Temp2.empty())
Temp2 = _("None");
Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2.c_str());
Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(_T("KEY")));
@@ -250,12 +250,12 @@ int DBTree::OnPopulate()
Expand(Root);
//---------------------------------------------------------------------------------------
popupMenu1 = NULL;
popupMenu1 = new wxMenu(_T(""));
popupMenu1 = new wxMenu;
popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h "));
popupMenu1->AppendSeparator();
popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes"));
popupMenu2 = NULL;
popupMenu2 = new wxMenu(_T(""));
popupMenu2 = new wxMenu;
popupMenu2->Append(DATA_SHOW, _("Show Data"));
popupMenu2->AppendSeparator();
popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));

View File

@@ -92,7 +92,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
//layout->height.AsIs();
m_Password->SetConstraints(layout);
m_OK = new wxButton(this, wxID_OK, _("OK"));
m_OK = new wxButton(this, wxID_OK);
m_OK->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->left.SameAs(this, wxLeft, 10);
@@ -101,7 +101,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
layout->width.Absolute(75);
m_OK->SetConstraints(layout);
m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
m_Cancel = new wxButton(this, wxID_CANCEL);
m_Cancel->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->left.SameAs(m_OK, wxRight, 10);

View File

@@ -157,7 +157,7 @@ bool MainDoc::OnInitODBC()
{
wxChar Dsn[SQL_MAX_DSN_LENGTH+1];
wxChar DsDesc[254+1]; // BJO20002501 instead of 512
Temp0 = _T("");
Temp0 = wxEmptyString;
i_DSN = 0; // Counter
int i;
//---------------------------------------------------------------------------------------
@@ -183,7 +183,7 @@ bool MainDoc::OnInitODBC()
s_SortDSNList.Add(Dsn);
s_SortDsDescList.Add(KeyString);
}
//---------------------------------------------------------------------------------------
// Allocate n ODBC-DSN objects to hold the information
// Allocate n wxDatabase objects to hold the column information
@@ -197,8 +197,8 @@ bool MainDoc::OnInitODBC()
// ODBC-DSN object
(p_DSN+i)->Dsn = s_SortDSNList[i];
(p_DSN+i)->Drv = KeyString;
(p_DSN+i)->Usr = _T("");
(p_DSN+i)->Pas = _T("");
(p_DSN+i)->Usr = wxEmptyString;
(p_DSN+i)->Pas = wxEmptyString;
Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str());
wxLogMessage(Temp0);
@@ -236,7 +236,7 @@ bool MainDoc::OnChosenDSN(int Which)
p_TabArea->Show(false); // Deactivate the Window
p_TabArea->RemoveTab(p_DBTree->i_ViewNr);
p_TabArea->Show(true); // Activate the Window
OnChosenTbl(77,_T(""));
OnChosenTbl(77,wxEmptyString);
}
//-------------------------
p_TabArea->Show(false); // Deactivate the Window
@@ -286,7 +286,7 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
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(""));
p_TabArea->AddTab(p_DBGrid, Table, wxEmptyString);
p_DBGrid->i_ViewNr = p_TabArea->GetTabCount()-1;
p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br;
@@ -299,7 +299,7 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
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(""));
p_PageArea->AddTab(p_DBGrid, Table, wxEmptyString);
p_DBGrid->i_ViewNr = p_PageArea->GetTabCount()-1;
p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br;

View File

@@ -45,7 +45,7 @@
//----------------------------------------------------------------------------------------
static inline const wxChar *bool2String(bool b)
{
return b ? _T("") : _T("not ");
return b ? wxEmptyString : _T("not ");
}
//----------------------------------------------------------------------------------------
@@ -88,7 +88,7 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
PgmCtrl::~PgmCtrl()
{
delete p_imageListNormal;
delete popupMenu1;
delete popupMenu1;
}
//----------------------------------------------------------------------------------------
@@ -122,7 +122,7 @@ int PgmCtrl::OnPopulate()
}
//---------------------------------------------------------------------------------------
popupMenu1 = NULL;
popupMenu1 = new wxMenu(_T(""));
popupMenu1 = new wxMenu;
popupMenu1->Append(PGMCTRL_ODBC_USER, _("Set Username and Password"));
// popupMenu1->AppendSeparator();
//---------------------------------------------------------------------------------------
@@ -262,7 +262,7 @@ void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
// wxMessageBox(SaveDSN);
int i;
//--------------------------------------------
DlgUser *p_Dlg = new DlgUser(this,pDoc,_T(""));
DlgUser *p_Dlg = new DlgUser(this,pDoc,wxEmptyString);
//-------------------------------------------
for (i=0;i<pDoc->i_DSN;i++)
{

View File

@@ -56,7 +56,7 @@ public:
void OnRightSelect(wxTreeEvent& event);
void OnMouseMove(wxMouseEvent& event);
void OnUserPassword(wxCommandEvent& event);
public:
//----------------------------------------------------------------------------------------
// NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()