Commit 53870013 authored by stambaughw's avatar stambaughw
Browse files

Replace component library editor draw item dialog box.

* Created new component library editor draw item dialog box with
  wxFormBuilder.
* Removed previous DialogBlocks version of the draw item dialog box.
* Removed some additional global variables used in component library
  editor.
* Add IsFillable() method to draw item base object.
parent b9c40ba9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ set(EESCHEMA_SRCS
    dialog_bodygraphictext_properties_base.cpp
    dialog_build_BOM.cpp
    dialog_build_BOM_base.cpp
#   dialog_cmp_graphic_properties.cpp
    dialog_edit_component_in_lib.cpp
    dialog_edit_component_in_lib_base.cpp
    dialog_edit_component_in_schematic_fbp.cpp
@@ -56,6 +55,8 @@ set(EESCHEMA_SRCS
    dialog_erc.cpp
    dialog_erc_base.cpp
#   dialog_find.cpp
    dialog_lib_edit_draw_item.cpp
    dialog_lib_edit_draw_item_base.cpp
    dialog_lib_new_component.cpp
    dialog_lib_new_component_base.cpp
    dialog_options.cpp
+12 −4
Original line number Diff line number Diff line
@@ -43,17 +43,17 @@
LIB_FIELD::LIB_FIELD(LIB_COMPONENT * aParent, int idfield ) :
    LIB_DRAW_ITEM( COMPONENT_FIELD_DRAW_TYPE, aParent )
{
    m_FieldId = idfield;
    m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT;
    Init( idfield );
}


LIB_FIELD::LIB_FIELD( int idfield ) :
    LIB_DRAW_ITEM( COMPONENT_FIELD_DRAW_TYPE, NULL )
{
    m_FieldId = idfield;
    m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT;
    Init( idfield );
}


LIB_FIELD::LIB_FIELD( const LIB_FIELD& field ) : LIB_DRAW_ITEM( field )
{
    m_Pos       = field.m_Pos;
@@ -75,6 +75,14 @@ LIB_FIELD::~LIB_FIELD()
}


void LIB_FIELD::Init( int id )
{
    m_FieldId = id;
    m_Size.x = m_Size.y = DEFAULT_SIZE_TEXT;
    m_typeName = _( "Field" );
}


bool LIB_FIELD::Save( FILE* ExportFile ) const
{
    int      hjustify, vjustify;
+5 −0
Original line number Diff line number Diff line
@@ -40,11 +40,16 @@ public:
    LIB_FIELD( LIB_COMPONENT * aParent, int idfield = 2 );
    LIB_FIELD( const LIB_FIELD& field );
    ~LIB_FIELD();

    virtual wxString GetClass() const
    {
        return wxT( "LIB_FIELD" );
    }

    /**
     * Object constructor initialization helper.
     */
    void Init( int idfield );

    /** Function GetPenSize virtual pure
     * @return the size of the "pen" that be used to draw or plot this item
+32 −25
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( KICAD_T struct_type, LIB_COMPONENT* aParent ) :
    m_Fill       = NO_FILL;
    m_Parent     = (EDA_BaseStruct*) aParent;
    m_typeName   = _( "Undefined" );
    m_isFillable = false;
}


@@ -44,6 +45,7 @@ LIB_DRAW_ITEM::LIB_DRAW_ITEM( const LIB_DRAW_ITEM& item ) :
    m_Fill = item.m_Fill;
    m_Parent = item.m_Parent;
    m_typeName = item.m_typeName;
    m_isFillable = item.m_isFillable;
}


@@ -122,6 +124,7 @@ LIB_ARC::LIB_ARC( LIB_COMPONENT* aParent ) :
    m_t2         = 0;
    m_Width      = 0;
    m_Fill       = NO_FILL;
    m_isFillable = true;
    m_typeName   = _( "Arc" );
}

@@ -542,6 +545,7 @@ LIB_CIRCLE::LIB_CIRCLE( LIB_COMPONENT* aParent ) :
{
    m_Radius     = 0;
    m_Fill       = NO_FILL;
    m_isFillable = true;
    m_typeName   = _( "Circle" );
}

@@ -806,6 +810,7 @@ LIB_RECTANGLE::LIB_RECTANGLE( LIB_COMPONENT* aParent ) :
{
    m_Width      = 0;
    m_Fill       = NO_FILL;
    m_isFillable = true;
    m_typeName   = _( "Rectangle" );
}

@@ -1311,6 +1316,7 @@ LIB_POLYLINE::LIB_POLYLINE( LIB_COMPONENT* aParent ) :
{
    m_Fill       = NO_FILL;
    m_Width      = 0;
    m_isFillable = true;
    m_typeName   = _( "PolyLine" );
}

@@ -1685,6 +1691,7 @@ LIB_BEZIER::LIB_BEZIER( LIB_COMPONENT* aParent ) :
{
    m_Fill       = NO_FILL;
    m_Width      = 0;
    m_isFillable = true;
    m_typeName   = _( "Bezier" );
}

+13 −0
Original line number Diff line number Diff line
@@ -303,6 +303,16 @@ public:
    int GetWidth( void ) { return DoGetWidth(); }
    void SetWidth( int width ) { DoSetWidth( width ); }

    /**
     * Check if draw object can be filled.
     *
     * The default setting is false.  If the derived object support filling,
     * set the m_isFillable member to true.
     *
     * @return bool - True if draw object can be fill.  Default is false.
     */
    bool IsFillable( void ) { return m_isFillable; }

protected:
    virtual LIB_DRAW_ITEM* DoGenCopy() = 0;

@@ -327,6 +337,9 @@ protected:
                         const int transform[2][2] ) = 0;
    virtual int DoGetWidth( void ) = 0;
    virtual void DoSetWidth( int width ) = 0;

    /** Flag to indicate if draw item is fillable.  Default is false. */
    bool m_isFillable;
};


Loading