Re: Buglets in dlgFunction

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

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

Предыдущее
От: svn@pgadmin.org
Дата:
Сообщение: SVN Commit by guillaume: r7488 - trunk/pgadmin3/pgadmin/dlg
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Buglets in dlgFunction