eeschema: annotate dialog converted from DialogBlocks to wxFormBuilder

This commit is contained in:
charras 2009-10-27 19:30:32 +00:00
parent 1c983b013d
commit 4a5151969d
13 changed files with 1391 additions and 381 deletions

View File

@ -8,7 +8,7 @@
#include "appl_wxstruct.h"
#define BUILD_VERSION "(20091024-unstable)"
#define BUILD_VERSION "(20091027-unstable)"
#ifdef HAVE_SVN_VERSION

View File

@ -38,7 +38,7 @@ set(EESCHEMA_SRCS
database.cpp
delete.cpp
delsheet.cpp
# dialog_backanno.cpp
dialog_annotate_base.cpp
dialog_bodygraphictext_properties_base.cpp
dialog_build_BOM.cpp
dialog_build_BOM_base.cpp

View File

@ -1,244 +1,87 @@
/////////////////////////////////////////////////////////////////////////////
// Name: annotate_dialog.cpp
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 16/04/2008 17:50:59
// RCS-ID:
// Copyright: License GNU
// Licence:
// Licence: License GNU
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "annotate_dialog.h"
#endif
////@begin includes
////@end includes
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "bitmaps.h"
#include "common.h"
#include "program.h"
#include "annotate_dialog.h"
#define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption")
extern void AnnotateComponents( WinEDA_SchematicFrame* parent,
bool annotateSchematic,
int sortOption,
bool resetAnnotation,
bool repairsTimestamps );
////@begin XPM images
////@end XPM images
/*!
* WinEDA_AnnotateFrame type definition
*/
IMPLEMENT_DYNAMIC_CLASS( WinEDA_AnnotateFrame, wxDialog )
/*!
* WinEDA_AnnotateFrame event table definition
*/
BEGIN_EVENT_TABLE( WinEDA_AnnotateFrame, wxDialog )
////@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()
{
Init();
}
WinEDA_AnnotateFrame::WinEDA_AnnotateFrame( WinEDA_SchematicFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
DIALOG_ANNOTATE::DIALOG_ANNOTATE( WinEDA_SchematicFrame* parent )
: DIALOG_ANNOTATE_BASE( parent )
{
m_Parent = parent;
Init();
Create(parent, id, caption, pos, size, style);
}
/*!
* WinEDA_AnnotateFrame creator
*/
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 );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
InitValues();
Layout();
GetSizer()->SetSizeHints(this);
Centre();
////@end WinEDA_AnnotateFrame creation
return true;
}
/*!
* WinEDA_AnnotateFrame destructor
*/
WinEDA_AnnotateFrame::~WinEDA_AnnotateFrame()
/*********************************/
void DIALOG_ANNOTATE::InitValues()
/*********************************/
{
////@begin WinEDA_AnnotateFrame destruction
////@end WinEDA_AnnotateFrame destruction
m_Config = wxGetApp().m_EDA_Config;
SetFocus(); // needed to close dialog by escape key
if( m_Config )
{
long option;
m_Config->Read(KEY_ANNOTATE_SORT_OPTION, &option, 0l);
switch( option )
{
case 0:
m_rbSortBy_X_Position->SetValue(1);
break;
case 1:
m_rbSortBy_Y_Position->SetValue(1);
break;
case 2:
rbSortByValue->SetValue(1);
break;
default:
break;
}
}
wxBitmap bitmap0(annotate_down_right_xpm);
annotate_down_right_bitmap->SetBitmap(bitmap0);
wxBitmap bitmap1(annotate_right_down_xpm);
annotate_right_down_bitmap->SetBitmap(bitmap1);
wxBitmap bitmap2(add_text_xpm);
annotate_by_value_bitmap->SetBitmap(bitmap2);
}
/*!
* Member initialisation
*/
void WinEDA_AnnotateFrame::Init()
{
////@begin WinEDA_AnnotateFrame member initialisation
m_rbEntireSchematic = NULL;
m_rbKeepAnnotation = NULL;
m_rbResetAnnotation = NULL;
m_rbSortBy_X_Position = NULL;
m_rbSortBy_Y_Position = NULL;
rbSortByValue = NULL;
sizerDialogButtons = NULL;
m_btnClose = NULL;
m_btnClear = NULL;
m_btnApply = NULL;
////@end WinEDA_AnnotateFrame member initialisation
}
/*!
* Control creation for WinEDA_AnnotateFrame
*/
void WinEDA_AnnotateFrame::CreateControls()
{
////@begin WinEDA_AnnotateFrame content construction
// Generated by DialogBlocks, 29/04/2009 13:38:10 (unregistered)
WinEDA_AnnotateFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Scope"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText4->SetFont(wxFont(int(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize()*1.2), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()));
itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer5, 0, wxGROW|wxLEFT, 25);
m_rbEntireSchematic = new wxRadioButton( itemDialog1, ID_ENTIRE_SCHEMATIC, _("Use 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, _("Use the current &page only"), wxDefaultPosition, wxDefaultSize, 0 );
itemRadioButton7->SetValue(false);
itemBoxSizer5->Add(itemRadioButton7, 0, wxGROW|wxALL, 5);
wxStaticLine* itemStaticLine8 = new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
itemBoxSizer5->Add(itemStaticLine8, 0, wxGROW|wxALL, 5);
m_rbKeepAnnotation = new wxRadioButton( itemDialog1, ID_KEEP_ANNOTATION, _("&Keep existing annotation"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbKeepAnnotation->SetValue(true);
itemBoxSizer5->Add(m_rbKeepAnnotation, 0, wxGROW|wxALL, 5);
m_rbResetAnnotation = new wxRadioButton( itemDialog1, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbResetAnnotation->SetValue(false);
itemBoxSizer5->Add(m_rbResetAnnotation, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText11 = new wxStaticText( itemDialog1, wxID_STATIC, _("Order"), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticText11->SetFont(wxFont(int(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize()*1.2), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFaceName()));
itemBoxSizer3->Add(itemStaticText11, 0, wxALIGN_LEFT|wxALL, 5);
wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer12, 0, wxGROW|wxLEFT, 25);
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer12->Add(itemBoxSizer13, 0, wxGROW, 5);
wxStaticBitmap* itemStaticBitmap14 = new wxStaticBitmap( itemDialog1, wxID_STATIC, itemDialog1->GetBitmapResource(wxT("annotate_down_right_xpm")), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer13->Add(itemStaticBitmap14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_rbSortBy_X_Position = new wxRadioButton( itemDialog1, ID_SORT_BY_X_POSITION, _("Sort components by &X position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
m_rbSortBy_X_Position->SetValue(true);
itemBoxSizer13->Add(m_rbSortBy_X_Position, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer12->Add(itemBoxSizer16, 0, wxGROW, 5);
wxStaticBitmap* itemStaticBitmap17 = new wxStaticBitmap( itemDialog1, wxID_STATIC, itemDialog1->GetBitmapResource(wxT("annotate_right_down_xpm")), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer16->Add(itemStaticBitmap17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_rbSortBy_Y_Position = new wxRadioButton( itemDialog1, ID_SORT_BY_Y_POSITION, _("Sort components by &Y position"), wxDefaultPosition, wxDefaultSize, 0 );
m_rbSortBy_Y_Position->SetValue(false);
itemBoxSizer16->Add(m_rbSortBy_Y_Position, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer12->Add(itemBoxSizer19, 0, wxGROW, 5);
wxStaticBitmap* itemStaticBitmap20 = new wxStaticBitmap( itemDialog1, wxID_STATIC, itemDialog1->GetBitmapResource(wxT("add_text_xpm")), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer19->Add(itemStaticBitmap20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
rbSortByValue = new wxRadioButton( itemDialog1, ID_SORT_BY_VALUE, _("Sort components by &value"), wxDefaultPosition, wxDefaultSize, 0 );
rbSortByValue->SetValue(false);
itemBoxSizer19->Add(rbSortByValue, 0, wxALIGN_CENTER_VERTICAL|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 );
sizerDialogButtons->Add(m_btnClear, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_btnApply = new wxButton( itemDialog1, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
m_btnApply->SetDefault();
sizerDialogButtons->Add(m_btnApply, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
////@end WinEDA_AnnotateFrame content construction
m_btnClose->SetFocus(); // needed to closes dialog by escape key
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
*/
void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event )
/*********************************************************/
void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
/*********************************************************/
{
int response;
wxString message;
if( m_Config )
m_Config->Write(KEY_ANNOTATE_SORT_OPTION, GetSortOrder());
if( GetResetItems() )
message = _( "Clear and annotate all of the components " );
else
@ -259,11 +102,9 @@ void WinEDA_AnnotateFrame::OnApplyClick( wxCommandEvent& event )
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DEANNOTATE_CMP
*/
void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event )
/************************************************************************/
void DIALOG_ANNOTATE::OnClearAnnotationCmpClick( wxCommandEvent& event )
/************************************************************************/
{
int response;
@ -283,11 +124,9 @@ void WinEDA_AnnotateFrame::OnClearAnnotationCmpClick( wxCommandEvent& event )
}
/*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/
void WinEDA_AnnotateFrame::OnCancelClick( wxCommandEvent& event )
/************************************************************/
void DIALOG_ANNOTATE::OnCancelClick( wxCommandEvent& event )
/************************************************************/
{
if( IsModal() )
EndModal( wxID_CANCEL );
@ -299,17 +138,23 @@ void WinEDA_AnnotateFrame::OnCancelClick( wxCommandEvent& event )
}
bool WinEDA_AnnotateFrame::GetLevel( void )
/**************************************/
bool DIALOG_ANNOTATE::GetLevel( void )
/**************************************/
{
return m_rbEntireSchematic->GetValue();
}
bool WinEDA_AnnotateFrame::GetResetItems( void )
/******************************************/
bool DIALOG_ANNOTATE::GetResetItems( void )
/******************************************/
{
return m_rbResetAnnotation->GetValue();
}
int WinEDA_AnnotateFrame::GetSortOrder( void )
/****************************************/
int DIALOG_ANNOTATE::GetSortOrder( void )
/****************************************/
/**
* @return 0 if annotation by X position,
* 1 if annotation by Y position
@ -323,51 +168,3 @@ int WinEDA_AnnotateFrame::GetSortOrder( void )
return 2;
}
/*!
* Should we show tooltips?
*/
bool WinEDA_AnnotateFrame::ShowToolTips()
{
return true;
}
/*!
* Get bitmap resources
*/
wxBitmap WinEDA_AnnotateFrame::GetBitmapResource( const wxString& name )
{
// Bitmap retrieval
if (name == wxT("annotate_down_right_xpm"))
{
wxBitmap bitmap(annotate_down_right_xpm);
return bitmap;
}
else if (name == wxT("annotate_right_down_xpm"))
{
wxBitmap bitmap(annotate_right_down_xpm);
return bitmap;
}
else if (name == wxT("add_text_xpm"))
{
wxBitmap bitmap(add_text_xpm);
return bitmap;
}
return wxNullBitmap;
}
/*!
* 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
}

View File

@ -1,132 +1,56 @@
/////////////////////////////////////////////////////////////////////////////
// Name: annotate_dialog.h
// Purpose:
// Author: jean-pierre Charras
// 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
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2009 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _ANNOTATE_DIALOG_H_
#define _ANNOTATE_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "annotate_dialog.h"
#endif
#include "dialog_annotate_base.h"
/*!
* Includes
* DIALOG_ANNOTATE class declaration
*/
////@begin includes
#include "wx/statline.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
class wxBoxSizer;
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_ENTIRE_SCHEMATIC 10002
#define ID_CURRENT_PAGE 10003
#define ID_KEEP_ANNOTATION 10009
#define ID_RESET_ANNOTATION 10009
#define ID_SORT_BY_X_POSITION 10001
#define ID_SORT_BY_Y_POSITION 10001
#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
/*!
* WinEDA_AnnotateFrame class declaration
*/
class WinEDA_AnnotateFrame: public wxDialog
class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
{
DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame )
DECLARE_EVENT_TABLE()
private:
WinEDA_SchematicFrame * m_Parent;
wxConfig* m_Config;
public:
/// Constructors
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 );
/// 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 );
/// Destructor
~WinEDA_AnnotateFrame();
DIALOG_ANNOTATE( WinEDA_SchematicFrame* parent );
~DIALOG_ANNOTATE(){};
/// 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 InitValues();
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 );
////@end WinEDA_AnnotateFrame member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
// User functions:
bool GetLevel( void );
bool GetResetItems( void );
int GetSortOrder( void );
////@begin WinEDA_AnnotateFrame member variables
wxRadioButton* m_rbEntireSchematic;
wxRadioButton* m_rbKeepAnnotation;
wxRadioButton* m_rbResetAnnotation;
wxRadioButton* m_rbSortBy_X_Position;
wxRadioButton* m_rbSortBy_Y_Position;
wxRadioButton* rbSortByValue;
wxBoxSizer* sizerDialogButtons;
wxButton* m_btnClose;
wxButton* m_btnClear;
wxButton* m_btnApply;
////@end WinEDA_AnnotateFrame member variables
WinEDA_SchematicFrame * m_Parent;
};
#endif

View File

@ -408,6 +408,13 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref )
}
rf->m_Text = ref; // for drawing.
// Reinit the m_PrefixString member if needed
wxString prefix = ref;
while( prefix.Last() == '?' or isdigit(prefix.Last()) )
prefix.RemoveLast();
if( m_PrefixString != prefix )
m_PrefixString = prefix;
}
/** function SetTimeStamp

View File

@ -0,0 +1,129 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_annotate_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bmainSizer;
bmainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxVERTICAL );
m_staticTextScope = new wxStaticText( this, wxID_ANY, _("Scope"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextScope->Wrap( -1 );
m_staticTextScope->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bupperSizer->Add( m_staticTextScope, 0, wxALL, 5 );
wxBoxSizer* bscopeOptSizer;
bscopeOptSizer = new wxBoxSizer( wxVERTICAL );
m_rbEntireSchematic = new wxRadioButton( this, ID_ENTIRE_SCHEMATIC, _("Use the &entire schematic"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bscopeOptSizer->Add( m_rbEntireSchematic, 0, wxALL, 5 );
m_rbCurrPage = new wxRadioButton( this, ID_CURRENT_PAGE, _("Use the current &page only"), wxDefaultPosition, wxDefaultSize, 0 );
bscopeOptSizer->Add( m_rbCurrPage, 0, wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bscopeOptSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_rbKeepAnnotation = new wxRadioButton( this, ID_KEEP_ANNOTATION, _("&Keep existing annotation"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bscopeOptSizer->Add( m_rbKeepAnnotation, 0, wxALL, 5 );
m_rbResetAnnotation = new wxRadioButton( this, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 );
bscopeOptSizer->Add( m_rbResetAnnotation, 0, wxALL, 5 );
bupperSizer->Add( bscopeOptSizer, 0, wxEXPAND|wxLEFT|wxALIGN_RIGHT, 25 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bupperSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
m_staticTextOrder = new wxStaticText( this, wxID_ANY, _("Annotation Order"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextOrder->Wrap( -1 );
m_staticTextOrder->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bupperSizer->Add( m_staticTextOrder, 0, wxALL, 5 );
wxBoxSizer* b_orderOptSizer;
b_orderOptSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerXpos;
bSizerXpos = new wxBoxSizer( wxHORIZONTAL );
annotate_down_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerXpos->Add( annotate_down_right_bitmap, 0, wxRIGHT|wxLEFT, 5 );
m_rbSortBy_X_Position = new wxRadioButton( this, ID_SORT_BY_X_POSITION, _("Sort Components by &X Position"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bSizerXpos->Add( m_rbSortBy_X_Position, 0, wxALL, 5 );
b_orderOptSizer->Add( bSizerXpos, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerYpos;
bSizerYpos = new wxBoxSizer( wxHORIZONTAL );
annotate_right_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerYpos->Add( annotate_right_down_bitmap, 0, wxRIGHT|wxLEFT, 5 );
m_rbSortBy_Y_Position = new wxRadioButton( this, ID_SORT_BY_Y_POSITION, _("Sort Components by &Y Position"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerYpos->Add( m_rbSortBy_Y_Position, 0, wxALL, 5 );
b_orderOptSizer->Add( bSizerYpos, 0, wxEXPAND, 5 );
wxBoxSizer* bSizerValuepos;
bSizerValuepos = new wxBoxSizer( wxHORIZONTAL );
annotate_by_value_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerValuepos->Add( annotate_by_value_bitmap, 0, wxRIGHT|wxLEFT, 5 );
rbSortByValue = new wxRadioButton( this, ID_SORT_BY_VALUE, _("Sort Components by &Value"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerValuepos->Add( rbSortByValue, 0, wxALL, 5 );
b_orderOptSizer->Add( bSizerValuepos, 0, wxEXPAND, 5 );
bupperSizer->Add( b_orderOptSizer, 1, wxEXPAND|wxLEFT, 25 );
bmainSizer->Add( bupperSizer, 1, wxEXPAND|wxLEFT, 5 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bmainSizer->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_btnClose = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_btnClose, 0, wxALL|wxEXPAND, 5 );
m_btnClear = new wxButton( this, ID_CLEAR_ANNOTATION_CMP, _("Clear Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_btnClear, 0, wxALL|wxEXPAND, 5 );
m_btnApply = new wxButton( this, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 );
bmainSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
this->SetSizer( bmainSizer );
this->Layout();
// Connect Events
m_btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCancelClick ), NULL, this );
m_btnClear->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
m_btnApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
}
DIALOG_ANNOTATE_BASE::~DIALOG_ANNOTATE_BASE()
{
// Disconnect Events
m_btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnCancelClick ), NULL, this );
m_btnClear->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnClearAnnotationCmpClick ), NULL, this );
m_btnApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_ANNOTATE_BASE::OnApplyClick ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,79 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_annotate_base__
#define __dialog_annotate_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/radiobut.h>
#include <wx/statline.h>
#include <wx/sizer.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_ENTIRE_SCHEMATIC 1000
#define ID_CURRENT_PAGE 1001
#define ID_KEEP_ANNOTATION 1002
#define ID_RESET_ANNOTATION 1003
#define ID_SORT_BY_X_POSITION 1004
#define ID_SORT_BY_Y_POSITION 1005
#define ID_SORT_BY_VALUE 1006
#define ID_CLEAR_ANNOTATION_CMP 1007
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ANNOTATE_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_ANNOTATE_BASE : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextScope;
wxRadioButton* m_rbEntireSchematic;
wxRadioButton* m_rbCurrPage;
wxStaticLine* m_staticline1;
wxRadioButton* m_rbKeepAnnotation;
wxRadioButton* m_rbResetAnnotation;
wxStaticLine* m_staticline2;
wxStaticText* m_staticTextOrder;
wxStaticBitmap* annotate_down_right_bitmap;
wxRadioButton* m_rbSortBy_X_Position;
wxStaticBitmap* annotate_right_down_bitmap;
wxRadioButton* m_rbSortBy_Y_Position;
wxStaticBitmap* annotate_by_value_bitmap;
wxRadioButton* rbSortByValue;
wxStaticLine* m_staticline5;
wxButton* m_btnClose;
wxButton* m_btnClear;
wxButton* m_btnApply;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnClearAnnotationCmpClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnApplyClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 331,338 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ANNOTATE_BASE();
};
#endif //__dialog_annotate_base__

View File

@ -14,7 +14,7 @@
#include "program.h"
#include "general.h"
#include "protos.h"
#include "eeconfig.h"
#include "eeschema_config.h"
#include "worksheet.h"
#include "hotkeys.h"

View File

@ -488,7 +488,7 @@ void WinEDA_SchematicFrame::OnUpdateGrid( wxUpdateUIEvent& event )
void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event )
/**************************************************************/
{
WinEDA_AnnotateFrame* dlg = new WinEDA_AnnotateFrame( this );
DIALOG_ANNOTATE* dlg = new DIALOG_ANNOTATE( this );
dlg->ShowModal();
dlg->Destroy();

View File

@ -13,7 +13,7 @@
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "pcbplot.h"
#include "pcbcfg.h"
#include "pcbnew_config.h"
#include "worksheet.h"
#include "pcbnew_id.h"
#include "hotkeys.h"