Example #1
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);
  }
}
Example #2
0
MenuBar::MenuBar(ContainerWindow &parent)
{
  const PixelRect rc = parent.get_client_rect();

  ButtonWindowStyle style;
  style.Hide();
  style.Border();
  style.multiline();

  for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
    PixelRect button_rc = GetButtonPosition(i, rc);
    buttons[i].set(parent, _T(""), button_rc, style);
  }
}
Example #3
0
bool
TabMenuDisplay::OnMouseMove(PixelScalar x, PixelScalar y, unsigned keys)
{
  if (down_index.IsNone())
    return false;

  const PixelRect &rc = GetButtonPosition(down_index);
  const bool tmp = !rc.IsInside({x, y});
  if (drag_off_button != tmp) {
    drag_off_button = tmp;
    Invalidate(rc);
  }
  return true;
}
Example #4
0
MenuBar::MenuBar(ContainerWindow &parent)
{
  const RECT rc = parent.get_client_rect();
  int x, y, xsize, ysize;

  ButtonWindowStyle style;
  style.hide();
  style.border();
  style.multiline();

  for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
    GetButtonPosition(i, rc, &x, &y, &xsize, &ysize);
    buttons[i].set(parent, _T(""), i, x, y, xsize, ysize,
                   style);
  }
}
Example #5
0
void
ButtonLabel::CreateButtonLabels(ContainerWindow &parent, const RECT rc)
{
  int x, y, xsize, ysize;

  if (InfoBoxLayout::gnav)
    ButtonLabelGeometry = 1;
  else
    ButtonLabelGeometry = 0;

  for (unsigned i = 0; i < NUMBUTTONLABELS; i++) {
    GetButtonPosition(i, rc, &x, &y, &xsize, &ysize);
    hWndButtonWindow[i].set(parent, x, y, xsize, ysize, false);

    ButtonVisible[i] = false;
  }
}
Example #6
0
void
MenuBar::OnResize(const PixelRect &rc)
{
  for (unsigned i = 0; i < MAX_BUTTONS; ++i)
    buttons[i].move(GetButtonPosition(i, rc));
}