Zdeněk Krejčí

Zdeněk Krejčí

Stránky na téma programování v C++
Program NSEO pro Windows
NSEO - znamená návrhový systém elektronických obvodů = kreslení elektrotechnických výkresů
Projekt není ještě zdaleka hotový takže si zde zatím můžete prohlédnout v jaké je fázy.
Popřípadě stáhout v menu Download jeho prozatimní verzy...
------------------------------------------------------------------------------------------------------------------------------
Projekt1Frm.cpp - Obsluha událostí jako je pohyb myši stisky tlačítek synchronizování
aktuálních souřadnic a jejich zasílání ObjectManageru. Dále obsluha vlastního formuláře, zobrazování StatusBaru se souřadnicemi atd...
NSEO.jpg
NSEO.exe  5.17MB
//---------------------------------------------------------------------------
//
// Name:        Project1Frm.cpp
// Author:      Zdenek Krejci
// Created:     28/07/2009 14:32:40
// Description: Project1Frm class implementation
//
//---------------------------------------------------------------------------

#include "Project1Frm.h"
#include "WorkBench.h"
#include "ObjectManager.h"
#include "Object.h"
WorkBench WB;
WorkBench& rWB = WB;
ObjectManager OM;
ObjectManager& rOM = OM;
int nPass = 0;
int X = 0;


//Object OB;
    //Object& rOB = OB;

//Do not add custom headers between
//Header Include Start and Header Include End
//wxDev-C++ designer will remove them
////Header Include Start
////Header Include End

//----------------------------------------------------------------------------
// Project1Frm
//----------------------------------------------------------------------------
//Add Custom Events only in the appropriate block.
//Code added in other places will be removed by wxDev-C++
////Event Table Start
BEGIN_EVENT_TABLE(Project1Frm,wxFrame)
    ////Manual Code Start
    ////Manual Code End
  
    EVT_CLOSE(Project1Frm::OnClose)
    EVT_ERASE_BACKGROUND(Project1Frm::Project1FrmEraseBackground)
    EVT_MOTION(Project1Frm::Project1FrmMouseMotion)
    EVT_LEFT_DOWN(Project1Frm::Project1FrmLeftDown)
    EVT_LEFT_UP(Project1Frm::Project1FrmLeftUP)
    EVT_PAINT(Project1Frm::Project1FrmPaint)
    EVT_IDLE(Project1Frm::Project1FrmIdle)
    EVT_ACTIVATE(Project1Frm::Project1FrmActivate)
    EVT_MENU(ID_MENU_SELECT_1006, Project1Frm::Menuselect1006Click)
    EVT_MENU(ID_MNU_LINE_1005, Project1Frm::Menuline1005Click)
END_EVENT_TABLE()
////Event Table End

Project1Frm::Project1Frm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
    CreateGUIControls();
}

Project1Frm::~Project1Frm()
{
}

void Project1Frm::CreateGUIControls()
{
    //Do not add custom code between
    //GUI Items Creation Start and GUI Items Creation End
    //wxDev-C++ designer will remove them.
    //Add the custom code before or after the blocks
    ////GUI Items Creation Start

    WxStatusBar1 = new wxStatusBar(this, ID_WXSTATUSBAR1, wxRAISED_BORDER);

    WxMenuBar1 = new wxMenuBar();
    wxMenu *ID_MNU_SOUBOR_1002_Mnu_Obj = new wxMenu(0);
    WxMenuBar1->Append(ID_MNU_SOUBOR_1002_Mnu_Obj, wxT("Soubor"));
    wxMenu *ID_MNU_EDIT_1003_Mnu_Obj = new wxMenu(0);
    ID_MNU_EDIT_1003_Mnu_Obj->Append(ID_MENU_SELECT_1006, wxT("Select "), wxT(""), wxITEM_NORMAL);
    WxMenuBar1->Append(ID_MNU_EDIT_1003_Mnu_Obj, wxT("Edit"));
  
    wxMenu *ID_MNU_DRAW_1004_Mnu_Obj = new wxMenu(0);
    ID_MNU_DRAW_1004_Mnu_Obj->Append(ID_MNU_LINE_1005, wxT("Line"), wxT(""), wxITEM_NORMAL);
    WxMenuBar1->Append(ID_MNU_DRAW_1004_Mnu_Obj, wxT("Draw"));
    SetMenuBar(WxMenuBar1);

    SetStatusBar(WxStatusBar1);
    SetTitle(wxT("Project1"));
    SetIcon(wxNullIcon);
    SetSize(8,8,900,563);
    Center();
  
    ////GUI Items Creation End
}

