Thread: Buglets in dlgFunction

Buglets in dlgFunction

From
"Dave Page"
Date:
Hi Guillaume

I found a couple of small bugs in the new layout code for dlgFunction:

- The Privileges (and SQL) panes don't size themselves properly when
viewing an existing function, until the dialogue is manually resized
- The privilege checkboxes are touching the role combo box above.

I've attached a screenshot for your amusement :-)

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Attachment

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> [...]
> I found a couple of small bugs in the new layout code for dlgFunction:
>
> - The Privileges (and SQL) panes don't size themselves properly when
> viewing an existing function, until the dialogue is manually resized
> - The privilege checkboxes are touching the role combo box above.
>
> I've attached a screenshot for your amusement :-)
>

I finally found some time to work on this... You'll find a patch
attached. It seems to work nice on Mac and Linux. Can you check on your
Mac ? Thanks.

I would love this to be the solution. This hack would allow us to get
rid of the 350 constant in the OnSize method.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h    (révision 7488)
+++ pgadmin/include/dlg/dlgProperty.h    (copie de travail)
@@ -183,7 +183,7 @@
     virtual wxString GetHelpPage() const;
     virtual int Go(bool modal=false);
     bool DisablePrivilege(const wxString &priv);
-    void SetPrivilegesSize(int width, int height);
+    void SetPrivilegesLayout();

 private:

Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp    (révision 7488)
+++ pgadmin/dlg/dlgProperty.cpp    (copie de travail)
@@ -208,10 +208,9 @@
 }


-void dlgSecurityProperty::SetPrivilegesSize(int width, int height)
+void dlgSecurityProperty::SetPrivilegesLayout()
 {
-    securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        width, height);
+    securityPage->lbPrivileges->GetParent()->Layout();
 }


@@ -1516,7 +1515,10 @@
 int dlgSecurityProperty::Go(bool modal)
 {
     if (securityPage)
+    {
         securityPage->SetConnection(connection);
+        //securityPage->Layout();
+    }

     return dlgProperty::Go(modal);
 }
Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (révision 7488)
+++ pgadmin/dlg/dlgFunction.cpp    (copie de travail)
@@ -367,11 +367,9 @@
 #ifdef __WXMAC__
 void dlgFunction::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
+    lstArguments->GetParent()->Layout();
+    lstVariables->GetParent()->Layout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTable.cpp    (copie de travail)
@@ -931,7 +931,7 @@

     lstColumns->SetSize(wxDefaultCoord, wxDefaultCoord,
         ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 150);
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();

     if (GetAutoLayout())
     {
Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (révision 7488)
+++ pgadmin/dlg/dlgPackage.cpp    (copie de travail)
@@ -104,7 +104,7 @@
 #ifdef __WXMAC__
 void dlgPackage::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTablespace.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgTablespace::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (révision 7488)
+++ pgadmin/dlg/dlgDatabase.cpp    (copie de travail)
@@ -244,7 +244,7 @@
 #ifdef __WXMAC__
 void dlgDatabase::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
         ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
     if (GetAutoLayout())
Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSequence.cpp    (copie de travail)
@@ -140,7 +140,7 @@
 #ifdef __WXMAC__
 void dlgSequence::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (révision 7488)
+++ pgadmin/dlg/dlgView.cpp    (copie de travail)
@@ -95,7 +95,7 @@
 #ifdef __WXMAC__
 void dlgView::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSchema.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgSchema::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Thu, Oct 2, 2008 at 12:05 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Dave Page a écrit :
>> [...]
>> I found a couple of small bugs in the new layout code for dlgFunction:
>>
>> - The Privileges (and SQL) panes don't size themselves properly when
>> viewing an existing function, until the dialogue is manually resized
>> - The privilege checkboxes are touching the role combo box above.
>>
>> I've attached a screenshot for your amusement :-)
>>
>
> I finally found some time to work on this... You'll find a patch
> attached. It seems to work nice on Mac and Linux. Can you check on your
> Mac ? Thanks.
>
> I would love this to be the solution. This hack would allow us to get
> rid of the 350 constant in the OnSize method.

Testing dlgFunction:

The SQL pane seems OK now, but the privileges pane opens with the
controls at a minimal size on the parent pane, and the listview still
has the non-shrinking bug :-(. I've attached screenshots.

Testing dlgTable, dlgSequence:

(create mode) SQL pane is fine. Initial size of the privileges
controls are fine, just the listview bug remaining. (edit mode)
pgAdmin crashes.

Testing dlgDatabase:

SQL pane is fine. Initial size of the privileges controls are fine,
just the listview bug remaining.

Testing dlgPackage:

SQL pane is fine. Initial sizing of the privilege controls is broken.
The listview bug is not present.

Testing dlgTablespace, dlgSchema, dlgView:

Work perfectly :-)

So it seems like all bugs are fixed somewhere, just not on all dialogues!

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Attachment

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Thu, Oct 2, 2008 at 12:05 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Dave Page a écrit :
>>> [...]
>>> I found a couple of small bugs in the new layout code for dlgFunction:
>>>
>>> - The Privileges (and SQL) panes don't size themselves properly when
>>> viewing an existing function, until the dialogue is manually resized
>>> - The privilege checkboxes are touching the role combo box above.
>>>
>>> I've attached a screenshot for your amusement :-)
>>>
>> I finally found some time to work on this... You'll find a patch
>> attached. It seems to work nice on Mac and Linux. Can you check on your
>> Mac ? Thanks.
>>
>> I would love this to be the solution. This hack would allow us to get
>> rid of the 350 constant in the OnSize method.
>
> Testing dlgFunction:
>
> The SQL pane seems OK now, but the privileges pane opens with the
> controls at a minimal size on the parent pane, and the listview still
> has the non-shrinking bug :-(. I've attached screenshots.
>
> Testing dlgTable, dlgSequence:
>
> (create mode) SQL pane is fine. Initial size of the privileges
> controls are fine, just the listview bug remaining. (edit mode)
> pgAdmin crashes.
>
> Testing dlgDatabase:
>
> SQL pane is fine. Initial size of the privileges controls are fine,
> just the listview bug remaining.
>
> Testing dlgPackage:
>
> SQL pane is fine. Initial sizing of the privilege controls is broken.
> The listview bug is not present.
>
> Testing dlgTablespace, dlgSchema, dlgView:
>
> Work perfectly :-)
>
> So it seems like all bugs are fixed somewhere, just not on all dialogues!
>

It seems I finally get something working. But not yet for dlgFunction.
Can you take a look at it? I just want to know if I haven't break other
things. If it works, I will commit this patch and work on the
dlgFunction.cpp file.

Thanks.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/include/dlg/dlgView.h
===================================================================
--- pgadmin/include/dlg/dlgView.h    (révision 7488)
+++ pgadmin/include/dlg/dlgView.h    (copie de travail)
@@ -40,10 +40,6 @@
     pgView *view;
     wxString oldDefinition;

-#ifdef __WXMAC__
-    void OnChangeSize(wxSizeEvent &ev);
-#endif
-
     DECLARE_EVENT_TABLE()
 };

Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h    (révision 7488)
+++ pgadmin/include/dlg/dlgProperty.h    (copie de travail)
@@ -183,14 +183,14 @@
     virtual wxString GetHelpPage() const;
     virtual int Go(bool modal=false);
     bool DisablePrivilege(const wxString &priv);
-    void SetPrivilegesSize(int width, int height);
+    void SetPrivilegesLayout();

-private:
-
 #ifdef __WXMAC__
     void OnChangeSize(wxSizeEvent &ev);
 #endif

+private:
+
     void OnAddPriv(wxCommandEvent& ev);
     void OnDelPriv(wxCommandEvent& ev);
     bool securityChanged;
Index: pgadmin/agent/dlgJob.cpp
===================================================================
--- pgadmin/agent/dlgJob.cpp    (révision 7488)
+++ pgadmin/agent/dlgJob.cpp    (copie de travail)
@@ -119,6 +119,8 @@

 int dlgJob::Go(bool modal)
 {
+    int returncode;
+
     pgSet *jcl=connection->ExecuteSet(wxT("SELECT jclname FROM pgagent.pga_jobclass"));
     if (jcl)
     {
@@ -214,7 +216,14 @@
         btnChangeSchedule->Hide();
     }

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp    (révision 7488)
+++ pgadmin/dlg/dlgProperty.cpp    (copie de travail)
@@ -208,10 +208,9 @@
 }


-void dlgSecurityProperty::SetPrivilegesSize(int width, int height)
+void dlgSecurityProperty::SetPrivilegesLayout()
 {
-    securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        width, height);
+    securityPage->lbPrivileges->GetParent()->Layout();
 }


@@ -1504,7 +1503,7 @@
 void dlgSecurityProperty::OnChangeSize(wxSizeEvent &ev)
 {
     securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
     if (GetAutoLayout())
     {
         Layout();
@@ -1516,7 +1515,10 @@
 int dlgSecurityProperty::Go(bool modal)
 {
     if (securityPage)
+    {
         securityPage->SetConnection(connection);
+        //securityPage->Layout();
+    }

     return dlgProperty::Go(modal);
 }
Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (révision 7488)
+++ pgadmin/dlg/dlgFunction.cpp    (copie de travail)
@@ -153,6 +153,8 @@

 int dlgFunction::Go(bool modal)
 {
+    int returncode;
+
     if (function)
     {
         rdbIn->Disable();
@@ -361,21 +363,25 @@
     OnSelChangeLanguage(event);

     SetupVarEditor(1);
-    return dlgSecurityProperty::Go(modal);
+
+    returncode = dlgSecurityProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event2(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 100));
+    OnChangeSize(event2);
+    #endif
+
+    return returncode;
 }

 #ifdef __WXMAC__
 void dlgFunction::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTable.cpp    (copie de travail)
@@ -931,12 +931,8 @@

     lstColumns->SetSize(wxDefaultCoord, wxDefaultCoord,
         ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 150);
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);

-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (révision 7488)
+++ pgadmin/dlg/dlgPackage.cpp    (copie de travail)
@@ -104,7 +104,7 @@
 #ifdef __WXMAC__
 void dlgPackage::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchDictionary.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchDictionary.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTextSearchDictionary.cpp    (copie de travail)
@@ -69,6 +69,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     qry = wxT("SELECT tmplname, nspname\n")
           wxT("  FROM pg_ts_template\n")
@@ -120,7 +121,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTablespace.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgTablespace::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (révision 7488)
+++ pgadmin/dlg/dlgDatabase.cpp    (copie de travail)
@@ -244,13 +244,17 @@
 #ifdef __WXMAC__
 void dlgDatabase::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
     lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
+    dlgSecurityProperty::OnChangeSize(ev);
+
+/*
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
     }
+*/
 }
 #endif

Index: pgadmin/dlg/dlgIndex.cpp
===================================================================
--- pgadmin/dlg/dlgIndex.cpp    (révision 7488)
+++ pgadmin/dlg/dlgIndex.cpp    (copie de travail)
@@ -82,6 +82,8 @@

 int dlgIndexBase::Go(bool modal)
 {
+    int returncode;
+
     if (index)
     {
         // edit mode: view only
@@ -120,7 +122,15 @@
     btnAddCol->Disable();
     btnRemoveCol->Disable();

-    return dlgCollistProperty::Go(modal);
+    returncode = dlgCollistProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    //wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSequence.cpp    (copie de travail)
@@ -140,7 +140,7 @@
 #ifdef __WXMAC__
 void dlgSequence::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (révision 7488)
+++ pgadmin/dlg/dlgView.cpp    (copie de travail)
@@ -92,18 +92,6 @@
 }


-#ifdef __WXMAC__
-void dlgView::OnChangeSize(wxSizeEvent &ev)
-{
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
-}
-#endif
-
-
 void dlgView::CheckChange()
 {
     wxString name=GetName();
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSchema.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgSchema::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchConfiguration.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchConfiguration.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTextSearchConfiguration.cpp    (copie de travail)
@@ -81,6 +81,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     cbParser->Append(wxT(""));

@@ -176,7 +177,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 120));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/ui/dlgServer.xrc
===================================================================
--- pgadmin/ui/dlgServer.xrc    (révision 7488)
+++ pgadmin/ui/dlgServer.xrc    (copie de travail)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgServer">
     <title></title>
-    <size>218,240d</size>
+    <size>218,250d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,225d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>
Index: pgadmin/ui/dlgSequence.xrc
===================================================================
--- pgadmin/ui/dlgSequence.xrc    (révision 7488)
+++ pgadmin/ui/dlgSequence.xrc    (copie de travail)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgSequence">
     <title></title>
-    <size>218,240d</size>
+    <size>218,280d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,255d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> It seems I finally get something working. But not yet for dlgFunction.
> Can you take a look at it? I just want to know if I haven't break other
> things. If it works, I will commit this patch and work on the
> dlgFunction.cpp file.

Sorry, I don't understand what changed in this patch. Everything
except dlgFunction? Or just one or two particular dialogues?

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
<48E40257.80608@lelarge.info>
<937d27e10810020153i75e92c4fq4c44f8d57f6b0f26@mail.gmail.com>
<48EB5561.5000605@lelarge.info> <937d27e10810080554j2358c94bu1d520891be57b764@mail.gmail.com>
Message-ID: <a6beeab5baf28725cdcb22e5e4fbe580@lelarge.info>
X-Sender: guillaume@lelarge.info
Received: from frpar-46plp-vipfw.publicis.fr [81.200.176.13] with HTTP/1.1
    (POST); Wed, 08 Oct 2008 15:29:01 +0200
User-Agent: RoundCube Webmail/0.1-rc2
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

On Wed, 8 Oct 2008 13:54:05 +0100, "Dave Page" <dpage@pgadmin.org> wrote:
> On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> It seems I finally get something working. But not yet for dlgFunction.
>> Can you take a look at it? I just want to know if I haven't break other
>> things. If it works, I will commit this patch and work on the
>> dlgFunction.cpp file.
>
> Sorry, I don't understand what changed in this patch. Everything
> except dlgFunction? Or just one or two particular dialogues?
>

Everything except dlgFunction.


--
Guillaume.
http://www.postgresql.fr
http://www.dalibo.com


Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> It seems I finally get something working. But not yet for dlgFunction.
> Can you take a look at it? I just want to know if I haven't break other
> things. If it works, I will commit this patch and work on the
> dlgFunction.cpp file.
>

OK, testing on OS X Leopard, I see

dlgTable:

Existing table: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x0010983b
dlgTable::dlgTable(pgaFactory*, frmMain*, pgTable*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x00109efe
pgTableFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New table: OK.

dlgSequence:

Existing sequence: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x000f106b
dlgSequence::dlgSequence(pgaFactory*, frmMain*, pgSequence*,
pgSchema*) + 139
6   pgAdmin3-Debug                    0x000f119e
pgSequenceFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New sequence: OK

dlgDatabase:

New database: OK
Existing database: OK

dlgPackage:

Existing package: Privileges and SQL pane controls minimally sized
initially (fixed when resized).
New package: Privileges pane list control incorrectly sized initially
(fixed when resized).

dlgTablespace:

New tablespace: OK
Existing tablespace: OK

dlgSchema:

Existing schema: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x000ed03b
dlgSchema::dlgSchema(pgaFactory*, frmMain*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x000ed167
pgSchemaBaseFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 55

New schema: OK

dlgView:

Existing view: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x001310bb
dlgView::dlgView(pgaFactory*, frmMain*, pgView*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x001311de
pgViewFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New view: OK

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> It seems I finally get something working. But not yet for dlgFunction.
> Can you take a look at it? I just want to know if I haven't break other
> things. If it works, I will commit this patch and work on the
> dlgFunction.cpp file.
>

OK, testing on OS X Leopard, I see

dlgTable:

Existing table: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x0010983b
dlgTable::dlgTable(pgaFactory*, frmMain*, pgTable*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x00109efe
pgTableFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New table: OK.

dlgSequence:

Existing sequence: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x000f106b
dlgSequence::dlgSequence(pgaFactory*, frmMain*, pgSequence*,
pgSchema*) + 139
6   pgAdmin3-Debug                    0x000f119e
pgSequenceFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New sequence: OK

dlgDatabase:

New database: OK
Existing database: OK

dlgPackage:

Existing package: Privileges and SQL pane controls minimally sized
initially (fixed when resized).
New package: Privileges pane list control incorrectly sized initially
(fixed when resized).

dlgTablespace:

New tablespace: OK
Existing tablespace: OK

dlgSchema:

Existing schema: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x000ed03b
dlgSchema::dlgSchema(pgaFactory*, frmMain*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x000ed167
pgSchemaBaseFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 55

New schema: OK

dlgView:

Existing view: Crashes:

0   libwx_macu_core-2.8.0.dylib       0x00ce8929
wxListMainWindow::SetItem(wxListItem&) + 233
1   libwx_macu_core-2.8.0.dylib       0x00ce9a12
wxGenericListCtrl::SetItem(long, int, wxString const&, int) + 194
2   libwx_macu_core-2.8.0.dylib       0x00c8cc09
wxListCtrl::SetItem(long, int, wxString const&, int) + 73
3   pgAdmin3-Debug                    0x0003eb59
ctlListView::AppendItem(int, wchar_t const*, wchar_t const*, wchar_t
const*) + 393
4   pgAdmin3-Debug                    0x000dac7f
dlgSecurityProperty::dlgSecurityProperty(pgaFactory*, frmMain*,
pgObject*, wxString const&, wxString const&, char const*) + 847
5   pgAdmin3-Debug                    0x001310bb
dlgView::dlgView(pgaFactory*, frmMain*, pgView*, pgSchema*) + 139
6   pgAdmin3-Debug                    0x001311de
pgViewFactory::CreateDialog(frmMain*, pgObject*, pgObject*) + 62

New view: OK

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> It seems I finally get something working. But not yet for dlgFunction.
>> Can you take a look at it? I just want to know if I haven't break other
>> things. If it works, I will commit this patch and work on the
>> dlgFunction.cpp file.
>>
>
> OK, testing on OS X Leopard, I see
>

Only dlgSchema crashes on my Mac Mini. I'll work on this one tomorrow.
None of the others crash. Did it crash for every table/sequence/view or
just a specific one ?


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Guillaume Lelarge a écrit :
> Dave Page a écrit :
>> On Tue, Oct 7, 2008 at 1:26 PM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>> It seems I finally get something working. But not yet for dlgFunction.
>>> Can you take a look at it? I just want to know if I haven't break other
>>> things. If it works, I will commit this patch and work on the
>>> dlgFunction.cpp file.
>>>
>> OK, testing on OS X Leopard, I see
>>
>
> Only dlgSchema crashes on my Mac Mini. I'll work on this one tomorrow.
> None of the others crash. Did it crash for every table/sequence/view or
> just a specific one ?
>

OK, problem was in the CreateColumns function, file
pgadmin/ctl/ctlListView.cpp. Complete patch attached.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/ctl/ctlListView.cpp
===================================================================
--- pgadmin/ctl/ctlListView.cpp    (révision 7488)
+++ pgadmin/ctl/ctlListView.cpp    (copie de travail)
@@ -73,13 +73,22 @@
     int rightSize;
     if (leftSize < 0)
     {
-        leftSize = rightSize = GetClientSize().GetWidth()/2;
+#ifdef __WXMAC__
+        leftSize = rightSize = (GetParent()->GetSize().GetWidth() - 20)/2;
+#else
+        leftSize = rightSize = GetSize().GetWidth()/2;
+#endif
     }
     else
     {
         if (leftSize)
             leftSize = ConvertDialogToPixels(wxPoint(leftSize, 0)).x;
+
+#ifdef __WXMAC__
+        rightSize = (GetParent()->GetSize().GetWidth() - 20) - leftSize;
+#else
         rightSize = GetClientSize().GetWidth()-leftSize;
+#endif
     }
     if (!leftSize)
     {
Index: pgadmin/include/dlg/dlgView.h
===================================================================
--- pgadmin/include/dlg/dlgView.h    (révision 7488)
+++ pgadmin/include/dlg/dlgView.h    (copie de travail)
@@ -40,10 +40,6 @@
     pgView *view;
     wxString oldDefinition;

-#ifdef __WXMAC__
-    void OnChangeSize(wxSizeEvent &ev);
-#endif
-
     DECLARE_EVENT_TABLE()
 };

Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h    (révision 7488)
+++ pgadmin/include/dlg/dlgProperty.h    (copie de travail)
@@ -183,14 +183,14 @@
     virtual wxString GetHelpPage() const;
     virtual int Go(bool modal=false);
     bool DisablePrivilege(const wxString &priv);
-    void SetPrivilegesSize(int width, int height);
+    void SetPrivilegesLayout();

-private:
-
 #ifdef __WXMAC__
     void OnChangeSize(wxSizeEvent &ev);
 #endif

+private:
+
     void OnAddPriv(wxCommandEvent& ev);
     void OnDelPriv(wxCommandEvent& ev);
     bool securityChanged;
Index: pgadmin/agent/dlgJob.cpp
===================================================================
--- pgadmin/agent/dlgJob.cpp    (révision 7488)
+++ pgadmin/agent/dlgJob.cpp    (copie de travail)
@@ -119,6 +119,8 @@

 int dlgJob::Go(bool modal)
 {
+    int returncode;
+
     pgSet *jcl=connection->ExecuteSet(wxT("SELECT jclname FROM pgagent.pga_jobclass"));
     if (jcl)
     {
@@ -214,7 +216,14 @@
         btnChangeSchedule->Hide();
     }

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp    (révision 7488)
+++ pgadmin/dlg/dlgProperty.cpp    (copie de travail)
@@ -208,10 +208,9 @@
 }


-void dlgSecurityProperty::SetPrivilegesSize(int width, int height)
+void dlgSecurityProperty::SetPrivilegesLayout()
 {
-    securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        width, height);
+    securityPage->lbPrivileges->GetParent()->Layout();
 }


@@ -1504,7 +1503,7 @@
 void dlgSecurityProperty::OnChangeSize(wxSizeEvent &ev)
 {
     securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
     if (GetAutoLayout())
     {
         Layout();
@@ -1516,7 +1515,10 @@
 int dlgSecurityProperty::Go(bool modal)
 {
     if (securityPage)
+    {
         securityPage->SetConnection(connection);
+        //securityPage->Layout();
+    }

     return dlgProperty::Go(modal);
 }
Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (révision 7488)
+++ pgadmin/dlg/dlgFunction.cpp    (copie de travail)
@@ -153,6 +153,8 @@

 int dlgFunction::Go(bool modal)
 {
+    int returncode;
+
     if (function)
     {
         rdbIn->Disable();
@@ -361,21 +363,25 @@
     OnSelChangeLanguage(event);

     SetupVarEditor(1);
-    return dlgSecurityProperty::Go(modal);
+
+    returncode = dlgSecurityProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event2(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 100));
+    OnChangeSize(event2);
+    #endif
+
+    return returncode;
 }

 #ifdef __WXMAC__
 void dlgFunction::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTable.cpp    (copie de travail)
@@ -931,12 +931,8 @@

     lstColumns->SetSize(wxDefaultCoord, wxDefaultCoord,
         ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 150);
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);

-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (révision 7488)
+++ pgadmin/dlg/dlgPackage.cpp    (copie de travail)
@@ -104,7 +104,7 @@
 #ifdef __WXMAC__
 void dlgPackage::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchDictionary.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchDictionary.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTextSearchDictionary.cpp    (copie de travail)
@@ -69,6 +69,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     qry = wxT("SELECT tmplname, nspname\n")
           wxT("  FROM pg_ts_template\n")
@@ -120,7 +121,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTablespace.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgTablespace::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (révision 7488)
+++ pgadmin/dlg/dlgDatabase.cpp    (copie de travail)
@@ -244,13 +244,17 @@
 #ifdef __WXMAC__
 void dlgDatabase::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
     lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
+    dlgSecurityProperty::OnChangeSize(ev);
+
+/*
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
     }
+*/
 }
 #endif

Index: pgadmin/dlg/dlgIndex.cpp
===================================================================
--- pgadmin/dlg/dlgIndex.cpp    (révision 7488)
+++ pgadmin/dlg/dlgIndex.cpp    (copie de travail)
@@ -82,6 +82,8 @@

 int dlgIndexBase::Go(bool modal)
 {
+    int returncode;
+
     if (index)
     {
         // edit mode: view only
@@ -120,7 +122,15 @@
     btnAddCol->Disable();
     btnRemoveCol->Disable();

-    return dlgCollistProperty::Go(modal);
+    returncode = dlgCollistProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    //wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSequence.cpp    (copie de travail)
@@ -140,7 +140,7 @@
 #ifdef __WXMAC__
 void dlgSequence::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (révision 7488)
+++ pgadmin/dlg/dlgView.cpp    (copie de travail)
@@ -92,18 +92,6 @@
 }


-#ifdef __WXMAC__
-void dlgView::OnChangeSize(wxSizeEvent &ev)
-{
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
-}
-#endif
-
-
 void dlgView::CheckChange()
 {
     wxString name=GetName();
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (révision 7488)
+++ pgadmin/dlg/dlgSchema.cpp    (copie de travail)
@@ -83,7 +83,7 @@
 #ifdef __WXMAC__
 void dlgSchema::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchConfiguration.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchConfiguration.cpp    (révision 7488)
+++ pgadmin/dlg/dlgTextSearchConfiguration.cpp    (copie de travail)
@@ -81,6 +81,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     cbParser->Append(wxT(""));

@@ -176,7 +177,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 120));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/ui/dlgServer.xrc
===================================================================
--- pgadmin/ui/dlgServer.xrc    (révision 7488)
+++ pgadmin/ui/dlgServer.xrc    (copie de travail)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgServer">
     <title></title>
-    <size>218,240d</size>
+    <size>218,250d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,225d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>
Index: pgadmin/ui/dlgSequence.xrc
===================================================================
--- pgadmin/ui/dlgSequence.xrc    (révision 7488)
+++ pgadmin/ui/dlgSequence.xrc    (copie de travail)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgSequence">
     <title></title>
-    <size>218,240d</size>
+    <size>218,280d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,255d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Thu, Oct 9, 2008 at 5:30 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> OK, problem was in the CreateColumns function, file
> pgadmin/ctl/ctlListView.cpp. Complete patch attached.

Okey-doke. So the latest testing shows:

dlgTable:

Existing table: Privileges listview may missing until resized
New table: Privileges listview may be missing until resized

dlgSequence:

Existing sequence: Privileges listview may be mis-sized until resized
New sequence: Privileges listview may be mis-sized until resized

dlgDatabase:

New database: Privileges listview may be mis-sized until resized
Existing database: Privileges listview may be mis-sized until resized

dlgPackage:

Existing package: Privileges and SQL pane controls incorrectly
sized/missing initially (fixed when resized).
New package: Privileges and SQL pane controls incorrectly
sized/missing initially (fixed when resized).

dlgTablespace:

New tablespace: Privileges listview may be mis-sized until resized
Existing tablespace: Privileges listview may be mis-sized until resized

dlgSchema:

Existing schema: Privileges listview may be mis-sized until resized
New schema: Privileges listview may be mis-sized until resized

dlgView:

Existing view: Privileges listview may be mis-sized/missing until resized
New view: Privileges listview may be mis-sized/missing until resized

So it's definitely getting better :-). We seem be be down to one bug
now (with the exception of dlgPackage) which I now realise seems to
manifest itself when any dialogue (with a privileges tab) opens with a
different size than it's default/minimum. In that case, the listview
will either be displayed at the standard height (thus looking too
small if the height of the dialogue is greater than normal), or
entirely mis-sized or missing. Should be relatively easy to force the
pane to resize I hope.

:-)

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Thu, Oct 9, 2008 at 5:30 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> OK, problem was in the CreateColumns function, file
>> pgadmin/ctl/ctlListView.cpp. Complete patch attached.
>
> Okey-doke. So the latest testing shows:
>
> dlgTable:
> [...]
> dlgView:
>
> Existing view: Privileges listview may be mis-sized/missing until resized
> New view: Privileges listview may be mis-sized/missing until resized
>
> So it's definitely getting better :-). We seem be be down to one bug
> now (with the exception of dlgPackage) which I now realise seems to
> manifest itself when any dialogue (with a privileges tab) opens with a
> different size than it's default/minimum. In that case, the listview
> will either be displayed at the standard height (thus looking too
> small if the height of the dialogue is greater than normal), or
> entirely mis-sized or missing. Should be relatively easy to force the
> pane to resize I hope.
>
> :-)
>

Sorry for giving you so many testing work... :-/

Here is a new (complete) patch. I don't like at all what I did but it
seems to fix your issues.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/ctl/ctlListView.cpp
===================================================================
--- pgadmin/ctl/ctlListView.cpp    (revision 7489)
+++ pgadmin/ctl/ctlListView.cpp    (working copy)
@@ -73,13 +73,22 @@
     int rightSize;
     if (leftSize < 0)
     {
-        leftSize = rightSize = GetClientSize().GetWidth()/2;
+#ifdef __WXMAC__
+        leftSize = rightSize = (GetParent()->GetSize().GetWidth() - 20)/2;
+#else
+        leftSize = rightSize = GetSize().GetWidth()/2;
+#endif
     }
     else
     {
         if (leftSize)
             leftSize = ConvertDialogToPixels(wxPoint(leftSize, 0)).x;
+
+#ifdef __WXMAC__
+        rightSize = (GetParent()->GetSize().GetWidth() - 20) - leftSize;
+#else
         rightSize = GetClientSize().GetWidth()-leftSize;
+#endif
     }
     if (!leftSize)
     {
Index: pgadmin/include/dlg/dlgView.h
===================================================================
--- pgadmin/include/dlg/dlgView.h    (revision 7489)
+++ pgadmin/include/dlg/dlgView.h    (working copy)
@@ -40,10 +40,6 @@
     pgView *view;
     wxString oldDefinition;

-#ifdef __WXMAC__
-    void OnChangeSize(wxSizeEvent &ev);
-#endif
-
     DECLARE_EVENT_TABLE()
 };

Index: pgadmin/include/dlg/dlgProperty.h
===================================================================
--- pgadmin/include/dlg/dlgProperty.h    (revision 7489)
+++ pgadmin/include/dlg/dlgProperty.h    (working copy)
@@ -183,14 +183,14 @@
     virtual wxString GetHelpPage() const;
     virtual int Go(bool modal=false);
     bool DisablePrivilege(const wxString &priv);
-    void SetPrivilegesSize(int width, int height);
+    void SetPrivilegesLayout();

-private:
-
 #ifdef __WXMAC__
     void OnChangeSize(wxSizeEvent &ev);
 #endif

+private:
+
     void OnAddPriv(wxCommandEvent& ev);
     void OnDelPriv(wxCommandEvent& ev);
     bool securityChanged;
Index: pgadmin/agent/dlgJob.cpp
===================================================================
--- pgadmin/agent/dlgJob.cpp    (revision 7489)
+++ pgadmin/agent/dlgJob.cpp    (working copy)
@@ -119,6 +119,8 @@

 int dlgJob::Go(bool modal)
 {
+    int returncode;
+
     pgSet *jcl=connection->ExecuteSet(wxT("SELECT jclname FROM pgagent.pga_jobclass"));
     if (jcl)
     {
@@ -214,7 +216,14 @@
         btnChangeSchedule->Hide();
     }

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp    (revision 7489)
+++ pgadmin/dlg/dlgProperty.cpp    (working copy)
@@ -208,10 +208,9 @@
 }


-void dlgSecurityProperty::SetPrivilegesSize(int width, int height)
+void dlgSecurityProperty::SetPrivilegesLayout()
 {
-    securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        width, height);
+    securityPage->lbPrivileges->GetParent()->Layout();
 }


@@ -1504,7 +1503,7 @@
 void dlgSecurityProperty::OnChangeSize(wxSizeEvent &ev)
 {
     securityPage->lbPrivileges->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
     if (GetAutoLayout())
     {
         Layout();
@@ -1516,7 +1515,10 @@
 int dlgSecurityProperty::Go(bool modal)
 {
     if (securityPage)
+    {
         securityPage->SetConnection(connection);
+        //securityPage->Layout();
+    }

     return dlgProperty::Go(modal);
 }
Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (revision 7489)
+++ pgadmin/dlg/dlgFunction.cpp    (working copy)
@@ -153,6 +153,8 @@

 int dlgFunction::Go(bool modal)
 {
+    int returncode;
+
     if (function)
     {
         rdbIn->Disable();
@@ -361,21 +363,35 @@
     OnSelChangeLanguage(event);

     SetupVarEditor(1);
-    return dlgSecurityProperty::Go(modal);
+
+    returncode = dlgSecurityProperty::Go(modal);
+
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
+/*
+    #ifdef __WXMAC__
+    wxSizeEvent event2(wxSize(GetSize().GetWidth() - 20, GetSize().GetHeight() + 100));
+    OnChangeSize(event2);
+    #endif
+*/
+
+    return returncode;
 }

 #ifdef __WXMAC__
 void dlgFunction::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    lstArguments->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (revision 7489)
+++ pgadmin/dlg/dlgTable.cpp    (working copy)
@@ -146,6 +146,8 @@

 int dlgTable::Go(bool modal)
 {
+    int returncode;
+
     if (!table)
         cbOwner->Append(wxT(""));
     AddGroups();
@@ -496,7 +498,14 @@
         txtFillFactor->Disable();
     }

-    return dlgSecurityProperty::Go();
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


@@ -931,12 +940,8 @@

     lstColumns->SetSize(wxDefaultCoord, wxDefaultCoord,
         ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 150);
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);

-    if (GetAutoLayout())
-    {
-        Layout();
-    }
+    dlgSecurityProperty::OnChangeSize(ev);
 }
 #endif

Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (revision 7489)
+++ pgadmin/dlg/dlgPackage.cpp    (working copy)
@@ -60,6 +60,8 @@
 
 int dlgPackage::Go(bool modal)
 {
+    int returncode;
+
     if (!connection->EdbMinimumVersion(8, 2))
         txtComment->Disable();
 
@@ -82,7 +84,14 @@
 
     }
 
-    return dlgSecurityProperty::Go(modal);
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }
 
 
@@ -104,7 +113,7 @@
 #ifdef __WXMAC__
 void dlgPackage::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchDictionary.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchDictionary.cpp    (revision 7489)
+++ pgadmin/dlg/dlgTextSearchDictionary.cpp    (working copy)
@@ -69,6 +69,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     qry = wxT("SELECT tmplname, nspname\n")
           wxT("  FROM pg_ts_template\n")
@@ -120,7 +121,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (revision 7489)
+++ pgadmin/dlg/dlgTablespace.cpp    (working copy)
@@ -54,6 +54,8 @@

 int dlgTablespace::Go(bool modal)
 {
+    int returncode;
+
     if (!tablespace)
         cbOwner->Append(wxEmptyString);
     AddGroups();
@@ -76,14 +78,21 @@
     if (!connection->BackendMinimumVersion(8, 2))
         txtComment->Disable();

-    return dlgSecurityProperty::Go(modal);
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


 #ifdef __WXMAC__
 void dlgTablespace::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (revision 7489)
+++ pgadmin/dlg/dlgDatabase.cpp    (working copy)
@@ -95,6 +95,8 @@

 int dlgDatabase::Go(bool modal)
 {
+    int returncode;
+
     if (!database)
         cbOwner->Append(wxT(""));

@@ -228,7 +230,15 @@
     }

     SetupVarEditor(1);
-    return dlgSecurityProperty::Go(modal);
+
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


@@ -244,13 +254,17 @@
 #ifdef __WXMAC__
 void dlgDatabase::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
     lstVariables->SetSize(wxDefaultCoord, wxDefaultCoord,
-        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+        ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 550);
+    dlgSecurityProperty::OnChangeSize(ev);
+
+/*
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
     }
+*/
 }
 #endif

Index: pgadmin/dlg/dlgIndex.cpp
===================================================================
--- pgadmin/dlg/dlgIndex.cpp    (revision 7489)
+++ pgadmin/dlg/dlgIndex.cpp    (working copy)
@@ -82,6 +82,8 @@

 int dlgIndexBase::Go(bool modal)
 {
+    int returncode;
+
     if (index)
     {
         // edit mode: view only
@@ -120,7 +122,15 @@
     btnAddCol->Disable();
     btnRemoveCol->Disable();

-    return dlgCollistProperty::Go(modal);
+    returncode = dlgCollistProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    //wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 130));
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 200));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (revision 7489)
+++ pgadmin/dlg/dlgSequence.cpp    (working copy)
@@ -64,6 +64,8 @@

 int dlgSequence::Go(bool modal)
 {
+    int returncode;
+
     if (!sequence)
         cbOwner->Append(wxEmptyString);
     AddGroups();
@@ -123,7 +125,14 @@
             wxLogError(_("Failed to disable the TRIGGER privilege checkbox!"));
     }

-    return dlgSecurityProperty::Go(modal);
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


@@ -140,7 +149,7 @@
 #ifdef __WXMAC__
 void dlgSequence::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (revision 7489)
+++ pgadmin/dlg/dlgView.cpp    (working copy)
@@ -56,6 +56,8 @@

 int dlgView::Go(bool modal)
 {
+    int returncode;
+
     AddGroups();
     AddUsers(cbOwner);

@@ -79,7 +81,14 @@
             wxLogError(_("Failed to disable the RULE privilege checkbox!"));
     }

-    return dlgSecurityProperty::Go(modal);
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


@@ -92,18 +101,6 @@
 }


-#ifdef __WXMAC__
-void dlgView::OnChangeSize(wxSizeEvent &ev)
-{
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
-    if (GetAutoLayout())
-    {
-        Layout();
-    }
-}
-#endif
-
-
 void dlgView::CheckChange()
 {
     wxString name=GetName();
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (revision 7489)
+++ pgadmin/dlg/dlgSchema.cpp    (working copy)
@@ -44,6 +44,8 @@

 int dlgSchema::Go(bool modal)
 {
+    int returncode;
+
     if (!schema)
         cbOwner->Append(wxT(""));

@@ -67,7 +69,14 @@
         // create mode
     }

-    return dlgSecurityProperty::Go(modal);
+    returncode = dlgSecurityProperty::Go(modal);
+
+#ifdef __WXMAC__
+    SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
+    SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
+#endif
+
+    return returncode;
 }


@@ -83,7 +92,7 @@
 #ifdef __WXMAC__
 void dlgSchema::OnChangeSize(wxSizeEvent &ev)
 {
-    SetPrivilegesSize(ev.GetSize().GetWidth(), ev.GetSize().GetHeight() - 350);
+    SetPrivilegesLayout();
     if (GetAutoLayout())
     {
         Layout();
Index: pgadmin/dlg/dlgTextSearchConfiguration.cpp
===================================================================
--- pgadmin/dlg/dlgTextSearchConfiguration.cpp    (revision 7489)
+++ pgadmin/dlg/dlgTextSearchConfiguration.cpp    (working copy)
@@ -81,6 +81,7 @@
 {
     wxString qry;
     pgSet *set;
+    int returncode;

     cbParser->Append(wxT(""));

@@ -176,7 +177,14 @@
     btnAdd->Disable();
     btnRemove->Disable();

-    return dlgProperty::Go(modal);
+    returncode = dlgProperty::Go(modal);
+
+    #ifdef __WXMAC__
+    wxSizeEvent event(wxSize(GetSize().GetWidth() - 25, GetSize().GetHeight() + 120));
+    OnChangeSize(event);
+    #endif
+
+    return returncode;
 }


Index: pgadmin/ui/dlgServer.xrc
===================================================================
--- pgadmin/ui/dlgServer.xrc    (revision 7489)
+++ pgadmin/ui/dlgServer.xrc    (working copy)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgServer">
     <title></title>
-    <size>218,240d</size>
+    <size>218,250d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,225d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>
Index: pgadmin/ui/dlgSequence.xrc
===================================================================
--- pgadmin/ui/dlgSequence.xrc    (revision 7489)
+++ pgadmin/ui/dlgSequence.xrc    (working copy)
@@ -2,7 +2,7 @@
 <resource>
   <object class="wxDialog" name="dlgSequence">
     <title></title>
-    <size>218,240d</size>
+    <size>218,280d</size>
     <style>wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER|wxRESIZE_BOX|wxTHICK_FRAME</style>
     <object class="wxFlexGridSizer">
       <cols>1</cols>
@@ -10,7 +10,7 @@
       <growablecols>0</growablecols>
       <object class="sizeritem">
         <object class="wxNotebook" name="nbNotebook">
-          <size>214,215d</size>
+          <size>214,255d</size>
           <selected>0</selected>
           <object class="notebookpage">
             <label>Properties</label>

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Thu, Oct 16, 2008 at 3:38 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>
> Sorry for giving you so many testing work... :-/

No problem.

> Here is a new (complete) patch. I don't like at all what I did but it
> seems to fix your issues.

Well I haven't been able to test it yet (I'm currently sat next to
your bosses listening to a talk on pgLoader :-) ), but wow. That's
*really* ugly :-(

I'll test when I can but it might not be for a few days at least.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Thu, Oct 16, 2008 at 3:38 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Sorry for giving you so many testing work... :-/
>
> No problem.
>
>> Here is a new (complete) patch. I don't like at all what I did but it
>> seems to fix your issues.
>
> Well I haven't been able to test it yet (I'm currently sat next to
> your bosses listening to a talk on pgLoader :-) ), but wow. That's
> *really* ugly :-(
>

I know. I warned you :) Honestly, I don't find a better way to do it.
This sure is ugly but it works. And I don't notice flickers.

> I'll test when I can but it might not be for a few days at least.
>

Yeah, I hope you'll all have a great time in Prato.

Too bad I couldn't come :-/ Some conferences seem really great. I would
love to see Greg's one.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Thu, Oct 16, 2008 at 3:38 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> Here is a new (complete) patch. I don't like at all what I did but it
> seems to fix your issues.

OK, here we go....

dlgTable:

Existing table: OK
New table: OK

dlgSequence:

Existing sequence: OK
New sequence: OK

dlgDatabase:

New database: OK
Existing database: OK

dlgPackage:

Existing package: OK
New package: OK

dlgTablespace:

New tablespace: OK
Existing tablespace: OK

dlgSchema:

Existing schema: OK
New schema: OK

dlgView:

Existing view: OK
New view: OK

Nice work!! So, let's please get this applied so we can put it to bed.
A couple of minor fixes:

- In dlgFunction::Go @367, you have:

    returncode = dlgSecurityProperty::Go(modal);

    returncode = dlgSecurityProperty::Go(modal);

Copy/paste error?

- Please add a comment to each instance of the ugly resize blocks to
explain what it's doing so we don't forget in 6 months :-)

Thanks!

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> [...]
> Nice work!! So, let's please get this applied so we can put it to bed.
> A couple of minor fixes:
>
> - In dlgFunction::Go @367, you have:
>
>     returncode = dlgSecurityProperty::Go(modal);
>
>     returncode = dlgSecurityProperty::Go(modal);
>
> Copy/paste error?
>

Yes. There was also two return statements.

> - Please add a comment to each instance of the ugly resize blocks to
> explain what it's doing so we don't forget in 6 months :-)
>

Done. Not sure my words are easy to understand. Feel free to change them
to something more appropriate.

Thanks. I still don't like this hack. I hope I'll soon better understand
this issue to replace the ugly code with a good one.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Sun, Oct 19, 2008 at 10:33 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Thanks. I still don't like this hack. I hope I'll soon better understand
> this issue to replace the ugly code with a good one.

You're going to hate this - but I just tested Gevik's work on Windows,
and seem to be seeing the SQL and Privilege panes mis-behaving there
:-(

I wonder if we just need to defer the restoration of the dialogue size
to a much later time than it currently is done. Obviously we could
just do it at the point that you have your hack at the moment, but it
would be nice to do it in the base class. I tried doing this quickly
but didn't get too far. Putting your existing hack towards the end of
dlgProperty::Go (but without the WXMAC ifdef) seemed to do the job
though - albeit still hackily.

Thoughts?

I also found on Windows that the check boxes for different privileges
on the privilege panes are touching each other and could use some
spacing. Can you look at that please?

Thanks.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
Hi Guillaume,

Did you see the message below? Don't worry if you did - I just want to
ensure it didn't get lost!

On Mon, Oct 27, 2008 at 8:23 AM, Dave Page <dpage@pgadmin.org> wrote:
> On Sun, Oct 19, 2008 at 10:33 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Thanks. I still don't like this hack. I hope I'll soon better understand
>> this issue to replace the ugly code with a good one.
>
> You're going to hate this - but I just tested Gevik's work on Windows,
> and seem to be seeing the SQL and Privilege panes mis-behaving there
> :-(
>
> I wonder if we just need to defer the restoration of the dialogue size
> to a much later time than it currently is done. Obviously we could
> just do it at the point that you have your hack at the moment, but it
> would be nice to do it in the base class. I tried doing this quickly
> but didn't get too far. Putting your existing hack towards the end of
> dlgProperty::Go (but without the WXMAC ifdef) seemed to do the job
> though - albeit still hackily.
>
> Thoughts?
>
> I also found on Windows that the check boxes for different privileges
> on the privilege panes are touching each other and could use some
> spacing. Can you look at that please?
>
> Thanks.



--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> Hi Guillaume,
>
> Did you see the message below? Don't worry if you did - I just want to
> ensure it didn't get lost!
>

Sorry for not answering sooner. I've seen it, I've printed it so that I
cannot forget it, I just didn't find time (and courage) to work on it.

Till PostgreSQL 8.4 beta, I'll only work on pgAdmin. First on your bug
report, then on the server status window and last on i18n.

Hmmm, I don't think I will work on it tonight. I'll try tomorrow.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Wed, Nov 5, 2008 at 5:11 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Dave Page a écrit :
>> Hi Guillaume,
>>
>> Did you see the message below? Don't worry if you did - I just want to
>> ensure it didn't get lost!
>>
>
> Sorry for not answering sooner. I've seen it, I've printed it so that I
> cannot forget it, I just didn't find time (and courage) to work on it.

No problem!

> Till PostgreSQL 8.4 beta, I'll only work on pgAdmin. First on your bug
> report, then on the server status window and last on i18n.

Sounds ambitious :-).

> Hmmm, I don't think I will work on it tonight. I'll try tomorrow.

Yeah - its pretty late for you I guess!


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Wed, Nov 5, 2008 at 5:11 PM, Guillaume Lelarge
> [...]
>> Till PostgreSQL 8.4 beta, I'll only work on pgAdmin. First on your bug
>> report, then on the server status window and last on i18n.
>
> Sounds ambitious :-).
>

Yeah, but I didn't say I will do all of this :) At least, I'll try.

>> Hmmm, I don't think I will work on it tonight. I'll try tomorrow.
>
> Yeah - its pretty late for you I guess!
>

Well, actually, I want to finish this book : "The Art of SQL", Stéphane
Faroult with Peter Robson, O'Reilly. Quite interesting, even if I
already know most of it. Do you know some books about database
internals? I've seen some on the Developer's FAQ, but I'm not sure which
one is the most interesting.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Wed, Nov 5, 2008 at 5:39 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

>
> Well, actually, I want to finish this book : "The Art of SQL", Stéphane
> Faroult with Peter Robson, O'Reilly. Quite interesting, even if I
> already know most of it. Do you know some books about database
> internals? I've seen some on the Developer's FAQ, but I'm not sure which
> one is the most interesting.

