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
18c9a62c
Commit
18c9a62c
authored
Oct 13, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcbnew: DIALOG_FIND allows to change warp options and set callbacks for found items.
parent
ad2df709
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
22 deletions
+15
-22
dialog_find.cpp
pcbnew/dialogs/dialog_find.cpp
+15
-22
No files found.
pcbnew/dialogs/dialog_find.cpp
View file @
18c9a62c
...
@@ -36,26 +36,7 @@
...
@@ -36,26 +36,7 @@
#include <pcbnew.h>
#include <pcbnew.h>
#include <pcbnew_id.h>
#include <pcbnew_id.h>
#include <dialog_find_base.h>
#include <dialog_find.h>
class
DIALOG_FIND
:
public
DIALOG_FIND_BASE
{
public
:
DIALOG_FIND
(
PCB_BASE_FRAME
*
aParent
);
private
:
PCB_BASE_FRAME
*
parent
;
int
itemCount
,
markerCount
;
static
wxString
prevSearchString
;
static
bool
warpMouse
;
void
onButtonFindItemClick
(
wxCommandEvent
&
event
);
void
onButtonFindMarkerClick
(
wxCommandEvent
&
event
);
void
onButtonCloseClick
(
wxCommandEvent
&
event
);
void
onClose
(
wxCloseEvent
&
event
);
};
// Initialize static member variables
// Initialize static member variables
...
@@ -66,6 +47,7 @@ bool DIALOG_FIND::warpMouse = true;
...
@@ -66,6 +47,7 @@ bool DIALOG_FIND::warpMouse = true;
DIALOG_FIND
::
DIALOG_FIND
(
PCB_BASE_FRAME
*
aParent
)
:
DIALOG_FIND_BASE
(
aParent
)
DIALOG_FIND
::
DIALOG_FIND
(
PCB_BASE_FRAME
*
aParent
)
:
DIALOG_FIND_BASE
(
aParent
)
{
{
parent
=
aParent
;
parent
=
aParent
;
foundItem
=
NULL
;
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
m_SearchTextCtrl
->
AppendText
(
prevSearchString
);
m_SearchTextCtrl
->
AppendText
(
prevSearchString
);
...
@@ -78,6 +60,11 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent
...
@@ -78,6 +60,11 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent
Center
();
Center
();
}
}
void
DIALOG_FIND
::
EnableWarp
(
bool
aEnabled
)
{
m_NoMouseWarpCheckBox
->
SetValue
(
!
aEnabled
);
warpMouse
=
aEnabled
;
}
void
DIALOG_FIND
::
onButtonCloseClick
(
wxCommandEvent
&
aEvent
)
void
DIALOG_FIND
::
onButtonCloseClick
(
wxCommandEvent
&
aEvent
)
{
{
...
@@ -89,8 +76,8 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
...
@@ -89,8 +76,8 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
{
{
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
(
parent
->
GetScreen
()
);
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
(
parent
->
GetScreen
()
);
wxPoint
pos
;
wxPoint
pos
;
BOARD_ITEM
*
foundItem
=
0
;
foundItem
=
NULL
;
wxString
searchString
=
m_SearchTextCtrl
->
GetValue
();
wxString
searchString
=
m_SearchTextCtrl
->
GetValue
();
if
(
!
searchString
.
IsSameAs
(
prevSearchString
,
false
)
)
if
(
!
searchString
.
IsSameAs
(
prevSearchString
,
false
)
)
...
@@ -149,6 +136,9 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
...
@@ -149,6 +136,9 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
DisplayError
(
this
,
msg
,
10
);
DisplayError
(
this
,
msg
,
10
);
itemCount
=
0
;
itemCount
=
0
;
}
}
if
(
callback
)
callback
(
foundItem
);
}
}
...
@@ -156,7 +146,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
...
@@ -156,7 +146,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
{
{
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
(
parent
->
GetScreen
()
);
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
(
parent
->
GetScreen
()
);
wxPoint
pos
;
wxPoint
pos
;
BOARD_ITEM
*
foundItem
=
0
;
foundItem
=
NULL
;
parent
->
GetCanvas
()
->
GetViewStart
(
&
screen
->
m_StartVisu
.
x
,
&
screen
->
m_StartVisu
.
y
);
parent
->
GetCanvas
()
->
GetViewStart
(
&
screen
->
m_StartVisu
.
x
,
&
screen
->
m_StartVisu
.
y
);
...
@@ -184,6 +174,9 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
...
@@ -184,6 +174,9 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
DisplayError
(
this
,
msg
,
10
);
DisplayError
(
this
,
msg
,
10
);
markerCount
=
0
;
markerCount
=
0
;
}
}
if
(
callback
)
callback
(
foundItem
);
}
}
...
...
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