Commit df7e6f37 authored by stambaughw's avatar stambaughw
Browse files

annotate dialog HIGification, refactor and beautify associated

annotation code
parent d2fe629b
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2008-Feb-25 UPDATE   Wayne Stambaugh <stambaughw{at}verizon{dot}net>
================================================================================
+eeschema
  * converted annotate_dialog layout to Gnome HIG per UIPolicy.txt factor
    out dialog code from annotate.cpp.
  * refactor and uncrustify schframe.cpp and schedit.cpp
  * modify eeschema CMakeList.txt to reflect code changes.



2008-Feb-22 UPDATE   Dick Hollenbeck <dick@softplc.com>
2008-Feb-22 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+1 −1
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(
SET(EESCHEMA_SRCS
SET(EESCHEMA_SRCS
    affiche.cpp
    affiche.cpp
    annotate.cpp
    annotate.cpp
#   annotate_dialog.cpp
    annotate_dialog.cpp
    block.cpp
    block.cpp
    block_libedit.cpp
    block_libedit.cpp
    busentry.cpp
    busentry.cpp
+293 −306

File changed.

Preview size limit exceeded, changes collapsed.

+211 −112
Original line number Original line Diff line number Diff line
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

// Name:        annotate_dialog.cpp
// Name:        annotate_dialog.cpp
// Purpose:
// Purpose:
// Author:      jean-pierre Charras
// Author:      jean-pierre Charras
// Modified by: 
// Modified by: Wayne Stambaugh
//
// Created:     05/02/2006 12:31:28
// Created:     05/02/2006 12:31:28
// Modified     02/21/2008 13:47:10
// RCS-ID:
// RCS-ID:
// Copyright:   License GNU
// Copyright:   License GNU
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////


// Generated by DialogBlocks (unregistered), 05/02/2006 12:31:28


#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#pragma implementation "annotate_dialog.h"
#pragma implementation "annotate_dialog.h"
@@ -26,13 +28,15 @@
#include "wx/wx.h"
#include "wx/wx.h"
#endif
#endif


////@begin includes
////@end includes

#include "annotate_dialog.h"
#include "annotate_dialog.h"


////@begin XPM images
extern void DeleteAnnotation( WinEDA_SchematicFrame* parent,
////@end XPM images
                              bool annotateSchematic );
extern void AnnotateComponents( WinEDA_SchematicFrame* parent,
                                bool annotateSchematic,
                                bool sortByPosition,
                                bool resetAnnotation );



/*!
/*!
 * WinEDA_AnnotateFrame type definition
 * WinEDA_AnnotateFrame type definition
@@ -45,16 +49,8 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog )
 */
 */


BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog )

    EVT_BUTTON( wxID_CLEAR, WinEDA_AnnotateFrame::OnClear )
////@begin WinEDA_AnnotateFrame event table entries
    EVT_BUTTON( wxID_APPLY, WinEDA_AnnotateFrame::OnApply )
    EVT_BUTTON( ID_ANNOTATE_CMP, WinEDA_AnnotateFrame::OnAnnotateCmpClick )

    EVT_BUTTON( ID_DEANNOTATE_CMP, WinEDA_AnnotateFrame::OnDeannotateCmpClick )

    EVT_BUTTON( wxID_CANCEL, WinEDA_AnnotateFrame::OnCancelClick )

////@end WinEDA_AnnotateFrame event table entries

END_EVENT_TABLE()
END_EVENT_TABLE()


/*!
/*!
@@ -63,29 +59,36 @@ END_EVENT_TABLE()


WinEDA_AnnotateFrame::WinEDA_AnnotateFrame()
WinEDA_AnnotateFrame::WinEDA_AnnotateFrame()
{
{
    m_rbEntireSchematic = NULL;
    m_cbResetAnnotation = NULL;
    m_rbSortByPosition = NULL;
    m_btnClear = NULL;
}
}


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;
    m_Parent = parent;
	m_Abort = FALSE;
    Create( parent, id, caption, pos, size, style );
    Create( parent, id, caption, pos, size, style );
	m_AnnotNewCmpCtrl->SetSelection(1);
}
}



/*!
/*!
 * WinEDA_AnnotateFrame creator
 * 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 member initialisation
    m_AnnotProjetCtrl = NULL;
    m_AnnotNewCmpCtrl = NULL;
    m_AnnotSortCmpCtrl = NULL;
////@end WinEDA_AnnotateFrame member initialisation

////@begin WinEDA_AnnotateFrame creation
    SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
    SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
    wxDialog::Create( parent, id, caption, pos, size, style );
    wxDialog::Create( parent, id, caption, pos, size, style );


@@ -95,70 +98,121 @@ bool WinEDA_AnnotateFrame::Create( wxWindow* parent, wxWindowID id, const wxStri
        GetSizer()->SetSizeHints( this );
        GetSizer()->SetSizeHints( this );
    }
    }
    Centre();
    Centre();
////@end WinEDA_AnnotateFrame creation

    return true;
    return true;
}
}



/*!
/*!
 * Control creation for WinEDA_AnnotateFrame
 * Control creation for WinEDA_AnnotateFrame
 */
 */


void WinEDA_AnnotateFrame::CreateControls()
void WinEDA_AnnotateFrame::CreateControls()
{
{
	SetFont(*g_DialogFont);
    wxFont fontBold = this->GetFont();

    fontBold.SetWeight(wxFONTWEIGHT_BOLD);
////@begin WinEDA_AnnotateFrame content construction

    // Generated by DialogBlocks, 07/11/2007 08:19:55 (unregistered)
    wxBoxSizer* sizerTop = new wxBoxSizer( wxVERTICAL );


    WinEDA_AnnotateFrame* itemDialog1 = this;
    /* 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
    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
     * the common directory so all of the dialogs share the same layout
    itemDialog1->SetSizer(itemBoxSizer2);
     * spacing */


    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    /* Spacing for grouping labels in a dialog box. */
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
    wxSizerFlags flagsLabelSpacing( 0 );

    flagsLabelSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT );
    wxArrayString m_AnnotProjetCtrlStrings;
    flagsLabelSpacing.Border( wxLEFT | wxTOP, 6 );
    m_AnnotProjetCtrlStrings.Add(_("Hierarchy"));

    m_AnnotProjetCtrlStrings.Add(_("Current sheet"));
    /* Spacing for grouping radio buttons inside the grouping sizer. */
    m_AnnotProjetCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX, _("annotate:"), wxDefaultPosition, wxDefaultSize, m_AnnotProjetCtrlStrings, 1, wxRA_SPECIFY_COLS );
    wxSizerFlags flagsRadioButtonSpacing( 0 );
    m_AnnotProjetCtrl->SetSelection(0);
    flagsRadioButtonSpacing.Align( wxALIGN_LEFT );
    itemBoxSizer3->Add(m_AnnotProjetCtrl, 0, wxGROW|wxALL, 5);
    flagsRadioButtonSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 6 );


    wxArrayString m_AnnotNewCmpCtrlStrings;
    /* Spacing for the radio button sizer inside the group sizer. */
    m_AnnotNewCmpCtrlStrings.Add(_("all components"));
    wxSizerFlags flagsRadioButtonSizerSpacing( 0 );
    m_AnnotNewCmpCtrlStrings.Add(_("new components only"));
    flagsRadioButtonSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT );
    m_AnnotNewCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX1, _("select items:"), wxDefaultPosition, wxDefaultSize, m_AnnotNewCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
    flagsRadioButtonSizerSpacing.Border( wxLEFT, 20 );
    m_AnnotNewCmpCtrl->SetSelection(0);

    itemBoxSizer3->Add(m_AnnotNewCmpCtrl, 0, wxGROW|wxALL, 5);
    /* Spacing for the vertical group sizers. */

    wxSizerFlags flagsGroupSizerSpacing( 1 );
    wxArrayString m_AnnotSortCmpCtrlStrings;
    flagsGroupSizerSpacing.Align( wxALIGN_TOP | wxALIGN_LEFT );
    m_AnnotSortCmpCtrlStrings.Add(_("by position"));
    flagsGroupSizerSpacing.Border( wxTOP | wxLEFT | wxRIGHT, 12 );
    m_AnnotSortCmpCtrlStrings.Add(_("by value"));

    m_AnnotSortCmpCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX2, _("sorting:"), wxDefaultPosition, wxDefaultSize, m_AnnotSortCmpCtrlStrings, 1, wxRA_SPECIFY_COLS );
    /* Spacing for dialog button sizer. */
    m_AnnotSortCmpCtrl->SetSelection(0);
    wxSizerFlags flagsDialogButtonSizerSpacing( 0 );
    itemBoxSizer3->Add(m_AnnotSortCmpCtrl, 0, wxGROW|wxALL, 5);
    flagsDialogButtonSizerSpacing.Border( wxALL, 12 );


    wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
    /* Spacing for the dialog buttons. */
    itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
    wxSizerFlags flagsDialogButtonSpacing( 0 );

    flagsDialogButtonSpacing.Border( wxLEFT | wxRIGHT, 3 );
    wxButton* itemButton8 = new wxButton( itemDialog1, ID_ANNOTATE_CMP, _("&Annotate"), wxDefaultPosition, wxDefaultSize, 0 );

    itemButton8->SetDefault();
    /* Annotate scope sizers, label, and radio buttons. */
    itemButton8->SetForegroundColour(wxColour(198, 0, 0));
    wxBoxSizer* sizerAnnotate = new wxBoxSizer( wxVERTICAL );
    itemBoxSizer7->Add(itemButton8, 0, wxGROW|wxALL, 5);
    wxStaticText* labelAnnotate = new wxStaticText( this, -1,

                                                    _( "Scope" ) );
    wxButton* itemButton9 = new wxButton( itemDialog1, ID_DEANNOTATE_CMP, _("&Del Annotate"), wxDefaultPosition, wxDefaultSize, 0 );
    labelAnnotate->SetFont( fontBold );
    itemButton9->SetForegroundColour(wxColour(0, 0, 230));
    sizerAnnotate->Add( labelAnnotate, flagsLabelSpacing );
    itemBoxSizer7->Add(itemButton9, 0, wxGROW|wxALL, 5);
    wxBoxSizer* sizerAnnotateItems = new wxBoxSizer( wxVERTICAL );

    m_rbEntireSchematic =
    wxButton* itemButton10 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
        new wxRadioButton( this, ID_ENTIRE_SCHEMATIC,
    itemBoxSizer7->Add(itemButton10, 0, wxGROW|wxALL, 5);
                           _( "Annotate the entire schematic" ),

                           wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
////@end WinEDA_AnnotateFrame content construction
    wxRadioButton* rbCurrentPage =

        new wxRadioButton( this, ID_CURRENT_PAGE,
	m_AnnotSortCmpCtrl->SetSelection(SortByPosition ? 0 : 1);
                           _( "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 );

    /* 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 position" ),
                                            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 DrawSheetList
     *       class will need to be done to accomadate this.
     */
    m_btnClear = new wxButton( this, wxID_CLEAR );
    wxButton* btnApply = new wxButton( this, wxID_APPLY );
    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 );
}
}



