Better drawing for control tracking on push buttons. Now selects/unselects correctly for mouse clicks.

This commit is contained in:
pinkerton%netscape.com 1998-10-05 23:02:49 +00:00
Родитель 2780450cd8
Коммит 909becd6f9
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -405,6 +405,9 @@ CRDFPushButton :: MouseWithin ( Point /*inPortPt*/, const EventRecord & /*inMacE
void
CRDFPushButton :: MouseLeave( )
{
if ( !IsMouseInFrame() )
return;
mMouseInFrame = false;
if (IsActive() && IsEnabled()) {
// since we can't simply draw the border w/ xor, we need to get the toolbar
@ -438,6 +441,25 @@ CRDFPushButton :: HotSpotAction(short /* inHotSpot */, Boolean inCurrInside, Boo
} // HotSpotAction
//
// DoneTracking
//
// Reset the toolbar back to its original state.
//
void
CRDFPushButton :: DoneTracking( SInt16 inHotSpot, Boolean inGoodTrack )
{
SetTrackInside(false);
if ( inGoodTrack ) {
// draw parent, then redraw us.
GetSuperView()->Draw(NULL);
Draw(NULL);
}
else
MouseLeave(); // mouse has left the building. Redraw the correct state now, not later
}
#pragma mark -

Просмотреть файл

@ -123,6 +123,7 @@ protected:
// handle control tracking
virtual void HotSpotAction(short /* inHotSpot */, Boolean inCurrInside, Boolean inPrevInside) ;
virtual void DoneTracking ( SInt16 inHotSpot, Boolean /* inGoodTrack */) ;
bool IsMouseInFrame ( ) const { return mMouseInFrame; } ;