void Project1Frm::OnClose(wxCloseEvent& event)
{
    Destroy();
}

/*
 * Project1FrmEraseBackground
 */
void Project1Frm::Project1FrmEraseBackground(wxEraseEvent& event)
{
    // insert your code here
}

/*
 * Project1FrmIdle
 */
void Project1Frm::Project1FrmIdle(wxIdleEvent& event)
{
    // insert your code here
    wxString str;
    wxString strND;
    wxString strMODE;
    wxString strInstanceCount;
    WxStatusBar1->SetStatusText(wxT("Ready"), 0);
  
    str << "X: ";
    str << rWB.GetPosX();
    str << " Y: ";
    str << rWB.GetPosY();
    WxStatusBar1->SetStatusText(wxT(str), 1);
  
    strND << "X: ";
    strND << WB.GetPosNDX();
    strND << " Y: ";
    strND << rWB.GetPosNDY();
    WxStatusBar1->SetStatusText(wxT(strND), 2);
  
    strMODE << "Mode: ";
    if(1 == rOM.GetWhatToDoOnDragging()){
        strMODE << "Line ";
      
        strMODE << rOM.GetInstanceCount();
    }else{
        strMODE << "Select";
    }
    WxStatusBar1->SetStatusText(wxT(strMODE), 3);
}

/*
 * Project1FrmLeftDown
 */
void Project1Frm::Project1FrmLeftDown(wxMouseEvent& event)
{
    //********************************************* Filtering to set startXY only when GetWhatToDoOnDragging() equal to 1
  
    if(1 == rOM.GetWhatToDoOnDragging()){
      rOM.SetStartXY(event.GetX(),event.GetY());
       //Create a new instance
       OM.SetInstanceCount(OM.GetInstanceCount()+1);
    }
}

/*
 * Project1FrmPaint
 */
void Project1Frm::Project1FrmPaint(wxPaintEvent& event)
{
    // insert your code here
    wxPaintDC dc(this);

}

/*
 * Project1FrmLeftUP
 */
void Project1Frm::Project1FrmLeftUP(wxMouseEvent& event)

  
}


void Project1Frm::Project1FrmMouseMotion(wxMouseEvent& event)
{
    // insert your code here
     wxClientDC dc(this);//WorkBench client in WB
     wxClientDC dca(this);//Fixture client in OM
     wxClientDC dce(this);//Draw line client in OB
    //********************************************* Synchronization XY for WorkBench
    rWB.SyncPosNDXY(event.GetX(), event.GetY());
    //********************************************* Drawing Guide Lines
    rWB.DrawGuideLines(dc);
    SetCursor(wxCursor(wxCURSOR_CROSS));
    //********************************************

  
  
    if (0 == rOM.GetWhatToDoOnDragging()){
        rOM.DrawFixture(event.GetX(), event.GetY(),dca);
    }
      
    if(event.Dragging()){
    
        //****************************************** Synchronization Coordinates for WorkBech
        rWB.SyncPosXY(event.GetX(), event.GetY());
        //****************************************** Synchronization Coordinates for ObjectManager
        rOM.SyncPosXY(event.GetX(), event.GetY());
        //****************************************** Make ObjectManager to draw an object default is NONE
        switch (rOM.GetWhatToDoOnDragging())
        {
            case 0:
                //OnSelect
              
              
                break;
            case 1:
                //OnLine
                rOM.Draw(dce);
                break;
        } 
    }

}

/*
 * Project1FrmActivate
 */
void Project1Frm::Project1FrmActivate(wxActivateEvent& event)
{
    //WxButton1->SetSize(100,100,100,100);
    WxStatusBar1->SetSize(0,0,0,20);
    int widths[4] = { 60,90,100,120 };
    WxStatusBar1->SetFieldsCount(5, widths);

}

/*
 * Menuline1005Click
 */
