Пример #1
0
/*virtual*/ void CWndListCalSimple::OnMessage(CWnd* pSender, ui16 code, ui32 data)
{	
	if ( pSender == NULL && code == WmBroadcast && data == ToWord('d', 'g') )
	{
		OnWave();
		return;
	}

	if ( pSender == &m_itmReset && code == ToWord('l', 'e') )
	{
		MainWnd.m_wndConfirm.Show( this, "Message", "Connect probe to ground\nReady?", RGB565(ffff00), "Yes", "No");
		return;
	}
	if ( pSender == &MainWnd.m_wndConfirm && code == ToWord('e', 'd') && data == (ui32)"Yes" )
	{
		m_proReset.m_pName = "Wait...";
		m_itmReset.Invalidate();

		m_nResetPhase = 0;
		MainWnd.m_wndConfirm.Hide();
		return;
	}
	if ( pSender == &MainWnd.m_wndConfirm && code == ToWord('e', 'd') && data == (ui32)"No" )
	{
		MainWnd.m_wndConfirm.Hide();
		return;
	}

	if ( pSender == &m_itmSave && code == ToWord('l', 'e') )
	{
		SaveCalib();
		StopModal();
		return;
	}

	if ( pSender == &m_itmNumber && code == ToWord('u', 'p') )
	{
		int nNewVal = m_nValue;
		UTILS.Clamp<int>(m_nValue, 256, 4096);
		if ( nNewVal != m_nValue )
			m_itmNumber.Invalidate();

		_UpdateCalib( m_nValue, V_LEVEL );
		UpdateZero();  // TODO: neni treba!
	}

	if ( ( pSender == &m_itmSource || pSender == &m_itmResolution ) && code == ToWord('u', 'p') )
	{
		LoadCalib();
		UpdateZero();
		return;
	}

	CListBox::OnMessage( pSender, code, data );
}
Пример #2
0
/*virtual*/ void CWndListCalDac::OnMessage(CWnd* pSender, ui16 code, ui32 data)
{
	if ( pSender == &m_itmANumber && code == ToWord('u', 'p') )	
	{
		if ( m_nValueA < 100 )
		{
			m_nValueA = 100;
			m_itmANumber.Invalidate();
		}
		if ( m_nValueA > 8000 )
		{
			m_nValueA = 8000;
			m_itmANumber.Invalidate();
		}
		BIOS::GEN::ConfigureDc( m_nValueA );
	}
	if ( pSender == &m_itmBNumber && code == ToWord('u', 'p') )	
	{
		if ( m_nValueB < 100 )
		{
			m_nValueB = 100;
			m_itmBNumber.Invalidate();
		}
		if ( m_nValueB > 8000 )
		{
			m_nValueB = 8000;
			m_itmBNumber.Invalidate();
		}
		BIOS::GEN::ConfigureDc( m_nValueB );
	}

	// Selector
	if ( pSender == &m_itmExecute && code == ToWord('l', 'e') )	// provider selector combo box
	{
		Save();
		StopModal();
		//MainWnd.m_wndConfirm.Show( this, "Message", "Do you really want to\nsave these settings?", RGB565(ffff00), "Yes", "No");
	}
	/*
	if ( pSender == &MainWnd.m_wndConfirm && code == ToWord('e', 'd') && data == (ui32)"Yes" )
	{
		MainWnd.m_wndConfirm.Hide();
		StopModal();
		Save();
		Settings.SaveCalibration();
		MainWnd.m_wndMessage.Show( this, "Message", "Values saved", RGB565(ffff00));
	}
	if ( pSender == &MainWnd.m_wndConfirm && code == ToWord('e', 'd') && data == (ui32)"No" )
	{
		MainWnd.m_wndConfirm.Hide();
		StopModal(); // hide this list
	}*/
}
Пример #3
0
void CWndManager::DoModal()
{
	m_bRunning = true;
	
	OnMessage( &m_itmTabs, ToWord('u', 'p'), 0 );
	StartModal( &m_itmValue );
	
	while ( IsRunning() )
	{
		Sleep(20);
	}
	StopModal();
}
Пример #4
0
// ShowModal that also disables emulator loop
// uses dialog_opened as a nesting counter
int MainFrame::ShowModal(wxDialog* dlg)
{
	dlg->SetWindowStyle(wxCAPTION | wxRESIZE_BORDER);

	if (gopts.keep_on_top)
		dlg->SetWindowStyle(dlg->GetWindowStyle() | wxSTAY_ON_TOP);
	else
		dlg->SetWindowStyle(dlg->GetWindowStyle() & ~wxSTAY_ON_TOP);

	CheckPointer(dlg);
	StartModal();
	int ret = dlg->ShowModal();
	StopModal();
	return ret;
}