Commit 4a515196 authored by charras's avatar charras

eeschema: annotate dialog converted from DialogBlocks to wxFormBuilder

parent 1c983b01
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#define BUILD_VERSION "(20091024-unstable)" #define BUILD_VERSION "(20091027-unstable)"
#ifdef HAVE_SVN_VERSION #ifdef HAVE_SVN_VERSION
......
...@@ -38,7 +38,7 @@ set(EESCHEMA_SRCS ...@@ -38,7 +38,7 @@ set(EESCHEMA_SRCS
database.cpp database.cpp
delete.cpp delete.cpp
delsheet.cpp delsheet.cpp
# dialog_backanno.cpp dialog_annotate_base.cpp
dialog_bodygraphictext_properties_base.cpp dialog_bodygraphictext_properties_base.cpp
dialog_build_BOM.cpp dialog_build_BOM.cpp
dialog_build_BOM_base.cpp dialog_build_BOM_base.cpp
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /*
// Name: annotate_dialog.h * This program source code file is part of KICAD, a free EDA CAD application.
// Purpose: *
// Author: jean-pierre Charras * Copyright (C) 1992-2009 Kicad Developers, see change_log.txt for contributors.
// Modified by: *
// Created: 16/04/2008 17:50:59 * This program is free software; you can redistribute it and/or
// RCS-ID: * modify it under the terms of the GNU General Public License
// Copyright: License GNU * as published by the Free Software Foundation; either version 2
// Licence: * of the License, or (at your option) any later version.
///////////////////////////////////////////////////////////////////////////// *
* This program is distributed in the hope that it will be useful,
// Generated by DialogBlocks (unregistered), 16/04/2008 17:50:59 * 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_ #ifndef _ANNOTATE_DIALOG_H_
#define _ANNOTATE_DIALOG_H_ #define _ANNOTATE_DIALOG_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #include "dialog_annotate_base.h"
#pragma interface "annotate_dialog.h"
#endif
/*!
* Includes
*/
////@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 * DIALOG_ANNOTATE class declaration
*/ */
class WinEDA_AnnotateFrame: public wxDialog class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_AnnotateFrame ) private:
DECLARE_EVENT_TABLE() WinEDA_SchematicFrame * m_Parent;
wxConfig* m_Config;
public: public:
/// Constructors DIALOG_ANNOTATE( WinEDA_SchematicFrame* parent );
WinEDA_AnnotateFrame(); ~DIALOG_ANNOTATE(){};
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();
/// Initialises member variables /// Initialises member variables
void Init(); void InitValues();
/// 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 ); void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CLEAR_ANNOTATION_CMP
void OnClearAnnotationCmpClick( wxCommandEvent& event ); void OnClearAnnotationCmpClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY
void OnApplyClick( wxCommandEvent& event ); 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: // User functions:
bool GetLevel( void ); bool GetLevel( void );
bool GetResetItems( void ); bool GetResetItems( void );
int GetSortOrder( 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 #endif
......
...@@ -408,6 +408,13 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref ) ...@@ -408,6 +408,13 @@ void SCH_COMPONENT::SetRef( DrawSheetPath* sheet, const wxString& ref )
} }
rf->m_Text = ref; // for drawing. 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 /** function SetTimeStamp
......
///////////////////////////////////////////////////////////////////////////
// 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 );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// 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__
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "program.h" #include "program.h"
#include "general.h" #include "general.h"
#include "protos.h" #include "protos.h"
#include "eeconfig.h" #include "eeschema_config.h"
#include "worksheet.h" #include "worksheet.h"
#include "hotkeys.h" #include "hotkeys.h"
......
...@@ -488,7 +488,7 @@ void WinEDA_SchematicFrame::OnUpdateGrid( wxUpdateUIEvent& event ) ...@@ -488,7 +488,7 @@ void WinEDA_SchematicFrame::OnUpdateGrid( wxUpdateUIEvent& event )
void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event ) void WinEDA_SchematicFrame::OnAnnotate( wxCommandEvent& event )
/**************************************************************/ /**************************************************************/
{ {
WinEDA_AnnotateFrame* dlg = new WinEDA_AnnotateFrame( this ); DIALOG_ANNOTATE* dlg = new DIALOG_ANNOTATE( this );
dlg->ShowModal(); dlg->ShowModal();
dlg->Destroy(); dlg->Destroy();
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "pcbcfg.h" #include "pcbnew_config.h"
#include "worksheet.h" #include "worksheet.h"
#include "pcbnew_id.h" #include "pcbnew_id.h"
#include "hotkeys.h" #include "hotkeys.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment