Skip to content

Commit

Permalink
FIX:fixed the fix window cant not display full text
Browse files Browse the repository at this point in the history
Change-Id: Ibab602396e2261059d7e730dbeea1f3e3282e841
  • Loading branch information
walterwongbbl authored and lanewei120 committed Dec 15, 2022
1 parent 4d8eefb commit c581117
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
36 changes: 23 additions & 13 deletions src/slic3r/GUI/Widgets/ProgressDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,21 @@ wxString ProgressDialog::FormatString(wxString title)
}
} else {
m_msg->SetLabel(title);
Layout();
m_msg->SetMaxSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x + 5, -1));
m_msg->SetMinSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x + 5, -1));
m_msg->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x + 5);
m_msg->Layout();
m_msg->Fit();

m_msg_scrolledWindow->SetSize(wxSize(FromDIP(m_msg->GetSize().x + 5), FromDIP(150)));
m_msg_scrolledWindow->SetMinSize(wxSize(FromDIP(m_msg->GetSize().x + 5), FromDIP(150)));
m_msg_scrolledWindow->SetMaxSize(wxSize(FromDIP(m_msg->GetSize().x + 5), FromDIP(150)));
// m_msg_scrolledWindow->Layout();
m_msg_scrolledWindow->Fit();
}


Fit();
//Fit();
return title;
}

Expand Down Expand Up @@ -185,17 +196,16 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int

m_sizer_main->Add(m_simplebook, 1, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
} else {
wxScrolledWindow* m_msg_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
m_msg_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL );
m_msg_scrolledWindow->SetScrollRate(0,5);
m_msg_scrolledWindow->SetMinSize(wxSize(FromDIP(80), FromDIP(300)));
wxBoxSizer* m_msg_sizer= new wxBoxSizer(wxVERTICAL);

m_msg = new wxStaticText(m_msg_scrolledWindow, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1), 0);
m_msg->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
m_msg->SetFont(::Label::Body_13);
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);

m_msg_sizer->Add( m_msg, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(5) );
m_msg_sizer->Add(m_msg, 0, wxEXPAND | wxALL, 0);
m_msg_scrolledWindow->SetSizer(m_msg_sizer);
m_msg_scrolledWindow->Layout();
m_msg_sizer->Fit(m_msg_scrolledWindow);
Expand All @@ -218,10 +228,10 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));

#ifdef __WXMSW__
m_block_left = new wxWindow(m_gauge, wxID_ANY, wxPoint(0, 0), wxSize(FromDIP(2), PROGRESSDIALOG_GAUGE_SIZE.y * 2));
m_block_left->SetBackgroundColour(PROGRESSDIALOG_DEF_BK);
m_block_right = new wxWindow(m_gauge, wxID_ANY, wxPoint(PROGRESSDIALOG_GAUGE_SIZE.x - 2, 0), wxSize(FromDIP(2), PROGRESSDIALOG_GAUGE_SIZE.y * 2));
m_block_right->SetBackgroundColour(PROGRESSDIALOG_DEF_BK);
//m_block_left = new wxWindow(m_gauge, wxID_ANY, wxPoint(0, 0), wxSize(FromDIP(2), PROGRESSDIALOG_GAUGE_SIZE.y * 2));
//m_block_left->SetBackgroundColour(PROGRESSDIALOG_DEF_BK);
//m_block_right = new wxWindow(m_gauge, wxID_ANY, wxPoint(PROGRESSDIALOG_GAUGE_SIZE.x - 2, 0), wxSize(FromDIP(2), PROGRESSDIALOG_GAUGE_SIZE.y * 2));
//m_block_right->SetBackgroundColour(PROGRESSDIALOG_DEF_BK);
#endif
wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);

Expand Down Expand Up @@ -778,10 +788,10 @@ void ProgressDialog::DoSetSize(int x, int y, int width, int height, int sizeFlag
if (m_button_cancel != nullptr) { m_button_cancel->SetMinSize(PROGRESSDIALOG_CANCEL_BUTTON_SIZE); }

#ifdef __WXMSW__
if (m_block_left != nullptr && m_block_right != nullptr) {
m_block_left->SetPosition(wxPoint(0, 0));
m_block_right->SetPosition(wxPoint(PROGRESSDIALOG_GAUGE_SIZE.x - 2, 0));
}
//if (m_block_left != nullptr && m_block_right != nullptr) {
// m_block_left->SetPosition(wxPoint(0, 0));
// m_block_right->SetPosition(wxPoint(PROGRESSDIALOG_GAUGE_SIZE.x - 2, 0));
//}
#endif
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
Expand Down
19 changes: 10 additions & 9 deletions src/slic3r/GUI/Widgets/ProgressDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ class WXDLLIMPEXP_CORE ProgressDialog : public wxDialog

int m_mode = 0; // 0 is 1line mode 1 is 2line mode

bool m_adaptive = {false};
wxSizer * m_sizer_main = {nullptr};
wxPanel * m_top_line= {nullptr};
wxSimplebook * m_simplebook= {nullptr};
wxPanel * m_panel_2line= {nullptr};
wxPanel * m_panel_1line= {nullptr};
Button* m_button_cancel = {nullptr};
wxWindow * m_block_left = {nullptr};
wxWindow * m_block_right = {nullptr};
bool m_adaptive = {false};
wxSizer * m_sizer_main = {nullptr};
wxPanel * m_top_line= {nullptr};
wxSimplebook * m_simplebook= {nullptr};
wxPanel * m_panel_2line= {nullptr};
wxPanel * m_panel_1line= {nullptr};
Button* m_button_cancel = {nullptr};
//wxWindow * m_block_left = {nullptr};
//wxWindow * m_block_right = {nullptr};
wxScrolledWindow* m_msg_scrolledWindow = {nullptr};

protected:
// Update just the m_maximum field, this is used by public SetRange() but,
Expand Down

0 comments on commit c581117

Please sign in to comment.