本文整理汇总了C++中Disable函数的典型用法代码示例。如果您正苦于以下问题:C++ Disable函数的具体用法?C++ Disable怎么用?C++ Disable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Disable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Enable
bool Layout::IsEnabled()
{
for (int i = 0; i < m_nWins; i++) {
if(m_sub_wins[i]->IsEnabled()){
if(!IWindow::IsEnabled())
Enable();
return true;
}
}
if(IWindow::IsEnabled())
Disable();
return false;
}
示例2: Disable
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CAI_PolicingBehavior::GatherConditions( void )
{
BaseClass::GatherConditions();
// Mapmaker may have removed our goal while we're running our schedule
if ( !m_hPoliceGoal )
{
Disable();
return;
}
ClearCondition( COND_POLICE_TARGET_TOO_CLOSE_HARASS );
ClearCondition( COND_POLICE_TARGET_TOO_CLOSE_SUPPRESS );
CBaseEntity *pTarget = m_hPoliceGoal->GetTarget();
if ( pTarget == NULL )
{
DevMsg( "ai_goal_police with NULL target entity!\n" );
return;
}
// See if we need to knock out our target immediately
if ( ShouldKnockOutTarget( pTarget ) )
{
SetCondition( COND_POLICE_TARGET_TOO_CLOSE_SUPPRESS );
}
float flDistSqr = ( m_hPoliceGoal->WorldSpaceCenter() - pTarget->WorldSpaceCenter() ).Length2DSqr();
float radius = ( m_hPoliceGoal->GetRadius() * PATROL_RADIUS_RATIO );
float zDiff = fabs( m_hPoliceGoal->WorldSpaceCenter().z - pTarget->WorldSpaceCenter().z );
// If we're too far away, don't bother
if ( flDistSqr < (radius*radius) && zDiff < 32.0f )
{
SetCondition( COND_POLICE_TARGET_TOO_CLOSE_HARASS );
if ( flDistSqr < (m_hPoliceGoal->GetRadius()*m_hPoliceGoal->GetRadius()) )
{
SetCondition( COND_POLICE_TARGET_TOO_CLOSE_SUPPRESS );
}
}
// If we're supposed to stop chasing (aggression over), return
if ( m_bTargetIsHostile && m_flAggressiveTime < gpGlobals->curtime && IsCurSchedule(SCHED_CHASE_ENEMY) )
{
// Force me to re-evaluate my schedule
GetOuter()->ClearSchedule( "Stopped chasing, aggression over" );
}
}
示例3: DCHECK_EQ
void FieldTrial::UseOneTimeRandomization()
{
DCHECK_EQ(group_, kNotFinalized);
DCHECK_EQ(kDefaultGroupNumber + 1, next_group_number_);
if(!FieldTrialList::IsOneTimeRandomizationEnabled())
{
NOTREACHED();
Disable();
return;
}
random_ = static_cast<Probability>(
divisor_ * HashClientId(FieldTrialList::client_id(), name_));
}
示例4: Enable
NS_IMETHODIMP
TaskbarPreview::SetVisible(bool visible) {
if (mVisible == visible) return NS_OK;
mVisible = visible;
// If the nsWindow has already been destroyed but the caller is still trying
// to use it then just pretend that everything succeeded. The caller doesn't
// actually have a way to detect this since it's the same case as when we
// CanMakeTaskbarCalls returns false.
if (!mWnd)
return NS_OK;
return visible ? Enable() : Disable();
}
示例5: DoAvailable
/* DoAvailable()
* ===================================================================
*/
void
DoAvailable( void )
{
PrevTree = ad_front;
Reset_Tree( ad_inactive );
NoExit( IINSTALL );
Disable( IINSTALL );
NoExit( ICONFIG );
Disable( ICONFIG );
/* Read in the UnUsed fonts, if necessary */
if( !Fonts_Loaded )
{
MF_Save();
Scan_Message( ad_scan, TRUE );
read_fonts( TRUE, FALSE );
Scan_Message( ad_scan, FALSE );
MF_Restore();
}
CheckSelectAll( FALSE );
mover_setup( available_list, available_count,
IBASE, ISLIDER, IUP, IDOWN,
ILINE0, ILINE13, ILINE, 0, INACTIVE_HEIGHT );
HideObj( ILINE );
Objc_draw( tree, ROOT, MAX_DEPTH, NULL );
ShowObj( ILINE );
RedrawBase( tree, ILINE );
}
示例6: HandleUpdate
void Bird::HandleUpdate(StringHash eventType, VariantMap &eventData)
{
if (dead_ && GetPosition().y_ < -5.0f) Disable();
float timeStep = eventData[SceneUpdate::P_TIMESTEP].GetFloat();
if (sinceSpeciesSet_ < morphTime_){
Morph();
}
sinceSpeciesSet_ += timeStep;
if (sinceStateChange_ > stateDuration_){
switch (state_) {
case BirdState::Flying: {
SetState(BirdState::Landing);
} break;
case BirdState::Standing: {
SetState(BirdState::Flying);
} break;
default:
break;
}
}
if(!(first_ && state_ == BirdState::Standing)) sinceStateChange_ += timeStep;
switch (state_) {
case BirdState::Flying: {
Fly(timeStep);
} break;
case BirdState::Landing: {
Land(timeStep);
} break;
case BirdState::Standing: {
Stand(timeStep);
} break;
default:
break;
}
//Move bird
rootNode_->Translate(velocity_*timeStep, TS_WORLD);
//Update rotation in accordance with the birds movement.
if (velocity_.Length() > 0.01f){
Quaternion rotation = rootNode_->GetWorldRotation();
Quaternion aimRotation = rotation;
aimRotation.FromLookRotation(velocity_);
rootNode_->SetRotation(rotation.Slerp(aimRotation, 2.0f * timeStep * velocity_.Length()));
}
}
示例7: defined
CMemLeakDetector::~CMemLeakDetector()
{
#if defined(AUTO_ENABLE_MEMLEAKDETECTOR)
// report leaks
Disable();
ReportLeaks();
#endif
#if defined(PLATFORM_WINDOWS)
for(std::size_t i = 0; i < m_ModuleInfoVector.size(); ++i)
_free_dbg(m_ModuleInfoVector[i].m_ModuleName, _CRT_BLOCK);
#endif
delete m_Reporter;
}
示例8: MythUIType
MythUICheckBox::MythUICheckBox(MythUIType *parent, const QString &name)
: MythUIType(parent, name)
{
m_currentCheckState = MythUIStateType::Off;
m_state = "active";
m_BackgroundState = m_CheckState = NULL;
connect(this, SIGNAL(TakingFocus()), this, SLOT(Select()));
connect(this, SIGNAL(LosingFocus()), this, SLOT(Deselect()));
connect(this, SIGNAL(Enabling()), this, SLOT(Enable()));
connect(this, SIGNAL(Disabling()), this, SLOT(Disable()));
SetCanTakeFocus(true);
}
示例9: Disable
void CIP2Country::Enable()
{
Disable();
if (m_CountryDataMap.empty()) {
LoadFlags();
}
if (!CPath::FileExists(m_DataBasePath)) {
Update();
return;
}
m_geoip = GeoIP_open(unicode2char(m_DataBasePath), GEOIP_STANDARD);
}
示例10: Disable
void opengl_texture_state::SetTarget(GLenum tex_target)
{
if (units[active_texture_unit].texture_target != tex_target) {
Disable();
if (units[active_texture_unit].texture_id) {
glBindTexture(units[active_texture_unit].texture_target, 0);
units[active_texture_unit].texture_id = 0;
}
// reset modes, since those were only valid for the previous texture target
default_values(active_texture_unit, tex_target);
units[active_texture_unit].texture_target = tex_target;
}
}
示例11: Enable
WorldLog::WorldLog()
{
bEnabled = false;
m_file = NULL;
if (Config.MainConfig.GetBoolDefault("LogLevel", "World", false))
{
Log.Notice("WorldLog", "Enabling packetlog output to \"world.log\"");
Enable();
}
else
{
Disable();
}
}
示例12: Disable
static void
/*FCN*/UpdateDlgControls (
void
){
if ( totalFeatures == 0 ){
Disable ( featGroup );
Enable ( groupDelButton );
} else {
if ( curFeatureInd < nHideFeatures ) Enable ( featHideButton );
else Disable ( featHideButton );
Enable ( featGroup );
Disable ( groupDelButton );
}
if ( totalGroups < 6 ){
Enable ( newButton );
} else {
Disable ( newButton );
}
if ( curGroupInd < nHideGroups ) Enable (groupHideButton);
else Disable ( groupHideButton );
if ( (Int2)Nlm_GetMuskCParamEd(MSM_GROUPS,groupAr[curGroupInd],MSM_STYLE)
== MSM_SPREAD ) SetStatus (groupCompBox,FALSE);
else SetStatus (groupCompBox,TRUE);
}
示例13: AddDelay
void AddDelay(TimerBase *TimerBase, struct IORequest *ioreq)
{
DPrintF("Inside AddDelay!\n");
UINT32 ipl;
ipl = Disable();
timer_AddTime(TimerBase, &TimerBase->Elapsed, &((struct TimeRequest*)ioreq)->tr_time);
INTERN_QueueRequest(TimerBase, ioreq);
Enable(ipl);
DPrintF("Delay added!\n");
//CLEAR_BITS(((struct TimeRequest*)ioreq)->tr_node.io_Flags, IOF_QUICK);
((struct TimeRequest*)ioreq)->tr_node.io_Flags &= ~IOF_QUICK;
}
示例14: Disable
void CCustomZone::OnStateSwitch (EZoneState new_state)
{
if (new_state==eZoneStateDisabled)
Disable();
else
Enable();
if(new_state==eZoneStateAccumulate)
PlayAccumParticles();
if(new_state==eZoneStateAwaking)
PlayAwakingParticles();
m_eZoneState = new_state;
m_iPreviousStateTime = m_iStateTime = 0;
};
示例15: Disable
bool
RasterTile::CheckTileVisibility(int view_x, int view_y, unsigned view_radius)
{
if (!width || !height) {
Disable();
return false;
}
const unsigned int dx1 = abs(view_x - (int)xstart);
const unsigned int dx2 = abs((int)xend - view_x);
const unsigned int dy1 = abs(view_y - (int)ystart);
const unsigned int dy2 = abs((int)yend - view_y);
distance = std::max(std::min(dx1, dx2), std::min(dy1, dy2));
return distance <= view_radius || IsEnabled();
}