• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetFrame函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: wxCHECK_RET

void wxMenuBar::Refresh()
{
    if ( IsFrozen() )
        return;

    wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );

#if defined(WINCE_WITHOUT_COMMANDBAR)
    if (GetToolBar())
    {
        CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
    }
#elif defined(WINCE_WITH_COMMANDBAR)
    if (m_commandBar)
        DrawMenuBar((HWND) m_commandBar);
#else
    DrawMenuBar(GetHwndOf(GetFrame()));
#endif
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:19,代码来源:menu.cpp


示例2: GetShipType

// Input: direction in ship's frame, doesn't need to be normalized
// Approximate positive angular velocity at match point
// Applies thrust directly
// old: returns whether it can reach that direction in this frame
// returns angle to target
double Ship::AIFaceDirection(const vector3d &dir, double av)
{
	double timeStep = Pi::game->GetTimeStep();
	double maxAccel = GetShipType().angThrust / GetAngularInertia();		// should probably be in stats anyway
	if (maxAccel <= 0.0) return 0.0;
	double frameAccel = maxAccel * timeStep;

	matrix4x4d rot; GetRotMatrix(rot);
	vector3d head = (dir * rot).Normalized();		// create desired object-space heading
	vector3d dav(0.0, 0.0, 0.0);	// desired angular velocity

	double ang = 0.0;
	if (head.z > -0.99999999)			
	{
		ang = acos (Clamp(-head.z, -1.0, 1.0));		// scalar angle from head to curhead
		double iangvel = av + sqrt (2.0 * maxAccel * ang);	// ideal angvel at current time

		double frameEndAV = iangvel - frameAccel;
		if (frameEndAV <= 0.0) iangvel = ang / timeStep;	// last frame discrete correction
		else iangvel = (iangvel + frameEndAV) * 0.5;		// discrete overshoot correction

		// Normalize (head.x, head.y) to give desired angvel direction
		if (head.z > 0.999999) head.x = 1.0;
		double head2dnorm = 1.0 / sqrt(head.x*head.x + head.y*head.y);		// NAN fix shouldn't be necessary if inputs are normalized
		dav.x = head.y * head2dnorm * iangvel;
		dav.y = -head.x * head2dnorm * iangvel;
	}
	vector3d cav = (GetAngVelocity() - GetFrame()->GetAngVelocity()) * rot;		// current obj-rel angvel
//	vector3d cav = GetAngVelocity() * rot;				// current obj-rel angvel
	vector3d diff = (dav - cav) / frameAccel;					// find diff between current & desired angvel

	// If the player is pressing a roll key, don't override roll.
	// XXX this really shouldn't be here. a better way would be to have a
	// field in Ship describing the wanted angvel adjustment from input. the
	// baseclass version in Ship would always be 0. the version in Player
	// would be constructed from user input. that adjustment could then be
	// considered by this method when computing the required change
	if (IsType(Object::PLAYER) && (KeyBindings::rollLeft.IsActive() || KeyBindings::rollRight.IsActive()))
		diff.z = m_angThrusters.z;
	SetAngThrusterState(diff);
	return ang;
}
开发者ID:Ziusudra,项目名称:pioneer,代码行数:47,代码来源:Ship-AI.cpp


示例3: GetFreeDockingPort