Not really - I don't spend much time deep in the server internals.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> [...]
> On Mon, Oct 27, 2008 at 8:23 AM, Dave Page <dpage@pgadmin.org> wrote:
>> On Sun, Oct 19, 2008 at 10:33 PM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>> Thanks. I still don't like this hack. I hope I'll soon better understand
>>> this issue to replace the ugly code with a good one.
>> You're going to hate this - but I just tested Gevik's work on Windows,
>> and seem to be seeing the SQL and Privilege panes mis-behaving there
>> :-(
>>
>> I wonder if we just need to defer the restoration of the dialogue size
>> to a much later time than it currently is done. Obviously we could
>> just do it at the point that you have your hack at the moment, but it
>> would be nice to do it in the base class. I tried doing this quickly
>> but didn't get too far.

I tried it and it failed.

>> Putting your existing hack towards the end of
>> dlgProperty::Go (but without the WXMAC ifdef) seemed to do the job
>> though - albeit still hackily.
>>
>> Thoughts?
>>

Still a hack but it works. It even works with GTK. The patch attached
removes the WXMAC ifdef.

>> I also found on Windows that the check boxes for different privileges
>> on the privilege panes are touching each other and could use some
>> spacing. Can you look at that please?
>>

I forgot to add a border to the checkboxes. I tried from 4 to 1. 4 was
really big. I still hesitate between 1 et 2. 2 seems better, so that's
the value in the patch. I think you should try both of them and tell us
which one you prefer.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/ctl/ctlSecurityPanel.cpp
===================================================================
--- pgadmin/ctl/ctlSecurityPanel.cpp    (révision 7496)
+++ pgadmin/ctl/ctlSecurityPanel.cpp    (copie de travail)
@@ -107,7 +107,7 @@
             allPrivilegesGrant = new wxCheckBox(this, CTL_ALLPRIVGRANT, wxT("WITH GRANT OPTION"));
             itemSizer5->Add(allPrivilegesGrant, wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT);
             allPrivilegesGrant->Disable();
-            itemSizer3->Add(itemSizer5, 0, wxALL, 0);
+            itemSizer3->Add(itemSizer5, 0, wxALL, 2);
         }

         while (privileges.HasMoreTokens())
@@ -122,7 +122,7 @@
             itemSizer6->Add(cb, wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT);
             cb->Disable();
             privCheckboxes[i++] = cb;
-            itemSizer3->Add(itemSizer6, 0, wxALL, 0);
+            itemSizer3->Add(itemSizer6, 0, wxALL, 2);
         }
     }

Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (révision 7496)
+++ pgadmin/dlg/dlgFunction.cpp    (copie de travail)
@@ -366,12 +366,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (révision 7496)
+++ pgadmin/dlg/dlgTable.cpp    (copie de travail)
@@ -500,12 +500,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (révision 7496)
+++ pgadmin/dlg/dlgPackage.cpp    (copie de travail)
@@ -86,12 +86,10 @@
 
     returncode = dlgSecurityProperty::Go(modal);
 
-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif
 
     return returncode;
 }
Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (révision 7496)
+++ pgadmin/dlg/dlgTablespace.cpp    (copie de travail)
@@ -80,12 +80,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (révision 7496)
+++ pgadmin/dlg/dlgDatabase.cpp    (copie de travail)
@@ -233,12 +233,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (révision 7496)
+++ pgadmin/dlg/dlgSequence.cpp    (copie de travail)
@@ -127,12 +127,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (révision 7496)
+++ pgadmin/dlg/dlgView.cpp    (copie de travail)
@@ -83,12 +83,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (révision 7496)
+++ pgadmin/dlg/dlgSchema.cpp    (copie de travail)
@@ -71,12 +71,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Guillaume Lelarge a écrit :
> Dave Page a écrit :
>> [...]
>> On Mon, Oct 27, 2008 at 8:23 AM, Dave Page <dpage@pgadmin.org> wrote:
>>> On Sun, Oct 19, 2008 at 10:33 PM, Guillaume Lelarge
>>> <guillaume@lelarge.info> wrote:
>>>> Thanks. I still don't like this hack. I hope I'll soon better understand
>>>> this issue to replace the ugly code with a good one.
>>> You're going to hate this - but I just tested Gevik's work on Windows,
>>> and seem to be seeing the SQL and Privilege panes mis-behaving there
>>> :-(
>>>
>>> I wonder if we just need to defer the restoration of the dialogue size
>>> to a much later time than it currently is done. Obviously we could
>>> just do it at the point that you have your hack at the moment, but it
>>> would be nice to do it in the base class. I tried doing this quickly
>>> but didn't get too far.
>
> I tried it and it failed.
>
>>> Putting your existing hack towards the end of
>>> dlgProperty::Go (but without the WXMAC ifdef) seemed to do the job
>>> though - albeit still hackily.
>>>
>>> Thoughts?
>>>
>
> Still a hack but it works. It even works with GTK. The patch attached
> removes the WXMAC ifdef.
>
>>> I also found on Windows that the check boxes for different privileges
>>> on the privilege panes are touching each other and could use some
>>> spacing. Can you look at that please?
>>>
>
> I forgot to add a border to the checkboxes. I tried from 4 to 1. 4 was
> really big. I still hesitate between 1 et 2. 2 seems better, so that's
> the value in the patch. I think you should try both of them and tell us
> which one you prefer.
>

Any comments on this? can I apply?


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Fri, Nov 14, 2008 at 6:01 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Guillaume Lelarge a écrit :
>> Dave Page a écrit :
>>> [...]
>>> On Mon, Oct 27, 2008 at 8:23 AM, Dave Page <dpage@pgadmin.org> wrote:
>>>> On Sun, Oct 19, 2008 at 10:33 PM, Guillaume Lelarge
>>>> <guillaume@lelarge.info> wrote:
>>>>> Thanks. I still don't like this hack. I hope I'll soon better understand
>>>>> this issue to replace the ugly code with a good one.
>>>> You're going to hate this - but I just tested Gevik's work on Windows,
>>>> and seem to be seeing the SQL and Privilege panes mis-behaving there
>>>> :-(
>>>>
>>>> I wonder if we just need to defer the restoration of the dialogue size
>>>> to a much later time than it currently is done. Obviously we could
>>>> just do it at the point that you have your hack at the moment, but it
>>>> would be nice to do it in the base class. I tried doing this quickly
>>>> but didn't get too far.
>>
>> I tried it and it failed.
>>
>>>> Putting your existing hack towards the end of
>>>> dlgProperty::Go (but without the WXMAC ifdef) seemed to do the job
>>>> though - albeit still hackily.
>>>>
>>>> Thoughts?
>>>>
>>
>> Still a hack but it works. It even works with GTK. The patch attached
>> removes the WXMAC ifdef.
>>
>>>> I also found on Windows that the check boxes for different privileges
>>>> on the privilege panes are touching each other and could use some
>>>> spacing. Can you look at that please?
>>>>
>>
>> I forgot to add a border to the checkboxes. I tried from 4 to 1. 4 was
>> really big. I still hesitate between 1 et 2. 2 seems better, so that's
>> the value in the patch. I think you should try both of them and tell us
>> which one you prefer.
>>
>
> Any comments on this? can I apply?

Oh, sorry - somehow it escaped from my TODO list. I'll try to review
later tonight.

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Thu, Nov 6, 2008 at 11:15 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>
> Still a hack but it works. It even works with GTK. The patch attached
> removes the WXMAC ifdef.
>
>>> I also found on Windows that the check boxes for different privileges
>>> on the privilege panes are touching each other and could use some
>>> spacing. Can you look at that please?
>>>
>
> I forgot to add a border to the checkboxes. I tried from 4 to 1. 4 was
> really big. I still hesitate between 1 et 2. 2 seems better, so that's
> the value in the patch. I think you should try both of them and tell us
> which one you prefer.

Hmm, I think they still look a little close. After some
experimentation, I'd say 3 or 4 on Windows, and 3 on Mac - but it
could use a few additional px between the combo and the top checkbox.
If you can add that, I'd say go with 3.

New bug: The definition pane on dlgFunction is thoroughly broken when
working with C functions :-(. I think this just got overlooked when
you redrew everything.

I'm happy for you to apply when you're happy. Things are definitely
going in the right direction!

--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Thu, Nov 6, 2008 at 11:15 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Still a hack but it works. It even works with GTK. The patch attached
>> removes the WXMAC ifdef.
>>
>>>> I also found on Windows that the check boxes for different privileges
>>>> on the privilege panes are touching each other and could use some
>>>> spacing. Can you look at that please?
>>>>
>> I forgot to add a border to the checkboxes. I tried from 4 to 1. 4 was
>> really big. I still hesitate between 1 et 2. 2 seems better, so that's
>> the value in the patch. I think you should try both of them and tell us
>> which one you prefer.
>
> Hmm, I think they still look a little close. After some
> experimentation, I'd say 3 or 4 on Windows, and 3 on Mac - but it
> could use a few additional px between the combo and the top checkbox.
> If you can add that, I'd say go with 3.
>

I put #ifdef to define the border size for each plateform.

> New bug: The definition pane on dlgFunction is thoroughly broken when
> working with C functions :-(. I think this just got overlooked when
> you redrew everything.
>

You're right. It's fixed.

> I'm happy for you to apply when you're happy. Things are definitely
> going in the right direction!
>

Can you take a quick look at this new patch? Thanks. I'll commit it if
you find it good enough.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/ctl/ctlSecurityPanel.cpp
===================================================================
--- pgadmin/ctl/ctlSecurityPanel.cpp    (révision 7500)
+++ pgadmin/ctl/ctlSecurityPanel.cpp    (copie de travail)
@@ -99,6 +99,17 @@
         itemSizer4->Add(cbGroups, wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT);
         itemSizer3->Add(itemSizer4, 0, wxEXPAND|wxALL, 0);

+        /* border size depends on the plateform */
+        #ifdef __WXMSW__
+        int bordersize = 4;
+        #endif
+        #ifdef __WXMAC__
+        int bordersize = 3;
+        #endif
+        #ifdef __WXGTK__
+        int bordersize = 0;
+        #endif
+
         if (needAll)
         {
             wxBoxSizer* itemSizer5 = new wxBoxSizer(wxHORIZONTAL);
@@ -107,7 +118,7 @@
             allPrivilegesGrant = new wxCheckBox(this, CTL_ALLPRIVGRANT, wxT("WITH GRANT OPTION"));
             itemSizer5->Add(allPrivilegesGrant, wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT);
             allPrivilegesGrant->Disable();
-            itemSizer3->Add(itemSizer5, 0, wxALL, 0);
+            itemSizer3->Add(itemSizer5, 0, wxALL, bordersize);
         }

         while (privileges.HasMoreTokens())
@@ -122,7 +133,7 @@
             itemSizer6->Add(cb, wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT);
             cb->Disable();
             privCheckboxes[i++] = cb;
-            itemSizer3->Add(itemSizer6, 0, wxALL, 0);
+            itemSizer3->Add(itemSizer6, 0, wxALL, bordersize);
         }
     }

Index: pgadmin/dlg/dlgFunction.cpp
===================================================================
--- pgadmin/dlg/dlgFunction.cpp    (révision 7500)
+++ pgadmin/dlg/dlgFunction.cpp    (copie de travail)
@@ -366,12 +366,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgTable.cpp
===================================================================
--- pgadmin/dlg/dlgTable.cpp    (révision 7500)
+++ pgadmin/dlg/dlgTable.cpp    (copie de travail)
@@ -500,12 +500,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgPackage.cpp
===================================================================
--- pgadmin/dlg/dlgPackage.cpp    (révision 7500)
+++ pgadmin/dlg/dlgPackage.cpp    (copie de travail)
@@ -86,12 +86,10 @@
 
     returncode = dlgSecurityProperty::Go(modal);
 
-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif
 
     return returncode;
 }
Index: pgadmin/dlg/dlgTablespace.cpp
===================================================================
--- pgadmin/dlg/dlgTablespace.cpp    (révision 7500)
+++ pgadmin/dlg/dlgTablespace.cpp    (copie de travail)
@@ -80,12 +80,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgDatabase.cpp
===================================================================
--- pgadmin/dlg/dlgDatabase.cpp    (révision 7500)
+++ pgadmin/dlg/dlgDatabase.cpp    (copie de travail)
@@ -291,12 +291,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgSequence.cpp
===================================================================
--- pgadmin/dlg/dlgSequence.cpp    (révision 7500)
+++ pgadmin/dlg/dlgSequence.cpp    (copie de travail)
@@ -127,12 +127,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgView.cpp
===================================================================
--- pgadmin/dlg/dlgView.cpp    (révision 7500)
+++ pgadmin/dlg/dlgView.cpp    (copie de travail)
@@ -83,12 +83,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/dlg/dlgSchema.cpp
===================================================================
--- pgadmin/dlg/dlgSchema.cpp    (révision 7500)
+++ pgadmin/dlg/dlgSchema.cpp    (copie de travail)
@@ -71,12 +71,10 @@

     returncode = dlgSecurityProperty::Go(modal);

-#ifdef __WXMAC__
-    // This fixes a UI glitch on MacOS X
+    // This fixes a UI glitch on MacOS X and Windows
     // Because of the new layout code, the Privileges pane don't size itself properly
     SetSize(GetSize().GetWidth()+1, GetSize().GetHeight());
     SetSize(GetSize().GetWidth()-1, GetSize().GetHeight());
-#endif

     return returncode;
 }
