Esempio n. 1
0
void
HorizonWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const Look &look = UIGlobals::GetLook();

  WindowStyle style;
  style.Hide();
  style.Disable();

  HorizonWindow *w = new HorizonWindow(look.horizon);
  w->Create(parent, rc, style);
  SetWindow(w);
}
Esempio n. 2
0
  virtual bool OnTimer(WindowTimer &_timer) override {
    if (_timer == timer) {
      AttitudeState attitude;
      attitude.bank_angle_computed = true;
      attitude.pitch_angle_computed = true;
      attitude.bank_angle = Angle::Zero();
      attitude.pitch_angle = Angle::Zero();

      horizon.SetAttitude(attitude);
      return true;
    }

    return SingleWindow::OnTimer(_timer);
  }
Esempio n. 3
0
  void Create(PixelSize size) {
    TopWindowStyle style;
    style.Resizable();

    SingleWindow::Create(_T("RunHorizonRenderer"), size, style);

    const PixelRect rc = GetClientRect();

    WindowStyle with_border;
    with_border.Border();

    horizon.Create(*this, rc, with_border);

    PixelRect button_rc = rc;
    button_rc.top = button_rc.bottom - 30;
    close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc);
  }
Esempio n. 4
0
 virtual void OnResize(PixelSize new_size) override {
   SingleWindow::OnResize(new_size);
   if (horizon.IsDefined())
     horizon.Resize(new_size);
 }