Commit 753d8340 authored by Brian Sidebotham's avatar Brian Sidebotham
Browse files

Enhance EESCHEMA Options Dialog

  * Include new field template editor
    - Removes 10 template limitation
    - Adds ability to set default value
    - Adds ability to set default visibility
  * Documentation to follow
  * Tested in Linux (Ubuntu 14.04) + Windows, Windows has issue with displaying highlight for selected template, fix to follow
parents 203247ae b554a221
Loading
Loading
Loading
Loading
+199 −64
Original line number Original line Diff line number Diff line
@@ -31,12 +31,57 @@


#include <dialog_eeschema_options.h>
#include <dialog_eeschema_options.h>


#include "wx/settings.h"


DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) :
DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) :
    DIALOG_EESCHEMA_OPTIONS_BASE( parent )
    DIALOG_EESCHEMA_OPTIONS_BASE( parent )
{
{
    m_choiceUnits->SetFocus();
    m_choiceUnits->SetFocus();
    m_sdbSizer1OK->SetDefault();
    m_sdbSizer1OK->SetDefault();

    // Dialog should not shrink beyond it's minimal size.
    GetSizer()->SetSizeHints( this );

    wxListItem col0;
    col0.SetId( 0 );
    col0.SetText( _( "Field Name" ) );

    wxListItem col1;
    col1.SetId( 1 );
    col1.SetText( _( "Default Value" ) );

    wxListItem col2;
    col2.SetId( 2 );
    col2.SetText( _( "Visible" ) );

    templateFieldListCtrl->InsertColumn( 0, col0 );
    templateFieldListCtrl->InsertColumn( 1, col1 );
    templateFieldListCtrl->InsertColumn( 2, col2 );

    templateFieldListCtrl->SetColumnWidth( 0, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
    templateFieldListCtrl->SetColumnWidth( 1, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );
    templateFieldListCtrl->SetColumnWidth( 2, templateFieldListCtrl->GetSize().GetWidth() / 3.5 );

    // Invalid field selected and don't ignore selection events because
    // they'll be from the user
    selectedField = 0;
    selectionValid = false;
    ignoreSelection = false;

    // Make sure we select the first tab of the options tab page
    m_notebook1->SetSelection( 0 );

    // Connect the edit controls for the template field names to the kill focus event which
    // doesn't propogate, hence the need to connect it here.

    fieldNameTextCtrl->Connect( wxEVT_KILL_FOCUS,
            wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this );

    fieldDefaultValueTextCtrl->Connect( wxEVT_KILL_FOCUS,
            wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this );

    fieldVisibleCheckbox->Connect( wxEVT_KILL_FOCUS,
            wxFocusEventHandler( DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus ), NULL, this );
}
}




@@ -49,6 +94,7 @@ void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select )
    m_choiceUnits->SetSelection( select );
    m_choiceUnits->SetSelection( select );
}
}



void DIALOG_EESCHEMA_OPTIONS::SetRefIdSeparator( wxChar aSep, wxChar aFirstId)
void DIALOG_EESCHEMA_OPTIONS::SetRefIdSeparator( wxChar aSep, wxChar aFirstId)
{
{
    // m_choiceSeparatorRefId displays one of
    // m_choiceSeparatorRefId displays one of
@@ -101,107 +147,196 @@ void DIALOG_EESCHEMA_OPTIONS::GetRefIdSeparator( int& aSep, int& aFirstId)
}
}




void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& grid_sizes, int grid_id )
void DIALOG_EESCHEMA_OPTIONS::SetGridSizes( const GRIDS& aGridSizes, int aGridId )
{
{
    wxASSERT( grid_sizes.size() > 0 );
    wxASSERT( aGridSizes.size() > 0 );


    int select = wxNOT_FOUND;
    int select = wxNOT_FOUND;


    for( size_t i = 0; i < grid_sizes.size(); i++ )
    for( size_t i = 0; i < aGridSizes.size(); i++ )
    {
    {
        wxString tmp;
        wxString tmp;
        tmp.Printf( wxT( "%0.1f" ), grid_sizes[i].m_Size.x );
        tmp.Printf( wxT( "%0.1f" ), aGridSizes[i].m_Size.x );
        m_choiceGridSize->Append( tmp );
        m_choiceGridSize->Append( tmp );


        if( grid_sizes[i].m_Id == grid_id )
        if( aGridSizes[i].m_Id == aGridId )
            select = (int) i;
            select = (int) i;
    }
    }


    m_choiceGridSize->SetSelection( select );
    m_choiceGridSize->SetSelection( select );
}
}