/*!
/*!
 * Should we show tooltips?
 * Should we show tooltips?
 */
 */
@@ -168,6 +222,7 @@ bool WinEDA_AnnotateFrame::ShowToolTips()
    return true;
    return true;
}
}



/*!
/*!
 * Get bitmap resources
 * Get bitmap resources
 */
 */
@@ -175,12 +230,11 @@ bool WinEDA_AnnotateFrame::ShowToolTips()
wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name )
wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name )
{
{
    // Bitmap retrieval
    // Bitmap retrieval
////@begin WinEDA_AnnotateFrame bitmap retrieval
    wxUnusedVar( name );
    wxUnusedVar( name );
    return wxNullBitmap;
    return wxNullBitmap;
////@end WinEDA_AnnotateFrame bitmap retrieval
}
}



/*!
/*!
 * Get icon resources
 * Get icon resources
 */
 */
@@ -188,34 +242,79 @@ wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name )
wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name )
wxIcon WinEDA_AnnotateFrame::GetIconResource( const wxString& name )
{
{
    // Icon retrieval
    // Icon retrieval
////@begin WinEDA_AnnotateFrame icon retrieval
    wxUnusedVar( name );
    wxUnusedVar( name );
    return wxNullIcon;
    return wxNullIcon;
////@end WinEDA_AnnotateFrame icon retrieval
}
}
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ANNOTATE_CMP
 */


void WinEDA_AnnotateFrame::OnAnnotateCmpClick( wxCommandEvent& event )
void WinEDA_AnnotateFrame::OnClear( wxCommandEvent& event )
{
{
	AnnotateComponents(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, _( "" ),
                             wxICON_EXCLAMATION | wxOK | wxCANCEL );
    if (response == wxCANCEL)
        return;
    DeleteAnnotation( m_Parent, GetLevel() );
    m_btnClear->Enable(false);
}
}


/*!
void WinEDA_AnnotateFrame::OnApply( wxCommandEvent& event )
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP
{
 */
    int response;
    wxButton* btn;
    wxString message;

    if( GetResetItems() )
        message = _( "Clear and annotate all of the components " );
    else
        message = _( "Annotate only the unannotated components " );
    if( GetLevel() )
        message += _( "on the entire schematic?" );
    else
        message += _( "on the current sheet?" );

    message += _( "\n\nThis operation will change the current annotation and " \
                  "cannot be undone." );
    response = wxMessageBox( message, _( "" ),
                             wxICON_EXCLAMATION | wxOK | wxCANCEL );
    if (response == wxCANCEL)
        return;
    AnnotateComponents( m_Parent, GetLevel(), GetSortOrder(),
                        GetResetItems() );
    m_btnClear->Enable();
}


