当前位置: 首页>>代码示例>>C++>>正文


C++ IsDisabled函数代码示例

本文整理汇总了C++中IsDisabled函数的典型用法代码示例。如果您正苦于以下问题:C++ IsDisabled函数的具体用法?C++ IsDisabled怎么用?C++ IsDisabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IsDisabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MouseExited

void Button::MouseExited(const MouseEvent& lEvent)
{
	if(IsDisabled())
	{
		return;
	}

	if(IsSelected() && m_Callback_Released)
	{
		// If we have pressed the button, but not released when we move outside of the button
		m_Callback_Released(m_pCallbackData_Released);
	}

	SetHover(false);

	// Call the callback function
	if(m_ExitCallback)
	{
		m_ExitCallback(m_pExitCallbackData);
	}

	// If we are selected when we exit, reposition back the offset
	if(IsSelected() && m_offsetApplied)
	{
		for(unsigned int i = 0; i < m_vpAddedComponentList.size(); i++)
		{
			m_vpAddedComponentList[i]->SetLocation(m_vpAddedComponentList[i]->GetLocation().m_x - m_pressedOffsetX, m_vpAddedComponentList[i]->GetLocation().m_y - m_pressedOffsetY);
		}

		m_label.SetLocation(m_label.GetLocation().m_x - m_pressedOffsetX, m_label.GetLocation().m_y - m_pressedOffsetY);

		m_offsetApplied = false;
	}

	if(m_bChangeLabelText)
	{
		for(unsigned int i = 0; i < m_vpAddedComponentList.size(); i++)
		{
			if(m_vpAddedComponentList[i]->GetComponentType() == EComponentType_Label)
			{
				((Label*)m_vpAddedComponentList[i])->SetColour(m_normalLabelColour);
			}
		}
		m_label.SetColour(m_normalLabelColour);
	}

	// Also removed the button selection if we exit it's dimensions
	SetSelected(false);

	OnMouseExit();
}
开发者ID:AlwaysGeeky,项目名称:Vox,代码行数:51,代码来源:button.cpp

示例2: ClientThink

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTeamRoundTimer::ClientThink()
{
	if ( IsDisabled() || m_bTimerPaused || IsInCommentaryMode() )
		return;

	if ( IsStopWatchTimer() == true && IsWatchingTimeStamps() == true )
		return;

	float flTime = GetTimeRemaining();

	if ( flTime <= 61.0 && m_bFire1MinRemain )
	{
		m_bFire1MinRemain = false;
		SendTimeWarning( RT_WARNING_60SECS );
	}
	else if ( flTime <= 31.0 && m_bFire30SecRemain )
	{
		m_bFire30SecRemain = false;
		SendTimeWarning( RT_WARNING_30SECS );
	}
	else if ( flTime <= 11.0 && m_bFire10SecRemain )
	{
		m_bFire10SecRemain = false;
		SendTimeWarning( RT_WARNING_10SECS );
	}
	else if ( flTime <= 6.0 && m_bFire5SecRemain )
	{
		m_bFire5SecRemain = false;
		SendTimeWarning( RT_WARNING_5SECS );
	}
	else if ( flTime <= 5.0 && m_bFire4SecRemain )
	{
		m_bFire4SecRemain = false;
		SendTimeWarning( RT_WARNING_4SECS );
	}
	else if ( flTime <= 4.0 && m_bFire3SecRemain )
	{
		m_bFire3SecRemain = false;
		SendTimeWarning( RT_WARNING_3SECS );
	}
	else if ( flTime <= 3.0 && m_bFire2SecRemain )
	{
		m_bFire2SecRemain = false;
		SendTimeWarning( RT_WARNING_2SECS );
	}
	else if ( flTime <= 2.0 && m_bFire1SecRemain )
	{
		m_bFire1SecRemain = false;
		SendTimeWarning( RT_WARNING_1SECS );
	}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:54,代码来源:teamplay_round_timer.cpp

示例3:

void C3Slider::MouseRGrabInside( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) return;

	if ( !m_thumb ) return;

	if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this )
	{

		return;
	}
	else
		MouseRGrabOutside( mouseData );
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:14,代码来源:C3slider.cpp

示例4: Undo_Fnodes

/* Undo_Fnodes()
 *==========================================================================
 * Deselects any Slits visible. Also, it goes down the slit ptr passed in,
 * and undo's any changes made to the filename.
 *
 * IN: 	FNODE *ptr:	Head Node pointer to the linked list.
 * 	BOOLEAN flag:	Defines which linked list to clear out.
 */
void
Undo_Fnodes( FON_PTR ptr )
{
    FON_PTR curptr;
    int     i;
    GRECT   rect; 
    int     tobject;
        
    /* Here we restore whatever the previous state was */
    if( !IsChanged( ptr ) )
    	return;
    	
    curptr = ptr;
    while( curptr )
    {
        AFLAG( curptr ) = SFLAG( curptr ) = FALSE;   
        curptr = FNEXT( curptr );
    }
    
    for( i = 0; i < MAX_SLITS; i++ )
        deselect( tree, First_Obj + i );
     
    if( IsActiveTree( ad_inactive ) )
       tobject = XTRANSFR;
    
    if( IsActiveTree( ad_active ) )
       tobject = REMOVE;
         
#if 1
    /* ONLY for inactive fonts tree */
    if( IsActiveTree( ad_inactive ) || IsActiveTree( ad_active ) )
    {
       if( !IsDisabled( tobject ) )
       {
          NoExit( tobject );
          Disable( tobject );
          
          rect = ObRect( tobject );
          objc_offset( tree, tobject, &rect.g_x, &rect.g_y );

	  rect.g_x -= 3;
	  rect.g_y -= 3;
	  rect.g_w += 6;
	  rect.g_h += 6;

          Objc_draw( tree, ROOT, MAX_DEPTH, &rect );
       }
    }
#endif    
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:58,代码来源:MOVER.C

示例5:

void ctp2_Button::ResetCurrentRenderFlags() {

	aui_Button::ResetCurrentRenderFlags();


	if(!IsDisabled())
		if(!m_isToggle || !m_toggleState) {
			AddRenderFlags(k_CTP2_BUTTON_LAYER_FLAG_UP);
			RemoveRenderFlags(k_CTP2_BUTTON_LAYER_FLAG_UP_ON);
		} else {
			AddRenderFlags(k_CTP2_BUTTON_LAYER_FLAG_UP_ON);
			RemoveRenderFlags(k_CTP2_BUTTON_LAYER_FLAG_UP);
		}
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:14,代码来源:ctp2_button.cpp

示例6: GetSightRange

void Unit::Order_NukeGround()
{
    unk_move_waypoint = order_target_pos;
    int sight_range = GetSightRange(false) * 32;
    int dist = Distance(exact_position, Point32(order_target_pos) * 256 + Point32(128, 128)) / 256;
    if (ai && dist <= sight_range * 3)
        Ai_Cloak();
    if (dist > sight_range)
    {
        if (move_target_update_timer == 0)
            ChangeMovementTarget(order_target_pos); // What, it is not moving?
    }
    else
    {
        StopMoving(this);
        if (position != unk_move_waypoint)
        {
            int diff = facing_direction - GetFacingDirection(sprite->position.x, sprite->position.y, unk_move_waypoint.x, unk_move_waypoint.y);
            if (diff < -1 || diff > 1)
                return;
        }
        Unit *silo = nullptr;
        for (Unit *unit : bw::first_player_unit[player])
        {
            if (unit->unit_id == NuclearSilo && unit->silo.has_nuke)
            {
                silo = unit;
                break;
            }
        }
        if (!silo)
        {
            OrderDone();
            return;
        }
        Unit *nuke = silo->silo.nuke;
        silo->silo.nuke = nullptr;
        silo->silo.has_nuke = 0;
        PlaySound(Sound::NukeLaser, this, 1, 0);
        IssueOrderTargetingGround(nuke, Order::NukeLaunch, order_target_pos.x, order_target_pos.y);
        related = nuke;
        nuke->related = this;
        nuke->sprite->SetDirection32(0);
        ShowUnit(nuke);
        IssueOrderTargetingGround(this, Order::NukeTrack, sprite->position.x, sprite->position.y);
        if (!IsDisabled() || units_dat_flags[unit_id] & UnitFlags::Building) // Huh?
            buttons = 0xed;
        RefreshUi();
    }
}
开发者ID:hydra-chan,项目名称:teippi_PronogoMod,代码行数:50,代码来源:nuke.cpp

示例7: MouseRDropInside

void aui_Button::MouseRDropInside( aui_MouseEvent *mouseData )
{
	if (IsDisabled()) return;

	if ( !GetWhichSeesMouse() || GetWhichSeesMouse() == this ) {
		SetWhichSeesMouse( this );

		HandleGameSpecificRightClick((void *)this);
		m_mouseCode = AUI_ERRCODE_HANDLED;
	}
	else {
		MouseRDropOutside( mouseData );
	}
}
开发者ID:jleclanche,项目名称:darkdust-ctp2,代码行数:14,代码来源:aui_button.cpp

示例8: MousePressed

void Button::MousePressed(const MouseEvent& lEvent)
{
	if(IsDisabled())
	{
		return;
	}

	// If our parent is a GUIWindow, then makew this window have focus in the GUI, used to make it's depth the highest
	if(GetParent() != NULL && GetParent()->GetComponentType() == EComponentType_GUIWindow)
	{
		GUIWindow* lpParentWindow = (GUIWindow *)GetParent();
		lpParentWindow->SetFocusWindow();
	}

	SetSelected(true);

	OnMousePressed();

	// Colour change
	if(m_bChangeLabelText)
	{
		for(unsigned int i = 0; i < m_vpAddedComponentList.size(); i++)
		{
			if(m_vpAddedComponentList[i]->GetComponentType() == EComponentType_Label)
			{
				((Label*)m_vpAddedComponentList[i])->SetColour(m_PressedLabelColour);
			}
		}

		m_label.SetColour(m_PressedLabelColour);
	}

	// Position change
	if(m_offsetApplied == false)
	{
		for(unsigned int i = 0; i < m_vpAddedComponentList.size(); i++)
		{
			m_vpAddedComponentList[i]->SetLocation(m_vpAddedComponentList[i]->GetLocation().m_x + m_pressedOffsetX, m_vpAddedComponentList[i]->GetLocation().m_y + m_pressedOffsetY);
		}

		m_label.SetLocation(m_label.GetLocation().m_x + m_pressedOffsetX, m_label.GetLocation().m_y + m_pressedOffsetY);

		m_offsetApplied = true;
	}
	
	if(m_Callback_Pressed)
	{
		m_Callback_Pressed(m_pCallbackData_Pressed);
	}
}
开发者ID:AlwaysGeeky,项目名称:Vox,代码行数:50,代码来源:button.cpp

示例9: Disabled

	void Disabled()
	{
		while(IsDisabled())
		{
			LEDLight->Set(Relay::kForward);
			rpi->Read();
			lcd->Clear();
			lcd->Printf(DriverStationLCD::kUser_Line3, 1, "R: %i", rpi->GetMissingPacketcount());
			lcd->Printf(DriverStationLCD::kUser_Line1, 1, "x: %i", rpi->GetXPos());
			lcd->Printf(DriverStationLCD::kUser_Line2, 1, "y: %i", rpi->GetYPos());

			lcd->UpdateLCD();
		}
	}
开发者ID:robotics1714,项目名称:2014-Code,代码行数:14,代码来源:MyRobot.cpp

示例10: if

void CGUIRadioButtonControl::Render()
{
  CGUIButtonControl::Render();

  if ( IsSelected() && !IsDisabled() )
  {
    if (HasFocus())
      m_imgRadioOnFocus.Render();
    else
      m_imgRadioOnNoFocus.Render();
  }
  else if ( !IsSelected() && !IsDisabled() )
  {
    if (HasFocus())
      m_imgRadioOffFocus.Render();
    else
      m_imgRadioOffNoFocus.Render();
  }
  else if ( IsSelected() && IsDisabled() )
    m_imgRadioOnDisabled.Render();
  else
    m_imgRadioOffDisabled.Render();
}
开发者ID:FLyrfors,项目名称:xbmc,代码行数:23,代码来源:GUIRadioButtonControl.cpp

示例11: Materialize

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponSpawner::Materialize( void )
{
	BaseClass::Materialize();

	if ( !IsDisabled() )
	{
		EmitSound( "Item.Materialize" );
		CPVSFilter filter( GetAbsOrigin() );
		//TE_TFParticleEffect( filter, 0.0f, RESPAWN_PARTICLE, GetAbsOrigin(), QAngle( 0,0,0 ) );
		AddEffects( EF_ITEM_BLINK );
		m_nRenderFX = kRenderFxNone;
		SetRenderColor( 255, 255, 255, 255 );
	}
}
开发者ID:zxz41,项目名称:TF2Classic,代码行数:17,代码来源:entity_weaponspawn.cpp

示例12:

bool
HTMLTextAreaElement::IsHTMLFocusable(bool aWithMouse,
                                     bool *aIsFocusable, int32_t *aTabIndex)
{
  if (nsGenericHTMLFormElementWithState::IsHTMLFocusable(aWithMouse, aIsFocusable,
                                                         aTabIndex))
  {
    return true;
  }

  // disabled textareas are not focusable
  *aIsFocusable = !IsDisabled();
  return false;
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:14,代码来源:HTMLTextAreaElement.cpp

示例13: RobotMain

/**
 * Start a competition.
 * This code needs to track the order of the field starting to ensure that everything happens
 * in the right order. Repeatedly run the correct method, either Autonomous or OperatorControl
 * when the robot is enabled. After running the correct method, wait for some state to change,
 * either the other mode starts or the robot is disabled. Then go back and wait for the robot
 * to be enabled again.
 */
void SimpleRobot::StartCompetition()
{
	nUsageReporting::report(nUsageReporting::kResourceType_Framework, nUsageReporting::kFramework_Simple);

	RobotMain();
	
	if (!m_robotMainOverridden)
	{
		// first and one-time initialization
		RobotInit();

		while (true)
		{
			if (IsDisabled())
			{
				m_ds->InDisabled(true);
				Disabled();
				m_ds->InDisabled(false);
				while (IsDisabled()) m_ds->WaitForData();
			}
			else if (IsAutonomous())
			{
				m_ds->InAutonomous(true);
				Autonomous();
				m_ds->InAutonomous(false);
				while (IsAutonomous() && IsEnabled()) m_ds->WaitForData();
			}
			else
			{
				m_ds->InOperatorControl(true);
				OperatorControl();
				m_ds->InOperatorControl(false);
				while (IsOperatorControl() && IsEnabled()) m_ds->WaitForData();
			}
		}
	}
}
开发者ID:jwhite66,项目名称:jpw-wpilib,代码行数:45,代码来源:SimpleRobot.cpp

示例14: if

void MenuItem::DrawSelf()
{
	// Reset visibility
	m_pSelectedIcon->SetVisible(false);
	m_pHoverIcon->SetVisible(false);
	m_pDisabledIcon->SetVisible(false);
	m_pDefaultIcon->SetVisible(false);

	if(!IsParentMenuOpen())
	{
		m_label.SetVisible(false);

		return;
	}

	if(m_bOnlyShowSelectedItems)
	{
		if(IsSelected())
		{
			m_pSelectedIcon->SetVisible(true);
		}
		else if(IsHover())
		{
			m_pHoverIcon->SetVisible(true);
		}
	}
	else
	{
		if(IsSelected())
		{
			m_pSelectedIcon->SetVisible(true);
		}
		else if(IsHover())
		{
			m_pHoverIcon->SetVisible(true);
		}
		else if(IsDisabled())
		{
			m_pDisabledIcon->SetVisible(true);
		}
		else
		{
			m_pDefaultIcon->SetVisible(true);
		}
	}

	// Set the label visibility
	m_label.SetVisible(true);
}
开发者ID:CodeMason,项目名称:Vox,代码行数:49,代码来源:menuitem.cpp

示例15: InternalSetNumTrainCappers

void CTeamTrainWatcher::InternalSetNumTrainCappers( int iNumCappers, CBaseEntity *pTrigger )
{
	if ( IsDisabled() )
		return;

	m_nNumCappers = iNumCappers;

	// inputdata.pCaller is hopefully an area capture
	// lets see if its blocked, and not start receding if it is
	CTriggerAreaCapture *pAreaCap = dynamic_cast<CTriggerAreaCapture *>( pTrigger );
	if ( pAreaCap )
	{
		m_bCapBlocked = pAreaCap->IsBlocked();
		m_hAreaCap = pAreaCap;
	}

	if ( iNumCappers <= 0 && !m_bCapBlocked && m_bTrainCanRecede )
	{
		if ( !m_bWaitingToRecede )
		{
			// start receding in [tf_escort_cart_recede_time] seconds
			m_bWaitingToRecede = true;

			if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->InOvertime() )
			{
				m_flRecedeTotalTime = tf_escort_recede_time_overtime.GetFloat();
			}
			else
			{
				m_flRecedeTotalTime = tf_escort_recede_time.GetFloat();
				if ( m_nTrainRecedeTime > 0 )
				{
					m_flRecedeTotalTime = m_nTrainRecedeTime;
				}
			}

			m_flRecedeStartTime = gpGlobals->curtime;
			m_flRecedeTime = m_flRecedeStartTime + m_flRecedeTotalTime;
		}		
	}
	else
	{
		// cancel receding
		m_bWaitingToRecede = false;
		m_flRecedeTime = 0;
	}

	HandleTrainMovement();
}
开发者ID:emcniece,项目名称:fps-moba,代码行数:49,代码来源:team_train_watcher.cpp


注:本文中的IsDisabled函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。