void SpaceStation::DoLawAndOrder()
{
	Sint64 fine, crimeBitset;
	Polit::GetCrime(&crimeBitset, &fine);
	bool isDocked = static_cast<Ship*>(Pi::player)->GetDockedWith() ? true : false;
	if (Pi::player->GetFlightState() != Ship::DOCKED
			&& m_numPoliceDocked
			&& (fine > 1000)
			&& (GetPositionRelTo(static_cast<Body*>(Pi::player)).Length() < 100000.0)) {
		int port = GetFreeDockingPort();
		if (port != -1) {
			m_numPoliceDocked--;
			// Make police ship intent on killing the player
			Ship *ship = new Ship(ShipType::LADYBIRD);
			ship->AIKill(Pi::player);
			ship->SetFrame(GetFrame());
			ship->SetDockedWith(this, port);
			Space::AddBody(ship);
			{ // blue and white thang
				ShipFlavour f;
				f.type = ShipType::LADYBIRD;
				strncpy(f.regid, "POLICE", 16);
				f.price = ship->GetFlavour()->price;
				LmrMaterial m;
				m.diffuse[0] = 0.0f; m.diffuse[1] = 0.0f; m.diffuse[2] = 1.0f; m.diffuse[3] = 1.0f;
				m.specular[0] = 0.0f; m.specular[1] = 0.0f; m.specular[2] = 1.0f; m.specular[3] = 1.0f;
				m.emissive[0] = 0.0f; m.emissive[1] = 0.0f; m.emissive[2] = 0.0f; m.emissive[3] = 0.0f;
				m.shininess = 50.0f;
				f.primaryColor = m;
				m.shininess = 0.0f;
				m.diffuse[0] = 1.0f; m.diffuse[1] = 1.0f; m.diffuse[2] = 1.0f; m.diffuse[3] = 1.0f;
				f.secondaryColor = m;
				ship->ResetFlavour(&f);
			}
			ship->m_equipment.Set(Equip::SLOT_LASER, 0, Equip::PULSECANNON_DUAL_1MW);
			ship->m_equipment.Add(Equip::SHIELD_GENERATOR);
			ship->m_equipment.Add(Equip::LASER_COOLING_BOOSTER);
			ship->m_equipment.Add(Equip::ATMOSPHERIC_SHIELDING);
			ship->UpdateMass();
		}
	}
}
开发者ID:unavowed,项目名称:pioneer,代码行数:42,代码来源:SpaceStation.cpp


示例4: double

void DynamicBody::TimeStepUpdate(const float timeStep)
{
	if (m_enabled) {
		m_force += m_externalForce;

		m_oldOrient = m_orient;
		m_vel += double(timeStep) * m_force * (1.0 / m_mass);
		m_angVel += double(timeStep) * m_torque * (1.0 / m_angInertia);
		// angvel is always relative to non-rotating frame, so need to counter frame angvel
		vector3d consideredAngVel = m_angVel - GetFrame()->GetAngVelocity();
		
		vector3d pos = GetPosition();
		// applying angular velocity :-/
		{
			double len = consideredAngVel.Length();
			if (len > 1e-16) {
				vector3d rotAxis = consideredAngVel * (1.0 / len);
				matrix4x4d rotMatrix = matrix4x4d::RotateMatrix(len * timeStep,
						rotAxis.x, rotAxis.y, rotAxis.z);
				m_orient = rotMatrix * m_orient;
			}
		}
		m_oldAngDisplacement = consideredAngVel * timeStep;

		pos += m_vel * double(timeStep);
		m_orient[12] = pos.x;
		m_orient[13] = pos.y;
		m_orient[14] = pos.z;
		TriMeshUpdateLastPos(m_orient);

//printf("vel = %.1f,%.1f,%.1f, force = %.1f,%.1f,%.1f, external = %.1f,%.1f,%.1f\n",
//	m_vel.x, m_vel.y, m_vel.z, m_force.x, m_force.y, m_force.z,
//	m_externalForce.x, m_externalForce.y, m_externalForce.z);

		m_force = vector3d(0.0);
		m_torque = vector3d(0.0);
		CalcExternalForce();			// regenerate for new pos/vel
	} else {
		m_oldOrient = m_orient;
		m_oldAngDisplacement = vector3d(0.0);
	}
}
开发者ID:dewasha,项目名称:pioneer,代码行数:42,代码来源:DynamicBody.cpp


示例5: GetFrame

nsAccessible*
nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                     EWhichChildAtPoint aWhichChild)
{
  nsIFrame *frame = GetFrame();
  if (!frame)
    return nsnull;

  nsPresContext *presContext = frame->PresContext();
  nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();

  nsIFrame *rootFrame = presShell->GetRootFrame();
  NS_ENSURE_TRUE(rootFrame, nsnull);

  nsIntRect rootRect = rootFrame->GetScreenRectExternal();

  PRInt32 clientX = presContext->DevPixelsToIntCSSPixels(aX - rootRect.x);
  PRInt32 clientY = presContext->DevPixelsToIntCSSPixels(aY - rootRect.y);

  PRInt32 row = -1;
  nsCOMPtr<nsITreeColumn> column;
  nsCAutoString childEltUnused;
  mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                   childEltUnused);

  // If we failed to find tree cell for the given point then it might be
  // tree columns.
  if (row == -1 || !column)
    return nsAccessibleWrap::GetChildAtPoint(aX, aY, aWhichChild);

  nsAccessible *child = GetTreeItemAccessible(row);
  if (aWhichChild == eDeepestChild && child) {
    // Look for accessible cell for the found item accessible.
    nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);

    nsAccessible *cell = treeitem->GetCellAccessible(column);
    if (cell)
      child = cell;
  }

  return child;
}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:42,代码来源:nsXULTreeAccessible.cpp


