mirror of https://github.com/KLayout/klayout.git
Adding the ruler options widget and disabling editor options in viewer mode
This commit is contained in:
parent
c8362d16f1
commit
cb918203c7
|
|
@ -25,6 +25,7 @@
|
|||
#include "layConverters.h"
|
||||
#include "layDispatcher.h"
|
||||
#include "layAbstractMenu.h"
|
||||
#include "layLayoutViewBase.h"
|
||||
#include "tlColor.h"
|
||||
#include "tlLog.h"
|
||||
#if defined(HAVE_QT)
|
||||
|
|
@ -139,11 +140,10 @@ PluginDeclaration::create_plugin (db::Manager *manager, lay::Dispatcher *, lay::
|
|||
}
|
||||
|
||||
std::vector<std::string>
|
||||
PluginDeclaration::additional_editor_options_pages () const
|
||||
PluginDeclaration::additional_editor_options_pages (lay::LayoutViewBase * /*view*/) const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
// TODO: provide in a central place instead of borrowing from the edt module
|
||||
names.push_back ("GenericEditorOptions");
|
||||
names.push_back ("ant::RulerOptions");
|
||||
return names;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
virtual void uninitialize (lay::Dispatcher *);
|
||||
virtual bool menu_activated (const std::string &symbol) const;
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const;
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *view) const;
|
||||
|
||||
void register_annotation_template (const ant::Template &t, lay::Plugin *plugin = 0);
|
||||
void unregister_annotation_template (const std::string &category, lay::Plugin *plugin = 0);
|
||||
|
|
|
|||
|
|
@ -142,8 +142,8 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
{
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *) const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
names.push_back ("GenericEditorOptions");
|
||||
return names;
|
||||
|
|
@ -415,7 +415,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *) const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
names.push_back ("GenericEditorOptions");
|
||||
|
|
|
|||
|
|
@ -482,11 +482,15 @@ public:
|
|||
return new MoveService (view);
|
||||
}
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *view) const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
// TODO: provide in a central place instead of borrowing from the edt module
|
||||
names.push_back ("GenericEditorOptions");
|
||||
if (view->is_editable ()) {
|
||||
// TODO: provide in a central place instead of borrowing from the edt module
|
||||
names.push_back ("GenericEditorOptions");
|
||||
}
|
||||
// TODO: provide in a central place instead of borrowing from the ant module
|
||||
names.push_back ("ant::RulerOptions");
|
||||
return names;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ public:
|
|||
* In addition to providing pages through "get_editor_options_pages", the plugin can request pages
|
||||
* from globally registered factories by name.
|
||||
*/
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase * /*view*/) const
|
||||
{
|
||||
return std::vector<std::string> ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -333,11 +333,13 @@ public:
|
|||
return new SelectionService (view);
|
||||
}
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *view) const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
// TODO: provide in a central place instead of borrowing from the edt module
|
||||
names.push_back ("GenericEditorOptions");
|
||||
if (view->is_editable ()) {
|
||||
// TODO: provide in a central place instead of borrowing from the edt module
|
||||
names.push_back ("GenericEditorOptions");
|
||||
}
|
||||
return names;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ public:
|
|||
m_additional_editor_options_pages.push_back (name);
|
||||
}
|
||||
|
||||
virtual std::vector<std::string> additional_editor_options_pages () const
|
||||
virtual std::vector<std::string> additional_editor_options_pages (lay::LayoutViewBase *) const
|
||||
{
|
||||
return m_additional_editor_options_pages;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ EditorOptionsFrame::populate (LayoutViewBase *view)
|
|||
|
||||
for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ++cls) {
|
||||
cls->get_editor_options_pages (editor_options_pages, view, view->dispatcher ());
|
||||
std::vector<std::string> ap = cls->additional_editor_options_pages ();
|
||||
std::vector<std::string> ap = cls->additional_editor_options_pages (view);
|
||||
for (auto i = ap.begin (); i != ap.end (); ++i) {
|
||||
additional_pages [*i].push_back (cls.operator-> ());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue