// Draw the icon
dc.DrawIcon (x, y, m_hIcon);
}
else
{
CClientDC pDC (this);
CDC temp;
CBitmap bmp;
bmp.LoadBitmap (IDB_BITMAP1);
temp.CreateCompatibleDC (& pDC);
temp.SelectObject (bmp);
В
for (int j = 0; j <29; j + +)
{
if (flag_select [j])
{
int x = koord [j] [0]-x0;
int y = koord [j] [1]-y0;
В
temp.SelectStockObject (BLACK_BRUSH);
temp.Ellipse (x-3, y-3, x +3, y +3);
}
}
if (begin_point> = 0)
{
int x = koord [begin_point] [0]-x0;
int y = koord [begin_point] [1]-y0;
CBrush br (RGB (255,0,0));
temp.SelectObject (& br);
temp.Ellipse (x-4, y-4, x +4, y +4);
В
}
В
if (flag_draw)
{
for (int i = 0; i
{
int x1 = koord [sel_city [min_path [i] -1]] [0];
int x2 = koord [sel_city [min_path [i +1] -1]] [0];
int y1 = koord [sel_city [min_path [i] -1]] [1];
int y2 = koord [sel_city [min_path [i +1] -1]] [1];
В
temp.MoveTo (x1-x0, y1-y0);
temp.LineTo (x2-x0, y2-y0);
}
В
CString s1;
В
m_list1.ResetContent ();
for (i = 0; i
{
s1 = name_city [sel_city [min_path [i] -1]];
s1 + = "-" + name_city [sel_city [min_path [i +1] -1]];
CString s2;
s2.Format ("% d", table [min_path [i] -1] [min_path [i +1] -1]);
s1 + = "->" + s2;
m_list1.AddString (s1);
В
}
m_len.Format ("Довжина шляхи: n% d км ", min_path [n +1]);
for (i = 0; i
{
if (i% 2! = 0) m_list1.SetSel (i);
}
}
else
{
m_len = "Виберіть кілька міст.";
В
}
UpdateData (false);
В
pDC.BitBlt (x0, y0, 638,638, & temp, 0,0, SRCCOPY);
В
CDialog :: OnPaint ();
}
}
В
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CKurs_LipinDlg :: OnQueryDragIcon ()
{
return ...