#316 good size of dialog & content in sync with display scaling.

but the html pictures as they blurry if I use a %
This commit is contained in:
supermerill 2020-07-10 00:38:50 +02:00
parent 89c475a439
commit 196c96d818
11 changed files with 44 additions and 30 deletions

View File

@ -8,7 +8,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Bed Level Calibration</h1>
</td>
<td style="text-align: right;">need: nothing</td>
@ -22,7 +22,7 @@
<p>When clicking on the Generate button, the program will create and slice the test print. You have to send it to your printer and print it. After the print end, check the result of each corners and the middle one against the photos below. You will have to tune your printer/firmware to correct the height if needed.</p>
<p>Read the notes and advices below for more information.</p>
<h2>Results</h2>
<table>
<table width="100%">
<tbody>
<tr>
<td><img src="./low_ll.jpg" width="100" height="200" /></td>

View File

@ -9,7 +9,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Bridge Flow Ratio Calibration</h1>
</td>
<td style="text-align: right;"><strong>

View File

@ -9,7 +9,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Calibration Cube</h1>
</td>
<td style="text-align: right;"><strong>

View File

@ -9,7 +9,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Filament Flow Calibration</h1>
</td>
<td style="text-align: right;"><strong>
@ -25,7 +25,7 @@
After verifying the result with the help of the table below, you have to modify the filament extrusion multiplier in your filament preset (if the -20 is the best, change the multiplier from 1 to 0.8, see the formula below). Don't forget to save it afterwards! You can continue with the 2.5 step if you want a bit more precision.</p>
<h2>Results</h2>
<h4>Example:</h4>
<table>
<table width="100%">
<tbody>
<tr>
<td><img src="./m20.jpg" width="150" height="150" /></td>

View File

@ -9,7 +9,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Filament Temperature Calibration</h1>
</td>
<td style="text-align: right;"><strong>
@ -27,7 +27,7 @@ Note that this test is dependant of the cooling you selected. You can print this
<h2>Results / observation</h2>
<p>The goal is to choose the highest temperature possible that doesn't produce artifacts.</p>
<p>First, you have to analyse the tower. Each floor has the according temperature written on it.</p>
<table>
<table width="100%">
<tbody>
<tr>
<td><img src="./temp_tower_180.jpg" width="400" height="100" /></td>

View File

@ -5,7 +5,7 @@
<title>Calibrations</title>
</head>
<body>
<h1>Introduction</h1>
<h1 style="text-align: center;">Introduction</h1>
<p>Welcome to the calibration menu. This menu is here to help you print quick & efficient calibrations.</p>
<h2>Why?</h2>
<p>Most printers profile should work pretty good with default settings, but if you encounter problems, or if you want to go a step above in quality, you have to ensure that everything is well calibrated. Calibrations can be divided in three groups: printer, filament and slicer.</p>

View File

@ -9,7 +9,7 @@
<table width="100%">
<tbody>
<tr>
<td>
<td style="text-align: center;">
<h1>Ironing Pattern Calibration</h1>
</td>
<td style="text-align: right;"><strong>
@ -23,7 +23,7 @@
<p><strong>You need to do the filament flow calibration and the bridge flow ratio before this one.</strong> It's better if you have done the filament temperature.</p>
<p>This calibration method will print test samples with various levels of over-bridge flow ratio, between 100 and 125. Choose the lowest value on which the top surface is smooth without rough "holes".</p>
<h2>Results</h2>
<table>
<table width="100%">
<tbody>
<h4>Exemple:</h4>
<tr>

View File

