]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/pgmctrl.cpp
fix for assertion failure
[wxWidgets.git] / demos / dbbrowse / pgmctrl.cpp
index 4576a7f72a23c939afadf5e51d11f0dee548934d..6006503a5afd1771d788f6fc4d6759da993eed2e 100644 (file)
@@ -88,6 +88,7 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
 PgmCtrl::~PgmCtrl()
 {
  delete p_imageListNormal;
+ delete popupMenu1;  
 }
 //----------------------------------------------------------------------------------------
 #undef TREE_EVENT_HANDLER
@@ -129,7 +130,7 @@ int  PgmCtrl::OnPopulate()
   return 0;
 }
 //----------------------------------------------------------------------------------------
-void PgmCtrl::OnSelChanged(wxTreeEvent& WXUNUSED(event))
+void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
 {
  int i;
  Temp0.Empty();   Temp1.Empty();
@@ -242,24 +243,25 @@ void PgmCtrl::OnRightSelect(wxTreeEvent& WXUNUSED(event))
   }
   //--------------------------------------------------------------------------------------
  }
-}
+} // void PgmCtrl::OnRightSelect(wxTreeEvent& WXUNUSED(event))
 //----------------------------------------------------------------------------------------
 void PgmCtrl::OnMouseMove(wxMouseEvent &event)
 {
  TreePos = event.GetPosition();
 }
 //----------------------------------------------------------------------------------------
-void PgmCtrl::OnUserPassword()
+void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
 {
  // wxMessageBox(SaveDSN);
- int i, rc=0;
- //-------------------------------------------
- DlgUser *p_Dlg = new DlgUser(this, "Username and Password");
+ int i;
+ //--------------------------------------------
+ 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;