diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc
index b04503489..ce00d229c 100644
--- a/src/edt/edt/edtPartialService.cc
+++ b/src/edt/edt/edtPartialService.cc
@@ -1094,7 +1094,7 @@ PartialService::timeout ()
mp_view->clear_transient_selection ();
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = db::DBox (m_hover_point, m_hover_point).enlarged (db::DVector (l, l));
PartialShapeFinder finder (true, m_top_level_sel, db::ShapeIterator::All);
@@ -1748,7 +1748,7 @@ PartialService::mouse_click_event (const db::DPoint &p, unsigned int buttons, bo
try {
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = db::DBox (p, p).enlarged (db::DVector (l, l));
// check, if there is a selected shape under the mouse - in this case, we do not do a new selection
@@ -2551,7 +2551,7 @@ PartialService::partial_select (const db::DBox &box, lay::Editable::SelectionMod
clear_partial_transient_selection ();
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = box.enlarged (db::DVector (l, l));
bool needs_update = false;
diff --git a/src/edt/edt/edtService.cc b/src/edt/edt/edtService.cc
index e01d98187..cc1f85f55 100644
--- a/src/edt/edt/edtService.cc
+++ b/src/edt/edt/edtService.cc
@@ -829,7 +829,7 @@ double
Service::click_proximity (const db::DPoint &pos, lay::Editable::SelectionMode mode)
{
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = db::DBox (pos, pos).enlarged (db::DVector (l, l));
// for single-point selections either exclude the current selection or the
@@ -889,7 +889,7 @@ Service::transient_select (const db::DPoint &pos)
}
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = db::DBox (pos, pos).enlarged (db::DVector (l, l));
if (m_cell_inst_service) {
@@ -1152,7 +1152,7 @@ bool
Service::select (const db::DBox &box, lay::Editable::SelectionMode mode)
{
// compute search box
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox search_box = box.enlarged (db::DVector (l, l));
bool needs_update = false;
diff --git a/src/klayout.pro b/src/klayout.pro
index fbf20df44..e8e3bfafa 100644
--- a/src/klayout.pro
+++ b/src/klayout.pro
@@ -101,3 +101,6 @@ plugins.depends += lib rdb db
unit_tests.depends += plugins $$MAIN_DEPENDS
+RESOURCES += \
+ laybasic/laybasic/layResources.qrc
+
diff --git a/src/laybasic/laybasic/LayoutViewConfigPage2c.ui b/src/laybasic/laybasic/LayoutViewConfigPage2c.ui
index 9e18f7d6a..27e462baa 100644
--- a/src/laybasic/laybasic/LayoutViewConfigPage2c.ui
+++ b/src/laybasic/laybasic/LayoutViewConfigPage2c.ui
@@ -7,7 +7,7 @@
0
0
608
- 235
+ 318
@@ -17,7 +17,16 @@
6
-
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
9
-
@@ -26,7 +35,16 @@
How the selection is shown
-
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
9
@@ -153,7 +171,7 @@
561
- 16
+ 10
@@ -172,17 +190,104 @@
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 10
+
+
+
+
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Raised
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+ Capture range to mouse cursor
+
+
+
+ -
+
+
+ 9999
+
+
+
+ -
+
+
+ pixel
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 311
+ 20
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
- lay::DitherPatternSelectionButton
+ lay::ColorButton
QPushButton
- lay::ColorButton
+ lay::DitherPatternSelectionButton
QPushButton
diff --git a/src/laybasic/laybasic/LayoutViewConfigPage7.ui b/src/laybasic/laybasic/LayoutViewConfigPage7.ui
index 679f8d489..fc794d04d 100644
--- a/src/laybasic/laybasic/LayoutViewConfigPage7.ui
+++ b/src/laybasic/laybasic/LayoutViewConfigPage7.ui
@@ -1,68 +1,87 @@
-
+
+
LayoutViewConfigPage7
-
-
+
+
0
0
791
- 323
+ 385
-
+
Application Settings
-
-
- 9
-
-
+
+
6
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-
-
-
+
+
Oversampling
-
-
+
+
9
-
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
6
-
-
-
-
+
-
+
+
Use oversampling:
- -
-
+
-
+
-
-
+
No oversampling
-
-
+
2x oversampling
-
-
+
3x oversampling
- -
+
-
-
+
Qt::Horizontal
-
+
40
20
@@ -70,12 +89,12 @@
- -
-
-
+
-
+
+
Oversampling increases the image quality by using an internal resolution larger than the image resolution. Drawing speed is somewhat reduced and lines may appear thinner.
-
+
true
@@ -84,38 +103,47 @@
-
-
-
+
+
Default Font Size
-
-
- 9
-
-
+
+
6
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-
-
-
- Font size for "Default" font and rulers
+
+
+ Font size for "Default" font and rulers
-
-
+
-
-
+
Small
-
-
+
Medium
-
-
+
Large
@@ -123,10 +151,10 @@
-
-
+
Qt::Horizontal
-
+
40
20
@@ -138,98 +166,115 @@
-
-
-
+
+
Global Transformation
-
-
- 9
-
-
+
+
6
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-
-
-
+
+
Transform the view globally with
-
-
+
-
-
+
(r0)
-
- :/r0.png
+
+
+ :/r0.png:/r0.png
-
-
+
(r90)
-
- :/r90.png
+
+
+ :/r90.png:/r90.png
-
-
+
(r180)
-
- :/r180.png
+
+
+ :/r180.png:/r180.png
-
-
+
(r270)
-
- :/r270.png
+
+
+ :/r270.png:/r270.png
-
-
+
(m0)
-
- :/m0.png
+
+
+ :/m0.png:/m0.png
-
-
+
(m45)
-
- :/m45.png
+
+
+ :/m45.png:/m45.png
-
-
+
(m90)
-
- :/m90.png
+
+
+ :/m90.png:/m90.png
-
-
+
(m135)
-
- :/m135.png
+
+
+ :/m135.png:/m135.png
-
-
+
Qt::Horizontal
-
+
40
20
@@ -241,37 +286,46 @@
-
-
-
+
+
Hierarchy Depth
-
-
+
+
9
-
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
6
-
-
-
-
+
-
+
+
Initial hierarchy depth when opening a new panel
- -
-
-
+
-
+
+
1000
- -
+
-
-
+
Qt::Horizontal
-
+
40
20
@@ -279,12 +333,12 @@
- -
-
-
- (This setting is not active if "select all hierarchy levels on new cell" is checked on the "Navigation/New Cell" tab)
+
-
+
+
+ (This setting is not active if "select all hierarchy levels on new cell" is checked on the "Navigation/New Cell" tab)
-
+
true
@@ -294,9 +348,9 @@
-
+
-
+
diff --git a/src/laybasic/laybasic/layFinder.h b/src/laybasic/laybasic/layFinder.h
index 382b4c841..da60b737a 100644
--- a/src/laybasic/laybasic/layFinder.h
+++ b/src/laybasic/laybasic/layFinder.h
@@ -44,9 +44,6 @@ namespace tl
namespace lay
{
-// default search range for select in pixels
-const unsigned int search_range = 5; // TODO make variable?
-
/**
* @brief A generic finder class
*
diff --git a/src/laybasic/laybasic/layLayoutView.cc b/src/laybasic/laybasic/layLayoutView.cc
index f88ed2dc6..54b498936 100644
--- a/src/laybasic/laybasic/layLayoutView.cc
+++ b/src/laybasic/laybasic/layLayoutView.cc
@@ -435,6 +435,7 @@ LayoutView::init (db::Manager *mgr, lay::PluginRoot *root, QWidget * /*parent*/)
m_copy_cvr = -1;
m_copy_layera = -1;
m_copy_layerr = -1;
+ m_search_range = 5;
m_layer_properties_lists.push_back (new LayerPropertiesList ());
m_layer_properties_lists.back ()->attach_view (this, (unsigned int) (m_layer_properties_lists.size () - 1));
@@ -1075,6 +1076,13 @@ LayoutView::configure (const std::string &name, const std::string &value)
child_ctx_enabled (h);
return true;
+ } else if (name == cfg_search_range) {
+
+ unsigned int n;
+ tl::from_string (value, n);
+ set_search_range (n);
+ return true;
+
} else if (name == cfg_abstract_mode_enabled) {
bool e;
@@ -6424,6 +6432,18 @@ LayoutView::is_editable () const
return m_editable;
}
+unsigned int
+LayoutView::search_range ()
+{
+ return m_search_range;
+}
+
+void
+LayoutView::set_search_range (unsigned int sr)
+{
+ m_search_range = sr;
+}
+
void
LayoutView::message (const std::string &s, int timeout)
{
diff --git a/src/laybasic/laybasic/layLayoutView.h b/src/laybasic/laybasic/layLayoutView.h
index c2e3caf0b..5b871e7a4 100644
--- a/src/laybasic/laybasic/layLayoutView.h
+++ b/src/laybasic/laybasic/layLayoutView.h
@@ -2188,6 +2188,18 @@ public:
return m_marker_halo;
}
+ /**
+ * @brief Gets the "search range" in pixels
+ * The search range applies whenever some object is looked up in the vicinity of the
+ * mouse cursor. This value gives the search range in pixels.
+ */
+ unsigned int search_range ();
+
+ /**
+ * @brief Sets the "search range" in pixels
+ */
+ void set_search_range (unsigned int sr);
+
/**
* @brief Return true, if any cellview is editable
*/
@@ -2734,6 +2746,8 @@ private:
int m_marker_line_style;
bool m_marker_halo;
+ unsigned int m_search_range;
+
bool m_transient_selection_mode;
bool m_sel_inside_pcells;
diff --git a/src/laybasic/laybasic/layLayoutViewConfigPages.cc b/src/laybasic/laybasic/layLayoutViewConfigPages.cc
index 94187cae1..2fcb6ebf6 100644
--- a/src/laybasic/laybasic/layLayoutViewConfigPages.cc
+++ b/src/laybasic/laybasic/layLayoutViewConfigPages.cc
@@ -366,6 +366,10 @@ LayoutViewConfigPage2c::setup (lay::PluginRoot *root)
bool ipm = 0;
root->config_get (cfg_sel_inside_pcells_mode, ipm);
mp_ui->sel_inside_pcells_cb->setChecked (ipm);
+
+ unsigned int sr = 0;
+ root->config_get (cfg_search_range, sr);
+ mp_ui->search_range_spinbx->setValue (sr);
}
void
@@ -379,6 +383,7 @@ LayoutViewConfigPage2c::commit (lay::PluginRoot *root)
root->config_set (cfg_sel_halo, mp_ui->halo_cb->isChecked ());
root->config_set (cfg_sel_transient_mode, mp_ui->transient_mode_cb->isChecked ());
root->config_set (cfg_sel_inside_pcells_mode, mp_ui->sel_inside_pcells_cb->isChecked ());
+ root->config_set (cfg_search_range, (unsigned int) mp_ui->search_range_spinbx->value ());
}
// ------------------------------------------------------------
@@ -1511,6 +1516,7 @@ public:
options.push_back (std::pair (cfg_child_ctx_dimming, "50"));
options.push_back (std::pair (cfg_child_ctx_hollow, "false"));
options.push_back (std::pair (cfg_child_ctx_enabled, "false"));
+ options.push_back (std::pair (cfg_search_range, "5"));
options.push_back (std::pair (cfg_abstract_mode_width, "10.0"));
options.push_back (std::pair (cfg_abstract_mode_enabled, "false"));
options.push_back (std::pair (cfg_fit_new_cell, "true"));
diff --git a/src/laybasic/laybasic/layNetlistBrowserDialog.cc b/src/laybasic/laybasic/layNetlistBrowserDialog.cc
index f06e66714..5396cb1ec 100644
--- a/src/laybasic/laybasic/layNetlistBrowserDialog.cc
+++ b/src/laybasic/laybasic/layNetlistBrowserDialog.cc
@@ -192,7 +192,7 @@ void
NetlistBrowserDialog::probe_net (const db::DPoint &p, bool trace_path)
{
// prepare for the net tracing
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox start_search_box = db::DBox (p, p).enlarged (db::DVector (l, l));
diff --git a/src/laybasic/laybasic/laybasicConfig.h b/src/laybasic/laybasic/laybasicConfig.h
index 58788e56e..4953c3edb 100644
--- a/src/laybasic/laybasic/laybasicConfig.h
+++ b/src/laybasic/laybasic/laybasicConfig.h
@@ -58,6 +58,8 @@ static const std::string cfg_child_ctx_dimming ("child-context-dimming");
static const std::string cfg_child_ctx_hollow ("child-context-hollow");
static const std::string cfg_child_ctx_enabled ("child-context-enabled");
+static const std::string cfg_search_range ("search-range");
+
static const std::string cfg_abstract_mode_enabled ("abstract-mode-enabled");
static const std::string cfg_abstract_mode_width ("abstract-mode-width");
diff --git a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc
index a5974917b..c3303712a 100644
--- a/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc
+++ b/src/plugins/tools/net_tracer/lay_plugin/layNetTracerDialog.cc
@@ -169,7 +169,7 @@ NetTracerDialog::mouse_click_event (const db::DPoint &p, unsigned int buttons, b
// prepare for the net tracing
clear_markers ();
- double l = double (lay::search_range) / widget ()->mouse_event_trans ().mag ();
+ double l = double (view ()->search_range ()) / widget ()->mouse_event_trans ().mag ();
db::DBox start_search_box = db::DBox (p, p).enlarged (db::DVector (l, l));