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
ec4cbb79
Commit
ec4cbb79
authored
Mar 31, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw only in OnPaint
parent
4cf118ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
52 deletions
+55
-52
change_log.txt
change_log.txt
+8
-2
msgpanel.cpp
common/msgpanel.cpp
+40
-48
wxstruct.h
include/wxstruct.h
+7
-2
No files found.
change_log.txt
View file @
ec4cbb79
...
@@ -5,6 +5,13 @@ Started 2007-June-11
...
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Mar-31 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+all
Tweaked class MsgPanel so that the screen drawing only happens from
its OnPaint() function.
2008-Mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema
+eeschema
...
@@ -16,7 +23,6 @@ email address.
...
@@ -16,7 +23,6 @@ email address.
Added comments in gestfich.cpp to explain the default paths used by kicad to find help files and lib files
Added comments in gestfich.cpp to explain the default paths used by kicad to find help files and lib files
2008-Mar-30 UPDATE Jonas Diemer <diemer-at-gmx.de>
2008-Mar-30 UPDATE Jonas Diemer <diemer-at-gmx.de>
================================================================================
================================================================================
+eeschema
+eeschema
...
@@ -50,7 +56,7 @@ email address.
...
@@ -50,7 +56,7 @@ email address.
+eeschema
+eeschema
Removed an very old bug in onrightclick.cpp which crashes eeschema when
Removed an very old bug in onrightclick.cpp which crashes eeschema when
right clicking in a field inside a component.
right clicking in a field inside a component.
Old code should never works,
but ...
Old code should never works,
but ...
2008-Mar-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Mar-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
...
...
common/msgpanel.cpp
View file @
ec4cbb79
...
@@ -29,12 +29,12 @@ WinEDA_MsgPanel::WinEDA_MsgPanel( WinEDA_DrawFrame* parent, int id,
...
@@ -29,12 +29,12 @@ WinEDA_MsgPanel::WinEDA_MsgPanel( WinEDA_DrawFrame* parent, int id,
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
SetFont
(
*
g_MsgFont
);
SetFont
(
*
g_MsgFont
);
m_last_x
=
0
;
}
}
WinEDA_MsgPanel
::~
WinEDA_MsgPanel
()
WinEDA_MsgPanel
::~
WinEDA_MsgPanel
()
{
{
m_Items
.
clear
();
}
}
...
@@ -44,18 +44,18 @@ void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event )
...
@@ -44,18 +44,18 @@ void WinEDA_MsgPanel::OnPaint( wxPaintEvent& event )
{
{
wxPaintDC
dc
(
this
);
wxPaintDC
dc
(
this
);
//EraseMsgBox
( &dc );
erase
(
&
dc
);
dc
.
SetBackground
(
*
wxBLACK_BRUSH
);
dc
.
SetBackground
(
*
wxBLACK_BRUSH
);
dc
.
SetBackgroundMode
(
wxSOLID
);
dc
.
SetBackgroundMode
(
wxSOLID
);
dc
.
SetTextBackground
(
GetBackgroundColour
()
);
dc
.
SetTextBackground
(
GetBackgroundColour
()
);
dc
.
SetFont
(
*
g_MsgFont
);
dc
.
SetFont
(
*
g_MsgFont
);
for
(
unsigned
i
=
0
;
i
<
m_Items
.
size
();
++
i
)
for
(
unsigned
i
=
0
;
i
<
m_Items
.
size
();
++
i
)
showItem
(
dc
,
m_Items
[
i
]
);
showItem
(
dc
,
m_Items
[
i
]
);
event
.
Skip
();
event
.
Skip
();
}
}
...
@@ -77,44 +77,41 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
...
@@ -77,44 +77,41 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
* color = couleur d'affichage
* color = couleur d'affichage
*/
*/
{
{
static
int
old_pos_X
;
wxPoint
pos
;
wxPoint
pos
;
wxSize
drawSize
=
GetClientSize
();
wxSize
FontSizeInPixels
,
DrawSize
;
wxClientDC
dc
(
this
);
DrawSize
=
GetClientSize
();
// Get size of the font
wxSize
fontSizeInPixels
;
{
wxClientDC
dc
(
this
);
dc
.
SetBackground
(
*
wxBLACK_BRUSH
);
dc
.
SetFont
(
*
g_MsgFont
);
dc
.
SetBackgroundMode
(
wxSOLID
);
dc
.
GetTextExtent
(
wxT
(
"W"
),
&
fontSizeInPixels
.
x
,
&
fontSizeInPixels
.
y
);
dc
.
SetTextBackground
(
GetBackgroundColour
()
);
dc
.
SetFont
(
*
g_MsgFont
);
dc
.
GetTextExtent
(
wxT
(
"W"
),
&
FontSizeInPixels
.
x
,
&
FontSizeInPixels
.
y
);
}
// destroy wxClientDC ASAP
if
(
pos_X
>=
0
)
if
(
pos_X
>=
0
)
{
{
old_pos_X
=
pos
.
x
=
pos_X
*
(
F
ontSizeInPixels
.
x
+
2
);
m_last_x
=
pos
.
x
=
pos_X
*
(
f
ontSizeInPixels
.
x
+
2
);
}
}
else
else
pos
.
x
=
old_pos_X
;
pos
.
x
=
m_last_x
;
MsgItem
item
;
MsgItem
item
;
item
.
m_X
=
pos
.
x
;
item
.
m_X
=
pos
.
x
;
item
.
m_UpperY
=
(
DrawSize
.
y
/
2
)
-
F
ontSizeInPixels
.
y
;
item
.
m_UpperY
=
(
drawSize
.
y
/
2
)
-
f
ontSizeInPixels
.
y
;
item
.
m_LowerY
=
DrawSize
.
y
-
F
ontSizeInPixels
.
y
;
item
.
m_LowerY
=
drawSize
.
y
-
f
ontSizeInPixels
.
y
;
item
.
m_UpperText
=
texte_H
;
item
.
m_UpperText
=
texte_H
;
item
.
m_LowerText
=
texte_L
;
item
.
m_LowerText
=
texte_L
;
item
.
m_Color
=
color
;
item
.
m_Color
=
color
;
int
ndx
;
int
ndx
;
// update the vector, which is sorted by m_X
// update the vector, which is sorted by m_X
int
limit
=
m_Items
.
size
();
int
limit
=
m_Items
.
size
();
for
(
ndx
=
0
;
ndx
<
limit
;
++
ndx
)
for
(
ndx
=
0
;
ndx
<
limit
;
++
ndx
)
{
{
...
@@ -124,31 +121,31 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
...
@@ -124,31 +121,31 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
m_Items
[
ndx
]
=
item
;
m_Items
[
ndx
]
=
item
;
break
;
break
;
}
}
if
(
m_Items
[
ndx
].
m_X
>
item
.
m_X
)
if
(
m_Items
[
ndx
].
m_X
>
item
.
m_X
)
{
{
m_Items
.
insert
(
m_Items
.
begin
()
+
ndx
,
item
);
m_Items
.
insert
(
m_Items
.
begin
()
+
ndx
,
item
);
break
;
break
;
}
}
}
}
if
(
ndx
==
limit
)
// mutually exclusive with two above if tests
if
(
ndx
==
limit
)
// mutually exclusive with two above if tests
{
{
m_Items
.
push_back
(
item
);
m_Items
.
push_back
(
item
);
}
}
showItem
(
dc
,
item
);
Refresh
(
);
}
}
void
WinEDA_MsgPanel
::
showItem
(
wxDC
&
dc
,
const
MsgItem
&
aItem
)
void
WinEDA_MsgPanel
::
showItem
(
wxDC
&
dc
,
const
MsgItem
&
aItem
)
{
{
int
color
=
aItem
.
m_Color
;
int
color
=
aItem
.
m_Color
;
if
(
color
>=
0
)
if
(
color
>=
0
)
{
{
color
&=
MASKCOLOR
;
color
&=
MASKCOLOR
;
dc
.
SetTextForeground
(
wxColour
(
ColorRefs
[
color
].
m_Red
,
dc
.
SetTextForeground
(
wxColour
(
ColorRefs
[
color
].
m_Red
,
ColorRefs
[
color
].
m_Green
,
ColorRefs
[
color
].
m_Green
,
ColorRefs
[
color
].
m_Blue
)
);
ColorRefs
[
color
].
m_Blue
)
);
}
}
...
@@ -157,7 +154,7 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem )
...
@@ -157,7 +154,7 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem )
{
{
dc
.
DrawText
(
aItem
.
m_UpperText
.
GetData
(),
aItem
.
m_X
,
aItem
.
m_UpperY
);
dc
.
DrawText
(
aItem
.
m_UpperText
.
GetData
(),
aItem
.
m_X
,
aItem
.
m_UpperY
);
}
}
if
(
!
aItem
.
m_LowerText
.
IsEmpty
()
)
if
(
!
aItem
.
m_LowerText
.
IsEmpty
()
)
{
{
dc
.
DrawText
(
aItem
.
m_LowerText
.
GetData
(),
aItem
.
m_X
,
aItem
.
m_LowerY
);
dc
.
DrawText
(
aItem
.
m_LowerText
.
GetData
(),
aItem
.
m_X
,
aItem
.
m_LowerY
);
...
@@ -168,39 +165,34 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem )
...
@@ -168,39 +165,34 @@ void WinEDA_MsgPanel::showItem( wxDC& dc, const MsgItem& aItem )
/****************************************/
/****************************************/
void
WinEDA_MsgPanel
::
EraseMsgBox
()
void
WinEDA_MsgPanel
::
EraseMsgBox
()
/****************************************/
/****************************************/
/* Effacement de la fenetre d'affichage des messages de bas d'ecran
*/
{
{
wxClientDC
dc
(
this
);
m_Items
.
clear
(
);
m_last_x
=
0
;
EraseMsgBox
(
&
dc
);
Refresh
(
);
}
}
/*******************************************/
/*******************************************/
void
WinEDA_MsgPanel
::
EraseMsgBox
(
wxDC
*
DC
)
void
WinEDA_MsgPanel
::
erase
(
wxDC
*
DC
)
/*******************************************/
/*******************************************/
{
{
wxSize
size
;
wxColor
color
;
wxPen
pen
;
wxPen
pen
;
wxBrush
brush
;
wxBrush
brush
;
size
=
GetClientSize
();
wxSize
size
=
GetClientSize
();
color
=
GetBackgroundColour
();
wxColor
color
=
GetBackgroundColour
();
pen
.
SetColour
(
color
);
pen
.
SetColour
(
color
);
brush
.
SetColour
(
color
);
brush
.
SetColour
(
color
);
brush
.
SetStyle
(
wxSOLID
);
brush
.
SetStyle
(
wxSOLID
);
DC
->
SetPen
(
pen
);
DC
->
SetPen
(
pen
);
DC
->
SetBrush
(
brush
);
DC
->
SetBrush
(
brush
);
DC
->
DrawRectangle
(
0
,
0
,
size
.
x
,
size
.
y
);
DC
->
DrawRectangle
(
0
,
0
,
size
.
x
,
size
.
y
);
DC
->
SetBrush
(
wxNullBrush
);
DC
->
SetBrush
(
wxNullBrush
);
DC
->
SetPen
(
wxNullPen
);
DC
->
SetPen
(
wxNullPen
);
m_Items
.
clear
();
}
}
include/wxstruct.h
View file @
ec4cbb79
...
@@ -192,6 +192,8 @@ public:
...
@@ -192,6 +192,8 @@ public:
class
WinEDA_DrawFrame
:
public
WinEDA_BasicFrame
class
WinEDA_DrawFrame
:
public
WinEDA_BasicFrame
{
{
public
:
public
:
WinEDA_DrawPanel
*
DrawPanel
;
// Draw area
WinEDA_DrawPanel
*
DrawPanel
;
// Draw area
WinEDA_MsgPanel
*
MsgPanel
;
// Zone d'affichage de caracteristiques
WinEDA_MsgPanel
*
MsgPanel
;
// Zone d'affichage de caracteristiques
...
@@ -541,8 +543,12 @@ class WinEDA_MsgPanel : public wxPanel
...
@@ -541,8 +543,12 @@ class WinEDA_MsgPanel : public wxPanel
{
{
protected
:
protected
:
std
::
vector
<
MsgItem
>
m_Items
;
std
::
vector
<
MsgItem
>
m_Items
;
int
m_last_x
;
///< the last used x coordinate
void
showItem
(
wxDC
&
dc
,
const
MsgItem
&
aItem
);
void
showItem
(
wxDC
&
dc
,
const
MsgItem
&
aItem
);
void
erase
(
wxDC
*
DC
);
public
:
public
:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
...
@@ -556,7 +562,6 @@ public:
...
@@ -556,7 +562,6 @@ public:
void
OnPaint
(
wxPaintEvent
&
event
);
void
OnPaint
(
wxPaintEvent
&
event
);
void
EraseMsgBox
();
void
EraseMsgBox
();
void
EraseMsgBox
(
wxDC
*
DC
);
void
Affiche_1_Parametre
(
int
pos_X
,
const
wxString
&
texte_H
,
void
Affiche_1_Parametre
(
int
pos_X
,
const
wxString
&
texte_H
,
const
wxString
&
texte_L
,
int
color
);
const
wxString
&
texte_L
,
int
color
);
...
...
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