示例6: Explode

void Missile::Explode()
{
	Pi::game->GetSpace()->KillBody(this);

	const double damageRadius = 200.0;
	const double kgDamage = 10000.0;

	for (Space::BodyIterator i = Pi::game->GetSpace()->BodiesBegin(); i != Pi::game->GetSpace()->BodiesEnd(); ++i) {
		if ((*i)->GetFrame() != GetFrame()) continue;
		double dist = ((*i)->GetPosition() - GetPosition()).Length();
		if (dist < damageRadius) {
			// linear damage decay with distance
			(*i)->OnDamage(m_owner, kgDamage * (damageRadius - dist) / damageRadius);
			if ((*i)->IsType(Object::SHIP))
				Pi::luaOnShipHit->Queue(dynamic_cast<Ship*>(*i), m_owner);
		}
	}

	Sfx::Add(this, Sfx::TYPE_EXPLOSION);
}
开发者ID:AaronSenese,项目名称:pioneer,代码行数:20,代码来源:Missile.cpp


示例7: GetFrame

/**
  * Our action name is the reverse of our state: 
  *     if we are closed -> open is our name.
  *     if we are open -> closed is our name.
  * Uses the frame to get the state, updated on every click
  */
NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
  if (aIndex != nsHTMLComboboxAccessible::eAction_Click) {
    return NS_ERROR_INVALID_ARG;
  }
  nsIFrame *frame = GetFrame();
  if (!frame) {
    return NS_ERROR_FAILURE;
  }
  nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
  if (!comboFrame) {
    return NS_ERROR_FAILURE;
  }
  if (comboFrame->IsDroppedDown())
    aName.AssignLiteral("close"); 
  else
    aName.AssignLiteral("open"); 

  return NS_OK;
}
开发者ID:AllenDou,项目名称:firefox,代码行数:26,代码来源:nsHTMLSelectAccessible.cpp


示例8: shell

NS_IMETHODIMP
nsAccessNode::ScrollTo(PRUint32 aScrollType)
{
  if (IsDefunct())
    return NS_ERROR_FAILURE;

  nsCOMPtr<nsIPresShell> shell(GetPresShell());
  NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);

  nsIFrame *frame = GetFrame();
  NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);

  nsCOMPtr<nsIContent> content = frame->GetContent();
  NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);

  PRInt16 vPercent, hPercent;
  nsCoreUtils::ConvertScrollTypeToPercents(aScrollType, &vPercent, &hPercent);
  return shell->ScrollContentIntoView(content, vPercent, hPercent,
                                      nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
}
开发者ID:dseif,项目名称:mozilla-central,代码行数:20,代码来源:nsAccessNode.cpp


示例9: check