void DIALOG_EESCHEMA_OPTIONS::SetFieldName( int aNdx, wxString aName )

void DIALOG_EESCHEMA_OPTIONS::RefreshTemplateFieldView( void )
{
{
    switch( aNdx )
    // Delete all items in the template field list control and add all of the
    // current template fields
    templateFieldListCtrl->DeleteAllItems();

    // Loop through the template fieldnames and add then to the list control
    for( TEMPLATE_FIELDNAMES::iterator fld = templateFields.begin();
            fld != templateFields.end(); ++fld )
    {
    {
    case 0:
        long itemindex = templateFieldListCtrl->InsertItem(
        m_fieldName1->SetValue( aName );
                templateFieldListCtrl->GetItemCount(), fld->m_Name );
        break;


    case 1:
        templateFieldListCtrl->SetItem( itemindex, 1, fld->m_Value );
        m_fieldName2->SetValue( aName );
        break;


    case 2:
        templateFieldListCtrl->SetItem( itemindex, 2,
        m_fieldName3->SetValue( aName );
                ( fld->m_Visible == true ) ? _( "Visible" ) : _( "Hidden" ) );
        break;
    }
}


    case 3:
        m_fieldName4->SetValue( aName );
        break;


    case 4:
void DIALOG_EESCHEMA_OPTIONS::SelectTemplateField( int aItem )
        m_fieldName5->SetValue( aName );
{
        break;
    // Only select valid items!
    if( !selectionValid || ( aItem >= templateFieldListCtrl->GetItemCount() ) )
        return;


    case 5:
    // Make sure we select the new item
        m_fieldName6->SetValue( aName );
    ignoreSelection = true;
        break;
    templateFieldListCtrl->SetItemState( aItem, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
}


    case 6:
        m_fieldName7->SetValue( aName );
        break;


    case 7:
void DIALOG_EESCHEMA_OPTIONS::OnAddButtonClick( wxCommandEvent& event )
        m_fieldName8->SetValue( aName );
{
        break;
    // If there is currently a valid selection, copy the edit panel to the
    // selected field so as not to lose the data
    if( selectionValid && ( selectedField < templateFields.size() ) )
        copyPanelToSelected();

    // Add a new fieldname to the fieldname list
    TEMPLATE_FIELDNAME newFieldname = TEMPLATE_FIELDNAME( "Fieldname" );
    newFieldname.m_Value = wxT( "Value" );
    newFieldname.m_Visible = false;
    templateFields.push_back( newFieldname );

    // Select the newly added field and then copy that data to the edit panel.
    // Make sure any previously selected state is cleared and then select the
    // new field
    selectedField = templateFields.size() - 1;
    selectionValid = true;

    // Update the display to reflect the new data
    RefreshTemplateFieldView();
    copySelectedToPanel();

    // Make sure we select the new item
    SelectTemplateField( selectedField );

    event.Skip();
}


    default:

        break;
void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event )
{
    // If there is currently a valid selection, delete the template field from
    // the template field list
    if( selectionValid && ( selectedField < templateFields.size() ) )
    {
        // Delete the fieldname from the fieldname list
        templateFields.erase( templateFields.begin() + selectedField );

        // If the selectedField is still not in the templateField range now,
        // make sure we stay in range and when there are no fields present
        // move to -1
        if( selectedField >= templateFields.size() )
            selectedField = templateFields.size() - 1;

        // Update the display to reflect the new data
        RefreshTemplateFieldView();
        copySelectedToPanel();

        // Make sure after the refresh that the selected item is correct
        SelectTemplateField( selectedField );
    }
    }

    event.Skip();
}
}


