Le 13/04/2010 09:01, Guillaume Lelarge a écrit : > Hi Ashesh, > > Le 12/04/2010 11:14, Ashesh Vashi a écrit : >> [...] >> Right click on GQB will popup a menu (Refresh). >> This will adjust the size of the scroll windows, if the table's size goes >> beyond the current size. >> > > I checked your patch this morning. Works great. Thanks Ashesh. > >> 1200x800 is the default minimum size of the scrolled window defined by the >> constants: >> *#define GQB_MIN_WIDTH 1280* >> *#define GQB_MIN_HEIGHT 800* >> * >> * >> I tried adding the same code, when adding a new table/view. >> But, if I select a table for next to get created (by double click on >> left-side tree) and then press left clicks few times, the application is >> crashing.. Hence, just added this code to work with the pop-up menu. :-( >> > > Didn't try this, but will do tonight. It would be better if it > automatically grows the canvas size. >
It seems to work with this patch (to apply above your own patch). Can you try it, please? It didn't crash for me, but I'm not a good tester. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com
diff --git a/pgadmin/gqb/gqbBrowser.cpp b/pgadmin/gqb/gqbBrowser.cpp index c3dc6b8..7137d83 100644 --- a/pgadmin/gqb/gqbBrowser.cpp +++ b/pgadmin/gqb/gqbBrowser.cpp @@ -129,6 +129,9 @@ void gqbBrowser::OnBeginDrag(wxTreeEvent& event) controller->getView()->CalcUnscrolledPosition(xx,yy,&xx,&yy); controller->addTableToModel(item,wxPoint(xx,yy)); controller->getView()->Refresh(); + controller->getView()->Update(); + controller->getView()->updateModelSize(NULL, true); + } } } diff --git a/pgadmin/include/gqb/gqbViewController.h b/pgadmin/include/gqb/gqbViewController.h index 8275690..7283a13 100644 --- a/pgadmin/include/gqb/gqbViewController.h +++ b/pgadmin/include/gqb/gqbViewController.h @@ -132,6 +132,8 @@ public: // Functions for all gqb extra Panels (projection, criteria..) void emptyPanelsData(); + void updateModelSize(gqbQueryObject* obj, bool updateAnyWay); + private: gqbController *controller; // owned by caller application shouldn't be destroy // by this class @@ -164,7 +166,6 @@ private: void OnMenuTableDelete(wxCommandEvent& event); void OnMenuTableSetAlias(wxCommandEvent& event); void OnRefresh(wxCommandEvent& ev); - void updateModelSize(gqbQueryObject* obj, bool updateAnyWay); wxArrayString joinTypeChoices;
-- Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-support