progdlg.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/progdlg.h
  3. // Purpose: wxProgressDialog
  4. // Author: Rickard Westerlund
  5. // Created: 2010-07-22
  6. // Copyright: (c) 2010 wxWidgets team
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_PROGDLG_H_
  10. #define _WX_PROGDLG_H_
  11. class wxProgressDialogTaskRunner;
  12. class wxProgressDialogSharedData;
  13. class WXDLLIMPEXP_CORE wxProgressDialog : public wxGenericProgressDialog
  14. {
  15. public:
  16. wxProgressDialog(const wxString& title, const wxString& message,
  17. int maximum = 100,
  18. wxWindow *parent = NULL,
  19. int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
  20. virtual ~wxProgressDialog();
  21. virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
  22. virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL);
  23. void Resume();
  24. int GetValue() const;
  25. wxString GetMessage() const;
  26. void SetRange(int maximum);
  27. // Return whether "Cancel" or "Skip" button was pressed, always return
  28. // false if the corresponding button is not shown.
  29. bool WasSkipped() const;
  30. bool WasCancelled() const;
  31. virtual void SetTitle(const wxString& title);
  32. virtual wxString GetTitle() const;
  33. virtual bool Show( bool show = true );
  34. // Must provide overload to avoid hiding it (and warnings about it)
  35. virtual void Update() { wxGenericProgressDialog::Update(); }
  36. virtual WXWidget GetHandle() const;
  37. private:
  38. // Performs common routines to Update() and Pulse(). Requires the
  39. // shared object to have been entered.
  40. bool DoNativeBeforeUpdate(bool *skip);
  41. // Updates the various timing informations for both determinate
  42. // and indeterminate modes. Requires the shared object to have
  43. // been entered.
  44. void UpdateExpandedInformation(int value);
  45. wxProgressDialogTaskRunner *m_taskDialogRunner;
  46. wxProgressDialogSharedData *m_sharedData;
  47. // Store the message and title we currently use to be able to return it
  48. // from Get{Message,Title}()
  49. wxString m_message,
  50. m_title;
  51. wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxProgressDialog);
  52. };
  53. #endif // _WX_PROGDLG_H_