Commit 014d852b authored by stambaughw's avatar stambaughw

Dialog work and other minor changes.

* Replace EESchema sheet properties dialog with wxFormBuilder version.
* Editing an existing sheet now marks schematic as modified.
* Code style updates for some of my previous work.
* Improvements to the CMP_LIB_ENTRY object.
* Replaced symbol edit export fprintf code with wxFFile implementation.
* GCC compiler warning fix in pcbnew/drc.cpp.
parent 867737e2
...@@ -65,6 +65,8 @@ set(EESCHEMA_SRCS ...@@ -65,6 +65,8 @@ set(EESCHEMA_SRCS
dialog_lib_new_component_base.cpp dialog_lib_new_component_base.cpp
dialog_print_using_printer_base.cpp dialog_print_using_printer_base.cpp
dialog_print_using_printer.cpp dialog_print_using_printer.cpp
dialog_sch_sheet_props.cpp
dialog_sch_sheet_props_base.cpp
dialog_SVG_print.cpp dialog_SVG_print.cpp
dialog_SVG_print_base.cpp dialog_SVG_print_base.cpp
edit_component_in_lib.cpp edit_component_in_lib.cpp
......
...@@ -75,7 +75,7 @@ void ReAnnotatePowerSymbolsOnly( void ) ...@@ -75,7 +75,7 @@ void ReAnnotatePowerSymbolsOnly( void )
LIB_COMPONENT* Entry = LIB_COMPONENT* Entry =
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName ); CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
if( (Entry == NULL) || (Entry->m_Options != ENTRY_POWER) ) if( ( Entry == NULL ) || !Entry->isPower() )
continue; continue;
//DrawLibItem->ClearAnnotation(sheet); this clears all annotation :( //DrawLibItem->ClearAnnotation(sheet); this clears all annotation :(
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -525,7 +525,7 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number ) ...@@ -525,7 +525,7 @@ LIB_PIN* SCH_COMPONENT::GetPin( const wxString& number )
if( Entry == NULL ) if( Entry == NULL )
return NULL; return NULL;
wxASSERT( Entry->Type == ROOT ); wxASSERT( Entry->isComponent() );
return Entry->GetPin( number, m_Multi, m_Convert ); return Entry->GetPin( number, m_Multi, m_Convert );
} }
...@@ -1099,7 +1099,7 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -1099,7 +1099,7 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()), GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()),
DARKCYAN ); DARKCYAN );
if( Entry->m_Options == ENTRY_POWER ) if( Entry->isPower() )
msg = _( "Power symbol" ); msg = _( "Power symbol" );
else else
msg = _( "Name" ); msg = _( "Name" );
...@@ -1110,8 +1110,8 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -1110,8 +1110,8 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
msg = Entry->GetLibraryName(); msg = Entry->GetLibraryName();
frame->AppendMsgPanel( _( "Library" ), msg, DARKRED ); frame->AppendMsgPanel( _( "Library" ), msg, DARKRED );
frame->AppendMsgPanel( _( "Description" ), Entry->m_Doc, DARKCYAN ); frame->AppendMsgPanel( _( "Description" ), Entry->GetDescription(), DARKCYAN );
frame->AppendMsgPanel( _( "Key words" ), Entry->m_KeyWord, DARKCYAN ); frame->AppendMsgPanel( _( "Key words" ), Entry->GetKeyWords(), DARKCYAN );
} }
/** virtual function Mirror_Y /** virtual function Mirror_Y
......
This diff is collapsed.
This diff is collapsed.
...@@ -82,9 +82,9 @@ void DisplayCmpDoc( wxString& Name ) ...@@ -82,9 +82,9 @@ void DisplayCmpDoc( wxString& Name )
return; return;
wxLogDebug( wxT( "Selected component <%s>, m_Doc: <%s>, m_KeyWord: <%s>." ), wxLogDebug( wxT( "Selected component <%s>, m_Doc: <%s>, m_KeyWord: <%s>." ),
GetChars( Name ), GetChars( CmpEntry->m_Doc ), GetChars( Name ), GetChars( CmpEntry->GetDescription() ),
GetChars( CmpEntry->m_KeyWord ) ); GetChars( CmpEntry->GetKeyWords() ) );
Name = wxT( "Description: " ) + CmpEntry->m_Doc; Name = wxT( "Description: " ) + CmpEntry->GetDescription();
Name += wxT( "\nKey Words: " ) + CmpEntry->m_KeyWord; Name += wxT( "\nKey Words: " ) + CmpEntry->GetKeyWords();
} }
...@@ -114,10 +114,10 @@ void WinEDA_CreateCmpDialog::SetComponentData( LIB_COMPONENT & component ) ...@@ -114,10 +114,10 @@ void WinEDA_CreateCmpDialog::SetComponentData( LIB_COMPONENT & component )
else else
component.m_TextInside = m_SetSkew->GetValue(); component.m_TextInside = m_SetSkew->GetValue();
if ( m_IsPowerSymbol->GetValue() == TRUE) if ( m_IsPowerSymbol->GetValue() == TRUE )
component.m_Options = ENTRY_POWER; component.SetPower();
else else
component.m_Options = ENTRY_NORMAL; component.SetNormal();
/* Set the option "Units locked". /* Set the option "Units locked".
Obviously, cannot be TRUE if there is only one part */ Obviously, cannot be TRUE if there is only one part */
......
...@@ -267,7 +267,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event ...@@ -267,7 +267,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
LIB_COMPONENT* entry = LIB_COMPONENT* entry =
CMP_LIBRARY::FindLibraryComponent( m_Cmp->m_ChipName ); CMP_LIBRARY::FindLibraryComponent( m_Cmp->m_ChipName );
if( entry && entry->m_Options == ENTRY_POWER ) if( entry && entry->isPower() )
m_FieldsBuf[VALUE].m_Text = m_Cmp->m_ChipName; m_FieldsBuf[VALUE].m_Text = m_Cmp->m_ChipName;
// copy all the fields back, and change the length of m_Fields. // copy all the fields back, and change the length of m_Fields.
...@@ -527,7 +527,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel() ...@@ -527,7 +527,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
// For power symbols, the value is NOR editable, because value and pin // For power symbols, the value is NOR editable, because value and pin
// name must be same and can be edited only in library editor // name must be same and can be edited only in library editor
if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->m_Options == ENTRY_POWER ) if( fieldNdx == VALUE && m_LibEntry && m_LibEntry->isPower() )
fieldValueTextCtrl->Enable( false ); fieldValueTextCtrl->Enable( false );
else else
fieldValueTextCtrl->Enable( true ); fieldValueTextCtrl->Enable( true );
......
#include "dialog_sch_sheet_props.h"
DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS( wxWindow* parent ) :
DIALOG_SCH_SHEET_PROPS_BASE( parent )
{
m_textFileName->SetFocus();
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -102,7 +102,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC ) ...@@ -102,7 +102,7 @@ void WinEDA_SchematicFrame::EditCmpFieldText( SCH_FIELD* Field, wxDC* DC )
{ {
Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName ); Entry = CMP_LIBRARY::FindLibraryComponent( Cmp->m_ChipName );
if( Entry && (Entry->m_Options == ENTRY_POWER) ) if( Entry && Entry->isPower() )
{ {
DisplayInfoMessage( this, _( "Part is a POWER, value cannot be \ DisplayInfoMessage( this, _( "Part is a POWER, value cannot be \
modified!\nYou must create a new power" ) ); modified!\nYou must create a new power" ) );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -69,6 +69,9 @@ int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, ...@@ -69,6 +69,9 @@ int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
ListNames = (const wxChar**) MyZMalloc( ( nameList.GetCount() + 1 ) * ListNames = (const wxChar**) MyZMalloc( ( nameList.GetCount() + 1 ) *
sizeof( wxChar* ) ); sizeof( wxChar* ) );
if( ListNames == NULL )
return 0;
for( i = 0; i < nameList.GetCount(); i++ ) for( i = 0; i < nameList.GetCount(); i++ )
ListNames[i] = (const wxChar*) nameList[i]; ListNames[i] = (const wxChar*) nameList[i];
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "wx/msw/wx.rc"
This diff is collapsed.
...@@ -159,7 +159,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar() ...@@ -159,7 +159,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
SelpartBox->Enable( parts_count > 1 ); SelpartBox->Enable( parts_count > 1 );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC,
entry && ( entry->m_DocFile != wxEmptyString ) ); entry && ( entry->GetDocFileName() != wxEmptyString ) );
} }
......
This diff is collapsed.
This diff is collapsed.
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