// SolveOptions.cpp : implementation file // /* pdnmesh - a 2D finite element solver Copyright (C) 2001-2005 Sarod Yatawatta This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: SolveOptions.cpp,v 1.3 2005/02/16 13:16:15 sarod Exp $ */ #include "stdafx.h" #include "winpdnmesh.h" #include "SolveOptions.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SolveOptions dialog SolveOptions::SolveOptions(CWnd* pParent /*=NULL*/) : CDialog(SolveOptions::IDD, pParent) { //{{AFX_DATA_INIT(SolveOptions) //}}AFX_DATA_INIT //initialize slider } void SolveOptions::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SolveOptions) DDX_Control(pDX, IDC_SLIDER_EIGEN, m_SliderEigen); DDX_Text(pDX, IDC_SLIDE_EIGEN_VALUE, m_SliderEigenValue); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SolveOptions, CDialog) //{{AFX_MSG_MAP(SolveOptions) ON_BN_CLICKED(IDC_RADIO1, OnRadio1) ON_BN_CLICKED(IDC_RADIO3, OnRadio3) ON_BN_CLICKED(IDC_RADIO2, OnRadio2) ON_WM_HSCROLL() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SolveOptions message handlers void SolveOptions::OnRadio1() { // TODO: Add your control notification handler code here m_equtype=POISSON; m_degree_of_freedom=1; } void SolveOptions::OnRadio2() { // TODO: Add your control notification handler code here m_equtype=POISSON_SPARSE; m_degree_of_freedom=1; } void SolveOptions::OnRadio3() { // TODO: Add your control notification handler code here m_equtype=HELMHOLTZ; } void SolveOptions::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { // TODO: Add your message handler code here and/or call default if(nSBCode==SB_THUMBPOSITION) { m_SliderEigenValue.Format("%ld",nPos); m_degree_of_freedom=nPos; UpdateData(FALSE); } else { CDialog::OnHScroll(nSBCode, nPos, pScrollBar); } } BOOL SolveOptions::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_equtype=solve_equation; m_degree_of_freedom=degree_of_freedom; //initialize slider m_SliderEigen.SetRangeMin(1,false); m_SliderEigen.SetRangeMax(100,false); m_SliderEigenValue=_T("1"); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }