Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лабы / С++Builder / Laba5 / task3 / Unit2

.cpp
Скачиваний:
12
Добавлен:
17.04.2013
Размер:
857 б
Скачать
//---------------------------------------------------------------------------


#pragma hdrstop

#include "Unit2.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

void _fastcall SuperShape::MouseDown
        (TMouseButton Button, Classes::TShiftState Shift, int X, int Y)
{
moving=true;
x0=X;
y0=Y;
}

void __fastcall SuperShape::MouseUp
        (TMouseButton Button, Classes::TShiftState Shift, int X, int Y)
{
moving=false;
OnMouseUp(this,Button,Shift,X,Y);
}

void __fastcall SuperShape::MouseMove
        (Classes::TShiftState Shift, int X, int Y)
{
if (moving)
        {
        Left+=X-x0;
        Top+=Y-y0;
        }
}

void _fastcall SuperShape::Click()
{

}

void __fastcall SuperShape::DblClick()
{
((SuperShape*)this)->Shape=random(6);
}
Соседние файлы в папке task3