@ -25,7 +25,7 @@ namespace GUI {
#if ENABLE_SCROLLABLE
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
#else
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
#endif // ENABLE_SCROLLABLE
{
this->gui_app = app;
@ -45,10 +45,15 @@ void CalibrationAbstractDialog::create(std::string html_path, wxSize dialog_size
//html
html_viewer = new wxHtmlWindow(this, wxID_ANY,
wxDefaultPosition, dialog_size, wxHW_SCROLLBAR_AUTO);
wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
html_viewer->LoadPage(Slic3r::resources_dir()+ html_path);
main_sizer->Add(html_viewer, 1, wxEXPAND | wxALL, 5);
wxDisplay display(wxDisplay::GetFromWindow(main_frame));
wxRect screen = display.GetClientArea();
dialog_size.x = std::min(int(dialog_size.x * this->scale_factor()), screen.width - 50);
dialog_size.y = std::min(int(dialog_size.y * this->scale_factor()), screen.height - 50);
wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer();
create_buttons(buttons);
@ -63,6 +68,7 @@ void CalibrationAbstractDialog::create(std::string html_path, wxSize dialog_size
SetSizer(main_sizer);
main_sizer->SetSizeHints(this);
this->SetSize(dialog_size.x, dialog_size.y);
}
void CalibrationAbstractDialog::close_me(wxCommandEvent& event_args) {
@ -120,8 +126,9 @@ void CalibrationAbstractDialog::on_dpi_changed(const wxRect& suggested_rect)
{
msw_buttons_rescale(this, em_unit(), { wxID_OK });
wxSize oldSize = this->GetSize();
Layout();
Fit();
this->SetSize(oldSize.x * this->scale_factor() / this->prev_scale_factor(), oldSize.y * this->scale_factor() / this->prev_scale_factor());
Refresh();
}

View File

@ -24,7 +24,7 @@ public:
private:
wxPanel* create_header(wxWindow* parent, const wxFont& bold_font);
protected:
void create(std::string html_path, wxSize dialogsize = wxSize(800, 500));
void create(std::string html_path, wxSize dialogsize = wxSize(850, 550));
virtual void create_buttons(wxStdDialogButtonSizer*) = 0;
void on_dpi_changed(const wxRect& suggested_rect) override;
void close_me(wxCommandEvent& event_args);

View File

@ -10,7 +10,7 @@ class CalibrationBridgeDialog : public CalibrationAbstractDialog
{
public:
CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create("/calibration/bridge_flow/bridge_flow.html", wxSize(600, 300)); }
CalibrationBridgeDialog(GUI_App* app, MainFrame* mainframe) : CalibrationAbstractDialog(app, mainframe, "Bridge calibration") { create("/calibration/bridge_flow/bridge_flow.html", wxSize(850, 400)); }
virtual ~CalibrationBridgeDialog() { }
protected:

View File

@ -222,21 +222,14 @@ FreeCADDialog::FreeCADDialog(GUI_App* app, MainFrame* mainframe)
createSTC();
m_errors = new wxTextCtrl(this, wxID_ANY, "",
wxDefaultPosition, wxSize(600, 100), wxHW_SCROLLBAR_AUTO | wxTE_MULTILINE);
wxDefaultPosition, wxSize(200, 100 * this->scale_factor()), wxHW_SCROLLBAR_AUTO | wxTE_MULTILINE);
m_errors->SetEditable(false);
m_help = new wxTextCtrl(this, wxID_ANY, create_help_text(),
wxDefaultPosition, wxSize(200, 500), wxTE_MULTILINE);
wxDefaultPosition, wxSize(200 * this->scale_factor(), 200), wxTE_MULTILINE);
m_help->SetEditable(false);
//wxBoxSizer *m_icons = new wxBoxSizer(wxHORIZONTAL);
//m_icons->Add(16,16,0,0,0,freecad_icon);
//wxSizerItem* Add(wxSizer * sizer, const wxGBPosition & pos, const wxGBSpan & span = wxDefaultSpan, int flag = 0, int border = 0, wxObject * userData = NULL)
//wxSizerItem* Add(wxSizer * sizer, int proportion = 0, int flag = 0, int border = 0, wxObject * userData = NULL)
main_sizer->Add(m_text, wxGBPosition(1,1), wxGBSpan(2,1), wxEXPAND | wxALL, 2);
//main_sizer->Add(m_icons, wxGBPosition(1, 2), wxGBSpan(1, 1), 0, 2);
//main_sizer->Add(m_help, wxGBPosition(2, 2), wxGBSpan(2, 1), wxEXPAND | wxVERTICAL, 2);
main_sizer->Add(m_help, wxGBPosition(1, 2), wxGBSpan(3, 1), wxEXPAND | wxVERTICAL, 2);
main_sizer->Add(m_errors, wxGBPosition(3, 1), wxGBSpan(1, 1), wxEXPAND | wxHORIZONTAL, 2);
@ -245,7 +238,7 @@ FreeCADDialog::FreeCADDialog(GUI_App* app, MainFrame* mainframe)
wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer();
wxButton* bt_new = new wxButton(this, wxID_FILE3, _(L("New")));
wxButton* bt_new = new wxButton(this, wxID_FILE1, _(L("New")));
bt_new->Bind(wxEVT_BUTTON, &FreeCADDialog::new_script, this);
buttons->Add(bt_new);
wxButton* bt_load = new wxButton(this, wxID_FILE2, _(L("Load")));
@ -260,7 +253,7 @@ FreeCADDialog::FreeCADDialog(GUI_App* app, MainFrame* mainframe)
buttons->Add(bt_quick_save);
buttons->AddSpacer(30);
wxButton* bt_create_geometry = new wxButton(this, wxID_FILE1, _(L("Generate")));
wxButton* bt_create_geometry = new wxButton(this, wxID_APPLY, _(L("Generate")));
bt_create_geometry->Bind(wxEVT_BUTTON, &FreeCADDialog::create_geometry, this);
buttons->Add(bt_create_geometry);
@ -276,6 +269,14 @@ FreeCADDialog::FreeCADDialog(GUI_App* app, MainFrame* mainframe)
SetSizer(main_sizer);
main_sizer->SetSizeHints(this);
wxSize dialog_size(800 * this->scale_factor(), 600 * this->scale_factor());
wxDisplay display(wxDisplay::GetFromWindow(main_frame));
wxRect screen = display.GetClientArea();
dialog_size.x = std::min(dialog_size.x, screen.width - 50);
dialog_size.y = std::min(dialog_size.y, screen.height - 50);
this->SetSize(dialog_size);
//set keyboard shortcut
wxAcceleratorEntry entries[6];
//entries[0].Set(wxACCEL_CTRL, (int) 'X', bt_create_geometry->GetId());
@ -673,7 +674,7 @@ void FreeCADDialog::on_key_type(wxKeyEvent& event)
void FreeCADDialog::createSTC()
{
m_text = new wxStyledTextCtrl(this, wxID_ANY,
wxDefaultPosition, wxSize(600,400), wxHW_SCROLLBAR_AUTO);
wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO);
//m_text->SetMarginWidth(MARGIN_LINE_NUMBERS, 50);
m_text->StyleSetForeground(wxSTC_STYLE_LINENUMBER, wxColour(75, 75, 75));
@ -686,6 +687,7 @@ void FreeCADDialog::createSTC()
m_text->SetIndentationGuides(wxSTC_IV_LOOKFORWARD);
m_text->SetBackSpaceUnIndents(true);
m_text->SetTabIndents(true);
m_text->SetZoom(int((this->scale_factor() - 1) * 10));
m_text->SetWrapMode(wxSTC_WRAP_WORD);
@ -731,10 +733,15 @@ void FreeCADDialog::createSTC()
void FreeCADDialog::on_dpi_changed(const wxRect& suggested_rect)
{
msw_buttons_rescale(this, em_unit(), { wxID_OK });
msw_buttons_rescale(this, em_unit(), { wxID_FILE1, wxID_FILE2, wxID_FILE3, wxID_FILE4, wxID_APPLY, wxID_CLOSE });
m_errors->SetMinSize(wxSize(200, 100 * this->scale_factor()));
m_help->SetMinSize(wxSize(200 * this->scale_factor(), 200));
m_text->SetZoom(int((this->scale_factor() - 1) * 10));
wxSize oldSize = this->GetSize();
Layout();
Fit();
this->SetSize(oldSize.x * this->scale_factor() / this->prev_scale_factor(), oldSize.y * this->scale_factor() / this->prev_scale_factor());
Refresh();
}