Index: pgadmin/ui/dlgFunction.xrc
===================================================================
--- pgadmin/ui/dlgFunction.xrc    (révision 7500)
+++ pgadmin/ui/dlgFunction.xrc    (copie de travail)
@@ -346,30 +346,59 @@
           <object class="notebookpage">
             <label>Definition</label>
             <object class="wxPanel" name="pnlDefinition">
-              <object class="wxStaticText" name="stObjectFile">
-                <label>Object file</label>
-              </object>
-              <object class="wxTextCtrl" name="txtObjectFile">
-                <size>135,-1d</size>
-              </object>
-              <object class="wxStaticText" name="stLinkSymbol">
-                <label>Link symbol</label>
-              </object>
-              <object class="wxTextCtrl" name="txtLinkSymbol">
-                <size>135,-1d</size>
-              </object>
               <object class="wxFlexGridSizer">
+                <cols>1</cols>
+                <rows>2</rows>
+                <vgap>5</vgap>
+                <hgap>5</hgap>
+                <growablecols>0</growablecols>
+                <growablerows>0,1</growablerows>
                 <object class="sizeritem">
+                  <object class="wxFlexGridSizer">
+                    <cols>2</cols>
+                    <rows>2</rows>
+                    <vgap>5</vgap>
+                    <hgap>5</hgap>
+                    <growablecols>1</growablecols>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stObjectFile">
+                        <label>Object file</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxTextCtrl" name="txtObjectFile">
+                        <size>135,-1d</size>
+                      </object>
+                      <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxStaticText" name="stLinkSymbol">
+                        <label>Link symbol</label>
+                      </object>
+                      <flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                    <object class="sizeritem">
+                      <object class="wxTextCtrl" name="txtLinkSymbol">
+                        <size>135,-1d</size>
+                      </object>
+                      <flag>wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
+                      <border>4</border>
+                    </object>
+                  </object>
+                  <flag>wxALL|wxEXPAND</flag>
+                  <border>5</border>
+                </object>
+                <object class="sizeritem">
                   <object class="ctlSQLBox" name="txtSqlBox">
                     <style>wxTE_MULTILINE|wxSUNKEN_BORDER|wxTE_RICH2</style>
                   </object>
                   <flag>wxALL|wxEXPAND</flag>
                   <border>5</border>
                 </object>
-                <cols>1</cols>
-                <rows>1</rows>
-                <growablerows>0</growablerows>
-                <growablecols>0</growablecols>
               </object>
             </object>
           </object>

Re: Buglets in dlgFunction

From
"Dave Page"
Date:
On Wed, Nov 19, 2008 at 11:21 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

>
> Can you take a quick look at this new patch? Thanks. I'll commit it if
> you find it good enough.

Thanks - that looked good, so I've committed it (as I only too a
couple of clicks :-p ). I did increase the default size of dlgTable,
as the TRIGGER persmission checkbox was getting obscured otherwise.

The only other thing I noticed this time is that the custom autovacuum
settings checkbox on the Autovacuum tab of dlgTable is almost touching
the top-left of it's parent tab.

Hopefully, we're nearly there *this* time :-)


--
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com

Re: Buglets in dlgFunction

From
Guillaume Lelarge
Date:
Dave Page a écrit :
> On Wed, Nov 19, 2008 at 11:21 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>
>> Can you take a quick look at this new patch? Thanks. I'll commit it if
>> you find it good enough.
>
> Thanks - that looked good, so I've committed it (as I only too a
> couple of clicks :-p ). I did increase the default size of dlgTable,
> as the TRIGGER persmission checkbox was getting obscured otherwise.
>

Great, thanks.

> The only other thing I noticed this time is that the custom autovacuum
> settings checkbox on the Autovacuum tab of dlgTable is almost touching
> the top-left of it's parent tab.
>

I'll look at this.


--
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com