本文整理汇总了C++中SetFrame函数的典型用法代码示例。如果您正苦于以下问题:C++ SetFrame函数的具体用法?C++ SetFrame怎么用?C++ SetFrame使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetFrame函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BWindow
CalcWindow::CalcWindow(BRect frame, BMessage* settings)
: BWindow(frame, kWindowTitle, B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
{
// create calculator view with calculator description and
// desktop background color
BScreen screen(this);
rgb_color baseColor = screen.DesktopColor();
SetSizeLimits(100.0, 400.0, 100.0, 400.0);
frame.OffsetTo(B_ORIGIN);
fCalcView = new CalcView(frame, baseColor, settings);
// create replicant dragger
BRect replicantFrame(frame);
replicantFrame.top = replicantFrame.bottom - 7.0f;
replicantFrame.left = replicantFrame.right - 7.0f;
BDragger* dragger = new BDragger(replicantFrame, fCalcView,
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
// attach views
AddChild(fCalcView);
fCalcView->AddChild(dragger);
BRect rect;
if (settings->FindRect("window frame", &rect) == B_OK)
SetFrame(rect);
else
SetFrame(frame, true);
}
示例2: printf
void Body::UpdateFrame()
{
if (!(GetFlags() & Body::FLAG_CAN_MOVE_FRAME)) return;
// falling out of frames
if (!GetFrame()->IsLocalPosInFrame(GetPosition())) {
printf("%s leaves frame %s\n", GetLabel().c_str(), GetFrame()->GetLabel().c_str());
Frame *new_frame = GetFrame()->m_parent;
if (new_frame) { // don't let fall out of root frame
matrix4x4d m = matrix4x4d::Identity();
GetFrame()->ApplyLeavingTransform(m);
vector3d new_pos = m * GetPosition();
matrix4x4d rot;
GetRotMatrix(rot);
SetRotMatrix(m * rot);
m.ClearToRotOnly();
SetVelocity(GetFrame()->GetVelocity() + m*(GetVelocity() -
GetFrame()->GetStasisVelocityAtPosition(GetPosition())));
SetFrame(new_frame);
SetPosition(new_pos);
Pi::luaOnFrameChanged->Queue(this);
return;
}
}
// entering into frames
for (std::list<Frame*>::iterator j = GetFrame()->m_children.begin(); j != GetFrame()->m_children.end(); ++j) {
Frame *kid = *j;
matrix4x4d m;
Frame::GetFrameTransform(GetFrame(), kid, m);
vector3d pos = m * GetPosition();
if (!kid->IsLocalPosInFrame(pos)) continue;
printf("%s enters frame %s\n", GetLabel().c_str(), kid->GetLabel().c_str());
SetPosition(pos);
SetFrame(kid);
matrix4x4d rot;
GetRotMatrix(rot);
SetRotMatrix(m * rot);
// get rid of transforms
m.ClearToRotOnly();
SetVelocity(m*(GetVelocity() - kid->GetVelocity())
+ kid->GetStasisVelocityAtPosition(pos));
Pi::luaOnFrameChanged->Queue(this);
break;
}
}
示例3: PROFILE_SCOPED
void ShipCockpit::RenderCockpit(Graphics::Renderer* renderer, const Camera* camera, Frame* frame)
{
PROFILE_SCOPED()
renderer->ClearDepthBuffer();
SetFrame(frame);
Render(renderer, camera, m_translate, m_transform);
SetFrame(nullptr);
}
示例4: SetFrame
void hgeAnimation::Play()
{
bPlaying=true;
fSinceLastFrame=-1.0f;
if(Mode & HGEANIM_REV) {
nDelta = -1;
SetFrame(nFrames-1);
} else {
nDelta = 1;
SetFrame(0);
}
}
示例5: SetFrame
void hgeAnimation::SetMode(const int mode) {
mode_ = mode;
if (mode & HGEANIM_REV) {
delta_ = -1;
SetFrame(frames_ - 1);
}
else {
delta_ = 1;
SetFrame(0);
}
}
示例6: SetFrame
void hgeAnimation::SetMode(anim_mode_t mode)
{
m_play_mode = mode;
if (mode & HGEANIM_REV)
{
m_delta = -1;
SetFrame(m_frame_count - 1);
}
else
{
m_delta = 1;
SetFrame(0);
}
}
示例7: SetFrameStart
void Vessel::SetFrameGroup(StartAndEndFrameInfo* pFameInfo, float FrameSpeed)
{
SetFrameStart( pFameInfo->StartFrame );
SetEndFrame( pFameInfo->EndFrame );
SetFrame( GetFrameStart() );
SetFrameSpeed( FrameSpeed );
}
示例8: EMIT_SOUND
void CWallHealth::Recharge(void)
{
EMIT_SOUND( this, CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM );
m_iJuice = gSkillData.GetHealthChargerCapacity();
SetFrame( 0 );
SetThink( &CWallHealth::SUB_DoNothing );
}
示例9: s
// Clean up windows used for displaying the view.
bool DrawingView::OnClose(bool deleteWindow)
{
if (!GetDocument()->Close())
return false;
// Clear the canvas in case we're in single-window mode,
// and the canvas stays.
canvas->ClearBackground();
canvas->view = (wxView *) NULL;
canvas = (MyCanvas *) NULL;
wxString s(wxTheApp->GetAppName());
if (frame)
frame->SetTitle(s);
SetFrame((wxFrame*)NULL);
Activate(false);
if (deleteWindow)
{
delete frame;
return true;
}
return true;
}
示例10: SetColor
void CE_CBeam::BeamInit( const char *pSpriteName, float width )
{
SetColor( 255, 255, 255 );
SetBrightness( 255 );
SetNoise( 0 );
SetFrame( 0 );
SetScrollRate( 0 );
SetModelName( MAKE_STRING( pSpriteName ) );
SetRenderMode( kRenderTransTexture );
SetTexture( engine->PrecacheModel( pSpriteName ) );
SetWidth( width );
SetEndWidth( width );
SetFadeLength( 0 ); // No fade
for (int i=0;i<MAX_BEAM_ENTS;i++)
{
Set_m_hAttachEntity(i,NULL);
Set_m_nAttachIndex(i, 0);
}
m_nHaloIndex = 0;
m_fHaloScale = BEAM_DEFAULT_HALO_SCALE;
m_nBeamType = 0;
m_nBeamFlags = 0;
}
示例11: SetFrame
//////////////////////////////////////////////////////////////////////////////////
//Calculates tensor in reaction CM frame
//This is the same as KVTensP after using SetFrame("CM")
//_________________________________________________________________
KVTensPCM::KVTensPCM(void)
{
//
// Createur par default
//
SetFrame("CM");
}
示例12: WXUNUSED
// What to do when a view is created. Creates actual
// windows for displaying the view.
bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
{
MyApp& app = wxGetApp();
if ( app.GetMode() != MyApp::Mode_Single )
{
// create a new window and canvas inside it
m_frame = app.CreateChildFrame(doc, this, true);
m_frame->SetTitle("Drawing View");
m_canvas = new MyCanvas(this, m_frame);
m_frame->Show(true);
}
else // single document mode
{
// reuse the existing window and canvas
m_frame = wxStaticCast(app.GetTopWindow(), wxFrame);
m_canvas = app.GetMainWindowCanvas();
m_canvas->SetView(this);
// Associate the appropriate frame with this view.
SetFrame(m_frame);
// Make sure the document manager knows that this is the
// current view.
Activate(true);
// Initialize the edit menu Undo and Redo items
doc->GetCommandProcessor()->SetEditMenu(app.GetMainWindowEditMenu());
doc->GetCommandProcessor()->Initialize();
}
return true;
}
示例13: Activate
// Clean up windows used for displaying the view.
bool DrawingView::OnClose(bool deleteWindow)
{
if ( !wxView::OnClose(deleteWindow) )
return false;
Activate(false);
// Clear the canvas in single-window mode in which it stays alive
if ( wxGetApp().GetMode() == MyApp::Mode_Single )
{
m_canvas->ClearBackground();
m_canvas->ResetView();
m_canvas = NULL;
if (GetFrame())
wxStaticCast(GetFrame(), wxFrame)->SetTitle(wxTheApp->GetAppDisplayName());
}
else // not single window mode
{
if ( deleteWindow )
{
GetFrame()->Destroy();
SetFrame(NULL);
}
}
return true;
}
示例14: SetFrame
void
SpriteEditWindow::AddFrame (sint32 add)
{
m_frame +=add;
SetFrame(m_frame);
}
示例15: Stop
// Fonction à appeler à chaque tours de boucle, prend le temps
// écoulé depuis le dernier appel à la fonction en paramètre
void Animated::anim(float ElapsedTime)
{
// Si il n'est pas en pause et que l'animation est valide
if (!Paused && myAnim != NULL)
{
// on retranche le temps écoulé a notre compteur
myElapsedTime -= ElapsedTime;
// Si Le temps entre chaque frame est atteint
if (myElapsedTime <= 0.f)
{
// On réinitialise notre compteur
myElapsedTime = myTime;
// On passe a la frame suivante
if (static_cast<unsigned>(myCurrentFrame + 1) < myAnim->Size())
myCurrentFrame++;
else
{
// Ou on a la premiere
if (myLoop)
myCurrentFrame = 0;
else
{
// Si le mode Loop est désactivé, on stop l'animation
Stop();
}
}
// On change la frame
SetFrame(myCurrentFrame);
}
}
}