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

code cleaning

parent 2cdce05d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include "common.h"
#include "macros.h"
#include "kicad_string.h"
#include "dialog_helpers.h"


enum listbox {
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "wxstruct.h"
#include "confirm.h"
#include "kicad_device_context.h"
#include "dialog_helpers.h"

#include <wx/fontdlg.h>

+1 −63
Original line number Diff line number Diff line
@@ -2,14 +2,10 @@
/* wxwineda.cpp */
/****************/

#ifdef __GNUG__
#pragma implementation
#endif

#include "fctsys.h"
#include "common.h"
#include "wxstruct.h"

#include "dialog_helpers.h"

/*
 * Text entry dialog to enter one or more lines of text.
@@ -390,61 +386,3 @@ void WinEDA_ValueCtrl::Enable( bool enbl )
    m_ValueCtrl->Enable( enbl );
    m_Text->Enable( enbl );
}


/**********************************************************************/
/* Class to display and edit a double precision floating point value. */
/**********************************************************************/
WinEDA_DFloatValueCtrl::WinEDA_DFloatValueCtrl( wxWindow* parent,
                                                const wxString& title,
                                                double value,
                                                wxBoxSizer* BoxSizer )
{
    wxString buffer;
    wxString label = title;

    m_Value = value;

    m_Text = new wxStaticText( parent, -1, label );

    BoxSizer->Add( m_Text, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );

    buffer.Printf( wxT( "%f" ), m_Value );
    m_ValueCtrl = new   wxTextCtrl( parent, -1, buffer );

    BoxSizer->Add( m_ValueCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
}


WinEDA_DFloatValueCtrl::~WinEDA_DFloatValueCtrl()
{
    delete m_ValueCtrl;
    delete m_Text;
}


double WinEDA_DFloatValueCtrl::GetValue()
{
    double coord = 0;

    m_ValueCtrl->GetValue().ToDouble( &coord );
    return coord;
}


void WinEDA_DFloatValueCtrl::SetValue( double new_value )
{
    wxString buffer;

    m_Value = new_value;

    buffer.Printf( wxT( "%f" ), m_Value );
    m_ValueCtrl->SetValue( buffer );
}


void WinEDA_DFloatValueCtrl::Enable( bool enbl )
{
    m_ValueCtrl->Enable( enbl );
    m_Text->Enable( enbl );
}
+10 −4
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "general.h"
#include "protos.h"
#include "class_library.h"
#include "dialog_helpers.h"

#include <boost/foreach.hpp>

@@ -64,13 +65,18 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys, wxString& Buf
        return wxEmptyString;
    }

    wxSingleChoiceDialog dlg( frame, wxEmptyString, _( "Select Component" ),
                              nameList );
    // Show candidate list:
    wxString cmpname;
    WinEDAListBox dlg( frame, _( "Select Component" ),
                               NULL, cmpname, DisplayCmpDoc );

    if( dlg.ShowModal() == wxID_CANCEL || dlg.GetStringSelection().IsEmpty() )
    dlg.InsertItems(nameList);
    int selection = dlg.ShowModal();
    if(  selection < 0 )
        return wxEmptyString;

    return dlg.GetStringSelection();
    cmpname = nameList[selection];
    return cmpname;
}


+3 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include "protos.h"
#include "class_library.h"
#include "sch_component.h"
#include "dialog_helpers.h"

#include "dialog_edit_component_in_schematic.h"

Loading