--- src/include/frmQueryBuilder.h.orig Thu Nov 13 17:29:50 2003 +++ src/include/frmQueryBuilder.h Wed Dec 3 11:24:23 2003 @@ -47,6 +47,7 @@ // Controls wxStatusBar *statusBar; + wxMDIParentFrame *m_QueryBuilder; // Data wxArrayPtrVoid m_children; --- src/include/frmChildTableViewFrame.h.orig Mon Oct 27 02:32:59 2003 +++ src/include/frmChildTableViewFrame.h Wed Dec 3 11:24:23 2003 @@ -93,6 +93,7 @@ // Controls myList *m_columnlist; + wxMDIParentFrame *m_ChildFrame; // Data wxString m_title; @@ -159,9 +160,16 @@ public: +#ifdef __WXGTK__ + DnDJoin(wxFrame *frame,wxMDIParentFrame *ParentFrame) +#else DnDJoin(wxFrame *frame) +#endif { m_frame = frame; +#ifdef __WXGTK__ + m_ParentFrame = ParentFrame; +#endif } virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& text); @@ -169,6 +177,10 @@ private: wxFrame *m_frame; +#ifdef __WXGTK__ + wxMDIParentFrame *m_ParentFrame; +#endif + }; #endif // frmChildfrmChildTableViewFrame_H --- src/ui/frmChildTableViewFrame.cpp.orig Mon Oct 27 02:33:00 2003 +++ src/ui/frmChildTableViewFrame.cpp Wed Dec 3 13:05:09 2003 @@ -125,6 +125,7 @@ // Create a column list m_columnlist = new myList(this, ID_TABLEVIEWLISTBOX); + m_columnlist->SetFont(*wxNORMAL_FONT); // We need to know if we're going to show system objects wxString sysobjstr; @@ -174,7 +175,14 @@ this->SetClientSize(maxtextwidth, m_minheight); // Set the drop target +#ifdef __WXGTK__ + m_columnlist->SetDropTarget(new DnDJoin(this,frame)); +#else m_columnlist->SetDropTarget(new DnDJoin(this)); +#endif + + m_ChildFrame = (wxMDIParentFrame*)frame; + } //////////////////////////////////////////////////////////////////////////////// @@ -190,7 +198,11 @@ //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::OnDoubleClick(wxCommandEvent& event) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif int tmpitem = m_columnlist->GetSelection(); tmpparent->AddColumn(this, tmpitem); @@ -201,7 +213,11 @@ //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::ExecRightClick(wxPoint &point) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif int tmpitem = this->m_columnlist->GetSelection(); @@ -273,7 +289,11 @@ //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::OnCloseWindow(wxCloseEvent& event) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif // Make sure the display updates tmpparent->GetClientWindow()->Refresh(); @@ -295,7 +315,11 @@ //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::OnAddColumn(wxCommandEvent& event) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif int tmpitem = this->m_columnlist->GetSelection(); @@ -339,7 +363,11 @@ wxPoint clientpos = GetPosition(); // wxSize clientsize = GetSize(); +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif // wxSize parentsize = tmpparent->GetSize(); // wxSize parentclientsize = tmpparent->GetClientSize(); @@ -395,7 +423,7 @@ // start drag operation wxTextDataObject textData(tmpstr); - wxDropSource source(textData, NULL, + wxDropSource source(textData, this, wxDROP_ICON(dnd_copy), wxDROP_ICON(dnd_move), wxDROP_ICON(dnd_none)); @@ -430,6 +458,7 @@ //////////////////////////////////////////////////////////////////////////////// bool DnDJoin::OnDropText(wxCoord x, wxCoord y, const wxString& text) { +#ifndef __WXGTK__ wxPoint hit(x,y); frmChildTableViewFrame *tmprightframe = (frmChildTableViewFrame*)m_frame; @@ -442,6 +471,7 @@ tmprightframe->m_columnlist->Select(item); +#endif // Construct the Join dialog frmQBJoin dlgJoin(m_frame, text); @@ -459,7 +489,11 @@ } // Get the parent Query Builder +#ifdef __WXGTK__ + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ParentFrame; +#else frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_frame->GetParent(); +#endif // Populate the Join dialog dlgJoin.PopulateData(tmpparent->GetFrameFromAlias(lefttable), m_frame); @@ -490,7 +524,11 @@ void frmChildTableViewFrame::OnMove(wxMoveEvent& event) { // Get the parent Query Builder +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif tmpparent->GetClientWindow()->Refresh(); event.Skip(); @@ -501,8 +539,10 @@ void frmChildTableViewFrame::OnSize(wxSizeEvent& event) { // Get the parent Query Builder +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); tmpparent->GetClientWindow()->Refresh(); +#endif wxSize clientsize = this->GetClientSize(); @@ -526,17 +566,28 @@ if (m_close) m_close->SetSize(clientsize.x-13, 3, 11, 10); +#ifdef __WXGTK__ + /* This can't be used by the limitation why.? H.Saito */ + event.Skip(); + return; +#endif + if (m_columnlist) m_columnlist->SetColumnWidth(0, clientsize.x); event.Skip(); + } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::OnJoinTo(wxCommandEvent& event) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif int n = event.GetId() - MNU_JOINTO; @@ -554,7 +605,11 @@ wxString tmpleftname = this->m_title; +#ifdef __WXGTK__ + DnDJoin tmpjoin(tmpframe,m_ChildFrame); +#else DnDJoin tmpjoin(tmpframe); +#endif tmpjoin.OnDropText(0, 0, tmpleftname + wxT(".") + tmpcolumn); } @@ -562,7 +617,11 @@ //////////////////////////////////////////////////////////////////////////////// void frmChildTableViewFrame::OnRemoveJoin(wxCommandEvent& event) { +#ifdef __WXMSW__ frmQueryBuilder *tmpparent = (frmQueryBuilder*)this->GetParent(); +#else + frmQueryBuilder *tmpparent = (frmQueryBuilder*)m_ChildFrame; +#endif int n = event.GetId() - MNU_REMOVEJOIN; JoinStruct *js = (JoinStruct *)tmpparent->m_joins[n]; --- src/ui/frmQueryBuilder.cpp.orig Tue Oct 28 19:27:41 2003 +++ src/ui/frmQueryBuilder.cpp Wed Dec 3 12:49:26 2003 @@ -1,4 +1,4 @@ -////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////// // // pgAdmin III - PostgreSQL Tools // RCS-ID: $Id: frmQueryBuilder.cpp,v 1.26 2003/10/28 10:27:41 dpage Exp $ @@ -79,14 +79,7 @@ EVT_PAINT(myClientWindow::OnPaint) END_EVENT_TABLE() -frmQueryBuilder::frmQueryBuilder(frmMain* form, pgDatabase *database): - wxMDIParentFrame(form, -1, - wxT("Query Builder: ") + database->GetName() - + wxT(" (") + database->GetServer()->GetName() + wxT(")"), - settings->GetFrmQueryBuilderPos(), - settings->GetFrmQueryBuilderSize(), - wxFRAME_NO_WINDOW_MENU | wxSYSTEM_MENU | wxMAXIMIZE_BOX | - wxMINIMIZE_BOX | wxRESIZE_BORDER) +frmQueryBuilder::frmQueryBuilder(frmMain* form, pgDatabase *database) { // Log wxLogInfo(wxT("Creating Query builder")); @@ -97,6 +90,13 @@ m_database = database; m_server = m_database->GetServer(); changed = FALSE; + wxString title = wxT("Query Builder: ") + m_database->GetName() + + wxT(" (") + m_server->GetName() + wxT(")"); + // Create + this->Create(form, -1, title, + settings->GetFrmQueryBuilderPos(), + settings->GetFrmQueryBuilderSize(), + wxFRAME_NO_WINDOW_MENU | wxSYSTEM_MENU | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER); // Icon SetIcon(wxIcon(sql_xpm)); @@ -253,6 +253,8 @@ // Set the drop target design->SetDropTarget(new DnDDesign(this)); + m_QueryBuilder = (wxMDIParentFrame*)this->GetParent(); + } void frmQueryBuilder::OnSaveHistory(wxCommandEvent& event) @@ -321,6 +323,10 @@ wxMDIClientWindow* frmQueryBuilder::OnCreateClient() { m_clientWindow = new myClientWindow(); +#ifdef __WXGTK__ + m_clientWindow->CreateClient((wxMDIParentFrame*)this, + wxRESIZE_BORDER|wxSIMPLE_BORDER ); +#endif return m_clientWindow; }