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
9e46a779
Commit
9e46a779
authored
Apr 29, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SetToolbars() fixes
parent
c25e5c31
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
75 deletions
+99
-75
change_log.txt
change_log.txt
+12
-0
wxPcbStruct.h
include/wxPcbStruct.h
+8
-0
controle.cpp
pcbnew/controle.cpp
+2
-1
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+2
-0
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-1
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+69
-73
drawpanel.cpp
share/drawpanel.cpp
+4
-0
No files found.
change_log.txt
View file @
9e46a779
...
@@ -6,6 +6,18 @@ Please add newer entries at the top, list the date and your name with
...
@@ -6,6 +6,18 @@ Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Apr-29 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
* Added WinEDA_PcbFrame::UpdateToolbarLayerInfo() by factoring it out of
ReCreateLayerBox().
* Changed call in void WinEDA_PcbFrame::SetToolbars() from ReCreateLayerBox()
to UpdateToolbarLayerInfo().
* Removed calls to SetToolbars() from:
> share/drawpanel.cpp's void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
> void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
2008-Apr-28 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Apr-28 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
...
...
include/wxPcbStruct.h
View file @
9e46a779
...
@@ -350,6 +350,14 @@ public:
...
@@ -350,6 +350,14 @@ public:
void
ReCreateOptToolbar
();
void
ReCreateOptToolbar
();
void
ReCreateMenuBar
();
void
ReCreateMenuBar
();
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
WinEDAChoiceBox
*
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
);
/**
* Function UpdateToolbarLayerInfo
* updates the currently selected layer in the layer listbox and
* the colored icon in the toolbar.
*/
void
UpdateToolbarLayerInfo
();
void
PrepareLayerIndicator
();
void
PrepareLayerIndicator
();
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
...
...
pcbnew/controle.cpp
View file @
9e46a779
...
@@ -660,6 +660,7 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
...
@@ -660,6 +660,7 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
RedrawActiveWindow
(
DC
,
TRUE
);
RedrawActiveWindow
(
DC
,
TRUE
);
}
}
SetToolbars
();
// SetToolbars();
Affiche_Status_Box
();
/* Display new cursor coordinates */
Affiche_Status_Box
();
/* Display new cursor coordinates */
}
}
pcbnew/editrack-part2.cpp
View file @
9e46a779
...
@@ -315,6 +315,8 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -315,6 +315,8 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
Via
->
Display_Infos
(
this
);
Via
->
Display_Infos
(
this
);
Affiche_Status_Box
();
Affiche_Status_Box
();
D
(
printf
(
"Other_Layer_Route
\n
"
);)
SetToolbars
();
SetToolbars
();
return
true
;
return
true
;
...
...
pcbnew/pcbframe.cpp
View file @
9e46a779
...
@@ -559,7 +559,8 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -559,7 +559,8 @@ void WinEDA_PcbFrame::SetToolbars()
}
}
}
}
ReCreateLayerBox
(
NULL
);
UpdateToolbarLayerInfo
();
PrepareLayerIndicator
();
PrepareLayerIndicator
();
DisplayUnitsMsg
();
DisplayUnitsMsg
();
...
...
pcbnew/tool_pcb.cpp
View file @
9e46a779
...
@@ -225,6 +225,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -225,6 +225,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_FilesMenu
->
Append
(
ID_LOAD_FILE_1
+
ii
,
GetLastProject
(
ii
)
);
m_FilesMenu
->
Append
(
ID_LOAD_FILE_1
+
ii
,
GetLastProject
(
ii
)
);
}
}
D
(
printf
(
"ReCreateHToolbar
\n
"
);)
SetToolbars
();
SetToolbars
();
return
;
return
;
}
}
...
@@ -232,6 +233,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -232,6 +233,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar
=
new
WinEDA_Toolbar
(
TOOLBAR_MAIN
,
this
,
ID_H_TOOLBAR
,
TRUE
);
m_HToolBar
=
new
WinEDA_Toolbar
(
TOOLBAR_MAIN
,
this
,
ID_H_TOOLBAR
,
TRUE
);
m_HToolBar
->
SetRows
(
1
);
m_HToolBar
->
SetRows
(
1
);
SetToolBar
(
m_HToolBar
);
SetToolBar
(
m_HToolBar
);
// Set up toolbar
// Set up toolbar
...
@@ -295,6 +297,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -295,6 +297,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
_
(
"Pcb Design Rules Check"
)
);
_
(
"Pcb Design Rules Check"
)
);
m_HToolBar
->
AddSeparator
();
m_HToolBar
->
AddSeparator
();
ReCreateLayerBox
(
m_HToolBar
);
ReCreateLayerBox
(
m_HToolBar
);
PrepareLayerIndicator
();
// Initialise the bitmap with current active layer colors for the next tool
PrepareLayerIndicator
();
// Initialise the bitmap with current active layer colors for the next tool
m_HToolBar
->
AddTool
(
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR
,
wxEmptyString
,
*
LayerPairBitmap
,
m_HToolBar
->
AddTool
(
ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR
,
wxEmptyString
,
*
LayerPairBitmap
,
...
@@ -318,6 +321,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
...
@@ -318,6 +321,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar
->
Realize
();
m_HToolBar
->
Realize
();
D
(
printf
(
"ReCreateHToolbar
\n
"
);)
SetToolbars
();
SetToolbars
();
}
}
...
@@ -392,6 +396,7 @@ void WinEDA_PcbFrame::ReCreateOptToolbar()
...
@@ -392,6 +396,7 @@ void WinEDA_PcbFrame::ReCreateOptToolbar()
m_OptionsToolBar
->
Realize
();
m_OptionsToolBar
->
Realize
();
D
(
printf
(
"ReCreateOptToolbar
\n
"
);)
SetToolbars
();
SetToolbars
();
}
}
...
@@ -472,6 +477,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
...
@@ -472,6 +477,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
m_VToolBar
->
Realize
();
m_VToolBar
->
Realize
();
D
(
printf
(
"ReCreateVToolbar
\n
"
);)
SetToolbars
();
SetToolbars
();
}
}
...
@@ -524,6 +530,7 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar()
...
@@ -524,6 +530,7 @@ void WinEDA_PcbFrame::ReCreateAuxVToolbar()
m_AuxVToolBar
->
Realize
();
m_AuxVToolBar
->
Realize
();
D
(
printf
(
"ReCreateAuxVToolbar
\n
"
);)
SetToolbars
();
SetToolbars
();
}
}
...
@@ -626,12 +633,38 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
...
@@ -626,12 +633,38 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
}
}
/**************************************************************************/
void
WinEDA_PcbFrame
::
UpdateToolbarLayerInfo
()
/**************************************************************************/
{
wxASSERT
(
m_SelLayerBox
);
// Activation de l'affichage sur la bonne couche
// Pour eviter la reentrance (Bug wxGTK version Linux?), la selection n'est faite que si
// elle est mauvaise (Pb corrige sur wxGTK 2.6.0)
int
count
=
m_SelLayerBox
->
GetCount
();
int
choice
=
m_SelLayerBox
->
GetChoice
();
int
layer
=
GetScreen
()
->
m_Active_Layer
;
for
(
int
listNdx
=
0
;
listNdx
<
count
;
++
listNdx
)
{
if
(
(
int
)
(
size_t
)
m_SelLayerBox
->
GetClientData
(
listNdx
)
==
layer
)
{
if
(
listNdx
!=
choice
)
m_SelLayerBox
->
SetSelection
(
listNdx
);
break
;
}
}
}
/**************************************************************************/
/**************************************************************************/
WinEDAChoiceBox
*
WinEDA_PcbFrame
::
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
)
WinEDAChoiceBox
*
WinEDA_PcbFrame
::
ReCreateLayerBox
(
WinEDA_Toolbar
*
parent
)
/**************************************************************************/
/**************************************************************************/
{
{
int
ii
,
jj
,
ll
;
// wxASSERT("ReCreateLayerBox"==""); // get a stack trace, who is calling me and from where
unsigned
length
=
0
;
if
(
m_SelLayerBox
==
NULL
)
if
(
m_SelLayerBox
==
NULL
)
{
{
if
(
parent
==
NULL
)
if
(
parent
==
NULL
)
...
@@ -658,30 +691,11 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
...
@@ -658,30 +691,11 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
layer_mask
|=
ALL_NO_CU_LAYERS
;
layer_mask
|=
ALL_NO_CU_LAYERS
;
unsigned
length
=
0
;
// This is commented out because testing the number of layer is no longer
// sufficient since the layer names may also have changed. And the time
// required to test layer names is probably longer than the time required
// to simply reconstruct the list.
#if 0
// Test if reconstruction of the list is necessary
int current_layer_mask = 0;
for( ii = 0; ii < (int) m_SelLayerBox->GetCount(); ii++ )
{
jj = (int) ( (size_t) m_SelLayerBox->GetClientData( ii ) );
current_mask_layer |= g_TabOneLayerMask[jj];
}
bool rebuild = FALSE;
if( current_layer_mask != layer_mask )
rebuild = TRUE;
// Construction de la liste
if( rebuild )
#endif
{
m_SelLayerBox
->
Clear
();
m_SelLayerBox
->
Clear
();
int
ii
,
jj
;
for
(
ii
=
0
,
jj
=
0
;
ii
<=
EDGE_N
;
ii
++
)
for
(
ii
=
0
,
jj
=
0
;
ii
<=
EDGE_N
;
ii
++
)
{
{
// List to append hotkeys in layer box selection
// List to append hotkeys in layer box selection
...
@@ -715,27 +729,9 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
...
@@ -715,27 +729,9 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
}
}
}
}
// Test me:
// int lchar = m_SelLayerBox->GetFont().GetPointSize();
// m_SelLayerBox->SetSize(wxSize(length * lchar,-1));
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
}
// Activation de l'affichage sur la bonne couche
UpdateToolbarLayerInfo
();
// Pour eviter la reentrance (Bug wxGTK version Linux?), la selection n'est faite que si
// elle est mauvaise (Pb corrige sur wxGTK 2.6.0)
jj
=
m_SelLayerBox
->
GetCount
();
ll
=
m_SelLayerBox
->
GetChoice
();
for
(
ii
=
0
;
ii
<
jj
;
ii
++
)
{
if
(
(
int
)
(
(
size_t
)
m_SelLayerBox
->
GetClientData
(
ii
)
)
==
((
PCB_SCREEN
*
)
GetScreen
())
->
m_Active_Layer
)
{
if
(
ii
!=
ll
)
m_SelLayerBox
->
SetSelection
(
ii
);
break
;
}
}
return
m_SelLayerBox
;
return
m_SelLayerBox
;
}
}
share/drawpanel.cpp
View file @
9e46a779
...
@@ -1178,7 +1178,11 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
...
@@ -1178,7 +1178,11 @@ void WinEDA_DrawPanel::OnMouseEvent( wxMouseEvent& event )
#endif
#endif
LastPanel
=
this
;
LastPanel
=
this
;
/* @todo: move this to where it is really needed, obviously not here in
response to every mouse move event:
m_Parent->SetToolbars();
m_Parent->SetToolbars();
*/
}
}
...
...
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