diff --git a/ctl/ctlTree.cpp b/ctl/ctlTree.cpp index 5cfb85f..88ecc3d 100644 --- a/ctl/ctlTree.cpp +++ b/ctl/ctlTree.cpp @@ -198,13 +198,14 @@ void ctlTree::OnMouse(wxMouseEvent& event) else { if ((flags & wxTREE_HITTEST_ONITEMINDENT) == wxTREE_HITTEST_ONITEMINDENT && (item==GetSelection())) { wxRect r; - wxClientDC dc(this); GetBoundingRect(item, r, true); r.width = r.x-19; r.x = r.x - 19; + if (r.x < 10) return; wxTreeItemId prev; wxTreeItemId itemParent = item; wxImageList *list=this->GetImageList(); + wxClientDC dc(this); bool ex = false; while (!ex) { //ex = true; @@ -214,17 +215,17 @@ void ctlTree::OnMouse(wxMouseEvent& event) if (!itemParent.IsOk()) break; r.x = r.x - 19; //if (r.x >= pt.x) ex = false; - - dc.SetClippingRegion(r.x + 1-19, r.y + 1, + int image = this->GetItemImage(itemParent); + if (image >= 0) { + dc.SetClippingRegion(r.x + 1 - 19, r.y + 1, 16, 16); - int image = this->GetItemImage(itemParent); list->Draw(image, dc, - r.x + 1-19, + r.x + 1 - 19, r.y + 1, wxIMAGELIST_DRAW_TRANSPARENT ); dc.DestroyClippingRegion(); - + } } // dc.SetBrush(*wxRED); // dc.SetPen(*wxTRANSPARENT_PEN); diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index ba68d25..e56a4d4 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -777,13 +777,13 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w wxString pref=_conn->GetDbname(); bool modeUnicode = settings->GetUnicodeFile(); - wxString activePage; + wxArrayString activePage; wxString f = wxFindFirstFile(tempDir+wxT("*.a")); while ( !f.empty() ) { filename=f.AfterLast('\\').BeforeLast('.'); if (filename.BeforeFirst('.') == "_active") { - activePage = filename.AfterFirst('.'); + activePage.Add(filename.AfterFirst('.')); } if ((f.AfterLast('\\').StartsWith(pref+wxT("."))||(filename.BeforeLast('.').IsEmpty()))) { wxUtfFile file(f, wxFile::read, modeUnicode ? wxFONTENCODING_UTF8 : wxFONTENCODING_DEFAULT); @@ -830,8 +830,9 @@ frmQuery::frmQuery(frmMain *form, const wxString &_title, pgConn *_conn, const w //outputPane->GetPageText(curpage) == _("History"); for (int i = 0; i < sqlQueryBook->GetPageCount(); i++) { wxString textpage = sqlQueryBook->GetPageText(i); - if (textpage ==activePage) { + if (wxNOT_FOUND !=activePage.Index(textpage)) { sqlQueryBook->SetSelection(i); + break; //sqlQueryBook->ChangeSelection(i); //if (sqlQueryBook->GetSelection()!=i) sqlQueryBook->SetSelection(i); } @@ -4160,8 +4161,9 @@ void frmQuery::fileMarkerActive(bool addOrRemove, wxString &sqlTabName) { wxString fn = tempDir + wxT("_active.") + tabname + ".a"; //if (sqlTabName.Right(1)=='*' ) tabname= - if (addOrRemove) - wxUtfFile file(fn, wxFile::write, wxFONTENCODING_UTF8); + if (addOrRemove) + //wxUtfFile file(fn, wxFile::write, wxFONTENCODING_UTF8); + wxFile file(fn, wxFile::write); else if (wxFileName::FileExists(fn)) wxRemoveFile(fn);