Add support High DPI

Выполнен переход на wxWidgets 3.2 для улучшения поддержки DPI.
Также обновлена среда разработки до Microsoft Visual Studio 2022.
This commit is contained in:
lsv 2023-06-25 18:36:16 +05:00
parent 920d424767
commit d07487eac9
13 changed files with 84 additions and 47 deletions

View file

@ -41,9 +41,7 @@ ctlSQLGrid::ctlSQLGrid()
{
}
ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
: wxGrid(parent, id, pos, size, wxWANTS_CHARS | wxVSCROLL | wxHSCROLL)
{
void ctlSQLGrid::setresizedpi() {
// Set cells font
wxFont fntCells(settings->GetSQLFont());
SetDefaultCellFont(fntCells);
@ -53,8 +51,22 @@ ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
SetLabelFont(fntLabel);
SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
SetRowLabelSize(50);
SetDefaultRowSize(fntCells.GetPointSize() * 2 + 2);
SetColLabelSize(fntLabel.GetPointSize() * 4);
}
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);
//SetColLabelSize(fntLabel.GetPointSize() * 4);
SetDefaultCellOverflow(false);
//SetDefaultRenderer(new wxGridCellAutoWrapStringRenderer);
SetDefaultRenderer(new CursorCellRenderer);