void Project1Frm::Menuline1005Click(wxCommandEvent& event)
{
    // Sets number one to draw a line
    rOM.SetWhatToDoOnDragging(1);
 
}

/*
 * WxButton1Click
 */
void Project1Frm::WxButton1Click(wxCommandEvent& event)
{
    // insert your code here
    /*OB OBr;
    OB& rOB = OBr;
    wxString str;
    str << rOB.GetTypeOfObject();
    wxMessageBox(str);  
    Refresh();
    */
}

/*
 * Menuselect1006Click
 */
void Project1Frm::Menuselect1006Click(wxCommandEvent& event)
{
    //Sets number zero to do select
    rOM.SetWhatToDoOnDragging(0);
}

***************************************************************************************************



WorkBench.h pouze pro obsluhu plochy programu jako jsou vodící čáry atd...

/*
  Name: WorkBech.h
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#ifndef __WORKBENCH_h__
#define __WORKBENCH_h__
#include "wx/wx.h"
#include
    #include

class WorkBench
    {
        public:
            WorkBench(){itsPosX = 0;itsPosY = 0;itsPosNDX = 0;itsPosNDY = 0;
                        CountN = 0;}
            ~WorkBench(){};
                /************************************* sync x and y when dragging */
                void SyncPosXY(int X,int Y);
                 int GetPosX()const;
                 int GetPosY()const;
                /************************************* sync x and y when no dragging*/
                void SyncPosNDXY(int X,int Y);
                 int GetPosNDX()const;
                 int GetPosNDY()const;
              
                /************************************* Drawing guide lines*/
                void DrawGuideLines(wxDC& dc);
                void SetOldPosX(int X, int Y);
                 int GetOldPosX()const;
                 int GetOldPosY()const;
         
         private:
            int itsPosX;
            int itsPosY;
            int itsPosNDX;
            int itsPosNDY;
            int itsOldPosX;
            int itsOldPosY;
            int CountN;
            int CountNL;
          
    };
  
  
  
#endif


***************************************************************************************************

WorkBench.cpp implementační část...

