diff --git a/ctl/ctlSQLGrid.cpp b/ctl/ctlSQLGrid.cpp index 88acb20..724bbcb 100644 --- a/ctl/ctlSQLGrid.cpp +++ b/ctl/ctlSQLGrid.cpp @@ -1452,7 +1452,7 @@ retry: if (pos == wxString::npos) pos = len; int x=rect.GetRight()-1; - int yb=rect.GetTop(); + int yb=rect.GetTop()+1; //GRID_TEXT_MARGIN int c=0; while (pos > 0) { diff --git a/include/utils/popuphelp.h b/include/utils/popuphelp.h index 03bc928..212e36c 100644 --- a/include/utils/popuphelp.h +++ b/include/utils/popuphelp.h @@ -27,6 +27,10 @@ public: return isvalid; } void SetSizePopup(const wxSize& sz) { + //wxPoint p=this->GetScreenPosition(); + //p.x=p.x-50; + //p.y=p.y-50; + //SetSize(p.x,p.y, sz.x,sz.y,wxSIZE_FORCE); SetSize(sz); Layout(); Fit(); @@ -84,7 +88,7 @@ public: //htmlWindow->SetInitialSize(wxSize(htmlWindow->GetInternalRepresentation()->GetWidth(), htmlWindow->GetInternalRepresentation()->GetHeight())); //SetSize(wxSize(300,150)); - topsizer->Add(htmlWindow, 1, wxALL, 1); + topsizer->Add(htmlWindow, 1, wxEXPAND|wxALL, 1); //wxButton* bu1 = new wxButton(this, wxID_OK, _("OK")); //bu1->SetDefault(); @@ -157,21 +161,30 @@ public: htmlWindow->Bind(wxEVT_KEY_DOWN, [&](wxKeyEvent& event) { if (event.GetKeyCode() == WXK_ESCAPE) { Hide(); + event.Skip(); return; } if (event.GetKeyCode() == WXK_NUMPAD_ADD) { wxSize sz=this->GetSize(); wxSize szh=htmlWindow->GetSize(); - szh.IncBy(50,50); - htmlWindow->SetSize(szh); - std::cout << sz.GetWidth() << "," << sz.GetHeight() << std::endl; - sz.IncBy(50,50); - this->SetSizePopup(sz); - wxPoint p; - p=this->GetScreenPosition(); - p.x=p.x-50; - p.y=p.y-50; - //this->Move(p); + int xx, yy; + htmlWindow->GetVirtualSize(&xx, &yy); + wxPoint p=GetScreenPosition(); + wxSize sizeScreen=getScreenSizeForPoint(p); + if (yy>szh.y) { + if (p.y+sz.y +50 50) {p.y=p.y-50; sz.y+=50;} + } + if (p.x+sz.x +50 50) {p.x=p.x-50; sz.x+=50;} + SetSize(p.x,p.y,sz.x,sz.y,wxSIZE_USE_EXISTING); + Layout(); + wxSize newsz=GetSize(); + //std::cout << sz.GetWidth() << "," << sz.GetHeight() << " new: " << newsz.GetWidth() << "," << newsz.GetHeight() << std::endl; } if (event.GetKeyCode() == WXK_PAGEDOWN) htmlWindow->ScrollPages(1); if (event.GetKeyCode() == WXK_PAGEUP) htmlWindow->ScrollPages(-1);