Re: Buglets in dlgFunction

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Buglets in dlgFunction
Дата
Msg-id 48EB5561.5000605@lelarge.info
обсуждение исходный текст
Ответ на Re: Buglets in dlgFunction  ("Dave Page" <dpage@pgadmin.org>)
Ответы Re: Buglets in dlgFunction  ("Dave Page" <dpage@pgadmin.org>)
Re: Buglets in dlgFunction  ("Dave Page" <dpage@pgadmin.org>)
Re: Buglets in dlgFunction  ("Dave Page" <dpage@pgadmin.org>)
Список pgadmin-hackers
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>

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: [HACKERS] Function management in PG
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Buglets in dlgFunction