Commit 1aaa7a9b authored by stambaughw's avatar stambaughw
Browse files

Compiler warning, object name, bug, and string fixes.

* Fixed EESchema options dialog focus bug so escape key now works in GTK.
* Rename schematic objects for improved readability.
* Fixed GCC compiler warnings in plot code.
* Added paragraph in UIpolicies.txt about setting dialog box sizes.
* Lots of message box string clean up.
parent 04c7eb29
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ Dialogs:
    expands the dialog window, making it easier to read more DRC error messages.
    In other dialogs without one component more important than the others, the
    sizers might be configured to position the controls to sensible positions
    near the perimeter of the increasingly larger dialog box, not necesarily
    near the perimeter of the increasingly larger dialog box, not necessarily
    leaving them all bundled tightly together.  The dialog box should look
    nice at any size large enough to show all the components.

@@ -36,3 +36,12 @@ Dialogs:
    This is important because the help files and the wiki often lag behind
    the source code.

    Avoid defining initial dialog sizes if possible.  Let the sizers do their
    job.  After the dialog is fit to the sizers, set the minimum size to the
    current size to prevent the dialog controls from being obscured when
    resizing the dialog.  If the labels or text of the dialog controls are,
    set or changed at run time.  Rerun wxWindow::Fit() to allow the dialog to
    re-size and adjust for the new control widths.  This can all be done after
    the dialog is created but before it is shown or use class methods to
    re-size the dialog as required.  Reset the minimum size to the updated
    dialog size.
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ void DXF_PLOTTER::arc( wxPoint centre, int StAngle, int EndAngle, int radius,
        return;

    user_to_device_coordinates( centre );
    radius = user_to_device_size( radius );
    radius = wxRound( user_to_device_size( radius ) );

    /* DXF ARC */
    wxString cname = ColorRefs[current_color].m_Name;
+222 −169

File changed.

Preview size limit exceeded, changes collapsed.

+21 −21
Original line number Diff line number Diff line
@@ -14,15 +14,10 @@
#include "general.h"


bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
    const wxString& aReference,
    const wxString& aFootPrint,
    bool            aSetVisible )
{
/** function FillFootprintFieldForAllInstancesofComponent
 * Search for component "aReference", and place a Footprint in Footprint field
 * @param aReference = reference of the component to initialize
 * @param aFootPrint = new value for the filed Fottprint component
 * @param aFootPrint = new value for the filed Footprint component
 * @param aSetVisible = true to have the field visible, false to set the
 * invisible flag
 * @return true if the given component is found
@@ -33,9 +28,14 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
 * the search is not stopped when a reference is found (all instances must be
 * found).
 */
    DrawSheetPath* sheet;
bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
    const wxString& aReference,
    const wxString& aFootPrint,
    bool            aSetVisible )
{
    SCH_SHEET_PATH* sheet;
    SCH_ITEM*       DrawList = NULL;
    EDA_SheetList  SheetList;
    SCH_SHEET_LIST  SheetList;
    SCH_COMPONENT*  Cmp;
    bool            found = false;

@@ -82,9 +82,6 @@ bool WinEDA_SchematicFrame::FillFootprintFieldForAllInstancesofComponent(
}


bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
                                              aSetFielsAttributeToVisible  )
{
/** Function ProcessStuffFile
 * Read a "stuff" file created by cvpcb.
 * That file has lines like:
@@ -99,6 +96,9 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
 * visible
 * @return true if OK.
 */
bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
                                              aSetFielsAttributeToVisible  )
{
    int   LineNum = 0;
    char* cp, Ref[256], FootPrint[256], Line[1024];

@@ -127,10 +127,10 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* aStuffFile, bool
}


bool WinEDA_SchematicFrame::ReadInputStuffFile()
{
/* Backann footprint info to schematic.
 */
bool WinEDA_SchematicFrame::ReadInputStuffFile()
{
    wxString Line, filename;
    FILE*    StuffFile;
    wxString msg;
@@ -157,7 +157,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
        return FALSE;

    int diag = wxMessageBox(
        _( "Set the Footprint Field to Visible ?" ),
        _( "Set the foot print field to visible?" ),
        _( "Field Display Option" ),
        wxYES_NO | wxICON_QUESTION | wxCANCEL, this );

@@ -171,7 +171,7 @@ bool WinEDA_SchematicFrame::ReadInputStuffFile()
    StuffFile = wxFopen( filename, wxT( "rt" ) );
    if( StuffFile == NULL )
    {
        msg.Printf( _( "Failed to open Stuff File <%s>" ), filename.GetData() );
        msg.Printf( _( "Failed to open stuff file <%s>" ), filename.GetData() );
        DisplayError( this, msg, 20 );
        return FALSE;
    }
+38 −58
Original line number Diff line number Diff line
@@ -39,13 +39,11 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel,
static void     SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList );


/*************************************************************************/
int WinEDA_SchematicFrame::ReturnBlockCommand( int key )
{
/*************************************************************************/
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
 *  the key (ALT, SHIFT ALT ..)
 */
int WinEDA_SchematicFrame::ReturnBlockCommand( int key )
{
    int cmd;

    switch( key )
@@ -80,12 +78,10 @@ int WinEDA_SchematicFrame::ReturnBlockCommand( int key )
}


/*************************************************/
void WinEDA_SchematicFrame::InitBlockPasteInfos()
{
/*************************************************/
/* Init the parameters used by the block paste command
 */
void WinEDA_SchematicFrame::InitBlockPasteInfos()
{
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

    block->m_ItemsSelection.CopyList( g_BlockSaveDataList.m_ItemsSelection );
@@ -93,15 +89,13 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos()
}


/******************************************************/
void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{
/******************************************************/
/* Routine to handle the BLOCK PLACE command
 *  Last routine for block operation for:
 *  - block move & drag
 *  - block copy & paste
 */
void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
{
    bool            err   = FALSE;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

@@ -208,16 +202,14 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC )
}


/****************************************************/
int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
{
/****************************************************/
/* Manage end block command
 * Returns:
 * 0 if no features selected
 * 1 otherwise
 * -1 If control ended and components selection (block delete, block save)
 */
int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
{
    int             ii = 0;
    bool            zoom_command = FALSE;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;
@@ -349,14 +341,12 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC )
}


/***********************************************************************/
void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
{
/***********************************************************************/
/* Manage end block command from context menu.
 * Called after HandleBlockEnd.
 * From the command block move can execute a command other than block move.
 */
void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
{
    int             ii    = 0;
    BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate;

@@ -476,14 +466,12 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC )
}


/************************************************************************/
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
                                     bool erase )
{
/************************************************************************/
/* Traces the outline of the search block structures
 * The entire block follows the cursor
 */
static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
                                     bool erase )
{
    BLOCK_SELECTOR* block = &panel->GetScreen()->m_BlockLocate;;

    BASE_SCREEN*    screen = panel->GetScreen();
@@ -513,15 +501,13 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
}


/*****************************************************************/
void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
{
/*****************************************************************/
/* Routine to Save an object from global drawing object list.
 *  This routine is the same as delete but:
 *  - the original list is NOT removed.
 *  - List is saved in g_BlockSaveDataList
 */
void SaveStructListForPaste( PICKED_ITEMS_LIST& aItemsList )
{
    g_BlockSaveDataList.ClearListAndDeleteItems();      // delete previous
                                                        // saved list, if
                                                        // exists
@@ -594,16 +580,14 @@ void WinEDA_SchematicFrame::PasteListOfItems( wxDC* DC )
}


/****************************************************/
static void CollectStructsToDrag( SCH_SCREEN* screen )
{
/****************************************************/
/* creates the list of items found when a drag block is initiated.
 * items are those selected in window block an some items outside this area but
 * connected to a selected item (connected wires to a component or an entry )
 */
static void CollectStructsToDrag( SCH_SCREEN* screen )
{
    SCH_ITEM* Struct;
    EDA_DrawLineStruct* SegmStruct;
    SCH_LINE* SegmStruct;

    PICKED_ITEMS_LIST*  pickedlist = &screen->m_BlockLocate.m_ItemsSelection;

@@ -645,7 +629,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
        Struct = (SCH_ITEM*) (SCH_ITEM*) pickedlist->GetPickedItem( ii );
        if( Struct->Type() == DRAW_SEGMENT_STRUCT_TYPE )
        {
            SegmStruct = (EDA_DrawLineStruct*) Struct;
            SegmStruct = (SCH_LINE*) Struct;
            if( !screen->m_BlockLocate.Inside( SegmStruct->m_Start ) )
                SegmStruct->m_Flags |= STARTPOINT;

@@ -698,7 +682,7 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )

        if( Struct->Type() == DRAW_BUSENTRY_STRUCT_TYPE )
        {
            DrawBusEntryStruct* item = (DrawBusEntryStruct*) Struct;
            SCH_BUS_ENTRY* item = (SCH_BUS_ENTRY*) Struct;
            AddPickedItem( screen, item->m_Pos );
            AddPickedItem( screen, item->m_End() );
        }
@@ -706,16 +690,14 @@ static void CollectStructsToDrag( SCH_SCREEN* screen )
}


/******************************************************************/
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
{
/******************************************************************/
/** AddPickedItem
 * add to the picked list in screen->m_BlockLocate items found at location
 * position
 * @param screen = the screen to consider
 * @param position = the wxPoint where items must be located to be select
 */
static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
{
    SCH_ITEM*          Struct;

    /* Review the list of already selected elements. */
@@ -729,7 +711,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
        {
        case DRAW_SEGMENT_STRUCT_TYPE:
                #undef STRUCT
                #define STRUCT ( (EDA_DrawLineStruct*) Struct )
                #define STRUCT ( (SCH_LINE*) Struct )
            if( STRUCT->m_Start == position )
                STRUCT->m_Flags &= ~STARTPOINT;

@@ -765,7 +747,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )

        case DRAW_JUNCTION_STRUCT_TYPE:
                #undef STRUCT
                #define STRUCT ( (DrawJunctionStruct*) Struct )
                #define STRUCT ( (SCH_JUNCTION*) Struct )
            if( Struct->m_Flags & SELECTED )
                break;
            if( STRUCT->m_Pos != position )
@@ -775,7 +757,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )

        case DRAW_SEGMENT_STRUCT_TYPE:
                #undef STRUCT
                #define STRUCT ( (EDA_DrawLineStruct*) Struct )
                #define STRUCT ( (SCH_LINE*) Struct )
            if( Struct->m_Flags & SELECTED )
                break;
            if( STRUCT->m_Start == position )
@@ -832,9 +814,9 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
        case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
            break;

        case TYPE_MARKER_SCH:
        case TYPE_SCH_MARKER:
                #undef STRUCT
                #define STRUCT ( (MARKER_SCH*) Struct )
                #define STRUCT ( (SCH_MARKER*) Struct )
            if( Struct->m_Flags & SELECTED )
                break;  /* Already in list */
            if( STRUCT->m_Pos != position )
@@ -845,7 +827,7 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )

        case DRAW_NOCONNECT_STRUCT_TYPE:
                #undef STRUCT
                #define STRUCT ( (DrawNoConnectStruct*) Struct )
                #define STRUCT ( (SCH_NO_CONNECT*) Struct )
            if( Struct->m_Flags & SELECTED )
                break;  /* Already in list */
            if( STRUCT->m_Pos != position )
@@ -862,12 +844,6 @@ static void AddPickedItem( SCH_SCREEN* screen, wxPoint position )
}


/****************************************************************************/
static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
                                    wxPoint&       aPosition,
                                    bool           aSearchFirst )
{
/****************************************************************************/
/** GetNextPinPosition()
 * calculate position of the "next" pin of the aDrawLibItem component
 * @param aDrawLibItem = component to test.
@@ -876,6 +852,10 @@ static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
 * @param aSearchFirst = if true, search for the first pin
 * @return a pointer to the pin
 */
static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
                                    wxPoint&       aPosition,
                                    bool           aSearchFirst )
{
    static LIB_COMPONENT* Entry;
    static int Multi, convert, TransMat[2][2];
    static wxPoint CmpPosition;
@@ -908,7 +888,7 @@ static LIB_PIN* GetNextPinPosition( SCH_COMPONENT* aDrawLibItem,
            continue;

        /* Calculate the pin position (according to the component orientation)
         **/
         */
        aPosition = TransformCoordinate( TransMat, Pin->m_Pos ) + CmpPosition;
        return Pin;
    }
Loading