mirror of https://github.com/KLayout/klayout.git
commit
da5e287d9a
|
|
@ -1978,7 +1978,11 @@ MacroEditorDialog::replace_all_button_clicked ()
|
|||
void
|
||||
MacroEditorDialog::search_requested (const QString &s)
|
||||
{
|
||||
searchEditBox->setText (s);
|
||||
if (! s.isNull ()) {
|
||||
searchEditBox->setText (s);
|
||||
} else {
|
||||
searchEditBox->selectAll ();
|
||||
}
|
||||
searchEditBox->setFocus ();
|
||||
search_editing ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1788,7 +1788,11 @@ MacroEditorPage::eventFilter (QObject *watched, QEvent *event)
|
|||
QTextBlock e = mp_text->document ()->findBlock (c.selectionEnd ());
|
||||
if (e == s) {
|
||||
emit search_requested (c.selectedText ());
|
||||
} else {
|
||||
emit search_requested (QString ());
|
||||
}
|
||||
} else {
|
||||
emit search_requested (QString ());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ HTMLItemDelegate::HTMLItemDelegate (QObject *parent)
|
|||
m_icon_spacing = 6;
|
||||
m_text_margin = 4;
|
||||
m_text_height = -1;
|
||||
m_text_width = 500;
|
||||
m_text_width = -1;
|
||||
m_plain_text = false;
|
||||
m_anchors_clickable = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2566,8 +2566,12 @@ NetlistBrowserModel::data (const QModelIndex &index, int role) const
|
|||
return QVariant (icon_for_status (status (index)));
|
||||
} else if (role == Qt::DisplayRole) {
|
||||
return QVariant (text (index));
|
||||
} else if (role == Qt::ToolTipRole && index.column () == m_status_column) {
|
||||
return tooltip (index);
|
||||
} else if (role == Qt::ToolTipRole) {
|
||||
if (index.column () == m_status_column) {
|
||||
return tooltip (index);
|
||||
} else {
|
||||
return QVariant (text (index));
|
||||
}
|
||||
} else if (role == Qt::UserRole) {
|
||||
return QVariant (search_text (index));
|
||||
} else if (role == Qt::FontRole) {
|
||||
|
|
|
|||
|
|
@ -168,16 +168,22 @@ NetlistBrowserPage::NetlistBrowserPage (QWidget * /*parent*/)
|
|||
for (int i = 0; i < 4; ++i) {
|
||||
delegate = new lay::HTMLItemDelegate (this);
|
||||
delegate->set_text_margin (2);
|
||||
delegate->set_plain_text (true);
|
||||
/* currently, HTML is not used:
|
||||
delegate->set_anchors_clickable (true);
|
||||
connect (delegate, SIGNAL (anchor_clicked (const QString &)), this, SLOT (anchor_clicked (const QString &)));
|
||||
*/
|
||||
directory_tree->setItemDelegateForColumn (i, delegate);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
delegate = new lay::HTMLItemDelegate (this);
|
||||
delegate->set_text_margin (2);
|
||||
delegate->set_plain_text (true);
|
||||
/* currently, HTML is not used:
|
||||
delegate->set_anchors_clickable (true);
|
||||
connect (delegate, SIGNAL (anchor_clicked (const QString &)), this, SLOT (anchor_clicked (const QString &)));
|
||||
*/
|
||||
hierarchy_tree->setItemDelegateForColumn (i, delegate);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -164,8 +164,12 @@ NetlistBrowserTreeModel::data (const QModelIndex &index, int role) const
|
|||
return QVariant (icon_for_status (status (index)));
|
||||
} else if (role == Qt::DisplayRole) {
|
||||
return QVariant (text (index));
|
||||
} else if (role == Qt::ToolTipRole && index.column () == m_status_column) {
|
||||
return tooltip (index);
|
||||
} else if (role == Qt::ToolTipRole) {
|
||||
if (index.column () == m_status_column) {
|
||||
return tooltip (index);
|
||||
} else {
|
||||
return QVariant (text (index));
|
||||
}
|
||||
} else if (role == Qt::UserRole) {
|
||||
return QVariant (search_text (index));
|
||||
} else if (role == Qt::FontRole) {
|
||||
|
|
|
|||
|
|
@ -611,6 +611,7 @@ LEFDEFReaderOptions::format_name () const
|
|||
static void set_datatypes (db::LEFDEFReaderOptions *data, void (db::LEFDEFReaderOptions::*clear) (), void (db::LEFDEFReaderOptions::*set_datatype) (int datatype), void (db::LEFDEFReaderOptions::*set_datatype_per_mask) (unsigned int mask, int datatype), const std::string &s)
|
||||
{
|
||||
(data->*clear) ();
|
||||
(data->*set_datatype) (-1);
|
||||
|
||||
tl::Extractor ex (s.c_str ());
|
||||
|
||||
|
|
@ -642,6 +643,7 @@ static void set_datatypes (db::LEFDEFReaderOptions *data, void (db::LEFDEFReader
|
|||
static void set_suffixes (db::LEFDEFReaderOptions *data, void (db::LEFDEFReaderOptions::*clear) (), void (db::LEFDEFReaderOptions::*set_suffix) (const std::string &suffix), void (db::LEFDEFReaderOptions::*set_suffix_per_mask) (unsigned int mask, const std::string &suffix), const std::string &s)
|
||||
{
|
||||
(data->*clear) ();
|
||||
(data->*set_suffix) (std::string ());
|
||||
|
||||
tl::Extractor ex (s.c_str ());
|
||||
|
||||
|
|
|
|||
|
|
@ -1998,10 +1998,10 @@ OASISWriter::write (const db::CellInstArray &inst, db::properties_id_type prop_i
|
|||
|
||||
if (rep != db::Repetition ()) {
|
||||
for (db::RepetitionIterator r = rep.begin (); ! r.at_end (); ++r) {
|
||||
write_inst_with_rep (inst, prop_id, *r, array_rep);
|
||||
write_inst_with_rep (inst, prop_id, *r + po, array_rep);
|
||||
}
|
||||
} else {
|
||||
write_inst_with_rep (inst, prop_id, db::Vector (), array_rep);
|
||||
write_inst_with_rep (inst, prop_id, po, array_rep);
|
||||
}
|
||||
|
||||
} else if (inst.is_regular_array (a, b, amax, bmax) && (amax > 1 || bmax > 1)) {
|
||||
|
|
|
|||
|
|
@ -1805,3 +1805,45 @@ TEST(119_WithAndWithoutContext)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
TEST(120_IrregularInstRepetitions)
|
||||
{
|
||||
db::Manager m (false);
|
||||
db::Layout g (&m);
|
||||
|
||||
db::cell_index_type top = g.add_cell ("TOP");
|
||||
db::cell_index_type c1 = g.add_cell ("C1");
|
||||
|
||||
db::Vector pts[3] = { db::Vector (0, 10), db::Vector (0, 20), db::Vector (0, 30) };
|
||||
|
||||
unsigned int l1 = g.insert_layer (db::LayerProperties (1, 0));
|
||||
g.cell (c1).shapes (l1).insert (db::Box (-5, -5, 5, 5));
|
||||
db::iterated_array<db::Coord> *reps = new db::iterated_array<db::Coord> (pts + 0, pts + 3);
|
||||
g.cell (top).shapes (l1).insert (db::array<db::Box, db::UnitTrans> (db::Box (-5, -5, 5, 5), db::UnitTrans (), reps));
|
||||
|
||||
db::iterated_array<db::Coord> *rep = new db::iterated_array<db::Coord> (pts + 0, pts + 3);
|
||||
db::CellInstArray ci1 (db::CellInst (c1), db::Trans (db::Vector (10, 0)), rep);
|
||||
g.cell (top).insert (ci1);
|
||||
|
||||
std::string tmp_file = tl::TestBase::tmp_file (tl::sprintf ("tmp_dbOASISWriter120.oas"));
|
||||
|
||||
{
|
||||
tl::OutputStream out (tmp_file);
|
||||
db::SaveLayoutOptions options;
|
||||
options.set_format ("OASIS");
|
||||
db::Writer writer (options);
|
||||
writer.write (g, out);
|
||||
}
|
||||
|
||||
{
|
||||
tl::InputStream in (tmp_file);
|
||||
db::Reader reader (in);
|
||||
db::Layout gg;
|
||||
reader.set_warnings_as_errors (true);
|
||||
reader.read (gg);
|
||||
|
||||
CHECKPOINT ();
|
||||
db::compare_layouts (_this, gg, tl::testdata () + "/oasis/dbOASISWriter120_au.gds", db::NoNormalization);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue