2010-08-18 18:49:02 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/msw/progdlg.h
|
|
|
|
// Purpose: wxProgressDialog
|
|
|
|
// Author: Rickard Westerlund
|
|
|
|
// Created: 2010-07-22
|
|
|
|
// Copyright: (c) 2010 wxWidgets team
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_PROGDLG_H_
|
|
|
|
#define _WX_PROGDLG_H_
|
|
|
|
|
|
|
|
class wxProgressDialogTaskRunner;
|
|
|
|
class wxProgressDialogSharedData;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxProgressDialog : public wxGenericProgressDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxProgressDialog(const wxString& title, const wxString& message,
|
|
|
|
int maximum = 100,
|
|
|
|
wxWindow *parent = NULL,
|
|
|
|
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
|
|
|
|
|
|
|
|
virtual ~wxProgressDialog();
|
|
|
|
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL) wxOVERRIDE;
|
|
|
|
virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL) wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2017-10-27 20:01:24 -04:00
|
|
|
virtual void Resume() wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2017-10-31 11:47:38 -04:00
|
|
|
virtual int GetValue() const wxOVERRIDE;
|
|
|
|
virtual wxString GetMessage() const wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2017-10-31 11:47:38 -04:00
|
|
|
virtual void SetRange(int maximum) wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
|
|
|
// Return whether "Cancel" or "Skip" button was pressed, always return
|
|
|
|
// false if the corresponding button is not shown.
|
2017-10-31 11:47:38 -04:00
|
|
|
virtual bool WasSkipped() const wxOVERRIDE;
|
|
|
|
virtual bool WasCancelled() const wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual void SetTitle(const wxString& title) wxOVERRIDE;
|
|
|
|
virtual wxString GetTitle() const wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2017-10-04 10:06:33 -04:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons) wxOVERRIDE;
|
2017-10-05 10:22:15 -04:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
|
|
|
|
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
|
2017-10-29 14:46:52 -04:00
|
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
2017-10-26 19:34:10 -04:00
|
|
|
virtual void Fit() wxOVERRIDE;
|
2017-10-04 10:06:33 -04:00
|
|
|
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool Show( bool show = true ) wxOVERRIDE;
|
2010-08-18 18:49:02 -04:00
|
|
|
|
|
|
|
// Must provide overload to avoid hiding it (and warnings about it)
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual void Update() wxOVERRIDE { wxGenericProgressDialog::Update(); }
|
2010-08-18 18:49:02 -04:00
|
|
|
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual WXWidget GetHandle() const wxOVERRIDE;
|
2011-09-09 23:26:37 -04:00
|
|
|
|
2010-08-18 18:49:02 -04:00
|
|
|
private:
|
2017-10-28 13:31:30 -04:00
|
|
|
// Common part of Update() and Pulse().
|
|
|
|
//
|
|
|
|
// Returns false if the user requested cancelling the dialog.
|
2010-08-18 18:49:02 -04:00
|
|
|
bool DoNativeBeforeUpdate(bool *skip);
|
|
|
|
|
2017-10-28 13:46:36 -04:00
|
|
|
// Dispatch the pending events to let the windows to update, just as the
|
|
|
|
// generic version does. This is done as part of DoNativeBeforeUpdate().
|
|
|
|
void DispatchEvents();
|
|
|
|
|
2010-08-18 18:49:02 -04:00
|
|
|
// Updates the various timing informations for both determinate
|
|
|
|
// and indeterminate modes. Requires the shared object to have
|
|
|
|
// been entered.
|
|
|
|
void UpdateExpandedInformation(int value);
|
|
|
|
|
2017-10-29 14:45:35 -04:00
|
|
|
// Get the task dialog geometry when using the native dialog.
|
|
|
|
wxRect GetTaskDialogRect() const;
|
|
|
|
|
|
|
|
|
2010-08-18 18:49:02 -04:00
|
|
|
wxProgressDialogTaskRunner *m_taskDialogRunner;
|
|
|
|
|
|
|
|
wxProgressDialogSharedData *m_sharedData;
|
|
|
|
|
|
|
|
// Store the message and title we currently use to be able to return it
|
|
|
|
// from Get{Message,Title}()
|
|
|
|
wxString m_message,
|
|
|
|
m_title;
|
|
|
|
|
|
|
|
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxProgressDialog);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_PROGDLG_H_
|