logo       

SVN Commit by dpage: r4744 - in trunk/pgadmin3/src: ctl include/ctl: msg#00247

Subject: SVN Commit by dpage: r4744 - in trunk/pgadmin3/src: ctl include/ctl
Author: dpage
Date: 2005-11-16 21:57:28 +0000 (Wed, 16 Nov 2005)
New Revision: 4744

Modified:
   trunk/pgadmin3/src/ctl/ctlSQLBox.cpp
   trunk/pgadmin3/src/include/ctl/ctlSQLBox.h
Log:
Swap between Find/Replace dialogues correctly on non-windows platforms 
properly. Looks like we might have to live with slightly odd behaviour on 
Windows due to the design of wx :-(


Modified: trunk/pgadmin3/src/ctl/ctlSQLBox.cpp
===================================================================
--- trunk/pgadmin3/src/ctl/ctlSQLBox.cpp        2005-11-12 19:28:35 UTC (rev 
4743)
+++ trunk/pgadmin3/src/ctl/ctlSQLBox.cpp        2005-11-16 21:57:28 UTC (rev 
4744)
@@ -295,13 +295,18 @@
 ctlSQLBox::ctlSQLBox()
 {
     m_dlgFind=0;
+#ifndef __WXMSW__
+       findDlgLast = false;
+#endif
 }
 
 
 ctlSQLBox::ctlSQLBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, 
const wxSize& size, long style)
 {
     m_dlgFind=0;
-    
+#ifndef __WXMSW__
+    findDlgLast = false;
+#endif
     Create(parent, id, pos, size, style);
 }
 
@@ -369,11 +374,21 @@
 
 void ctlSQLBox::OnFind(wxCommandEvent& ev)
 {
+#ifndef __WXMSW__
+       if (m_dlgFind && !findDlgLast)
+       {
+               m_dlgFind->Destroy();
+               m_dlgFind = NULL;
+       }
+#endif
+       
     if (!m_dlgFind)
     {
         m_dlgFind = new wxFindReplaceDialog(this, &m_findData, _("Find text"), 
0);
-
         m_dlgFind->Show(true);
+#ifndef __WXMSW__
+               findDlgLast = true;
+#endif
     }
     else
         m_dlgFind->SetFocus();
@@ -382,11 +397,21 @@
 
 void ctlSQLBox::OnReplace(wxCommandEvent& ev)
 {
+#ifndef __WXMSW__
+       if (m_dlgFind && findDlgLast)
+       {
+               m_dlgFind->Destroy();
+               m_dlgFind = NULL;
+       }
+#endif
+       
     if (!m_dlgFind)
     {
         m_dlgFind = new wxFindReplaceDialog(this, &m_findData, _("Find text"), 
wxFR_REPLACEDIALOG);
-
         m_dlgFind->Show(true);
+#ifndef __WXMSW__
+               findDlgLast = false;
+#endif
     }
     else
         m_dlgFind->SetFocus();

Modified: trunk/pgadmin3/src/include/ctl/ctlSQLBox.h
===================================================================
--- trunk/pgadmin3/src/include/ctl/ctlSQLBox.h  2005-11-12 19:28:35 UTC (rev 
4743)
+++ trunk/pgadmin3/src/include/ctl/ctlSQLBox.h  2005-11-16 21:57:28 UTC (rev 
4744)
@@ -29,8 +29,6 @@
     ~ctlSQLBox();
 
     void Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = 
wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
-    wxFindReplaceData m_findData;
-    wxFindReplaceDialog* m_dlgFind;
 
     void OnKeyDown(wxKeyEvent& event);
     void OnFind(wxCommandEvent& event);
@@ -39,6 +37,14 @@
     
     DECLARE_DYNAMIC_CLASS(ctlSQLBox)
     DECLARE_EVENT_TABLE()
+               
+private:
+       wxFindReplaceData m_findData;
+    wxFindReplaceDialog* m_dlgFind;
+#ifndef __WXMSW__
+       bool findDlgLast;
+#endif
+               
 };
 
 


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe