Exemplo n.º 1
0
 void Prepare(ContainerWindow &parent, const PixelRect &rc) override {
   WindowStyle style;
   style.Hide();
   terminal.Create(parent, rc, style);
   SetWindow(&terminal);
   device.SetMonitor(&bridge);
 }
Exemplo n.º 2
0
void
InfoBoxManager::Create(PixelRect rc, const InfoBoxLayout::Layout &_layout,
                       const InfoBoxLook &look, const UnitsLook &units_look)
{
  const InfoBoxSettings &settings =
    CommonInterface::GetUISettings().info_boxes;

  first = true;
  layout = _layout;

  WindowStyle style;
  style.Hide();

  // create infobox windows
  for (unsigned i = layout.count; i-- > 0;) {
    const PixelRect &rc = layout.positions[i];
    int Border = GetInfoBoxBorder(i);

    InfoBoxes[i] = new InfoBoxWindow(XCSoarInterface::main_window,
                                     rc.left, rc.top,
                                     rc.right - rc.left, rc.bottom - rc.top,
                                     Border, settings, look, units_look,
                                     style);
  }

  InfoBoxesHidden = true;
}
Exemplo n.º 3
0
 virtual void Prepare(ContainerWindow &parent,
                      const PixelRect &rc) override {
   WindowStyle style;
   style.Hide();
   window.Create(parent, rc, style);
   SetWindow(&window);
 }
Exemplo n.º 4
0
void
InfoBoxManager::Create(ContainerWindow &parent,
                       const InfoBoxLayout::Layout &_layout,
                       const InfoBoxLook &look, const UnitsLook &units_look)
{
  const InfoBoxSettings &settings =
    CommonInterface::GetUISettings().info_boxes;

  first = true;
  layout = _layout;

  WindowStyle style;
  style.Hide();

  // create infobox windows
  for (unsigned i = layout.count; i-- > 0;) {
    const PixelRect &rc = layout.positions[i];
    int Border =
      settings.border_style == InfoBoxSettings::BorderStyle::TAB
      ? 0
      /* layout.geometry is the effective layout, while
         settings.geometry is the configured layout */
      : InfoBoxLayout::GetBorder(layout.geometry, layout.landscape, i);

    infoboxes[i] = new InfoBoxWindow(parent, rc,
                                     Border, settings, look, units_look,
                                     i, style);
  }

  infoboxes_hidden = true;
}
Exemplo n.º 5
0
void
KeyboardWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  PrepareSize(rc);

  TCHAR caption[] = _T(" ");

  for (const TCHAR *i = keyboard_letters; !StringIsEmpty(i); ++i) {
    caption[0] = *i;
    AddButton(parent, caption, *i);
  }

  AddButton(parent, _T("Space"), ' ');
  AddButton(parent, _T("."), '.');
  AddButton(parent, _T(","), ',');
  AddButton(parent, _T("-"), '-');

  if (show_shift_button) {
    WindowStyle style;
    style.Hide();
    shift_button.Create(parent, { 0, 0, 16, 16 }, style,
                        new SymbolButtonRenderer(look, _T("v")),
                        *this, SHIFT);
  }
  UpdateShiftState();
}
Exemplo n.º 6
0
void
AnalysisWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const Layout layout(rc);

  ButtonWindowStyle button_style;
  button_style.Hide();
  button_style.TabStop();

  info.Create(parent, layout.info);

  const auto &button_look = dialog.GetLook().button;
  details_button.Create(parent, button_look, _T("Calc"), layout.details_button,
                        button_style, *this, DETAILS);
  previous_button.Create(parent, button_look, _T("<"), layout.previous_button,
                         button_style, *this, PREVIOUS);
  next_button.Create(parent, button_look, _T(">"), layout.next_button,
                     button_style, *this, NEXT);
  close_button.Create(parent, button_look, _("Close"), layout.close_button,
                      button_style, dialog, mrOK);

  WindowStyle style;
  style.Hide();

  chart.Create(parent, layout.main, style);
}
Exemplo n.º 7
0
  void Prepare(ContainerWindow &parent, const PixelRect &rc) override {
    assert(!visible);

    WindowStyle style;
    style.Hide();
    style.TabStop();

    const ButtonLook &look = UIGlobals::GetDialogLook().button;

    const Layout layout = CalculateLayout(rc);
    edit_button.Create(parent, look, _("Edit Point"),
                       layout.edit, style,
                       *listener, EDIT);
    mutate_button.Create(parent, look, _("Make Finish"),
                         layout.down, style,
                         *listener, MUTATE);
    down_button.Create(parent, layout.down, style,
                       new SymbolButtonRenderer(look, _T("v")),
                       *listener, DOWN);
    up_button.Create(parent, layout.down, style,
                     new SymbolButtonRenderer(look, _T("^")),
                     *listener, UP);
    reverse_button.Create(parent, look, _("Reverse"),
                          layout.reverse, style,
                          *listener, REVERSE);
    clear_all_button.Create(parent, look, _("Clear All"),
                            layout.clear_all, style,
                            *listener, CLEAR_ALL);
  }
