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
dialog_lib_new_component_base.cpp
dialog_print_using_printer_base.cpp
dialog_print_using_printer.cpp
dialog_sch_sheet_props.cpp
dialog_sch_sheet_props_base.cpp
dialog_SVG_print.cpp
dialog_SVG_print_base.cpp
edit_component_in_lib.cpp
......
......@@ -75,7 +75,7 @@ void ReAnnotatePowerSymbolsOnly( void )
LIB_COMPONENT* Entry =
CMP_LIBRARY::FindLibraryComponent( DrawLibItem->m_ChipName );
if( (Entry == NULL) || (Entry->m_Options != ENTRY_POWER) )
if( ( Entry == NULL ) || !Entry->isPower() )
continue;
//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 )
if( Entry == NULL )
return NULL;
wxASSERT( Entry->Type == ROOT );
wxASSERT( Entry->isComponent() );
return Entry->GetPin( number, m_Multi, m_Convert );
}
......@@ -1099,7 +1099,7 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
GetRef(((WinEDA_SchematicFrame*)frame)->GetSheet()),
DARKCYAN );
if( Entry->m_Options == ENTRY_POWER )
if( Entry->isPower() )
msg = _( "Power symbol" );
else
msg = _( "Name" );
......@@ -1110,8 +1110,8 @@ void SCH_COMPONENT::DisplayInfo( WinEDA_DrawFrame* frame )
msg = Entry->GetLibraryName();
frame->AppendMsgPanel( _( "Library" ), msg, DARKRED );
frame->AppendMsgPanel( _( "Description" ), Entry->m_Doc, DARKCYAN );
frame->AppendMsgPanel( _( "Key words" ), Entry->m_KeyWord, DARKCYAN );
frame->AppendMsgPanel( _( "Description" ), Entry->GetDescription(), DARKCYAN );
frame->AppendMsgPanel( _( "Key words" ), Entry->GetKeyWords(), DARKCYAN );
}
/** virtual function Mirror_Y
......
This diff is collapsed.
This diff is collapsed.
......@@ -82,9 +82,9 @@ void DisplayCmpDoc( wxString& Name )
return;
wxLogDebug( wxT( "Selected component <%s>, m_Doc: <%s>, m_KeyWord: <%s>." ),
GetChars( Name ), GetChars( CmpEntry->m_Doc ),
GetChars( CmpEntry->m_KeyWord ) );
GetChars( Name ), GetChars( CmpEntry->GetDescription() ),
GetChars( CmpEntry->GetKeyWords() ) );
Name = wxT( "Description: " ) + CmpEntry->m_Doc;
Name += wxT( "\nKey Words: " ) + CmpEntry->m_KeyWord;
Name = wxT( "Description: " ) + CmpEntry->GetDescription();
Name += wxT( "\nKey Words: " ) + CmpEntry->GetKeyWords();
}
......@@ -114,10 +114,10 @@ void WinEDA_CreateCmpDialog::SetComponentData( LIB_COMPONENT & component )
else
component.m_TextInside = m_SetSkew->GetValue();
if ( m_IsPowerSymbol->GetValue() == TRUE)
component.m_Options = ENTRY_POWER;
if ( m_IsPowerSymbol->GetValue() == TRUE )
component.SetPower();
else
component.m_Options = ENTRY_NORMAL;
component.SetNormal();
/* Set the option "Units locked".
Obviously, cannot be TRUE if there is only one part */
......
......@@ -267,7 +267,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
LIB_COMPONENT* entry =
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;
// copy all the fields back, and change the length of m_Fields.
......@@ -527,7 +527,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
// For power symbols, the value is NOR editable, because value and pin
// 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 );
else
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.
#ifndef __dialog_sch_sheet_props__
#define __dialog_sch_sheet_props__
/**
* @file
* Subclass of DIALOG_SCH_SHEET_PROPS_BASE, which is generated by wxFormBuilder.
*/
#include "dialog_sch_sheet_props_base.h"
/** Implementing DIALOG_SCH_SHEET_PROPS_BASE */
class DIALOG_SCH_SHEET_PROPS : public DIALOG_SCH_SHEET_PROPS_BASE
{
public:
/** Constructor */
DIALOG_SCH_SHEET_PROPS( wxWindow* parent );
void SetFileName( const wxString& aFileName )
{
m_textFileName->SetValue( aFileName );
}
wxString GetFileName() { return m_textFileName->GetValue(); }
void SetSheetName( const wxString& aSheetName )
{
m_textSheetName->SetValue( aSheetName );
}
wxString GetSheetName() { return m_textSheetName->GetValue(); }
void SetFileNameTextSize( const wxString& aTextSize )
{
m_textFileNameSize->SetValue( aTextSize );
}
wxString GetFileNameTextSize() { return m_textFileNameSize->GetValue(); }
void SetSheetNameTextSize( const wxString& aTextSize )
{
m_textSheetNameSize->SetValue( aTextSize );
}
wxString GetSheetNameTextSize() { return m_textSheetNameSize->GetValue(); }
void SetFileNameTextSizeUnits(const wxString& aUnits)
{
m_staticFileNameSizeUnits->SetLabel( aUnits );
}
void SetSheetNameTextSizeUnits(const wxString& aUnits)
{
m_staticSheetNameSizeUnits->SetLabel( aUnits );
}
};
#endif // __dialog_sch_sheet_props__
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 )
{
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 \
modified!\nYou must create a new power" ) );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "wx/msw/wx.rc"
This diff is collapsed.
This diff is collapsed.
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