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
42b1020d
Commit
42b1020d
authored
Aug 07, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MsgPanel is sized dynamically based on system gui font size
parent
896c6975
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
23 deletions
+64
-23
3d_frame.cpp
3d-viewer/3d_frame.cpp
+3
-1
CHANGELOG.txt
CHANGELOG.txt
+8
-0
basicframe.cpp
common/basicframe.cpp
+3
-1
msgpanel.cpp
common/msgpanel.cpp
+26
-14
cvframe.cpp
cvpcb/cvframe.cpp
+3
-1
wxstruct.h
include/wxstruct.h
+18
-4
mainframe.cpp
kicad/mainframe.cpp
+2
-1
specctra_import.cpp
pcbnew/specctra_import.cpp
+1
-1
No files found.
3d-viewer/3d_frame.cpp
View file @
42b1020d
...
...
@@ -67,9 +67,11 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
SetSize
(
m_FramePos
.
x
,
m_FramePos
.
y
,
m_FrameSize
.
x
,
m_FrameSize
.
y
);
// Create the status line
int
dims
[
5
]
=
{
-
1
,
100
,
100
,
100
,
140
};
static
const
int
dims
[
5
]
=
{
-
1
,
100
,
100
,
100
,
140
};
CreateStatusBar
(
5
);
SetStatusWidths
(
5
,
dims
);
ReCreateMenuBar
();
ReCreateHToolbar
();
...
...
CHANGELOG.txt
View file @
42b1020d
...
...
@@ -4,6 +4,14 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-Aug-6 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
MsgPanel is dynamically sized based on system gui font. Before this fix
the window height was hardcoded and was too small on systems with large
fonts. See WinEDA_MsgPanel::GetRequiredHeight();
2009-aug-08 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew
...
...
common/basicframe.cpp
View file @
42b1020d
...
...
@@ -40,10 +40,12 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
m_Ident
=
idtype
;
m_HToolBar
=
NULL
;
m_FrameIsActive
=
TRUE
;
m_MsgFrameHeight
=
MSG_PANEL_DEFAULT_HEIGHT
;
m_MsgFrameHeight
=
WinEDA_MsgPanel
::
GetRequiredHeight
();
minsize
.
x
=
470
;
minsize
.
y
=
350
+
m_MsgFrameHeight
;
SetSizeHints
(
minsize
.
x
,
minsize
.
y
,
-
1
,
-
1
,
-
1
,
-
1
);
/* Verification des parametres de creation */
...
...
common/msgpanel.cpp
View file @
42b1020d
...
...
@@ -30,6 +30,8 @@ WinEDA_MsgPanel::WinEDA_MsgPanel( WinEDA_DrawFrame* parent, int id,
SetFont
(
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
)
);
SetBackgroundColour
(
wxSystemSettings
::
GetColour
(
wxSYS_COLOUR_BTNFACE
)
);
m_last_x
=
0
;
m_fontSize
=
computeFontSize
();
}
...
...
@@ -38,6 +40,27 @@ WinEDA_MsgPanel::~WinEDA_MsgPanel()
}
wxSize
WinEDA_MsgPanel
::
computeFontSize
()
{
// Get size of the wxSYS_DEFAULT_GUI_FONT
wxSize
fontSizeInPixels
;
wxScreenDC
dc
;
dc
.
SetFont
(
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
)
);
dc
.
GetTextExtent
(
wxT
(
"W"
),
&
fontSizeInPixels
.
x
,
&
fontSizeInPixels
.
y
);
return
fontSizeInPixels
;
}
int
WinEDA_MsgPanel
::
GetRequiredHeight
()
{
// make space for two rows of text plus a number of pixels between them.
return
2
*
computeFontSize
().
y
+
0
;
}
/*************************************************/
void
WinEDA_MsgPanel
::
OnPaint
(
wxPaintEvent
&
event
)
/*************************************************/
...
...
@@ -78,20 +101,9 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
wxPoint
pos
;
wxSize
drawSize
=
GetClientSize
();
// Get size of the font
wxSize
fontSizeInPixels
;
{
wxClientDC
dc
(
this
);
dc
.
SetFont
(
wxSystemSettings
::
GetFont
(
wxSYS_DEFAULT_GUI_FONT
)
);
dc
.
GetTextExtent
(
wxT
(
"W"
),
&
fontSizeInPixels
.
x
,
&
fontSizeInPixels
.
y
);
}
// destroy wxClientDC ASAP
if
(
pos_X
>=
0
)
{
m_last_x
=
pos
.
x
=
pos_X
*
(
fontSizeInPixels
.
x
+
2
);
m_last_x
=
pos
.
x
=
pos_X
*
(
m_fontSize
.
x
+
2
);
}
else
pos
.
x
=
m_last_x
;
...
...
@@ -100,8 +112,8 @@ void WinEDA_MsgPanel::Affiche_1_Parametre( int pos_X, const wxString& texte_H,
item
.
m_X
=
pos
.
x
;
item
.
m_UpperY
=
(
drawSize
.
y
/
2
)
-
fontSizeInPixels
.
y
;
item
.
m_LowerY
=
drawSize
.
y
-
fontSizeInPixels
.
y
;
item
.
m_UpperY
=
(
drawSize
.
y
/
2
)
-
m_fontSize
.
y
;
item
.
m_LowerY
=
drawSize
.
y
-
m_fontSize
.
y
;
item
.
m_UpperText
=
texte_H
;
item
.
m_LowerText
=
texte_L
;
...
...
cvpcb/cvframe.cpp
View file @
42b1020d
...
...
@@ -144,9 +144,11 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
m_FrameSize
.
y
=
FRAME_MIN_SIZE_Y
;
// create the status bar
int
dims
[
3
]
=
{
-
1
,
-
1
,
250
};
static
const
int
dims
[
3
]
=
{
-
1
,
-
1
,
250
};
CreateStatusBar
(
3
);
SetStatusWidths
(
3
,
dims
);
ReCreateMenuBar
();
ReCreateHToolbar
();
...
...
include/wxstruct.h
View file @
42b1020d
...
...
@@ -80,8 +80,6 @@ enum id_toolbar {
/* Classes for basic main frames used in kicad */
/***********************************************/
#define MSG_PANEL_DEFAULT_HEIGHT ( 28 ) // height of the infos display window
/******************************************************************/
/* Basic frame for kicad, eeschema, pcbnew and gerbview. */
...
...
@@ -348,14 +346,22 @@ struct MsgItem
class
WinEDA_MsgPanel
:
public
wxPanel
{
protected
:
std
::
vector
<
MsgItem
>
m_Items
;
int
m_last_x
;
///< the last used x coordinate
std
::
vector
<
MsgItem
>
m_Items
;
int
m_last_x
;
///< the last used x coordinate
wxSize
m_fontSize
;
void
showItem
(
wxDC
&
dc
,
const
MsgItem
&
aItem
);
void
erase
(
wxDC
*
DC
);
/**
* Function getFontSize
* computes the height and width of a 'W' in the system font.
*/
static
wxSize
computeFontSize
();
public
:
WinEDA_DrawFrame
*
m_Parent
;
int
m_BgColor
;
// couleur de fond
...
...
@@ -366,6 +372,14 @@ public:
WinEDA_MsgPanel
(
WinEDA_DrawFrame
*
parent
,
int
id
,
const
wxPoint
&
pos
,
const
wxSize
&
size
);
~
WinEDA_MsgPanel
();
/**
* Function GetRequiredHeight
* returns the required height (in pixels) of a WinEDA_MsgPanel. This takes
* into consideration the system gui font, wxSYS_DEFAULT_GUI_FONT.
*/
static
int
GetRequiredHeight
();
void
OnPaint
(
wxPaintEvent
&
event
);
void
EraseMsgBox
();
void
Affiche_1_Parametre
(
int
pos_X
,
const
wxString
&
texte_H
,
...
...
kicad/mainframe.cpp
View file @
42b1020d
...
...
@@ -48,7 +48,8 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
SetSize
(
m_FramePos
.
x
,
m_FramePos
.
y
,
m_FrameSize
.
x
,
m_FrameSize
.
y
);
// Create the status line (bottom of the frame
int
dims
[
3
]
=
{
-
1
,
-
1
,
100
};
static
const
int
dims
[
3
]
=
{
-
1
,
-
1
,
100
};
CreateStatusBar
(
3
);
SetStatusWidths
(
3
,
dims
);
...
...
pcbnew/specctra_import.cpp
View file @
42b1020d
...
...
@@ -424,7 +424,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
{
// module is on component layer (front)
module
->
Flip
(
module
->
m_Pos
);
}
}
module
->
SetOrientation
(
orientation
);
}
else
...
...
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