/*
  Name: WorkBench.cpp
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#include
#include "Project1Frm.h"
#include "WorkBench.h"
#include "Object.h"


//****************************************** SyncPosXY - sync when dragging
void WorkBench::SyncPosXY(int X,int Y){
    itsPosX = X;
    itsPosY = Y;
}

int WorkBench::GetPosX()const{
    return itsPosX;
}

int WorkBench::GetPosY()const{
    return itsPosY;
}
//*******************************************SyncPosNDXY - ND no dragging
void WorkBench::SyncPosNDXY(int X,int Y){
    itsPosNDX = X;
    itsPosNDY = Y;
}

int WorkBench::GetPosNDX()const{
    return itsPosNDX;
}

int WorkBench::GetPosNDY()const{
    return itsPosNDY;
}
//******************************************** Set and Get old position Guide lines
void WorkBench::SetOldPosX(int X,int Y){
    itsOldPosX = X;
    itsOldPosY = Y;
}
int WorkBench::GetOldPosX()const{
    return itsOldPosX;
}

int WorkBench::GetOldPosY()const{
    return itsOldPosY;
}
//******************************************** Drawing Guide lines
void WorkBench::DrawGuideLines(wxDC& dc){
  
    dc.SetPen(wxPen(*wxBLACK, 1, wxDOT));
    dc.SetLogicalFunction(wxINVERT);
  
  
   switch(CountN)
   {
     case 1: 
        dc.DrawLine(this->GetOldPosX(),0,this->GetOldPosX(),1000);
        dc.DrawLine(0,this->GetOldPosY(),1000,this->GetOldPosY());
        dc.DrawLine(this->GetPosNDX(),0,this->GetPosNDX(),1000);
        dc.DrawLine(0,this->GetPosNDY(),1000,this->GetPosNDY());
        SetOldPosX(this->GetPosNDX(),this->GetPosNDY());
        break;
     case 0:
         
        dc.DrawLine(this->GetPosNDX(),0,this->GetPosNDX(),1000);
        dc.DrawLine(0,this->GetPosNDY(),1000,this->GetPosNDY());
        SetOldPosX(this->GetPosNDX(),this->GetPosNDY());
        CountN = 1;
        break;
    }
  
}


***************************************************************************************************

ObjectManager.h - Provádí nastavování souřednic jednotlivých instancí třídy Objekt a určuje kdy se vykreslit...

/*
  Name: WorkBech.h
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#ifndef __OBJECTMANAGER_h__
#define __OBJECTMANAGER_h__
#include "wx/wx.h"
#include
#include
#include "Object.h"

class ObjectManager
    {
        public:
            ObjectManager(){itsObject = 0;
                        StartX = 0;StartY = 0;itsPosX = 0;itsPosY = 0;itsInstanceCount = 0;
                        itsWhatToDoOnDragging = 0;}
            ~ObjectManager(){};
          
                void Draw(wxDC& dce);
                //***********************************************
                void SetObjectTypeToDraw(int ObjectTypeToDraw);
                 int GetObjectTypeToDraw()const;
                //***********************************************
                void SetStartXY(int X,int Y);
                 int GetStartX()const;
                 int GetStartY()const;
                //***********************************************
                void SyncPosXY(int X, int Y);
                 int GetPosX();
                 int GetPosY();
                 //**********************************************
                void SetInstanceCount(int InstanceCount);
                 int GetInstanceCount();
                 //********************************************** Checking colision against object
                void DrawFixture(int X,int Y,wxDC& dca);
                 //**********************************************
                void SetWhatToDoOnDragging(int Do);
                 int GetWhatToDoOnDragging();
                 //**********************************************
                // void SetNewInstanceCondition(int Con);
                 //int GetNewInstanceCondition();
            
         private:
            int itsObject;
            //***************
            int StartX;
            int StartY;
            //***************
            int itsPosX;
            int itsPosY;
            //***************
            int itsInstanceCount;
            //***************
            int itsWhatToDoOnDragging;
            //*****************
            int itsNewInstanceCondition;
          
    };
  
  
  
#endif

***************************************************************************************************

ObjectManager.cpp implementační část...

/*
  Name: WorkBench.cpp
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#include
#include "Project1Frm.h"
#include "ObjectManager.h"
#include "Object.h"
#include "WorkBench.h"
#define MAXINSTANCE 1000
Object* OB = new Object[MAXINSTANCE];
//****************************************************************** Draw an object
void ObjectManager::Draw(wxDC& dce){
  
        //Seting coordinates of object of current instance number
        OB[GetInstanceCount()].SetCoordXY(this->GetStartX(), this->GetStartY(), this->GetPosX(), this->GetStartY());
        OB[GetInstanceCount()].SetCoordXY2(this->GetPosX(), this->GetStartY(), this->GetPosX(), this->GetPosY());
        OB[GetInstanceCount()].Draw(dce);
  
}
//****************************************************************** Set type of object to be draw
void ObjectManager::SetObjectTypeToDraw(int ObjectTypeToDraw){
    itsObject = ObjectTypeToDraw;
}
int ObjectManager::GetObjectTypeToDraw()const{
    return itsObject;
}
//****************************************************************** Get start coordinates after left down
void ObjectManager::SetStartXY(int X,int Y){
    StartX = X;
    StartY = Y;
}
 
int ObjectManager::GetStartX()const{
    return StartX;
}

int ObjectManager::GetStartY()const{
    return StartY;
}
//****************************************************************** Synchronization coordinates on Mouse Move
void ObjectManager::SyncPosXY(int X, int Y){
    itsPosX = X;
    itsPosY = Y;
}
int ObjectManager::GetPosX(){
    return itsPosX;
}
int ObjectManager::GetPosY(){
    return itsPosY;
}
//****************************************************************** Instance Total Counter
void ObjectManager::SetInstanceCount(int InstanceCount){
    itsInstanceCount = InstanceCount;
}
int ObjectManager::GetInstanceCount(){
    return itsInstanceCount;
  
}
//********************************************************************
void ObjectManager::DrawFixture(int X,int Y,wxDC& dca){
 
             dca.SetPen(wxPen(*wxRED, 1, wxSOLID));
            //dca.SetLogicalFunction(wxSET);
            //dca.SetPen(*wxTRANSPARENT_PEN);
            //dca.SetBackgroundMode(wxTRANSPARENT);
          
   for (int i = 0;i <= GetInstanceCount();i++){
      
        if ( OB[i].GetAX() == OB[i].GetBX() ){
          
            //int difference = OB[i].GetAY()-OB[i].GetBY();//diffrerence between AY and BY
          
          
              
               dca.DrawRectangle(OB[i].GetAX()-5,OB[i].GetAY()-10,10,10);
          
        }
    }
  
}
//**********************************************************************
void ObjectManager::SetWhatToDoOnDragging(int Do){
    itsWhatToDoOnDragging = Do;
}

int ObjectManager::GetWhatToDoOnDragging(){
    return itsWhatToDoOnDragging;
}
//**********************************************************************
/*
void ObjectManager::SetNewInstanceCondition(int Con){
    itsNewInstanceCondition = itsNewInstanceCondition+Con;
    if (Con > 3){wxMessageBox("Error 1: Program assigment");return;}
    switch (itsNewInstanceCondition)
    {
        case 0:
            itsNewInstanceCondition = Con;
            break;
        case 1:
            if(Con == 1){return;}
            if(Con == 2){itsNewInstanceCondition = Con;}
            break;
        case 2:
            if(Con == 2){return;}
            if(Con == 1){itsNewInstanceCondition = Con;}  
            break;
        }
}
int ObjectManager::GetNewInstanceCondition(){
    return itsNewInstanceCondition;
}
*/

***************************************************************************************************

Object.h Vlastní oběkt ktrerý si sám pamatuje svojí polohu a metodu vykreslení

/*
  Name: WorkBech.h
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#ifndef __OBJECT_h__
#define __OBJECT_h__
#include "wx/wx.h"
#include
#include

class Object
    {
        public:
             Object(){itsTypeOfObject = 0;itsAX = 0;itsAY = 0;itsBX = 0;itsBY = 0;itsOldCoordAX = 0;
            itsOldCoordAY = 0;itsOldCoordBX = 0;itsOldCoordBY = 0;itsAX2 = 0;itsAY2 = 0;itsBX2 = 0;
            itsBY2 = 0;itsOldCoordAX2 = 0;
            itsOldCoordAY2 = 0;itsOldCoordBX2 = 0;itsOldCoordBY2 = 0;CountNDraw = 0;}
            ~Object(){};
            //************************************** Set object type
            void SetTypeOfObject(int Type);
             int GetTypeOfObject();
             //************************************* Set coordinates first line
            void SetCoordXY(int AX, int AY, int BX, int BY);
             int GetAX();
             int GetAY();
             int GetBX();
             int GetBY();
             //************************************** Save old coordinates first line
            void SetOldCoordXY(int AX, int AY, int BX, int BY);
             int GetOldCoordAX();
             int GetOldCoordAY();
             int GetOldCoordBX();
             int GetOldCoordBY();
             //////////////////////////////////////// Set coordinates second line
             void SetCoordXY2(int AX2, int AY2, int BX2, int BY2);
             int GetAX2();
             int GetAY2();
             int GetBX2();
             int GetBY2();
             //************************************** Save old coordinates second line
            void SetOldCoordXY2(int AX2, int AY2, int BX2, int BY2);
             int GetOldCoordAX2();
             int GetOldCoordAY2();
             int GetOldCoordBX2();
             int GetOldCoordBY2();
            //*************************************** Draw
            void Draw(wxDC& dce);


              
                       
        private:
            int itsTypeOfObject;
            //*************** Set coordinates first line
            int itsAX;
            int itsAY;
            int itsBX;
            int itsBY;
            //*************** Old coordinates first line
            int itsOldCoordAX;
            int itsOldCoordAY;
            int itsOldCoordBX;
            int itsOldCoordBY;
            ///////////////////
            //*************** Set coordinates second line
            int itsAX2;
            int itsAY2;
            int itsBX2;
            int itsBY2;
            //*************** Old coordinates second line
            int itsOldCoordAX2;
            int itsOldCoordAY2;
            int itsOldCoordBX2;
            int itsOldCoordBY2;
            //*************** Count pass
            int CountNDraw;
      
         
    };
  
  
  
#endif

***************************************************************************************************

Object.cpp - implementační část...

/*
  Name: WorkBench.cpp
  Copyright:
  Author: Zdenek Krejci
  Date: 26/07/09 19:09
  Description:
*/
#include
#include "Project1Frm.h"
#include "ObjectManager.h"
#include "Object.h"

