Ejemplo n.º 1
0
//
// !CQ Auto-hide all docking areas? Give them IDW_s
//
/// Handles checking and unchecking of menu items that are associated with
/// decorations.
//
void
TDecoratedFrame::EvCommandEnable(TCommandEnabler& commandEnabler)
{
  // Provide default command text to TooltipEnablers
  //
  if (dynamic_cast<TTooltipEnabler*>(&commandEnabler))
  {
    tstring hint = GetHintText(commandEnabler.GetId(), htTooltip);
    if (hint.length() > 0)
    {
      commandEnabler.SetText(hint);
      return;
    }
  }

#if 0
  TWindow*  decoration;
  if (DocAreaTop)
    decoration = DocAreaTop->ChildWithId(commandEnabler.GetId());
  else
    decoration = ChildWithId(commandEnabler.GetId());
#else
  TWindow*  decoration = ChildWithId(commandEnabler.GetId());
#endif

  if (!decoration)
    TFrameWindow::EvCommandEnable(commandEnabler);

  else {
    commandEnabler.Enable();
    commandEnabler.SetCheck(decoration->IsWindowVisible() ?
                            TCommandEnabler::Checked :
                            TCommandEnabler::Unchecked);
  }
}
void TSensorView::CeBright(TCommandEnabler& ce)
{
  double d = 1.0 / ((ce.Id - CM_BRIGHT0)*0.5 + 1.0) - m_dBright;
  ce.SetCheck(d*d < 0.0001);
}
void TSensorView::CeGrid(TCommandEnabler& ce)
{
  ce.Enable(m_nType != 4);
  ce.SetCheck(m_bGrid);
}
void TSensorView::CeDrawing(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDimSize[0] > 1 && m_nDimSize[1] == 2);
  ce.SetCheck(m_nType == 5);
}
void TSensorView::CeStereo(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 4);
}
void TSensorView::CeColor(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim && m_nDimSize[m_nDim-1] <= 3);
  ce.SetCheck(m_nType == 3);
}
void TSensorView::CeGrey(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 2);
}
void TSensorView::CeColumn(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 1);
}
void TSensorView::CeLine(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3 && m_nDimSize[0] > 1);
  ce.SetCheck(m_nType == 0);
}