home *** CD-ROM | disk | FTP | other *** search
- // ProgressDlg.cpp : implementation file
- // jont 7/99
-
- #include "stdafx.h"
- #include "Progress.h"
- #include "ProgressDlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- #define WIDTHADJUST 23
- #define HEIGHTADJUST 57
- #define TIMERVAL 100
- #define TEXTHEIGHT 11
-
-
- /////////////////////////////////////////////////////////////////////////////
- // ProgressDlg dialog
-
-
- ProgressDlg::ProgressDlg(CWnd* pParent /*=NULL*/)
- : CDialog(ProgressDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(ProgressDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
-
- void ProgressDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(ProgressDlg)
- DDX_Control(pDX, IDC_PROGRESS1, m_progbar);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(ProgressDlg, CDialog)
- //{{AFX_MSG_MAP(ProgressDlg)
- ON_WM_TIMER()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // ProgressDlg message handlers
-
- BOOL ProgressDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // set window size and pos
- SetWindowPos(FromHandle(m_hWnd),g_xpos,g_ypos,g_width+WIDTHADJUST,g_height+HEIGHTADJUST,SWP_NOZORDER );
- m_progbar.SetWindowPos(FromHandle(m_hWnd),0,0,g_width,g_height,SWP_NOZORDER | SWP_NOMOVE); // set progress bar size and pos
-
- SetDlgItemText(IDC_TEXT1,g_text1); // set static text control text
- CWnd* pStaticText = GetDlgItem(IDC_TEXT1); // get pointer to static text control text
- pStaticText->SetWindowPos(NULL,0,0,g_width,TEXTHEIGHT,SWP_NOZORDER | SWP_NOMOVE); // set width of static text control
-
- SetDlgItemText(IDC_TEXT2,g_text2); // set static text control text
- pStaticText = GetDlgItem(IDC_TEXT2); // get pointer to static text control text
- pStaticText->SetWindowPos(NULL,0,0,g_width,TEXTHEIGHT,SWP_NOZORDER | SWP_NOMOVE); // set width of static text control
-
- m_progbar.SetRange32(g_begin,g_end); // set lower and upper range of progress bar
-
- m_progbar.SetPos(g_begin); // default to lower
-
- SetTimer(1,TIMERVAL,NULL); // start timer used for updateing by reference
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void ProgressDlg::OnTimer(UINT nIDEvent)
- {
- m_progbar.SetPos(*g_pBasicVar); // set to updated variable in Basic memory
-
- SetDlgItemText(IDC_TEXT1,g_text1); // set static text control text
- SetDlgItemText(IDC_TEXT2,g_text2); // set static text control text
-
- CDialog::OnTimer(nIDEvent); // call parent class event
- }
-