Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
0ee7234c
Commit
0ee7234c
authored
Oct 30, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sweet editor work
parent
8a034512
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
169 additions
and
20 deletions
+169
-20
CMakeLists.txt
new/CMakeLists.txt
+4
-9
sch_canvas.cpp
new/sch_canvas.cpp
+87
-0
sch_canvas.h
new/sch_canvas.h
+67
-0
sch_part.cpp
new/sch_part.cpp
+1
-1
sch_part.h
new/sch_part.h
+2
-2
sch_sweet_parser.cpp
new/sch_sweet_parser.cpp
+1
-1
sweet_editor_panel.cpp
new/sweet_editor_panel.cpp
+1
-1
sweet_editor_panel.fbp
new/sweet_editor_panel.fbp
+4
-4
sweet_editor_panel.h
new/sweet_editor_panel.h
+2
-2
No files found.
new/CMakeLists.txt
View file @
0ee7234c
...
...
@@ -42,9 +42,9 @@ if( 1 )
# On Apple only wxwidgets 2.9 or higher doesn't need to find aui part of base
if
(
APPLE
)
find_package
(
wxWidgets COMPONENTS gl adv html core net base xml QUIET
)
find_package
(
wxWidgets COMPONENTS gl adv html core net base xml QUIET
)
else
()
find_package
(
wxWidgets COMPONENTS gl a
ui adv html core net base xml QUIET
)
find_package
(
wxWidgets COMPONENTS gl a
dv html core net base xml aui QUIET
)
endif
()
check_find_package_result
(
wxWidgets_FOUND
"wxWidgets"
)
...
...
@@ -168,12 +168,7 @@ if( MINGW )
endif
()
target_link_libraries
(
test_sch_lib_table sweet
)
include_directories
(
"
${
gal_ROOT
}
/gal/cairo"
)
include_directories
(
"
${
gal_ROOT
}
/gal/common"
)
include_directories
(
"
${
gal_ROOT
}
/gal/font"
)
include_directories
(
"
${
gal_ROOT
}
/gal/opengl"
)
include_directories
(
"
${
gal_ROOT
}
/math"
)
include_directories
(
"
${
gal_ROOT
}
"
)
# Find pkg-config in order find cairo.
find_package
(
PkgConfig REQUIRED
)
...
...
@@ -192,7 +187,7 @@ include_directories( ${GLEW_INCLUDE_DIRS} )
include_directories
(
${
gal_ROOT
}
)
add_executable
(
sweet_edit sweet_edit.cpp sweet_editor_panel.cpp
)
add_executable
(
sweet_edit sweet_edit.cpp sweet_editor_panel.cpp
sch_canvas.cpp
)
target_link_libraries
(
sweet_edit
${
OPENGL_LIBRARIES
}
...
...
new/sch_canvas.cpp
0 → 100644
View file @
0ee7234c
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2011 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 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
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "sch_canvas.h"
#include "sch_part.h"
namespace
SCH
{
CANVAS
::
CANVAS
(
wxWindow
*
aParent
)
:
OPENGL_GAL
(
aParent
,
wxDefaultSize
)
{
// Set the world unit length
SetWorldUnitLength
(
0.01
);
SetScreenDPI
(
100
);
// SetLookAtPoint( VECTOR2D( size.x / 2, size.y / 2 ) );
ComputeWorldScreenMatrix
();
/*
// Compute the world size
m_worldSize = VECTOR2D( m_screenSize.x, m_screenSize.y );
m_isReady = true;
m_isPanning = false;
m_isGroupStarted = true;
m_offset = 0.333;
// Load Font
if( !m_font.LoadNewStrokeFont( newstroke_font, newstroke_font_bufsize ) )
{
cout << "Loading of the font failed." << endl;
}
m_font.SetGraphicsAbstractionLayer( this );
*/
}
void
CANVAS
::
Paint
()
{
/*
BeginDrawing();
SetBackgroundColor( COLOR4D( 0, 0, 0, 1.0 ) );
ClearScreen();
SetLayerDepth( -10 );
SetGridSize( VECTOR2D( 50, 50 ) );
DrawGrid();
SetLayerDepth( 0 );
Flush();
EndDrawing();
*/
}
}
// namespace SCH
new/sch_canvas.h
0 → 100644
View file @
0ee7234c
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2011 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 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
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SCH_CANVAS_H_
#define SCH_CANVAS_H_
#include <gal/opengl/opengl_gal.h>
namespace
SCH
{
class
PART
;
class
CANVAS
:
public
OPENGL_GAL
{
protected
:
PART
*
part
;
///< which PART to draw
public
:
CANVAS
(
wxWindow
*
aParent
);
/**
* Function Paint (overloaded)
* redraws the entire window, overloads OPENGL_GAL::Paint()
*/
void
Paint
();
/**
* Function SetPart
* sets the PART to draw, returns the previous PART.
*/
PART
*
SetPart
(
PART
*
aPart
)
{
PART
*
ret
=
part
;
part
=
aPart
;
return
ret
;
}
};
}
// namespace SCH
#endif // SCH_PART_H_
new/sch_part.cpp
View file @
0ee7234c
...
...
@@ -293,7 +293,7 @@ void PART::Parse( SWEET_PARSER* aParser , LIB_TABLE* aTable ) throw( IO_ERROR, P
}
bool
PART
::
Prop
erty
Delete
(
const
wxString
&
aPropertyName
)
bool
PART
::
PropDelete
(
const
wxString
&
aPropertyName
)
{
PROPERTIES
::
iterator
it
=
propertyFind
(
aPropertyName
);
if
(
it
!=
properties
.
end
()
)
...
...
new/sch_part.h
View file @
0ee7234c
...
...
@@ -729,11 +729,11 @@ public:
throw
(
IO_ERROR
);
/**
* Function Prop
erty
Delete
* Function PropDelete
* deletes the property with aPropertyName if found and returns true, else false
* if not found.
*/
bool
Prop
erty
Delete
(
const
wxString
&
aPropertyName
);
bool
PropDelete
(
const
wxString
&
aPropertyName
);
/**
* Function Field
...
...
new/sch_sweet_parser.cpp
View file @
0ee7234c
...
...
@@ -992,7 +992,7 @@ void SWEET_PARSER::parsePropertyDel( PART* me )
wxString
propertyName
=
FromUTF8
();
if
(
!
me
->
Prop
erty
Delete
(
propertyName
)
)
if
(
!
me
->
PropDelete
(
propertyName
)
)
{
wxString
msg
;
msg
.
Printf
(
_
(
"Unable to find property: %s"
),
propertyName
.
GetData
()
);
...
...
new/sweet_editor_panel.cpp
View file @
0ee7234c
...
...
@@ -41,7 +41,7 @@ SWEET_EDITOR_PANEL::SWEET_EDITOR_PANEL( wxWindow* parent, wxWindowID id, const w
wxStaticBoxSizer
*
m_gal_sizer
;
m_gal_sizer
=
new
wxStaticBoxSizer
(
new
wxStaticBox
(
m_gal_scrolled_window
,
wxID_ANY
,
_
(
"Visual Part"
)
),
wxVERTICAL
);
m_gal
=
new
OPENGL_GAL
(
m_gal_scrolled_window
,
size
);
m_gal
=
new
SCH
::
CANVAS
(
m_gal_scrolled_window
);
m_gal_sizer
->
Add
(
m_gal
,
0
,
wxALL
,
5
);
m_gal_scrolled_window
->
SetSizer
(
m_gal_sizer
);
...
...
new/sweet_editor_panel.fbp
View file @
0ee7234c
...
...
@@ -668,12 +668,12 @@
<property
name=
"caption"
></property>
<property
name=
"caption_visible"
>
1
</property>
<property
name=
"center_pane"
>
0
</property>
<property
name=
"class"
>
OPENGL_GAL
</property>
<property
name=
"class"
>
SCH::CANVAS
</property>
<property
name=
"close_button"
>
1
</property>
<property
name=
"construction"
>
m_gal = new
OPENGL_GAL( m_gal_scrolled_window, size
);
</property>
<property
name=
"construction"
>
m_gal = new
SCH::CANVAS( m_gal_scrolled_window
);
</property>
<property
name=
"context_help"
></property>
<property
name=
"context_menu"
>
1
</property>
<property
name=
"declaration"
>
OPENGL_GAL
* m_gal;
</property>
<property
name=
"declaration"
>
SCH::CANVAS
* m_gal;
</property>
<property
name=
"default_pane"
>
0
</property>
<property
name=
"dock"
>
Dock
</property>
<property
name=
"dock_fixed"
>
0
</property>
...
...
@@ -685,7 +685,7 @@
<property
name=
"gripper"
>
0
</property>
<property
name=
"hidden"
>
0
</property>
<property
name=
"id"
>
wxID_ANY
</property>
<property
name=
"include"
>
#include
<
opengl_gal
.h
>
</property>
<property
name=
"include"
>
#include
<
sch_canvas
.h
>
</property>
<property
name=
"layer"
></property>
<property
name=
"max_size"
></property>
<property
name=
"maximize_button"
>
0
</property>
...
...
new/sweet_editor_panel.h
View file @
0ee7234c
...
...
@@ -19,7 +19,7 @@
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/scrolwin.h>
#include <
opengl_gal
.h>
#include <
sch_canvas
.h>
#include <wx/splitter.h>
#include <wx/panel.h>
#include <wx/html/htmlwin.h>
...
...
@@ -41,7 +41,7 @@ class SWEET_EDITOR_PANEL : public wxPanel
wxScrolledWindow
*
m_scrolledTextWindow
;
wxTextCtrl
*
m_sweet_scroll_window
;
wxScrolledWindow
*
m_gal_scrolled_window
;
OPENGL_GAL
*
m_gal
;
SCH
::
CANVAS
*
m_gal
;
wxScrolledWindow
*
m_scrolledWindow3
;
wxHtmlWindow
*
m_htmlWin2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment