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
ceeb27cf
Commit
ceeb27cf
authored
Dec 06, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: solved: incorrect draw origin setup for viewlib and libedit
parent
e29d89c7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
139 deletions
+131
-139
class_screen.cpp
eeschema/class_screen.cpp
+1
-1
libframe.cpp
eeschema/libframe.cpp
+2
-0
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+40
-54
viewlibs.cpp
eeschema/viewlibs.cpp
+1
-1
drawpanel_wxstruct.h
include/drawpanel_wxstruct.h
+87
-83
No files found.
eeschema/class_screen.cpp
View file @
ceeb27cf
...
...
@@ -110,7 +110,7 @@ SCH_SCREEN::SCH_SCREEN( KICAD_T type ) : BASE_SCREEN( type )
SetGrid
(
wxSize
(
50
,
50
)
);
/* pas de la grille */
m_UndoRedoCountMax
=
10
;
m_RefCount
=
0
;
m_Center
=
false
;
m_Center
=
false
;
// Suitable for schematic only. for libedit and viewlib, must be set to true
InitDatas
();
}
...
...
eeschema/libframe.cpp
View file @
ceeb27cf
...
...
@@ -72,6 +72,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
// Give an icon
SetIcon
(
wxIcon
(
libedit_xpm
)
);
SetBaseScreen
(
g_ScreenLib
);
GetScreen
()
->
m_Center
=
true
;
// set to true to have the coordinates origine -0,0) centered on screen
GetSettings
();
SetSize
(
m_FramePos
.
x
,
m_FramePos
.
y
,
m_FrameSize
.
x
,
m_FrameSize
.
y
);
if
(
DrawPanel
)
...
...
@@ -79,6 +80,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
ReCreateHToolbar
();
ReCreateVToolbar
();
DisplayLibInfos
();
BestZoom
();
Show
(
TRUE
);
}
...
...
eeschema/viewlib_frame.cpp
View file @
ceeb27cf
...
...
@@ -2,10 +2,6 @@
/* viewlib_frame.cpp - fonctions des classes du type WinEDA_ViewlibFrame */
/*************************************************************************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "common.h"
...
...
@@ -23,41 +19,39 @@
/* class WinEDA_ViewlibFrame */
/*****************************/
BEGIN_EVENT_TABLE
(
WinEDA_ViewlibFrame
,
wxFrame
)
COMMON_EVENTS_DRAWFRAME
EVT_CLOSE
(
WinEDA_ViewlibFrame
::
OnCloseWindow
)
EVT_SIZE
(
WinEDA_ViewlibFrame
::
OnSize
)
EVT_ACTIVATE
(
WinEDA_DrawFrame
::
OnActivate
)
COMMON_EVENTS_DRAWFRAME
EVT_CLOSE
(
WinEDA_ViewlibFrame
::
OnCloseWindow
)
EVT_SIZE
(
WinEDA_ViewlibFrame
::
OnSize
)
EVT_ACTIVATE
(
WinEDA_DrawFrame
::
OnActivate
)
EVT_TOOL_RANGE
(
ID_LIBVIEW_START_H_TOOL
,
ID_LIBVIEW_END_H_TOOL
,
WinEDA_ViewlibFrame
::
Process_Special_Functions
)
EVT_TOOL_RANGE
(
ID_LIBVIEW_START_H_TOOL
,
ID_LIBVIEW_END_H_TOOL
,
WinEDA_ViewlibFrame
::
Process_Special_Functions
)
EVT_TOOL_RANGE
(
ID_ZOOM_IN_BUTT
,
ID_ZOOM_PAGE_BUTT
,
WinEDA_DrawFrame
::
Process_Zoom
)
EVT_TOOL_RANGE
(
ID_ZOOM_IN_BUTT
,
ID_ZOOM_PAGE_BUTT
,
WinEDA_DrawFrame
::
Process_Zoom
)
EVT_TOOL
(
ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC
,
WinEDA_ViewlibFrame
::
ExportToSchematicLibraryPart
)
EVT_TOOL
(
ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC
,
WinEDA_ViewlibFrame
::
ExportToSchematicLibraryPart
)
EVT_KICAD_CHOICEBOX
(
ID_LIBVIEW_SELECT_PART_NUMBER
,
WinEDA_ViewlibFrame
::
Process_Special_Functions
)
EVT_KICAD_CHOICEBOX
(
ID_LIBVIEW_SELECT_PART_NUMBER
,
WinEDA_ViewlibFrame
::
Process_Special_Functions
)
EVT_LISTBOX
(
ID_LIBVIEW_LIB_LIST
,
WinEDA_ViewlibFrame
::
ClickOnLibList
)
EVT_LISTBOX
(
ID_LIBVIEW_CMP_LIST
,
WinEDA_ViewlibFrame
::
ClickOnCmpList
)
EVT_LISTBOX
(
ID_LIBVIEW_LIB_LIST
,
WinEDA_ViewlibFrame
::
ClickOnLibList
)
EVT_LISTBOX
(
ID_LIBVIEW_CMP_LIST
,
WinEDA_ViewlibFrame
::
ClickOnCmpList
)
END_EVENT_TABLE
()
/****************/
/* Constructeur */
/****************/
/******************************************************************************/
WinEDA_ViewlibFrame
::
WinEDA_ViewlibFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
LibraryStruct
*
Library
,
wxSemaphore
*
semaphore
)
:
WinEDA_DrawFrame
(
father
,
VIEWER_FRAME
,
parent
,
_
(
"Library browser"
),
wxDefaultPosition
,
wxDefaultSize
)
/******************************************************************************/
{
m_FrameName
=
wxT
(
"ViewlibFrame"
);
m_Draw_Axis
=
TRUE
;
// TRUE
pour avoir les axes dessine
s
m_Draw_Grid
=
TRUE
;
// TRUE
pour avoir la axes dessinee
m_Draw_Axis
=
TRUE
;
// TRUE
to dispaly Axi
s
m_Draw_Grid
=
TRUE
;
// TRUE
to display grid
// Give an icon
SetIcon
(
wxIcon
(
library_browse_xpm
)
);
...
...
@@ -69,7 +63,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
SetWindowStyle
(
GetWindowStyle
()
|
wxSTAY_ON_TOP
);
SetBaseScreen
(
new
SCH_SCREEN
()
);
GetScreen
()
->
SetZoom
(
16
);
GetScreen
()
->
m_Center
=
true
;
// set to true to have the coordinates origine -0,0) centered on screen
if
(
Library
==
NULL
)
{
...
...
@@ -78,8 +72,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
m_LibList
=
new
wxListBox
(
this
,
ID_LIBVIEW_LIB_LIST
,
wxPoint
(
0
,
0
),
m_LibListSize
,
0
,
NULL
,
wxLB_HSCROLL
);
m_LibList
->
SetFont
(
*
g_DialogFont
);
m_LibList
->
SetBackgroundColour
(
wxColour
(
255
,
255
,
255
)
);
// Library background listbox color (white)
m_LibList
->
SetForegroundColour
(
wxColour
(
0
,
0
,
0
)
);
// Library foreground listbox color (black)
m_LibList
->
SetBackgroundColour
(
wxColour
(
255
,
255
,
255
)
);
// Library background listbox color (white)
m_LibList
->
SetForegroundColour
(
wxColour
(
0
,
0
,
0
)
);
// Library foreground listbox color (black)
}
else
g_CurrentViewLibraryName
=
Library
->
m_Name
;
...
...
@@ -89,8 +83,8 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
m_CmpList
=
new
wxListBox
(
this
,
ID_LIBVIEW_CMP_LIST
,
wxPoint
(
m_LibListSize
.
x
,
0
),
m_CmpListSize
,
0
,
NULL
,
wxLB_HSCROLL
);
m_CmpList
->
SetFont
(
*
g_DialogFont
);
m_CmpList
->
SetBackgroundColour
(
wxColour
(
255
,
255
,
255
)
);
// Component background listbox color (white)
m_CmpList
->
SetForegroundColour
(
wxColour
(
0
,
0
,
0
)
);
// Component foreground listbox color (black)
m_CmpList
->
SetBackgroundColour
(
wxColour
(
255
,
255
,
255
)
);
// Component background listbox color (white)
m_CmpList
->
SetForegroundColour
(
wxColour
(
0
,
0
,
0
)
);
// Component foreground listbox color (black)
GetSettings
();
SetSize
(
m_FramePos
.
x
,
m_FramePos
.
y
,
m_FrameSize
.
x
,
m_FrameSize
.
y
);
...
...
@@ -99,15 +93,14 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father, WinEDA_App* parent,
if
(
m_LibList
)
ReCreateListLib
();
DisplayLibInfos
();
BestZoom
();
Show
(
TRUE
);
}
/***************/
/* Destructeur */
/***************/
/*******************************************/
WinEDA_ViewlibFrame
::~
WinEDA_ViewlibFrame
()
/*******************************************/
{
delete
GetScreen
();
SetBaseScreen
(
0
);
...
...
@@ -176,9 +169,9 @@ void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv )
}
/***********************************
********
/
/***********************************/
int
WinEDA_ViewlibFrame
::
BestZoom
()
/***********************************
********
/
/***********************************/
{
int
bestzoom
,
ii
,
jj
;
wxSize
size
,
itemsize
;
...
...
@@ -198,28 +191,21 @@ int WinEDA_ViewlibFrame::BestZoom()
EDA_Rect
BoundaryBox
=
CurrentLibEntry
->
GetBoundaryBox
(
g_ViewUnit
,
g_ViewConvert
);
itemsize
=
BoundaryBox
.
GetSize
();
size
=
DrawPanel
->
GetClientSize
();
size
.
x
-=
60
;
// Pour marges haut et bas
ii
=
itemsize
.
x
/
size
.
x
;
jj
=
itemsize
.
y
/
size
.
y
;
ii
=
MAX
(
ii
,
jj
);
size
=
DrawPanel
->
GetClientSize
();
size
.
x
-=
60
;
// sub a margin
ii
=
itemsize
.
x
/
size
.
x
;
jj
=
itemsize
.
y
/
size
.
y
;
bestzoom
=
MAX
(
ii
,
jj
);
/* determination du zoom existant le plus proche */
for
(
bestzoom
=
1
;
bestzoom
<
512
;
bestzoom
<<=
1
)
{
if
(
bestzoom
>
ii
)
break
;
}
GetScreen
()
->
m_Curseur
=
BoundaryBox
.
Centre
();
GetScreen
()
->
m_Curseur
=
BoundaryBox
.
Centre
();
return
bestzoom
;
}
/******************************************
*********
/
/******************************************/
void
WinEDA_ViewlibFrame
::
ReCreateListLib
()
/*******************************************
********
/
/*******************************************/
{
const
wxChar
**
ListNames
,
**
names
;
int
ii
;
...
...
@@ -243,8 +229,8 @@ void WinEDA_ViewlibFrame::ReCreateListLib()
free
(
ListNames
);
/*
Librairie courante peut etre non retrouv�e en list
e
* (peut etre effac�e lors d'une modification de configuration)
*/
/*
Clear current library because it can be deleted after a config chang
e
*/
if
(
!
found
)
{
g_CurrentViewLibraryName
.
Empty
();
...
...
@@ -269,8 +255,8 @@ void WinEDA_ViewlibFrame::ReCreateListCmp()
m_CmpList
->
Clear
();
ii
=
0
;
g_CurrentViewComponentName
.
Empty
();
g_ViewConvert
=
1
;
/*
Vue normal / convert
*/
g_ViewUnit
=
1
;
/*
unit� a afficher (A, B ..)
*/
g_ViewConvert
=
1
;
/*
Select normal/"de morgan" shape
*/
g_ViewUnit
=
1
;
/*
Selec unit to display for multiple parts per package
*/
if
(
Library
)
LibEntry
=
(
EDA_LibComponentStruct
*
)
PQFirst
(
&
Library
->
m_Entries
,
FALSE
);
while
(
LibEntry
)
...
...
@@ -325,7 +311,7 @@ void WinEDA_ViewlibFrame::ClickOnCmpList( wxCommandEvent& event )
void
WinEDA_ViewlibFrame
::
ExportToSchematicLibraryPart
(
wxCommandEvent
&
event
)
/****************************************************************************/
/* Export t
o schematic the current viewed component,
and close the library browser
/* Export t
he current component to schematic
and close the library browser
*/
{
int
ii
=
m_CmpList
->
GetSelection
();
...
...
eeschema/viewlibs.cpp
View file @
ceeb27cf
...
...
@@ -3,7 +3,7 @@
/****************************/
#include "fctsys.h"
#include "gr_basic.h"
//
#include "gr_basic.h"
#include "common.h"
#include "program.h"
...
...
include/drawpanel_wxstruct.h
View file @
ceeb27cf
This diff is collapsed.
Click to expand it.
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