1 // SolveOptions.cpp : implementation file
2 //
3 /* pdnmesh - a 2D finite element solver
4 Copyright (C) 2001-2005 Sarod Yatawatta <sarod@users.sf.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 $Id: SolveOptions.cpp,v 1.3 2005/02/16 13:16:15 sarod Exp $
19 */
20
21 #include "stdafx.h"
22 #include "winpdnmesh.h"
23 #include "SolveOptions.h"
24
25 #ifdef _DEBUG
26 #define new DEBUG_NEW
27 #undef THIS_FILE
28 static char THIS_FILE[] = __FILE__;
29 #endif
30
31 /////////////////////////////////////////////////////////////////////////////
32 // SolveOptions dialog
33
34
SolveOptions(CWnd * pParent)35 SolveOptions::SolveOptions(CWnd* pParent /*=NULL*/)
36 : CDialog(SolveOptions::IDD, pParent)
37 {
38 //{{AFX_DATA_INIT(SolveOptions)
39
40 //}}AFX_DATA_INIT
41
42 //initialize slider
43
44 }
45
46
DoDataExchange(CDataExchange * pDX)47 void SolveOptions::DoDataExchange(CDataExchange* pDX)
48 {
49 CDialog::DoDataExchange(pDX);
50 //{{AFX_DATA_MAP(SolveOptions)
51 DDX_Control(pDX, IDC_SLIDER_EIGEN, m_SliderEigen);
52 DDX_Text(pDX, IDC_SLIDE_EIGEN_VALUE, m_SliderEigenValue);
53 //}}AFX_DATA_MAP
54 }
55
56
BEGIN_MESSAGE_MAP(SolveOptions,CDialog)57 BEGIN_MESSAGE_MAP(SolveOptions, CDialog)
58 //{{AFX_MSG_MAP(SolveOptions)
59 ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
60 ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
61 ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
62 ON_WM_HSCROLL()
63 //}}AFX_MSG_MAP
64 END_MESSAGE_MAP()
65
66 /////////////////////////////////////////////////////////////////////////////
67 // SolveOptions message handlers
68
69 void SolveOptions::OnRadio1()
70 {
71 // TODO: Add your control notification handler code here
72 m_equtype=POISSON;
73 m_degree_of_freedom=1;
74 }
75
OnRadio2()76 void SolveOptions::OnRadio2()
77 {
78 // TODO: Add your control notification handler code here
79 m_equtype=POISSON_SPARSE;
80 m_degree_of_freedom=1;
81 }
OnRadio3()82 void SolveOptions::OnRadio3()
83 {
84 // TODO: Add your control notification handler code here
85 m_equtype=HELMHOLTZ;
86 }
87
OnHScroll(UINT nSBCode,UINT nPos,CScrollBar * pScrollBar)88 void SolveOptions::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
89 {
90 // TODO: Add your message handler code here and/or call default
91 if(nSBCode==SB_THUMBPOSITION) {
92 m_SliderEigenValue.Format("%ld",nPos);
93 m_degree_of_freedom=nPos;
94 UpdateData(FALSE);
95 } else {
96 CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
97 }
98 }
99
100
OnInitDialog()101 BOOL SolveOptions::OnInitDialog()
102 {
103 CDialog::OnInitDialog();
104
105 // TODO: Add extra initialization here
106 m_equtype=solve_equation;
107 m_degree_of_freedom=degree_of_freedom;
108 //initialize slider
109 m_SliderEigen.SetRangeMin(1,false);
110 m_SliderEigen.SetRangeMax(100,false);
111 m_SliderEigenValue=_T("1");
112 UpdateData(FALSE);
113 return TRUE; // return TRUE unless you set the focus to a control
114 // EXCEPTION: OCX Property Pages should return FALSE
115 }
116