diff --git a/ctl/ctlSQLGrid.cpp b/ctl/ctlSQLGrid.cpp index 7bd54d4..fb52932 100644 --- a/ctl/ctlSQLGrid.cpp +++ b/ctl/ctlSQLGrid.cpp @@ -50,19 +50,19 @@ void ctlSQLGrid::setresizedpi() { fntLabel.SetWeight(wxBOLD); SetLabelFont(fntLabel); SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTER); - SetRowLabelSize(50); + SetRowLabelSize(FromDIP(50)); } ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size) : wxGrid(parent, id, pos, size, wxWANTS_CHARS | wxVSCROLL | wxHSCROLL) { - +/* Bind(wxEVT_DPI_CHANGED, [this](wxDPIChangedEvent& event) { setresizedpi(); event.Skip(); }); - +*/ setresizedpi(); //SetDefaultRowSize(fntCells.GetPointSize() * 2 + 2); @@ -122,8 +122,8 @@ void ctlSQLGrid::DrawColLabel( wxDC& dc, int col ) { wxRect ar = rect; // make a rect for the arrow - ar.height = 4; - ar.width = 8; + ar.height = FromDIP(4); + ar.width = FromDIP(8); ar.y += (rect.height - ar.height)/2; ar.x = ar.x + rect.width - 3*ar.width/2; int arrowSpace = 0; @@ -903,7 +903,7 @@ void ctlSQLGrid::AutoSizeColumn(int col, bool setAsMin, bool doLimit) void ctlSQLGrid::AutoSizeColumns(bool setAsMin) { - wxCoord newSize, oldSize; + wxCoord newSize, oldSize, maxH=0; wxCoord maxSize, totalSize = 0, availSize; int col, nCols = GetNumberCols(); int row, nRows = GetNumberRows(); @@ -941,6 +941,8 @@ void ctlSQLGrid::AutoSizeColumns(bool setAsMin) if ( GetColLabelTextOrientation() == wxVERTICAL ) w = h; + if (h > maxH) + maxH = h; if ( w > newSize ) newSize = w; @@ -948,14 +950,14 @@ void ctlSQLGrid::AutoSizeColumns(bool setAsMin) newSize = GetRowLabelSize(); else // leave some space around text - newSize += 6; + newSize += FromDIP(EXTRAEXTENT_WIDTH); colMaxSizes.Add(newSize); } SetColSize(col, newSize); totalSize += newSize; } - + SetColLabelSize(maxH+ FromDIP(EXTRAEXTENT_HEIGHT)); availSize = GetClientSize().GetWidth() - GetRowLabelSize(); // Second pass: shrink wide columns if exceeded available width @@ -998,8 +1000,8 @@ wxSize ctlSQLGrid::GetBestSize(int row, int col) { wxClientDC dc(GetGridWindow()); size = renderer->GetBestSize(*this, *attr, dc, row, col); - int h = renderer->GetBestHeight(*this, *attr, dc, row, col, size.GetWidth()); - size.SetHeight(h); +// int h = renderer->GetBestHeight(*this, *attr, dc, row, col, size.GetWidth()) + size.SetHeight(size.GetHeight() + FromDIP(EXTRAEXTENT_HEIGHT)); renderer->DecRef(); } diff --git a/frm/frmMain.cpp b/frm/frmMain.cpp index a828be1..76a1bb3 100644 --- a/frm/frmMain.cpp +++ b/frm/frmMain.cpp @@ -268,9 +268,12 @@ frmMain::frmMain(const wxString &title) frmMain::~frmMain() { // Store the servers, to ensure we store the last database/schema etc - StoreServers(); + if (settings) { + StoreServers(); - settings->Write(wxT("frmMain/Perspective-") + wxString(FRMMAIN_PERSPECTIVE_VER), manager.SavePerspective()); + settings->Write(wxT("frmMain/Perspective-") + wxString(FRMMAIN_PERSPECTIVE_VER), manager.SavePerspective()); + + } manager.UnInit(); // Clear the treeview diff --git a/frm/frmStatus.cpp b/frm/frmStatus.cpp index 6e80e3b..b71647e 100644 --- a/frm/frmStatus.cpp +++ b/frm/frmStatus.cpp @@ -241,7 +241,7 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr SetTitle(_title); SetIcon(*server_status_png_ico); RestorePosition(-1, -1, 700, 500, 700, 500); - SetMinSize(wxSize(700, 500)); + SetMinSize(FromDIP(wxSize(700, 500))); SetFont(settings->GetSystemFont()); // Build menu bar @@ -315,17 +315,17 @@ frmStatus::frmStatus(frmMain *form, const wxString &_title, pgConn *conn) : pgFr // Set up toolbar toolBar = new ctlMenuToolbar(this, -1, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_NODIVIDER); toolBar->SetToolBitmapSize(FromDIP(wxSize(32, 32))); - toolBar->AddTool(MNU_REFRESH, wxEmptyString, *readdata_png_bmp, _("Refresh"), wxITEM_NORMAL); + toolBar->AddTool(MNU_REFRESH, wxEmptyString, *GetBundleSVG(readdata_png_bmp, "refresh.svg", wxSize(16, 16)), _("Refresh"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_COPY, wxEmptyString, *clip_copy_png_bmp, _("Copy selected text to clipboard"), wxITEM_NORMAL); - toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, *clip_copy_png_bmp, _("Open the query tool with the selected query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COPY, wxEmptyString, *GetBundleSVG(clip_copy_png_bmp, "clip_copy.svg", wxSize(16, 16)), _("Copy selected text to clipboard"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COPY_QUERY, wxEmptyString, *GetBundleSVG(clip_copy_png_bmp, "clip_copy_sql.svg", wxSize(16, 16)), _("Open the query tool with the selected query"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_CANCEL, wxEmptyString, *query_cancel_png_bmp, _("Cancel query"), wxITEM_NORMAL); - toolBar->AddTool(MNU_TERMINATE, wxEmptyString, *terminate_backend_png_bmp, _("Terminate backend"), wxITEM_NORMAL); - toolBar->AddTool(MNU_COMMIT, wxEmptyString, *storedata_png_bmp, _("Commit transaction"), wxITEM_NORMAL); - toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, *delete_png_bmp, _("Rollback transaction"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CANCEL, wxEmptyString, *GetBundleSVG(query_cancel_png_bmp, "query_cancel.svg", wxSize(16, 16)), _("Cancel query"), wxITEM_NORMAL); + toolBar->AddTool(MNU_TERMINATE, wxEmptyString, *GetBundleSVG(terminate_backend_png_bmp, "terminate_backend.svg", wxSize(16, 16)), _("Terminate backend"), wxITEM_NORMAL); + toolBar->AddTool(MNU_COMMIT, wxEmptyString, *GetBundleSVG(storedata_png_bmp, "file_save.svg", wxSize(16, 16)), _("Commit transaction"), wxITEM_NORMAL); + toolBar->AddTool(MNU_ROLLBACK, wxEmptyString, *GetBundleSVG(delete_png_bmp, "drop.svg", wxSize(16, 16)), _("Rollback transaction"), wxITEM_NORMAL); toolBar->AddSeparator(); - toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, *sortfilterclear_png_bmp, _("Clear filter"), wxITEM_NORMAL); + toolBar->AddTool(MNU_CLEAR_FILTER_SERVER_STATUS, wxEmptyString, *GetBundleSVG(sortfilterclear_png_bmp, "sortfilterclear.svg", wxSize(16, 16)), _("Clear filter"), wxITEM_NORMAL); toolBar->AddSeparator(); cbLogfiles = new wxComboBox(toolBar, CTL_LOGCBO, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, diff --git a/pgAdmin3.cpp b/pgAdmin3.cpp index 355035f..c04b77e 100644 --- a/pgAdmin3.cpp +++ b/pgAdmin3.cpp @@ -850,7 +850,7 @@ int pgAdmin3::OnExit() // Delete the settings object to ensure settings are saved. delete settings; - + settings = NULL; #ifdef __WXMSW__ WSACleanup(); #endif