Ejemplo n.º 1
0
//
/// When the gadget window receives a WM_COMMAND_ENABLE message, it is likely from a
/// gadget or control within a TControlGadget. This reroutes it to the command
/// target.
//
void
TGadgetWindow::EvCommandEnable(TCommandEnabler& ce)
{
  // If someone derived from TGadgetWindow and handles the command there,
  // give these handlers the first crack.
  //
  TEventInfo eventInfo(WM_COMMAND_ENABLE, ce.GetId());
  if (Find(eventInfo)) {
    Dispatch(eventInfo, 0, TParam2(&ce));
    return;
  }

  TWindow* target = GetParentO();

  // Forward to command target if the enabler was really destined for us, and
  // not a routing from the frame.
  //
  if (target && ce.IsReceiver(*this)) {
    CHECK(target->IsWindow());
    ce.SetReceiver(*target);
    target->EvCommandEnable(ce);
    if( ce.GetHandled() )
      return;
  }

  // Default to TWindow's implementation if the above routing fails
  //
  TWindow::EvCommandEnable(ce);
}
Ejemplo n.º 2
0
/////////////////////////////////////////////////////////////////////////////
// TDrawView::CmEnableECGScale()
//
// command enabler for ECGSCALE button.
/////////////////////////////////////////////////////////////////////////////
void TDrawView::CmEnableECGScale(TCommandEnabler &commandEnabler)
{
	// Enable the scakle command if an ECG exists.
	if (DrawDoc->IsOpen())
		commandEnabler.Enable(TRUE);	// if pointer to ecgdata=NULL then disable
	else
		commandEnabler.Enable(FALSE);
}
Ejemplo n.º 3
0
/////////////////////////////////////////////////////////////////////////////
// TDrawView::CmEnableECGRThresh()
//
// command enabler for RTHRESH button.
/////////////////////////////////////////////////////////////////////////////
void TDrawView::CmEnableECGRThresh(TCommandEnabler &commandEnabler)
{
	// Enable the scakle command if an ECG exists.
	if (DrawDoc->IsOpen())
	{
		if ((DrawDoc->GetECG())->get_r_thresh()!=-1)
			commandEnabler.Enable(TRUE);
		else
			commandEnabler.Enable(FALSE);
	}
	else
		commandEnabler.Enable(FALSE);
}
Ejemplo n.º 4
0
/////////////////////////////////////////////////////////////////////////////
// TDrawView::CmEnableECGQCalc()
//
// command enabler for QCALC button.
/////////////////////////////////////////////////////////////////////////////
void TDrawView::CmEnableECGQCalc(TCommandEnabler &commandEnabler)
{
	// enable if ecg exists, && it has already been analysed (so we have rwaves)
	if (DrawDoc->IsOpen())
	{
		if ((DrawDoc->GetECG())->IsAnalysed())
			commandEnabler.Enable(TRUE);
		else
			commandEnabler.Enable(FALSE);
	}
	else
		commandEnabler.Enable(FALSE);
}
Ejemplo n.º 5
0
void TFuncSpecView::CeEditSelected(TCommandEnabler &tce)
{
  // INSERT>> Your code here.
  tce.Enable( (wFuncs->List()->GetNextItem(-1, TListWindow::Selected) >=0) &&
              (wTabs->GetSel()==wFuncs) );

}
Ejemplo n.º 6
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);
  }
}
Ejemplo n.º 7
0
//
/// Reads information in the TProfile to display the menu choices.
//
void
TRecentFiles::CeExit(TCommandEnabler& ce)
{
  ce.Enable(true);

  TMenuItemEnabler* me = TYPESAFE_DOWNCAST(&ce, TMenuItemEnabler);
  if (me == 0)
    return;

  HMENU hMenu = me->GetMenu();
  RemoveMruItemsFromMenu(hMenu);
  InsertMruItemsToMenu(hMenu);
}
Ejemplo n.º 8
0
void TSetupDialog::CeStepNumber(TCommandEnabler& ce)
{
  ce.Enable(step->GetCheck() == BF_CHECKED ? true : false);
}
Ejemplo n.º 9
0
void TSetupDialog::CeGenerations(TCommandEnabler& ce)
{
  ce.Enable(evoToLimit->GetCheck() == BF_CHECKED ? true : false);
}
Ejemplo n.º 10
0
void TSetupDialog::CeDelayTime(TCommandEnabler& ce)
{
  ce.Enable(userDefDel->GetCheck() == BF_CHECKED ? true : false);
}
Ejemplo n.º 11
0
void TSensorView::CeGrey(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 2);
}
Ejemplo n.º 12
0
void TFuncSpecView::CeAddfunc(TCommandEnabler &tce)
{
  // INSERT>> Your code here.
  tce.Enable((wTabs->GetSel()==wFuncs));
}
Ejemplo n.º 13
0
void TSensorView::CeLine(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3 && m_nDimSize[0] > 1);
  ce.SetCheck(m_nType == 0);
}
Ejemplo n.º 14
0
//
/// If there are MDI child windows, CmChildActionEnalbe enables any one of the child
/// window action menu items.
//
void
TMDIClient::CmChildActionEnable(TCommandEnabler& commandEnabler)
{
  commandEnabler.Enable(GetFirstChild() != 0);
}
Ejemplo n.º 15
0
//
/// Command enabler for CmFileSave.
//
void
TDocManager::CeFileSave(TCommandEnabler& ce)
{
  TDocument* doc = GetCurrentDoc();
  ce.Enable(doc && (doc->IsDirty() || (Mode & dmSaveEnable)));
}
Ejemplo n.º 16
0
void TSensorView::CeGrid(TCommandEnabler& ce)
{
  ce.Enable(m_nType != 4);
  ce.SetCheck(m_bGrid);
}
Ejemplo n.º 17
0
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);
}
Ejemplo n.º 18
0
void TSensorView::CeDrawing(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDimSize[0] > 1 && m_nDimSize[1] == 2);
  ce.SetCheck(m_nType == 5);
}
Ejemplo n.º 19
0
void TSensorView::CeStereo(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 4);
}
Ejemplo n.º 20
0
void TSensorView::CeColor(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim && m_nDimSize[m_nDim-1] <= 3);
  ce.SetCheck(m_nType == 3);
}
Ejemplo n.º 21
0
//
/// Enables the find or replace option (only if no dialog is up).
//
void
TEditSearch::CeEditFindReplace(TCommandEnabler& ce)
{
  ce.Enable(!SearchCmd);
}
Ejemplo n.º 22
0
//
/// Command enabler for CmFileSaveAs.
//
void
TDocManager::CeFileSaveAs(TCommandEnabler& ce)
{
  TDocument* doc = GetCurrentDoc();
  ce.Enable(doc != 0);
}
Ejemplo n.º 23
0
//
/// Enables FindNext (only if there's data to search for).
//
void
TEditSearch::CeEditFindNext(TCommandEnabler& ce)
{
  ce.Enable(SearchData.FindWhat && *SearchData.FindWhat);
}
Ejemplo n.º 24
0
//
/// Command enabler for CmViewCreate.
//
void
TDocManager::CeViewCreate(TCommandEnabler& hndlr)
{
  TDocument* doc = GetCurrentDoc();
  hndlr.Enable(doc != 0);
}
Ejemplo n.º 25
0
void TFuncSpecView::CeEditclear(TCommandEnabler &tce)
{
  // INSERT>> Your code here.
  tce.Enable( (wFuncs->List()->GetItemCount() > 0) &&
              (wTabs->GetSel()==wFuncs) );
}
Ejemplo n.º 26
0
void
THelpFileManager::CeContextHelp (TCommandEnabler& ce)
{
  ce.Enable(true);
}
Ejemplo n.º 27
0
void TFuncSpecView::CeEditundo(TCommandEnabler &tce)
{
  // INSERT>> Your code here.
  tce.Enable(false && (wTabs->GetSel()==wFuncs) );
}
Ejemplo n.º 28
0
//
/// Enables save command (only if text is modified).
//
void
TEditFile::CmSaveEnable(TCommandEnabler& commandHandler)
{
  commandHandler.Enable(IsModified());
}
Ejemplo n.º 29
0
//
/// Command enabler for CmFileRevert.
//
void
TDocManager::CeFileRevert(TCommandEnabler& ce)
{
  TDocument* doc = GetCurrentDoc();
  ce.Enable(doc && doc->IsDirty() && doc->GetDocPath());
}
Ejemplo n.º 30
0
void TSensorView::CeColumn(TCommandEnabler& ce)
{
  ce.Enable(m_pSim && m_nDim < 3);
  ce.SetCheck(m_nType == 1);
}