Commit 67e28ade authored by Dick Hollenbeck's avatar Dick Hollenbeck
Browse files

++eeschema

    Add shim class SCH_BASE_FRAME which introduces the data model SCH_SCREEN
    to the frame class hierarchy.
parent f6940353
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ KiCad ChangeLog 2012
    Carve out TITLE_BLOCK from BASE_SCREEN, add include/hashtables.h and
    put class PROPERTIES in there.  Change PROPERTIES to use "const char*"
    as the key instead of wxString.
++eeschema
    Add shim class SCH_BASE_FRAME which introduces the data model SCH_SCREEN
    to the frame class hierarchy.


2012-Jan-5 UPDATE Dick Hollenbeck <dick@softplc.com>
+2 −2
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ may choose to document this corresponding work in the CHANGELOG.txt file.
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2011 <author>
 * Copyright (C) 2011 KiCad Developers, see change_log.txt for contributors.
 * Copyright (C) 2012 <author>
 * Copyright (C) 2012 KiCad Developers, see change_log.txt for contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
+1 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ set(EESCHEMA_SRCS
    onrightclick.cpp
    operations_on_items_lists.cpp
    pinedit.cpp
    sch_base_frame.cpp
    sch_bitmap.cpp
    sch_bus_entry.cpp
    sch_collectors.cpp
+1 −34
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent,
                                const wxPoint&  pos,
                                const wxSize&   size,
                                long            style ) :
    EDA_DRAW_FRAME( aParent, LIBEDITOR_FRAME, title, pos, size, style )
    SCH_BASE_FRAME( aParent, LIBEDITOR_FRAME, title, pos, size, style )
{
    wxASSERT( aParent );

@@ -287,39 +287,6 @@ LIB_EDIT_FRAME::~LIB_EDIT_FRAME()
}


void LIB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
{
    GetScreen()->SetPageSettings( aPageSettings );
}


const PAGE_INFO& LIB_EDIT_FRAME::GetPageSettings () const
{
    return GetScreen()->GetPageSettings();
}


const wxSize LIB_EDIT_FRAME::GetPageSizeIU() const
{
    // GetSizeIU is compile time dependent:
    return GetScreen()->GetPageSettings().GetSizeIU();
}


const wxPoint& LIB_EDIT_FRAME::GetOriginAxisPosition() const
{
    wxASSERT( GetScreen() );
    return GetScreen()->GetOriginAxisPosition();
}


void LIB_EDIT_FRAME::SetOriginAxisPosition( const wxPoint& aPosition )
{
    wxASSERT( GetScreen() );
    GetScreen()->SetOriginAxisPosition( aPosition );
}


void LIB_EDIT_FRAME::LoadSettings()
{
    wxConfig* cfg;
+11 −23
Original line number Diff line number Diff line
@@ -28,14 +28,14 @@
 * @brief Definition of class LIB_EDIT_FRAME
 */

#ifndef __LIBEDITFRM_H__
#define __LIBEDITFRM_H__
#ifndef LIBEDITFRM_H_
#define LIBEDITFRM_H_

#include "wxstruct.h"
#include "class_sch_screen.h"
#include <sch_base_frame.h>
#include <class_sch_screen.h>

#include "lib_draw_item.h"
#include "lib_collectors.h"
#include <lib_draw_item.h>
#include <lib_collectors.h>


class SCH_EDIT_FRAME;
@@ -49,7 +49,7 @@ class DIALOG_LIB_EDIT_TEXT;
/**
 * The component library editor main window.
 */
class LIB_EDIT_FRAME : public EDA_DRAW_FRAME
class LIB_EDIT_FRAME : public SCH_BASE_FRAME
{
    LIB_COMPONENT* m_tempCopyComponent;  ///< Temporary copy of current component during edit.
    LIB_COLLECTOR m_collectedItems;      // Used for hit testing.
@@ -122,9 +122,9 @@ class LIB_EDIT_FRAME : public EDA_DRAW_FRAME
    LIB_ITEM* locateItem( const wxPoint& aPosition, const KICAD_T aFilterList[] );

public:
    LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, const wxString& title,
                    const wxPoint& pos, const wxSize& size,
                    long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
    LIB_EDIT_FRAME( SCH_EDIT_FRAME* aParent, const wxString& aTitle,
                    const wxPoint& aPosition, const wxSize& aSize,
                    long aStyle = KICAD_DEFAULT_DRAWFRAME_STYLE );

    ~LIB_EDIT_FRAME();

@@ -257,18 +257,6 @@ public:
    double BestZoom();         // Returns the best zoom
    void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );

    SCH_SCREEN* GetScreen() const { return (SCH_SCREEN*) EDA_DRAW_FRAME::GetScreen(); }

    // note: a common base class shared between LIB_EDIT_FRAME, LIB_VIEW_FRAME, and SCH_EDIT_FRAME
    // would allow sharing of these 5 functions:

    void SetPageSettings( const PAGE_INFO& aPageSettings );     // overload EDA_DRAW_FRAME
    const PAGE_INFO& GetPageSettings () const;                  // overload EDA_DRAW_FRAME
    const wxSize GetPageSizeIU() const;                         // overload EDA_DRAW_FRAME

    const wxPoint& GetOriginAxisPosition() const;               // overload EDA_DRAW_FRAME
    void SetOriginAxisPosition( const wxPoint& aPosition );     // overload EDA_DRAW_FRAME

    void OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, EDA_ITEM* aItem = NULL );

    void GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey = 0 );
@@ -599,4 +587,4 @@ public:
    DECLARE_EVENT_TABLE()
};

#endif  /* __LIBEDITFRM_H__ */
#endif  // LIBEDITFRM_H_
Loading