Fixed some qrc files, added more attributes to PCellParameterState (tool tip, readonly, icon), added option to show parameter names

This commit is contained in:
Matthias Koefferlein 2022-10-29 21:19:35 +02:00
parent d00c4a94d6
commit 0e5842d36e
13 changed files with 258 additions and 65 deletions

View File

@ -330,11 +330,21 @@ public:
class DB_PUBLIC ParameterState
{
public:
/**
* @brief A enum describing the icon type
*/
enum Icon {
NoIcon = 0,
InfoIcon = 1,
ErrorIcon = 2,
WarningIcon = 3
};
/**
* @brief Parameterized constructor
*/
ParameterState ()
: m_value (), m_visible (true), m_enabled (true)
: m_value (), m_visible (true), m_enabled (true), m_readonly (false), m_icon (NoIcon)
{
// .. nothing yet ..
}
@ -387,9 +397,59 @@ public:
m_enabled = v;
}
/**
* @brief Gets a value indicating whether the parameter is read-only
*/
bool is_readonly () const
{
return m_readonly;
}
/**
* @brief Sets a value indicating whether the parameter is read-only
*/
void set_readonly (bool f)
{
m_readonly = f;
}
/**
* @brief Gets the tooltip for the parameter
*/
const std::string &tooltip () const
{
return m_tooltip;
}
/**
* @brief Sets the tooltip
*/
void set_tooltip (const std::string &s)
{
m_tooltip = s;
}
/**
* @brief Gets the icon
*/
Icon icon () const
{
return m_icon;
}
/**
* @brief Sets the icon
*/
void set_icon (Icon i)
{
m_icon = i;
}
private:
tl::Variant m_value;
bool m_visible, m_enabled;
bool m_visible, m_enabled, m_readonly;
std::string m_tooltip;
Icon m_icon;
};
/**

View File

@ -23,6 +23,7 @@
#include "gsiDecl.h"
#include "gsiEnums.h"
#include "dbLayout.h"
#include "dbLibrary.h"
#include "dbPCellDeclaration.h"
@ -319,6 +320,26 @@ Class<db::ParameterState> decl_PCellParameterState ("db", "PCellParameterState",
) +
gsi::method("is_enabled?", &db::ParameterState::is_enabled,
"@brief Gets a value indicating whether the parameter is enabled in the parameter form\n"
) +
gsi::method("readonly=", &db::ParameterState::set_readonly, gsi::arg ("f"),
"@brief Sets a value indicating whether the parameter is made read-only (not editable) in the parameter form\n"
) +
gsi::method("is_readonly?", &db::ParameterState::is_readonly,
"@brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form\n"
) +
gsi::method("tooltip=", &db::ParameterState::set_tooltip, gsi::arg ("s"),
"@brief Sets the tool tip text\n"
"\n"
"The tool tip is shown when hovering over the parameter label or edit field."
) +
gsi::method("tooltip", &db::ParameterState::tooltip,
"@brief Gets the tool tip text\n"
) +
gsi::method("icon=", &db::ParameterState::set_icon, gsi::arg ("i"),
"@brief Sets the icon for the parameter\n"
) +
gsi::method("tooltip", &db::ParameterState::tooltip,
"@brief Gets the icon for the parameter\n"
),
"@brief Provides access to the attributes of a single parameter within \\PCellParameterStates.\n"
"\n"
@ -327,6 +348,27 @@ Class<db::ParameterState> decl_PCellParameterState ("db", "PCellParameterState",
"This class has been introduced in version 0.28."
);
gsi::EnumIn<db::ParameterState, db::ParameterState::Icon> decl_PCellParameterState_Icon ("db", "ParameterStateIcon",
gsi::enum_const ("NoIcon", db::ParameterState::NoIcon,
"@brief No icon is shown for the parameter\n"
) +
gsi::enum_const ("InfoIcon", db::ParameterState::InfoIcon,
"@brief A general 'information' icon is shown\n"
) +
gsi::enum_const ("ErrorIcon", db::ParameterState::ErrorIcon,
"@brief An icon indicating an error is shown\n"
) +
gsi::enum_const ("WarningIcon", db::ParameterState::WarningIcon,
"@brief An icon indicating a warning is shown\n"
),
"@brief This enum specifies the icon shown next to the parameter in PCell parameter list.\n"
"\n"
"This enum was introduced in version 0.28.\n"
);
// Inject the NetlistCrossReference::Status declarations into NetlistCrossReference:
gsi::ClassExt<db::ParameterState> inject_PCellParameterState_Icon_in_parent (decl_PCellParameterState_Icon.defs ());
// Provide a binding for db::ParameterStates for native PCell implementations
Class<db::ParameterStates> decl_PCellParameterStates ("db", "PCellParameterStates",
gsi::method ("has_parameter?", &db::ParameterStates::has_parameter, gsi::arg ("name"),

View File

@ -26,7 +26,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_none_32px.png</normaloff>:/align_none_32px.png</iconset>
</property>
<property name="iconSize">
@ -43,7 +43,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_left_32px.png</normaloff>:/align_left_32px.png</iconset>
</property>
<property name="iconSize">
@ -60,7 +60,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_hcenter_32px.png</normaloff>:/align_hcenter_32px.png</iconset>
</property>
<property name="iconSize">
@ -77,7 +77,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_right_32px.png</normaloff>:/align_right_32px.png</iconset>
</property>
<property name="iconSize">
@ -204,7 +204,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_none_32px.png</normaloff>:/align_none_32px.png</iconset>
</property>
<property name="iconSize">
@ -221,7 +221,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_top_32px.png</normaloff>:/align_top_32px.png</iconset>
</property>
<property name="iconSize">
@ -238,7 +238,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_vcenter_32px.png</normaloff>:/align_vcenter_32px.png</iconset>
</property>
<property name="iconSize">
@ -308,7 +308,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_bottom_32px.png</normaloff>:/align_bottom_32px.png</iconset>
</property>
<property name="iconSize">
@ -432,7 +432,7 @@
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../../lay/lay/layResources.qrc"/>
<include location="../../icons/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -278,7 +278,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_none_32px.png</normaloff>:/align_none_32px.png</iconset>
</property>
<property name="iconSize">
@ -311,7 +311,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_left_32px.png</normaloff>:/align_left_32px.png</iconset>
</property>
<property name="iconSize">
@ -344,7 +344,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_hcenter_32px.png</normaloff>:/align_hcenter_32px.png</iconset>
</property>
<property name="iconSize">
@ -377,7 +377,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_right_32px.png</normaloff>:/align_right_32px.png</iconset>
</property>
<property name="iconSize">
@ -456,7 +456,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_none_32px.png</normaloff>:/align_none_32px.png</iconset>
</property>
<property name="iconSize">
@ -489,7 +489,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_top_32px.png</normaloff>:/align_top_32px.png</iconset>
</property>
<property name="iconSize">
@ -522,7 +522,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_vcenter_32px.png</normaloff>:/align_vcenter_32px.png</iconset>
</property>
<property name="iconSize">
@ -555,7 +555,7 @@
<string/>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/align_bottom_32px.png</normaloff>:/align_bottom_32px.png</iconset>
</property>
<property name="iconSize">
@ -676,7 +676,7 @@
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../../lay/lay/layResources.qrc"/>
<include location="../../icons/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -158,7 +158,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/find_16px.png</normaloff>:/find_16px.png</iconset>
</property>
<property name="autoRaise">
@ -549,7 +549,7 @@
</customwidget>
</customwidgets>
<resources>
<include location="../../lay/lay/layResources.qrc"/>
<include location="../../icons/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -59,7 +59,6 @@
<font>
<family>Sans Serif</family>
<pointsize>12</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
@ -731,7 +730,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../lay/lay/layResources.qrc">:/warn_16px@2x.png</pixmap>
<pixmap resource="../../icons/icons.qrc">:/warn_16px@2x.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
@ -899,7 +898,7 @@
<tabstop>inst_pb</tabstop>
</tabstops>
<resources>
<include location="../../lay/lay/layResources.qrc"/>
<include location="../../icons/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -144,7 +144,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/ct_31px.png</normaloff>:/ct_31px.png</iconset>
</property>
<property name="iconSize">
@ -164,7 +164,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/lt_31px.png</normaloff>:/lt_31px.png</iconset>
</property>
<property name="iconSize">
@ -184,7 +184,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/rt_31px.png</normaloff>:/rt_31px.png</iconset>
</property>
<property name="iconSize">
@ -204,7 +204,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/lc_31px.png</normaloff>:/lc_31px.png</iconset>
</property>
<property name="iconSize">
@ -224,7 +224,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/cc_31px.png</normaloff>:/cc_31px.png</iconset>
</property>
<property name="iconSize">
@ -244,7 +244,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/rc_31px.png</normaloff>:/rc_31px.png</iconset>
</property>
<property name="iconSize">
@ -264,7 +264,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/lb_31px.png</normaloff>:/lb_31px.png</iconset>
</property>
<property name="iconSize">
@ -284,7 +284,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/cb_31px.png</normaloff>:/cb_31px.png</iconset>
</property>
<property name="iconSize">
@ -304,7 +304,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../lay/lay/layResources.qrc">
<iconset resource="../../icons/icons.qrc">
<normaloff>:/rb_31px.png</normaloff>:/rb_31px.png</iconset>
</property>
<property name="iconSize">
@ -366,7 +366,7 @@
</layout>
</widget>
<resources>
<include location="../../lay/lay/layResources.qrc"/>
<include location="../../icons/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -149,7 +149,7 @@ static void set_value (const db::PCellParameterDeclaration &p, QWidget *widget,
}
PCellParametersPage::PCellParametersPage (QWidget *parent, bool dense)
: QFrame (parent), m_dense (dense), dm_parameter_changed (this, &PCellParametersPage::do_parameter_changed)
: QFrame (parent), m_dense (dense), m_show_parameter_names (false), dm_parameter_changed (this, &PCellParametersPage::do_parameter_changed)
{
init ();
}
@ -170,7 +170,7 @@ PCellParametersPage::init ()
frame_layout->setContentsMargins (0, 0, 0, 0);
setLayout (frame_layout);
mp_update_frame = new QFrame ();
mp_update_frame = new QFrame (this);
mp_update_frame->setFrameShape (QFrame::NoFrame);
frame_layout->addWidget (mp_update_frame, 0, 0, 1, 1);
@ -197,7 +197,7 @@ PCellParametersPage::init ()
update_frame_layout->setColumnStretch (2, 1);
mp_error_frame = new QFrame ();
mp_error_frame = new QFrame (this);
mp_error_frame->setFrameShape (QFrame::NoFrame);
frame_layout->addWidget (mp_error_frame, 1, 0, 1, 1);
@ -224,6 +224,13 @@ PCellParametersPage::init ()
error_frame_layout->addWidget (mp_error_label, 1, 1, 1, 2);
error_frame_layout->setColumnStretch (2, 1);
mp_show_parameter_names_cb = new QCheckBox (this);
mp_show_parameter_names_cb->setText (tr ("Show parameter names"));
mp_show_parameter_names_cb->setChecked (m_show_parameter_names);
frame_layout->addWidget (mp_show_parameter_names_cb, 3, 0, 1, 1);
connect (mp_show_parameter_names_cb, SIGNAL (clicked (bool)), this, SLOT (show_parameter_names (bool)));
}
bool
@ -232,6 +239,18 @@ PCellParametersPage::lazy_evaluation ()
return mp_pcell_decl.get () && mp_pcell_decl->wants_lazy_evaluation ();
}
void
PCellParametersPage::show_parameter_names (bool f)
{
if (m_show_parameter_names == f) {
return;
}
m_show_parameter_names = f;
mp_show_parameter_names_cb->setChecked (f);
setup (mp_view, m_cv_index, mp_pcell_decl.get (), get_parameters ());
}
void
PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::PCellDeclaration *pcell_decl, const db::pcell_parameters_type &parameters)
{
@ -239,12 +258,14 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
mp_view = view;
m_cv_index = cv_index;
m_states = db::ParameterStates ();
m_initial_states = db::ParameterStates ();
if (mp_parameters_area) {
delete mp_parameters_area;
}
m_widgets.clear ();
m_icon_widgets.clear ();
m_all_widgets.clear ();
mp_parameters_area = new QScrollArea (this);
@ -269,6 +290,12 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
QWidget *main_frame = inner_frame;
QGridLayout *main_grid = inner_grid;
if (! mp_pcell_decl) {
mp_parameters_area->setWidget (main_frame);
update_current_parameters ();
return;
}
int main_row = 0;
int row = 0;
std::string group_title;
@ -286,13 +313,14 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
db::ParameterState &ps = m_states.parameter (p->get_name ());
ps.set_value (value);
ps.set_enabled (! p->is_readonly ());
ps.set_readonly (p->is_readonly ());
ps.set_visible (! p->is_hidden ());
m_all_widgets.push_back (std::vector<QWidget *> ());
if (p->get_type () == db::PCellParameterDeclaration::t_shape) {
m_widgets.push_back (0);
m_icon_widgets.push_back (0);
continue;
}
@ -312,7 +340,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
// create a new group
QGroupBox *gb = new QGroupBox (main_frame);
gb->setTitle (tl::to_qstring (gt));
main_grid->addWidget (gb, main_row, 0, 1, 2);
main_grid->addWidget (gb, main_row, 0, 1, 3);
inner_grid = new QGridLayout (gb);
if (m_dense) {
@ -339,10 +367,28 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
}
QLabel *icon_label = new QLabel (QString (), inner_frame);
inner_grid->addWidget (icon_label, row, 0);
m_icon_widgets.push_back (icon_label);
m_all_widgets.back ().push_back (icon_label);
if (p->get_type () != db::PCellParameterDeclaration::t_callback) {
QLabel *l = new QLabel (tl::to_qstring (description), inner_frame);
inner_grid->addWidget (l, row, 0);
std::string leader;
if (m_show_parameter_names) {
leader = tl::sprintf ("[%s] ", p->get_name ());
}
QLabel *l = new QLabel (tl::to_qstring (leader + description), inner_frame);
inner_grid->addWidget (l, row, 1);
m_all_widgets.back ().push_back (l);
} else if (m_show_parameter_names) {
QLabel *l = new QLabel (tl::to_qstring (tl::sprintf ("[%s]", p->get_name ())), inner_frame);
inner_grid->addWidget (l, row, 1);
m_all_widgets.back ().push_back (l);
}
if (p->get_choices ().empty ()) {
@ -368,7 +414,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
hb->addWidget (ul, 1);
ul->setText (tl::to_qstring (p->get_unit ()));
inner_grid->addWidget (f, row, 1);
inner_grid->addWidget (f, row, 2);
m_all_widgets.back ().push_back (f);
connect (le, SIGNAL (editingFinished ()), this, SLOT (parameter_changed ()));
@ -383,7 +429,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
pb->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred);
m_widgets.push_back (pb);
inner_grid->addWidget (pb, row, 1);
inner_grid->addWidget (pb, row, 2);
m_all_widgets.back ().push_back (pb);
connect (pb, SIGNAL (clicked ()), this, SLOT (parameter_changed ()));
@ -397,7 +443,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
QLineEdit *le = new QLineEdit (inner_frame);
le->setObjectName (tl::to_qstring (p->get_name ()));
m_widgets.push_back (le);
inner_grid->addWidget (le, row, 1);
inner_grid->addWidget (le, row, 2);
m_all_widgets.back ().push_back (le);
connect (le, SIGNAL (editingFinished ()), this, SLOT (parameter_changed ()));
@ -411,7 +457,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
ly->set_view (mp_view, m_cv_index, true /*all layers*/);
ly->setObjectName (tl::to_qstring (p->get_name ()));
m_widgets.push_back (ly);
inner_grid->addWidget (ly, row, 1);
inner_grid->addWidget (ly, row, 2);
m_all_widgets.back ().push_back (ly);
connect (ly, SIGNAL (activated (int)), this, SLOT (parameter_changed ()));
@ -425,7 +471,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
cbx->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
cbx->setObjectName (tl::to_qstring (p->get_name ()));
m_widgets.push_back (cbx);
inner_grid->addWidget (cbx, row, 1);
inner_grid->addWidget (cbx, row, 2);
m_all_widgets.back ().push_back (cbx);
connect (cbx, SIGNAL (stateChanged (int)), this, SLOT (parameter_changed ()));
@ -456,7 +502,7 @@ PCellParametersPage::setup (lay::LayoutViewBase *view, int cv_index, const db::P
cb->setMinimumContentsLength (30);
cb->setSizeAdjustPolicy (QComboBox::AdjustToMinimumContentsLengthWithIcon);
m_widgets.push_back (cb);
inner_grid->addWidget (cb, row, 1);
inner_grid->addWidget (cb, row, 2);
m_all_widgets.back ().push_back (cb);
}
@ -499,6 +545,8 @@ PCellParametersPage::get_state ()
s.vScrollPosition = mp_parameters_area->verticalScrollBar ()->value ();
s.hScrollPosition = mp_parameters_area->horizontalScrollBar ()->value ();
s.show_parameter_names = m_show_parameter_names;
if (focusWidget ()) {
s.focusWidget = focusWidget ()->objectName ();
}
@ -514,6 +562,10 @@ PCellParametersPage::set_state (const State &s)
mp_parameters_area->verticalScrollBar ()->setValue (s.vScrollPosition);
mp_parameters_area->horizontalScrollBar ()->setValue (s.hScrollPosition);
if (s.show_parameter_names != m_show_parameter_names) {
show_parameter_names (s.show_parameter_names);
}
if (! s.focusWidget.isEmpty ()) {
QWidget *c = findChild<QWidget *> (s.focusWidget);
if (c) {
@ -617,7 +669,7 @@ PCellParametersPage::get_parameters_internal (db::ParameterStates &states, bool
db::ParameterState &ps = states.parameter (p->get_name ());
if (! ps.is_visible () || ! ps.is_enabled () || p->get_type () == db::PCellParameterDeclaration::t_shape) {
if (! ps.is_visible () || ! ps.is_enabled () || ps.is_readonly () || p->get_type () == db::PCellParameterDeclaration::t_shape) {
continue;
}
@ -834,11 +886,43 @@ PCellParametersPage::update_widgets_from_states (const db::ParameterStates &stat
const db::ParameterState &ps = states.parameter (name);
if (m_widgets [i]) {
m_widgets [i]->setEnabled (ps.is_enabled ());
m_widgets [i]->setEnabled (ps.is_enabled () && ! ps.is_readonly ());
}
for (auto w = m_all_widgets [i].begin (); w != m_all_widgets [i].end (); ++w) {
if (*w != m_widgets [i]) {
(*w)->setEnabled (ps.is_enabled ());
}
(*w)->setVisible (ps.is_visible ());
(*w)->setToolTip (tl::to_qstring (ps.tooltip ()));
}
if (m_icon_widgets [i]) {
static QPixmap error (":/error_16px@2x.png");
static QPixmap info (":/info_16px@2x.png");
static QPixmap warning (":/warn_16px@2x.png");
switch (ps.icon ()) {
case db::ParameterState::NoIcon:
default:
m_icon_widgets [i]->setPixmap (QPixmap ());
m_icon_widgets [i]->hide ();
break;
case db::ParameterState::InfoIcon:
m_icon_widgets [i]->setPixmap (info);
m_icon_widgets [i]->show ();
break;
case db::ParameterState::WarningIcon:
m_icon_widgets [i]->setPixmap (warning);
m_icon_widgets [i]->show ();
break;
case db::ParameterState::ErrorIcon:
m_icon_widgets [i]->setPixmap (error);
m_icon_widgets [i]->show ();
break;
}
}
}

View File

@ -32,6 +32,7 @@
#include <QScrollArea>
#include <QLabel>
#include <QToolButton>
#include <QCheckBox>
namespace lay
{
@ -52,9 +53,10 @@ Q_OBJECT
public:
struct State
{
State () : valid (false), hScrollPosition (0), vScrollPosition (0) { }
State () : valid (false), show_parameter_names (false), hScrollPosition (0), vScrollPosition (0) { }
bool valid;
bool show_parameter_names;
int hScrollPosition;
int vScrollPosition;
QString focusWidget;
@ -138,6 +140,9 @@ public:
signals:
void edited ();
public slots:
void show_parameter_names (bool f);
private slots:
void parameter_changed ();
void update_button_pressed ();
@ -150,12 +155,14 @@ private:
QLabel *mp_changed_icon;
QToolButton *mp_update_button;
QFrame *mp_error_frame, *mp_update_frame;
QCheckBox *mp_show_parameter_names_cb;
tl::weak_ptr<db::PCellDeclaration> mp_pcell_decl;
std::vector<QWidget *> m_widgets;
std::vector<QLabel *> m_icon_widgets;
std::vector<std::vector<QWidget *> > m_all_widgets;
lay::LayoutViewBase *mp_view;
int m_cv_index;
bool m_dense;
bool m_dense, m_show_parameter_names;
tl::DeferredMethod<PCellParametersPage> dm_parameter_changed;
db::ParameterStates m_current_states, m_initial_states;
db::ParameterStates m_states;

View File

@ -190,7 +190,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/clear_16px.png</normaloff>:/clear_16px.png</iconset>
</property>
</widget>
@ -204,7 +204,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/add_16px.png</normaloff>:/add_16px.png</iconset>
</property>
</widget>
@ -218,7 +218,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/up_16px.png</normaloff>:/up_16px.png</iconset>
</property>
</widget>
@ -232,7 +232,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/down_16px.png</normaloff>:/down_16px.png</iconset>
</property>
</widget>
@ -298,7 +298,7 @@
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
<include location="../../../../lay/lay/layResources.qrc"/>
<include location="../../../../icons/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -147,7 +147,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/clear_16px.png</normaloff>:/clear_16px.png</iconset>
</property>
</widget>
@ -161,7 +161,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/down_16px.png</normaloff>:/down_16px.png</iconset>
</property>
</widget>
@ -175,7 +175,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/add_16px.png</normaloff>:/add_16px.png</iconset>
</property>
</widget>
@ -197,7 +197,7 @@ You can use expressions inside the path components for variable paths</string>
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../lay/lay/layResources.qrc">
<iconset resource="../../../../icons/icons.qrc">
<normaloff>:/up_16px.png</normaloff>:/up_16px.png</iconset>
</property>
</widget>
@ -315,7 +315,7 @@ You can use expressions inside the path components for variable paths</string>
<tabstop>read_all_cbx</tabstop>
</tabstops>
<resources>
<include location="../../../../lay/lay/layResources.qrc"/>
<include location="../../../../icons/icons.qrc"/>
</resources>
<connections>
<connection>

View File

@ -284,7 +284,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/warn_16px@2x.png</pixmap>
<pixmap resource="../../../../icons/icons.qrc">:/warn_16px@2x.png</pixmap>
</property>
</widget>
</item>
@ -379,7 +379,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../lay/lay/layResources.qrc">:/warn_16px@2x.png</pixmap>
<pixmap resource="../../../../icons/icons.qrc">:/warn_16px@2x.png</pixmap>
</property>
</widget>
</item>
@ -430,7 +430,7 @@
<tabstop>subst_char</tabstop>
</tabstops>
<resources>
<include location="../../../../lay/lay/layResources.qrc"/>
<include location="../../../../icons/icons.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -22,3 +22,4 @@ SOURCES = \
FORMS = \
OASISWriterOptionPage.ui \