Добавил:
korayakov
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабы / С++Builder / Laba5 / task3 / Unit2
.cpp//---------------------------------------------------------------------------
#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);
}