////////////////////////////////////////////////////////////////////////////////
//
// shdialog.h -  
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __SHDIAL_H
#define __SHDIAL_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __STUDS3D_H
#include "studs3d.h"
#endif

#ifndef __PARMACRO_H
#include "parmacro.h"
#endif


////////////////////////////////////////////////////////////////////////////////
//
//  
//
////////////////////////////////////////////////////////////////////////////////
class ShpeelDlg : public CDialog
{
public:
	ShpeelDlg(Shpeel& _shpeel, CWnd* pParent = NULL);  

	//{{AFX_DATA(ShpeelDlg)
	enum { IDD = SHPEEL_DIALOG };
	CComboBox	m_tMatt;
	CButton	m_cAttr;
	CParamList m_listParam;
	CComboBox	m_klass;
	CComboBox	m_type;
	CComboBox	m_gost;
	CButton	m_pitch;
	CStatic	m_showStatic;
	CComboBox	m_len;
	CComboBox	m_diam;
	int		m_perfGroup;
	//}}AFX_DATA

	//{{AFX_VIRTUAL(ShpeelDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

protected:
	float p;              //  -  
	float massa;          //  -  
	UINT bitMapId;        //  
	Shpeel& shpeel;       // 

  //  
  void CalcMassa() { massa =  shpeel.GetShpeelParam().f & ISPOLN ? 
                              shpeel.GetShpeelParam().m2 : shpeel.GetShpeelParam().m1;
                     massa *= (float)( !shpeel.GetShpeelParam().indexMassa ?
                     									 1 : shpeel.GetShpeelParam().indexMassa == 1 ?
																					 0.356 : shpeel.GetShpeelParam().indexMassa == 3 ?
																									 0.97 : 1.08 ); }
  //  
  void ChoicePitch() { p = shpeel.GetShpeelParam().f & PITCH ?
  												 shpeel.GetShpeelParam().p2 : shpeel.GetShpeelParam().p1; }
	void ErrorDialog( int id ); //    ,  
	void FillDiametr();         //   
	void FillLenght();          //   
	void InitControls();        //  
	void ViewParamShow();       //  

	//{{AFX_MSG(ShpeelDlg)
	virtual BOOL OnInitDialog();              //  
	afx_msg void OnPaint();                   //  
	afx_msg void OnSelchangeGostCombo();      //    
	afx_msg void OnSelchangeStudKlassCombo(); //    " "
	afx_msg void OnStudSimplCheck();          //   ""
	afx_msg void OnSelchangeStudTypeCombo();  //    "  "
	afx_msg void OnSelchangeDiam();           //     -         
	afx_msg void OnSelchangeLen();            //     -     
	afx_msg void OnPitch();                   // 
	afx_msg void OnPerformance1();            //  1
	afx_msg void OnPerformance2();            //  2
	afx_msg void OnHelpBut();                 //  
	afx_msg void OnSelchangeMatCombo();       // 
	afx_msg void OnAttrCheck();               //   
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
#endif // !defined(__SHDIAL_H)
