[Q] About CRectTracker.
Kalyan -- chakri@sunserv.cmc.stph.net
Monday, September 30, 1996
Environment : Windows95, VC++ 4.1
Hi all,
Can I use the CRectTracker class for other the applications
other than involving OLE. Can I have more than one CRectTracker
objects in an app. with different rectangles on the client area.
Thanx in Advance,
Kalyan.V
Severino Delaurenti -- del@alpha.ico.olivetti.com
Tuesday, October 01, 1996
[Mini-digest: 11 responses]
From: Kalyan[SMTP:chakri@sunserv.cmc.stph.net]
Sent: 30 September 1996 15:21
To: mfc-l@netcom.com
Subject: [Q] About CRectTracker.
Environment : Windows95, VC++ 4.1
Hi all,
Can I use the CRectTracker class for other the applications=20
other than involving OLE.
Kalyan,
Look at the example on your Visual C++ 4.1 CD:
\MSDEV\SAMPLES\MFC\GENERAL\TRACKER
Can I have more than one CRectTracker
objects in an app. with different rectangles on the client area.
Sure, you can have more than one tracker on your view.
The behavior depends from the architecture of your application.
Normally the tracker is created when the user push the left mouse button =
and drag it over the view to select an area. So you can decide, for =
example, of having an "array" of trackers, each of them created when the =
user makes a new selection.
Bye
Severino Delaurenti
del@alpha.ico.olivetti.com
Olivetti Lexikon Spa
Italy
-----From: James Shao
> Can I use the CRectTracker class for other the applications
> other than involving OLE. i
Yes, you can.
>Can I have more than one CRectTracker
> objects in an app. with different rectangles on the client area.
>
I think that it should have no problem. You can have two or more
CRectTracker objects in your program and use them independently.
James Shao
DSP Technology Inc.
-----From: "C.Zhang"
You surely can use CRectTracker in other applications without Ole stuff.
And I am pretty sure that you can create multiple CRectTracker objects
at sametime as long as only one is active at a time.
-----From: Colin Angus Mackay
I don't see why not. In fact the first time I used this class I never
realised it was designed for OLE objects at all. I used it as a
convenient method for the used to desegnate an area of the screen for to
be zoomed in on.
Colin Angus Mackay
-----From: "Alan J. Livingston"
>From the Visual C++ Online Help overview for the CRectTracker class:
Although the CRectTracker class is designed to allow the user
to interact with OLE items by using a graphical interface, its
use is not restricted to OLE-enabled applications. It can be used
anywhere such a user interface is required.
You can have more than one CRectTracker object displayed at a time. If you
wanted to track multiple objects (Similar to Win 95's Explorer when dragging
multiple objects) -- No, you can't do that with CRectTracker.
-Alan
-----From: "Weeder, John"
The general answer to your questions is yes. The Visual C++ sample
applications "TRACKER" and "DRAWCLI" demonstrate the CRectTracker class.
-- John
-----From: "Paul Mitchell"
CRectTracker helps when creating an OLE app, but you can use it completely
independently of OLE (and I have in my current project). And I don't see
any reason why you shouldn't create as many of them as you want.
--
Paul Mitchell
British Gas Plc.
-----From: Jim Barry
>From the online help for CRectTracker:
"The CRectTracker class allows an item to be displayed, moved, and
resized in different fashions. Although the CRectTracker class is
designed to allow the user to interact with OLE items by using a
graphical interface, its use is not restricted to OLE-enabled
applications. It can be used anywhere such a user interface is required."
So yes, it isn't just for OLE. I don't see any problem with having
several CRectTrackers around at once.
Cheers,
- Jim
-----From: Duane Sallee
Yes, you can use the trackers for more than just OLE. I am using them
in an application to track "hot spots" on images. I can allocate up
to 400 of them without any problems. (Note that the 400 number is a
limitation on my part, not MFC). The code runs perfectly on both 95,
NT, and Win32s 1.3x.
To draw the rectangles, I just traverse a list of the trackers in my
view class' OnDraw(). I took most of my ideas from the sample Tracker
on the SDK and Developer Network CD's. They use ole in the samples,
but again, you don't have to.
Duane Sallee
Teubner & Associates, Inc.
-----From: "Sanjay Chouksey"
Hi,
Yes you can have multiple CRectTracker classes in the app on a client
area. I have an annotation tool for Images developed where the
annotation objects (Circle, Pen , Rect, Text, etc) have a CRectTracker
object. There can be multiple annotations on an image
Sanjay
MediaWay, Inc
-----From: "Dennis W. Worthem"
I use CRectTracker by declaring pointers of its type and use it within the
CFormView class.
Also I have derived a new class from CRectTracker and CObject by multiple
inheritance so that I can save the pointers in collection classes. The
derived class also allows additional properties and methods to be associated
with the tracker.
Dennis
| Вернуться в корень Архива
|