Commit c699c726 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Eeschema: in component properties dialog, add control for fields texts...

Eeschema: in component properties dialog, add control for fields texts justification, like in Libedit.
Fix some Doxygen warnings.
parent aec75256
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -36,10 +36,12 @@ const wxString FootprintAliasFileWildcard( _( "Kicad footprint alias files (*.eq
const wxString titleLibLoadError( _( "Library Load Error" ) );


/* MacOSX: Needed for file association 
/*
 * MacOSX: Needed for file association
 * http://wiki.wxwidgets.org/WxMac-specific_topics
 */
void WinEDA_App::MacOpenFile(const wxString &fileName) {
void WinEDA_App::MacOpenFile(const wxString &fileName)
{
    wxFileName    filename = fileName;
    wxString      oldPath;
    WinEDA_CvpcbFrame * frame = ((WinEDA_CvpcbFrame*)GetTopWindow());
+3 −3
Original line number Diff line number Diff line
/**
 * @file menucfg.cpp
 * (Re)Create the CvPCB main MenuBar
/*
 * menubar.cpp
 * Build the CvPCB MenuBar
 */
#include "fctsys.h"
#include "appl_wxstruct.h"
+2 −3
Original line number Diff line number Diff line
@@ -108,11 +108,10 @@ void DISPLAY_FOOTPRINTS_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/*
 * Redraw the BOARD items but not cursors, axis or grid.
 */
void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
                  int aDrawMode, const wxPoint& offset )
void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, int aDrawMode, const wxPoint& aOffset )
{
    if( m_Modules )
    {
        m_Modules->Draw( aPanel, DC, GR_COPY );
        m_Modules->Draw( aPanel, aDC, GR_COPY );
    }
}
+29 −0
Original line number Diff line number Diff line
@@ -578,6 +578,22 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()

    m_StyleRadioBox->SetSelection( style );

    // Select the right text justification
    if( field.m_HJustify == GR_TEXT_HJUSTIFY_LEFT )
        m_FieldHJustifyCtrl->SetSelection(0);
    else if( field.m_HJustify == GR_TEXT_HJUSTIFY_RIGHT )
        m_FieldHJustifyCtrl->SetSelection(2);
    else
        m_FieldHJustifyCtrl->SetSelection(1);

    if( field.m_VJustify == GR_TEXT_VJUSTIFY_BOTTOM )
        m_FieldVJustifyCtrl->SetSelection(0);
    else if( field.m_VJustify == GR_TEXT_VJUSTIFY_TOP )
        m_FieldVJustifyCtrl->SetSelection(2);
    else
        m_FieldVJustifyCtrl->SetSelection(1);


    fieldNameTextCtrl->SetValue( field.m_Name );

    // the names of the fixed fields are not editable, others are.
@@ -657,6 +673,19 @@ bool DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()

    rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );

    // Copy the text justification
    GRTextHorizJustifyType hjustify[3] = {
        GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_HJUSTIFY_CENTER,
        GR_TEXT_HJUSTIFY_RIGHT
    };

    GRTextVertJustifyType vjustify[3] = {
        GR_TEXT_VJUSTIFY_BOTTOM, GR_TEXT_VJUSTIFY_CENTER,
        GR_TEXT_VJUSTIFY_TOP
    };

    field.m_HJustify = hjustify[m_FieldHJustifyCtrl->GetSelection()];
    field.m_VJustify = vjustify[m_FieldVJustifyCtrl->GetSelection()];

    field.m_Name = fieldNameTextCtrl->GetValue();
    /* Void fields texts for REFERENCE and VALUE (value is the name of the
+27 −18
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Sep  8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -29,7 +29,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	int unitChoiceNChoices = sizeof( unitChoiceChoices ) / sizeof( wxString );
	unitChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, unitChoiceNChoices, unitChoiceChoices, 0 );
	unitChoice->SetSelection( 0 );
	unitSizer->Add( unitChoice, 1, wxALL|wxEXPAND, 5 );
	unitSizer->Add( unitChoice, 0, wxALL|wxEXPAND, 5 );
	
	optionsSizer->Add( unitSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 8 );
	
@@ -42,9 +42,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	orientationRadioBox->SetSelection( 0 );
	orientationRadioBox->SetToolTip( _("Select if the component is to be rotated when drawn") );
	
	orientationSizer->Add( orientationRadioBox, 1, wxALL, 8 );
	orientationSizer->Add( orientationRadioBox, 1, wxALL|wxEXPAND, 8 );
	
	optionsSizer->Add( orientationSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 0 );
	optionsSizer->Add( orientationSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
	
	wxBoxSizer* mirrorSizer;
	mirrorSizer = new wxBoxSizer( wxHORIZONTAL );
@@ -57,7 +57,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	
	mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 );
	
	optionsSizer->Add( mirrorSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 0 );
	optionsSizer->Add( mirrorSizer, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 0 );
	
	wxStaticBoxSizer* chipnameSizer;
	chipnameSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Chip Name") ), wxHORIZONTAL );
@@ -71,7 +71,6 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	optionsSizer->Add( chipnameSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
	
	convertCheckBox = new wxCheckBox( this, wxID_ANY, _("Convert"), wxDefaultPosition, wxDefaultSize, 0 );
	
	convertCheckBox->SetToolTip( _("Use the alternate shape of this component.\nFor gates, this is the \"De Morgan\" conversion") );
	
	optionsSizer->Add( convertCheckBox, 0, wxALL, 8 );
@@ -113,11 +112,28 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	
	gridStaticBoxSizer->Add( moveUpButton, 0, wxALL|wxEXPAND, 5 );
	
	fieldsSizer->Add( gridStaticBoxSizer, 5, wxALL|wxEXPAND, 8 );
	fieldsSizer->Add( gridStaticBoxSizer, 5, wxEXPAND|wxRIGHT|wxLEFT, 8 );
	
	wxBoxSizer* fieldEditBoxSizer;
	fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* sbSizerOptions;
	sbSizerOptions = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxHORIZONTAL );
	
	wxString m_FieldHJustifyCtrlChoices[] = { _("Align left"), _("Align center"), _("Align right") };
	int m_FieldHJustifyCtrlNChoices = sizeof( m_FieldHJustifyCtrlChoices ) / sizeof( wxString );
	m_FieldHJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Horiz. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldHJustifyCtrlNChoices, m_FieldHJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
	m_FieldHJustifyCtrl->SetSelection( 1 );
	sbSizerOptions->Add( m_FieldHJustifyCtrl, 1, wxRIGHT|wxLEFT, 5 );
	
	wxString m_FieldVJustifyCtrlChoices[] = { _("Align bottom"), _("Align center"), _("Align top") };
	int m_FieldVJustifyCtrlNChoices = sizeof( m_FieldVJustifyCtrlChoices ) / sizeof( wxString );
	m_FieldVJustifyCtrl = new wxRadioBox( this, wxID_ANY, _("Vert. Justify"), wxDefaultPosition, wxDefaultSize, m_FieldVJustifyCtrlNChoices, m_FieldVJustifyCtrlChoices, 1, wxRA_SPECIFY_COLS );
	m_FieldVJustifyCtrl->SetSelection( 1 );
	sbSizerOptions->Add( m_FieldVJustifyCtrl, 1, wxRIGHT|wxLEFT, 5 );
	
	fieldEditBoxSizer->Add( sbSizerOptions, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* visibilitySizer;
	visibilitySizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Visibility") ), wxHORIZONTAL );
	
@@ -125,13 +141,11 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	bShowRotateSizer = new wxBoxSizer( wxVERTICAL );
	
	showCheckBox = new wxCheckBox( this, wxID_ANY, _("Show"), wxDefaultPosition, wxDefaultSize, 0 );
	
	showCheckBox->SetToolTip( _("Check if you want this field visible") );
	
	bShowRotateSizer->Add( showCheckBox, 0, wxALL, 5 );
	
	rotateCheckBox = new wxCheckBox( this, wxID_ANY, _("Rotate"), wxDefaultPosition, wxDefaultSize, 0 );
	
	rotateCheckBox->SetToolTip( _("Check if you want this field's text rotated 90 degrees") );
	
	bShowRotateSizer->Add( rotateCheckBox, 0, wxALL, 5 );
@@ -146,7 +160,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	
	visibilitySizer->Add( m_StyleRadioBox, 1, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	fieldEditBoxSizer->Add( visibilitySizer, 0, wxEXPAND, 5 );
	fieldEditBoxSizer->Add( visibilitySizer, 0, wxEXPAND|wxTOP, 5 );
	
	wxBoxSizer* fieldNameBoxSizer;
	fieldNameBoxSizer = new wxBoxSizer( wxVERTICAL );
@@ -221,15 +235,9 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	
	positionBoxSizer->Add( posYBoxSizer, 1, wxALL|wxEXPAND, 5 );
	
	fieldEditBoxSizer->Add( positionBoxSizer, 1, wxEXPAND, 5 );
	
	
	fieldEditBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	fieldEditBoxSizer->Add( positionBoxSizer, 0, wxEXPAND, 5 );
	
	
	fieldEditBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
	
	fieldsSizer->Add( fieldEditBoxSizer, 3, wxEXPAND, 5 );
	fieldsSizer->Add( fieldEditBoxSizer, 0, wxEXPAND, 5 );
	
	upperSizer->Add( fieldsSizer, 1, wxALL|wxEXPAND, 5 );
	
@@ -268,4 +276,5 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
	moveUpButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::moveUpButtonHandler ), NULL, this );
	stdDialogButtonSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnCancelButtonClick ), NULL, this );
	stdDialogButtonSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnOKButtonClick ), NULL, this );
	
}
Loading