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

New EESchema find dialog and other minor fixes.

* Replaced find dialog with wxFormBuilder version.
* New find dialog is modeless, supports more advanced search features,
  remembers it's last position, size, search history, and search settings,
  and implements initial support for replacing.
* Added Shift+F5 hot key to search for next DRC marker.  F5 now just
  repeats previous search.
* Minor cosmetic enhancements to label edit dialog.
* Remove tab from grid size text printf to fix toolbar grid combobox
  display in wxGTK.
* Updated my TODO list items.
parent 8931b1fc
Loading
Loading
Loading
Loading
+12 −31
Original line number Original line Diff line number Diff line
@@ -45,11 +45,6 @@ C2) Write a tool to generate DSNLEXER keyword tables (and enums) as *.cpp and
    CMake.
    CMake.




Wayne:
C1)  Fix mouse wheel scrolling (ctrl + Mouse wheel) and (Shift + mouse wheel)
     to move more than a single scroll increment.


CvPCB
CvPCB
-----
-----
* Preview of the already assigned footprint.
* Preview of the already assigned footprint.
@@ -61,8 +56,18 @@ EESchema
* Drag and drop between two EESchema windows.
* Drag and drop between two EESchema windows.


Wayne:
Wayne:
E1)  Relpace find dialog with wxFormBuilder version using a modeless dialog
E2)  Finish adding replace capability to new Find dialog.
     and event driven design similar to wxFindReplaceDialog implementation.
E3)  Hook up perform last library search hot key to replace search libraries for
     component support removed from find dialog.
E4)  Change add component dialog search text control to combobox and add component
     search history save and restore capability.  Also add session save and restore
     to component history list control.  Add advanced search capability similar to
     new find dialog.
E5)  Make escape key work correctly in add component dialog.
E6)  Start initial work for changing component library file format to use Dick's
     dsnlexer.  See note C2 above.  Come up with a workable library file format to
     handle the wishes of the library implementation group.  Add initial clipboard
     support to the library editor.




GerbView
GerbView
@@ -118,27 +123,3 @@ L8) LAYER_WIDGET::GetBestSize() needs platform independence.


L9) On board load, ReFill() is called, this should also update the Render
L9) On board load, ReFill() is called, this should also update the Render
    checkboxes and colors.
    checkboxes and colors.


Use wxDC for coordinate scaling and offsetting fix. (Wayne)
------------------------------------------------------------
W1) Make wxAutoBufferedPaintDC function properly.

W2) Make bitmap grid drawing method function properly or figure out a more
    efficient method for drawing the grid.

W3) Use one cursor position (preferrably logical (drawing) units) instead
    of keeping track of both logical and device cursor positions at the same
    time.

W4) Figure out why none of the apps render correctly using wxGCDC on Windows.

** After (if?) new code accepted as project default: **

W6) Remove all old coordinate scaling and offset code from Kicad.

W7) Remove conditional compilation pragmas and dead code paths.

W8) Remove redundant drawing helper functions from gr_basic.cpp.

W9) Remove all global variables used by old drawing code.
+42 −6
Original line number Original line Diff line number Diff line
@@ -221,33 +221,40 @@ Ki_PageDescr::Ki_PageDescr( const wxSize& size,
}
}




wxString ReturnUnitSymbol( int Units )
wxString ReturnUnitSymbol( int aUnits, const wxString& formatString )
{
{
    wxString tmp;
    wxString label;
    wxString label;


    switch( Units )
    switch( aUnits )
    {
    {
    case INCHES:
    case INCHES:
        label = _( " (\"):" );
        tmp = _( "\"" );
        break;
        break;


    case MILLIMETRE:
    case MILLIMETRE:
        label = _( " (mm):" );
        tmp = _( "mm" );
        break;
        break;


    default:
    default:
        tmp = _( "??" );
        break;
        break;
    }
    }


    if( formatString.IsEmpty() )
        return tmp;

    label.Printf( formatString, GetChars( tmp ) );

    return label;
    return label;
}
}




