зеркало из https://github.com/mozilla/pjs.git
Better drawing for control tracking on push buttons. Now selects/unselects correctly for mouse clicks.
This commit is contained in:
Родитель
2780450cd8
Коммит
909becd6f9
|
@ -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; } ;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче