Commit a1659e41 authored by dickelbeck's avatar dickelbeck

further dialog development

parent c4215848
......@@ -5,6 +5,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
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>
================================================================================
+all
......@@ -25,8 +34,7 @@ email address.
+eeschema
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
if you want to fully use eeschema. I will get something working in another day,
even if it is the old editor.
if you want to fully use eeschema.
2008-Nov-22 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
......
......@@ -15,10 +15,6 @@
#include "dialog_edit_component_in_schematic.h"
#define ID_ON_SELECT_FIELD 3000
/**********************************************************************/
void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
SCH_COMPONENT* aComponent )
......@@ -38,6 +34,9 @@ void InstallCmpeditFrame( WinEDA_SchematicFrame* parent, wxPoint& pos,
new DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( parent );
frame->InitBuffers( aComponent );
// frame->Layout();
frame->ShowModal();
frame->Destroy();
}
......@@ -93,46 +92,55 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow
{
m_Parent = (WinEDA_SchematicFrame*) parent;
// fieldGrid->SetDefaultColSize( 160, true );
// fieldGrid->SetColLabelValue( 0, _("Field Text") );
m_SelectedRow = 0;
wxListItem columnLabel;
// set grid as read only.
fieldGrid->EnableEditing( false );
columnLabel.SetImage(-1);
// @todo make this conditional on 2.8.8 wxWidgets
fieldGrid->SetRowLabelSize( wxGRID_AUTOSIZE );
columnLabel.SetText( _("Name") );
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
// this means only one cell.
fieldGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
// these must go here late in the game.
fieldListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
fieldListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
copySelectedFieldToPanel();
wxToolTip::Enable( true );
}
/*
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnGridCellLeftClick( wxGridEvent& event )
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnListItemDeselected( wxListEvent& 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 )
{
fieldGrid->SelectCol( 0 );
fieldGrid->SelectRow( aFieldNdx );
fieldListCtrl->SetItemState( aFieldNdx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
fieldListCtrl->EnsureVisible( aFieldNdx );
}
int DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::getSelectedFieldNdx()
{
wxArrayInt array = fieldGrid->GetSelectedRows();
if( !array.IsEmpty() )
return array.Item(0);
else
return -1;
return m_SelectedRow;
}
......@@ -193,99 +201,139 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
#endif
/********************************************************************************/
/*******************************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent )
/********************************************************************************/
/*******************************************************************************/
{
m_Cmp = aComponent;
setSelectedFieldNdx( REFERENCE );
m_FieldBuf = aComponent->m_Fields;
// copy all the fields to a work area
m_FieldsBuf = 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 )
{
// 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;
for( int ii = FIELD1; ii < NUMBER_OF_FIELDS; ii++ )
{
m_FieldSelection->SetString( ii, m_FieldName[ii] );
}
SCH_CMP_FIELD& field = m_FieldsBuf[fieldNdx];
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 )
m_FieldTextCtrl->Enable( FALSE );
*/
if( m_FieldFlags[fieldNdx] )
m_ShowFieldTextCtrl->SetValue( TRUE );
else
m_ShowFieldTextCtrl->SetValue( FALSE );
showCheckBox->SetValue( !(field.m_Attributs & TEXT_NO_VISIBLE) );
// 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
// it the same as the ref field. That is likely to put it at least
// close to the desired position.
if( m_FieldBuf[fieldNdx].m_Pos == wxPoint( 0, 0 )
&& m_FieldBuf[fieldNdx].m_Text.IsEmpty() )
if( field.m_Pos == wxPoint( 0, 0 ) && field.m_Text.IsEmpty() )
{
m_VorientFieldText->SetValue( m_FieldOrient[REFERENCE] != 0 );
m_FieldPositionCtrl->SetValue( m_FieldPosition[REFERENCE].x + 100,
m_FieldPosition[REFERENCE].y + 100 );
wxString dim;
// @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
{
m_FieldPositionCtrl->SetValue( m_FieldPosition[fieldNdx].x, m_FieldPosition[fieldNdx].y );
m_VorientFieldText->SetValue( m_FieldOrient[fieldNdx] != 0 );
wxString dim;
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 )
m_FieldNameCtrl->Enable( FALSE );
else
m_FieldNameCtrl->Enable( TRUE );
#if 0
m_FieldNameCtrl->SetValue( m_FieldName[fieldNdx] );
m_FieldTextCtrl->SetValue( m_FieldText[fieldNdx] );
m_FieldTextCtrl->SetValue( m_FieldSize[fieldNdx] );
#endif
}
/*****************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToSelectedField()
/*****************************************************************/
{
unsigned fieldNdx = getSelectedFieldNdx();
/****************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelFieldToData()
/****************************************************************/
if( fieldNdx >= m_FieldsBuf.size() )
return;
/* Copy the values displayed on the panel field to the buffers according to
* the current field number
*/
{
int id = m_CurrentFieldId;
m_FieldFlags[id] = m_ShowFieldTextCtrl->GetValue();
m_FieldOrient[id] = m_VorientFieldText->GetValue();
m_FieldText[id] = m_FieldTextCtrl->GetText();
m_FieldName[id] = m_FieldNameCtrl->GetValue();
m_FieldPosition[id] = m_FieldPositionCtrl->GetValue();
m_FieldSize[id] = m_FieldTextCtrl->GetTextSize();
SCH_CMP_FIELD& field = m_FieldsBuf[fieldNdx];
field.m_Name = fieldNameTextCtrl->GetValue();
field.m_Text = fieldValueTextCtrl->GetValue();
// field.m_Size =
// m_FieldPosition[id] = m_FieldPositionCtrl->GetValue();
// m_FieldSize[id] = m_FieldTextCtrl->GetTextSize();
}
#if 0
/*************************************************************/
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::fillTableModel()
/*************************************************************/
......
......@@ -32,8 +32,8 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP</property>
<property name="pos"></property>
<property name="size">864,540</property>
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property>
<property name="size">864,550</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="title">Component Properties</property>
<property name="tooltip"></property>
......@@ -267,7 +267,7 @@
<property name="name">mirrorRadioBox</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="selection">0</property>
<property name="selection">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
......@@ -453,7 +453,7 @@
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<property name="proportion">4</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
......@@ -463,98 +463,36 @@
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="border">8</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="1">
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<object class="wxListCtrl" expanded="1">
<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="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="fg"></property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="hidden">0</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="minimum_size"></property>
<property name="name">fieldGrid</property>
<property name="name">fieldListCtrl</property>
<property name="permission">protected</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="style">wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES</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_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">wxSIMPLE_BORDER|wxVSCROLL</property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></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="OnKeyUp"></event>
<event name="OnKillFocus"></event>
......@@ -562,6 +500,26 @@
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></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="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
......@@ -579,7 +537,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
......@@ -635,7 +593,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
......@@ -691,7 +649,7 @@
</object>
<object class="sizeritem" expanded="1">
<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>
<object class="wxButton" expanded="1">
<property name="bg"></property>
......@@ -750,17 +708,17 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<property name="proportion">3</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">fieldEditBoxSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="0">
<property name="id">wxID_ANY</property>
<property name="label">Visibility</property>
<property name="minimum_size"></property>
......@@ -883,20 +841,72 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Field Name</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">fieldNameStaticBoxSizer</property>
<property name="name">fieldNameBoxSizer</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="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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
......@@ -915,7 +925,7 @@
<property name="size"></property>
<property name="style"></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_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
......@@ -956,20 +966,72 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Field Text</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">fieldTextStaticBoxSizer</property>
<property name="name">fieldTextBoxSizer</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="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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
......@@ -982,7 +1044,7 @@
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="minimum_size"></property>
<property name="name">m_textCtrl3</property>
<property name="name">fieldValueTextCtrl</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
......@@ -1029,20 +1091,72 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="flag">wxEXPAND|wxLEFT|wxRIGHT|wxTOP</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Size (&quot;)</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">textSizeStaticBoxSizer</property>
<property name="name">textSizeBoxSizer</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="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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
......@@ -1104,28 +1218,80 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0">
<property name="minimum_size"></property>
<property name="name">positionBoxSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</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="label">PosX(&quot;)</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">posXStaticBoxSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<property name="name">posXLabel</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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
......@@ -1143,7 +1309,7 @@
<property name="size"></property>
<property name="style"></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_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
......@@ -1184,21 +1350,73 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">8</property>
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">PosY(&quot;)</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">poxYStaticBoxSizer</property>
<property name="name">posYBoxSizer</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="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>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">1</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
......@@ -1258,6 +1476,16 @@
</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">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
......@@ -1314,6 +1542,16 @@
<event name="OnUpdateUI"></event>
</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>
......
......@@ -16,28 +16,41 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC : public DIALOG_EDIT_COMPONENT_IN_SCHEM
SCH_COMPONENT* m_Cmp;
EDA_LibComponentStruct* m_LibEntry;
int m_SelectedRow;
/// a copy of the edited component's SCH_CMP_FIELDs
SCH_CMP_FIELDS m_FieldBuf;
SCH_CMP_FIELDS m_FieldsBuf;
void setSelectedFieldNdx( int aFieldNdx );
int getSelectedFieldNdx();
/**
* Function CopyDataToPanel
* Function copySelectedFieldToPanel
* 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 setRowItem( int aFieldNdx, const SCH_CMP_FIELD& aField );
// event handlers
void OnListItemDeselected( wxListEvent& event );
void OnListItemSelected( wxListEvent& event );
protected:
// Handlers for DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP events.
// void OnGridCellLeftClick( wxGridEvent& event );
public:
/** Constructor */
......
......@@ -52,7 +52,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
wxString mirrorRadioBoxChoices[] = { _("Normal"), _("Mirror ---"), _("Mirror |") };
int mirrorRadioBoxNChoices = sizeof( mirrorRadioBoxChoices ) / sizeof( wxString );
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") );
mirrorSizer->Add( mirrorRadioBox, 1, wxALL, 8 );
......@@ -83,60 +83,25 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
wxStaticBoxSizer* gridStaticBoxSizer;
gridStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
fieldGrid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxVSCROLL );
// 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 );
fieldListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
gridStaticBoxSizer->Add( fieldListCtrl, 1, wxALL|wxEXPAND, 8 );
addFieldButton = new wxButton( this, wxID_ANY, _("Add Field"), wxDefaultPosition, wxDefaultSize, 0 );
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->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->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;
fieldEditBoxSizer = new wxBoxSizer( wxVERTICAL );
......@@ -154,67 +119,91 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
visibilitySizer->Add( rotateCheckBox, 1, wxALL, 5 );
fieldEditBoxSizer->Add( visibilitySizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 8 );
fieldEditBoxSizer->Add( visibilitySizer, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* fieldNameStaticBoxSizer;
fieldNameStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Field Name") ), wxVERTICAL );
wxBoxSizer* fieldNameBoxSizer;
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->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;
fieldTextStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Field Text") ), wxVERTICAL );
fieldValueTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fieldValueTextCtrl->SetToolTip( _("The text (or value) of the currently selected field") );
m_textCtrl3 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textCtrl3->SetToolTip( _("The text (or value) of the currently selected field") );
fieldTextBoxSizer->Add( fieldValueTextCtrl, 0, wxEXPAND, 5 );
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;
textSizeStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Size (\")") ), wxVERTICAL );
textSizeLabel = new wxStaticText( this, wxID_ANY, _("Size(\")"), wxDefaultPosition, wxDefaultSize, 0 );
textSizeLabel->Wrap( -1 );
textSizeBoxSizer->Add( textSizeLabel, 0, 0, 5 );
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") );
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;
positionBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* posXStaticBoxSizer;
posXStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("PosX(\")") ), wxHORIZONTAL );
wxBoxSizer* posXBoxSizer;
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->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;
poxYStaticBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("PosY(\")") ), wxVERTICAL );
posYLabel = new wxStaticText( this, wxID_ANY, _("PosY(\")"), wxDefaultPosition, wxDefaultSize, 0 );
posYLabel->Wrap( -1 );
posYBoxSizer->Add( posYLabel, 0, 0, 5 );
posYTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
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 );
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 );
......@@ -230,8 +219,15 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP(
this->SetSizer( mainSizer );
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()
{
// 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 @@
#include <wx/radiobox.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/grid.h>
#include <wx/listctrl.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
......@@ -41,25 +42,37 @@ class DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_FBP : public wxDialog
wxRadioBox* mirrorRadioBox;
wxTextCtrl* chipnameTxtControl;
wxCheckBox* convertCheckBox;
wxGrid* fieldGrid;
wxListCtrl* fieldListCtrl;
wxButton* addFieldButton;
wxButton* deleteFieldButton;
wxButton* moveUpButton;
wxCheckBox* showCheckBox;
wxCheckBox* rotateCheckBox;
wxStaticText* fieldNameLabel;
wxTextCtrl* fieldNameTextCtrl;
wxTextCtrl* m_textCtrl3;
wxStaticText* fieldValueLabel;
wxTextCtrl* fieldValueTextCtrl;
wxStaticText* textSizeLabel;
wxTextCtrl* textSizeTextCtrl;
wxStaticText* posXLabel;
wxTextCtrl* posXTextCtrl;
wxStaticText* posYLabel;
wxTextCtrl* posYTextCtrl;
wxButton* defaultsButton;
wxStdDialogButtonSizer* stdDialogButtonSizer;
wxButton* stdDialogButtonSizerOK;
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:
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();
};
......
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