]> git.saurik.com Git - wxWidgets.git/commitdiff
Handle Cancel button in userdlg
authorBart A.M. Jourquin <bart.jourquin@fucam.ac.be>
Mon, 31 Jan 2000 14:22:30 +0000 (14:22 +0000)
committerBart A.M. Jourquin <bart.jourquin@fucam.ac.be>
Mon, 31 Jan 2000 14:22:30 +0000 (14:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5750 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

demos/dbbrowse/browsedb.cpp
demos/dbbrowse/dbtree.cpp
demos/dbbrowse/doc.cpp
demos/dbbrowse/tabpgwin.cpp

index 8b7f648df3906d5302387825f106fb43b5d2daf1..11531afeb59bddc1eb8f32052cebe08381c0e0e1 100644 (file)
@@ -208,23 +208,24 @@ bool BrowserDB::OnStartDB(int Quite)
   //---------------------------------------------------------------------------
   // Connect to datasource
   //---------------------------
-  DlgUser p_Dlg(pDoc->p_MainFrame, "Username and Password");
-  p_Dlg.s_DSN      = ODBCSource;
-  p_Dlg.s_User     = UserName;
-  p_Dlg.s_Password = Password;
-  p_Dlg.OnInit();
-  p_Dlg.Fit();
+  DlgUser *p_Dlg = new DlgUser(pDoc->p_MainFrame, "Username and Password");
+  p_Dlg->s_DSN      = ODBCSource;
+  p_Dlg->s_User     = UserName;
+  p_Dlg->s_Password = Password;
+  p_Dlg->OnInit();
+  p_Dlg->Fit();
 
   bool OK = FALSE;
-  if (p_Dlg.ShowModal() == wxID_OK)
+  if (p_Dlg->ShowModal() == wxID_OK)
     {
-      (pDoc->p_DSN+i_Which)->Usr = p_Dlg.s_User;
-      (pDoc->p_DSN+i_Which)->Pas = p_Dlg.s_Password;
-      UserName  = p_Dlg.s_User;
-      Password  = p_Dlg.s_Password;
+      (pDoc->p_DSN+i_Which)->Usr = p_Dlg->s_User;
+      (pDoc->p_DSN+i_Which)->Pas = p_Dlg->s_Password;
+      UserName  = p_Dlg->s_User;
+      Password  = p_Dlg->s_Password;
       OK = TRUE;
     }
-  p_Dlg.Destroy();
+  //p_Dlg.Destroy();
+  delete p_Dlg;
 
   if (OK)
     {
index 0bd0fb0c1126dc5273cc69f90fb1c2745846b72a..5b4b15b6b6e16703570d8fad97583210b4284f1f 100644 (file)
@@ -189,6 +189,7 @@ int  DBTree::OnPopulate()
     }       // if((pDoc->db_Br+i_Which)->Initialize(FALSE))
   else
     {
+      return 0;
       wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed"));
     }
   //----------------------------------------------------------------------------------------------------------------------------
index 873261e884eab4d585d1cbef89b5ddf7f4e384a8..10b7d1d31162601b37c7f0838a23d18a500ee650 100644 (file)
@@ -80,8 +80,10 @@ mjDoc::~mjDoc()
 bool mjDoc::OnNewDocument()
 {
   //-------------------------------------------------------------------
-  if (!OnInitView())                 // LogBook is now activ
+  if (!OnInitView())
+    {
     return FALSE;
+    }
   p_PgmCtrl->OnPopulate();
   //-------------------------------------------------------------------
   return TRUE;
index f71d8640734fa42bdbfb1ffe0e72d5793148d03d..f2728ed917ecefb480133e1a766b11222dbde0ec 100644 (file)
@@ -398,7 +398,7 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
       long x,w,h;
       
       // set select default font of the window into it's device context
-      dc.SetFont( GetLabelingFont() );
+      //dc.SetFont( GetLabelingFont() );
       
       dc.SetTextBackground( GetBackgroundColour() );
       
@@ -525,7 +525,7 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
       long w,h;
       
       // set select default font of the window into it's device context
-  dc.SetFont( GetLabelingFont() );
+  //dc.SetFont( GetLabelingFont() );
   
   dc.GetTextExtent(tab.mText, &w, &h );
   
@@ -769,7 +769,7 @@ void wxPaggedWindow::DrawPaperBar( twTabInfo& tab, int x, int y,
   long w,h;
   
   // set select default font of the window into it's device context
-  dc.SetFont( GetLabelingFont() );
+  //dc.SetFont( GetLabelingFont() );
   
   dc.SetTextBackground( brush.GetColour() );
   
@@ -999,7 +999,7 @@ void wxPaggedWindow::RecalcLayout(bool andRepaint)
       long w,h;
       
       // set select default font of the window into it's device context
-      dc.SetFont( GetLabelingFont() );
+      //dc.SetFont( GetLabelingFont() );
       dc.GetTextExtent(tab.mText, &w, &h );
       
       tab.mDims.x = w + tab.ImageToTxtGap(mImageTextGap) +