void WinEDA_AnnotateFrame::OnDeannotateCmpClick( wxCommandEvent& event )
bool WinEDA_AnnotateFrame::GetLevel( void )
{
{
	DeleteAnnotation(event);
    wxASSERT_MSG( ((m_rbEntireSchematic != NULL) &&
                   m_rbEntireSchematic->IsKindOf( CLASSINFO( wxRadioButton ) )),
                  wxT( "m_rbEntireSchematic pointer was NULL." ) );

    return m_rbEntireSchematic->GetValue();
}
}


/*!
bool WinEDA_AnnotateFrame::GetResetItems( void )
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
{
 */
    wxASSERT_MSG( (m_cbResetAnnotation != NULL) &&
                  m_cbResetAnnotation->IsKindOf( CLASSINFO( wxCheckBox ) ),
                  wxT( "m_cbResetAnnotation pointer was NULL." ) );


void WinEDA_AnnotateFrame::OnCancelClick( wxCommandEvent& event )
    return m_cbResetAnnotation->IsChecked();
}

bool WinEDA_AnnotateFrame::GetSortOrder( void )
{
{
    EndModal( -1 );
    wxASSERT_MSG( (m_rbSortByPosition != NULL) &&
                  m_rbSortByPosition->IsKindOf( CLASSINFO( wxRadioButton ) ),
                  wxT( "m_rbSortByPosition pointer was NULL." ) );

    return m_rbSortByPosition->GetValue();
}
}
+51 −63
Original line number Original line Diff line number Diff line
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

// Name:        annotate_dialog.h
// Name:        annotate_dialog.h
// Purpose:
// Purpose:
// Author:      jean-pierre Charras
// Author:      jean-pierre Charras
@@ -9,7 +10,6 @@
// Licence:
// Licence:
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////


// Generated by DialogBlocks (unregistered), 05/02/2006 12:31:28


#ifndef _ANNOTATE_DIALOG_H_
#ifndef _ANNOTATE_DIALOG_H_
#define _ANNOTATE_DIALOG_H_
#define _ANNOTATE_DIALOG_H_
@@ -22,39 +22,28 @@
 * Includes
 * Includes
 */
 */


////@begin includes
////@end includes

#include "fctsys.h"
#include "fctsys.h"


#include "common.h"
#include "common.h"
#include "program.h"
#include "program.h"
#include "libcmp.h"
#include "libcmp.h"
#include "general.h"
#include "general.h"
/*!
 * Forward declarations
 */


