Added a stack-based class for setting/restoring the HT event notification mask (rev sdagley, appr don)

This commit is contained in:
pinkerton 1998-04-08 20:25:51 +00:00
parent ab89d48dba
commit 00bc8c3090
2 changed files with 35 additions and 1 deletions

View File

@ -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 );
}

View File

@ -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;
};