Exemplo n.º 1
0
//----------------------------------------------------------------------------//
bool ScrolledContainer::handleChildMoved(const EventArgs&)
{
    // Fire event that notifies that a child's area has changed.
    WindowEventArgs args(this);
    onContentChanged(args);
    return true;
}
Exemplo n.º 2
0
//----------------------------------------------------------------------------//
void ScrolledContainer::onParentSized(WindowEventArgs& e)
{
    Window::onParentSized(e);

    // perform notification.
    WindowEventArgs args(this);
    onContentChanged(args);
}
Exemplo n.º 3
0
//----------------------------------------------------------------------------//
void ScrolledContainer::onAutoSizeSettingChanged(WindowEventArgs& e)
{
    fireEvent(EventAutoSizeSettingChanged, e, EventNamespace);

    if (d_autosizePane)
    {
        WindowEventArgs args(this);
        onContentChanged(args);
    }
}
Exemplo n.º 4
0
//----------------------------------------------------------------------------//
void ScrolledContainer::setContentArea(const Rect& area)
{
    if (!d_autosizePane)
    {
        d_contentArea = area;
        
        // Fire event
        WindowEventArgs args(this);
        onContentChanged(args);
   }

}
Exemplo n.º 5
0
//----------------------------------------------------------------------------//
void ScrolledContainer::onChildRemoved(WindowEventArgs& e)
{
    Window::onChildRemoved(e);

    // disconnect from events for this window.
    ConnectionTracker::iterator conn;
    while ((conn = d_eventConnections.find(e.window)) != d_eventConnections.end())
    {
        conn->second->disconnect();
        d_eventConnections.erase(conn);
    }

    // perform notification.
    WindowEventArgs args(this);
    onContentChanged(args);
}
Exemplo n.º 6
0
    void ScrolledContainer::onChildAdded(WindowEventArgs& e)
    {
        Window::onChildAdded(e);

        // subscribe to some events on this child
        d_eventConnections.insert(std::make_pair(e.window,
            e.window->subscribeEvent(Window::EventSized,
                Event::Subscriber(&ScrolledContainer::handleChildSized, this))));
        d_eventConnections.insert(std::make_pair(e.window,
            e.window->subscribeEvent(Window::EventMoved,
                Event::Subscriber(&ScrolledContainer::handleChildMoved, this))));

        // perform notification.
        WindowEventArgs args(this);
        onContentChanged(args);
    }
Exemplo n.º 7
0
//----------------------------------------------------------------------------//
void ScrolledContainer::onChildAdded(WindowEventArgs& e)
{
    Window::onChildAdded(e);

    // subscribe to some events on this child
    d_eventConnections.insert(std::make_pair(e.window,
        e.window->subscribeEvent(Window::EventSized,
            Event::Subscriber(&ScrolledContainer::handleChildSized, this))));
    d_eventConnections.insert(std::make_pair(e.window,
        e.window->subscribeEvent(Window::EventMoved,
            Event::Subscriber(&ScrolledContainer::handleChildMoved, this))));

    // force window to update what it thinks it's screen / pixel areas are.
    e.window->notifyScreenAreaChanged(false);

    // perform notification.
    WindowEventArgs args(this);
    onContentChanged(args);
}
//----------------------------------------------------------------------------//
void ScrolledContainer::onChildRemoved(ElementEventArgs& e)
{
    Window::onChildRemoved(e);

    // disconnect from events for this window.
    ConnectionTracker::iterator conn;
    while ((conn = d_eventConnections.find(static_cast<Window*>(e.element))) != d_eventConnections.end())
    {
        conn->second->disconnect();
        d_eventConnections.erase(conn);
    }

    // perform notification only if we're not currently being destroyed
    if (!d_destructionStarted)
    {
        WindowEventArgs args(this);
        onContentChanged(args);
    }
}
Exemplo n.º 9
0
	//-------------------------------------------------------------------------
	void Layer::setEnabled( bool enabled )
	//-------------------------------------------------------------------------
	{
		mEnabled = enabled;
		onContentChanged( );
	}
Exemplo n.º 10
0
//-----------------------------------------------------------------------------
// Function: NewDesignDialog::NewDesignDialog()
//-----------------------------------------------------------------------------
NewDesignDialog::NewDesignDialog(LibraryInterface* libInterface,
                                 QSharedPointer<Component> component,
                                 KactusAttribute::Implementation designType,
                                 QWidget *parent)
    : QDialog(parent), 
      lh_(libInterface),
      component_(component),
      viewNameLabel_(new QLabel(tr("View name:"), this)),
      viewNameMatcher_(),
      viewNameEdit_(new LineEditEx(this)),
      vlnvEditor_(new VLNVEditor(VLNV::DESIGN, libInterface, this, this, true)),
      directoryEditor_(new LibrarySelectorWidget(this)), 
      okButton_(new QPushButton(tr("&OK"))),
      designExt_(),
      designConfExt_()
{
    switch (designType)
    {
    case KactusAttribute::HW:
        {
            viewNameLabel_->setText(tr("Name for a new view to HW component:"));
            viewNameEdit_->setDisallowedInputs(component->getViewNames());
            viewNameEdit_->setMessageTemplate("View name '%1' already exists!");
            vlnvEditor_->setTitle("VLNV for new HW design and design configuration");
            designExt_ = ".design";
            designConfExt_ = ".designcfg";
            break;
        }

    case KactusAttribute::SW:
        {
            viewNameLabel_->setText(tr("Name for a new SW view to component:"));
            viewNameEdit_->setDisallowedInputs(component->getSWViewNames());
            viewNameEdit_->setMessageTemplate("SW view name '%1' already exists!");
            vlnvEditor_->setTitle("VLNV for new SW design and design configuration");
            designExt_ = ".swdesign";
            designConfExt_ = ".swdesigncfg";
            break;
        }

    case KactusAttribute::SYSTEM:
        {
            viewNameLabel_->setText(tr("Name for a new system view to HW component:"));
            viewNameEdit_->setDisallowedInputs(component->getSystemViewNames());
            viewNameEdit_->setMessageTemplate("System view name '%1' already exists!");
            vlnvEditor_->setTitle("VLNV for new system design and design configuration");
            designExt_ = ".sysdesign";
            designConfExt_ = ".sysdesigncfg";
            break;
        }

    default:
        {
            Q_ASSERT(false);
            break;
        }
    }

    viewNameEdit_->setMessageIcon(QPixmap(":/icons/common/graphics/exclamation.png"));
    viewNameEdit_->setContentMatcher(&viewNameMatcher_);

    connect(viewNameEdit_, SIGNAL(textChanged(QString const&)), this, SLOT(updateVlnvName()));
    connect(viewNameEdit_, SIGNAL(textChanged(QString const&)), this, SLOT(onContentChanged()));

    vlnvEditor_->addNameExtension(designExt_);
    vlnvEditor_->addNameExtension(designConfExt_);
    vlnvEditor_->addContentType(VLNV::DESIGNCONFIGURATION);

    connect(vlnvEditor_, SIGNAL(contentChanged()), this, SLOT(onContentChanged()));
    connect(vlnvEditor_, SIGNAL(contentChanged()), this, SLOT(updateDirectory()));
        
    directoryEditor_->layout()->setContentsMargins(0,11,0,11);
	connect(directoryEditor_, SIGNAL(contentChanged()), this, SLOT(onContentChanged()));

    okButton_->setEnabled(false);
    connect(okButton_, SIGNAL(released()), this, SLOT(accept()));

    QPushButton *cancelButton = new QPushButton(tr("&Cancel"));
    connect(cancelButton, SIGNAL(released()), this, SLOT(reject()));

    QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal);
    buttonBox->addButton(okButton_, QDialogButtonBox::ActionRole);
    buttonBox->addButton(cancelButton, QDialogButtonBox::ActionRole);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addWidget(viewNameLabel_);
    mainLayout->addWidget(viewNameEdit_);
    mainLayout->addWidget(vlnvEditor_);
    mainLayout->addWidget(directoryEditor_);
    mainLayout->addWidget(buttonBox);
    mainLayout->addStretch(1);
    setLayout(mainLayout);

    setWindowTitle("New HW Design");
    setFixedHeight(sizeHint().height());
    resize(400, sizeHint().height());
    okButton_->setDefault(true);
}