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
7399fdc3
Commit
7399fdc3
authored
Jan 22, 2010
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved focus handling, still need to handle the tab change
parent
7ab4a9bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
11 deletions
+28
-11
layer_widget.cpp
pcbnew/layer_widget.cpp
+18
-7
layer_widget.h
pcbnew/layer_widget.h
+9
-3
pcbframe.cpp
pcbnew/pcbframe.cpp
+1
-1
No files found.
pcbnew/layer_widget.cpp
View file @
7399fdc3
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <wx/wx.h>
#include <wx/wx.h>
#include <wx/statbmp.h>
#include <wx/statbmp.h>
#include <wx/notebook.h>
#include "macros.h"
#include "macros.h"
#include "common.h"
#include "common.h"
...
@@ -350,6 +351,15 @@ void LAYER_WIDGET::OnRenderCheckBox( wxCommandEvent& event )
...
@@ -350,6 +351,15 @@ void LAYER_WIDGET::OnRenderCheckBox( wxCommandEvent& event )
}
}
void
LAYER_WIDGET
::
OnTabChange
(
wxNotebookEvent
&
event
)
{
// printf("OnTabChange\n");
// passOnFocus(); // this segfaults, cannot enable it.
// maybe we need to find a way to call the stock tab change event handler
// first, then call passOnFocus() before we consider this event done.
}
wxWindow
*
LAYER_WIDGET
::
getLayerComp
(
int
aSizerNdx
)
wxWindow
*
LAYER_WIDGET
::
getLayerComp
(
int
aSizerNdx
)
{
{
if
(
(
unsigned
)
aSizerNdx
<
m_LayersFlexGridSizer
->
GetChildren
().
GetCount
()
)
if
(
(
unsigned
)
aSizerNdx
<
m_LayersFlexGridSizer
->
GetChildren
().
GetCount
()
)
...
@@ -456,19 +466,16 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
...
@@ -456,19 +466,16 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
void
LAYER_WIDGET
::
passOnFocus
()
void
LAYER_WIDGET
::
passOnFocus
()
{
{
wxWindow
*
parent
=
GetParent
();
m_FocusOwner
->
SetFocus
();
parent
->
SetFocus
();
// printf( "passOnFocus() %p %p\n", parent, m_OriginalParent );
}
}
//-----<public>-------------------------------------------------------
//-----<public>-------------------------------------------------------
LAYER_WIDGET
::
LAYER_WIDGET
(
wxWindow
*
parent
)
:
LAYER_WIDGET
::
LAYER_WIDGET
(
wxWindow
*
aParent
,
wxWindow
*
aFocusOwner
)
:
LAYER_PANEL_BASE
(
p
arent
)
LAYER_PANEL_BASE
(
aP
arent
)
{
{
m_
OriginalParent
=
parent
;
m_
FocusOwner
=
aFocusOwner
;
m_CurrentRow
=
-
1
;
m_CurrentRow
=
-
1
;
...
@@ -486,6 +493,10 @@ LAYER_WIDGET::LAYER_WIDGET( wxWindow* parent ) :
...
@@ -486,6 +493,10 @@ LAYER_WIDGET::LAYER_WIDGET( wxWindow* parent ) :
Connect
(
ID_SHOW_ALL_COPPERS
,
ID_SHOW_NO_COPPERS
,
Connect
(
ID_SHOW_ALL_COPPERS
,
ID_SHOW_NO_COPPERS
,
wxEVT_COMMAND_MENU_SELECTED
,
wxEVT_COMMAND_MENU_SELECTED
,
wxCommandEventHandler
(
LAYER_WIDGET
::
OnPopupSelection
),
NULL
,
this
);
wxCommandEventHandler
(
LAYER_WIDGET
::
OnPopupSelection
),
NULL
,
this
);
// trap the tab changes so that we can call passOnFocus().
m_notebook
->
Connect
(
-
1
,
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
,
wxNotebookEventHandler
(
LAYER_WIDGET
::
OnTabChange
)
);
}
}
...
...
pcbnew/layer_widget.h
View file @
7399fdc3
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
protected
:
protected
:
wxWindow
*
m_
OriginalParent
;
wxWindow
*
m_
FocusOwner
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_BlankBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxBitmap
*
m_RightArrowBitmap
;
wxSize
m_BitmapSize
;
wxSize
m_BitmapSize
;
...
@@ -116,6 +116,9 @@ protected:
...
@@ -116,6 +116,9 @@ protected:
void
OnRenderCheckBox
(
wxCommandEvent
&
event
);
void
OnRenderCheckBox
(
wxCommandEvent
&
event
);
void
OnTabChange
(
wxNotebookEvent
&
event
);
/**
/**
* Function getLayerComp
* Function getLayerComp
* returns the component within the m_LayersFlexGridSizer at aSizerNdx or
* returns the component within the m_LayersFlexGridSizer at aSizerNdx or
...
@@ -148,8 +151,11 @@ protected:
...
@@ -148,8 +151,11 @@ protected:
public
:
public
:
/** Constructor */
/** Constructor
LAYER_WIDGET
(
wxWindow
*
parent
);
* @param aFocusOwner is the window that should be sent the focus after
* every operation.
*/
LAYER_WIDGET
(
wxWindow
*
aParent
,
wxWindow
*
aFocusOwner
);
/**
/**
* Function GetBestSize
* Function GetBestSize
...
...
pcbnew/pcbframe.cpp
View file @
7399fdc3
...
@@ -228,7 +228,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
...
@@ -228,7 +228,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
m_show_microwave_tools
=
false
;
m_show_microwave_tools
=
false
;
m_show_layer_manager_tools
=
true
;
m_show_layer_manager_tools
=
true
;
m_Layers
=
new
LYRS
(
this
);
m_Layers
=
new
LYRS
(
this
,
DrawPanel
);
SetBoard
(
new
BOARD
(
NULL
,
this
)
);
SetBoard
(
new
BOARD
(
NULL
,
this
)
);
...
...
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