Commit 14f477f9 authored by plyatov's avatar plyatov

Added sorting by value or position in to the annotation window of eeschema...

Added sorting by value or position in to the annotation window of eeschema (Thanks for patch to Andrey Fedorushkov).
parent 21891584
......@@ -4,6 +4,11 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-June-14 UPDATE Igor Plyatov <plyatov@mail.ru>
================================================================================
+ eeschema
Added sorting by value or position in to the annotation window (Thanks for patch to Andrey Fedorushkov).
2007-June-13 RELEASE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+All:
......
......@@ -22,6 +22,7 @@ static int ExistUnit(CmpListStruct *Objet, int Unit,
/* Variable locales */
static bool AnnotProject = TRUE;
static bool SortByPosition = TRUE;
/**************************************/
......@@ -88,6 +89,7 @@ CmpListStruct * BaseListeCmp;
wxBusyCursor dummy;
AnnotProject = (m_AnnotProjetCtrl->GetSelection() == 0) ? TRUE : FALSE;
SortByPosition = (m_AnnotSortCmpCtrl->GetSelection() == 0) ? TRUE : FALSE;
/* If it is an annotation for all the components, reset previous annotation: */
if( m_AnnotNewCmpCtrl->GetSelection() == 0 ) DeleteAnnotation(event);
......@@ -245,6 +247,7 @@ EDA_LibComponentStruct *Entry;
BaseListeCmp[NbrCmp].m_PartsLocked = Entry->m_UnitSelectionLocked;
BaseListeCmp[NbrCmp].m_Sheet = NumSheet;
BaseListeCmp[NbrCmp].m_IsNew = FALSE;
BaseListeCmp[NbrCmp].m_Pos = DrawLibItem->m_Pos;
BaseListeCmp[NbrCmp].m_TimeStamp = DrawLibItem->m_TimeStamp;
if( DrawLibItem->m_Field[REFERENCE].m_Text.IsEmpty() )
DrawLibItem->m_Field[REFERENCE].m_Text = wxT("DefRef?");
......@@ -294,12 +297,19 @@ int AnnotTriComposant(CmpListStruct *Objet1, CmpListStruct *Objet2)
int ii;
ii = strnicmp( Objet1->m_TextRef, Objet2->m_TextRef, 32 );
if ( SortByPosition == TRUE ) {
if ( ii == 0 ) ii = Objet1->m_Sheet - Objet2->m_Sheet;
if ( ii == 0 ) ii = Objet1->m_Unit - Objet2->m_Unit;
if ( ii == 0 ) ii = Objet1->m_Pos.x - Objet2->m_Pos.x;
if ( ii == 0 ) ii = Objet1->m_Pos.y - Objet2->m_Pos.y;
} else {
if ( ii == 0 ) ii = strnicmp( Objet1->m_TextValue, Objet2->m_TextValue, 32 );
if ( ii == 0 ) ii = Objet1->m_Unit - Objet2->m_Unit;
if ( ii == 0 ) ii = Objet1->m_Sheet - Objet2->m_Sheet;
}
if ( ii == 0 ) ii = strnicmp( Objet1->m_TextValue, Objet2->m_TextValue, 32 );
if ( ii == 0 ) ii = Objet1->m_Unit - Objet2->m_Unit;
if ( ii == 0 ) ii = Objet1->m_Sheet - Objet2->m_Sheet;
if ( ii == 0 ) ii = Objet1->m_TimeStamp - Objet2->m_TimeStamp;
return(ii);
}
......
......@@ -129,6 +129,13 @@ void WinEDA_AnnotateFrame::CreateControls()
m_AnnotNewCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("select items:"), wxDefaultPosition, wxDefaultSize, 2, m_AnnotNewCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_AnnotNewCmpCtrl, 0, wxALIGN_LEFT|wxALL, 5);
wxString m_AnnotSortCmpCtrlStrings[] = {
_("by position"),
_("by value")
};
m_AnnotSortCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("sorting:"), wxDefaultPosition, wxDefaultSize, 2, m_AnnotSortCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
itemBoxSizer3->Add(m_AnnotSortCmpCtrl, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
......
......@@ -47,12 +47,13 @@
#define SYMBOL_WINEDA_ANNOTATEFRAME_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
#define SYMBOL_WINEDA_ANNOTATEFRAME_TITLE _("EESchema Annotation")
#define SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_ANNOTATEFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_ANNOTATEFRAME_SIZE wxSize(400, 500)
#define SYMBOL_WINEDA_ANNOTATEFRAME_POSITION wxDefaultPosition
#define ID_RADIOBOX 10001
#define ID_RADIOBOX1 10002
#define ID_ANNOTATE_CMP 10003
#define ID_DEANNOTATE_CMP 10004
#define ID_RADIOBOX2 10003
#define ID_ANNOTATE_CMP 10004
#define ID_DEANNOTATE_CMP 10005
////@end control identifiers
/*!
......@@ -111,6 +112,7 @@ public:
////@begin WinEDA_AnnotateFrame member variables
wxRadioBox* m_AnnotProjetCtrl;
wxRadioBox* m_AnnotNewCmpCtrl;
wxRadioBox* m_AnnotSortCmpCtrl;
////@end WinEDA_AnnotateFrame member variables
WinEDA_SchematicFrame * m_Parent;
......
......@@ -96,6 +96,7 @@ public:
char m_TextRef[32]; /* Reference ( hors numero ) */
int m_NumRef; /* Numero de reference */
int m_Flag; /* flag pour calculs internes */
wxPoint m_Pos; /* position components */
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment