Commit 20dfe9ca authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Minor fixes: dialog_create_array.* files: clean code ( remove useless...

Minor fixes: dialog_create_array.*  files:  clean code ( remove useless declarations and functions ). 
fix a few coverity warnings about not initialized members in ctors.
parent e637493e
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -133,12 +133,6 @@ void DIALOG_CREATE_ARRAY::OnParameterChanged( wxCommandEvent& event )
}
}




void DIALOG_CREATE_ARRAY::OnCancelClick( wxCommandEvent& event )
{
    EndModal( CREATE_ARRAY_ABORT );
}


static const std::string& alphabetFromNumberingScheme(
static const std::string& alphabetFromNumberingScheme(
        DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type )
        DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type )
{
{
@@ -318,7 +312,7 @@ void DIALOG_CREATE_ARRAY::OnOkClick( wxCommandEvent& event )


        ReadConfigFromControls();
        ReadConfigFromControls();


        EndModal( CREATE_ARRAY_OK );
        EndModal( wxID_OK );
    }
    }
}
}


@@ -359,11 +353,10 @@ void DIALOG_CREATE_ARRAY::calculateCircularArrayProperties()
    centre.x = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() );
    centre.x = DoubleValueFromString( g_UserUnit, m_entryCentreX->GetValue() );
    centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() );
    centre.y = DoubleValueFromString( g_UserUnit, m_entryCentreY->GetValue() );


    // FInd the radius, etc of the circle
    // Find the radius, etc of the circle
    centre -= m_originalItemPosition;
    centre -= m_originalItemPosition;


    const double radius = VECTOR2I(centre.x, centre.y).EuclideanNorm();
    const double radius = VECTOR2I(centre.x, centre.y).EuclideanNorm();

    m_labelCircRadiusValue->SetLabelText( StringFromValue( g_UserUnit, int(radius), true ) );
    m_labelCircRadiusValue->SetLabelText( StringFromValue( g_UserUnit, int(radius), true ) );
}
}


+0 −7
Original line number Original line Diff line number Diff line
@@ -172,12 +172,6 @@ class DIALOG_CREATE_ARRAY : public DIALOG_CREATE_ARRAY_BASE,
{
{
public:
public:


    enum CREATE_ARRAY_EDIT_T
    {
        CREATE_ARRAY_ABORT,     ///< if not changed or error
        CREATE_ARRAY_OK,        ///< if successfully changed
    };

    enum ARRAY_TYPE_T
    enum ARRAY_TYPE_T
    {
    {
        ARRAY_GRID,         ///< A grid (x*y) array
        ARRAY_GRID,         ///< A grid (x*y) array
@@ -312,7 +306,6 @@ private:


    // Event callbacks
    // Event callbacks
    void    OnParameterChanged( wxCommandEvent& event );
    void    OnParameterChanged( wxCommandEvent& event );
    void    OnCancelClick( wxCommandEvent& event );
    void    OnOkClick( wxCommandEvent& event );
    void    OnOkClick( wxCommandEvent& event );


    // Internal callback handlers
    // Internal callback handlers
+0 −2
Original line number Original line Diff line number Diff line
@@ -314,7 +314,6 @@ DIALOG_CREATE_ARRAY_BASE::DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID
	m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCentreY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircAngle->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircCount->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), NULL, this );
	m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
	m_stdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
}
}


@@ -335,7 +334,6 @@ DIALOG_CREATE_ARRAY_BASE::~DIALOG_CREATE_ARRAY_BASE()
	m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCentreY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircAngle->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_entryCircCount->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnParameterChanged ), NULL, this );
	m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnCancelClick ), NULL, this );
	m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
	m_stdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_CREATE_ARRAY_BASE::OnOkClick ), NULL, this );
	
	
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -44,7 +44,7 @@
            <property name="minimum_size">-1,-1</property>
            <property name="minimum_size">-1,-1</property>
            <property name="name">DIALOG_CREATE_ARRAY_BASE</property>
            <property name="name">DIALOG_CREATE_ARRAY_BASE</property>
            <property name="pos"></property>
            <property name="pos"></property>
            <property name="size">576,528</property>
            <property name="size">576,428</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
            <property name="title">Create array</property>
            <property name="title">Create array</property>
@@ -4950,7 +4950,7 @@
                        <property name="name">m_stdButtons</property>
                        <property name="name">m_stdButtons</property>
                        <property name="permission">protected</property>
                        <property name="permission">protected</property>
                        <event name="OnApplyButtonClick"></event>
                        <event name="OnApplyButtonClick"></event>
                        <event name="OnCancelButtonClick">OnCancelClick</event>
                        <event name="OnCancelButtonClick"></event>
                        <event name="OnContextHelpButtonClick"></event>
                        <event name="OnContextHelpButtonClick"></event>
                        <event name="OnHelpButtonClick"></event>
                        <event name="OnHelpButtonClick"></event>
                        <event name="OnNoButtonClick"></event>
                        <event name="OnNoButtonClick"></event>
+1 −2
Original line number Original line Diff line number Diff line
@@ -107,13 +107,12 @@ class DIALOG_CREATE_ARRAY_BASE : public DIALOG_SHIM
		// Virtual event handlers, overide them in your derived class
		// Virtual event handlers, overide them in your derived class
		virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
		virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
		virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnParameterChanged( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
		
		
	
	
	public:
	public:
		
		
		DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 576,528 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		DIALOG_CREATE_ARRAY_BASE( wxWindow* parent, wxWindowID id = wxID_DIALOG_CREATE_ARRAY, const wxString& title = _("Create array"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 576,428 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		~DIALOG_CREATE_ARRAY_BASE();
		~DIALOG_CREATE_ARRAY_BASE();
	
	
};
};
Loading