mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Added a stack-based class for setting/restoring the HT event notification mask (rev sdagley, appr don)
This commit is contained in:
parent
ab89d48dba
commit
00bc8c3090
@ -101,4 +101,26 @@ Uint32 URDFUtilities::GetContainerSize(HT_Resource container)
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// StHTEventMasking
|
||||
//
|
||||
// Change HT's event masking in the given pane for the lifetime of this class. This is
|
||||
// meant to be used as a stack-based class. The new notification mask is set in the contsructor
|
||||
// and is reset to the original mask in the destructor.
|
||||
//
|
||||
|
||||
URDFUtilities::StHTEventMasking :: StHTEventMasking ( HT_Pane inPane, HT_NotificationMask inNewMask )
|
||||
: mPane(inPane)
|
||||
{
|
||||
HT_GetNotificationMask ( mPane, &mOldMask );
|
||||
HT_SetNotificationMask ( mPane, inNewMask );
|
||||
}
|
||||
|
||||
|
||||
URDFUtilities::StHTEventMasking :: ~StHTEventMasking ( )
|
||||
{
|
||||
HT_SetNotificationMask ( mPane, mOldMask );
|
||||
}
|
||||
|
@ -38,6 +38,18 @@ class URDFUtilities
|
||||
static Uint32 HTRowToPPRow ( TableIndexT inHTRow )
|
||||
{ return inHTRow + 1; }
|
||||
|
||||
// Change HT's event masking for the lifetime of this class
|
||||
class StHTEventMasking
|
||||
{
|
||||
public:
|
||||
StHTEventMasking ( HT_Pane inPane, HT_NotificationMask inNewMask );
|
||||
~StHTEventMasking ( ) ;
|
||||
|
||||
private:
|
||||
HT_NotificationMask mOldMask;
|
||||
HT_Pane mPane;
|
||||
};
|
||||
|
||||
protected:
|
||||
static Boolean sIsInited;
|
||||
};
|
Loading…
Reference in New Issue
Block a user