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
Родитель bfa2e799a8
Коммит f1ba38b754
2 изменённых файлов: 23 добавлений и 0 удалений

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

@ -405,6 +405,9 @@ CRDFPushButton :: MouseWithin ( Point /*inPortPt*/, const EventRecord & /*inMacE
void void
CRDFPushButton :: MouseLeave( ) CRDFPushButton :: MouseLeave( )
{ {
if ( !IsMouseInFrame() )
return;
mMouseInFrame = false; mMouseInFrame = false;
if (IsActive() && IsEnabled()) { if (IsActive() && IsEnabled()) {
// since we can't simply draw the border w/ xor, we need to get the toolbar // 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 } // 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 - #pragma mark -

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

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