Exemplo n.º 8
0
ProgressWindow::ProgressWindow(ContainerWindow &parent)
  :background_color(COLOR_WHITE),
   background_brush(background_color),
   position(0)
{
  PixelRect rc = parent.GetClientRect();
  WindowStyle style;
  style.Hide();
  Create(parent, rc, style);

  const unsigned width = rc.right - rc.left, height = rc.bottom - rc.top;

  // Load progress bar background
  bitmap_progress_border.Load(IDB_PROGRESSBORDER);

  // Determine text height
#ifndef USE_GDI
  font.Load(FontDescription(Layout::FontScale(10)));
  text_height = font.GetHeight();
#else
  VirtualCanvas canvas({1, 1});
  text_height = canvas.GetFontHeight();
#endif

  // Make progress bar height proportional to window height
  const unsigned progress_height = height / 20;
  const unsigned progress_horizontal_border = progress_height / 2;
  progress_border_height = progress_height * 2;

  // Initialize message text field
  PixelRect message_rc = rc;
  message_rc.bottom -= progress_border_height + height / 48;
  message_rc.top = message_rc.bottom - text_height;
  TextWindowStyle message_style;
  message_style.center();
  message.Create(*this, NULL, message_rc, message_style);

#ifndef USE_GDI
  message.SetFont(font);
#endif

  // Initialize progress bar
  PixelRect pb_rc;
  pb_rc.left = progress_horizontal_border;
  pb_rc.right = pb_rc.left + width - progress_height;
  pb_rc.top = height - progress_border_height + progress_horizontal_border;
  pb_rc.bottom = pb_rc.top + progress_height;
  ProgressBarStyle pb_style;
  progress_bar.Create(*this, pb_rc, pb_style);

  message.InstallWndProc(); // needed for OnChildColor()

  // Set progress bar step size and range
  SetRange(0, 1000);
  SetStep(50);

  // Show dialog
  ShowOnTop();
}
Exemplo n.º 9
0
void
GaugeFLARM::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();

  SetWindow(new SmallTrafficWindow(parent, rc, look, style));
}
Exemplo n.º 10
0
void
ContainerWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();
  container.Create(parent, rc, style);
  SetWindow(&container);
}
Exemplo n.º 11
0
gcc_const
static WindowStyle
GetDialogStyle()
{
  WindowStyle style;
  style.Hide();
  style.ControlParent();
  return style;
}
Exemplo n.º 12
0
void
GaugeThermalAssistant::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();

  GaugeThermalAssistantWindow *window =
    new GaugeThermalAssistantWindow(parent, rc, look, style);
  SetWindow(window);
}
Exemplo n.º 13
0
void
XMLWidget::LoadWindow(const CallBackTableEntry *callbacks,
                      ContainerWindow &parent, const TCHAR *resource)
{
  WindowStyle style;
  style.Hide();

  Window *window = ::LoadWindow(callbacks, &form, parent, resource, style);
  assert(window != NULL);
  SetWindow(window);
}
Exemplo n.º 14
0
void
MacCreadySetupPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();
  style.TabStop();

  auto_mc.Create(parent, UIGlobals::GetDialogLook(), _("Auto"), rc, style,
                 *this, 1);
  SetWindow(&auto_mc);
}
Exemplo n.º 15
0
void
KoboMenuWidget::Prepare(ContainerWindow &parent,
                        const PixelRect &rc)
{
    WindowStyle style;
    style.Hide();
    style.ControlParent();

    w.Create(parent, rc, style);
    SetWindow(&w);
}
Exemplo n.º 16
0
void
GlueGaugeVario::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();

  GaugeVario *gauge =
    new GaugeVario(blackboard, parent, look, units_look, rc.left, rc.top,
                   rc.right - rc.left, rc.bottom - rc.top,
                   style);
  SetWindow(gauge);
}
Exemplo n.º 17
0
  virtual void Prepare(ContainerWindow &parent,
                       const PixelRect &rc) override {
    WindowStyle style;
    style.Hide();

    ButtonWindowStyle button_style(style);
    button_style.TabStop();

    quit.Create(parent, _("Quit"), rc,
                style, action_listener, mrCancel);
    logo.Create(parent, rc, style);
  }
