Commit e8e6f1a7 authored by charras's avatar charras
Browse files

code cleaning and very minor bugs fixed

parent 6f631976
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -328,7 +328,7 @@ bool EDA_TextStruct::HitTest( EDA_Rect& refArea )
void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
                           const wxPoint& aOffset, EDA_Colors aColor,
                           const wxPoint& aOffset, EDA_Colors aColor,
                           int aDrawMode,
                           int aDrawMode,
                           GRFillMode aDisplayMode, EDA_Colors aAnchor_color )
                           GRFillMode aFillMode, EDA_Colors aAnchor_color )
/***************************************************************/
/***************************************************************/


/** Function Draw
/** Function Draw
@@ -338,7 +338,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
 *  @param aOffset = draw offset (usually (0,0))
 *  @param aOffset = draw offset (usually (0,0))
 *  @param EDA_Colors aColor = text color
 *  @param EDA_Colors aColor = text color
 *  @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
 *  @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
 *  @param aDisplayMode = FILAIRE, FILLED or SKETCH
 *  @param aFillMode = FILAIRE, FILLED or SKETCH
 *  @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
 *  @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
 */
 */


@@ -360,7 +360,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
                               aOffset,
                               aOffset,
                               aColor,
                               aColor,
                               aDrawMode,
                               aDrawMode,
                               aDisplayMode,
                               aFillMode,
                               aAnchor_color,
                               aAnchor_color,
                               txt,
                               txt,
                               pos );
                               pos );
@@ -375,7 +375,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
                           aOffset,
                           aOffset,
                           aColor,
                           aColor,
                           aDrawMode,
                           aDrawMode,
                           aDisplayMode,
                           aFillMode,
                           aAnchor_color,
                           aAnchor_color,
                           m_Text,
                           m_Text,
                           m_Pos );
                           m_Pos );
@@ -390,7 +390,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
 *  @param aOffset = draw offset (usually (0,0))
 *  @param aOffset = draw offset (usually (0,0))
 *  @param EDA_Colors aColor = text color
 *  @param EDA_Colors aColor = text color
 *  @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
 *  @param aDrawMode = GR_OR, GR_XOR.., -1 to use the current mode.
 *  @param aDisplayMode = FILAIRE, FILLED or SKETCH
 *  @param aFillMode = FILAIRE, FILLED or SKETCH
 *  @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
 *  @param EDA_Colors aAnchor_color = anchor color ( UNSPECIFIED_COLOR = do not draw anchor ).
 *  @param EDA_Colors aText = the single line of text to draw.
 *  @param EDA_Colors aText = the single line of text to draw.
 *  @param EDA_Colors aPos = the position of this line ).
 *  @param EDA_Colors aPos = the position of this line ).
@@ -398,12 +398,12 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
                                        const wxPoint& aOffset, EDA_Colors aColor,
                                        const wxPoint& aOffset, EDA_Colors aColor,
                                        int aDrawMode,
                                        int aDrawMode,
                                        GRFillMode aDisplayMode, EDA_Colors aAnchor_color,
                                        GRFillMode aFillMode, EDA_Colors aAnchor_color,
                                        wxString& aText, wxPoint aPos )
                                        wxString& aText, wxPoint aPos )
{
{
    int width = m_Width;
    int width = m_Width;


    if( aDisplayMode == FILAIRE )
    if( aFillMode == FILAIRE )
        width = 0;
        width = 0;


    if( aDrawMode != -1 )
    if( aDrawMode != -1 )
@@ -425,7 +425,7 @@ void EDA_TextStruct::DrawOneLineOfText( WinEDA_DrawPanel* aPanel, wxDC* aDC,
                cX, cY + anchor_size, 0, aAnchor_color );
                cX, cY + anchor_size, 0, aAnchor_color );
    }
    }


    if( aDisplayMode == SKETCH )
    if( aFillMode == SKETCH )
        width = -width;
        width = -width;


    wxSize size = m_Size;
    wxSize size = m_Size;
+0 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,6 @@ wxArrayString g_LibName_List; // library list to load


BOARD_ITEM* g_UnDeleteStack[UNDELETE_STACK_SIZE]; // Linked list of deleted items
BOARD_ITEM* g_UnDeleteStack[UNDELETE_STACK_SIZE]; // Linked list of deleted items
int         g_UnDeleteStackPtr;
int         g_UnDeleteStackPtr;
bool        g_ShowGrid = true;


DISPLAY_OPTIONS DisplayOpt;      /* Display options for board items */
DISPLAY_OPTIONS DisplayOpt;      /* Display options for board items */


+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ void WinEDA_GerberFrame::OnSelectOptionToolbar( wxCommandEvent& event )
    switch( id )
    switch( id )
    {
    {
    case ID_TB_OPTIONS_SHOW_GRID:
    case ID_TB_OPTIONS_SHOW_GRID:
        m_Draw_Grid = g_ShowGrid = m_OptionsToolBar->GetToolState( id );
        m_Draw_Grid = m_OptionsToolBar->GetToolState( id );
        DrawPanel->Refresh( TRUE );
        DrawPanel->Refresh( TRUE );
        break;
        break;


+6 −2
Original line number Original line Diff line number Diff line
@@ -19,6 +19,9 @@


#include "protos.h"
#include "protos.h"


// variable used to handle grid visibility:
bool s_showGrid;

#include "set_color.h" // Header file associated with this file
#include "set_color.h" // Header file associated with this file


// Local variables:
// Local variables:
@@ -132,6 +135,7 @@ void WinEDA_SetColorsFrame::CreateControls()


    // Add various items to the dialog box, as determined by the
    // Add various items to the dialog box, as determined by the
    // details of each element contained within laytool_list[]
    // details of each element contained within laytool_list[]
    s_showGrid = m_Parent->m_Draw_Grid;
    for( lyr = 0, cln = 0; lyr < NB_BUTT; lyr++ )
    for( lyr = 0, cln = 0; lyr < NB_BUTT; lyr++ )
    {
    {
        // Look for the first set of controls within each column.
        // Look for the first set of controls within each column.
@@ -442,7 +446,7 @@ void WinEDA_SetColorsFrame::UpdateLayerSettings()
        }
        }
    }
    }
   // Additional command required for updating visibility of grid.
   // Additional command required for updating visibility of grid.
    m_Parent->m_Draw_Grid = g_ShowGrid;
    m_Parent->m_Draw_Grid = s_showGrid;
}
}




+1 −1
Original line number Original line Diff line number Diff line
@@ -324,7 +324,7 @@ static ColorButton Grid_Butt=
    _("Grid"),                  // Title
    _("Grid"),                  // Title
    &g_GridColor,               // Address of optional parameter
    &g_GridColor,               // Address of optional parameter
    FALSE,
    FALSE,
    &g_ShowGrid                 // Address of boolean display control parameter to toggle
    &s_showGrid                 // Address of boolean display control parameter to toggle
};
};


static ColorButton Show_DCodes_Butt=
static ColorButton Show_DCodes_Butt=
Loading