//*********************************************************************Set object type
void Object::SetTypeOfObject(int Type){
    itsTypeOfObject = Type;
  
}
int Object::GetTypeOfObject(){
    return itsTypeOfObject;
}
//******************************************************************** Set and Get coordinates
void Object::SetCoordXY(int AX, int AY, int BX, int BY){
    itsAX = AX;
    itsAY = AY;
    itsBX = BX;
    itsBY = BY;
}
int Object::GetAX(){
    return itsAX;
}
int Object::GetAY(){
    return itsAY;
}
int Object::GetBX(){
    return itsBX;
}
int Object::GetBY(){
    return itsBY;
}
///////////////////////////
void Object::SetCoordXY2(int AX2, int AY2, int BX2, int BY2){
    itsAX2 = AX2;
    itsAY2 = AY2;
    itsBX2 = BX2;
    itsBY2 = BY2;
}
int Object::GetAX2(){
    return itsAX2;
}
int Object::GetAY2(){
    return itsAY2;
}
int Object::GetBX2(){
    return itsBX2;
}
int Object::GetBY2(){
    return itsBY2;
}
//********************************************************************** Set and Get old coordinates of first and second line
void Object::SetOldCoordXY(int AX, int AY, int BX, int BY){
    itsOldCoordAX = AX;
    itsOldCoordAY = AY;
    itsOldCoordBX = BX;
    itsOldCoordBY = BY;
}
int Object::GetOldCoordAX(){
    return itsOldCoordAX;
}
int Object::GetOldCoordAY(){
    return itsOldCoordAY;
}
int Object::GetOldCoordBX(){
    return itsOldCoordBX;
}
int Object::GetOldCoordBY(){
    return itsOldCoordBY;
}
/////////////////////////////////
void Object::SetOldCoordXY2(int AX2, int AY2, int BX2, int BY2){
    itsOldCoordAX2 = AX2;
    itsOldCoordAY2 = AY2;
    itsOldCoordBX2 = BX2;
    itsOldCoordBY2 = BY2;
}
int Object::GetOldCoordAX2(){
    return itsOldCoordAX2;
}
int Object::GetOldCoordAY2(){
    return itsOldCoordAY2;
}
int Object::GetOldCoordBX2(){
    return itsOldCoordBX2;
}
int Object::GetOldCoordBY2(){
    return itsOldCoordBY2;
}
//*********************************************************************** Draw
void Object::Draw(wxDC& dce){
 
    dce.SetPen(*wxBLACK_PEN);
    dce.SetLogicalFunction(wxINVERT);
 
   switch(CountNDraw)
   {
     case 1:
        //***************************************************************First Line to draw             
        dce.DrawLine(this->GetOldCoordAX(), this->GetOldCoordAY(), this->GetOldCoordBX(), this->GetOldCoordBY());
        dce.DrawLine(this->GetAX(), this->GetAY(), this->GetBX(), this->GetBY());
        SetOldCoordXY(this->GetAX(), this->GetAY(), this->GetBX(), this->GetBY());
        //***************************************************************Second Line to draw
        dce.DrawLine(this->GetOldCoordAX2(), this->GetOldCoordAY2(), this->GetOldCoordBX2(), this->GetOldCoordBY2());
        dce.DrawLine(this->GetAX2(), this->GetAY2(), this->GetBX2(), this->GetBY2());
        SetOldCoordXY2(this->GetAX2(), this->GetAY2(), this->GetBX2(), this->GetBY2());
        break;
     case 0:
        //***************************************************************First Line to draw          
        dce.DrawLine(this->GetAX(), this->GetAY(), this->GetBX(), this->GetBY());
        SetOldCoordXY(this->GetAX(), this->GetAY(), this->GetBX(), this->GetBY());
        //***************************************************************Second Line to draw
        dce.DrawLine(this->GetAX2(), this->GetAY2(), this->GetBX2(), this->GetBY2());
        SetOldCoordXY2(this->GetAX2(), this->GetAY2(), this->GetBX2(), this->GetBY2());      
        CountNDraw = 1;
      
        break;
    }
  
  
}
Name
Email
Comment
Or visit this link or this one