Boolean VolumePanelDialog::OnTouchEvent(
    /* [in] */ IMotionEvent* event)
{
    Int32 action;
    event->GetAction(&action);

    if (action == IMotionEvent::ACTION_OUTSIDE) {
        CVolumePanel* panel = (CVolumePanel*)mVolumePanel.Get();
        if (IsShowing()) {
            panel->ForceTimeout();
            return TRUE;
        }
    }
    return FALSE;
}
Exemple #2
0
// ************************************************************
// *** commands export ***
void RTLight::ExportCommands(int useIndex) {
  printf("\n");
  printf("RTLight * light%d = new RTLight();\n", useIndex);
  printf("light%d->SetPos(%f, %f, %f);\n", useIndex, vPos.x, vPos.y, vPos.z);
  
  if(IsShowing())
    printf("light%d->SetVisible(true);\n", useIndex);
  else
    printf("light%d->SetVisible(false);\n", useIndex);
 
  printf("light%d->SetAmbient(%f, %f, %f);\n", useIndex, ambient.x, ambient.y, ambient.z);
  printf("light%d->SetDiffuse(%f, %f, %f);\n", useIndex, diffuse.x, diffuse.y, diffuse.z);
  printf("light%d->SetSpecular(%f, %f, %f);\n", useIndex, specular.x, specular.y, specular.z);
  
  printf("AddLight(light%d);\n", useIndex);
  
}
Exemple #3
0
void
BFilePanel::Show()
{
	AutoLock<BWindow> lock(fWindow);
	if (!lock)
		return;

	// if the window is already showing, don't jerk the workspaces around,
	// just pull it to us
	uint32 workspace = 1UL << (uint32)current_workspace();
	uint32 windowWorkspaces = fWindow->Workspaces();
	if (!(windowWorkspaces & workspace))
		// window in a different workspace, reopen in current
		fWindow->SetWorkspaces(workspace);

	if (!IsShowing())
		fWindow->Show();

	fWindow->Activate();
}
void ThrobAnimation::StartThrobbing(int cycles_til_stop)
{
    cycles_til_stop = cycles_til_stop>=0 ? cycles_til_stop
        : std::numeric_limits<int>::max();
    cycles_remaining_ = cycles_til_stop;
    throbbing_ = true;
    SlideAnimation::SetSlideDuration(throb_duration_);
    if(is_animating())
    {
        return; // 已经在运行, 当前循环完成后会继续轮转.
    }

    if(IsShowing())
    {
        SlideAnimation::Hide();
    }
    else
    {
        SlideAnimation::Show();
    }
    cycles_remaining_ = cycles_til_stop;
}
void ThrobAnimation::Step(base::TimeTicks time_now)
{
    LinearAnimation::Step(time_now);

    if(!is_animating() && throbbing_)
    {
        // 抖动完成了一圈, 继续开始下一圈直到完成, 抖动停止.
        cycles_remaining_--;
        if(IsShowing())
        {
            // 要求停止时是隐藏的, 所以这里不检查cycles_remaining_.
            SlideAnimation::Hide();
        }
        else if(cycles_remaining_ > 0)
        {
            SlideAnimation::Show();
        }
        else
        {
            // 抖动完成.
            throbbing_ = false;
        }
    }
}