wxString DIALOG_EESCHEMA_OPTIONS::GetFieldName( int aNdx )
void DIALOG_EESCHEMA_OPTIONS::copyPanelToSelected( void )
{
{
    wxString nme;
    if( !selectionValid || ( selectedField >= templateFields.size() ) )
        return;


    switch ( aNdx )
    // Update the template field from the edit panel
    templateFields[selectedField].m_Name = fieldNameTextCtrl->GetValue();
    templateFields[selectedField].m_Value = fieldDefaultValueTextCtrl->GetValue();
    templateFields[selectedField].m_Visible = fieldVisibleCheckbox->GetValue();
}


void DIALOG_EESCHEMA_OPTIONS::OnEditControlKillFocus( wxFocusEvent& event )
{
{
    case 0:
    // Update the data + UI
        nme = m_fieldName1->GetValue();
    copyPanelToSelected();
        break;
    RefreshTemplateFieldView();
    SelectTemplateField( selectedField );


    case 1:
    event.Skip();
        nme = m_fieldName2->GetValue();
}
        break;


    case 2:
        nme = m_fieldName3->GetValue();
        break;


    case 3:
void DIALOG_EESCHEMA_OPTIONS::copySelectedToPanel( void )
        nme = m_fieldName4->GetValue();
{
        break;
    if( !selectionValid || ( selectedField >= templateFields.size() ) )
        return;


    case 4:
    // Update the panel data from the selected template field
        nme = m_fieldName5->GetValue();
    fieldNameTextCtrl->SetValue( templateFields[selectedField].m_Name );
        break;
    fieldDefaultValueTextCtrl->SetValue( templateFields[selectedField].m_Value );
    fieldVisibleCheckbox->SetValue( templateFields[selectedField].m_Visible );
}


    case 5:
        nme = m_fieldName6->GetValue();
        break;


    case 6:
void DIALOG_EESCHEMA_OPTIONS::OnTemplateFieldSelected( wxListEvent& event )
        nme = m_fieldName7->GetValue();
{
        break;
    // If the class has generated the event and asked to ignore it, honour that and reset the
    // ignore flag for the next user event.
    if( ignoreSelection )
    {
        ignoreSelection = false;
        event.Skip();
        return;
    }


    case 7:
    // Before getting the new field data, make sure we save the old!
        nme = m_fieldName8->GetValue();
    copyPanelToSelected();
        break;


    default:
    // Now update the selected field and copy the data from the field to the
        break;
    // edit panel
    selectedField = event.GetIndex();
    selectionValid = true;
    copySelectedToPanel();

    // Refresh the template field view - this deletes all fields and then
    // re-fills the entire data grid. It then re-selects the currently
    // selected field. This will be recursive, so disable this event while
    // we refresh the view
    RefreshTemplateFieldView();

    // If an item was selected, make sure we re-select it, or at least the
    // same position in the grid
    SelectTemplateField( selectedField );

    event.Skip();
}
}


    return nme;

void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields )
{
    // Set the template fields object
    templateFields = aFields;

    // Refresh the view
    RefreshTemplateFieldView();
}


TEMPLATE_FIELDNAMES DIALOG_EESCHEMA_OPTIONS::GetTemplateFields( void )
{
    return templateFields;
}
}
+315 −15
Original line number Original line Diff line number Diff line
@@ -32,100 +32,400 @@
#define __dialog_eeschema_options__
#define __dialog_eeschema_options__


#include <dialog_eeschema_options_base.h>
#include <dialog_eeschema_options_base.h>
#include <template_fieldnames.h>


class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE
class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE
{
{
protected:
    /** @brief The template fieldnames for this dialog */
    TEMPLATE_FIELDNAMES templateFields;

    /** @brief The current row selected in the template fieldname wxListCtrl which is also in the
        edit panel */
    size_t selectedField;

    /** @brief The selectedField value is only valid when this bool is set to true */
    bool selectionValid;

    /** @brief Set to true internally when OnTemplateFieldSelected() an event needs to be
        ignored */
    bool ignoreSelection;

    /**
     * Function OnAddButtonClick
     * Process the wxWidgets @a event produced when the user presses the Add buton for the
     * template fieldnames control
     *
     * @param event The wxWidgets produced event information
     *
     * Adds a new template fieldname (with default values) to the template fieldnames data
     */

    void OnAddButtonClick( wxCommandEvent& event );

    /**
     * Function OnDeleteButtonClick
     * Process the wxWidgets @a event produced when the user presses the Delete button for the
     * template fieldnames control
     *
     * @param event The wxWidgets produced event information
     *
     * Deletes the selected template fieldname from the template fieldnames data
     */
    void OnDeleteButtonClick( wxCommandEvent& event );

    /**
     * Function OnEditControlKillFocus
     * This Focus Event Handler should be connected to any controls in the template field edit box
     * so that any loss of focus results in the data being saved to the currently selected template
     * field
     *
     * @param event The wxWidgets produced event information
     *
     * Copies data from the edit box to the selected field template
     */
    void OnEditControlKillFocus( wxFocusEvent& event );

    /**
     * Function copyPanelToSelected
     * Copies the data from the edit panel to the selected template fieldname
     */
    void copyPanelToSelected( void );

    /**
     * Function copySelectedToPanel
     * Copies the data from the selected template fieldname and fills in the edit panel
     */
    void copySelectedToPanel( void );

    /**
     * Function OnTemplateFieldSelected
     * Event handler for the wxListCtrl containing the template fieldnames
     *
     * @param event The event information provided by wxWidgets
     *
     * Processes data exchange between the edit panel and the selected template fieldname
     */
    void OnTemplateFieldSelected( wxListEvent& event );

    /**
     * Function RefreshTemplateFieldView
     * Refresh the template fieldname wxListCtrl
     *
     * Deletes all data from the wxListCtrl and then re-polpulates the control with the data in
     * the template fieldnames.
     *
     * Use any time the template field data has changed
     */
    void RefreshTemplateFieldView( void );

    /**
     * Function SelectTemplateField
     * Selects @a aItem from the wxListCtrl populated with the template fieldnames
     *
     * @param aItem The item index of the row to be selected
     *
     * When RefreshTemplateFieldView() is used the selection is lost because all of the items are
     * removed from the wxListCtrl and then the control is re-populated. This function can be used
     * to re-select an item that was previously selected so that the selection is not lost.
     *
     * <b>NOTE:</b> This function first sets the ignoreSelection flag before making the selection.
     * This means the class can select something in the wxListCtrl without causing further
     * selection events.
     */
    void SelectTemplateField( int aItem );

public:
public:
    /**
     * Public constructor
     *
     * @param parent The dialog's parent
     */
    DIALOG_EESCHEMA_OPTIONS( wxWindow* parent );
    DIALOG_EESCHEMA_OPTIONS( wxWindow* parent );


    void SetUnits( const wxArrayString& units, int select = 0 );
    /**
     * Function GetUnitsSelection
     * Returns the currently selected grid size in the dialog
     */
    int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }
    int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }


    void SetGridSelection( int select ) { m_choiceGridSize->SetSelection( select ); }
    /**
     * Function SetUnits
     * Set the unit options
     *
     * @param units The array of strings representing the unit options
     * @param select The unit to select from the unit options
     *
     * Appends the @a units options to the list of unit options and selects the @a aSelect option
     */
    void SetUnits( const wxArrayString& units, int aSelect = 0 );

    /**
     * Function GetGridSelection
     * Returns the curent grid size selected in the dialog
     */
    int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
    int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
    void SetGridSizes( const GRIDS& grid_sizes, int grid_id );


    void SetBusWidth( int aWidth )
    /**
    {
     * Function SetGridSizes
        m_spinBusWidth->SetValue( aWidth );
     * Sets the available grid size choices @a aGridSizes and selectd the current option @a aGridId
    }
     *
     * @param aGridSizes The grid sizes that are able to be chosen from
     * @param aGridId The grid size to select from the grid size options
     */
    void SetGridSizes( const GRIDS& aGridSizes, int aGridId );


    int GetBusWidth( void )
    /**
    {
     * Function GetBusWidth
        return m_spinBusWidth->GetValue();
     * Get the current bus width setting from the dialog
    }
     */
    int GetBusWidth( void ) { return m_spinBusWidth->GetValue(); }


    /**
     * Function SetBusWidth
     * Sets the bus width setting in the dialog
     *
     * @param aWidth The bus width to set the dialog edit spinbox with
     */
    void SetBusWidth( int aWidth ) { m_spinBusWidth->SetValue( aWidth ); }

    /**
     * Function SetLineWidth
     * Sets the current LineWidth value in the dialog
     * @param aWidth The line width to set in the dialog
     */
    void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
    void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }

    /**
     * Function GetLineWidth
     * Returns the current LineWidth value from the dialog
     */
    int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
    int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }


    /**
     * Function SetTextSize
     * Sets the current default TextSize value in the dialog
     * @param text_size The text size to set in the dialog
     */
    void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
    void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }

    /**
     * Function GetTextSize
     * Returns the current default TextSize value from the dialog
     */
    int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
    int GetTextSize( void ) { return m_spinTextSize->GetValue(); }


    /**
     * Function SetRepeatHorizontal
     * Sets the current RepeatHorizontal displacement value in the dialog
     * @param displacement The displacement to set in the dialog
     */
    void SetRepeatHorizontal( int displacement )
    void SetRepeatHorizontal( int displacement )
    {
    {
        m_spinRepeatHorizontal->SetValue( displacement );
        m_spinRepeatHorizontal->SetValue( displacement );
    }
    }

    /**
     * Function GetRepeatHorizontal
     * Returns the current RepeatHorizontal displacement value from the dialog
     */
    int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }
    int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }

    /**
     * Function SetRepeatVertical
     * Sets the current RepeatVertical displacement value in the dialog
     * @param displacement The displacement to set in the dialog
     */
    void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }
    void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }


    /**
     * Function GetRepeatVertical
     * Returns the current RepeatVertical displacement value from the dialog
     */
    int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
    int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }

    /**
     * Function SetRepeatLabel
     * Sets the current RepeatLabel increment value in the dialog
     * @param increment The increment to set in the dialog
     */
    void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }
    void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }

    /**
     * Function GetRepeatLabel
     * Returns the current RepeatLabel increment value from the dialog
     */
    int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }
    int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }


    /**
     * Function SetAutoSaveInterval
     * Sets the current AutoSaveInterval value in the dialog
     * @param aInterval The interval to set in the dialog
     */
    void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
    void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }

    /**
     * Function GetAutoSaveInterval
     * Returns the current AutoSaveInterval value from the dialog
     */
    int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }
    int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }


    /**
     * Function SetRefIdSeparator
     * Sets the current RefIdSeparator value in the dialog
     * @param aSep The seperator to use between the reference and the part ID
     * @param aFirstId The first part ID, currently either 'A' or '1'
     */
    void SetRefIdSeparator( wxChar aSep, wxChar aFirstId);
    void SetRefIdSeparator( wxChar aSep, wxChar aFirstId);

    /**
     * Function GetRefIdSeparator
     * Returns the current RefIdSeparator value from the dialog
     * @param aSep The OUTPUT seperator value
     * @param aFirstId The OUTPUT reference first ID
     */
    void GetRefIdSeparator( int& aSep, int& aFirstId);
    void GetRefIdSeparator( int& aSep, int& aFirstId);


    /**
     * Function SetShowGrid
     * Sets the current ShowGrid value in the dialog
     * @param show The ShowGrid value to set in the dialog
     */
    void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
    void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }

    /**
     * Function GetShowGrid
     * Returns the current ShowGrid value from the dialog
     */
    bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
    bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }


    /**
     * Function SetShowHiddenPins
     * Sets the current ShowHiddenPins value in the dialog
     * @param show The ShowHiddenPins value to set in the dialog
     */
    void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }
    void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }

    /**
     * Function GetShowHiddenPins
     * Returns the current ShowHiddenPins value from the dialog
     */
    bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }
    bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }


    /**
     * Function SetEnableZoomNoCenter
     * Sets the current ZoomNoCenter value in the dialog
     * @param enable The ZoomNoCenter value to set in the dialog
     */
    void SetEnableZoomNoCenter( bool enable )
    void SetEnableZoomNoCenter( bool enable )
    {
    {
        m_checkEnableZoomNoCenter->SetValue( enable );
        m_checkEnableZoomNoCenter->SetValue( enable );
    }
    }


    /**
     * Function GetEnableZoomNoCenter
     * Returns the current ZoomNoCenter value from the dialog
     */
    bool GetEnableZoomNoCenter( void )
    bool GetEnableZoomNoCenter( void )
    {
    {
        return m_checkEnableZoomNoCenter->GetValue();
        return m_checkEnableZoomNoCenter->GetValue();
    }
    }

    /**
     * Function SetEnableMiddleButtonPan
     * Sets the current MiddleButtonPan value in the dialog
     *
     * @param enable The boolean value to set the MiddleButtonPan value in the dialog
     */
    void SetEnableMiddleButtonPan( bool enable )
    void SetEnableMiddleButtonPan( bool enable )
    {
    {
        m_checkEnableMiddleButtonPan->SetValue( enable );
        m_checkEnableMiddleButtonPan->SetValue( enable );
        m_checkMiddleButtonPanLimited->Enable( enable );
        m_checkMiddleButtonPanLimited->Enable( enable );
    }
    }


    /**
     * Function GetEnableMiddleButtonPan
     * Returns the current MiddleButtonPan setting from the dialog
     */
    bool GetEnableMiddleButtonPan( void )
    bool GetEnableMiddleButtonPan( void )
    {
    {
        return m_checkEnableMiddleButtonPan->GetValue();
        return m_checkEnableMiddleButtonPan->GetValue();
    }
    }

    /**
     * Function SetMiddleButtonPanLimited
     * Sets the MiddleButtonPanLimited value in the dialog
     *
     * @param enable The boolean value to set the MiddleButtonPanLimted value in the dialog
     */
    void SetMiddleButtonPanLimited( bool enable )
    void SetMiddleButtonPanLimited( bool enable )
    {
    {
        m_checkMiddleButtonPanLimited->SetValue( enable );
        m_checkMiddleButtonPanLimited->SetValue( enable );
    }
    }

    /**
     * Function GetMiddleButtonPanLimited
     * Returns the MiddleButtonPanLimited setting from the dialog
     */
    bool GetMiddleButtonPanLimited( void )
    bool GetMiddleButtonPanLimited( void )
    {
    {
        return m_checkMiddleButtonPanLimited->GetValue();
        return m_checkMiddleButtonPanLimited->GetValue();
    }
    }


    /**
     * Function SetEnableAutoPan
     * Sets the AutoPan setting in the dialog
     *
     * @param enable The boolean value to set the AutoPan value in the dialog
     */
    void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }
    void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }

    /**
     * Function GetEnableAutoPan
     * Return the AutoPan setting from the dialog
     */
    bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }
    bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }


    /**
     * Function SetEnableHVBusOrientation
     * Set the HVBusOrientation setting in the dialog
     *
     * @param enable The boolean value to set the HVBusOrientation value in the dialog
     */
    void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }
    void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }

    /**
     * Function GetEnableHVBusOrientation
     * Get the HVBusOrientation setting from the dialog
     */
    bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }
    bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }


    /**
     * Function
     * Set the ShowPageLimits setting in the dialog
     */
    void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }
    void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }

    /**
     * Function
     * Return the current ShowPageLimits setting from the dialog
     */
    bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
    bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }


    /** Set the field \a aNdx textctrl to \a aName */
    /**
    void SetFieldName( int aNdx, wxString aName );
     * Function SetTemplateFields
     * Set the template field data in the dialog
     *
     * @param aFields The template fieldnames that the dialog should start with before any editing
     */
    void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields );


    /** Get the field \a aNdx name from the fields textctrl */
    /**
    wxString GetFieldName( int aNdx );
     * Function GetTemplateFields
     * Get the dialog's template field data
     *
     */
    TEMPLATE_FIELDNAMES GetTemplateFields( void );


private:
private:
    void OnMiddleBtnPanEnbl( wxCommandEvent& event )
    void OnMiddleBtnPanEnbl( wxCommandEvent& event )
+33 −82

File changed.

Preview size limit exceeded, changes collapsed.

+673 −1457

File changed.

Preview size limit exceeded, changes collapsed.

+26 −21

File changed.

Preview size limit exceeded, changes collapsed.

Loading