Home > Software engineering >  Questions about L_ButtonDown no response
Questions about L_ButtonDown no response

Time:09-30

Click to achieve two light response after color change lights and orbital
Using L_ButtonDown statement does not respond to
Drawing code deleted but figure is normal in the middle of the fit inside the
//Wang Sijia Dlg. CPP: implementation file
//
# pragma comment (lib, "User64. Lib")
# pragma comment (lib, "ole64. Lib")

# include "stdafx. H"
# include "Wang Sijia. H
"# include "Wang Sijia Dlg. H"
# include "afxdialogex. H"

# ifdef _DEBUG
# define new DEBUG_NEW
Int m_LMouseDownStep=1;//mouse point number
# endif


//for application "about" menu item CAboutDlg dialog

The class CAboutDlg: public CDialogEx
{
Public:
CAboutDlg ();
Void Searchroute ();

//data dialog
Enum {IDD=IDD_ABOUTBOX};

Protected:
Virtual void DoDataExchange (CDataExchange * symbol;//support DDX/DDV

//implementation
Protected:
DECLARE_MESSAGE_MAP ()
Public:
Afx_msg void On32772 ();
Afx_msg void On32775 ();

Afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
};

CAboutDlg: : CAboutDlg () : CDialogEx CAboutDlg: : (IDD)
{
}

Void CAboutDlg: : DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
}

BEGIN_MESSAGE_MAP (CAboutDlg CDialogEx)
ON_COMMAND (ID_32772, & amp; CAboutDlg: : On32772)
ON_COMMAND (ID_32775, & amp; CAboutDlg: : On32775)
ON_WM_LBUTTONDOWN ()
ON_WM_LBUTTONUP ()
ON_WM_LBUTTONDOWN ()
END_MESSAGE_MAP ()


//C Wang Sijia Dlg dialog




C: Wang Sijia Dlg: C Wang Sijia Dlg (pParent/*=NULL CWnd * */)
: CDialogEx (C: Wang Sijia Dlg, IDD, pParent)
{
M_hIcon=AfxGetApp () - & gt; LoadIcon (IDR_MAINFRAME);
}

Void Wang Sijia Dlg: C: DoDataExchange (CDataExchange * symbol)
{
CDialogEx: : DoDataExchange (symbol);
DDX_Control (symbol, IDC_LIST7 m_ListBox);
}

BEGIN_MESSAGE_MAP (C Wang Sijia Dlg, CDialogEx)
ON_WM_SYSCOMMAND ()
ON_WM_PAINT ()
ON_WM_QUERYDRAGICON ()
ON_BN_CLICKED (IDOK, & amp; C: Wang Sijia Dlg: OnBnClickedOk)
ON_BN_CLICKED (IDC_BUTTON1, & amp; C: Wang Sijia Dlg: OnBnClickedButton1)

ON_EN_CHANGE (IDC_EDIT1, & amp; C: Wang Sijia Dlg: OnEnChangeEdit1)


ON_WM_MOUSEMOVE ()

END_MESSAGE_MAP ()

//C Wang Sijia Dlg message handler

BOOL C: Wang Sijia Dlg: OnInitDialog ()
{
CDialogEx: : OnInitDialog ();

//will "about... "Menu item added to the system menu,

//IDM_ABOUTBOX must be in the system command range,
ASSERT ((IDM_ABOUTBOX & amp; 0==IDM_ABOUTBOX xfff0));
ASSERT (IDM_ABOUTBOX & lt; 0 xf000);

CMenu * pSysMenu=GetSystemMenu (FALSE);
If (pSysMenu!=NULL)
{
BOOL bNameValid;
Cstrings strAboutMenu;
BNameValid=strAboutMenu. LoadString (IDS_ABOUTBOX);
ASSERT (bNameValid);
if (! StrAboutMenu. IsEmpty ())
{
PSysMenu - & gt; The AppendMenu (MF_SEPARATOR);
PSysMenu - & gt; AppendMenu (MF_STRING IDM_ABOUTBOX, strAboutMenu);
}
}

//set this dialog ICONS, when the application is the main window is not a dialog, the framework will automatically
//do this
SetIcon (m_hIcon, TRUE);//set the large icon
SetIcon (m_hIcon, FALSE);//set the small icon

//TODO: add additional initialization code in the
Int m_LMouseDownStep=1;//mouse point number
M_ListBox. AddString (_T (" shenyang station "));
M_ListBox. AddString (_T (" shenyang north station "));
M_ListBox. AddString (_T (" shenyang station "));
Return TRUE;//unless set focus to the control, return TRUE
}

Void Wang Sijia Dlg: C: OnSysCommand (UINT nID, LPARAM LPARAM)
{
If ((nID & amp; 0 xfff0)==IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
DlgAbout. DoModal ();
}
The else
{
CDialogEx: : OnSysCommand (nID, lParam);
}
}

//if the dialog box to add a minimize button, you need the following code
//to draw the icon, to use the document/view model of MFC application,
//it will be done automatically by the framework,

Void Wang Sijia Dlg: C: OnPaint ()
{

CPaintDC dc (this);//for drawing device context
//draw the gray linear
//create a width of 3 gray brush
CPen penSolid (PS_SOLID, 3, RGB (100100100));
CPen * pOldPen=NULL;
Dc. SelectObject (& amp; PenSolid);

//draw track
Dc. MoveTo (30200);
Dc. The LineTo (470200);
Dc. MoveTo (480200);
Dc. The LineTo (840200);
Dc. MoveTo (850200);
Dc. The LineTo (1240200);//2 lanes
Dc. MoveTo (30250);
Dc. The LineTo (465250);
Dc. MoveTo (475250);
Dc. The LineTo (840250);
Dc. MoveTo (850250);
Dc. The LineTo (1240250);//1 track
Dc. MoveTo (210300);
Dc. The LineTo (355300);
Dc. MoveTo (365300);
Dc. The LineTo (500300);
Dc. MoveTo (510300);
Dc. The LineTo (540300);
Dc. MoveTo (550300);
Dc. The LineTo (825300);//3 fields is
Dc. MoveTo (495150);
Dc. The LineTo (825150);//4 lanes
Dc. MoveTo (550350);
Dc. The LineTo (800350);
Dc. MoveTo (540300);
Dc. The LineTo (550350);
Dc. MoveTo (800350);
Dc. The LineTo (820310);//5 lanes
Dc. MoveTo (520100);
Dc. The LineTo (800100);
Dc. MoveTo (500140);
Dc. The LineTo (520100);
Dc. MoveTo (800100);
Dc. The LineTo (820140);//6 lanes
//safety
Dc. MoveTo (355300);
Dc. The LineTo (400350);
Dc. MoveTo (400350);
Dc. The LineTo (455350);
//draw switch
Dc. MoveTo (850200);
Dc. The LineTo (825150);//5-7
Dc. MoveTo (900240);
Dc. The LineTo (930210);//1-3
Dc. MoveTo (850250);
Dc. The LineTo (825300);//September 11
Dc. MoveTo (385210);
Dc. The LineTo (415240);//8-10
Dc. MoveTo (495150);
Dc. The LineTo (470200);//16 to 18
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related