Exemplo n.º 18
0
void
PanelWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.ControlParent();
  style.Hide();

  PanelControl *panel = new PanelControl(parent, UIGlobals::GetDialogLook(),
                                         rc,
                                         style);
  SetWindow(panel);
}
Exemplo n.º 19
0
void
RowFormWidget::Initialise(ContainerWindow &parent, const PixelRect &rc)
{
  assert(!IsDefined());
  assert(rows.empty());

  WindowStyle style;
  style.Hide();
  style.ControlParent();

  SetWindow(new PanelControl(parent, look, rc, style));
}
Exemplo n.º 20
0
void
PopupMessage::Create(const PixelRect _rc)
{
  rc = _rc;

  WindowStyle style;
#ifdef USE_WINUSER
  style.Border();
#endif
  style.Hide();

  PaintWindow::Create(parent, GetRect(), style);
}
Exemplo n.º 21
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);
}
Exemplo n.º 22
0
MenuBar::MenuBar(ContainerWindow &parent, const ButtonLook &look)
{
  const PixelRect rc = parent.GetClientRect();

  WindowStyle style;
  style.Hide();
  style.Border();

  for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
    PixelRect button_rc = GetButtonPosition(i, rc);
    buttons[i].Create(parent, look, _T(""), button_rc, style);
  }
}
Exemplo n.º 23
0
  /* virtual methods from Widget */
  virtual void Prepare(ContainerWindow &parent,
                       const PixelRect &rc) override {
    Layout layout(rc);

    WindowStyle style;
    style.Hide();
    style.TabStop();

    const auto &button_look = dialog.GetLook().button;
    demo_button.Create(parent, button_look, _("Demo"),
                       layout.demo, style, *this, DEMO);
    save_button.Create(parent, button_look, _("Save"),
                       layout.save, style, *this, SAVE);
  }
Exemplo n.º 24
0
  /* virtual methods from Widget */
  virtual void Prepare(ContainerWindow &parent,
                       const PixelRect &rc) override {
    Layout layout(rc);

    WindowStyle style;
    style.Hide();
    style.TabStop();

    expert.Create(parent, look, _("Expert"),
                  layout.expert, style, *this, EXPERT);

    button2.Create(parent, _T(""), layout.button2, style);
    button1.Create(parent, _T(""), layout.button1, style);
  }
Exemplo n.º 25
0
void
SolidWidget::Initialise(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.ControlParent();
  style.Hide();

  auto window = new SolidContainerWindow();
  window->Create(parent, rc, UIGlobals::GetDialogLook().background_color,
                 style);
  SetWindow(window);

  widget->Initialise(*window, ToOrigin(rc));
}
Exemplo n.º 26
0
void
TrafficWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  instance = this;

  WindowStyle style;
  style.Hide();
  style.EnableDoubleClicks();

  const Look &look = UIGlobals::GetLook();
  view = new FlarmTrafficControl2(look.flarm_dialog);
  view->set(parent, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
            style);
  SetWindow(view);
}
Exemplo n.º 27
0
void
TabWidget::Initialise(ContainerWindow &parent, const PixelRect &rc)
{
  WindowStyle style;
  style.Hide();

  tab_display = new TabDisplay(*this, UIGlobals::GetDialogLook(),
                               parent, rc, Layout::IsVertical(orientation, rc),
                               style);

  if (extra != nullptr)
    extra->Initialise(parent, rc);

  PagerWidget::Initialise(parent, rc);
}
Exemplo n.º 28
0
void
CrossSectionWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const Look &look = UIGlobals::GetLook();

  WindowStyle style;
  style.Hide();

  CrossSectionWindow *w =
    new CrossSectionWindow(look.cross_section, look.map.airspace, look.chart);
  w->SetAirspaces(&airspace_database);
  w->SetTerrain(terrain);
  w->Create(parent, rc, style);

  SetWindow(w);
}
Exemplo n.º 29
0
void
KeyboardWidget::AddButton(ContainerWindow &parent,
                          const TCHAR *caption, unsigned ch)
{
  assert(num_buttons < MAX_BUTTONS);

  WindowStyle style;
  style.Hide();

  PixelRect rc;
  rc.left = 0;
  rc.top = 0;
  rc.right = button_width;
  rc.bottom = button_height;

  CharacterButton &button = buttons[num_buttons++];
  button.Create(parent, look, caption, rc, on_character, ch, style);
}
Exemplo n.º 30
0
void
TaskClosePanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const Layout layout(rc, look);

  WindowStyle button_style;
  button_style.Hide();
  button_style.TabStop();

  WindowStyle style;
  style.Hide();

  close_button.Create(parent, look.button, _("Close"),
                      layout.close_button, button_style,
                      *this, CLOSE);

  message.Create(parent, layout.message, style);
  message.SetAlignCenter();
  message.SetVAlignCenter();

  revert_button.Create(parent, look.button, _("Revert Changes"),
                       layout.revert_button, button_style,
                       *this, REVERT);
}