ET++: A sample application: iconedit
Every ET++ application which uses the view metaphore must subclass the View class.
FatIconView is the iconedit view class which shows an enlarged view of the bitmap.
This method handles a left button click. Like other event handling methods in ET++, this
method returns a Command, which is executed later.
Command *FatIconView::DoLeftButtonDownCommand(Point lp, Token t, int)
{
if (tool == 0 && PixelToRect(selection).ContainsPoint(lp)) {
Rectangle oldsel= selection;
return new BitMover(this, oldsel, t.Flags & eFlgShiftKey);
}
[ ... handle resize ... ]
switch (tool) {
case 0:
return new BitSelector(this);
case 1:
return new BitPainter(this, PointToPixel(lp));
case 2:
return new LineCommand(this);
case 3:
return new RectCommand(this, FALSE, "Stroke Rect");
[ ... handle other tool clicks ... ]
}
return gNoChanges;
}
Back to the top of the IconEdit description
Back to the top of the ET++ pages