wxString GetUnitsLabel( int units )
wxString GetUnitsLabel( int aUnits )
{
{
    wxString label;
    wxString label;


    switch( units )
    switch( aUnits )
    {
    {
    case INCHES:
    case INCHES:
        label = _( "inches" );
        label = _( "inches" );
@@ -260,6 +267,7 @@ wxString GetUnitsLabel( int units )
    case CENTIMETRE:
    case CENTIMETRE:
        label = _( "centimeters" );
        label = _( "centimeters" );
        break;
        break;

    default:
    default:
        label = _( "Unknown" );
        label = _( "Unknown" );
        break;
        break;
@@ -268,6 +276,34 @@ wxString GetUnitsLabel( int units )
    return label;
    return label;
}
}



wxString GetAbbreviatedUnitsLabel( int aUnits )
{
    wxString label;

    switch( aUnits )
    {
    case INCHES:
        label = _( "in" );
        break;

    case MILLIMETRE:
        label = _( "mm" );
        break;

    case CENTIMETRE:
        label = _( "cm" );
        break;

    default:
        label = _( "??" );
        break;
    }

    return label;
}


/*
/*
 * Add string "  (mm):" or " ("):" to the static text Stext.
 * Add string "  (mm):" or " ("):" to the static text Stext.
 *  Used in dialog boxes for entering values depending on selected units
 *  Used in dialog boxes for entering values depending on selected units
+26 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,9 @@
#include "general.h"
#include "general.h"
#include "protos.h"
#include "protos.h"


#include "../eeschema/dialog_schematic_find.h"


/* Constructor and destructor for SCH_ITEM */
/* Constructor and destructor for SCH_ITEM */
/* They are not inline because this creates problems with gcc at linking time
/* They are not inline because this creates problems with gcc at linking time
 * in debug mode
 * in debug mode
@@ -60,3 +63,26 @@ void SCH_ITEM::Place( WinEDA_SchematicFrame* frame, wxDC* DC )
        frame->DrawPanel->CursorOn( DC );       // Display schematic cursor
        frame->DrawPanel->CursorOn( DC );       // Display schematic cursor
    }
    }
}
}


bool SCH_ITEM::Matches( const wxString& aText, wxFindReplaceData& aSearchData )
{
    wxString text = aText;
    wxString searchText = aSearchData.GetFindString();

    if( aSearchData.GetFlags() & wxFR_WHOLEWORD )
        return aText.IsSameAs( searchText, aSearchData.GetFlags() & wxFR_MATCHCASE );

    if( aSearchData.GetFlags() & FR_MATCH_WILDCARD )
    {
        if( aSearchData.GetFlags() & wxFR_MATCHCASE )
            return text.Matches( searchText );

        return text.MakeUpper().Matches( searchText.MakeUpper() );
    }

    if( aSearchData.GetFlags() & wxFR_MATCHCASE )
        return aText.Find( searchText ) != wxNOT_FOUND;

    return text.MakeUpper().Find( searchText.MakeUpper() ) != wxNOT_FOUND;
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -247,10 +247,10 @@ void WinEDA_DrawFrame::AddMenuZoomAndGrid( wxMenu* MasterMenu )
            else
            else
            {
            {
                if( g_UnitMetric == 0 )     // inches
                if( g_UnitMetric == 0 )     // inches
                    msg.Printf( wxT( "%.1f mils\t(%.3f mm)" ),
                    msg.Printf( wxT( "%.1f mils, (%.3f mm)" ),
                                gridValueInch * 1000, gridValue_mm );
                                gridValueInch * 1000, gridValue_mm );
                else
                else
                    msg.Printf( wxT( "%.3f mm\t(%.1f mils)" ),
                    msg.Printf( wxT( "%.3f mm, (%.1f mils)" ),
                                gridValue_mm, gridValueInch * 1000 );
                                gridValue_mm, gridValueInch * 1000 );
            }
            }
            gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true );
            gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true );
+2 −1
Original line number Original line Diff line number Diff line
@@ -56,7 +56,6 @@ set(EESCHEMA_SRCS
    dialog_eeschema_options.cpp
    dialog_eeschema_options.cpp
    dialog_erc.cpp
    dialog_erc.cpp
    dialog_erc_base.cpp
    dialog_erc_base.cpp
#   dialog_find.cpp
    dialog_lib_edit_draw_item.cpp
    dialog_lib_edit_draw_item.cpp
    dialog_lib_edit_draw_item_base.cpp
    dialog_lib_edit_draw_item_base.cpp
    dialog_lib_edit_pin.cpp
    dialog_lib_edit_pin.cpp
@@ -67,6 +66,8 @@ set(EESCHEMA_SRCS
    dialog_print_using_printer.cpp
    dialog_print_using_printer.cpp
    dialog_sch_sheet_props.cpp
    dialog_sch_sheet_props.cpp
    dialog_sch_sheet_props_base.cpp
    dialog_sch_sheet_props_base.cpp
    dialog_schematic_find.cpp
    dialog_schematic_find_base.cpp
    dialog_SVG_print.cpp
    dialog_SVG_print.cpp
    dialog_SVG_print_base.cpp
    dialog_SVG_print_base.cpp
    edit_component_in_lib.cpp
    edit_component_in_lib.cpp
Loading