예제 #1
0
void MainFrame::OnRequestDatalogData(wxCommandEvent &event){
	event.StopPropagation();
	RequestDatalogRangeParams *params = (RequestDatalogRangeParams *)event.GetClientData();

	m_datalogPlayer.UpdateDataHistory(params->view, params->channels, params->fromIndex, params->toIndex);

	delete params;
}
예제 #2
0
// Warning: This may cause an endless loop if the event is propagated back to its parent
void CFrame::PostEvent(wxCommandEvent& event)
{
	if (g_pCodeWindow &&
		event.GetId() >= IDM_INTERPRETER &&
		event.GetId() <= IDM_ADDRBOX)
	{
		event.StopPropagation();
		g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
	}
	else
		event.Skip();
}
예제 #3
0
void dlgDatabase::OnConnLimitChange(wxCommandEvent &ev)
{
	if (ev.GetEventType() == wxEVT_COMMAND_TEXT_UPDATED)
	{
		wxString strConnLimit = txtConnLimit->GetValue();
		long val = 0;
		if (strConnLimit.ToLong(&val))
		{
			CheckChange();
		}
		else if (strConnLimit.Contains(wxT(".")))
		{
			double val;

			// Stop Propagation of the event to the parents
			ev.StopPropagation();
			if (strConnLimit.ToDouble(&val))
			{
				strConnLimit.Printf(wxT("%ld"), (long)val);
				txtConnLimit->SetValue(strConnLimit);
				txtConnLimit->SetInsertionPointEnd();
				return;
			}
		}
		else if (strConnLimit.length() > 9)
		{
			// Maximum value support is 2147483647
			wxString newVal = strConnLimit.substr(0, 10);
			if (!newVal.ToLong(&val))
			{
				newVal = strConnLimit.substr(0, 9);
			}
			ev.StopPropagation();
			txtConnLimit->SetValue(newVal);
			txtConnLimit->SetInsertionPointEnd();
			return;
		}
	}
}
예제 #4
0
void MainFrame::OnConfigChanged(wxCommandEvent &event){

	event.StopPropagation();
	wxObject *obj = event.GetEventObject();
	if (obj == NULL){
		wxLogMessage("null event object");
		return;
	}

	event.Skip(false);
	ConfigModified();
	NotifyConfigChanged();
}
void PCB_CALCULATOR_FRAME::OnTWCalculateFromIntWidth( wxCommandEvent& event )
{
    // Setting the calculated values generates further events. Stop them.
    if( m_TWNested )
    {
        event.StopPropagation();
        return;
    }

    m_TWNested = true;

    // Update state.
    if( m_TWMode != TW_MASTER_INT_WIDTH )
    {
        m_TWMode = TW_MASTER_INT_WIDTH;
        TWUpdateModeDisplay();
    }

    // Load parameters.
    double current;
    double extThickness  = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
    double intThickness  = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
    double deltaT_C      = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
    double extTrackWidth;
    double intTrackWidth = std::abs( DoubleFromString( m_IntTrackWidthValue->GetValue() ) );

    // Normalize units.
    extThickness  *= m_ExtTrackThicknessUnit->GetUnitScale();
    intThickness  *= m_IntTrackThicknessUnit->GetUnitScale();
    intTrackWidth *= m_TW_IntTrackWidth_choiceUnit->GetUnitScale();

    // Calculate the maximum current.
    current = TWCalculateCurrent( intTrackWidth, intThickness, deltaT_C, true );

    // And now calculate the corresponding external width.
    extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );

    // Update the display.
    TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );

    // Re-enable the events.
    m_TWNested = false;
}
void PCB_CALCULATOR_FRAME::OnTWCalculateFromCurrent( wxCommandEvent& event )
{
    // Setting the calculated values generates further events. Stop them.
    if( m_TWNested )
    {
        event.StopPropagation();
        return;
    }

    m_TWNested = true;

    // Update state.
    if( m_TWMode != TW_MASTER_CURRENT )
    {
        m_TWMode = TW_MASTER_CURRENT;
        TWUpdateModeDisplay();
    }

    // Prepare parameters:
    double current      = std::abs( DoubleFromString( m_TrackCurrentValue->GetValue() ) );
    double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
    double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
    double deltaT_C     = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
    double extTrackWidth;
    double intTrackWidth;

    // Normalize units.
    extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
    intThickness *= m_IntTrackThicknessUnit->GetUnitScale();

    // Calculate the widths.
    extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );
    intTrackWidth = TWCalculateWidth( current, intThickness, deltaT_C, true );

    // Update the display.
    TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );

    // Re-enable the events.
    m_TWNested = false;
}
예제 #7
0
/** @brief Event - Modifies the range of the gauge of the copy/cut dialog and update the message.
 *
 * @param event wxCommandEvent&
 * @return void
 *
 */
void FuXFenetre::onDirFileDialogUpdate(wxCommandEvent& event)
{
    m_mediator.getDirFileDialog().update(event.GetInt(), event.GetString());
    event.StopPropagation();
}
예제 #8
0
/** @brief Event - Modifies the max range of the gauge of the copy/cut dialog.
 *
 * @param event wxCommandEvent&
 * @return void
 *
 */
void FuXFenetre::onDirFileDialogRange(wxCommandEvent& event)
{
    m_mediator.getDirFileDialog().setRange(event.GetInt());
    event.StopPropagation();
}
예제 #9
0
/** @brief Event - Close the dialog of copy/cut/delete operation.
 *
 * @param event wxCommandEvent&
 * @return void
 *
 */
void FuXFenetre::onDirFileDialogClose(wxCommandEvent& event)
{
    m_mediator.getDirFileDialog().close();
    event.StopPropagation();
}