HI,
I have write code to moe a selected entity with mouse. My problem is when the cursor reaches the edge of the screen it does not zoom automatically. the image is currently show in FitToSize and the scrollbars are show. Only it does not scroll. Please guide how I should code to make it happen? I am using C++ Builder 2009 and CADImportVCL_CADExportVCL_7.2.5.
Thanks.
Jason
How can I make screen scroll when mouse reach the top of scr
Moderators: SDS, support, admin
-
- Posts: 24
- Joined: 13 Apr 2006, 16:20
Re: How can I make screen scroll when mouse reach the top of
Hello.
Such functionality is possible but library modification required. We will send modified units and AddNew demo project to your mailbox. Please note the following code changes:
and additions:
Alexander.
Such functionality is possible but library modification required. We will send modified units and AddNew demo project to your mailbox. Please note the following code changes:
Code: Select all
sgPaintBox->RectZooming = false;
...
void __fastcall TfmMain::sgPaintBoxMouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
int dx = 0, dy = 0;
if (!PtInRect(sgPaintBox->ClientRect, Point(X, Y))) {
if (X < 0)
dx = X;
else
if (X > sgPaintBox->ClientWidth)
dx = X - sgPaintBox->ClientWidth;
if (Y < 0)
dy = Y;
else
if (Y > sgPaintBox->ClientHeight)
dy = Y - sgPaintBox->ClientHeight;
sgPaintBox->MovePictureRect(-dx, -dy);
}
}
Code: Select all
void __fastcall TfmMain::sgPaintBoxMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if (Button == mbLeft) {
sgPaintBox->SetFocus();
SetCaptureControl(sgPaintBox);
}
}
...
void __fastcall TfmMain::sgPaintBoxMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
if ((Button == mbLeft) && (GetCaptureControl() == sgPaintBox)) {
SetCaptureControl(NULL);
}
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support