browsedb.cpp dbtree.cpp dlguser.cpp dlguser.h pgmctrl.cpp
de/dbbrowse.mo de/dbbrowse.po git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -121,8 +121,8 @@ bool BrowserDB::OnStartDB(int Quite)
|
||||
//---------------------------------------------------------------------------------------
|
||||
// Connect to datasource
|
||||
//---------------------------------------------------------------------------------------
|
||||
DlgUser *p_Dlg = new DlgUser(pDoc->p_MainFrame, "Username and Password");
|
||||
p_Dlg->pDoc = pDoc;
|
||||
DlgUser *p_Dlg = new DlgUser(pDoc->p_MainFrame,pDoc,"");
|
||||
// p_Dlg->pDoc = pDoc;
|
||||
p_Dlg->s_DSN = ODBCSource;
|
||||
p_Dlg->s_User = UserName;
|
||||
p_Dlg->s_Password = Password;
|
||||
|
@@ -107,7 +107,7 @@ DBTree::~DBTree()
|
||||
int DBTree::OnPopulate()
|
||||
{
|
||||
wxTreeItemId Root, Folder, Docu, Funkt;
|
||||
int i,x,y, TableType;
|
||||
int i,x,y,z=0, TableType;
|
||||
wxString SQL_TYPE, DB_TYPE;
|
||||
SetFont(* pDoc->ft_Doc);
|
||||
//---------------------------------------------------------------------------------------
|
||||
@@ -154,7 +154,10 @@ int DBTree::OnPopulate()
|
||||
if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol != 0) // Primary Key
|
||||
{
|
||||
Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1));
|
||||
Temp2.Printf(_("This Key is used in the following Tables : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName);
|
||||
Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
|
||||
if (Temp2 == "")
|
||||
Temp2 = _("None");
|
||||
Temp2.Printf(_("This Key is used in the following Tables : %s"),Temp2);
|
||||
Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEY"));
|
||||
}
|
||||
else
|
||||
@@ -193,6 +196,12 @@ int DBTree::OnPopulate()
|
||||
} // if ((ct_BrowserDB->pTableInf+x)->pColInf)
|
||||
else
|
||||
Folder = AppendItem(Root,Temp0,TreeIc_FolderClosed,TreeIc_FolderOpen, new DBTreeData(Temp1));
|
||||
z++;
|
||||
if (z % 10 == 0)
|
||||
{
|
||||
Temp0.Printf(_("-I-> DBTree::OnPopulate(%s) - Table %6d has been read."),(ct_BrowserDB->pTableInf+x)->tableName,z);
|
||||
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
|
||||
}
|
||||
} // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE" or VIEW)
|
||||
// else
|
||||
// wxLogMessage(_("\n-I-> if ! TABLE or VIEW >%s<"),(ct_BrowserDB->pTableInf+x)->tableType);
|
||||
@@ -201,6 +210,8 @@ int DBTree::OnPopulate()
|
||||
else
|
||||
wxLogMessage(_("\n-E-> DBTree::OnPopulate() : Invalid Catalog Pointer : Failed"));
|
||||
wxEndBusyCursor();
|
||||
Temp0.Printf(_("-I-> DBTree::OnPopulate(%s) - Tables %6d have been read."),(ct_BrowserDB->pTableInf+x)->tableName,z);
|
||||
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
|
||||
} // if((pDoc->db_Br+i_Which)->Initialize(FALSE))
|
||||
else
|
||||
{
|
||||
|
Binary file not shown.
@@ -194,6 +194,10 @@ msgstr "Zeit"
|
||||
msgid "OK"
|
||||
msgstr ""
|
||||
|
||||
#: ../BrowserDB.cpp:47
|
||||
msgid "None"
|
||||
msgstr "Keine"
|
||||
|
||||
#: ../BrowserDB.cpp:47
|
||||
msgid "Message"
|
||||
msgstr "Nachricht"
|
||||
|
@@ -30,15 +30,17 @@
|
||||
//----------------------------------------------------------------------------------------
|
||||
#include "std.h"
|
||||
//----------------------------------------------------------------------------------------
|
||||
DlgUser::DlgUser(wxWindow *parent, const wxString& title) :
|
||||
DlgUser::DlgUser(wxWindow *parent, mjDoc *p_Doc, const wxString& title) :
|
||||
wxDialog(parent, ID_DIALOG_DSN, title)
|
||||
{
|
||||
int chSize; // Height of Font * 1.4 = Height of wxTextCtrl
|
||||
SetBackgroundColour("wheat");
|
||||
|
||||
pDoc = p_Doc;
|
||||
wxLayoutConstraints* layout;
|
||||
SetAutoLayout(TRUE);
|
||||
|
||||
m_Label1 = new wxStaticText(this, -1, _("User ID:"));
|
||||
m_Label1->SetFont(* pDoc->ft_Doc);
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(this, wxLeft, 10);
|
||||
layout->top.SameAs(this, wxTop, 10);
|
||||
@@ -47,16 +49,18 @@ DlgUser::DlgUser(wxWindow *parent, const wxString& title) :
|
||||
m_Label1->SetConstraints(layout);
|
||||
|
||||
m_UserName = new wxTextCtrl(this, -1, "");
|
||||
m_UserName->SetFont(* pDoc->ft_Doc);
|
||||
chSize = m_UserName->GetCharHeight()*1.4;
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(m_Label1, wxRight, 10);
|
||||
// layout->top.SameAs(m_Label1, wxTop);
|
||||
layout->centreY.SameAs(m_Label1,wxCentreY);
|
||||
layout->width.Absolute(200);
|
||||
layout->height.AsIs();
|
||||
layout->height.Absolute(chSize);
|
||||
m_UserName->SetConstraints(layout);
|
||||
|
||||
|
||||
m_Label2 = new wxStaticText(this, -1, _("Password:"));
|
||||
m_Label2->SetFont(* pDoc->ft_Doc);
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(m_Label1, wxLeft);
|
||||
layout->top.SameAs(m_Label1, wxBottom, 10);
|
||||
@@ -65,15 +69,16 @@ DlgUser::DlgUser(wxWindow *parent, const wxString& title) :
|
||||
m_Label2->SetConstraints(layout);
|
||||
|
||||
m_Password = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
|
||||
m_Password->SetFont(* pDoc->ft_Doc);
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(m_UserName, wxLeft);
|
||||
layout->width.SameAs(m_UserName, wxWidth);
|
||||
// layout->top.SameAs(m_Label2, wxTop);
|
||||
layout->centreY.SameAs(m_Label2,wxCentreY);
|
||||
layout->height.AsIs();
|
||||
layout->height.Absolute(chSize);
|
||||
m_Password->SetConstraints(layout);
|
||||
|
||||
m_OK = new wxButton(this, wxID_OK, _("OK"));
|
||||
m_OK->SetFont(* pDoc->ft_Doc);
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(this, wxLeft, 10);
|
||||
layout->top.SameAs(m_Label2, wxBottom,10);
|
||||
@@ -82,6 +87,7 @@ DlgUser::DlgUser(wxWindow *parent, const wxString& title) :
|
||||
m_OK->SetConstraints(layout);
|
||||
|
||||
m_Cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||
m_Cancel->SetFont(* pDoc->ft_Doc);
|
||||
layout = new wxLayoutConstraints;
|
||||
layout->left.SameAs(m_OK, wxRight, 10);
|
||||
layout->top.SameAs(m_OK, wxTop);
|
||||
@@ -103,9 +109,6 @@ void DlgUser::OnInit()
|
||||
SetTitle(Temp);
|
||||
m_UserName->SetLabel(s_User);
|
||||
m_Password->SetLabel(s_Password);
|
||||
m_Label1->SetFont(* pDoc->ft_Doc); m_Label2->SetFont(* pDoc->ft_Doc);
|
||||
m_UserName->SetFont(* pDoc->ft_Doc); m_Password->SetFont(* pDoc->ft_Doc);
|
||||
m_OK->SetFont(* pDoc->ft_Doc); m_Cancel->SetFont(* pDoc->ft_Doc);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
BEGIN_EVENT_TABLE(DlgUser, wxDialog)
|
||||
|
@@ -27,7 +27,7 @@ class DlgUser: public wxDialog
|
||||
wxButton *m_OK, *m_Cancel;
|
||||
mjDoc *pDoc;
|
||||
//---------------------------------------------------------------------------------------
|
||||
DlgUser(wxWindow *parent, const wxString& title);
|
||||
DlgUser(wxWindow *parent,mjDoc *pDoc, const wxString& title);
|
||||
void OnInit();
|
||||
void OnOk(wxCommandEvent& event);
|
||||
//---------------------------------------------------------------------------------------
|
||||
|
@@ -253,13 +253,14 @@ void PgmCtrl::OnUserPassword()
|
||||
{
|
||||
// wxMessageBox(SaveDSN);
|
||||
int i;
|
||||
//-------------------------------------------
|
||||
DlgUser *p_Dlg = new DlgUser(this, "Username and Password");
|
||||
//--------------------------------------------
|
||||
DlgUser *p_Dlg = new DlgUser(this,pDoc,"");
|
||||
//-------------------------------------------
|
||||
for (i=0;i<pDoc->i_DSN;i++)
|
||||
{
|
||||
if (SaveDSN == (pDoc->p_DSN+i)->Dsn)
|
||||
{
|
||||
p_Dlg->pDoc = pDoc;
|
||||
p_Dlg->s_DSN = (pDoc->p_DSN+i)->Dsn;
|
||||
p_Dlg->s_User = (pDoc->p_DSN+i)->Usr;
|
||||
p_Dlg->s_Password = (pDoc->p_DSN+i)->Pas;
|
||||
|
Reference in New Issue
Block a user