1 //#**************************************************************
2 //# filename: DialogProgressBar.cpp
3 //#
4 //# author: Gerstmayr, Vetyukov
5 //#
6 //# generated:
7 //# description:
8 //# comments:
9 //#
10 //# Copyright (c) 2003-2013 Johannes Gerstmayr, Linz Center of Mechatronics GmbH, Austrian
11 //# Center of Competence in Mechatronics GmbH, Institute of Technical Mechanics at the
12 //# Johannes Kepler Universitaet Linz, Austria. All rights reserved.
13 //#
14 //# This file is part of HotInt.
15 //# HotInt is free software: you can redistribute it and/or modify it under the terms of
16 //# the HOTINT license. See folder 'licenses' for more details.
17 //#
18 //# bug reports are welcome!!!
19 //# WWW: www.hotint.org
20 //# email: bug_reports@hotint.org or support@hotint.org
21 //#***************************************************************************************
22
23
24 #include "stdafx.h"
25 #include "WCDriver3DDlg.h"
26 #include "WCDriver3D.h"
27 #include "DialogProgressBar.h"
28
29 // CDialogProgressBar-Dialogfeld
30
IMPLEMENT_DYNAMIC(CDialogProgressBar,CDialog)31 IMPLEMENT_DYNAMIC(CDialogProgressBar, CDialog)
32
33 CDialogProgressBar::CDialogProgressBar(CWnd* pParent /*=NULL*/)
34 : CDialog(CDialogProgressBar::IDD, pParent)
35 {
36
37 }
38
~CDialogProgressBar()39 CDialogProgressBar::~CDialogProgressBar()
40 {
41
42 }
43
Reset()44 void CDialogProgressBar::Reset()
45 {
46 CProgressCtrl* pPC = (CProgressCtrl*) GetDlgItem(IDC_PROGRESS);
47 pPC->SetRange(0,100);
48 pPC->SetPos(50);
49
50 CEdit* pE = (CEdit*) GetDlgItem(IDC_EDIT_OVER);
51 pE->SetWindowTextA("not linked to a process");
52 pE = (CEdit*) GetDlgItem(IDC_EDIT_UNDER);
53 pE->SetWindowTextA("...");
54 }
SetTotalTicks(int totalticks)55 void CDialogProgressBar::SetTotalTicks(int totalticks)
56 {
57 m_progress_control.SetRange(0,totalticks);
58 }
59
SetActualTicks(int actticks)60 void CDialogProgressBar::SetActualTicks(int actticks)
61 {
62 m_progress_control.SetPos(actticks);
63 }
64
SetCaptionText(mystr & caption)65 void CDialogProgressBar::SetCaptionText(mystr& caption)
66 {
67 SetWindowTextA(caption.c_str());
68 }
69
SetTextOver(mystr & over)70 void CDialogProgressBar::SetTextOver(mystr& over)
71 {
72 CEdit* pEdit = (CEdit*) GetDlgItem(IDC_EDIT_OVER);
73 pEdit->SetWindowTextA(over.c_str());
74 // m_textover_control.SetWindowText(over.c_str());
75 }
SetTextUnder(mystr & under)76 void CDialogProgressBar::SetTextUnder(mystr& under)
77 {
78 m_textunder_control.SetWindowText(under.c_str());
79 }
80
DoDataExchange(CDataExchange * pDX)81 void CDialogProgressBar::DoDataExchange(CDataExchange* pDX)
82 {
83 CDialog::DoDataExchange(pDX);
84 DDX_Control(pDX, IDC_PROGRESS, m_progress_control);
85 DDX_Control(pDX, IDC_EDIT_OVER, m_textover_control);
86 DDX_Control(pDX, IDC_EDIT_UNDER, m_textunder_control);
87 }
88
89
BEGIN_MESSAGE_MAP(CDialogProgressBar,CDialog)90 BEGIN_MESSAGE_MAP(CDialogProgressBar, CDialog)
91 ON_WM_CLOSE()
92 END_MESSAGE_MAP()
93
94
95 // CDialogProgressBar-Meldungshandler
96
97 void CDialogProgressBar::OnClose()
98 {
99 DestroyWindow();
100 }