Beispiel #1
0
  virtual void Prepare(ContainerWindow &parent,
                       const PixelRect &rc) override {
    assert(!visible);

    ButtonWindowStyle style;
    style.Hide();
    style.TabStop();

    const DialogLook &look = UIGlobals::GetDialogLook();

    const Layout layout = CalculateLayout(rc);
    edit_button = new WndButton(parent, look, _("Edit Point"),
                                layout.edit, style,
                                *listener, EDIT);
    mutate_button = new WndButton(parent, look, _("Make Finish"),
                                  layout.down, style,
                                  *listener, MUTATE);
    down_button = new WndSymbolButton(parent, look, _T("v"),
                                      layout.down, style,
                                      *listener, DOWN);
    up_button = new WndSymbolButton(parent, look, _T("^"),
                                    layout.down, style,
                                    *listener, UP);
    clear_all_button = new WndButton(parent, look, _("Clear All"),
                                     layout.clear_all, style,
                                     *listener, CLEAR_ALL);
  }
Beispiel #2
0
void
MacCreadySetupPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  ButtonWindowStyle style;
  style.Hide();
  style.TabStop();

  SetWindow(new WndButton(parent, UIGlobals::GetDialogLook(), GetCaption(), rc,
                          style, *this, 1));
}
  /* virtual methods from Widget */
  virtual void Prepare(ContainerWindow &parent,
                       const PixelRect &rc) override {
    Layout layout(rc);

    ButtonWindowStyle style;
    style.Hide();
    style.TabStop();

    demo_button.Create(parent, _("Demo"), layout.demo, style, *this, DEMO);
    save_button.Create(parent, _("Save"), layout.save, style, *this, SAVE);
  }
Beispiel #4
0
void
OffsetButtonsWidget::Prepare(ContainerWindow &parent,
                             const PixelRect &total_rc)
{
  PixelRect rc[ARRAY_SIZE(buttons)];
  LayoutOffsetButtons(total_rc, rc);

  ButtonWindowStyle style;
  style.TabStop();
  style.Hide();

  for (unsigned i = 0; i < ARRAY_SIZE(buttons); ++i) {
    TCHAR caption[16];
    _stprintf(caption, format, (double)offsets[i]);
    buttons[i] = new WndButton(parent, look, caption, rc[i], style,
                               *this, i);
  }
}
void
SimulatorPromptWindow::OnCreate()
{
  ContainerWindow::OnCreate();

  const PixelRect rc = GetClientRect();

  ButtonWindowStyle style;
  style.TabStop();

  fly_button.Create(*this, _T("Fly"), rc, style,
                    action_listener, FLY);
  sim_button.Create(*this, _T("Simulator"), rc, style,
                    action_listener, SIMULATOR);

  if (have_quit_button)
    quit_button.Create(*this, _("Quit"), rc, style,
                       action_listener, QUIT);
}
Beispiel #6
0
bool
JobDialog(SingleWindow &parent, const DialogLook &dialog_look,
          const TCHAR *caption,
          Job &job, bool cancellable)
{
  WindowStyle form_style;
  form_style.Hide();
  WndForm form(parent, dialog_look,
               parent.GetClientRect(),
               caption);

  ContainerWindow &client_area = form.GetClientAreaWindow();

  ProgressWindowOperation progress(client_area);
  DialogJobThread thread(progress, job, form);
  thread.Start();

  JobCancelButton cancel_button(thread);
  if (cancellable) {
    ButtonWindowStyle style;
    style.TabStop();

    PixelRect rc = client_area.GetClientRect();
    rc.right -= Layout::Scale(2);
    rc.left = rc.right - Layout::Scale(78);
    rc.top += Layout::Scale(2);
    rc.bottom = rc.top + Layout::Scale(35);
    cancel_button.set(client_area, _("Cancel"), rc,
                      style);
    cancel_button.SetFont(*dialog_look.button.font);
    cancel_button.BringToTop();
  }

  int result = form.ShowModal();

  thread.Cancel();
  thread.Join();

  return result == mrOK;
}