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
902e5cce
Commit
902e5cce
authored
Sep 02, 2013
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcb layer box selector: ajust size when modifying the layer names, to show the full name.
parent
047749a8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
23 deletions
+30
-23
wxPcbStruct.h
include/wxPcbStruct.h
+9
-1
class_pcb_layer_box_selector.cpp
pcbnew/class_pcb_layer_box_selector.cpp
+4
-9
class_pcb_layer_widget.cpp
pcbnew/class_pcb_layer_widget.cpp
+1
-1
dialog_layers_setup.cpp
pcbnew/dialogs/dialog_layers_setup.cpp
+1
-1
files.cpp
pcbnew/files.cpp
+2
-3
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-1
pcbnew.cpp
pcbnew/pcbnew.cpp
+1
-1
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+11
-6
No files found.
include/wxPcbStruct.h
View file @
902e5cce
...
...
@@ -542,7 +542,15 @@ public:
void
ReCreateMicrowaveVToolbar
();
void
ReCreateOptToolbar
();
void
ReCreateMenuBar
();
PCB_LAYER_BOX_SELECTOR
*
ReCreateLayerBox
(
wxAuiToolBar
*
parent
);
/**
* Re create the layer Box by clearing the old list, and building
* le new one, from the new layers names and cole layers
* @param aForceResizeToolbar = true to resize the parent toolbar
* false if not needed (mainly in parent toolbar creation,
* or when the layers names are not modified)
*/
void
ReCreateLayerBox
(
bool
aForceResizeToolbar
=
true
);
/**
* Function OnModify
...
...
pcbnew/class_pcb_layer_box_selector.cpp
View file @
902e5cce
...
...
@@ -51,10 +51,8 @@ void PCB_LAYER_BOX_SELECTOR::Resync()
static
DECLARE_LAYERS_HOTKEY
(
layerhk
);
// Tray to fix a minimum width fot the BitmapComboBox
int
minwidth
,
h
;
int
minwidth
=
80
,
h
;
wxClientDC
dc
(
GetParent
()
);
// The DC for "this" is not always initialized
wxString
dummyText
(
wxT
(
"XXXXXXXXXXXX"
)
);
dc
.
GetTextExtent
(
dummyText
,
&
minwidth
,
&
h
);
#define BM_SIZE 14
for
(
LAYER_NUM
i
=
FIRST_LAYER
;
i
<
NB_LAYERS
;
++
i
)
...
...
@@ -83,14 +81,11 @@ void PCB_LAYER_BOX_SELECTOR::Resync()
Append
(
layername
,
layerbmp
,
(
void
*
)(
intptr_t
)
layerid
);
int
w
;
dc
.
GetTextExtent
(
layername
,
&
w
,
&
h
);
minwidth
=
std
::
max
(
minwidth
,
w
);
}
}
minwidth
+=
BM_SIZE
+
12
;
// Take in account the bitmap size and margins
wxLogMessage
(
"minw %d min %d"
,
minwidth
,
GetMinClientSize
().
x
);
// SetMinClientSize( wxSize( minwidth, -1 ) );
Layout
();
minwidth
+=
BM_SIZE
+
35
;
// Take in account the bitmap size and margins
SetMinClientSize
(
wxSize
(
minwidth
,
-
1
)
);
}
...
...
pcbnew/class_pcb_layer_widget.cpp
View file @
902e5cce
...
...
@@ -341,7 +341,7 @@ void PCB_LAYER_WIDGET::ReFill()
void
PCB_LAYER_WIDGET
::
OnLayerColorChange
(
LAYER_NUM
aLayer
,
EDA_COLOR_T
aColor
)
{
myframe
->
GetBoard
()
->
SetLayerColor
(
aLayer
,
aColor
);
myframe
->
ReCreateLayerBox
(
NULL
);
myframe
->
ReCreateLayerBox
(
false
);
myframe
->
GetCanvas
()
->
Refresh
();
}
...
...
pcbnew/dialogs/dialog_layers_setup.cpp
View file @
902e5cce
...
...
@@ -560,7 +560,7 @@ void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
}
m_Parent
->
OnModify
();
m_Parent
->
ReCreateLayerBox
(
NULL
);
m_Parent
->
ReCreateLayerBox
();
m_Parent
->
ReFillLayerWidget
();
EndModal
(
wxID_OK
);
...
...
pcbnew/files.cpp
View file @
902e5cce
...
...
@@ -141,7 +141,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
fn
.
SetExt
(
PcbFileExtension
);
GetBoard
()
->
SetFileName
(
fn
.
GetFullPath
()
);
UpdateTitle
();
ReCreateLayerBox
(
NULL
);
ReCreateLayerBox
();
}
break
;
...
...
@@ -396,8 +396,7 @@ bool PCB_EDIT_FRAME::LoadOnePcbFile( const wxString& aFileName, bool aAppend,
// Update info shown by the horizontal toolbars
GetBoard
()
->
SetCurrentNetClass
(
NETCLASS
::
Default
);
ReFillLayerWidget
();
ReCreateLayerBox
(
NULL
);
ReCreateLayerBox
();
// upate the layer widget to match board visibility states, both layers and render columns.
syncLayerVisibilities
();
...
...
pcbnew/pcbframe.cpp
View file @
902e5cce
...
...
@@ -589,7 +589,7 @@ void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
if
(
returncode
==
wxID_OK
)
// New rules, or others changes.
{
ReCreateLayerBox
(
NULL
);
ReCreateLayerBox
();
updateTraceWidthSelectBox
();
updateViaSizeSelectBox
();
OnModify
();
...
...
pcbnew/pcbnew.cpp
View file @
902e5cce
...
...
@@ -301,7 +301,7 @@ bool EDA_APP::OnInit()
frame
->
Clear_Pcb
(
false
);
// update the layer names in the listbox
frame
->
ReCreateLayerBox
(
NULL
);
frame
->
ReCreateLayerBox
(
false
);
/* For an obscure reason the focus is lost after loading a board file
* when starting (i.e. only at this point)
...
...
pcbnew/tool_pcb.cpp
View file @
902e5cce
...
...
@@ -281,7 +281,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
m_SelLayerBox
=
new
PCB_LAYER_BOX_SELECTOR
(
m_mainToolBar
,
ID_TOOLBARH_PCB_SELECT_LAYER
);
m_SelLayerBox
->
SetBoardFrame
(
this
);
}
ReCreateLayerBox
(
m_mainToolBar
);
ReCreateLayerBox
(
false
);
m_mainToolBar
->
AddControl
(
m_SelLayerBox
);
PrepareLayerIndicator
();
// Initialize the bitmap with current
...
...
@@ -663,14 +663,19 @@ void PCB_EDIT_FRAME::updateViaSizeSelectBox()
}
PCB_LAYER_BOX_SELECTOR
*
PCB_EDIT_FRAME
::
ReCreateLayerBox
(
wxAuiToolBar
*
parent
)
void
PCB_EDIT_FRAME
::
ReCreateLayerBox
(
bool
aForceResizeToolbar
)
{
if
(
m_SelLayerBox
==
NULL
)
return
NULL
;
if
(
m_SelLayerBox
==
NULL
||
m_mainToolBar
==
NULL
)
return
;
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
m_SelLayerBox
->
m_hotkeys
=
g_Board_Editor_Hokeys_Descr
;
m_SelLayerBox
->
Resync
();
m_SelLayerBox
->
SetToolTip
(
_
(
"+/- to switch"
)
);
return
m_SelLayerBox
;
if
(
aForceResizeToolbar
)
{
// the layer box can have its size changed
// Update the aui manager, to take in account the new size
m_auimgr
.
Update
();
}
}
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