the progres dialog now looks decently under Windows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "wx/event.h"
|
||||
#include "wx/gauge.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_PROGRESSDLG
|
||||
@@ -61,12 +62,8 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
m_parent = parent;
|
||||
m_maximum = maximum;
|
||||
|
||||
int height = 70; // FIXME arbitrary numbers
|
||||
if ( hasAbortButton )
|
||||
height += 35;
|
||||
wxFrame::Create(m_parent, -1, title,
|
||||
wxPoint(0, 0), wxSize(220, height),
|
||||
wxDEFAULT_DIALOG_STYLE | style );
|
||||
wxFrame::Create(m_parent, -1, title);
|
||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||
|
||||
wxLayoutConstraints *c;
|
||||
|
||||
@@ -80,7 +77,9 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
|
||||
if ( maximum > 0 )
|
||||
{
|
||||
m_gauge = new wxGauge(this, -1, maximum);
|
||||
m_gauge = new wxGauge(this, -1, maximum,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxGA_HORIZONTAL | wxRAISED_BORDER);
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
|
||||
c->top.Below(m_msg, 2*LAYOUT_Y_MARGIN);
|
||||
@@ -109,6 +108,14 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
m_btnAbort = (wxButton *)NULL;
|
||||
|
||||
SetAutoLayout(TRUE);
|
||||
Layout();
|
||||
|
||||
// calc the height of the dialog
|
||||
Fit();
|
||||
// and set the width from it
|
||||
wxSize size = GetClientSize();
|
||||
SetClientSize(2*size.y, size.y);
|
||||
|
||||
Show(TRUE);
|
||||
Centre(wxCENTER_FRAME | wxBOTH);
|
||||
|
||||
@@ -116,6 +123,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
||||
m_parent->Enable(FALSE);
|
||||
else
|
||||
wxEnableTopLevelWindows(FALSE);
|
||||
|
||||
Enable(TRUE); // enable this window
|
||||
wxYield();
|
||||
}
|
||||
|
Reference in New Issue
Block a user