Applied patch [ 825396 ] dbbrowse demo compatible with Unicode

Wlodzimierz Skiba


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-01-11 22:08:25 +00:00
parent 73e68c1d43
commit daf06bb8bc
11 changed files with 303 additions and 302 deletions

View File

@@ -31,8 +31,7 @@
#include "std.h" #include "std.h"
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// Global structure for holding ODBC connection information // Global structure for holding ODBC connection information
// - darf nur einmal im Projekte definiert werden ?? Extra Databasse Klasse ? wxDbConnectInf DbConnectInf;
wxDbConnectInf DbConnectInf; // F<>r DBase
#if !wxUSE_ODBC #if !wxUSE_ODBC
#error Demo cannot be compiled unless setup.h has wxUSE_ODBC set to 1 #error Demo cannot be compiled unless setup.h has wxUSE_ODBC set to 1
@@ -42,21 +41,21 @@ wxDbConnectInf DbConnectInf; // F
extern WXDLLEXPORT_DATA(wxDbList*) PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */ extern WXDLLEXPORT_DATA(wxDbList*) PtrBegDbList; /* from db.cpp, used in getting back error results from db connections */
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine) wxChar *GetExtendedDBErrorMsg(wxChar *ErrFile, int ErrLine)
{ {
static wxString msg; static wxString msg;
wxString tStr; wxString tStr;
if (ErrFile || ErrLine) if (ErrFile || ErrLine)
{ {
msg += "File: "; msg += _T("File: ");
msg += ErrFile; msg += ErrFile;
msg += " Line: "; msg += _T(" Line: ");
tStr.Printf("%d",ErrLine); tStr.Printf(_T("%d"),ErrLine);
msg += tStr.GetData(); msg += tStr.GetData();
// msg += "\n"; // msg += _T("\n");
} }
msg.Append ("\nODBC errors:\n"); msg.Append (_T("\nODBC errors:\n"));
// msg += "\n"; // msg += _T("\n");
/* Scan through each database connection displaying /* Scan through each database connection displaying
* any ODBC errors that have occured. */ * any ODBC errors that have occured. */
wxDbList *pDbList; wxDbList *pDbList;
@@ -71,22 +70,22 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
if (pDbList->PtrDb->errorList[i]) if (pDbList->PtrDb->errorList[i])
{ {
msg.Append(pDbList->PtrDb->errorList[i]); msg.Append(pDbList->PtrDb->errorList[i]);
if (strcmp(pDbList->PtrDb->errorList[i],"") != 0) if (wxStrcmp(pDbList->PtrDb->errorList[i],_T("")) != 0)
msg.Append("\n"); msg.Append(_T("\n"));
} }
} }
} }
msg += "\n"; msg += _T("\n");
return (char*) (const char*) msg; return (wxChar*) (const wxChar*) msg;
} // GetExtendedDBErrorMsg } // GetExtendedDBErrorMsg
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
BrowserDB::BrowserDB() BrowserDB::BrowserDB()
{ {
PointerToNULL(0); PointerToNULL(0);
ODBCSource = ""; // ODBC data source name (created with ODBC Administrator under Win95/NT) ODBCSource = _T(""); // ODBC data source name (created with ODBC Administrator under Win95/NT)
UserName = ""; // database username - must already exist in the data source UserName = _T(""); // database username - must already exist in the data source
Password = ""; // password database username Password = _T(""); // password database username
OnFillSqlTyp(); OnFillSqlTyp();
OnFilldbTyp(); OnFilldbTyp();
} // BrowserDB Constructor } // BrowserDB Constructor
@@ -127,7 +126,7 @@ bool BrowserDB::OnStartDB(int Quiet)
// Connect to datasource // Connect to datasource
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
DlgUser *p_Dlg; DlgUser *p_Dlg;
p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,""); p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,_T(""));
p_Dlg->s_DSN = ODBCSource; p_Dlg->s_DSN = ODBCSource;
p_Dlg->s_User = UserName; p_Dlg->s_User = UserName;
p_Dlg->s_Password = Password; p_Dlg->s_Password = Password;
@@ -207,7 +206,7 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
SDWORD cb; SDWORD cb;
int i_dbDataType; int i_dbDataType;
int i=0; int i=0;
char s_temp[1024+1]; wxChar s_temp[1024+1];
long l_temp; long l_temp;
double f_temp; double f_temp;
int AnzError=0; int AnzError=0;
@@ -218,7 +217,7 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
{ {
return FALSE; return FALSE;
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> ")); Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
wxMessageBox(Temp0); wxMessageBox(Temp0);
} }
@@ -226,7 +225,7 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
{ {
for (i=0;i<Cols;i++) for (i=0;i<Cols;i++)
{ {
strcpy((cl_BrowserDB+i)->tableName,"-E->"); wxStrcpy((cl_BrowserDB+i)->tableName,_T("-E->"));
i_dbDataType = (cl_BrowserDB+i)->pColFor->i_dbDataType; i_dbDataType = (cl_BrowserDB+i)->pColFor->i_dbDataType;
if (i_dbDataType == 0) // Filter unsupported dbDataTypes if (i_dbDataType == 0) // Filter unsupported dbDataTypes
{ {
@@ -250,27 +249,27 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
switch(i_dbDataType) switch(i_dbDataType)
{ {
case DB_DATA_TYPE_VARCHAR: case DB_DATA_TYPE_VARCHAR:
strcpy(s_temp,""); wxStrcpy(s_temp,_T(""));
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb)) if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_dbDataType,&s_temp,sizeof(s_temp), &cb))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName); Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext of >%s<.\n-E-> "),(cl_BrowserDB+i)->tableName);
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
} }
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,s_temp); Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,s_temp);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
break; break;
case DB_DATA_TYPE_INTEGER: case DB_DATA_TYPE_INTEGER:
l_temp = 0; l_temp = 0;
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb)) if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&l_temp,sizeof(l_temp), &cb))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> ")); Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
} }
else else
{ {
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,l_temp); Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,l_temp);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
} }
break; break;
case DB_DATA_TYPE_FLOAT: case DB_DATA_TYPE_FLOAT:
@@ -278,13 +277,13 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb)) if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&f_temp,sizeof(f_temp), &cb))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> ")); Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxMessageBox(Temp0); wxMessageBox(Temp0);
} }
else else
{ {
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,f_temp); Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,f_temp);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
} }
break; break;
case DB_DATA_TYPE_DATE: case DB_DATA_TYPE_DATE:
@@ -292,7 +291,7 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb)) if (!db_BrowserDB->GetData(i+1,(cl_BrowserDB+i)->pColFor->i_sqlDataType,&t_temp,sizeof(t_temp), &cb))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> ")); Temp0.Printf(_("\n-E-> BrowserDB::OnGetData - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
} }
else else
{ {
@@ -302,20 +301,20 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
{ {
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.year,t_temp.month,t_temp.day, Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.year,t_temp.month,t_temp.day,
t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
} }
if (((cl_BrowserDB+i)->pColFor->i_Nation == 1) || // EU DD.MM.YYYY if (((cl_BrowserDB+i)->pColFor->i_Nation == 1) || // EU DD.MM.YYYY
((cl_BrowserDB+i)->pColFor->i_Nation == 2)) // UK DD/MM/YYYY ((cl_BrowserDB+i)->pColFor->i_Nation == 2)) // UK DD/MM/YYYY
{ {
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.day,t_temp.month,t_temp.year, Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.day,t_temp.month,t_temp.year,
t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
} }
if ((cl_BrowserDB+i)->pColFor->i_Nation == 3) // US MM/DD/YYYY if ((cl_BrowserDB+i)->pColFor->i_Nation == 3) // US MM/DD/YYYY
{ {
Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.month,t_temp.day,t_temp.year, Temp0.Printf((cl_BrowserDB+i)->pColFor->s_Field,t_temp.month,t_temp.day,t_temp.year,
t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction); t_temp.hour, t_temp.minute, t_temp.second, t_temp.fraction);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
} }
} }
break; break;
@@ -329,7 +328,7 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
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);
strcpy((cl_BrowserDB+i)->tableName,Temp0.c_str()); wxStrcpy((cl_BrowserDB+i)->tableName,Temp0.c_str());
break; break;
}; // switch }; // switch
} // for } // for
@@ -345,13 +344,13 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
wxString SQLStmt; wxString SQLStmt;
i_Records = 0; i_Records = 0;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
SQLStmt.sprintf("SELECT * FROM %s",db_BrowserDB->SQLTableName(tb_Name.c_str())); SQLStmt.sprintf(_T("SELECT * FROM %s"),db_BrowserDB->SQLTableName(tb_Name.c_str()));
if (!db_BrowserDB->ExecSql((char *)(SQLStmt.GetData()))) if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
{ {
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(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
wxMessageBox("-E-> BrowserDB::OnSelect - GetData()"); wxMessageBox(_T("-E-> BrowserDB::OnSelect - GetData()"));
return FALSE; return FALSE;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -360,10 +359,10 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
i_Records++; i_Records++;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (!db_BrowserDB->ExecSql((char *)(SQLStmt.GetData()))) if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
{ {
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(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
return FALSE; return FALSE;
} }
@@ -381,14 +380,14 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet) bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet)
{ {
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (!db_BrowserDB->ExecSql((char *)(SQLStmt.GetData()))) if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnExecSQL - ODBC-Error with ExecSql of >%s<.\n-E-> "),SQLStmt.c_str()); Temp0.Printf(_("\n-E-> BrowserDB::OnExecSQL - ODBC-Error with ExecSql of >%s<.\n-E-> "),SQLStmt.c_str());
Temp0 += GetExtendedDBErrorMsg(__FILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
if (!Quiet) if (!Quiet)
wxLogMessage(Temp0); wxLogMessage(Temp0);
else else
wxMessageBox("-E-> BrowserDB::OnExecSql - ExecSql()"); wxMessageBox(_T("-E-> BrowserDB::OnExecSql - ExecSql()"));
return FALSE; return FALSE;
} }
if (!Quiet) if (!Quiet)
@@ -401,18 +400,18 @@ bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
wxDbInf* BrowserDB::OnGetCatalog(int Quiet) wxDbInf* BrowserDB::OnGetCatalog(int Quiet)
{ {
char UName[255]; wxChar UName[255];
strcpy(UName,UserName); wxStrcpy(UName,UserName);
ct_BrowserDB = db_BrowserDB->GetCatalog(UName); ct_BrowserDB = db_BrowserDB->GetCatalog(UName);
return ct_BrowserDB; return ct_BrowserDB;
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
wxDbColInf* BrowserDB::OnGetColumns(char *tableName, UWORD numCols, int Quiet) wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int Quiet)
{ {
char UName[255]; wxChar UName[255];
int i; int i;
strcpy(UName,UserName); wxStrcpy(UName,UserName);
cl_BrowserDB = db_BrowserDB->GetColumns(tableName,&numCols,UName); cl_BrowserDB = db_BrowserDB->GetColumns(tableName,&numCols,UName);
// cl_BrowserDB->pColFor = new wxDbColFor[numCols]; // cl_BrowserDB->pColFor = new wxDbColFor[numCols];
for (i=0;i<numCols;i++) for (i=0;i<numCols;i++)
@@ -459,39 +458,39 @@ void BrowserDB::PointerToNULL(int Art)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void BrowserDB::OnFillSqlTyp() void BrowserDB::OnFillSqlTyp()
{ {
i_SqlTyp[1] = SQL_C_BINARY; s_SqlTyp[1] = "SQL_C_BINARY"; i_SqlTyp[1] = SQL_C_BINARY; s_SqlTyp[1] = _T("SQL_C_BINARY");
i_SqlTyp[2] = SQL_C_BIT; s_SqlTyp[2] = "SQL_C_BIT"; i_SqlTyp[2] = SQL_C_BIT; s_SqlTyp[2] = _T("SQL_C_BIT");
i_SqlTyp[3] = SQL_C_BOOKMARK; s_SqlTyp[3] = "SQL_C_BOOKMARK"; i_SqlTyp[3] = SQL_C_BOOKMARK; s_SqlTyp[3] = _T("SQL_C_BOOKMARK");
i_SqlTyp[4] = SQL_C_CHAR; s_SqlTyp[4] = "SQL_C_CHAR"; i_SqlTyp[4] = SQL_C_CHAR; s_SqlTyp[4] = _T("SQL_C_CHAR");
i_SqlTyp[5] = SQL_C_DATE; s_SqlTyp[5] = "SQL_C_DATE"; i_SqlTyp[5] = SQL_C_DATE; s_SqlTyp[5] = _T("SQL_C_DATE");
i_SqlTyp[6] = SQL_C_DEFAULT; s_SqlTyp[6] = "SQL_C_DEFAULT"; i_SqlTyp[6] = SQL_C_DEFAULT; s_SqlTyp[6] = _T("SQL_C_DEFAULT");
i_SqlTyp[7] = SQL_C_DOUBLE; s_SqlTyp[7] = "SQL_C_DOUBLE"; i_SqlTyp[7] = SQL_C_DOUBLE; s_SqlTyp[7] = _T("SQL_C_DOUBLE");
i_SqlTyp[8] = SQL_C_FLOAT; s_SqlTyp[8] = "SQL_C_FLOAT"; i_SqlTyp[8] = SQL_C_FLOAT; s_SqlTyp[8] = _T("SQL_C_FLOAT");
i_SqlTyp[9] = SQL_C_LONG; s_SqlTyp[9] = "SQL_C_LONG"; i_SqlTyp[9] = SQL_C_LONG; s_SqlTyp[9] = _T("SQL_C_LONG");
i_SqlTyp[10] = SQL_C_SHORT; s_SqlTyp[10] = "SQL_C_SHORT"; i_SqlTyp[10] = SQL_C_SHORT; s_SqlTyp[10] = _T("SQL_C_SHORT");
i_SqlTyp[11] = SQL_C_SLONG; s_SqlTyp[11] = "SQL_C_SLONG"; i_SqlTyp[11] = SQL_C_SLONG; s_SqlTyp[11] = _T("SQL_C_SLONG");
i_SqlTyp[12] = SQL_C_SSHORT; s_SqlTyp[12] = "SQL_C_SSHORT"; i_SqlTyp[12] = SQL_C_SSHORT; s_SqlTyp[12] = _T("SQL_C_SSHORT");
i_SqlTyp[13] = SQL_C_STINYINT; s_SqlTyp[13] = "SQL_C_STINYINT"; i_SqlTyp[13] = SQL_C_STINYINT; s_SqlTyp[13] = _T("SQL_C_STINYINT");
i_SqlTyp[14] = SQL_C_TIME; s_SqlTyp[14] = "SQL_C_TIME"; i_SqlTyp[14] = SQL_C_TIME; s_SqlTyp[14] = _T("SQL_C_TIME");
i_SqlTyp[15] = SQL_C_TIMESTAMP; s_SqlTyp[15] = "SQL_C_TIMESTAMP"; i_SqlTyp[15] = SQL_C_TIMESTAMP; s_SqlTyp[15] = _T("SQL_C_TIMESTAMP");
i_SqlTyp[16] = SQL_C_TINYINT; s_SqlTyp[16] = "SQL_C_TINYINT"; i_SqlTyp[16] = SQL_C_TINYINT; s_SqlTyp[16] = _T("SQL_C_TINYINT");
i_SqlTyp[17] = SQL_C_ULONG; s_SqlTyp[17] = "SQL_C_ULONG"; i_SqlTyp[17] = SQL_C_ULONG; s_SqlTyp[17] = _T("SQL_C_ULONG");
i_SqlTyp[18] = SQL_C_USHORT; s_SqlTyp[18] = "SQL_C_USHORT"; i_SqlTyp[18] = SQL_C_USHORT; s_SqlTyp[18] = _T("SQL_C_USHORT");
i_SqlTyp[19] = SQL_C_UTINYINT; s_SqlTyp[19] = "SQL_C_UTINYINT"; i_SqlTyp[19] = SQL_C_UTINYINT; s_SqlTyp[19] = _T("SQL_C_UTINYINT");
i_SqlTyp[20] = SQL_VARCHAR; s_SqlTyp[20] = "SQL_VARCHAR"; i_SqlTyp[20] = SQL_VARCHAR; s_SqlTyp[20] = _T("SQL_VARCHAR");
i_SqlTyp[21] = SQL_NUMERIC; s_SqlTyp[21] = "SQL_NUMERIC"; i_SqlTyp[21] = SQL_NUMERIC; s_SqlTyp[21] = _T("SQL_NUMERIC");
i_SqlTyp[22] = SQL_LONGVARCHAR; s_SqlTyp[22] = "SQL_LONGVARCHAR"; i_SqlTyp[22] = SQL_LONGVARCHAR; s_SqlTyp[22] = _T("SQL_LONGVARCHAR");
i_SqlTyp[23] = SQL_REAL; s_SqlTyp[23] = "SQL_REAL"; i_SqlTyp[23] = SQL_REAL; s_SqlTyp[23] = _T("SQL_REAL");
i_SqlTyp[0] = 23; s_SqlTyp[0] = ""; i_SqlTyp[0] = 23; s_SqlTyp[0] = _T("");
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void BrowserDB::OnFilldbTyp() void BrowserDB::OnFilldbTyp()
{ {
i_dbTyp[1] = DB_DATA_TYPE_VARCHAR; s_dbTyp[1] = "DB_DATA_TYPE_VARCHAR"; i_dbTyp[1] = DB_DATA_TYPE_VARCHAR; s_dbTyp[1] = _T("DB_DATA_TYPE_VARCHAR");
i_dbTyp[2] = DB_DATA_TYPE_INTEGER; s_dbTyp[2] = "DB_DATA_TYPE_INTEGER"; 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] = "DB_DATA_TYPE_FLOAT"; 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] = "DB_DATA_TYPE_DATE"; i_dbTyp[4] = DB_DATA_TYPE_DATE; s_dbTyp[4] = _T("DB_DATA_TYPE_DATE");
i_dbTyp[0] = 4; s_dbTyp[0] = ""; i_dbTyp[0] = 4; s_dbTyp[0] = _T("");
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -70,7 +70,7 @@ public:
bool OnExecSql(wxString SQLStmt,int Quiet); bool OnExecSql(wxString SQLStmt,int Quiet);
bool OnGetNext(int Cols,int Quiet); bool OnGetNext(int Cols,int Quiet);
wxDbInf* OnGetCatalog(int Quiet); wxDbInf* OnGetCatalog(int Quiet);
wxDbColInf* OnGetColumns(char *tableName, UWORD numCols,int Quiet); wxDbColInf* OnGetColumns(wxChar *tableName, UWORD numCols,int Quiet);
void OnFillSqlTyp(); void OnFillSqlTyp();
void OnFilldbTyp(); void OnFilldbTyp();
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------

View File

@@ -55,8 +55,8 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
wxString Temp0; // Use as needed wxString Temp0; // Use as needed
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// set the language to use // Help.?? (.std = english, .de = german etc.) // set the language to use // Help.?? (.std = english, .de = german etc.)
const char *language = NULL; // czech, german, french, polish const wxChar *language = NULL; // czech, german, french, polish
const char *langid = NULL; // std = english , cz, de = german, fr = french, pl = polish const wxChar *langid = NULL; // std = english , cz, de = german, fr = french, pl = polish
wxString s_LangHelp; // Directory/Filename.hhp of the Help-Project file wxString s_LangHelp; // Directory/Filename.hhp of the Help-Project file
wxString s_LangId, s_Language; wxString s_LangId, s_Language;
s_Language.Empty(); s_LangId.Empty(); s_LangHelp.Empty(); s_Language.Empty(); s_LangId.Empty(); s_LangHelp.Empty();
@@ -96,8 +96,8 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Win-Registry : Workplace\HKEY_CURRENT_USERS\Software\%GetVendorName()\%GetAppName() // Win-Registry : Workplace\HKEY_CURRENT_USERS\Software\%GetVendorName()\%GetAppName()
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
SetVendorName("mj10777"); // Needed to get Configuration Information SetVendorName(_T("mj10777")); // Needed to get Configuration Information
SetAppName("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 // 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 // config object when it's used for the first time. It has a number of
@@ -112,78 +112,78 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_ProgramCfg = wxConfigBase::Get(); // Get Program Configuration from Registry p_ProgramCfg = wxConfigBase::Get(); // Get Program Configuration from Registry
// p_ProgramCfg->DeleteAll(); // This is how the Config can be erased // p_ProgramCfg->DeleteAll(); // This is how the Config can be erased
p_ProgramCfg->SetPath("/"); // Start at root p_ProgramCfg->SetPath(_T("/")); // Start at root
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
//-- Set the Language and remember it for the next time. -------------------------------- //-- Set the Language and remember it for the next time. --------------------------------
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (langid == NULL) // No Parameter was given if (langid == NULL) // No Parameter was given
{ {
Temp0.Empty(); Temp0.Empty();
p_ProgramCfg->Read("/Local/langid",&Temp0); // >const char *langid< can't be used here p_ProgramCfg->Read(_T("/Local/langid"),&Temp0); // >const char *langid< can't be used here
if (Temp0 == "") if (Temp0 == _T(""))
langid = "std"; // Standard language is "std" = english langid = _T("std"); // Standard language is "std" = english
else else
langid = Temp0; langid = Temp0;
} }
Temp0.Printf("%s",langid); Temp0.Printf(_T("%s"),langid);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Support the following languages (std = english) // Support the following languages (std = english)
if ((Temp0 == "a") || (Temp0 == "cz") || (Temp0 == "de") || if ((Temp0 == _T("a")) || (Temp0 == _T("cz")) || (Temp0 == _T("de")) ||
(Temp0 == "fr") || (Temp0 == "pl")) (Temp0 == _T("fr")) || (Temp0 == _T("pl")))
{ // The three-letter language-string codes are only valid in Windows NT and Windows 95. { // The three-letter language-string codes are only valid in Windows NT and Windows 95.
if (Temp0 == "cz") if (Temp0 == _T("cz"))
language = "czech"; // csy or czech language = _T("czech"); // csy or czech
if ((Temp0 == "de") || (Temp0 == "a")) if ((Temp0 == _T("de")) || (Temp0 == _T("a")))
{ {
language = "german"; // deu or german language = _T("german"); // deu or german
if (Temp0 == "a") if (Temp0 == _T("a"))
{ langid = Temp0 = "de"; } // Austrian = german { langid = Temp0 = _T("de"); } // Austrian = german
} // german / austrian } // german / austrian
if (Temp0 == "fr") if (Temp0 == _T("fr"))
language = "french"; // fra or french language = _T("french"); // fra or french
if (Temp0 == "pl") if (Temp0 == _T("pl"))
language = "polish"; // plk or polish language = _T("polish"); // plk or polish
if (!m_locale.Init(language, langid, language)) // Don't do this for english (std) if (!m_locale.Init(language, langid, language)) // Don't do this for english (std)
{ // You should recieve errors here for cz and pl since there is no cz/ and pl/ directory { // You should recieve errors here for cz and pl since there is no cz/ and pl/ directory
wxLogMessage("-E-> %s : SetLocale error : langid(%s) ; language(%s)",GetAppName().c_str(),langid,language); wxLogMessage(_T("-E-> %s : SetLocale error : langid(%s) ; language(%s)"),GetAppName().c_str(),langid,language);
langid = "std"; langid = _T("std");
language = "C"; // english, english-aus , -can , -nz , -uk , -usa language = _T("C"); // english, english-aus , -can , -nz , -uk , -usa
} }
else else
{ // Read in Foreign language's text for GetAppName() and Help { // Read in Foreign language's text for GetAppName() and Help
Temp0 = GetAppName(); Temp0 = GetAppName();
Temp0 = Temp0.Lower(); Temp0 = Temp0.Lower();
m_locale.AddCatalog(Temp0.c_str()); m_locale.AddCatalog(Temp0.c_str());
m_locale.AddCatalog("help"); m_locale.AddCatalog(_T("help"));
} }
} // Support the following languages (std = english) } // Support the following languages (std = english)
else else
{ {
langid = "std"; langid = _T("std");
language = "C"; // english, english-aus , -can , -nz , -uk , -usa language = _T("C"); // english, english-aus , -can , -nz , -uk , -usa
} }
s_Language.Printf("%s",language); // language is a pointer s_Language.Printf(_T("%s"),language); // language is a pointer
s_LangId.Printf("%s",langid); // langid is a pointer s_LangId.Printf(_T("%s"),langid); // langid is a pointer
p_ProgramCfg->Write("/Local/language",s_Language); p_ProgramCfg->Write(_T("/Local/language"),s_Language);
p_ProgramCfg->Write("/Local/langid",s_LangId); p_ProgramCfg->Write(_T("/Local/langid"),s_LangId);
s_LangHelp.Printf("help.%s/%s.hhp",s_LangId.c_str(),GetAppName().c_str()); // "help.std/Garantie.hhp"; s_LangHelp.Printf(_T("help.%s/%s.hhp"),s_LangId.c_str(),GetAppName().c_str()); // "help.std/Garantie.hhp";
s_LangHelp = s_LangHelp.Lower(); // A must for Linux s_LangHelp = s_LangHelp.Lower(); // A must for Linux
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
Temp0 = "NONE"; // I don't remember why I did this Temp0 = _T("NONE"); // I don't remember why I did this
p_ProgramCfg->Write("/NONE",Temp0); // I don't remember why I did this p_ProgramCfg->Write(_T("/NONE"),Temp0); // I don't remember why I did this
p_ProgramCfg->Write("/Paths/NONE",Temp0); // I don't remember why I did this p_ProgramCfg->Write(_T("/Paths/NONE"),Temp0); // I don't remember why I did this
p_ProgramCfg->Write("/MainFrame/NONE",Temp0); // I don't remember why I did this p_ProgramCfg->Write(_T("/MainFrame/NONE"),Temp0); // I don't remember why I did this
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_ProgramCfg->Write("/Paths/Work",wxGetCwd()); // Get current Working Path p_ProgramCfg->Write(_T("/Paths/Work"),wxGetCwd()); // Get current Working Path
p_ProgramCfg->SetPath("/"); p_ProgramCfg->SetPath(_T("/"));
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// restore frame position and size, if empty start Values (1,1) and (750,600) // restore frame position and size, if empty start Values (1,1) and (750,600)
int x = p_ProgramCfg->Read("/MainFrame/x", 1), y = p_ProgramCfg->Read("/MainFrame/y", 1), int x = p_ProgramCfg->Read(_T("/MainFrame/x"), 1), y = p_ProgramCfg->Read(_T("/MainFrame/y"), 1),
w = p_ProgramCfg->Read("/MainFrame/w", 750), h = p_ProgramCfg->Read("/MainFrame/h", 600); w = p_ProgramCfg->Read(_T("/MainFrame/w"), 750), h = p_ProgramCfg->Read(_T("/MainFrame/h"), 600);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Create the main frame window // Create the main frame window
Temp0.Printf("%s - %s",GetAppName().c_str(),GetVendorName().c_str()); Temp0.Printf(_T("%s - %s"),GetAppName().c_str(),GetVendorName().c_str());
frame = new MainFrame((wxFrame *) NULL,(char *) Temp0.c_str(),wxPoint(x,y),wxSize(w,h)); frame = new MainFrame((wxFrame *) NULL,(wxChar *) Temp0.c_str(),wxPoint(x,y),wxSize(w,h));
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Set the Backgroundcolour (only need if your are NOT using wxSYS_COLOUR_BACKGROUND) // Set the Backgroundcolour (only need if your are NOT using wxSYS_COLOUR_BACKGROUND)
frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND)); frame->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
@@ -244,7 +244,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
// You should recieve errors here for fr since there is no help.fr/ directory // You should recieve errors here for fr since there is no help.fr/ directory
if (!frame->p_Help->AddBook(s_LangHelp)) // Use the language set if (!frame->p_Help->AddBook(s_LangHelp)) // Use the language set
{ // You should recieve errors here for fr since there is no help.fr/ but a fr/ directory { // You should recieve errors here for fr since there is no help.fr/ but a fr/ directory
wxLogMessage("-E-> %s : AddBook error : s_LangHelp(%s)",GetAppName().c_str(),s_LangHelp.c_str()); wxLogMessage(_T("-E-> %s : AddBook error : s_LangHelp(%s)"),GetAppName().c_str(),s_LangHelp.c_str());
} }
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
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -263,7 +263,7 @@ bool MainApp::OnInit(void) // Does everything needed for a program start
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
// My frame constructor // My frame constructor
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
MainFrame::MainFrame(wxFrame *frame, char *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, -1, 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 !
@@ -285,11 +285,11 @@ MainFrame::~MainFrame(void)
int x, y, w, h; int x, y, w, h;
GetPosition(&x, &y); GetPosition(&x, &y);
GetClientSize(&w, &h); w -= DiffW; h -= DiffH; GetClientSize(&w, &h); w -= DiffW; h -= DiffH;
p_ProgramCfg->Write("/MainFrame/x", (long) x); p_ProgramCfg->Write(_T("/MainFrame/x"), (long) x);
p_ProgramCfg->Write("/MainFrame/y", (long) y); p_ProgramCfg->Write(_T("/MainFrame/y"), (long) y);
p_ProgramCfg->Write("/MainFrame/w", (long) w); p_ProgramCfg->Write(_T("/MainFrame/w"), (long) w);
p_ProgramCfg->Write("/MainFrame/h", (long) h); p_ProgramCfg->Write(_T("/MainFrame/h"), (long) h);
p_ProgramCfg->Write("/MainFrame/Sash", (long) pDoc->Sash); p_ProgramCfg->Write(_T("/MainFrame/Sash"), (long) pDoc->Sash);
// clean up: Set() returns the active config object as Get() does, but unlike // clean up: Set() returns the active config object as Get() does, but unlike
// 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!)
@@ -318,6 +318,6 @@ void MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void MainFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) void MainFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
{ {
p_Help->Display("Main page"); p_Help->Display(_T("Main page"));
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------

View File

@@ -13,7 +13,7 @@
class MainFrame: public wxFrame class MainFrame: public wxFrame
{ {
public: public:
MainFrame(wxFrame *frame, char *title, const wxPoint& pos, const wxSize& size); MainFrame(wxFrame *frame, wxChar *title, const wxPoint& pos, const wxSize& size);
~MainFrame(void); ~MainFrame(void);
public: public:

View File

@@ -67,9 +67,9 @@ wxGrid(parent, id, pos, size, style)
{ {
b_EditModus = FALSE; b_EditModus = FALSE;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
popupMenu1 = new wxMenu(""); popupMenu1 = new wxMenu(_T(""));
popupMenu1->Append(GRID_EDIT, _("Edit Modus")); popupMenu1->Append(GRID_EDIT, _("Edit Modus"));
popupMenu2 = new wxMenu(""); popupMenu2 = new wxMenu(_T(""));
popupMenu2->Append(GRID_BROWSE, _("Browse Modus")); popupMenu2->Append(GRID_BROWSE, _("Browse Modus"));
} }
@@ -119,7 +119,7 @@ int DBGrid::OnTableView(wxString Table)
// The Grid has been created, now fill it // The Grid has been created, now fill it
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("%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
@@ -188,10 +188,10 @@ void DBGrid::OnEditorHidden( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnSelectCell( wxGridEvent& ev ) void DBGrid::OnSelectCell( wxGridEvent& ev )
{ {
logBuf = ""; logBuf = _T("");
logBuf << "Selected cell at row " << ev.GetRow() logBuf << _T("Selected cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
wxLogMessage( "%s", logBuf.c_str() ); wxLogMessage( _T("%s"), logBuf.c_str() );
// you must call Skip() if you want the default processing // you must call Skip() if you want the default processing
// to occur in wxGrid // to occur in wxGrid
ev.Skip(); ev.Skip();
@@ -206,24 +206,24 @@ void DBGrid::OnMouseMove(wxMouseEvent &event)
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnLabelLeftClick( wxGridEvent& ev ) void DBGrid::OnLabelLeftClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnLabelLeftClick : "; logBuf = _T("DBGrid::OnLabelLeftClick : ");
if ( ev.GetRow() != -1 ) if ( ev.GetRow() != -1 )
{ {
logBuf << "row label " << ev.GetRow(); logBuf << _T("row label ") << ev.GetRow();
} }
else if ( ev.GetCol() != -1 ) else if ( ev.GetCol() != -1 )
{ {
logBuf << "col label " << ev.GetCol(); logBuf << _T("col label ") << ev.GetCol();
} }
else else
{ {
logBuf << "corner label"; logBuf << _T("corner label");
} }
if ( ev.ShiftDown() ) if ( ev.ShiftDown() )
logBuf << " (shift down)"; logBuf << _T(" (shift down)");
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -237,24 +237,24 @@ void DBGrid::OnLabelRightClick( wxGridEvent& ev )
else else
PopupMenu(popupMenu1,MousePos.x,MousePos.y); PopupMenu(popupMenu1,MousePos.x,MousePos.y);
//------------------- //-------------------
logBuf = "DBGrid::OnLabelRightClick : "; logBuf = _T("DBGrid::OnLabelRightClick : ");
if ( ev.GetRow() != -1 ) if ( ev.GetRow() != -1 )
{ {
logBuf << "row label " << ev.GetRow(); logBuf << _T("row label ") << ev.GetRow();
} }
else if ( ev.GetCol() != -1 ) else if ( ev.GetCol() != -1 )
{ {
logBuf << "col label " << ev.GetCol(); logBuf << _T("col label ") << ev.GetCol();
} }
else else
{ {
logBuf << "corner label"; logBuf << _T("corner label");
} }
if ( ev.ShiftDown() ) if ( ev.ShiftDown() )
logBuf << " (shift down)"; logBuf << _T(" (shift down)");
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -262,24 +262,24 @@ void DBGrid::OnLabelRightClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnLabelLeftDClick( wxGridEvent& ev ) void DBGrid::OnLabelLeftDClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnLabelLeftDClick : "; logBuf = _T("DBGrid::OnLabelLeftDClick : ");
if ( ev.GetRow() != -1 ) if ( ev.GetRow() != -1 )
{ {
logBuf << "row label " << ev.GetRow(); logBuf << _T("row label ") << ev.GetRow();
} }
else if ( ev.GetCol() != -1 ) else if ( ev.GetCol() != -1 )
{ {
logBuf << "col label " << ev.GetCol(); logBuf << _T("col label ") << ev.GetCol();
} }
else else
{ {
logBuf << "corner label"; logBuf << _T("corner label");
} }
if ( ev.ShiftDown() ) if ( ev.ShiftDown() )
logBuf << " (shift down)"; logBuf << _T(" (shift down)");
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( _T("%s"), logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -287,23 +287,23 @@ void DBGrid::OnLabelLeftDClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnLabelRightDClick( wxGridEvent& ev ) void DBGrid::OnLabelRightDClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnLabelRightDClick : "; logBuf = _T("DBGrid::OnLabelRightDClick : ");
if ( ev.GetRow() != -1 ) if ( ev.GetRow() != -1 )
{ {
logBuf << "row label " << ev.GetRow(); logBuf << _T("row label ") << ev.GetRow();
} }
else if ( ev.GetCol() != -1 ) else if ( ev.GetCol() != -1 )
{ {
logBuf << "col label " << ev.GetCol(); logBuf << _T("col label ") << ev.GetCol();
} }
else else
{ {
logBuf << "corner label"; logBuf << _T("corner label");
} }
if ( ev.ShiftDown() ) if ( ev.ShiftDown() )
logBuf << " (shift down)"; logBuf << _T(" (shift down)");
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -311,12 +311,12 @@ void DBGrid::OnLabelRightDClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnCellLeftClick( wxGridEvent& ev ) void DBGrid::OnCellLeftClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnCellLeftClick : "; logBuf = _T("DBGrid::OnCellLeftClick : ");
logBuf << "Cell at row " << ev.GetRow() logBuf << _T("Cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf); // wxMessageBox(logBuf);
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
// you must call event skip if you want default grid processing // you must call event skip if you want default grid processing
// (cell highlighting etc.) // (cell highlighting etc.)
@@ -327,12 +327,12 @@ void DBGrid::OnCellLeftClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnCellRightClick( wxGridEvent& ev ) void DBGrid::OnCellRightClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnCellRightClick : "; logBuf = _T("DBGrid::OnCellRightClick : ");
logBuf << "Cell at row " << ev.GetRow() logBuf << _T("Cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf); // wxMessageBox(logBuf);
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
// you must call event skip if you want default grid processing // you must call event skip if you want default grid processing
// (cell highlighting etc.) // (cell highlighting etc.)
@@ -343,12 +343,12 @@ void DBGrid::OnCellRightClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnCellLeftDClick( wxGridEvent& ev ) void DBGrid::OnCellLeftDClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnCellLeftDClick : "; logBuf = _T("DBGrid::OnCellLeftDClick : ");
logBuf << "Cell at row " << ev.GetRow() logBuf << _T("Cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf); // wxMessageBox(logBuf);
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
// you must call event skip if you want default grid processing // you must call event skip if you want default grid processing
// (cell highlighting etc.) // (cell highlighting etc.)
@@ -359,12 +359,12 @@ void DBGrid::OnCellLeftDClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnCellRightDClick( wxGridEvent& ev ) void DBGrid::OnCellRightDClick( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnCellRightDClick : "; logBuf = _T("DBGrid::OnCellRightDClick : ");
logBuf << "Cell at row " << ev.GetRow() logBuf << _T("Cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf); // wxMessageBox(logBuf);
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
// you must call event skip if you want default grid processing // you must call event skip if you want default grid processing
// (cell highlighting etc.) // (cell highlighting etc.)
@@ -375,12 +375,12 @@ void DBGrid::OnCellRightDClick( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnCellChange( wxGridEvent& ev ) void DBGrid::OnCellChange( wxGridEvent& ev )
{ {
logBuf = "DBGrid::OnCellChange : "; logBuf = _T("DBGrid::OnCellChange : ");
logBuf << "Cell at row " << ev.GetRow() logBuf << _T("Cell at row ") << ev.GetRow()
<< " col " << ev.GetCol(); << _T(" col ") << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf); // wxMessageBox(logBuf);
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
// you must call event skip if you want default grid processing // you must call event skip if you want default grid processing
// (cell highlighting etc.) // (cell highlighting etc.)
@@ -391,10 +391,10 @@ void DBGrid::OnCellChange( wxGridEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnRowSize( wxGridSizeEvent& ev ) void DBGrid::OnRowSize( wxGridSizeEvent& ev )
{ {
logBuf = "DBGrid::OnRowSize : "; logBuf = _T("DBGrid::OnRowSize : ");
logBuf << "Resized row " << ev.GetRowOrCol(); logBuf << _T("Resized row ") << ev.GetRowOrCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -402,10 +402,10 @@ void DBGrid::OnRowSize( wxGridSizeEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnColSize( wxGridSizeEvent& ev ) void DBGrid::OnColSize( wxGridSizeEvent& ev )
{ {
logBuf = "DBGrid::OnColSize : "; logBuf = _T("DBGrid::OnColSize : ");
logBuf << "Resized col " << ev.GetRowOrCol(); logBuf << _T("Resized col ") << ev.GetRowOrCol();
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n"; logBuf += _T("\n");
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();
} }
@@ -413,12 +413,12 @@ void DBGrid::OnColSize( wxGridSizeEvent& ev )
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnRangeSelected( wxGridRangeSelectEvent& ev ) void DBGrid::OnRangeSelected( wxGridRangeSelectEvent& ev )
{ {
logBuf = "DBGrid::OnRangeSelected : "; logBuf = _T("DBGrid::OnRangeSelected : ");
logBuf << "Selected cells from row " << ev.GetTopRow() logBuf << _T("Selected cells from row ") << ev.GetTopRow()
<< " col " << ev.GetLeftCol() << _T(" col ") << ev.GetLeftCol()
<< " to row " << ev.GetBottomRow() << _T(" to row ") << ev.GetBottomRow()
<< " col " << ev.GetRightCol(); << _T(" col ") << ev.GetRightCol();
logBuf += "\n"; logBuf += _T("\n");
// wxLogMessage( "%s", logBuf.c_str() ); // wxLogMessage( "%s", logBuf.c_str() );
wxLogMessage(logBuf.c_str()); wxLogMessage(logBuf.c_str());
ev.Skip(); ev.Skip();

View File

@@ -36,9 +36,9 @@
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
//-- Global functions -------------------------------------------------------------------- //-- Global functions --------------------------------------------------------------------
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
static inline const char *bool2String(bool b) static inline const wxChar *bool2String(bool b)
{ {
return b ? "" : "not "; return b ? _T("") : _T("not ");
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -65,8 +65,9 @@ DBTree::DBTree(wxWindow *parent) : wxTreeCtrl(parent)
DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size, long style) DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size, long style)
: wxTreeCtrl(parent, id, pos, size, style) : wxTreeCtrl(parent, id, pos, size, style)
{ {
const int image_size = 16;
// Make an image list containing small icons // Make an image list containing small icons
p_imageListNormal = new wxImageList(16, 16, 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"
@@ -80,16 +81,16 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w
#include "bitmaps/d_open.xpm" #include "bitmaps/d_open.xpm"
#include "bitmaps/d_closed.xpm" #include "bitmaps/d_closed.xpm"
#endif #endif
p_imageListNormal->Add(wxICON(aLogo)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(aLogo)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DsnClosed)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnClosed)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DsnOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnOpen)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(TAB)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(TAB)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(VIEW)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(VIEW)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(COL)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(COL)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(KEY)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(KEY)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(KEYF)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(KEYF)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DocOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DocOpen)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DocOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DocOpen)).ConvertToImage().Rescale(image_size, image_size)));
SetImageList(p_imageListNormal); SetImageList(p_imageListNormal);
ct_BrowserDB = NULL; ct_BrowserDB = NULL;
popupMenu1 = NULL; popupMenu1 = NULL;
@@ -134,19 +135,19 @@ int DBTree::OnPopulate()
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("%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);
Root = AddRoot(Temp0,TreeIc_DsnOpen,TreeIc_DsnOpen,new DBTreeData("Root")); Root = AddRoot(Temp0,TreeIc_DsnOpen,TreeIc_DsnOpen,new DBTreeData(_T("Root")));
for (x=0;x<ct_BrowserDB->numTables;x++) for (x=0;x<ct_BrowserDB->numTables;x++)
{ {
wxYield(); wxYield();
TableType = 0; // TABLE = 1 ; VIEW = 2 ; 0 We are not interested in TableType = 0; // TABLE = 1 ; VIEW = 2 ; 0 We are not interested in
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,"TABLE")) // only TABLES if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,_T("TABLE"))) // only TABLES
TableType = 1; TableType = 1;
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,"VIEW")) // and VIEWS if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,_T("VIEW"))) // and VIEWS
TableType = 2; TableType = 2;
if (TableType) // only TABLES or Views if (TableType) // only TABLES or Views
{ {
Temp1.Printf("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);
//---- //----
@@ -166,37 +167,37 @@ int DBTree::OnPopulate()
} }
for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++)
{ {
Temp1.Printf("FN(%s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName); Temp1.Printf(_T("FN(%s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
// Here is where we find out if the Column is a Primary / Foreign Key // Here is where we find out if the Column is a Primary / Foreign Key
if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol != 0) // Primary Key if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol != 0) // Primary Key
{ {
Temp2.Printf("(%d) - %s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName); 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)); Docu = AppendItem(Folder,Temp2,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1));
Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName; Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
if (Temp2 == "") if (Temp2 == _T(""))
Temp2 = _("None"); Temp2 = _("None");
Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2.c_str()); 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("KEY")); Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(_T("KEY")));
} }
else else
{ {
if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol != 0) // Foreign Key if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol != 0) // Foreign Key
{ {
Temp2.Printf("(%d) - %s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName); Temp2.Printf(_T("(%d) - %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
Docu = AppendItem(Folder,Temp2,TreeIc_KEYF,TreeIc_KEYF,new DBTreeData(Temp1)); Docu = AppendItem(Folder,Temp2,TreeIc_KEYF,TreeIc_KEYF,new DBTreeData(Temp1));
Temp2.Printf(_("This Foreign Key comes from the following Table : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkTableName); Temp2.Printf(_("This Foreign Key comes from the following Table : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkTableName);
Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEYF")); Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(_T("KEYF")));
} }
else else
Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_COL,TreeIc_COL,new DBTreeData(Temp1)); Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_COL,TreeIc_COL,new DBTreeData(Temp1));
} }
SQL_TYPE.Printf("SQL_C_???? (%d)",((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType); SQL_TYPE.Printf(_T("SQL_C_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType);
DB_TYPE.Printf("DB_DATA_TYPE_???? (%d)",((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType); DB_TYPE.Printf(_T("DB_DATA_TYPE_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType);
for (i=1;i<=(pDoc->db_Br+i_Which)->i_SqlTyp[0];i++) for (i=1;i<=(pDoc->db_Br+i_Which)->i_SqlTyp[0];i++)
{ {
if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType == (pDoc->db_Br+i_Which)->i_SqlTyp[i]) if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType == (pDoc->db_Br+i_Which)->i_SqlTyp[i])
{ {
SQL_TYPE.Printf("%s(%d) ; ",(pDoc->db_Br+i_Which)->s_SqlTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_SqlTyp[i]); SQL_TYPE.Printf(_T("%s(%d) ; "),(pDoc->db_Br+i_Which)->s_SqlTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_SqlTyp[i]);
} }
} // for (i=1;i<=i_SqlTyp[0];i++) } // for (i=1;i<=i_SqlTyp[0];i++)
wxYield(); wxYield();
@@ -204,13 +205,13 @@ int DBTree::OnPopulate()
{ {
if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType == (pDoc->db_Br+i_Which)->i_dbTyp[i]) if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType == (pDoc->db_Br+i_Which)->i_dbTyp[i])
{ {
DB_TYPE.Printf("%s(%d)",(pDoc->db_Br+i_Which)->s_dbTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_dbTyp[i]); DB_TYPE.Printf(_T("%s(%d)"),(pDoc->db_Br+i_Which)->s_dbTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_dbTyp[i]);
} }
} // for (i=1;i<=i_dbTyp[0];i++) } // for (i=1;i<=i_dbTyp[0];i++)
wxYield(); wxYield();
SQL_TYPE += DB_TYPE; SQL_TYPE += DB_TYPE;
Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE));
SQL_TYPE.Printf("%10s %d,%d",((ct_BrowserDB->pTableInf+x)->pColInf+y)->typeName, SQL_TYPE.Printf(_T("%10s %d,%d"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->typeName,
((ct_BrowserDB->pTableInf+x)->pColInf+y)->columnSize,((ct_BrowserDB->pTableInf+x)->pColInf+y)->decimalDigits); ((ct_BrowserDB->pTableInf+x)->pColInf+y)->columnSize,((ct_BrowserDB->pTableInf+x)->pColInf+y)->decimalDigits);
Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE));
} // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) } // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++)
@@ -245,12 +246,12 @@ int DBTree::OnPopulate()
Expand(Root); Expand(Root);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
popupMenu1 = NULL; popupMenu1 = NULL;
popupMenu1 = new wxMenu(""); popupMenu1 = new wxMenu(_T(""));
popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h ")); popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h "));
popupMenu1->AppendSeparator(); popupMenu1->AppendSeparator();
popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes")); popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes"));
popupMenu2 = NULL; popupMenu2 = NULL;
popupMenu2 = new wxMenu(""); popupMenu2 = new wxMenu(_T(""));
popupMenu2->Append(DATA_SHOW, _("Show Data")); popupMenu2->Append(DATA_SHOW, _("Show Data"));
popupMenu2->AppendSeparator(); popupMenu2->AppendSeparator();
popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h ")); popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));
@@ -270,9 +271,9 @@ void DBTree::OnSelChanged(wxTreeEvent& WXUNUSED(event))
if ( item != NULL ) if ( item != NULL )
{ {
int Treffer = 0; int Treffer = 0;
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
if (Temp1.Contains("ODBC-")) if (Temp1.Contains(_T("ODBC-")))
{ {
Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN); Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN);
for (i=0;i<pDoc->i_DSN;i++) for (i=0;i<pDoc->i_DSN;i++)
@@ -316,16 +317,16 @@ void DBTree::OnRightSelect(wxTreeEvent& WXUNUSED(event))
if ( item != NULL ) if ( item != NULL )
{ {
int Treffer = 0; int Treffer = 0;
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (!wxStrcmp("Root",Temp1)) if (!wxStrcmp(_T("Root"),Temp1))
{ {
PopupMenu(popupMenu1,TreePos.x,TreePos.y); PopupMenu(popupMenu1,TreePos.x,TreePos.y);
Treffer++; Treffer++;
} }
for (i=0;i<ct_BrowserDB->numTables;i++) for (i=0;i<ct_BrowserDB->numTables;i++)
{ {
Temp2.Printf("TN(%s",(ct_BrowserDB->pTableInf+i)->tableName); Temp2.Printf(_T("TN(%s"),(ct_BrowserDB->pTableInf+i)->tableName);
if (!wxStrcmp(Temp2,Temp1)) if (!wxStrcmp(Temp2,Temp1))
{ {
PopupMenu(popupMenu2,TreePos.x,TreePos.y); PopupMenu(popupMenu2,TreePos.x,TreePos.y);
@@ -362,10 +363,10 @@ void DBTree::OnDBGrid(wxCommandEvent& event)
DBTreeData *item = (DBTreeData *)GetItemData(itemId); DBTreeData *item = (DBTreeData *)GetItemData(itemId);
if ( item != NULL ) if ( item != NULL )
{ {
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
for (i=0;i<ct_BrowserDB->numTables;i++) for (i=0;i<ct_BrowserDB->numTables;i++)
{ {
Temp2.Printf("TN(%s",(ct_BrowserDB->pTableInf+i)->tableName); Temp2.Printf(_T("TN(%s"),(ct_BrowserDB->pTableInf+i)->tableName);
if (!wxStrcmp(Temp2,Temp1)) if (!wxStrcmp(Temp2,Temp1))
{ {
// Temp0.Printf("(%d) Here is where a GridCtrl for >%s< will be called! ",i,(ct_BrowserDB->pTableInf+i)->tableName); // Temp0.Printf("(%d) Here is where a GridCtrl for >%s< will be called! ",i,(ct_BrowserDB->pTableInf+i)->tableName);
@@ -399,10 +400,10 @@ void DBTree::OnTableClass(wxCommandEvent& event)
DBTreeData *item = (DBTreeData *)GetItemData(itemId); DBTreeData *item = (DBTreeData *)GetItemData(itemId);
if ( item != NULL ) if ( item != NULL )
{ {
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
for (i=0;i<ct_BrowserDB->numTables;i++) for (i=0;i<ct_BrowserDB->numTables;i++)
{ {
Temp2.Printf("TN(%s",(ct_BrowserDB->pTableInf+i)->tableName); Temp2.Printf(_T("TN(%s"),(ct_BrowserDB->pTableInf+i)->tableName);
if (!wxStrcmp(Temp2,Temp1)) if (!wxStrcmp(Temp2,Temp1))
{ {
Temp0.Printf(_("(%d) Here is where a wxTable Class for >%s< will be made! "),i,(ct_BrowserDB->pTableInf+i)->tableName); Temp0.Printf(_("(%d) Here is where a wxTable Class for >%s< will be made! "),i,(ct_BrowserDB->pTableInf+i)->tableName);

View File

@@ -43,7 +43,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
ratio = (float)2.1; ratio = (float)2.1;
#endif #endif
SetBackgroundColour("wheat"); SetBackgroundColour(_T("wheat"));
pDoc = p_Doc; pDoc = p_Doc;
wxLayoutConstraints* layout; wxLayoutConstraints* layout;
SetAutoLayout(TRUE); SetAutoLayout(TRUE);
@@ -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, ""); m_UserName = new wxTextCtrl(this, -1, _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);
@@ -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, "", wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD); m_Password = new wxTextCtrl(this, -1, _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);
@@ -113,15 +113,15 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
m_OK->SetDefault(); m_OK->SetDefault();
m_UserName->SetFocus(); m_UserName->SetFocus();
s_User = ""; s_User = _T("");
s_Password = ""; s_Password = _T("");
Layout(); Layout();
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DlgUser::OnInit() void DlgUser::OnInit()
{ {
wxString Temp; Temp.Printf(">>> %s <<<",s_DSN.c_str()); wxString Temp; Temp.Printf(_T(">>> %s <<<"),s_DSN.c_str());
SetTitle(Temp); SetTitle(Temp);
m_UserName->SetLabel(s_User); m_UserName->SetLabel(s_User);
m_Password->SetLabel(s_Password); m_Password->SetLabel(s_Password);

View File

@@ -56,7 +56,7 @@ MainDoc::MainDoc()
p_PageArea = NULL; p_PageArea = NULL;
i_TabNr = 0; i_TabNr = 0;
i_PageNr = 0; i_PageNr = 0;
s_BColour = "WHEAT"; s_BColour = _T("WHEAT");
ft_Doc = new wxFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT)); ft_Doc = new wxFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
} }
@@ -96,7 +96,7 @@ bool MainDoc::OnNewDocument()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
bool MainDoc::OnInitView() bool MainDoc::OnInitView()
{ {
Sash = p_ProgramCfg->Read("/MainFrame/Sash", 200); Sash = p_ProgramCfg->Read(_T("/MainFrame/Sash"), 200);
// wxMessageBox("OnInitView() - Begin ","-I->MainDoc::OnInitView"); // wxMessageBox("OnInitView() - Begin ","-I->MainDoc::OnInitView");
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// create "workplace" window // create "workplace" window
@@ -109,9 +109,9 @@ bool MainDoc::OnInitView()
p_PgmCtrl->i_TabArt = 0; // 0 = Tab ; 1 = Page p_PgmCtrl->i_TabArt = 0; // 0 = Tab ; 1 = Page
p_PgmCtrl->i_ViewNr = p_TabArea->GetTabCount()-1; p_PgmCtrl->i_ViewNr = p_TabArea->GetTabCount()-1;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
wxBitmap *p_FolderClose = new wxBitmap("PgmCtrl"); //, wxBITMAP_TYPE_BMP_RESOURCE); // BJO20000115 wxBitmap *p_FolderClose = new wxBitmap(_T("PgmCtrl")); //, wxBITMAP_TYPE_BMP_RESOURCE); // BJO20000115
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_TabArea->AddTab(p_PgmCtrl,"PgmCtrl",p_FolderClose); p_TabArea->AddTab(p_PgmCtrl,_T("PgmCtrl"),p_FolderClose);
delete p_FolderClose; // Memory leak delete p_FolderClose; // Memory leak
p_FolderClose = NULL; p_FolderClose = NULL;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -129,7 +129,7 @@ bool MainDoc::OnInitView()
p_LogBook->SetActiveTarget(p_LogBook); p_LogBook->SetActiveTarget(p_LogBook);
p_LogBook->SetTimestamp( NULL ); p_LogBook->SetTimestamp( NULL );
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
p_PageArea->AddTab(p_LogWin,_("LogBook"), "what is this?" ); p_PageArea->AddTab(p_LogWin,_("LogBook"), _T("what is this?") );
i_TabNr = p_TabArea->GetTabCount()-1; // Add one when a new AddTab is done; i_TabNr = p_TabArea->GetTabCount()-1; // Add one when a new AddTab is done;
i_PageNr = p_PageArea->GetTabCount()-1; // Add one when a new AddTab is done; i_PageNr = p_PageArea->GetTabCount()-1; // Add one when a new AddTab is done;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -152,9 +152,9 @@ bool MainDoc::OnInitView()
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
bool MainDoc::OnInitODBC() bool MainDoc::OnInitODBC()
{ {
char Dsn[SQL_MAX_DSN_LENGTH + 1]; wxChar Dsn[SQL_MAX_DSN_LENGTH + 1];
char DsDesc[255]; // BJO20002501 instead of 512 wxChar DsDesc[255]; // BJO20002501 instead of 512
Temp0 = ""; Temp0 = _T("");
i_DSN = 0; // Counter i_DSN = 0; // Counter
int i = 0; int i = 0;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -176,15 +176,15 @@ bool MainDoc::OnInitODBC()
while(wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc))) while(wxDbGetDataSource(DbConnectInf.GetHenv(), Dsn, sizeof(Dsn), DsDesc, sizeof(DsDesc)))
{ {
i_DSN++; // How many Dsn have we ? i_DSN++; // How many Dsn have we ?
KeyString.Printf("%s%c%s",Dsn, sep, DsDesc); KeyString.Printf(_T("%s%c%s"),Dsn, sep, DsDesc);
s_SortDSNList.Add(Dsn); s_SortDSNList.Add(Dsn);
s_SortDsDescList.Add(KeyString); s_SortDsDescList.Add(KeyString);
} }
s_SortDSNList.Sort(); //BJO s_SortDSNList.Sort(); //BJO
s_SortDsDescList.Sort(); //BJO s_SortDsDescList.Sort(); //BJO
char ** s_SortDSN = s_SortDSNList.ListToArray(); //BJO wxChar ** s_SortDSN = s_SortDSNList.ListToArray(); //BJO
char ** s_SortDsDesc = s_SortDsDescList.ListToArray(); //BJO wxChar ** s_SortDsDesc = s_SortDsDescList.ListToArray(); //BJO
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Allocate n ODBC-DSN objects to hold the information // Allocate n ODBC-DSN objects to hold the information
p_DSN = new DSN[i_DSN]; //BJO p_DSN = new DSN[i_DSN]; //BJO
@@ -192,12 +192,12 @@ bool MainDoc::OnInitODBC()
{ {
KeyString = s_SortDsDesc[i]; KeyString = s_SortDsDesc[i];
KeyString = KeyString.AfterFirst(sep); KeyString = KeyString.AfterFirst(sep);
strcpy(s_SortDsDesc[i],KeyString.c_str()); wxStrcpy(s_SortDsDesc[i],KeyString.c_str());
(p_DSN+i)->Dsn = s_SortDSN[i]; (p_DSN+i)->Dsn = s_SortDSN[i];
(p_DSN+i)->Drv = s_SortDsDesc[i]; (p_DSN+i)->Drv = s_SortDsDesc[i];
(p_DSN+i)->Usr = ""; (p_DSN+i)->Usr = _T("");
(p_DSN+i)->Pas = ""; (p_DSN+i)->Pas = _T("");
Temp0.Printf("%02d) Dsn(%s) DsDesc(%s)",i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str()); Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str());
wxLogMessage(Temp0); wxLogMessage(Temp0);
} }
i = 0; i = 0;
@@ -221,9 +221,10 @@ bool MainDoc::OnInitODBC()
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
if (!i_DSN) if (!i_DSN)
{ {
wxMessageBox(_("No Dataset names found in ODBC!\n" \ wxString message = _("No Dataset names found in ODBC!\n");
" Program will exit!\n\n" \ message += _(" Program will exit!\n\n");
" Ciao"),"-E-> Fatal situation"); message += _(" Ciao");
wxMessageBox( message,_("-E-> Fatal situation"));
return FALSE; return FALSE;
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -240,13 +241,13 @@ bool MainDoc::OnChosenDSN(int Which)
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,""); 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," ? "); 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;
@@ -290,7 +291,7 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
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, ""); p_TabArea->AddTab(p_DBGrid, Table, _T(""));
p_DBGrid->i_ViewNr = p_TabArea->GetTabCount()-1; p_DBGrid->i_ViewNr = p_TabArea->GetTabCount()-1;
p_DBGrid->pDoc = this; p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br; p_DBGrid->db_Br = db_Br;
@@ -303,7 +304,7 @@ bool MainDoc::OnChosenTbl(int Tab,wxString Table)
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, ""); p_PageArea->AddTab(p_DBGrid, Table, _T(""));
p_DBGrid->i_ViewNr = p_PageArea->GetTabCount()-1; p_DBGrid->i_ViewNr = p_PageArea->GetTabCount()-1;
p_DBGrid->pDoc = this; p_DBGrid->pDoc = this;
p_DBGrid->db_Br = db_Br; p_DBGrid->db_Br = db_Br;

View File

@@ -43,9 +43,9 @@
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
//-- Global functions -------------------------------------------------------------------- //-- Global functions --------------------------------------------------------------------
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
static inline const char *bool2String(bool b) static inline const wxChar *bool2String(bool b)
{ {
return b ? "" : "not "; return b ? _T("") : _T("not ");
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
@@ -70,22 +70,23 @@ PgmCtrl::PgmCtrl(wxWindow *parent) : wxTreeCtrl(parent)
PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size, long style) PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size, long style)
: wxTreeCtrl(parent, id, pos, size, style) : wxTreeCtrl(parent, id, pos, size, style)
{ {
const int image_size = 16;
// Make an image list containing small icons // Make an image list containing small icons
p_imageListNormal = new wxImageList(16, 16, 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__) && defined(__WIN16__) #if defined(__WXMSW__) && defined(__WIN16__)
// This is required in 16-bit Windows mode only because we can't load a specific (16x16) // This is required in 16-bit Windows mode only because we can't load a specific (16x16)
// icon image, so it comes out stretched // icon image, so it comes out stretched
p_imageListNormal->Add(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE)); p_imageListNormal->Add(wxBitmap(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE)); p_imageListNormal->Add(wxBitmap(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Rescale(image_size, image_size)));
#else #else
p_imageListNormal->Add(wxICON(aLogo)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(aLogo)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DsnClosed)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnClosed)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DsnOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnOpen)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DocClosed)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DocClosed)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(DocOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DocOpen)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(FolderClosed)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(FolderClosed)).ConvertToImage().Rescale(image_size, image_size)));
p_imageListNormal->Add(wxICON(FolderOpen)); p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(FolderOpen)).ConvertToImage().Rescale(image_size, image_size)));
#endif #endif
SetImageList(p_imageListNormal); SetImageList(p_imageListNormal);
} }
@@ -109,26 +110,26 @@ int PgmCtrl::OnPopulate()
int i; int i;
double dTmp = 1234567.89; double dTmp = 1234567.89;
Temp0.Printf(_("%s Functions"),p_ProgramCfg->GetAppName().c_str()); Temp0.Printf(_("%s Functions"),p_ProgramCfg->GetAppName().c_str());
Root = AddRoot(Temp0,TreeIc_Logo,TreeIc_Logo, new TreeData("Root")); Root = AddRoot(Temp0,TreeIc_Logo,TreeIc_Logo, new TreeData(_T("Root")));
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
Folder = AppendItem(Root, _("Program settings") ,TreeIc_FolderClosed, TreeIc_FolderOpen, new TreeData("Settings")); Folder = AppendItem(Root, _("Program settings") ,TreeIc_FolderClosed, TreeIc_FolderOpen, new TreeData(_T("Settings")));
p_ProgramCfg->Read("/Local/langid",&Temp0); p_ProgramCfg->Read("/Local/language",&Temp2); p_ProgramCfg->Read(_T("/Local/langid"),&Temp0); p_ProgramCfg->Read(_T("/Local/language"),&Temp2);
Temp1.Printf(_("locale (%s) ; Language (%s) ; Number(%2.2f)"),Temp0.c_str(), Temp2.c_str(), dTmp); Temp0.Empty(); Temp2.Empty(); Temp1.Printf(_("locale (%s) ; Language (%s) ; Number(%2.2f)"),Temp0.c_str(), Temp2.c_str(), dTmp); Temp0.Empty(); Temp2.Empty();
Docu = AppendItem(Folder, Temp1,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData("Setting Language")); Docu = AppendItem(Folder, Temp1,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData(_T("Setting Language")));
p_ProgramCfg->Read("/Paths/Work",&Temp0); Temp1.Printf(_("Work Path : %s"),Temp0.c_str()); Temp0.Empty(); p_ProgramCfg->Read(_T("/Paths/Work"),&Temp0); Temp1.Printf(_("Work Path : %s"),Temp0.c_str()); Temp0.Empty();
Docu = AppendItem(Folder,Temp1,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData("Path Work")); Docu = AppendItem(Folder,Temp1,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData(_T("Path Work")));
Docu = AppendItem(Folder, _("Change the language to English") ,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData("Language English")); Docu = AppendItem(Folder, _("Change the language to English") ,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData(_T("Language English")));
Docu = AppendItem(Folder, _("Change the language to German") ,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData("Language German")); Docu = AppendItem(Folder, _("Change the language to German") ,TreeIc_DocClosed,TreeIc_DocOpen,new TreeData(_T("Language German")));
Docu = AppendItem(Folder, _("Delete all wxConfigBase Entry's"),TreeIc_DocClosed,TreeIc_DocOpen,new TreeData("wxConfigBase Delete")); Docu = AppendItem(Folder, _("Delete all wxConfigBase Entry's"),TreeIc_DocClosed,TreeIc_DocOpen,new TreeData(_T("wxConfigBase Delete")));
Folder = AppendItem(Root, "ODBC DSN",TreeIc_FolderClosed,TreeIc_FolderOpen,new TreeData("ODBC-DSN")); Folder = AppendItem(Root, _T("ODBC DSN"),TreeIc_FolderClosed,TreeIc_FolderOpen,new TreeData(_T("ODBC-DSN")));
for (i=0;i<pDoc->i_DSN;i++) for (i=0;i<pDoc->i_DSN;i++)
{ {
Temp0.Printf("ODBC-%s",(pDoc->p_DSN+i)->Dsn.c_str()); Temp0.Printf(_T("ODBC-%s"),(pDoc->p_DSN+i)->Dsn.c_str());
Docu = AppendItem(Folder,(pDoc->p_DSN+i)->Dsn ,TreeIc_DsnClosed,TreeIc_DsnOpen, new TreeData(Temp0)); Docu = AppendItem(Folder,(pDoc->p_DSN+i)->Dsn ,TreeIc_DsnClosed,TreeIc_DsnOpen, new TreeData(Temp0));
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
popupMenu1 = NULL; popupMenu1 = NULL;
popupMenu1 = new wxMenu(""); popupMenu1 = new wxMenu(_T(""));
popupMenu1->Append(PGMCTRL_ODBC_USER, _("Set Username and Password")); popupMenu1->Append(PGMCTRL_ODBC_USER, _("Set Username and Password"));
// popupMenu1->AppendSeparator(); // popupMenu1->AppendSeparator();
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -150,24 +151,24 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
if (item != NULL ) if (item != NULL )
{ {
int Treffer = 0; int Treffer = 0;
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (Temp1 == "Language English") if (Temp1 == _T("Language English"))
{ {
Temp0 = "std"; Temp0 = _T("std");
p_ProgramCfg->Write("/Local/langid",Temp0); p_ProgramCfg->Write(_T("/Local/langid"),Temp0);
Temp0 = _("-I-> After a programm restart, the language will be changed to English."); Temp0 = _("-I-> After a programm restart, the language will be changed to English.");
wxMessageBox(Temp0); wxMessageBox(Temp0);
} }
if (Temp1 == "Language German") if (Temp1 == _T("Language German"))
{ {
Temp0 = "de"; Temp0 = _T("de");
p_ProgramCfg->Write("/Local/langid",Temp0); p_ProgramCfg->Write(_T("/Local/langid"),Temp0);
Temp0 = _("-I-> After a programm restart, the language will be changed to German."); Temp0 = _("-I-> After a programm restart, the language will be changed to German.");
wxMessageBox(Temp0); wxMessageBox(Temp0);
} }
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (Temp1 == "wxConfigBase Delete") if (Temp1 == _T("wxConfigBase Delete"))
{ {
if (p_ProgramCfg->DeleteAll()) // Default Diretory for wxFileSelector if (p_ProgramCfg->DeleteAll()) // Default Diretory for wxFileSelector
Temp0 = _("-I-> wxConfigBase.p_ProgramCfg->DeleteAll() was succesfull."); Temp0 = _("-I-> wxConfigBase.p_ProgramCfg->DeleteAll() was succesfull.");
@@ -177,7 +178,7 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
Treffer++; Treffer++;
} }
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (Temp1.Contains("ODBC-")) if (Temp1.Contains(_T("ODBC-")))
{ {
Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN); Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN);
for (i=0;i<pDoc->i_DSN;i++) for (i=0;i<pDoc->i_DSN;i++)
@@ -193,16 +194,15 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
if (Treffer == 0) if (Treffer == 0)
{ {
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
Temp0.Printf(_("Item '%s': %sselected, %sexpanded, %sbold," Temp0.Printf(_("Item '%s': %sselected, %sexpanded, %sbold, %u children (%u immediately under this item)."),
"%u children (%u immediately under this item)."),
item->m_desc.c_str(), item->m_desc.c_str(),
bool2String(IsSelected(itemId)), bool2String(IsSelected(itemId)),
bool2String(IsExpanded(itemId)), bool2String(IsExpanded(itemId)),
bool2String(IsBold(itemId)), bool2String(IsBold(itemId)),
GetChildrenCount(itemId), GetChildrenCount(itemId),
GetChildrenCount(itemId)); GetChildrenCount(itemId));
LogBuf.Printf("-I-> PgmCtrl::OnSelChanged - %s",Temp0.c_str()); LogBuf.Printf(_T("-I-> PgmCtrl::OnSelChanged - %s"),Temp0.c_str());
wxLogMessage( "%s", LogBuf.c_str() ); wxLogMessage( _T("%s"), LogBuf.c_str() );
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
} }
} }
@@ -220,9 +220,9 @@ void PgmCtrl::OnRightSelect(wxTreeEvent& WXUNUSED(event))
if ( item != NULL ) if ( item != NULL )
{ {
int Treffer = 0; int Treffer = 0;
Temp1.Printf("%s",item->m_desc.c_str()); Temp1.Printf(_T("%s"),item->m_desc.c_str());
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
if (Temp1.Contains("ODBC-")) if (Temp1.Contains(_T("ODBC-")))
{ {
Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN); Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN);
for (i=0;i<pDoc->i_DSN;i++) for (i=0;i<pDoc->i_DSN;i++)
@@ -267,7 +267,7 @@ void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
// wxMessageBox(SaveDSN); // wxMessageBox(SaveDSN);
int i; int i;
//-------------------------------------------- //--------------------------------------------
DlgUser *p_Dlg = new DlgUser(this,pDoc,""); DlgUser *p_Dlg = new DlgUser(this,pDoc,_T(""));
//------------------------------------------- //-------------------------------------------
for (i=0;i<pDoc->i_DSN;i++) for (i=0;i<pDoc->i_DSN;i++)
{ {

View File

@@ -506,7 +506,7 @@ wxFont wxTabbedWindow::GetLabelingFont()
{ {
wxFont font; wxFont font;
#ifdef __WINDOWS__ #ifdef __WINDOWS__
font.SetFaceName("MS Sans Serif"); font.SetFaceName(_T("MS Sans Serif"));
#else #else
font.SetFamily( wxSWISS ); font.SetFamily( wxSWISS );
#endif #endif
@@ -736,7 +736,7 @@ wxFont wxPagedWindow::GetLabelingFont()
wxFont font; wxFont font;
#ifdef __WINDOWS__ #ifdef __WINDOWS__
font.SetFaceName("Comic Sans MS"); font.SetFaceName(_T("Comic Sans MS"));
#else #else
font.SetFamily( wxSWISS ); font.SetFamily( wxSWISS );
#endif #endif

View File

@@ -102,7 +102,7 @@ public:
virtual void AddTab( wxWindow* pContent, // contained window virtual void AddTab( wxWindow* pContent, // contained window
wxString tabText, // tab label wxString tabText, // tab label
wxString imageFileName = "", // if "", only text label is displayed wxString imageFileName = _T(""), // if "", only text label is displayed
wxBitmapType imageType = wxBITMAP_TYPE_BMP ); wxBitmapType imageType = wxBITMAP_TYPE_BMP );
// NOTE:: if this AddTab(..) overload is called, the // NOTE:: if this AddTab(..) overload is called, the