void FGearVR::GetCurrentPose(FQuat& CurrentHmdOrientation, FVector& CurrentHmdPosition, bool bUseOrienationForPlayerCamera, bool bUsePositionForPlayerCamera)
{
	check(IsInGameThread());

	auto frame = GetFrame();
	check(frame);

	if (bUseOrienationForPlayerCamera || bUsePositionForPlayerCamera)
	{
		// if this pose is going to be used for camera update then save it.
		// This matters only if bUpdateOnRT is OFF.
		frame->EyeRenderPose[0] = frame->CurEyeRenderPose[0];
		frame->EyeRenderPose[1] = frame->CurEyeRenderPose[1];
		frame->HeadPose = frame->CurSensorState.Predicted.Pose;
	}

	frame->PoseToOrientationAndPosition(frame->CurSensorState.Predicted.Pose, CurrentHmdOrientation, CurrentHmdPosition);
	//UE_LOG(LogHMD, Log, TEXT("CRPOSE: Pos %.3f %.3f %.3f"), CurrentHmdPosition.X, CurrentHmdPosition.Y, CurrentHmdPosition.Z);
	//UE_LOG(LogHMD, Log, TEXT("CRPOSE: Yaw %.3f Pitch %.3f Roll %.3f"), CurrentHmdOrientation.Rotator().Yaw, CurrentHmdOrientation.Rotator().Pitch, CurrentHmdOrientation.Rotator().Roll);
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:20,代码来源:GearVR.cpp


示例10: GetFrame

void EnviroGUI::SetTerrainToGUI(vtTerrain *pTerrain)
{
	GetFrame()->SetTerrainToGUI(pTerrain);

	if (pTerrain)
	{
		if (m_pJFlyer)
		{
			float speed = pTerrain->GetParams().GetValueFloat(STR_NAVSPEED);
			m_pJFlyer->SetSpeed(speed);
		}
		ShowMapOverview(pTerrain->GetParams().GetValueBool(STR_OVERVIEW));
		ShowCompass(pTerrain->GetParams().GetValueBool(STR_COMPASS));
	}
	else
	{
		ShowMapOverview(false);
		ShowCompass(false);
	}
}
开发者ID:kamalsirsa,项目名称:vtp,代码行数:20,代码来源:EnviroGUI.cpp


示例11: wxFileSelector

void AudioView::Import()
{
  wxString fileName =
	wxFileSelector("Select an audio file...",
				   "", // Path
				   "", // Name
				   "", // Extension
				   "", // Wildcard
				   0, // Flags
				   GetFrame()); // Parent

  if (fileName == "")
    return;

  WaveTrack *left = 0;
  WaveTrack *right = 0;
  
  if (ImportWAV(fileName, &left, &right, &((AudioDoc *)GetDocument())->dirManager)) {

	if (left || right) {
	  SelectNone();
	}

    if (left) {
      GetTracks()->Add(left);
	  left->selected = true;
    }

    if (right) {
      GetTracks()->Add(right);
	  right->selected = true;
    }

    PushState();

    FixScrollbars();
    REDRAW(trackPanel);
    REDRAW(rulerPanel);
  }
  
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:41,代码来源:AudioView.cpp


示例12: Activate

bool TextEditView::OnClose(bool deleteWindow)
{
    if ( !wxView::OnClose(deleteWindow) )
        return false;

    Activate(false);

    if ( wxGetApp().GetMode() == MyApp::Mode_Single )
    {
        m_text->Clear();
    }
    else // not single window mode
    {
        if ( deleteWindow )
        {
            GetFrame()->Destroy();
            SetFrame(NULL);
        }
    }
    return true;
}
开发者ID:BjornBjarnsteins,项目名称:MoneyMaster-3000,代码行数:21,代码来源:view.cpp


示例13: do_QueryFrame

NS_IMETHODIMP
nsMenuBoxObject::GetOpenedWithKey(bool* aOpenedWithKey)
{
  *aOpenedWithKey = false;

  nsMenuFrame* menuframe = do_QueryFrame(GetFrame(false));
  if (!menuframe)
    return NS_OK;

  nsIFrame* frame = menuframe->GetParent();
  while (frame) {
    nsMenuBarFrame* menubar = do_QueryFrame(frame);
    if (menubar) {
      *aOpenedWithKey = menubar->IsActiveByKeyboard();
      return NS_OK;
    }
    frame = frame->GetParent();
  }

  return NS_OK;
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:21,代码来源:nsMenuBoxObject.cpp


示例14: ClearResultStrings

void SDIOAnalyzerResults::GenerateBubbleText( U64 frame_index, Channel& channel, DisplayBase display_base )
{
	ClearResultStrings();
	Frame frame = GetFrame( frame_index );

    // if this is command data
    if (frame.mType == FRAME_TYPE_CMD_DATA)
    {
        SdioCmd *tmp = SdioCmd::CreateSdioCmd(frame.mData1);
        string *s = tmp->getShortString();
		AddResultString( s->c_str() );
        delete s;
    }
    // else, this is data line data, should be partitioned into bytes
    else
    {
        char number_str[128] = {0};
        sprintf(number_str, "0x%02X", frame.mData1);
        AddResultString( number_str );
    }
}
开发者ID:GotoHack,项目名称:saleae_sdio,代码行数:21,代码来源:SDIOAnalyzerResults.cpp


示例15: while

void sPerfMonGpu::Flip()
{
    if(Current)
    {
        //    Leave(&MasterSection);
        Current->FrequencyQuery->End(Adapter->ImmediateContext);
        PendingFrames.AddTail(Current);
        Current = 0;
        uint64 freq;
        while(PendingFrames.GetCount()>History)
            GetLastFrame(freq);
    }
    if(sPerfMonEnable)
    {
        Current = GetFrame();
        Current->Data.Clear();
        sASSERT(Current->Queries.IsEmpty());
        Current->FrequencyQuery->Begin(Adapter->ImmediateContext);
        //  Enter(&MasterSection);
    }
}
开发者ID:wxthss82,项目名称:fr_public,代码行数:21,代码来源:Perfmon.cpp


示例16: Collide

void CPlasmaShot::Collide(const CGameObject *obj)
{ 
   // Object is the terrain 
   if(!obj)
   {
      // create terrain deformation
      CVector2f Center;
      Center.x = m_RenderObj.GetSphere()->Center.x;
      Center.y = m_RenderObj.GetSphere()->Center.z;
      g_pCurrLevel->DeformCircle(&Center, m_DamageRadius * 0.5f, m_Damage * -.05f);

      Color3F Color = { .6274f, .4274f, .1412f};
      g_pCurrLevel->ColorCircle(&Center, m_DamageRadius * 0.5f, &Color);

      CParticleSystem *dirt = g_ParticleManager.ObtainSystem();

      if(dirt)
         g_ParticleManager.CreateSystem(dirt, *(GetFrame(0)->GetPosition()), NULL, g_ParticleManager.DIRT, LOD_BOTH, 20.0f, 200.0f);
      
      // Kill the shot
      Die();
   }
   
   // Object is a game object
   else
   {
      if(m_ShotOwner == ENEMY_SHOT && obj->m_RadarType != RADAR_ENEMY && obj->m_RadarType != RADAR_PROJECTILE)
          Die();
      if(m_ShotOwner == PLAYER_SHOT && obj->GetType() != OBJ_PLAYER && obj->m_RadarType != RADAR_PROJECTILE)
      {
         Die();
         if(obj->m_RadarType == RADAR_ENEMY)
            g_Player.m_HitsWithPlasma++;
      }
      if(m_ShotOwner == FRIENDLY_SHOT && obj->GetType() != OBJ_FTURRET && obj->m_RadarType != RADAR_PROJECTILE)
      {
         Die();
      }
   } 
}
开发者ID:eclifford,项目名称:prototype-game,代码行数:40,代码来源:plasmashot.cpp


示例17: GetShipType

// Input: direction in ship's frame, doesn't need to be normalized
// Approximate positive angular velocity at match point
// Applies thrust directly
// old: returns whether it can reach that direction in this frame
// returns angle to target
double Ship::AIFaceDirection(const vector3d &dir, double av)
{
	double timeStep = Pi::GetTimeStep();

	double maxAccel = GetShipType().angThrust / GetAngularInertia();		// should probably be in stats anyway
	if (maxAccel <= 0.0)
		// happens if no angular thrust is set for the model eg MISSILE_UNGUIDED
		return 0.0;
	double frameAccel = maxAccel * timeStep;

	matrix4x4d rot; GetRotMatrix(rot);

	vector3d head = (dir * rot).Normalized();		// create desired object-space heading
	vector3d dav(0.0, 0.0, 0.0);	// desired angular velocity

	double ang = 0.0;
	if (head.z > -0.99999999)			
	{
		ang = acos (Clamp(-head.z, -1.0, 1.0));		// scalar angle from head to curhead
		double iangvel = av + sqrt (2.0 * maxAccel * ang);	// ideal angvel at current time

		double frameEndAV = iangvel - frameAccel;
		if (frameEndAV <= 0.0) iangvel = ang / timeStep;	// last frame discrete correction
		else iangvel = (iangvel + frameEndAV) * 0.5;		// discrete overshoot correction

		// Normalize (head.x, head.y) to give desired angvel direction
		if (head.z > 0.9999) head.x = 1.0;
		double head2dnorm = 1.0 / sqrt(head.x*head.x + head.y*head.y);		// NAN fix shouldn't be necessary if inputs are normalized
		dav.x = head.y * head2dnorm * iangvel;
		dav.y = -head.x * head2dnorm * iangvel;
	}
	vector3d cav = (GetAngVelocity() - GetFrame()->GetAngVelocity()) * rot;		// current obj-rel angvel
//	vector3d cav = GetAngVelocity() * rot;				// current obj-rel angvel
	vector3d diff = (dav - cav) / frameAccel;					// find diff between current & desired angvel

	SetAngThrusterState(diff);
	return ang;
//if (diff.x*diff.x > 1.0 || diff.y*diff.y > 1.0 || diff.z*diff.z > 1.0) return false;
//	else return true;
}
开发者ID:GAlexx,项目名称:pioneer,代码行数:45,代码来源:Ship-AI.cpp


示例18: printf

bool BrowserWindow::QuitRequested( void )
{
	if ( s_nWndCount == 1 ) {
		printf("Window closed\n" );
#warning Does not work!
		be_app_messenger.SendMessage( B_QUIT_REQUESTED );
	}
#if 0
	if ( m_pcSearchDialog != NULL ) {
		if ( m_pcSearchDialog->SafeLock() >= 0 ) {
			m_pcSearchDialog->PostMessage( M_QUIT );
			m_pcSearchDialog->Unlock();
			m_pcSearchDialog = NULL;
		}
	}
	if ( s_nWndCount == 1 ) {
		if ( m_bSaveSize ) {
			char*	pzHome = getenv( "HOME" );
	
			if ( NULL != pzHome ) {
				FILE*	hFile;
				char	zPath[ 256 ];
					
				strcpy( zPath, pzHome );
				strcat( zPath, "/config/abrowse.cfg" );
		
				hFile = fopen( zPath, "wb" );
		
				if ( hFile != NULL ) {
					Rect cFrame = GetFrame();
					fwrite( &cFrame, sizeof( cFrame ), 1, hFile );
					fclose( hFile );
				}
			}
		}
		Application::GetInstance()->PostMessage( M_QUIT );
	}
#endif
	return( true );
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:40,代码来源:main.cpp


示例19: NS_ENSURE_ARG

/* boolean handleKeyPress (in nsIDOMKeyEvent keyEvent); */
NS_IMETHODIMP nsMenuBoxObject::HandleKeyPress(nsIDOMKeyEvent* aKeyEvent, PRBool* aHandledFlag)
{
  *aHandledFlag = PR_FALSE;
  NS_ENSURE_ARG(aKeyEvent);

  // if event has already been handled, bail
  nsCOMPtr<nsIDOMNSUIEvent> uiEvent(do_QueryInterface(aKeyEvent));
  if (!uiEvent)
    return NS_OK;

  PRBool eventHandled = PR_FALSE;
  uiEvent->GetPreventDefault(&eventHandled);
  if (eventHandled)
    return NS_OK;

  if (nsMenuBarListener::IsAccessKeyPressed(aKeyEvent))
    return NS_OK;

  nsIFrame* frame = GetFrame();
  if (!frame)
    return NS_OK;

  nsIMenuFrame* menuFrame;
  CallQueryInterface(frame, &menuFrame);
  if (!menuFrame)
    return NS_OK;

  PRUint32 keyCode;
  aKeyEvent->GetKeyCode(&keyCode);
  switch (keyCode) {
    case NS_VK_UP:
    case NS_VK_DOWN:
    case NS_VK_HOME:
    case NS_VK_END:
      return menuFrame->KeyboardNavigation(keyCode, *aHandledFlag);
    default:
      return menuFrame->ShortcutNavigation(aKeyEvent, *aHandledFlag);
  }
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:40,代码来源:nsMenuBoxObject.cpp


示例20: OutFile

//called to save the current state out to a file
bool CSpriteFile::Save(const char* pszFilename) const
{
	//open up the file
#if _MSC_VER >= 1300
	std::ofstream OutFile(pszFilename, std::ios::out | std::ios::binary);
#else
	ofstream OutFile(pszFilename, ios::out | ios::binary);
#endif

	//check the open
	if(!OutFile)
		return false;

	//write out the header
	uint32 nTempVal;

	OutFile.write((char*)&m_nNumFrames, sizeof(m_nNumFrames));
	OutFile.write((char*)&m_nFrameRate, sizeof(m_nFrameRate));
	
	nTempVal = m_bTransparent ? 1 : 0;
	OutFile.write((char*)&nTempVal, sizeof(nTempVal));
	nTempVal = m_bTranslucent ? 1 : 0;
	OutFile.write((char*)&nTempVal, sizeof(nTempVal));

	OutFile.write((char*)&m_nKey, sizeof(m_nKey));

	//now write out all the strings
	for(uint32 nCurrFrame = 0; nCurrFrame < GetNumFrames(); nCurrFrame++)
	{
		const char* pszFrame = GetFrame(nCurrFrame);

		uint16 nStrLen = pszFrame ? strlen(pszFrame) : 0;
		OutFile.write((char*)&nStrLen, sizeof(nStrLen));
		OutFile.write(pszFrame, nStrLen);
	}

	//success
	return true;
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:40,代码来源:SpriteFile.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetFspGlobalDataPointer函数代码示例发布时间:2022-05-30
下一篇:
C++ GetForwarder函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap