Loading change_log.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ email address. +eeschema In complex hierarchies, multiples parts per packages now should work, without restrictions Update and use annotate_dialog.pjd to create annotate dialog 2008-Apr-15 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Loading eeschema/annotate.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -440,9 +440,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp ) } } wxLogDebug( wxT( "BreakReference(): %s number found: %d\n" ), BaseListeCmp[ii].m_TextRef, BaseListeCmp[ii].m_NumRef ); } } Loading Loading @@ -667,7 +664,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) if( NbOfCmp == 0 ) { wxBell(); return 0; } Loading @@ -675,7 +671,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) /* Second pass : create the list of components */ ListeCmp = AllocateCmpListStrct( NbOfCmp ); printf( "CheckAnnotate() listing all components:\n" ); if( !oneSheetOnly ) { ii = 0; Loading @@ -687,8 +682,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) else ListeComposants( ListeCmp, frame->GetSheet() ); printf( "CheckAnnotate() done:\n" ); qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct), AnnotateByValue ); /* Break full components reference in name (prefix) and number: example: Loading eeschema/annotate_dialog.cpp +184 −177 Original line number Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// // Name: annotate_dialog.cpp // Purpose: // Author: jean-pierre Charras // Modified by: Wayne Stambaugh // // Created: 05/02/2006 12:31:28 // Modified 02/21/2008 13:47:10 // Modified by: // Created: 16/04/2008 17:50:59 // RCS-ID: // Copyright: License GNU // Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "annotate_dialog.h" Loading @@ -28,6 +26,9 @@ #include "wx/wx.h" #endif ////@begin includes ////@end includes #include "fctsys.h" #include "common.h" #include "program.h" Loading @@ -40,6 +41,9 @@ extern void AnnotateComponents( WinEDA_SchematicFrame* parent, bool sortByPosition, bool resetAnnotation ); ////@begin XPM images ////@end XPM images /*! * WinEDA_AnnotateFrame type definition Loading @@ -47,37 +51,38 @@ extern void AnnotateComponents( WinEDA_SchematicFrame* parent, IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog ) /*! * WinEDA_AnnotateFrame event table definition */ BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog ) EVT_BUTTON( ID_CLEAR_ANNOTATION, WinEDA_AnnotateFrame::OnClearAnnotation ) EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApply ) EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancel ) ////@begin WinEDA_AnnotateFrame event table entries EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancelClick ) EVT_BUTTON( ID_CLEAR_ANNOTATION_CMP, WinEDA_AnnotateFrame::OnClearAnnotationCmpClick ) EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApplyClick ) ////@end WinEDA_AnnotateFrame event table entries END_EVENT_TABLE() /*! * WinEDA_AnnotateFrame constructors */ WinEDA_AnnotateFrame::WinEDA_AnnotateFrame() { m_rbEntireSchematic = NULL; m_cbResetAnnotation = NULL; m_rbSortByPosition = NULL; m_btnClear = NULL; Init(); } WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { m_Parent = parent; Init(); Create(parent, id, caption, pos, size, style); } Loading @@ -86,13 +91,9 @@ WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, * WinEDA_AnnotateFrame creator */ bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin WinEDA_AnnotateFrame creation SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); Loading @@ -102,182 +103,120 @@ bool WinEDA_AnnotateFrame::Create( wxWindow* parent, GetSizer()->SetSizeHints(this); } Centre(); ////@end WinEDA_AnnotateFrame creation return true; } /*! * Control creation for WinEDA_AnnotateFrame * WinEDA_AnnotateFrame destructor */ void WinEDA_AnnotateFrame::CreateControls() WinEDA_AnnotateFrame::~WinEDA_AnnotateFrame() { wxFont fontBold = this->GetFont(); fontBold.SetWeight(wxFONTWEIGHT_BOLD); wxBoxSizer* sizerTop = new wxBoxSizer( wxVERTICAL ); /* Sizer flags for setting up the spacing of the controls in the dialog * box. These eventually should be moved to a file with a header in * the common directory so all of the dialogs share the same layout * spacing */ /* Spacing for grouping labels in a dialog box. */ wxSizerFlags flagsLabelSpacing( 0 ); flagsLabelSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsLabelSpacing.Border( wxLEFT | wxTOP, 6 ); /* Spacing for grouping radio buttons inside the grouping sizer. */ wxSizerFlags flagsRadioButtonSpacing( 0 ); flagsRadioButtonSpacing.Align( wxALIGN_LEFT ); flagsRadioButtonSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 6 ); /* Spacing for the radio button sizer inside the group sizer. */ wxSizerFlags flagsRadioButtonSizerSpacing( 0 ); flagsRadioButtonSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsRadioButtonSizerSpacing.Border( wxLEFT, 20 ); /* Spacing for the vertical group sizers. */ wxSizerFlags flagsGroupSizerSpacing( 1 ); flagsGroupSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsGroupSizerSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 12 ); /* Spacing for dialog button sizer. */ wxSizerFlags flagsDialogButtonSizerSpacing( 0 ); flagsDialogButtonSizerSpacing.Border( wxALL, 12 ); /* Spacing for the dialog buttons. */ wxSizerFlags flagsDialogButtonSpacing( 0 ); flagsDialogButtonSpacing.Border( wxLEFT | wxRIGHT, 3 ); /* Annotate scope sizers, label, and radio buttons. */ wxBoxSizer* sizerAnnotate = new wxBoxSizer( wxVERTICAL ); wxStaticText* labelAnnotate = new wxStaticText( this, -1, _( "Scope" ) ); labelAnnotate->SetFont( fontBold ); sizerAnnotate->Add( labelAnnotate, flagsLabelSpacing ); wxBoxSizer* sizerAnnotateItems = new wxBoxSizer( wxVERTICAL ); m_rbEntireSchematic = new wxRadioButton( this, ID_ENTIRE_SCHEMATIC, _( "Annotate the &entire schematic" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); wxRadioButton* rbCurrentPage = new wxRadioButton( this, ID_CURRENT_PAGE, _( "Annotate the current &page only" ) ); m_rbEntireSchematic->SetValue( true ); m_cbResetAnnotation = new wxCheckBox( this, ID_RESET_ANNOTATION, _( "&Reset existing annotation" ) ); sizerAnnotateItems->Add( m_rbEntireSchematic, flagsRadioButtonSpacing ); sizerAnnotateItems->Add( rbCurrentPage, flagsRadioButtonSpacing ); sizerAnnotateItems->Add( m_cbResetAnnotation, flagsRadioButtonSpacing ); sizerAnnotate->Add( sizerAnnotateItems, flagsRadioButtonSizerSpacing ); sizerTop->Add( sizerAnnotate, flagsGroupSizerSpacing ); /* This is an ugly hack to make sure the focus is set correctly so the * escape key closes the dialog without requiring one of the controls * to be activated by the user first. This problem only occurs on the * GTK version of wxWidgets */ #ifdef __WXGTK__ m_rbEntireSchematic->SetFocus( ); #endif /* Annotation sort order sizers, label, and radio buttons. */ wxBoxSizer* sizerSort = new wxBoxSizer( wxVERTICAL ); wxStaticText* labelSort = new wxStaticText( this, wxID_ANY, _( "Order" ) ); labelSort->SetFont( fontBold ); sizerSort->Add( labelSort, flagsLabelSpacing ); wxBoxSizer* sizerSortItems = new wxBoxSizer( wxVERTICAL ); m_rbSortByPosition = new wxRadioButton( this, ID_SORT_BY_POSITION, _( "Sort components by p&osition" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); wxRadioButton* rbSortByValue = new wxRadioButton( this, ID_SORT_BY_VALUE, _( "Sort components by &value" ) ); sizerSortItems->Add( m_rbSortByPosition, flagsRadioButtonSpacing ); sizerSortItems->Add( rbSortByValue, flagsRadioButtonSpacing ); sizerSort->Add( sizerSortItems, flagsRadioButtonSizerSpacing ); sizerTop->Add( sizerSort, flagsGroupSizerSpacing ); /* Standard dialog buttons and sizer. */ wxBoxSizer* sizerDialogButtons = new wxBoxSizer( wxHORIZONTAL ); wxButton* btnClose = new wxButton( this, wxID_CANCEL, _("Close") ); /* TODO: Check if there is any existing annotation and enable/disable * the clear button accordingly. Probably should also enable/ * disable new components radio button if all of the components * are already annotated. Some low level work on the DrawSheetPath * class will need to be done to accomadate this. */ m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION, _("Clear Annotation") ); wxButton* btnApply = new wxButton( this, wxID_APPLY, _("Annotation") ); sizerDialogButtons->Add( btnClose, flagsDialogButtonSpacing ); sizerDialogButtons->Add( new wxBoxSizer( wxHORIZONTAL ), wxSizerFlags( 1 ).Expand( ) ); sizerDialogButtons->Add( m_btnClear, flagsDialogButtonSpacing ); sizerDialogButtons->Add( btnApply, flagsDialogButtonSpacing ); sizerTop->Add( sizerDialogButtons, flagsDialogButtonSizerSpacing ); SetSizer( sizerTop ); ////@begin WinEDA_AnnotateFrame destruction ////@end WinEDA_AnnotateFrame destruction } /*! * Should we show tooltips? * Member initialisation */ bool WinEDA_AnnotateFrame::ShowToolTips() void WinEDA_AnnotateFrame::Init() { return true; ////@begin WinEDA_AnnotateFrame member initialisation m_rbEntireSchematic = NULL; m_cbResetAnnotation = NULL; m_rbSortByPosition = NULL; rbSortByValue = NULL; sizerDialogButtons = NULL; m_btnClose = NULL; m_btnClear = NULL; m_btnApply = NULL; ////@end WinEDA_AnnotateFrame member initialisation } /*! * Get bitmap resources * Control creation for WinEDA_AnnotateFrame */ wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name ) void WinEDA_AnnotateFrame::CreateControls() { // Bitmap retrieval wxUnusedVar( name ); return wxNullBitmap; } ////@begin WinEDA_AnnotateFrame content construction // Generated by DialogBlocks, 16/04/2008 20:16:13 (unregistered) WinEDA_AnnotateFrame* itemDialog1 = this; /*! * Get icon resources */ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemDialog1->SetSizer(itemBoxSizer2); wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name ) { // Icon retrieval wxUnusedVar( name ); return wxNullIcon; } wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5); void WinEDA_AnnotateFrame::OnClearAnnotation( wxCommandEvent& event ) { int response; wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Scope"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText4->SetForegroundColour(wxColour(0, 128, 64)); itemStaticText4->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALL, 5); wxString message = _( "Clear the existing annotation for " ); if( GetLevel() ) message += _( "the entire schematic?" ); else message += _( "the current sheet?" ); wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer5, 0, wxGROW|wxLEFT, 25); message += _( "\n\nThis operation will clear the existing annotation " \ "and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_btnClear->Enable(false); m_rbEntireSchematic = new wxRadioButton( itemDialog1, ID_ENTIRE_SCHEMATIC, _("Annotate the &entire schematic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbEntireSchematic->SetValue(true); itemBoxSizer5->Add(m_rbEntireSchematic, 0, wxGROW|wxALL, 5); wxRadioButton* itemRadioButton7 = new wxRadioButton( itemDialog1, ID_CURRENT_PAGE, _("Annotate the current &page only"), wxDefaultPosition, wxDefaultSize, 0 ); itemRadioButton7->SetValue(false); itemBoxSizer5->Add(itemRadioButton7, 0, wxGROW|wxALL, 5); m_cbResetAnnotation = new wxCheckBox( itemDialog1, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbResetAnnotation->SetValue(false); m_cbResetAnnotation->SetForegroundColour(wxColour(217, 38, 52)); itemBoxSizer5->Add(m_cbResetAnnotation, 0, wxGROW|wxALL, 5); wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, wxID_STATIC, _("Order"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText9->SetForegroundColour(wxColour(125, 2, 12)); itemStaticText9->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); itemBoxSizer3->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALL, 5); wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer10, 0, wxGROW|wxLEFT, 25); m_rbSortByPosition = new wxRadioButton( itemDialog1, ID_SORT_BY_POSITION, _("Sort Components by &Y Position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbSortByPosition->SetValue(true); itemBoxSizer10->Add(m_rbSortByPosition, 0, wxGROW|wxALL, 5); rbSortByValue = new wxRadioButton( itemDialog1, ID_SORT_BY_VALUE, _("Sort Components by &Value"), wxDefaultPosition, wxDefaultSize, 0 ); rbSortByValue->SetValue(false); itemBoxSizer10->Add(rbSortByValue, 0, wxGROW|wxALL, 5); sizerDialogButtons = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(sizerDialogButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); m_btnClose = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnClose->SetDefault(); sizerDialogButtons->Add(m_btnClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_btnClear = new wxButton( itemDialog1, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnClear->SetForegroundColour(wxColour(0, 0, 230)); sizerDialogButtons->Add(m_btnClear, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_btnApply = new wxButton( itemDialog1, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnApply->SetDefault(); m_btnApply->SetForegroundColour(wxColour(198, 0, 0)); sizerDialogButtons->Add(m_btnApply, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); ////@end WinEDA_AnnotateFrame content construction } void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event ) /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY */ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event ) { int response; wxString message; Loading @@ -302,7 +241,37 @@ void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event ) m_btnClear->Enable(); } void WinEDA_AnnotateFrame::OnCancel( wxCommandEvent& event ) /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP */ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) { int response; wxString message = _( "Clear the existing annotation for " ); if( GetLevel() ) message += _( "the entire schematic?" ); else message += _( "the current sheet?" ); message += _( "\n\nThis operation will clear the existing annotation " \ "and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_btnClear->Enable(false); } /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */ void WinEDA_AnnotateFrame::OnCancelClick( wxCommandEvent& event ) { if( IsModal() ) EndModal( wxID_CANCEL ); Loading @@ -313,6 +282,7 @@ void WinEDA_AnnotateFrame::OnCancel( wxCommandEvent& event ) } } bool WinEDA_AnnotateFrame::GetLevel( void ) { wxASSERT_MSG( ((m_rbEntireSchematic != NULL) && Loading Loading @@ -342,3 +312,40 @@ bool WinEDA_AnnotateFrame::GetSortOrder( void ) return m_rbSortByPosition->GetValue(); } /*! * Should we show tooltips? */ bool WinEDA_AnnotateFrame::ShowToolTips() { return true; } /*! * Get bitmap resources */ wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_AnnotateFrame bitmap retrieval wxUnusedVar(name); return wxNullBitmap; ////@end WinEDA_AnnotateFrame bitmap retrieval } /*! * Get icon resources */ wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_AnnotateFrame icon retrieval wxUnusedVar(name); return wxNullIcon; ////@end WinEDA_AnnotateFrame icon retrieval } eeschema/annotate_dialog.h +68 −60 Original line number Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// // Name: annotate_dialog.h // Purpose: // Author: jean-pierre Charras // Modified by: // Created: 05/02/2006 12:31:28 // Created: 16/04/2008 17:50:59 // RCS-ID: // Copyright: License GNU // Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59 #ifndef _ANNOTATE_DIALOG_H_ #define _ANNOTATE_DIALOG_H_ Loading @@ -22,38 +22,36 @@ * Includes */ #include "fctsys.h" ////@begin includes ////@end includes #include "common.h" #include "program.h" #include "libcmp.h" #include "general.h" /*! * Forward declarations */ ////@begin forward declarations class wxBoxSizer; ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define ID_DIALOG 10000 #define ID_ENTIRE_SCHEMATIC 10001 #define ID_CURRENT_PAGE 10002 #define ID_RESET_ANNOTATION 10003 #define ID_SORT_BY_POSITION 10004 #define ID_SORT_BY_VALUE 10005 #define ID_CLEAR_ANNOTATION 10006 #define ANNOTATE_DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER #define ANNOTATE_DIALOG_TITLE _( "Annotate" ) /*! * Compatibility */ #define ID_ENTIRE_SCHEMATIC 10002 #define ID_CURRENT_PAGE 10003 #define ID_RESET_ANNOTATION 10009 #define ID_SORT_BY_POSITION 10010 #define ID_SORT_BY_VALUE 10011 #define ID_CLEAR_ANNOTATION_CMP 10004 #define SYMBOL_WINEDA_ANNOTATEFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER #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_POSITION wxDefaultPosition ////@end control identifiers #ifndef wxCLOSE_BOX #define wxCLOSE_BOX 0x1000 #endif /*! * WinEDA_AnnotateFrame class declaration Loading @@ -62,59 +60,69 @@ class WinEDA_AnnotateFrame: public wxDialog { DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame ) DECLARE_EVENT_TABLE() public: /// Constructors WinEDA_AnnotateFrame(); WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id = wxID_ANY, const wxString& caption = ANNOTATE_DIALOG_TITLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ANNOTATE_DIALOG_STYLE ); WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id = SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ANNOTATEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ANNOTATEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ANNOTATEFRAME_SIZE, long style = SYMBOL_WINEDA_ANNOTATEFRAME_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = ANNOTATE_DIALOG_TITLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ANNOTATE_DIALOG_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ANNOTATEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ANNOTATEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ANNOTATEFRAME_SIZE, long style = SYMBOL_WINEDA_ANNOTATEFRAME_STYLE ); /// Destructor ~WinEDA_AnnotateFrame(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); ////@begin WinEDA_AnnotateFrame event handler declarations /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL void OnCancelClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_ANNOTATION_CMP void OnClearAnnotationCmpClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY void OnApplyClick( wxCommandEvent& event ); ////@end WinEDA_AnnotateFrame event handler declarations ////@begin WinEDA_AnnotateFrame member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); bool GetLevel( void ); bool GetResetItems( void ); bool GetSortOrder( void ); ////@end WinEDA_AnnotateFrame member function declarations /// Should we show tooltips? static bool ShowToolTips(); WinEDA_SchematicFrame* m_Parent; private: void CloseDialog( void ); void OnClearAnnotation( wxCommandEvent& event ); void OnApply( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event ); // User functions: bool GetLevel( void ); bool GetResetItems( void ); bool GetSortOrder( void ); ////@begin WinEDA_AnnotateFrame member variables wxRadioButton* m_rbEntireSchematic; wxRadioButton* m_rbSortByPosition; wxCheckBox* m_cbResetAnnotation; wxRadioButton* m_rbSortByPosition; wxRadioButton* rbSortByValue; wxBoxSizer* sizerDialogButtons; wxButton* m_btnClose; wxButton* m_btnClear; wxButton* m_btnApply; ////@end WinEDA_AnnotateFrame member variables WinEDA_SchematicFrame * m_Parent; DECLARE_EVENT_TABLE() }; #endif // _ANNOTATE_DIALOG_H_ Loading
change_log.txt +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ email address. +eeschema In complex hierarchies, multiples parts per packages now should work, without restrictions Update and use annotate_dialog.pjd to create annotate dialog 2008-Apr-15 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> Loading
eeschema/annotate.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -440,9 +440,6 @@ void BreakReference( CmpListStruct* BaseListeCmp, int NbOfCmp ) } } wxLogDebug( wxT( "BreakReference(): %s number found: %d\n" ), BaseListeCmp[ii].m_TextRef, BaseListeCmp[ii].m_NumRef ); } } Loading Loading @@ -667,7 +664,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) if( NbOfCmp == 0 ) { wxBell(); return 0; } Loading @@ -675,7 +671,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) /* Second pass : create the list of components */ ListeCmp = AllocateCmpListStrct( NbOfCmp ); printf( "CheckAnnotate() listing all components:\n" ); if( !oneSheetOnly ) { ii = 0; Loading @@ -687,8 +682,6 @@ int CheckAnnotate( WinEDA_SchematicFrame* frame, bool oneSheetOnly ) else ListeComposants( ListeCmp, frame->GetSheet() ); printf( "CheckAnnotate() done:\n" ); qsort( ListeCmp, NbOfCmp, sizeof(CmpListStruct), AnnotateByValue ); /* Break full components reference in name (prefix) and number: example: Loading
eeschema/annotate_dialog.cpp +184 −177 Original line number Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// // Name: annotate_dialog.cpp // Purpose: // Author: jean-pierre Charras // Modified by: Wayne Stambaugh // // Created: 05/02/2006 12:31:28 // Modified 02/21/2008 13:47:10 // Modified by: // Created: 16/04/2008 17:50:59 // RCS-ID: // Copyright: License GNU // Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "annotate_dialog.h" Loading @@ -28,6 +26,9 @@ #include "wx/wx.h" #endif ////@begin includes ////@end includes #include "fctsys.h" #include "common.h" #include "program.h" Loading @@ -40,6 +41,9 @@ extern void AnnotateComponents( WinEDA_SchematicFrame* parent, bool sortByPosition, bool resetAnnotation ); ////@begin XPM images ////@end XPM images /*! * WinEDA_AnnotateFrame type definition Loading @@ -47,37 +51,38 @@ extern void AnnotateComponents( WinEDA_SchematicFrame* parent, IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog ) /*! * WinEDA_AnnotateFrame event table definition */ BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog ) EVT_BUTTON( ID_CLEAR_ANNOTATION, WinEDA_AnnotateFrame::OnClearAnnotation ) EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApply ) EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancel ) ////@begin WinEDA_AnnotateFrame event table entries EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancelClick ) EVT_BUTTON( ID_CLEAR_ANNOTATION_CMP, WinEDA_AnnotateFrame::OnClearAnnotationCmpClick ) EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApplyClick ) ////@end WinEDA_AnnotateFrame event table entries END_EVENT_TABLE() /*! * WinEDA_AnnotateFrame constructors */ WinEDA_AnnotateFrame::WinEDA_AnnotateFrame() { m_rbEntireSchematic = NULL; m_cbResetAnnotation = NULL; m_rbSortByPosition = NULL; m_btnClear = NULL; Init(); } WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { m_Parent = parent; Init(); Create(parent, id, caption, pos, size, style); } Loading @@ -86,13 +91,9 @@ WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, * WinEDA_AnnotateFrame creator */ bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin WinEDA_AnnotateFrame creation SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); Loading @@ -102,182 +103,120 @@ bool WinEDA_AnnotateFrame::Create( wxWindow* parent, GetSizer()->SetSizeHints(this); } Centre(); ////@end WinEDA_AnnotateFrame creation return true; } /*! * Control creation for WinEDA_AnnotateFrame * WinEDA_AnnotateFrame destructor */ void WinEDA_AnnotateFrame::CreateControls() WinEDA_AnnotateFrame::~WinEDA_AnnotateFrame() { wxFont fontBold = this->GetFont(); fontBold.SetWeight(wxFONTWEIGHT_BOLD); wxBoxSizer* sizerTop = new wxBoxSizer( wxVERTICAL ); /* Sizer flags for setting up the spacing of the controls in the dialog * box. These eventually should be moved to a file with a header in * the common directory so all of the dialogs share the same layout * spacing */ /* Spacing for grouping labels in a dialog box. */ wxSizerFlags flagsLabelSpacing( 0 ); flagsLabelSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsLabelSpacing.Border( wxLEFT | wxTOP, 6 ); /* Spacing for grouping radio buttons inside the grouping sizer. */ wxSizerFlags flagsRadioButtonSpacing( 0 ); flagsRadioButtonSpacing.Align( wxALIGN_LEFT ); flagsRadioButtonSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 6 ); /* Spacing for the radio button sizer inside the group sizer. */ wxSizerFlags flagsRadioButtonSizerSpacing( 0 ); flagsRadioButtonSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsRadioButtonSizerSpacing.Border( wxLEFT, 20 ); /* Spacing for the vertical group sizers. */ wxSizerFlags flagsGroupSizerSpacing( 1 ); flagsGroupSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT ); flagsGroupSizerSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 12 ); /* Spacing for dialog button sizer. */ wxSizerFlags flagsDialogButtonSizerSpacing( 0 ); flagsDialogButtonSizerSpacing.Border( wxALL, 12 ); /* Spacing for the dialog buttons. */ wxSizerFlags flagsDialogButtonSpacing( 0 ); flagsDialogButtonSpacing.Border( wxLEFT | wxRIGHT, 3 ); /* Annotate scope sizers, label, and radio buttons. */ wxBoxSizer* sizerAnnotate = new wxBoxSizer( wxVERTICAL ); wxStaticText* labelAnnotate = new wxStaticText( this, -1, _( "Scope" ) ); labelAnnotate->SetFont( fontBold ); sizerAnnotate->Add( labelAnnotate, flagsLabelSpacing ); wxBoxSizer* sizerAnnotateItems = new wxBoxSizer( wxVERTICAL ); m_rbEntireSchematic = new wxRadioButton( this, ID_ENTIRE_SCHEMATIC, _( "Annotate the &entire schematic" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); wxRadioButton* rbCurrentPage = new wxRadioButton( this, ID_CURRENT_PAGE, _( "Annotate the current &page only" ) ); m_rbEntireSchematic->SetValue( true ); m_cbResetAnnotation = new wxCheckBox( this, ID_RESET_ANNOTATION, _( "&Reset existing annotation" ) ); sizerAnnotateItems->Add( m_rbEntireSchematic, flagsRadioButtonSpacing ); sizerAnnotateItems->Add( rbCurrentPage, flagsRadioButtonSpacing ); sizerAnnotateItems->Add( m_cbResetAnnotation, flagsRadioButtonSpacing ); sizerAnnotate->Add( sizerAnnotateItems, flagsRadioButtonSizerSpacing ); sizerTop->Add( sizerAnnotate, flagsGroupSizerSpacing ); /* This is an ugly hack to make sure the focus is set correctly so the * escape key closes the dialog without requiring one of the controls * to be activated by the user first. This problem only occurs on the * GTK version of wxWidgets */ #ifdef __WXGTK__ m_rbEntireSchematic->SetFocus( ); #endif /* Annotation sort order sizers, label, and radio buttons. */ wxBoxSizer* sizerSort = new wxBoxSizer( wxVERTICAL ); wxStaticText* labelSort = new wxStaticText( this, wxID_ANY, _( "Order" ) ); labelSort->SetFont( fontBold ); sizerSort->Add( labelSort, flagsLabelSpacing ); wxBoxSizer* sizerSortItems = new wxBoxSizer( wxVERTICAL ); m_rbSortByPosition = new wxRadioButton( this, ID_SORT_BY_POSITION, _( "Sort components by p&osition" ), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); wxRadioButton* rbSortByValue = new wxRadioButton( this, ID_SORT_BY_VALUE, _( "Sort components by &value" ) ); sizerSortItems->Add( m_rbSortByPosition, flagsRadioButtonSpacing ); sizerSortItems->Add( rbSortByValue, flagsRadioButtonSpacing ); sizerSort->Add( sizerSortItems, flagsRadioButtonSizerSpacing ); sizerTop->Add( sizerSort, flagsGroupSizerSpacing ); /* Standard dialog buttons and sizer. */ wxBoxSizer* sizerDialogButtons = new wxBoxSizer( wxHORIZONTAL ); wxButton* btnClose = new wxButton( this, wxID_CANCEL, _("Close") ); /* TODO: Check if there is any existing annotation and enable/disable * the clear button accordingly. Probably should also enable/ * disable new components radio button if all of the components * are already annotated. Some low level work on the DrawSheetPath * class will need to be done to accomadate this. */ m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION, _("Clear Annotation") ); wxButton* btnApply = new wxButton( this, wxID_APPLY, _("Annotation") ); sizerDialogButtons->Add( btnClose, flagsDialogButtonSpacing ); sizerDialogButtons->Add( new wxBoxSizer( wxHORIZONTAL ), wxSizerFlags( 1 ).Expand( ) ); sizerDialogButtons->Add( m_btnClear, flagsDialogButtonSpacing ); sizerDialogButtons->Add( btnApply, flagsDialogButtonSpacing ); sizerTop->Add( sizerDialogButtons, flagsDialogButtonSizerSpacing ); SetSizer( sizerTop ); ////@begin WinEDA_AnnotateFrame destruction ////@end WinEDA_AnnotateFrame destruction } /*! * Should we show tooltips? * Member initialisation */ bool WinEDA_AnnotateFrame::ShowToolTips() void WinEDA_AnnotateFrame::Init() { return true; ////@begin WinEDA_AnnotateFrame member initialisation m_rbEntireSchematic = NULL; m_cbResetAnnotation = NULL; m_rbSortByPosition = NULL; rbSortByValue = NULL; sizerDialogButtons = NULL; m_btnClose = NULL; m_btnClear = NULL; m_btnApply = NULL; ////@end WinEDA_AnnotateFrame member initialisation } /*! * Get bitmap resources * Control creation for WinEDA_AnnotateFrame */ wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name ) void WinEDA_AnnotateFrame::CreateControls() { // Bitmap retrieval wxUnusedVar( name ); return wxNullBitmap; } ////@begin WinEDA_AnnotateFrame content construction // Generated by DialogBlocks, 16/04/2008 20:16:13 (unregistered) WinEDA_AnnotateFrame* itemDialog1 = this; /*! * Get icon resources */ wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemDialog1->SetSizer(itemBoxSizer2); wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name ) { // Icon retrieval wxUnusedVar( name ); return wxNullIcon; } wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL); itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxRIGHT|wxTOP|wxBOTTOM, 5); void WinEDA_AnnotateFrame::OnClearAnnotation( wxCommandEvent& event ) { int response; wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Scope"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText4->SetForegroundColour(wxColour(0, 128, 64)); itemStaticText4->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALL, 5); wxString message = _( "Clear the existing annotation for " ); if( GetLevel() ) message += _( "the entire schematic?" ); else message += _( "the current sheet?" ); wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer5, 0, wxGROW|wxLEFT, 25); message += _( "\n\nThis operation will clear the existing annotation " \ "and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_btnClear->Enable(false); m_rbEntireSchematic = new wxRadioButton( itemDialog1, ID_ENTIRE_SCHEMATIC, _("Annotate the &entire schematic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbEntireSchematic->SetValue(true); itemBoxSizer5->Add(m_rbEntireSchematic, 0, wxGROW|wxALL, 5); wxRadioButton* itemRadioButton7 = new wxRadioButton( itemDialog1, ID_CURRENT_PAGE, _("Annotate the current &page only"), wxDefaultPosition, wxDefaultSize, 0 ); itemRadioButton7->SetValue(false); itemBoxSizer5->Add(itemRadioButton7, 0, wxGROW|wxALL, 5); m_cbResetAnnotation = new wxCheckBox( itemDialog1, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbResetAnnotation->SetValue(false); m_cbResetAnnotation->SetForegroundColour(wxColour(217, 38, 52)); itemBoxSizer5->Add(m_cbResetAnnotation, 0, wxGROW|wxALL, 5); wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, wxID_STATIC, _("Order"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText9->SetForegroundColour(wxColour(125, 2, 12)); itemStaticText9->SetFont(wxFont(8, wxSWISS, wxNORMAL, wxBOLD, false, wxT("Tahoma"))); itemBoxSizer3->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALL, 5); wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer10, 0, wxGROW|wxLEFT, 25); m_rbSortByPosition = new wxRadioButton( itemDialog1, ID_SORT_BY_POSITION, _("Sort Components by &Y Position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_rbSortByPosition->SetValue(true); itemBoxSizer10->Add(m_rbSortByPosition, 0, wxGROW|wxALL, 5); rbSortByValue = new wxRadioButton( itemDialog1, ID_SORT_BY_VALUE, _("Sort Components by &Value"), wxDefaultPosition, wxDefaultSize, 0 ); rbSortByValue->SetValue(false); itemBoxSizer10->Add(rbSortByValue, 0, wxGROW|wxALL, 5); sizerDialogButtons = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(sizerDialogButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); m_btnClose = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnClose->SetDefault(); sizerDialogButtons->Add(m_btnClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_btnClear = new wxButton( itemDialog1, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnClear->SetForegroundColour(wxColour(0, 0, 230)); sizerDialogButtons->Add(m_btnClear, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_btnApply = new wxButton( itemDialog1, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnApply->SetDefault(); m_btnApply->SetForegroundColour(wxColour(198, 0, 0)); sizerDialogButtons->Add(m_btnApply, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); ////@end WinEDA_AnnotateFrame content construction } void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event ) /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY */ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event ) { int response; wxString message; Loading @@ -302,7 +241,37 @@ void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event ) m_btnClear->Enable(); } void WinEDA_AnnotateFrame::OnCancel( wxCommandEvent& event ) /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP */ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event ) { int response; wxString message = _( "Clear the existing annotation for " ); if( GetLevel() ) message += _( "the entire schematic?" ); else message += _( "the current sheet?" ); message += _( "\n\nThis operation will clear the existing annotation " \ "and cannot be undone." ); response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL ); if (response == wxCANCEL) return; DeleteAnnotation( m_Parent, GetLevel() ); m_btnClear->Enable(false); } /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */ void WinEDA_AnnotateFrame::OnCancelClick( wxCommandEvent& event ) { if( IsModal() ) EndModal( wxID_CANCEL ); Loading @@ -313,6 +282,7 @@ void WinEDA_AnnotateFrame::OnCancel( wxCommandEvent& event ) } } bool WinEDA_AnnotateFrame::GetLevel( void ) { wxASSERT_MSG( ((m_rbEntireSchematic != NULL) && Loading Loading @@ -342,3 +312,40 @@ bool WinEDA_AnnotateFrame::GetSortOrder( void ) return m_rbSortByPosition->GetValue(); } /*! * Should we show tooltips? */ bool WinEDA_AnnotateFrame::ShowToolTips() { return true; } /*! * Get bitmap resources */ wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_AnnotateFrame bitmap retrieval wxUnusedVar(name); return wxNullBitmap; ////@end WinEDA_AnnotateFrame bitmap retrieval } /*! * Get icon resources */ wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_AnnotateFrame icon retrieval wxUnusedVar(name); return wxNullIcon; ////@end WinEDA_AnnotateFrame icon retrieval }
eeschema/annotate_dialog.h +68 −60 Original line number Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// // Name: annotate_dialog.h // Purpose: // Author: jean-pierre Charras // Modified by: // Created: 05/02/2006 12:31:28 // Created: 16/04/2008 17:50:59 // RCS-ID: // Copyright: License GNU // Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59 #ifndef _ANNOTATE_DIALOG_H_ #define _ANNOTATE_DIALOG_H_ Loading @@ -22,38 +22,36 @@ * Includes */ #include "fctsys.h" ////@begin includes ////@end includes #include "common.h" #include "program.h" #include "libcmp.h" #include "general.h" /*! * Forward declarations */ ////@begin forward declarations class wxBoxSizer; ////@end forward declarations /*! * Control identifiers */ ////@begin control identifiers #define ID_DIALOG 10000 #define ID_ENTIRE_SCHEMATIC 10001 #define ID_CURRENT_PAGE 10002 #define ID_RESET_ANNOTATION 10003 #define ID_SORT_BY_POSITION 10004 #define ID_SORT_BY_VALUE 10005 #define ID_CLEAR_ANNOTATION 10006 #define ANNOTATE_DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER #define ANNOTATE_DIALOG_TITLE _( "Annotate" ) /*! * Compatibility */ #define ID_ENTIRE_SCHEMATIC 10002 #define ID_CURRENT_PAGE 10003 #define ID_RESET_ANNOTATION 10009 #define ID_SORT_BY_POSITION 10010 #define ID_SORT_BY_VALUE 10011 #define ID_CLEAR_ANNOTATION_CMP 10004 #define SYMBOL_WINEDA_ANNOTATEFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER #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_POSITION wxDefaultPosition ////@end control identifiers #ifndef wxCLOSE_BOX #define wxCLOSE_BOX 0x1000 #endif /*! * WinEDA_AnnotateFrame class declaration Loading @@ -62,59 +60,69 @@ class WinEDA_AnnotateFrame: public wxDialog { DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame ) DECLARE_EVENT_TABLE() public: /// Constructors WinEDA_AnnotateFrame(); WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id = wxID_ANY, const wxString& caption = ANNOTATE_DIALOG_TITLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ANNOTATE_DIALOG_STYLE ); WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id = SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ANNOTATEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ANNOTATEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ANNOTATEFRAME_SIZE, long style = SYMBOL_WINEDA_ANNOTATEFRAME_STYLE ); /// Creation bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = ANNOTATE_DIALOG_TITLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ANNOTATE_DIALOG_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ANNOTATEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ANNOTATEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ANNOTATEFRAME_SIZE, long style = SYMBOL_WINEDA_ANNOTATEFRAME_STYLE ); /// Destructor ~WinEDA_AnnotateFrame(); /// Initialises member variables void Init(); /// Creates the controls and sizers void CreateControls(); ////@begin WinEDA_AnnotateFrame event handler declarations /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL void OnCancelClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_ANNOTATION_CMP void OnClearAnnotationCmpClick( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY void OnApplyClick( wxCommandEvent& event ); ////@end WinEDA_AnnotateFrame event handler declarations ////@begin WinEDA_AnnotateFrame member function declarations /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); /// Retrieves icon resources wxIcon GetIconResource( const wxString& name ); bool GetLevel( void ); bool GetResetItems( void ); bool GetSortOrder( void ); ////@end WinEDA_AnnotateFrame member function declarations /// Should we show tooltips? static bool ShowToolTips(); WinEDA_SchematicFrame* m_Parent; private: void CloseDialog( void ); void OnClearAnnotation( wxCommandEvent& event ); void OnApply( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event ); // User functions: bool GetLevel( void ); bool GetResetItems( void ); bool GetSortOrder( void ); ////@begin WinEDA_AnnotateFrame member variables wxRadioButton* m_rbEntireSchematic; wxRadioButton* m_rbSortByPosition; wxCheckBox* m_cbResetAnnotation; wxRadioButton* m_rbSortByPosition; wxRadioButton* rbSortByValue; wxBoxSizer* sizerDialogButtons; wxButton* m_btnClose; wxButton* m_btnClear; wxButton* m_btnApply; ////@end WinEDA_AnnotateFrame member variables WinEDA_SchematicFrame * m_Parent; DECLARE_EVENT_TABLE() }; #endif // _ANNOTATE_DIALOG_H_