////@begin forward declarations
////@end forward declarations


/*!
/*!
 * Control identifiers
 * Control identifiers
 */
 */


////@begin control identifiers
#define ID_DIALOG                10000
#define ID_DIALOG                10000
#define ID_RADIOBOX 10001
#define ID_ENTIRE_SCHEMATIC      10001
#define ID_RADIOBOX1 10002
#define ID_CURRENT_PAGE          10002
#define ID_RADIOBOX2 10005
#define ID_RESET_ANNOTATION      10003
#define ID_ANNOTATE_CMP 10003
#define ID_SORT_BY_POSITION      10004
#define ID_DEANNOTATE_CMP 10004
#define ID_SORT_BY_VALUE         10005
#define SYMBOL_WINEDA_ANNOTATEFRAME_STYLE wxDEFAULT_DIALOG_STYLE|MAYBE_RESIZE_BORDER

#define SYMBOL_WINEDA_ANNOTATEFRAME_TITLE _("EESchema Annotation")
#define ANNOTATE_DIALOG_STYLE    wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_ANNOTATEFRAME_IDNAME ID_DIALOG
#define ANNOTATE_DIALOG_TITLE    _( "Annotate" )
#define SYMBOL_WINEDA_ANNOTATEFRAME_SIZE wxSize(400, 300)

#define SYMBOL_WINEDA_ANNOTATEFRAME_POSITION wxDefaultPosition
////@end control identifiers


/*!
/*!
 * Compatibility
 * Compatibility
@@ -71,57 +60,56 @@
class WinEDA_AnnotateFrame : public wxDialog
class WinEDA_AnnotateFrame : public wxDialog
{
{
    DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame )
    DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame )
    DECLARE_EVENT_TABLE()


public:
public:

    /// Constructors
    /// Constructors
    WinEDA_AnnotateFrame();
    WinEDA_AnnotateFrame();
    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 );
    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 );


    /// Creation
    /// Creation
    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 );
    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 );


    /// Creates the controls and sizers
    /// Creates the controls and sizers
    void    CreateControls();
    void    CreateControls();


////@begin WinEDA_AnnotateFrame event handler declarations

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ANNOTATE_CMP
    void OnAnnotateCmpClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP
    void OnDeannotateCmpClick( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
    void OnCancelClick( wxCommandEvent& event );

////@end WinEDA_AnnotateFrame event handler declarations

////@begin WinEDA_AnnotateFrame member function declarations

    /// Retrieves bitmap resources
    /// Retrieves bitmap resources
    wxBitmap    GetBitmapResource( const wxString& name );
    wxBitmap    GetBitmapResource( const wxString& name );


    /// Retrieves icon resources
    /// Retrieves icon resources
    wxIcon      GetIconResource( const wxString& name );
    wxIcon      GetIconResource( const wxString& name );
////@end WinEDA_AnnotateFrame member function declarations

    bool GetLevel( void );
    bool GetResetItems( void );
    bool GetSortOrder( void );


    /// Should we show tooltips?
    /// Should we show tooltips?
    static bool ShowToolTips();
    static bool ShowToolTips();


////@begin WinEDA_AnnotateFrame member variables
    wxRadioBox* m_AnnotProjetCtrl;
    wxRadioBox* m_AnnotNewCmpCtrl;
    wxRadioBox* m_AnnotSortCmpCtrl;
////@end WinEDA_AnnotateFrame member variables

    WinEDA_SchematicFrame* m_Parent;
    WinEDA_SchematicFrame* m_Parent;
	bool m_Abort;


private:
private:
	void AnnotateComponents(wxCommandEvent& event);
    void OnClear( wxCommandEvent& event );
	void DeleteAnnotation(wxCommandEvent& event);
    void OnApply( wxCommandEvent& event );

    wxRadioButton* m_rbEntireSchematic;
    wxRadioButton* m_rbSortByPosition;
    wxCheckBox* m_cbResetAnnotation;
    wxButton* m_btnClear;

    DECLARE_EVENT_TABLE()
};
};


#endif
#endif

// _ANNOTATE_DIALOG_H_
// _ANNOTATE_DIALOG_H_
Loading