1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Information window when app is busy
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
10 #pragma implementation "busyinfo.h"
13 #include "wx/wxprec.h"
21 #include "wx/busyinfo.h"
22 #include "wx/stattext.h"
27 wxInfoFrame::wxInfoFrame(wxWindow
*parent
, const wxString
& message
)
28 : wxFrame(parent
, -1, wxT(""),
29 wxDefaultPosition
, wxDefaultSize
,
30 wxSIMPLE_BORDER
| wxFRAME_TOOL_WINDOW
)
32 wxPanel
*panel
= new wxPanel( this );
33 wxStaticText
*text
= new wxStaticText(panel
, -1, message
);
35 panel
->SetCursor(*wxHOURGLASS_CURSOR
);
36 text
->SetCursor(*wxHOURGLASS_CURSOR
);
38 // make the frame of at least the standard size (400*80) but big enough
39 // for the text we show
40 wxSize sizeText
= text
->GetBestSize();
41 SetClientSize(wxMax(sizeText
.x
, 340) + 60, wxMax(sizeText
.y
, 40) + 40);
43 // need to size the panel correctly first so that text->Centre() works
44 panel
->SetSize(GetClientSize());
50 wxBusyInfo::wxBusyInfo(const wxString
& message
, wxWindow
*parent
)
52 m_InfoFrame
= new wxInfoFrame( parent
, message
);
53 m_InfoFrame
->Show(TRUE
);
55 m_InfoFrame
->Refresh();
59 wxBusyInfo::~wxBusyInfo()
61 m_InfoFrame
->Show(FALSE
);