mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-19 12:14:35 +02:00
Fixed up the wait dialog.
This commit is contained in:
+69
-34
@@ -2,9 +2,9 @@
|
||||
===========================================================================
|
||||
|
||||
IceTech GPL Source Code
|
||||
Copyright (C) 2026 Justin Marshall
|
||||
Copyright (C) 2026 Justin Marshall
|
||||
|
||||
This file is part of the IceTech GPL Source Code (?IceTech Source Code?).
|
||||
This file is part of the IceTech GPL Source Code (?IceTech Source Code?).
|
||||
|
||||
IceTech Source Code is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,58 +25,93 @@ If you have questions concerning this license or the applicable additional terms
|
||||
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
#if !defined(AFX_WAITDLG_H__2B7A6C91_8D3F_4BEE_B564_33A0CFFA241B__INCLUDED_)
|
||||
#define AFX_WAITDLG_H__2B7A6C91_8D3F_4BEE_B564_33A0CFFA241B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// WaitDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CWaitDlg dialog
|
||||
|
||||
class CWaitDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
class CWaitDlg : public CDialog {
|
||||
public:
|
||||
CWaitDlg(CWnd* pParent = NULL, const char *msg = "Wait..."); // standard constructor
|
||||
~CWaitDlg();
|
||||
void SetText(const char *msg, bool append = false);
|
||||
void AllowCancel( bool enable );
|
||||
bool CancelPressed( void );
|
||||
CWaitDlg(CWnd* pParent = NULL, const char* msg = "Wait...");
|
||||
virtual ~CWaitDlg();
|
||||
|
||||
void SetText(const char* msg, bool append = false);
|
||||
void AllowCancel(bool enable);
|
||||
bool CancelPressed(void);
|
||||
|
||||
// New progress API.
|
||||
// SetProgress(-1) = animated indeterminate marquee.
|
||||
// SetProgress(0..100) = fixed progress amount.
|
||||
void SetProgress(int percent);
|
||||
void StepProgress(int amount = 1);
|
||||
int GetProgress(void) const;
|
||||
|
||||
void SetTitleText(const char* title);
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CWaitDlg)
|
||||
enum { IDD = IDD_DLG_WAIT };
|
||||
CString waitStr;
|
||||
//}}AFX_DATA
|
||||
|
||||
CString waitStr;
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CWaitDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CWaitDlg)
|
||||
virtual void DoDataExchange(CDataExchange* pDX);
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnCancel();
|
||||
//}}AFX_MSG
|
||||
|
||||
afx_msg void OnPaint();
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
idStr text;
|
||||
bool cancelPressed;
|
||||
void InitModernResources(void);
|
||||
void FreeModernResources(void);
|
||||
void LayoutModernControls(void);
|
||||
void ResizeAndCenterDialog(void);
|
||||
|
||||
void DrawModernBackground(CDC& dc, const CRect& rcClient);
|
||||
void DrawHeader(CDC& dc, const CRect& rcClient);
|
||||
void DrawMessage(CDC& dc, const CRect& rcClient);
|
||||
void DrawProgress(CDC& dc, const CRect& rcClient);
|
||||
void DrawRoundedRect(CDC& dc, const CRect& rc, COLORREF fill, COLORREF outline, int radius);
|
||||
|
||||
void PumpMessages(void);
|
||||
|
||||
private:
|
||||
idStr text;
|
||||
bool cancelPressed;
|
||||
bool cancelAllowed;
|
||||
|
||||
CString titleStr;
|
||||
|
||||
int progressPercent; // -1 = indeterminate / marquee
|
||||
int marqueeOffset;
|
||||
int pulseFrame;
|
||||
|
||||
CFont titleFont;
|
||||
CFont messageFont;
|
||||
CFont smallFont;
|
||||
|
||||
CBrush transparentBrush;
|
||||
|
||||
COLORREF colorBackTop;
|
||||
COLORREF colorBackBottom;
|
||||
COLORREF colorPanel;
|
||||
COLORREF colorPanelBorder;
|
||||
COLORREF colorText;
|
||||
COLORREF colorMutedText;
|
||||
COLORREF colorAccent;
|
||||
COLORREF colorAccent2;
|
||||
COLORREF colorProgressBack;
|
||||
COLORREF colorDanger;
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_WAITDLG_H__2B7A6C91_8D3F_4BEE_B564_33A0CFFA241B__INCLUDED_)
|
||||
#endif // !defined(AFX_WAITDLG_H__2B7A6C91_8D3F_4BEE_B564_33A0CFFA241B__INCLUDED_)
|
||||
Reference in New Issue
Block a user