Commit a1659e41 authored by dickelbeck's avatar dickelbeck

further dialog development

parent c4215848
...@@ -5,6 +5,15 @@ Started 2007-June-11 ...@@ -5,6 +5,15 @@ 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-Nov-24 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+eeschema
edit component in schematic editor. It is not complete but further.
Keep your old eeschema binary, this one does not fully work yet, another day or so.
Switched away from wxGrid to wxListCtrl, and that class is poorly documented
so much time pioneering how to use it. Should go faster now.
2008-Nov-23 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Nov-23 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+all +all
...@@ -25,8 +34,7 @@ email address. ...@@ -25,8 +34,7 @@ email address.
+eeschema +eeschema
Started on the edit component in schematic editor. It is not complete and Started on the edit component in schematic editor. It is not complete and
breaks the usefulness of the editor at this moment. Do not build this version breaks the usefulness of the editor at this moment. Do not build this version
if you want to fully use eeschema. I will get something working in another day, if you want to fully use eeschema.
even if it is the old editor.
2008-Nov-22 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Nov-22 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
......
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
#include "dialog_edit_component_in_schematic.h" #include "dialog_edit_component_in_schematic.h"
#define ID_ON_SELECT_FIELD 3000
/**********************************************************************/ /**********************************************************************/
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos, void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
SCH_COMPONENT* aComponent ) SCH_COMPONENT* aComponent )
...@@ -38,6 +34,9 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos, ...@@ -38,6 +34,9 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( parent ); new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( parent );
frame->InitBuffers( aComponent ); frame->InitBuffers( aComponent );
// frame->Layout();
frame->ShowModal(); frame->ShowModal();
frame->Destroy(); frame->Destroy();
} }
...@@ -93,46 +92,55 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow ...@@ -93,46 +92,55 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow
{ {
m_Parent = (WinEDA_SchematicFrame*) parent; m_Parent = (WinEDA_SchematicFrame*) parent;
// fieldGrid->SetDefaultColSize( 160, true ); m_SelectedRow = 0;
// fieldGrid->SetColLabelValue( 0, _("Field Text") );
wxListItem columnLabel;
// set grid as read only. columnLabel.SetImage(-1);
fieldGrid->EnableEditing( false );
// @todo make this conditional on 2.8.8 wxWidgets columnLabel.SetText( _("Name") );
fieldGrid->SetRowLabelSize( wxGRID_AUTOSIZE ); fieldListCtrl->InsertColumn( 0, columnLabel );
// else fieldGrid->SetRowLabelSize( 140 ) or so columnLabel.SetText( _("Value") );
fieldListCtrl->InsertColumn( 1, columnLabel );
// select only a single row, and since table is only a single column wide // these must go here late in the game.
// this means only one cell. fieldListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
fieldGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); fieldListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
copySelectedFieldToPanel();
wxToolTip::Enable( true ); wxToolTip::Enable( true );
} }
/* void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemDeselected( wxListEvent& event )
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellLeftClick( wxGridEvent& event )
{ {
// TODO: Implement OnGridCellLeftClick D(printf("OnListItemDeselected()\n");)
copyPanelToSelectedField();
} }
*/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemSelected( wxListEvent& event )
{
D(printf("OnListItemSelected()\n");)
m_SelectedRow = event.GetIndex();
copySelectedFieldToPanel();
}
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setSelectedFieldNdx( int aFieldNdx ) void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setSelectedFieldNdx( int aFieldNdx )
{ {
fieldGrid->SelectCol( 0 ); fieldListCtrl->SetItemState( aFieldNdx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
fieldGrid->SelectRow( aFieldNdx ); fieldListCtrl->EnsureVisible( aFieldNdx );
} }
int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::getSelectedFieldNdx() int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::getSelectedFieldNdx()
{ {
wxArrayInt array = fieldGrid->GetSelectedRows(); return m_SelectedRow;
if( !array.IsEmpty() )
return array.Item(0);
else
return -1;
} }
...@@ -193,99 +201,139 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event ) ...@@ -193,99 +201,139 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
#endif #endif
/********************************************************************************/ /*******************************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent ) void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent )
/********************************************************************************/ /*******************************************************************************/
{ {
m_Cmp = aComponent; m_Cmp = aComponent;
setSelectedFieldNdx( REFERENCE ); // copy all the fields to a work area
m_FieldsBuf = aComponent->m_Fields;
m_FieldBuf = aComponent->m_Fields;
m_FieldBuf[REFERENCE].m_Text = m_Cmp->GetRef( m_Parent->GetSheet() ); m_FieldsBuf[REFERENCE].m_Text = m_Cmp->GetRef( m_Parent->GetSheet() );
for( int ii = 0; ii < aComponent->GetFieldCount(); ++ii ) for( int ii = 0; ii < aComponent->GetFieldCount(); ++ii )
{ {
// make the editable field position relative to the component // make the editable field position relative to the component
m_FieldBuf[ii].m_Pos -= m_Cmp->m_Pos; m_FieldsBuf[ii].m_Pos -= m_Cmp->m_Pos;
setRowItem( ii, m_FieldsBuf[ii] );
} }
setSelectedFieldNdx( REFERENCE );
}
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::setRowItem( int aFieldNdx, const SCH_CMP_FIELD& aField )
{
wxASSERT( aFieldNdx >= 0 );
// insert blanks if aFieldNdx is referencing a yet to be defined row
while( aFieldNdx >= fieldListCtrl->GetItemCount() )
{
long ndx = fieldListCtrl->InsertItem( fieldListCtrl->GetItemCount(), wxEmptyString );
wxASSERT( ndx >= 0 );
fieldListCtrl->SetItem( ndx, 1, wxEmptyString );
}
fieldListCtrl->SetItem( aFieldNdx, 0, aField.m_Name );
fieldListCtrl->SetItem( aFieldNdx, 1, aField.m_Text );
// recompute the column widths here, after setting texts
fieldListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
fieldListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
} }
#if 0
/****************************************************************/ /****************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyDataToPanel() void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
/****************************************************************/ /****************************************************************/
{ {
int fieldNdx = GetSelectedFieldNdx(); unsigned fieldNdx = getSelectedFieldNdx();
if( fieldNdx == -1 ) if( fieldNdx >= m_FieldsBuf.size() ) // traps the -1 case too
return; return;
for( int ii = FIELD1; ii < NUMBER_OF_FIELDS; ii++ ) SCH_CMP_FIELD& field = m_FieldsBuf[fieldNdx];
{
m_FieldSelection->SetString( ii, m_FieldName[ii] );
}
fieldNameTextCtrl->SetValue( field.m_Name );
// if fieldNdx == REFERENCE, VALUE, FOOTPRINT, or DATASHEET, then disable editing
fieldNameTextCtrl->Enable( fieldNdx >= FIELD1 );
fieldValueTextCtrl->SetValue( field.m_Text );
/*
if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->m_Options == ENTRY_POWER ) if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->m_Options == ENTRY_POWER )
m_FieldTextCtrl->Enable( FALSE ); m_FieldTextCtrl->Enable( FALSE );
*/
if( m_FieldFlags[fieldNdx] ) showCheckBox->SetValue( !(field.m_Attributs & TEXT_NO_VISIBLE) );
m_ShowFieldTextCtrl->SetValue( TRUE );
else
m_ShowFieldTextCtrl->SetValue( FALSE );
// If the field value is empty and the position is zero, we set the // If the field value is empty and the position is zero, we set the
// initial position as a small offset from the ref field, and orient // initial position as a small offset from the ref field, and orient
// it the same as the ref field. That is likely to put it at least // it the same as the ref field. That is likely to put it at least
// close to the desired position. // close to the desired position.
if( m_FieldBuf[fieldNdx].m_Pos == wxPoint( 0, 0 ) if( field.m_Pos == wxPoint( 0, 0 ) && field.m_Text.IsEmpty() )
&& m_FieldBuf[fieldNdx].m_Text.IsEmpty() )
{ {
m_VorientFieldText->SetValue( m_FieldOrient[REFERENCE] != 0 ); wxString dim;
m_FieldPositionCtrl->SetValue( m_FieldPosition[REFERENCE].x + 100,
m_FieldPosition[REFERENCE].y + 100 ); // @todo look at the dedicated position control for this.
dim.Printf( wxT("%d"), m_FieldsBuf[REFERENCE].m_Pos.x + (fieldNdx-FIELD1+1)*100 );
posXTextCtrl->SetValue( dim );
dim.Printf( wxT("%d"), m_FieldsBuf[REFERENCE].m_Pos.y + (fieldNdx-FIELD1+1)*100 );
posYTextCtrl->SetValue( dim );
} }
else else
{ {
m_FieldPositionCtrl->SetValue( m_FieldPosition[fieldNdx].x, m_FieldPosition[fieldNdx].y ); wxString dim;
m_VorientFieldText->SetValue( m_FieldOrient[fieldNdx] != 0 );
dim.Printf( wxT("%d"), field.m_Pos.x );
posXTextCtrl->SetValue( dim );
dim.Printf( wxT("%d"), field.m_Pos.y );
posYTextCtrl->SetValue( dim );
} }
m_FieldNameCtrl->SetValue( m_FieldName[fieldNdx] ); rotateCheckBox->SetValue( field.m_Orient == TEXT_ORIENT_VERT );
if( fieldNdx < FIELD1 ) #if 0
m_FieldNameCtrl->Enable( FALSE );
else m_FieldNameCtrl->SetValue( m_FieldName[fieldNdx] );
m_FieldNameCtrl->Enable( TRUE );
m_FieldTextCtrl->SetValue( m_FieldText[fieldNdx] ); m_FieldTextCtrl->SetValue( m_FieldText[fieldNdx] );
m_FieldTextCtrl->SetValue( m_FieldSize[fieldNdx] ); m_FieldTextCtrl->SetValue( m_FieldSize[fieldNdx] );
#endif
} }
/*****************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
/*****************************************************************/
{
unsigned fieldNdx = getSelectedFieldNdx();
/****************************************************************/ if( fieldNdx >= m_FieldsBuf.size() )
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelFieldToData() return;
/****************************************************************/
/* Copy the values displayed on the panel field to the buffers according to SCH_CMP_FIELD& field = m_FieldsBuf[fieldNdx];
* the current field number
*/ field.m_Name = fieldNameTextCtrl->GetValue();
{ field.m_Text = fieldValueTextCtrl->GetValue();
int id = m_CurrentFieldId;
// field.m_Size =
m_FieldFlags[id] = m_ShowFieldTextCtrl->GetValue();
m_FieldOrient[id] = m_VorientFieldText->GetValue(); // m_FieldPosition[id] = m_FieldPositionCtrl->GetValue();
m_FieldText[id] = m_FieldTextCtrl->GetText(); // m_FieldSize[id] = m_FieldTextCtrl->GetTextSize();
m_FieldName[id] = m_FieldNameCtrl->GetValue();
m_FieldPosition[id] = m_FieldPositionCtrl->GetValue();
m_FieldSize[id] = m_FieldTextCtrl->GetTextSize();
} }
#if 0
/*************************************************************/ /*************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::fillTableModel() void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::fillTableModel()
/*************************************************************/ /*************************************************************/
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property> <property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">864,540</property> <property name="size">864,550</property>
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property> <property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="title">Component Properties</property> <property name="title">Component Properties</property>
<property name="tooltip"></property> <property name="tooltip"></property>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
<property name="name">mirrorRadioBox</property> <property name="name">mirrorRadioBox</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="selection">0</property> <property name="selection">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property> <property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property> <property name="subclass"></property>
...@@ -453,7 +453,7 @@ ...@@ -453,7 +453,7 @@
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">8</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">4</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label"></property> <property name="label"></property>
...@@ -463,98 +463,36 @@ ...@@ -463,98 +463,36 @@
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">8</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxGrid" expanded="1"> <object class="wxListCtrl" expanded="1">
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="bg"></property> <property name="bg"></property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">30</property>
<property name="col_label_values">&quot;Field Text&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">1</property>
<property name="column_sizes">170</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">0</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="font"></property> <property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldGrid</property> <property name="name">fieldListCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="row_label_horiz_alignment">wxALIGN_LEFT</property>
<property name="row_label_size">80</property>
<property name="row_label_values">&quot;Reference&quot; &quot;Value&quot; &quot;Footprint&quot; &quot;Datasheet&quot; &quot;Field1&quot; &quot;Field2&quot; &quot;Field3&quot; &quot;Field4&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">8</property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">The list of component fields</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property> <property name="validator_variable"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxSIMPLE_BORDER|wxVSCROLL</property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
<event name="OnKeyUp"></event> <event name="OnKeyUp"></event>
<event name="OnKillFocus"></event> <event name="OnKillFocus"></event>
...@@ -562,6 +500,26 @@ ...@@ -562,6 +500,26 @@
<event name="OnLeftDClick"></event> <event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event> <event name="OnLeftDown"></event>
<event name="OnLeftUp"></event> <event name="OnLeftUp"></event>
<event name="OnListBeginDrag"></event>
<event name="OnListBeginLabelEdit"></event>
<event name="OnListBeginRDrag"></event>
<event name="OnListCacheHint"></event>
<event name="OnListColBeginDrag"></event>
<event name="OnListColClick"></event>
<event name="OnListColDragging"></event>
<event name="OnListColEndDrag"></event>
<event name="OnListColRightClick"></event>
<event name="OnListDeleteAllItems"></event>
<event name="OnListDeleteItem"></event>
<event name="OnListEndLabelEdit"></event>
<event name="OnListInsertItem"></event>
<event name="OnListItemActivated"></event>
<event name="OnListItemDeselected">OnListItemDeselected</event>
<event name="OnListItemFocused"></event>
<event name="OnListItemMiddleClick"></event>
<event name="OnListItemRightClick"></event>
<event name="OnListItemSelected">OnListItemSelected</event>
<event name="OnListKeyDown"></event>
<event name="OnMiddleDClick"></event> <event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event> <event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event> <event name="OnMiddleUp"></event>
...@@ -579,7 +537,7 @@ ...@@ -579,7 +537,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -635,7 +593,7 @@ ...@@ -635,7 +593,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -691,7 +649,7 @@ ...@@ -691,7 +649,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="1"> <object class="wxButton" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -750,17 +708,17 @@ ...@@ -750,17 +708,17 @@
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">3</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldEditBoxSizer</property> <property name="name">fieldEditBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Visibility</property> <property name="label">Visibility</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
...@@ -883,20 +841,72 @@ ...@@ -883,20 +841,72 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Field Name</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldNameStaticBoxSizer</property> <property name="name">fieldNameBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Field Name</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">fieldNameLabel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -915,7 +925,7 @@ ...@@ -915,7 +925,7 @@
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">The name of the currently selected field</property> <property name="tooltip">The text (or value) of the currently selected field</property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
...@@ -956,20 +966,72 @@ ...@@ -956,20 +966,72 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Field Text</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">fieldTextStaticBoxSizer</property> <property name="name">fieldTextBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Field Value</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">fieldValueLabel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -982,7 +1044,7 @@ ...@@ -982,7 +1044,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_textCtrl3</property> <property name="name">fieldValueTextCtrl</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
...@@ -1029,20 +1091,72 @@ ...@@ -1029,20 +1091,72 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Size (&quot;)</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">textSizeStaticBoxSizer</property> <property name="name">textSizeBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Size(&quot;)</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">textSizeLabel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
...@@ -1104,28 +1218,80 @@ ...@@ -1104,28 +1218,80 @@
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">positionBoxSizer</property> <property name="name">positionBoxSizer</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">posXBoxSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">PosX(&quot;)</property> <property name="label">PosX(&quot;)</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">posXStaticBoxSizer</property> <property name="name">posXLabel</property>
<property name="orient">wxHORIZONTAL</property> <property name="permission">protected</property>
<property name="permission">none</property> <property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
...@@ -1143,7 +1309,7 @@ ...@@ -1143,7 +1309,7 @@
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip">The x coordinate of the text relative to the component</property> <property name="tooltip"></property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>
...@@ -1184,21 +1350,73 @@ ...@@ -1184,21 +1350,73 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">8</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">PosY(&quot;)</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">poxYStaticBoxSizer</property> <property name="name">posYBoxSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag"></property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">PosY(&quot;)</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">posYLabel</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="context_help"></property> <property name="context_help"></property>
...@@ -1258,6 +1476,16 @@ ...@@ -1258,6 +1476,16 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property> <property name="flag">wxALL|wxEXPAND</property>
...@@ -1314,6 +1542,16 @@ ...@@ -1314,6 +1542,16 @@
<event name="OnUpdateUI"></event> <event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object> </object>
</object> </object>
</object> </object>
......
...@@ -16,28 +16,41 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEM ...@@ -16,28 +16,41 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEM
SCH_COMPONENT* m_Cmp; SCH_COMPONENT* m_Cmp;
EDA_LibComponentStruct* m_LibEntry; EDA_LibComponentStruct* m_LibEntry;
int m_SelectedRow;
/// a copy of the edited component's SCH_CMP_FIELDs /// a copy of the edited component's SCH_CMP_FIELDs
SCH_CMP_FIELDS m_FieldBuf; SCH_CMP_FIELDS m_FieldsBuf;
void setSelectedFieldNdx( int aFieldNdx ); void setSelectedFieldNdx( int aFieldNdx );
int getSelectedFieldNdx(); int getSelectedFieldNdx();
/** /**
* Function CopyDataToPanel * Function copySelectedFieldToPanel
* sets the values displayed on the panel according to * sets the values displayed on the panel according to
* the current field number * the currently selected field row
*/ */
void copyDataToPanel(); void copySelectedFieldToPanel();
/**
* Function copyPanelToSelectedField
* copies the values displayed on the panel fields to the currently selected field
*/
void copyPanelToSelectedField();
void fillTableModel(); void fillTableModel();
void setRowItem( int aFieldNdx, const SCH_CMP_FIELD& aField );
// event handlers
void OnListItemDeselected( wxListEvent& event );
void OnListItemSelected( wxListEvent& event );
protected: protected:
// Handlers for DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP events.
// void OnGridCellLeftClick( wxGridEvent& event );
public: public:
/** Constructor */ /** Constructor */
......
...@@ -52,7 +52,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( ...@@ -52,7 +52,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") }; wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") };
int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString ); int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString );
mirrorRadioBox = new wxRadioBox( this, wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, mirrorRadioBoxNChoices, mirrorRadioBoxChoices, 1, wxRA_SPECIFY_COLS ); mirrorRadioBox = new wxRadioBox( this, wxID_ANY, _("Mirror"), wxDefaultPosition, wxDefaultSize, mirrorRadioBoxNChoices, mirrorRadioBoxChoices, 1, wxRA_SPECIFY_COLS );
mirrorRadioBox->SetSelection( 0 ); mirrorRadioBox->SetSelection( 1 );
mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") ); mirrorRadioBox->SetToolTip( _("Pick the graphical transformation to be used when displaying the component, if any") );
mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 ); mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 );
...@@ -83,60 +83,25 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( ...@@ -83,60 +83,25 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
wxStaticBoxSizer* gridStaticBoxSizer; wxStaticBoxSizer* gridStaticBoxSizer;
gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
fieldGrid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxVSCROLL ); fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
// Grid
fieldGrid->CreateGrid( 8, 1 );
fieldGrid->EnableEditing( true );
fieldGrid->EnableGridLines( true );
fieldGrid->EnableDragGridSize( false );
fieldGrid->SetMargins( 0, 0 );
// Columns
fieldGrid->SetColSize( 0, 170 );
fieldGrid->EnableDragColMove( false );
fieldGrid->EnableDragColSize( false );
fieldGrid->SetColLabelSize( 30 );
fieldGrid->SetColLabelValue( 0, _("Field Text") );
fieldGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
fieldGrid->EnableDragRowSize( true );
fieldGrid->SetRowLabelSize( 80 );
fieldGrid->SetRowLabelValue( 0, _("Reference") );
fieldGrid->SetRowLabelValue( 1, _("Value") );
fieldGrid->SetRowLabelValue( 2, _("Footprint") );
fieldGrid->SetRowLabelValue( 3, _("Datasheet") );
fieldGrid->SetRowLabelValue( 4, _("Field1") );
fieldGrid->SetRowLabelValue( 5, _("Field2") );
fieldGrid->SetRowLabelValue( 6, _("Field3") );
fieldGrid->SetRowLabelValue( 7, _("Field4") );
fieldGrid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
fieldGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
fieldGrid->SetToolTip( _("The list of component fields") );
gridStaticBoxSizer->Add( fieldGrid, 1, wxALL|wxEXPAND, 5 );
addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 ); addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
addFieldButton->SetToolTip( _("Add a new custom field") ); addFieldButton->SetToolTip( _("Add a new custom field") );
gridStaticBoxSizer->Add( addFieldButton, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); gridStaticBoxSizer->Add( addFieldButton, 0, wxALL|wxEXPAND, 5 );
deleteFieldButton = new wxButton( this, wxID_ANY, _("Delete Field"), wxDefaultPosition, wxDefaultSize, 0 ); deleteFieldButton = new wxButton( this, wxID_ANY, _("Delete Field"), wxDefaultPosition, wxDefaultSize, 0 );
deleteFieldButton->SetToolTip( _("Delete one of the optional fields") ); deleteFieldButton->SetToolTip( _("Delete one of the optional fields") );
gridStaticBoxSizer->Add( deleteFieldButton, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); gridStaticBoxSizer->Add( deleteFieldButton, 0, wxALL|wxEXPAND, 5 );
moveUpButton = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 ); moveUpButton = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
moveUpButton->SetToolTip( _("Move the selected optional fields up one position") ); moveUpButton->SetToolTip( _("Move the selected optional fields up one position") );
gridStaticBoxSizer->Add( moveUpButton, 0, wxALL|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); gridStaticBoxSizer->Add( moveUpButton, 0, wxALL|wxEXPAND, 5 );
fieldsSizer->Add( gridStaticBoxSizer, 1, wxALL|wxEXPAND, 8 ); fieldsSizer->Add( gridStaticBoxSizer, 4, wxALL|wxEXPAND, 8 );
wxBoxSizer* fieldEditBoxSizer; wxBoxSizer* fieldEditBoxSizer;
fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL ); fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL );
...@@ -154,67 +119,91 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( ...@@ -154,67 +119,91 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
visibilitySizer->Add( rotateCheckBox, 1, wxALL, 5 ); visibilitySizer->Add( rotateCheckBox, 1, wxALL, 5 );
fieldEditBoxSizer->Add( visibilitySizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); fieldEditBoxSizer->Add( visibilitySizer, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* fieldNameStaticBoxSizer; wxBoxSizer* fieldNameBoxSizer;
fieldNameStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Field Name") ), wxVERTICAL ); fieldNameBoxSizer = new wxBoxSizer( wxVERTICAL );
fieldNameLabel = new wxStaticText( this, wxID_ANY, _("Field Name"), wxDefaultPosition, wxDefaultSize, 0 );
fieldNameLabel->Wrap( -1 );
fieldNameBoxSizer->Add( fieldNameLabel, 0, 0, 5 );
fieldNameTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fieldNameTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fieldNameTextCtrl->SetToolTip( _("The name of the currently selected field") ); fieldNameTextCtrl->SetToolTip( _("The text (or value) of the currently selected field") );
fieldNameBoxSizer->Add( fieldNameTextCtrl, 0, wxEXPAND, 5 );
fieldEditBoxSizer->Add( fieldNameBoxSizer, 0, wxALL|wxEXPAND, 5 );
fieldNameStaticBoxSizer->Add( fieldNameTextCtrl, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* fieldTextBoxSizer;
fieldTextBoxSizer = new wxBoxSizer( wxVERTICAL );
fieldEditBoxSizer->Add( fieldNameStaticBoxSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); fieldValueLabel = new wxStaticText( this, wxID_ANY, _("Field Value"), wxDefaultPosition, wxDefaultSize, 0 );
fieldValueLabel->Wrap( -1 );
fieldTextBoxSizer->Add( fieldValueLabel, 0, 0, 5 );
wxStaticBoxSizer* fieldTextStaticBoxSizer; fieldValueTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fieldTextStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Field Text") ), wxVERTICAL ); fieldValueTextCtrl->SetToolTip( _("The text (or value) of the currently selected field") );
m_textCtrl3 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); fieldTextBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND, 5 );
m_textCtrl3->SetToolTip( _("The text (or value) of the currently selected field") );
fieldTextStaticBoxSizer->Add( m_textCtrl3, 0, wxALL|wxEXPAND, 5 ); fieldEditBoxSizer->Add( fieldTextBoxSizer, 0, wxALL|wxEXPAND, 5 );
fieldEditBoxSizer->Add( fieldTextStaticBoxSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); wxBoxSizer* textSizeBoxSizer;
textSizeBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* textSizeStaticBoxSizer; textSizeLabel = new wxStaticText( this, wxID_ANY, _("Size(\")"), wxDefaultPosition, wxDefaultSize, 0 );
textSizeStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Size (\")") ), wxVERTICAL ); textSizeLabel->Wrap( -1 );
textSizeBoxSizer->Add( textSizeLabel, 0, 0, 5 );
textSizeTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); textSizeTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
textSizeTextCtrl->SetToolTip( _("The vertical height of the currently selected field's text in the schematic") ); textSizeTextCtrl->SetToolTip( _("The vertical height of the currently selected field's text in the schematic") );
textSizeStaticBoxSizer->Add( textSizeTextCtrl, 0, wxALL|wxEXPAND, 5 ); textSizeBoxSizer->Add( textSizeTextCtrl, 0, wxEXPAND, 5 );
fieldEditBoxSizer->Add( textSizeStaticBoxSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 ); fieldEditBoxSizer->Add( textSizeBoxSizer, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* positionBoxSizer; wxBoxSizer* positionBoxSizer;
positionBoxSizer = new wxBoxSizer( wxHORIZONTAL ); positionBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* posXStaticBoxSizer; wxBoxSizer* posXBoxSizer;
posXStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("PosX(\")") ), wxHORIZONTAL ); posXBoxSizer = new wxBoxSizer( wxVERTICAL );
posXLabel = new wxStaticText( this, wxID_ANY, _("PosX(\")"), wxDefaultPosition, wxDefaultSize, 0 );
posXLabel->Wrap( -1 );
posXBoxSizer->Add( posXLabel, 0, 0, 5 );
posXTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); posXTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
posXTextCtrl->SetToolTip( _("The x coordinate of the text relative to the component") ); posXBoxSizer->Add( posXTextCtrl, 0, wxEXPAND, 5 );
posXStaticBoxSizer->Add( posXTextCtrl, 1, wxALL|wxEXPAND, 5 ); positionBoxSizer->Add( posXBoxSizer, 1, wxALL|wxEXPAND, 5 );
positionBoxSizer->Add( posXStaticBoxSizer, 1, wxALL|wxEXPAND, 8 ); wxBoxSizer* posYBoxSizer;
posYBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* poxYStaticBoxSizer; posYLabel = new wxStaticText( this, wxID_ANY, _("PosY(\")"), wxDefaultPosition, wxDefaultSize, 0 );
poxYStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("PosY(\")") ), wxVERTICAL ); posYLabel->Wrap( -1 );
posYBoxSizer->Add( posYLabel, 0, 0, 5 );
posYTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); posYTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
posYTextCtrl->SetToolTip( _("The Y coordinate of the text relative to the component") ); posYTextCtrl->SetToolTip( _("The Y coordinate of the text relative to the component") );
poxYStaticBoxSizer->Add( posYTextCtrl, 1, wxALL|wxEXPAND, 5 ); posYBoxSizer->Add( posYTextCtrl, 0, wxEXPAND, 5 );
positionBoxSizer->Add( posYBoxSizer, 1, wxALL|wxEXPAND, 5 );
positionBoxSizer->Add( poxYStaticBoxSizer, 1, wxALL|wxEXPAND, 8 ); fieldEditBoxSizer->Add( positionBoxSizer, 1, wxEXPAND, 5 );
fieldEditBoxSizer->Add( positionBoxSizer, 0, wxEXPAND, 5 );
fieldEditBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
defaultsButton = new wxButton( this, wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 ); defaultsButton = new wxButton( this, wxID_ANY, _("Reset to Library Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
fieldEditBoxSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 ); fieldEditBoxSizer->Add( defaultsButton, 0, wxALL|wxEXPAND, 5 );
fieldsSizer->Add( fieldEditBoxSizer, 1, wxEXPAND, 5 );
fieldEditBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
fieldsSizer->Add( fieldEditBoxSizer, 3, wxEXPAND, 5 );
upperSizer->Add( fieldsSizer, 1, wxALL|wxEXPAND, 5 ); upperSizer->Add( fieldsSizer, 1, wxALL|wxEXPAND, 5 );
...@@ -230,8 +219,15 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( ...@@ -230,8 +219,15 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
this->SetSizer( mainSizer ); this->SetSizer( mainSizer );
this->Layout(); this->Layout();
// Connect Events
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
fieldListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
} }
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP() DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP()
{ {
// Disconnect Events
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemDeselected ), NULL, this );
fieldListCtrl->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::OnListItemSelected ), NULL, this );
} }
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/grid.h> #include <wx/listctrl.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/stattext.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -41,25 +42,37 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog ...@@ -41,25 +42,37 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog
wxRadioBox* mirrorRadioBox; wxRadioBox* mirrorRadioBox;
wxTextCtrl* chipnameTxtControl; wxTextCtrl* chipnameTxtControl;
wxCheckBox* convertCheckBox; wxCheckBox* convertCheckBox;
wxGrid* fieldGrid; wxListCtrl* fieldListCtrl;
wxButton* addFieldButton; wxButton* addFieldButton;
wxButton* deleteFieldButton; wxButton* deleteFieldButton;
wxButton* moveUpButton; wxButton* moveUpButton;
wxCheckBox* showCheckBox; wxCheckBox* showCheckBox;
wxCheckBox* rotateCheckBox; wxCheckBox* rotateCheckBox;
wxStaticText* fieldNameLabel;
wxTextCtrl* fieldNameTextCtrl; wxTextCtrl* fieldNameTextCtrl;
wxTextCtrl* m_textCtrl3; wxStaticText* fieldValueLabel;
wxTextCtrl* fieldValueTextCtrl;
wxStaticText* textSizeLabel;
wxTextCtrl* textSizeTextCtrl; wxTextCtrl* textSizeTextCtrl;
wxStaticText* posXLabel;
wxTextCtrl* posXTextCtrl; wxTextCtrl* posXTextCtrl;
wxStaticText* posYLabel;
wxTextCtrl* posYTextCtrl; wxTextCtrl* posYTextCtrl;
wxButton* defaultsButton; wxButton* defaultsButton;
wxStdDialogButtonSizer* stdDialogButtonSizer; wxStdDialogButtonSizer* stdDialogButtonSizer;
wxButton* stdDialogButtonSizerOK; wxButton* stdDialogButtonSizerOK;
wxButton* stdDialogButtonSizerCancel; wxButton* stdDialogButtonSizerCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnListItemDeselected( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); }
public: public:
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 864,540 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Component Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 864,550 ), long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(); ~DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP();
}; };
......
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