Make option not uppercasing component names. I'm so bored with my Eeschema is convert ADuC, Si, component names to ADUC, SI etc., so I contribute this patch so anyone now may keep components

This commit is contained in:
Vovanium 2010-10-22 19:02:11 +04:00
parent 185a2544b5
commit 15652d8d34
7 changed files with 28 additions and 1 deletions

View File

@ -19,6 +19,9 @@ option(KICAD_MINIZIP "enable/disable building minizip (default ON)" ON)
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
#for those who bored with uppercase
option(KICAD_KEEPCASE "turn-off automatic component name conversion to uppercase if selected")
option(USE_WX_ZOOM "Use wxDC to perform zooming (default OFF). Warning, this is experimental" )
option(USE_WX_GRAPHICS_CONTEXT
@ -53,6 +56,10 @@ if(KICAD_GOST)
add_definitions(-DKICAD_GOST)
endif(KICAD_GOST)
if(KICAD_KEEPCASE)
add_definitions(-DKICAD_KEEPCASE)
endif(KICAD_KEEPCASE)
if(USE_WX_ZOOM)
add_definitions(-DUSE_WX_ZOOM)
endif(USE_WX_ZOOM)

View File

@ -169,6 +169,10 @@ Require on locale utf8 for build the KiCad with cyrillic fonts support.
-DKICAD_GOST=ON
Build the KiCad with russian GOST support.
-DKICAD_KEEPCASE=ON
Build the KiCad with no component name conversion to uppercase (if you want your
ADuC.../Si.../bq... components named as just so).
-DCMAKE_CXX_FLAGS=<some extra flags>
Extra flags for the c++ compiler for your system required.

View File

@ -169,7 +169,13 @@ public:
* @param aMakeUpperCase - Force entry names to upper case.
*/
void GetEntryNames( wxArrayString& aNames, bool aSort = true,
bool aMakeUpperCase = true );
bool aMakeUpperCase =
#ifndef KICAD_KEEPCASE
true
#else
false
#endif
);
/**
* Load string array with entry names matching name and/or key word.

View File

@ -35,7 +35,9 @@ wxString DataBaseGetName( WinEDA_DrawFrame* frame, wxString& Keys,
wxArrayString nameList;
wxString msg;
#ifndef KICAD_KEEPCASE
BufName.MakeUpper();
#endif
Keys.MakeUpper();
/* Review the list of libraries for counting. */

View File

@ -148,7 +148,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
{
wxString newname = chipnameTextCtrl->GetValue();
#ifndef KICAD_KEEPCASE
newname.MakeUpper();
#endif
newname.Replace( wxT( " " ), wxT( "_" ) );
if( newname.IsEmpty() )

View File

@ -124,7 +124,9 @@ SCH_COMPONENT* WinEDA_SchematicFrame::Load_Component( wxDC* DC,
return NULL;
}
#ifndef KICAD_KEEPCASE
Name.MakeUpper();
#endif
if( Name.GetChar( 0 ) == '=' )
{

View File

@ -497,7 +497,11 @@ lost!\n\nClear the current component from the screen?" ) ) )
return;
}
#ifndef KICAD_KEEPCASE
name = dlg.GetName().MakeUpper();
#else
name = dlg.GetName();
#endif
name.Replace( wxT( " " ), wxT( "_" ) );
/* Test if there a component with this name already. */