Minor fixes:

* fix minor coding style issues.
* remove unused member in modview_frame.
* use different frame names in ctor of modview_frame and viewlib_frame depending on the fact they are built modal or not modal (allowing identifications when calling wxFindWindowByName)
* change questionnable code in  class_libentry.cpp.
* remove unused code in class_treeproject_item.cpp
This commit is contained in:
jean-pierre charras 2015-12-22 12:58:26 +01:00
parent e47bc6883d
commit 59d02cf1a4
9 changed files with 30 additions and 20 deletions

View File

@ -537,7 +537,7 @@ void LIB_PART::RemoveDrawItem( LIB_ITEM* aItem, EDA_DRAW_PANEL* aPanel, wxDC* aD
LIB_ITEMS::iterator i; LIB_ITEMS::iterator i;
for( i = drawings.begin(); i < drawings.end(); i++ ) for( i = drawings.begin(); i != drawings.end(); i++ )
{ {
if( *i == aItem ) if( *i == aItem )
{ {
@ -1222,7 +1222,7 @@ void LIB_PART::deleteAllFields()
{ {
LIB_ITEMS::iterator it; LIB_ITEMS::iterator it;
for( it = drawings.begin(); it!=drawings.end(); /* deleting */ ) for( it = drawings.begin(); it != drawings.end(); /* deleting */ )
{ {
if( it->Type() != LIB_FIELD_T ) if( it->Type() != LIB_FIELD_T )
{ {
@ -1709,7 +1709,7 @@ wxArrayString LIB_PART::GetAliasNames( bool aIncludeRoot ) const
LIB_ALIASES::const_iterator it; LIB_ALIASES::const_iterator it;
for( it=m_aliases.begin(); it<m_aliases.end(); ++it ) for( it=m_aliases.begin(); it != m_aliases.end(); ++it )
{ {
if( !aIncludeRoot && (*it)->IsRoot() ) if( !aIncludeRoot && (*it)->IsRoot() )
continue; continue;
@ -1756,7 +1756,7 @@ void LIB_PART::SetAliases( const wxArrayString& aAliasList )
// Remove names in the current component that are not in the new alias list. // Remove names in the current component that are not in the new alias list.
LIB_ALIASES::iterator it; LIB_ALIASES::iterator it;
for( it = m_aliases.begin(); it < m_aliases.end(); it++ ) for( it = m_aliases.begin(); it != m_aliases.end(); it++ )
{ {
int index = aAliasList.Index( (*it)->GetName(), false ); int index = aAliasList.Index( (*it)->GetName(), false );
@ -1778,7 +1778,7 @@ void LIB_PART::RemoveAlias( const wxString& aName )
LIB_ALIASES::iterator it; LIB_ALIASES::iterator it;
for( it = m_aliases.begin(); it < m_aliases.end(); it++ ) for( it = m_aliases.begin(); it != m_aliases.end(); it++ )
{ {
if( Cmp_KEEPCASE( aName, (*it)->GetName() ) == 0 ) if( Cmp_KEEPCASE( aName, (*it)->GetName() ) == 0 )
{ {

View File

@ -93,6 +93,7 @@ END_EVENT_TABLE()
*/ */
#define LIB_VIEW_FRAME_NAME wxT( "ViewlibFrame" ) #define LIB_VIEW_FRAME_NAME wxT( "ViewlibFrame" )
#define LIB_VIEW_FRAME_NAME_MODAL wxT( "ViewlibFrameModal" )
LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType, LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
PART_LIB* aLibrary ) : PART_LIB* aLibrary ) :
@ -105,13 +106,17 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT : KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT :
#endif #endif
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_DEFAULT_DRAWFRAME_STYLE,
LIB_VIEW_FRAME_NAME ) aFrameType == FRAME_SCH_VIEWER_MODAL ?
LIB_VIEW_FRAME_NAME_MODAL : LIB_VIEW_FRAME_NAME )
{ {
wxASSERT( aFrameType == FRAME_SCH_VIEWER || aFrameType == FRAME_SCH_VIEWER_MODAL ); wxASSERT( aFrameType == FRAME_SCH_VIEWER || aFrameType == FRAME_SCH_VIEWER_MODAL );
if( aFrameType == FRAME_SCH_VIEWER_MODAL ) if( aFrameType == FRAME_SCH_VIEWER_MODAL )
SetModal( true ); SetModal( true );
// Force the frame name used in config. the lib viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),
// but only one configuration is preferable.
m_configFrameName = LIB_VIEW_FRAME_NAME; m_configFrameName = LIB_VIEW_FRAME_NAME;
// Give an icon // Give an icon

View File

@ -224,12 +224,9 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
OpenPDF( fullFileName ); OpenPDF( fullFileName );
break; break;
/* No, use a text editor. Netlists can only be handled sanely now from within
eeschema's launcher for the *.kiface, NOT THE EXE which is now gone.
case TREE_NET: case TREE_NET:
frame->Execute( m_parent, CVPCB_EXE, fullFileName ); // Nothing to do ( can be read only by Pcbnew, or by a text editor)
break; break;
*/
case TREE_TXT: case TREE_TXT:
{ {

View File

@ -99,7 +99,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway,
#endif #endif
FOOTPRINT_WIZARD_FRAME_NAME ) FOOTPRINT_WIZARD_FRAME_NAME )
{ {
wxASSERT( aFrameType==FRAME_PCB_FOOTPRINT_WIZARD_MODAL ); wxASSERT( aFrameType == FRAME_PCB_FOOTPRINT_WIZARD_MODAL );
// This frame is always show modal: // This frame is always show modal:
SetModal( true ); SetModal( true );

View File

@ -740,7 +740,8 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame(); EDA_3D_FRAME* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame ) if( draw3DFrame )
draw3DFrame->ReloadRequest();} draw3DFrame->ReloadRequest();
}
void FOOTPRINT_EDIT_FRAME::updateTitle() void FOOTPRINT_EDIT_FRAME::updateTitle()

View File

@ -114,6 +114,7 @@ END_EVENT_TABLE()
#define FOOTPRINT_VIEWER_FRAME_NAME wxT( "ModViewFrame" ) #define FOOTPRINT_VIEWER_FRAME_NAME wxT( "ModViewFrame" )
#define FOOTPRINT_VIEWER_FRAME_NAME_MODAL wxT( "ModViewFrameModal" )
FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType ) : FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType ) :
@ -126,14 +127,22 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT : KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT :
#endif #endif
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_DEFAULT_DRAWFRAME_STYLE,
FOOTPRINT_VIEWER_FRAME_NAME )
aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ?
FOOTPRINT_VIEWER_FRAME_NAME_MODAL
: FOOTPRINT_VIEWER_FRAME_NAME )
{ {
wxASSERT( aFrameType==FRAME_PCB_MODULE_VIEWER || aFrameType==FRAME_PCB_MODULE_VIEWER_MODAL ); wxASSERT( aFrameType==FRAME_PCB_MODULE_VIEWER ||
aFrameType==FRAME_PCB_MODULE_VIEWER_MODAL );
if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL ) if( aFrameType == FRAME_PCB_MODULE_VIEWER_MODAL )
SetModal( true ); SetModal( true );
// Force the frame name used in config. the footprint viewer frame has a name
// depending on aFrameType (needed to identify the frame by wxWidgets),
// but only one configuration is preferable.
m_configFrameName = FOOTPRINT_VIEWER_FRAME_NAME; m_configFrameName = FOOTPRINT_VIEWER_FRAME_NAME;
m_showAxis = true; // true to draw axis. m_showAxis = true; // true to draw axis.
// Give an icon // Give an icon

View File

@ -67,8 +67,6 @@ private:
wxListBox* m_libList; // The list of libs names wxListBox* m_libList; // The list of libs names
wxListBox* m_footprintList; // The list of footprint names wxListBox* m_footprintList; // The list of footprint names
wxString m_configPath; // subpath for configuration
const wxString getCurNickname(); const wxString getCurNickname();
void setCurNickname( const wxString& aNickname ); void setCurNickname( const wxString& aNickname );

View File

@ -148,7 +148,7 @@ static struct IFACE : public KIFACE_I
break; break;
default: default:
; break;
} }
return frame; return frame;