eWindow (CREATESTRUCT amp; cs)
{(! CFrameWnd :: PreCreateWindow (cs)) FALSE; .dwExStyle |=WS_EX_CLIENTEDGE; .style amp;=~ WS_BORDER; .lpszClass=AfxRegisterWndClass (CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS,
:: LoadCursor (NULL, IDC_ARROW), HBRUSH (0), NULL); TRUE;
} Grafik :: OnCreate (LPCREATESTRUCT lpCreateStruct)
{(CFrameWnd :: OnCreate (lpCreateStruct) == - 1) - 1; (! Init_3d ()) MessageBox ( Error ); 0;
} Grafik :: OnPaint ()
{dc (this);
//device context for painting (); (1,1,1,1); (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushAttrib (GL_ALL_ATTRIB_BITS); sum=0; ( i=0;ilt;Doc-gt;n;i++)sum+=Doc-gt;mas[i];(i=0;ilt;Doc-gt;n;i++)kof[i]=(100*Doc-gt;mas[i])/sum;(i=0;ilt;Doc-gt;n;i++)otr[i]=(360*kof[i])/100;data;(time(0));*quadObj;= gluNewQuadric (); (quadObj, GLU_FILL);=90; r, g, b; (i=0; i lt; Doc- gt; n; i ++)
{=colorArray[i];=(colorArray[i])gt;gt;8;=(colorArray[i])gt;gt;16;ub(r,g,b);(quadObj, 0, 0.5, 15, 1, data, otr [i]); +=otr [i];
}();(wglGetCurrentDC());();();rect;font;(amp;rect);.CreatePointFont(140,laquo;Arialraquo;);.SelectObject(amp;font);z=40;br;.CreateSolidBrush(colorArray[0]);.SelectObject(amp;br);k;(i=0;ilt;Doc-gt;n;i++)
{. DeleteObject () ;. TextOut (rect.Width () - 200, z, Doc- gt; ms [i]) ;. CreateSolidBrush (colorArray [i]) ;. SelectObject ( amp ; br) ;. Rectangle (rect.Width () - 230, z, rect.Width () - 210, z + 25);
//dc.FillRect (k, br); +=40;
}
//TODO: Add your message handler code here
//Do not call CFrameWnd :: OnPaint () for painting messages
} Grafik :: OnSize (UINT nType, int cx, int cy)
{:: OnSize (nType, cx, cy); (cx gt; cy)
{(0,0, cy, cy);
}
{(0, (cy-cx)/2, cx, cx);
} (false);
}
Додаток K
. cpp
# include stdafx.h
# include kursovaya.h
# include Dlg.h
# include time.h
# include lt; sys/timeb.h gt;
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILEchar THIS_FILE []=__FILE __;
# endif :: Dlg (CWnd * pParent/*=NULL * /)
: CDialog (Dlg :: IDD, pParent)
{
//{{AFX_DATA_INIT (Dlg)
//NOTE: the ClassWizard will add member initialization here
//}} AFX_DATA_INIT
} :: ~ Dlg ()
{
//exit (0);
} Dlg :: DoDataExchange (CDataExchange * pDX)
{:: DoDataExchange (pDX);
//{{AFX_DATA_MAP (Dlg) _Control (pDX, IDC_POLYA, m_pol); _ Control (pDX, IDC_TABLE, m_tab); _ Control (pDX, IDC_EDIT1, m_editquery); _ Control (pDX, IDC_DATAGRID1, m_datagrid);(IDC_DOHOD_OT_USLUG)-gt;ShowWindow(SW_HIDE);(IDC_DOHOD_PO_DNYAM)-gt;ShowWindow(SW_HIDE);(IDC_DOHOD_SOTR_PODNYAM)-gt;ShowWindow(SW_HIDE);(IDC_ALL_DOHOD_SOTR)-gt;ShowWindow(SW_HIDE);(IDC_ZAPROS_MAKE)-gt;ShowWindow(SW_HIDE);(IDC_ZAPROS_SELECT)-gt;ShowWindow(SW_HIDE);(IDC_Find)-gt;ShowWindow(SW_HIDE);(IDC_Sort)-gt;ShowWindow(SW_HIDE);(IDC_GRAF)-gt;ShowWindow(SW_HIDE);
//}} AFX_DATA_MAP
} _ MESSAGE_MAP (Dlg, CDialog)
//{{AFX_MSG_MAP (Dlg) _BN_CLICKED (IDC_OPEN_DB, OnOpenDb) _BN_CLICKED (IDC_ZAPROS_MAKE, OnZaprosMake) _BN_CLICKED (IDC_ZAPROS_SELECT, OnZaprosSelect) _BN_CLICKED (IDC_Find, OnFind) _BN_CLICKED (IDC_GRAF, OnGraf) _BN_CLICKED (IDC_DOHOD_OT_USLUG, OnDohodOtUslug) _BN_CLICKED (IDC_DOHOD_PO_DNYAM, OnDohodPoDnyam) _BN_CLICKED (IDC_DOHOD_SOTR_PODNYAM, OnDohodSotrPodnyam) _BN_CLICKED (IDC_ALL_DOHOD_SOTR, OnAllDohodSotr) _LBN_SELCHANGE (IDC_TABLE, OnSelchangeTable) _LBN_SELCHANGE (IDC_POLYA, OnSelchangePolya) _BN_CLICKED (IDC_First, OnFirst) _BN_CLICKED (IDC_Left, OnLeft) _BN_CLICKED (IDC_Right, OnRight) _BN_CLICKED (IDC_Last, OnLast) _BN_CLICKED (IDC_Sort, OnSort)
//}} AFX_MSG_MAP_MESSAGE_MAP () Dlg :: OnOpenDb ()
{OpenDialog (true, raquo ;, , _ FILEMUSTEXIST | OFN_HIDEREADONLY,
Microsoft Access Database (* .mdb) | * .mdb | ); (OpenDialog.DoModal ()!=IDOK) return; str_con=OpenDialog.GetPathName (); _ con.MakeLower (); _ editquery.SetWindowText ( ); g; (1)
{= str_con...