change best zoom calculation in viewlib. Minor others changes and fixes.

This commit is contained in:
charras 2008-12-08 18:56:43 +00:00
parent 2611a54791
commit 6e80810b87
6 changed files with 2378 additions and 2378 deletions

View File

@ -13,11 +13,9 @@
int ReadDelimitedText( char* dest, char* source, int NbMaxChar ) int ReadDelimitedText( char* dest, char* source, int NbMaxChar )
/*********************************************************************/ /*********************************************************************/
/* lit et place dans dest la chaine de caractere trouvee dans source, /* read a double-qute delimited text in source and put in in dest,
* delimitee par " . * read NbMaxChar bytes max
* transfere NbMaxChar max * return the byte count read in source
* retourne le nombre de codes lus dans source
* dest est termine par NULL
*/ */
{ {
int ii, jj, flag = 0; int ii, jj, flag = 0;
@ -47,8 +45,8 @@ int ReadDelimitedText( char* dest, char* source, int NbMaxChar )
char* StrPurge( char* text ) char* StrPurge( char* text )
/********************************/ /********************************/
/* Remove training space in text /* Remove training spaces in text
* return a pointer on the first not space char in text * return a pointer on the first non space char in text
*/ */
{ {
char* ptspace; char* ptspace;
@ -113,7 +111,7 @@ char* DateAndTime( char* aBuffer )
wxString DateAndTime() wxString DateAndTime()
/*******************************/ /*******************************/
/* return a wxString filled with the date and time /* return the date and time in a wxString
* note: does the same thing than strftime() * note: does the same thing than strftime()
* time is the local time. * time is the local time.
*/ */
@ -248,12 +246,10 @@ bool WildCompareString( const wxString& pattern, const wxString& string_to_tst,
bool case_sensitive ) bool case_sensitive )
/***********************************************************************/ /***********************************************************************/
/* compare 2 noms de composants, selon regles usuelles /* compare a string to a pattern
* ( Jokers * , ? , autorisés). * ( usual chars * and ? allowed).
* la chaine de reference est "pattern" * if case_sensitive == true, comparison is case sensitive
* si case_sensitive == TRUE, comparaison exacte * return true if match else false
* retourne TRUE si match
* retourne FALSE si differences
*/ */
{ {
const wxChar* cp = NULL, * mp = NULL; const wxChar* cp = NULL, * mp = NULL;

View File

@ -91,18 +91,17 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist()
wxString schematic_timestamp; /* buffer for component time stamp */ wxString schematic_timestamp; /* buffer for component time stamp */
wxString footprint_name; /* buffer for component footprint field */ wxString footprint_name; /* buffer for component footprint field */
wxString component_value; /* buffer for component values (470K, 22nF ...) */ wxString component_value; /* buffer for component values (470K, 22nF ...) */
char* ptchar; /* pointeur de service */ char* ptchar;
STORECMP* Cmp; STORECMP* Cmp;
modified = 0; modified = 0;
Rjustify = 0; Rjustify = 0;
g_FlagEESchema = FALSE; g_FlagEESchema = FALSE;
/* Raz buffer et variable de gestion */ /* Clear components buffer */
if( g_BaseListeCmp ) if( g_BaseListeCmp )
FreeMemoryComponants(); FreeMemoryComponants();
/* Ouverture du fichier source */
source = wxFopen( FFileName, wxT( "rt" ) ); source = wxFopen( FFileName, wxT( "rt" ) );
if( source == 0 ) if( source == 0 )
{ {
@ -437,7 +436,7 @@ int CmpCompare( void* mod1, void* mod2 )
/****************************************/ /****************************************/
/* /*
* Function compare() for qsort() : alphabetic sorting, with numbering order * Compare function for qsort() : alphabetic sorting, with numbering order
*/ */
{ {
int ii; int ii;
@ -446,7 +445,6 @@ int CmpCompare( void* mod1, void* mod2 )
pt1 = *( (STORECMP**) mod1 ); pt1 = *( (STORECMP**) mod1 );
pt2 = *( (STORECMP**) mod2 ); pt2 = *( (STORECMP**) mod2 );
//FIXME: ii = StrNumICmp( pt1->m_Reference.GetData(), pt2->m_Reference.GetData() );
ii = StrNumICmp( (const wxChar*) pt1->m_Reference, (const wxChar*) pt2->m_Reference );
return ii; return ii;
} }

View File

@ -265,11 +265,10 @@ int WinEDA_LibeditFrame::BestZoom()
} }
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
size.x -= 60; // Pour marges haut et bas size -= wxSize(100,100); // reserve 100 mils margin
ii = abs( dx / size.x ); ii = abs( dx / size.x );
jj = abs( dy / size.y ); jj = abs( dy / size.y );
/* determination du zoom existant le plus proche */
bestzoom = MAX( ii, jj ) + 1; bestzoom = MAX( ii, jj ) + 1;
if( CurrentLibEntry ) if( CurrentLibEntry )

View File

@ -194,10 +194,10 @@ int WinEDA_ViewlibFrame::BestZoom()
itemsize = BoundaryBox.GetSize(); itemsize = BoundaryBox.GetSize();
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
size.x -= 60; // sub a margin size -= wxSize( 100, 100 ); // reserve a 100 mils margin
ii = itemsize.x / size.x; ii = (double) itemsize.x / size.x;
jj = itemsize.y / size.y; jj = itemsize.y / size.y;
bestzoom = MAX( ii, jj ); bestzoom = MAX( ii, jj ) + 1;
GetScreen()->m_Curseur = BoundaryBox.Centre(); GetScreen()->m_Curseur = BoundaryBox.Centre();
@ -207,7 +207,7 @@ int WinEDA_ViewlibFrame::BestZoom()
/******************************************/ /******************************************/
void WinEDA_ViewlibFrame::ReCreateListLib() void WinEDA_ViewlibFrame::ReCreateListLib()
/*******************************************/ /******************************************/
{ {
const wxChar** ListNames, ** names; const wxChar** ListNames, ** names;
int ii; int ii;

Binary file not shown.

File diff suppressed because it is too large Load Diff