--- src/ui/frmChildTableViewFrame.cpp.orig Mon Oct 27 02:33:00 2003 +++ src/ui/frmChildTableViewFrame.cpp Tue Nov 4 15:30:47 2003 @@ -75,8 +75,15 @@ //////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////// +#ifdef __WXMSW__ frmChildTableViewFrame::frmChildTableViewFrame(wxMDIParentFrame* frame, wxString table, wxString alias, pgDatabase *database) +#else +frmChildTableViewFrame::frmChildTableViewFrame(wxMDIParentFrame* frame, + wxString table, wxString alias, pgDatabase *database): + wxMDIChildFrame(frame, -1, alias, wxDefaultPosition, + wxSize(200, 200), wxRESIZE_BORDER|wxSIMPLE_BORDER ) +#endif { int rowct = 0; m_columnlist = NULL; @@ -100,10 +107,11 @@ int descent; int leading; +#ifdef __WXMSW__ // Create the frame this->Create(frame, -1, alias, wxDefaultPosition, wxSize(200, 200), wxRESIZE_BORDER|wxSIMPLE_BORDER ); - +#endif // Create the table name // wxStaticText *tmpstatic = new wxStaticText(this, -1, // m_title, wxPoint(2,1), wxSize(m_titlewidth, 15), wxNO_BORDER, @@ -125,6 +133,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; @@ -175,6 +184,9 @@ // Set the drop target m_columnlist->SetDropTarget(new DnDJoin(this)); + + m_ChildFrame = (wxMDIParentFrame*)frame; + } //////////////////////////////////////////////////////////////////////////////// @@ -190,7 +202,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 +217,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 +293,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 +319,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 +367,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 +427,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)); @@ -490,7 +522,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 +537,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(); @@ -536,7 +574,11 @@ //////////////////////////////////////////////////////////////////////////////// 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; @@ -562,7 +604,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 Tue Nov 4 15:37:09 2003 @@ -78,7 +78,9 @@ BEGIN_EVENT_TABLE(myClientWindow, wxMDIClientWindow) EVT_PAINT(myClientWindow::OnPaint) END_EVENT_TABLE() - +#ifdef __WXMSW__ +frmQueryBuilder::frmQueryBuilder(frmMain* form, pgDatabase *database) +#else frmQueryBuilder::frmQueryBuilder(frmMain* form, pgDatabase *database): wxMDIParentFrame(form, -1, wxT("Query Builder: ") + database->GetName() @@ -87,6 +89,7 @@ settings->GetFrmQueryBuilderSize(), wxFRAME_NO_WINDOW_MENU | wxSYSTEM_MENU | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | wxRESIZE_BORDER) +#endif { // Log wxLogInfo(wxT("Creating Query builder")); @@ -97,7 +100,15 @@ m_database = database; m_server = m_database->GetServer(); changed = FALSE; - +#ifdef __WXMSW__ + 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); +#endif // Icon SetIcon(wxIcon(sql_xpm)); @@ -252,6 +263,8 @@ // Set the drop target design->SetDropTarget(new DnDDesign(this)); + + m_QueryBuilder = (wxMDIParentFrame*)this->GetParent(); } --- src/include/frmQueryBuilder.h.orig Mon Oct 27 02:32:59 2003 +++ src/include/frmQueryBuilder.h Tue Nov 4 12:48:11 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 Tue Nov 4 12:40:46 2003 @@ -93,6 +93,7 @@ // Controls myList *m_columnlist; + wxMDIParentFrame *m_ChildFrame; // Data wxString m_title;