Example #1
0
mxListView::mxListView (mxWindow *parent, int x, int y, int w, int h, int id)
: mxWidget (parent, x, y, w, h)
{
	if (!parent)
		return;

	d_this = new mxListView_i;

	DWORD dwStyle = LVS_NOSORTHEADER | LVS_REPORT | LVS_SHOWSELALWAYS | WS_VISIBLE | WS_CHILD;
	HWND hwndParent = (HWND) ((mxWidget *) parent)->getHandle ();

	d_this->d_hwnd = CreateWindowEx (WS_EX_CLIENTEDGE, WC_LISTVIEW, "", dwStyle,
				x, y, w, h, hwndParent,
				(HMENU) id, (HINSTANCE) GetModuleHandle (NULL), NULL);
	
	SendMessage (d_this->d_hwnd, WM_SETFONT, (WPARAM) (HFONT) GetStockObject (ANSI_VAR_FONT), MAKELPARAM (TRUE, 0));
	SetWindowLong (d_this->d_hwnd, GWL_USERDATA, (LONG) this);

	setHandle ((void *) d_this->d_hwnd);
	setType (MX_LISTVIEW);
	setParent (parent);
	setId (id);
}
Example #2
0
void Window::dockUndock()
{
    if (parent()) {
        setParent(0);
        setAttribute(Qt::WA_DeleteOnClose);
        move(QApplication::desktop()->width() / 2 - width() / 2,
             QApplication::desktop()->height() / 2 - height() / 2);
        dockBtn->setText(tr("Dock"));
        show();
    } else {
        if (!mainWindow->centralWidget()) {
            if (mainWindow->isVisible()) {
                setAttribute(Qt::WA_DeleteOnClose, false);
                dockBtn->setText(tr("Undock"));
                mainWindow->setCentralWidget(this);
            } else {
                QMessageBox::information(0, tr("Cannot dock"), tr("Main window already closed"));
            }
        } else {
            QMessageBox::information(0, tr("Cannot dock"), tr("Main window already occupied"));
        }
    }
}
Example #3
0
void twDialog::showWithCompletionHandler(twInvocation *handler){
	twReleaseCapture();
	m_handler=handler;
	m_mode=twDM_handler;
	
	if(m_needsDimming){
		m_dimmer=twDimmer::openDimmer(m_dimmerStyle, new twNoArgumentMemberFunctionInvocation<twDialog>(this, &twDialog::backgroundTouched));
		m_oldDesktop=getParent();
		setParent(m_dimmer);
		m_dimmer->setHidingWindow(this);
	}
	
	m_res=twDR_invalid;
	
	if(twWnd *w=twGetDesktop()){
		twRect r1=w->getRect();
		twRect r2=getRect();
		setRect(twRect( (r1.w-r2.w)/2, (r1.h-r2.h)/2, r2.w, r2.h ));
	}
	
	show();
	focus();
}
Example #4
0
	void Sound::create (Movable *parent)
	{
		Ogre::SceneManager *mSceneMgr = RadXML::getSingletonPtr ()->getSceneManager ();

		if (load == true)
		{
			sSound = new RadXmlCommon::s13Sound ();
			sSound->strPath = file;
			sSound->bStreaming = streaming;
			sSound->dGain = gain;
			sSound->LoadPath ();

			if (sSound->IsLoaded () == false)
				RadXmlCommon::s13LogMessage ("Unable to load audio file: " + file);

			if (bPlay == true)
				sSound->Play ();
		}

		/// @note Create the SceneNode here and keep it updated.
		updateSettings ();
		setParent (parent);
	}
Example #5
0
void WLayout::setParentWidget(WWidget *parent)
{
  if (!this->parent())
    setParent(parent);

  assert(!impl_);

  int c = count();
  for (int i = 0; i < c; ++i) {
    WLayoutItem *item = itemAt(i);
    if (item)
      item->setParentWidget(parent);
  }

  impl_ = parent->createLayoutItemImpl(this);

  if (hints_) {
    for (unsigned i = 0; i < hints_->size(); ++i)
      impl_->setHint((*hints_)[i].name, (*hints_)[i].value);
    delete hints_;
    hints_ = 0;
  }
}
SpectrumAnalyserThread::SpectrumAnalyserThread(QObject *parent)
    :   QObject(parent)
#ifndef DISABLE_FFT
    ,   m_fft(new FFTRealWrapper)
#endif
    ,   m_numSamples(SpectrumLengthSamples)
    ,   m_windowFunction(DefaultWindowFunction)
    ,   m_window(SpectrumLengthSamples, 0.0)
    ,   m_input(SpectrumLengthSamples, 0.0)
    ,   m_output(SpectrumLengthSamples, 0.0)
    ,   m_spectrum(SpectrumLengthSamples)
#ifdef SPECTRUM_ANALYSER_SEPARATE_THREAD
    ,   m_thread(new QThread(this))
#endif
{
#ifdef SPECTRUM_ANALYSER_SEPARATE_THREAD
    // moveToThread() cannot be called on a QObject with a parent
    setParent(0);
    moveToThread(m_thread);
    m_thread->start();
#endif
    calculateWindow();
}
Example #7
0
void Completer::invokeCompletion( QPlainTextEdit* editor )
{
    if ( !isVisible() )
    {
        mEditor = editor;
        setParent( mEditor, windowFlags() );
        QPoint position = mEditor->mapToGlobal( mEditor->cursorRect().topLeft() );
        int h = mEditor->cursorRect().height();
        QDesktopWidget *dw = QApplication::desktop();

        if(position.ry() < (dw->screen()->height()-height()))
            position.ry() += h;
        else
            position.ry() -= (h+height());

        move( position );
        if ( prepareCompletion() )
        {
            show();
            lwItems->setFocus();
        }
    }
}
void		THIS::init(parent_t * const & p)
{
	printv_func(DEBUG);

	setParent(p);

	auto self = std::dynamic_pointer_cast<neb::gfx::environ::three>(shared_from_this());
	
	neb::gfx::environ::single<neb::gfx::camera::view::Base>::init(p);
	neb::gfx::environ::three::init(p);

	//programs_.reset(new neb::gfx::glsl::program::threed("3d"));
	//programs_->init();
	
	
	
	// camera
	/*
	if(!getParent()->view_) {
		getParent()->view_.reset(new neb::gfx::camera::view::Free(self));
	}
	*/
}
Example #9
0
DelDialog::DelDialog(QString name, QString text, QWidget* parent)
{
	setParent(parent);
	setWindowFlags(Qt::Dialog);
	setWindowTitle(name);
	setModal(1);

	layout = new QGridLayout;
	label = new QLabel (text, this);
	acceptButton = new QPushButton (tr("&yes"), this);
	rejectButton = new QPushButton (tr("&no"), this);

	rejectButton->setFocus();

	connect(acceptButton, SIGNAL(clicked()), this, SLOT(accept()));
	connect(rejectButton, SIGNAL(clicked()), this, SLOT(reject()));

	layout->addWidget(label, 0, 0, 1, 0);
	layout->addWidget(acceptButton, 1, 0);
	layout->addWidget(rejectButton, 1, 1);

	setLayout(layout);
}
Example #10
0
Magic3D::Object::~Object()
{
    std::vector<Object*>::const_iterator it_o = children.begin();
    while (it_o != children.end())
    {
        (*it_o++)->setParent(NULL, false);
    }
    children.clear();

    std::vector<ObjectInstance*>::const_iterator it_i = instances.begin();
    while (it_i != instances.end())
    {
        (*it_i++)->setInstance(NULL, false);
    }
    instances.clear();

    if (getParent())
    {
        setParent(NULL);
    }

    if (Script::getInstance())
    {
        if (isScripted())
        {
            setScripted(false);
        }
    }

    if (AI)
    {
        delete AI;
        AI = NULL;
    }

    clearMeshes();
}
Example #11
0
    void bindServer(const char *port, EventHandler *pProcessor) {
        sockaddr_in sin = { 0 };

        sin.sin_family = AF_INET;
        sin.sin_port = htons(atoi(port));

        int listenerfd = socket(AF_INET, SOCK_STREAM, 0);
        if (listenerfd == -1) {
            ERRNO_OUT("Error creating listening socket");
            exit(1);
        }
        int reuse = 1;
        if (setsockopt(listenerfd, SOL_SOCKET, SO_REUSEADDR, &reuse,
                sizeof(reuse))) {
            ERRNO_OUT("Error enabling socket reuse");
            exit(1);
        }
        evutil_make_socket_nonblocking(listenerfd);

        if (bind(listenerfd, (sockaddr*) &sin, sizeof(sin)) < 0) {
            perror("bind");
        }

        if (listen(listenerfd, 16) < 0) {
            perror("listen");
            return;
        }
        setParent(pProcessor);

        event *e = event_new(m_ebase, listenerfd, EV_READ | EV_PERSIST,
                acceptfn, (void*) pProcessor);

        event_add(e, NULL);

        INFO_OUT("Bound to port:%s\n", port);

    }
Example #12
0
UniversalMusicScraper::UniversalMusicScraper(QObject *parent)
{
    setParent(parent);
    m_tadbApiKey = "7490823590829082posuda";

    m_language = "en";
    m_prefer = "theaudiodb";
    m_widget = new QWidget(MainWindow::instance());
    m_box = new QComboBox(m_widget);
    m_box->addItem(tr("Chinese"), "cn");
    m_box->addItem(tr("Dutch"), "nl");
    m_box->addItem(tr("English"), "en");
    m_box->addItem(tr("French"), "fr");
    m_box->addItem(tr("German"), "de");
    m_box->addItem(tr("Hebrew"), "il");
    m_box->addItem(tr("Hungarian"), "hu");
    m_box->addItem(tr("Italian"), "it");
    m_box->addItem(tr("Japanese"), "jp");
    m_box->addItem(tr("Norwegian"), "no");
    m_box->addItem(tr("Polish"), "pl");
    m_box->addItem(tr("Portuguese"), "pt");
    m_box->addItem(tr("Russian"), "ru");
    m_box->addItem(tr("Spanish"), "es");
    m_box->addItem(tr("Swedish"), "se");
    m_preferBox = new QComboBox(m_widget);
    m_preferBox->addItem(tr("The Audio DB"), "theaudiodb");
    m_preferBox->addItem(tr("AllMusic"), "allmusic");
    m_preferBox->addItem(tr("Discogs"), "discogs");
    QGridLayout *layout = new QGridLayout(m_widget);
    layout->addWidget(new QLabel(tr("Language")), 0, 0);
    layout->addWidget(m_box, 0, 1);
    layout->addWidget(new QLabel(tr("Prefer")), 1, 0);
    layout->addWidget(m_preferBox, 1, 1);
    layout->setColumnStretch(2, 1);
    layout->setContentsMargins(12, 0, 12, 12);
    m_widget->setLayout(layout);
}
Example #13
0
RDirNode::RDirNode(RDirNode* parent, const std::string & abspath) {

    changePath(abspath);

    parent = 0;
    setParent(parent);

    accel = spos = prev_accel = vel = vec2(0.0f);

    //NOTE: parent is always being set to 0 so this never gets called ...

    //figure out starting position
    if(parent !=0) {
        vec2 parentPos = parent->getPos();
        vec2 offset;

        pos = parentPos;
    } else {
        pos = vec2(0.0f, 0.0f);
    }

    float padded_file_radius  = gGourceFileDiameter * 0.5;

    file_area  = padded_file_radius * padded_file_radius * PI;

    visible_count = 0;

    visible = false;
    position_initialized = false;

    since_node_visible = 0.0;
    since_last_file_change = 0.0;
    since_last_node_change = 0.0;

    calcRadius();
    calcColour();
}
Example #14
0
        InstanceAdaptor::InstanceAdaptor(AbstractPlugin *p_plgn) : Adaptor(Core::instance ()) {
            if (p_plgn == NULL){
                emit pluginCantLoad (Core::arguments ()->value ("plugin").toString ());
                QApplication::quit ();
            } else {
                connect(QApplication::instance (),SIGNAL(aboutToQuit()),this,SIGNAL(aboutToQuit()));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginCantLoad",
                                                        this,SIGNAL(pluginCantLoad(QString)));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginLoaded",
                                                        this,SIGNAL(pluginLoaded(QString)));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginUnloaded",
                                                        this,SIGNAL(pluginUnloaded(QString)));

                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","aboutToQuit",
                                                        this,SLOT(aboutToQuit()));

                setParent(p_plgn);
                //setAutoRelaySignals (true);
            }
        }
Example #15
0
    void bindServer(const char *port, EventHandler *pProcessor) {
        struct sockaddr_in sin = { 0 };

        sin.sin_family = AF_INET;
        sin.sin_addr.s_addr = 0;
        sin.sin_port = htons(atoi(port));

        listener = socket(AF_INET, SOCK_STREAM, 0);
        this->server = pProcessor;
        setParent(pProcessor);
        fcntl(listener, F_SETFL, O_NONBLOCK);
        int oneval = 1;
        setsockopt(listener, SOL_SOCKET, SO_REUSEADDR, &oneval, sizeof(oneval));
        if (bind(listener, (struct sockaddr*) &sin, sizeof(sin)) < 0) {
            perror("bind");
            return;
        }
        INFO_OUT("Bound to port %s", port);
        if (listen(listener, 16) < 0) {
            perror("listen");
            return;
        }
        INFO_OUT("Listenning to port %s", port);
    }
Example #16
0
	QWidget* MailTreeDelegate::createEditor (QWidget *parent,
			const QStyleOptionViewItem& option, const QModelIndex& index) const
	{
		const auto& actionsVar = index.data (MailModel::MailRole::MessageActions);
		if (actionsVar.isNull ())
			return nullptr;

		const auto& actionInfos = actionsVar.value<QList<MessageListActionInfo>> ();
		if (actionInfos.isEmpty ())
			return nullptr;

		const auto& id = index.data (MailModel::MailRole::ID).toByteArray ();

		const auto container = new QToolBar { parent };
		auto style = new NullMarginsStyle;
		style->setParent (container);
		container->setStyle (style);
		for (const auto& actInfo : actionInfos)
			BuildAction (std::bind (Loader_, id), container, actInfo);

		Util::ExecuteLater ([=] { updateEditorGeometry (container, option, index); });

		return container;
	}
BattleScripting::BattleScripting(QScriptEngine *engine, BaseBattleWindowInterface *_interface)
{
    myinterface = _interface;
    myengine = engine;
    myengine->setParent(this);
    setParent(_interface);

    registerObject(ProxyDataContainer);
    registerObject(TeamProxy);
    registerObject(PokeProxy);
    registerObject(MoveProxy);
    registerObject(AuxPokeDataProxy);
    registerObject(FieldProxy);
    qScriptRegisterMetaType<BattleChoice>(engine, &toBattleChoice, &fromBattleChoice);

    advbattledata_proxy *data = _interface->getBattleData();
    ProxyDataContainer *pdata = data->exposedData();
    int me = data->isPlayer(1) ? 1 : 0;
    int opp = !me;

    QScriptValue battle = myengine->newQObject(_interface);
    myengine->globalObject().setProperty("battle", battle);
    battle.setProperty("data", myengine->newQObject(dynamic_cast<QObject*>(pdata)));
    battle.setProperty("me", QScriptValue(me));
    battle.setProperty("opp", QScriptValue(opp));
    battle.setProperty("id", _interface->battleId());

    /* Removes clientscripting' print function and add ours. Client scripting's print function
      can still be accessed with sys.print() */
    QScriptValue printfun = myengine->newFunction(nativePrint);
    printfun.setData(myengine->newQObject(this));
    myengine->globalObject().setProperty("print", myengine->nullValue());
    myengine->globalObject().setProperty("print", printfun);

    _interface->addOutput(this);
}
Example #18
0
void GuideManager::handleEvent(cocos2d::EventCustom* event)
{
    void* userdata = event->getUserData();
    if (userdata)
    {
        setParent((Node*)userdata);
    }
    
    if (event->getEventName() == GUIDE_EVENT_TOUCH_IN_RECT)
    {
        nextStep(getNextStepId());
    }
    else if (event->getEventName() == GUIDE_EVENT_BEGIN_GUIDE)
    {
        nextStep(0); // test here
    }
    else if (event->getEventName() == GUIDE_EVENT_CONTENUE)
    {
        setWait(false);
        nextStep(getNextStepId());
    }
    else
    {}
}
Example #19
0
TileSelectionWidget::TileSelectionWidget(QWidget *parent_)
{
    setParent(parent_);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setAutoFillBackground(true);
    QPalette pal(palette());
    pal.setColor(QPalette::Background, QColor(157, 150, 150));
    setPalette(pal);
    container = new QWidget(this);
    container->setStyleSheet("background:transparent;");
    tileSetPixmap.load("res/img/tileset.png");
    tileSetLabel = new QLabel(container);
    tileSetLabel->setPixmap(tileSetPixmap);
    tileSetLabel->resize(tileSetPixmap.size());
    cursor = new QLabel(container);
    cursor->setPixmap(QPixmap("res/img/GUI/tileSelector.png"));
    container->resize(tileSetLabel->size() + QSize(80, 80));
    tileSetLabel->move(40, 40);
    cursor->move(40, 40);
    setWidget(container);
    select(0, 0);
    leftButtonDown = false;
}
Example #20
0
sp<Control> ControlGenerator::createAgentAssignmentControl(GameState &state, sp<Agent> agent)
{
	const int controlLength = 200, controlHeight = 24, iconLenght = 36;

	if (!singleton.initialised)
	{
		singleton.init(state);
	}

	auto control = mksp<Control>();
	control->setData(agent);
	control->Size = control->SelectionSize = {controlLength, controlHeight};
	control->Name = "AGENT_PORTRAIT";

	auto icon = createAgentIcon(state, agent, UnitSelectionState::Unselected, false);
	icon->Size = {iconLenght, controlHeight};
	icon->setParent(control);

	auto nameLabel = control->createChild<Label>(agent->name, singleton.labelFont);
	nameLabel->Size = {controlLength - iconLenght, singleton.labelFont->getFontHeight()};
	nameLabel->Location = {iconLenght, (control->Size.y - nameLabel->Size.y) / 2};

	return control;
}
Example #21
0
SplitterCollapser::SplitterCollapser(QSplitter *splitter, QWidget *widget)
    : QToolButton(),
      d(new SplitterCollapserPrivate)
{
    d->q = this;

    // We do not want our collapser to be added as a regular widget in the
    // splitter!
    setAttribute(Qt::WA_NoChildEventsForParent);

    d->mOpacityTimeLine = new QTimeLine(TIMELINE_DURATION, this);
    d->mOpacityTimeLine->setFrameRange(int(MINIMUM_OPACITY * 1000), 1000);
    connect(d->mOpacityTimeLine, SIGNAL(valueChanged(qreal)), SLOT(update()));

    d->mWidget = widget;
    d->mWidget->installEventFilter(this);

    qApp->installEventFilter(this);

    d->mSplitter = splitter;
    setParent(d->mSplitter);

    if (splitter->indexOf(widget) < splitter->count() / 2) {
        d->mDirection = LTR;
    } else {
        d->mDirection = RTL;
    }
    if (splitter->orientation() == Qt::Vertical) {
        // FIXME: Ugly!
        d->mDirection = static_cast<Direction>(int(d->mDirection) + int(TTB));
    }

    connect(this, SIGNAL(clicked()), SLOT(slotClicked()));

    show();
}
mxListBox::mxListBox (mxWindow *parent, int x, int y, int w, int h, int id, int style)
    : mxWidget (parent, x, y, w, h)
{
    if (!parent)
        return;

    DWORD dwStyle = WS_VISIBLE | WS_CHILD | LBS_NOTIFY | WS_VSCROLL | WS_HSCROLL;
    HWND hwndParent = (HWND) ((mxWidget *) parent)->getHandle ();

    if (style == MultiSelection)
        dwStyle |= LBS_MULTIPLESEL | LBS_EXTENDEDSEL;

    void *handle = (void *) CreateWindowEx (WS_EX_CLIENTEDGE, "LISTBOX", "", WS_VISIBLE | WS_CHILD | LBS_NOTIFY | WS_VSCROLL,
                                            x, y, w, h, hwndParent,
                                            (HMENU) id, (HINSTANCE) GetModuleHandle (NULL), NULL);

    SendMessage ((HWND) handle, WM_SETFONT, (WPARAM) (HFONT) GetStockObject (ANSI_VAR_FONT), MAKELPARAM (TRUE, 0));
    SetWindowLong ((HWND) handle, GWL_USERDATA, (LONG) this);

    setHandle (handle);
    setType (MX_LISTBOX);
    setParent (parent);
    setId (id);
}
Example #23
0
/*! \internal
 */
QLayout::QLayout(QLayoutPrivate &dd, QLayout *lay, QWidget *w)
    : QObject(dd, lay ? static_cast<QObject*>(lay) : static_cast<QObject*>(w))
{
    Q_D(QLayout);
    if (lay) {
        lay->addItem(this);
    } else if (w) {
        if (w->layout()) {
            qWarning("QLayout: Attempting to add QLayout \"%s\" to %s \"%s\", which"
                     " already has a layout",
                     qPrintable(QObject::objectName()), w->metaObject()->className(),
                     w->objectName().toLocal8Bit().data());
            setParent(0);
        } else {
            d->topLevel = true;
            w->d_func()->layout = this;
            QT_TRY {
                invalidate();
            } QT_CATCH(...) {
                w->d_func()->layout = 0;
                QT_RETHROW;
            }
        }
    }
mxWindow::mxWindow (mxWindow *parent, int x, int y, int w, int h, const char *label, int style)
: mxWidget (parent, x, y, w, h, label)
{
	d_this = new mxWindow_i;
	d_this->d_uTimer = 0;

	DWORD dwStyle = 0;
	if (style == Normal)
		dwStyle = WS_OVERLAPPEDWINDOW;
	else if (style == Popup)
		dwStyle = WS_POPUP;
	else if (style == Dialog || style == ModalDialog)
		dwStyle = WS_CAPTION | WS_SYSMENU;

	void *parentHandle = 0;
	if (parent)
	{
		parentHandle = parent->getHandle ();
		dwStyle = WS_CHILD | WS_VISIBLE;
	}

	void *handle = (void *) CreateWindowEx (0, "mx_class", label, dwStyle,
					x, y, w, h, (HWND) parentHandle,
					(HMENU) NULL, (HINSTANCE) GetModuleHandle (NULL), NULL);

	SetWindowLong ((HWND) handle, GWL_USERDATA, reinterpret_cast< LONG >( this ) );

	setHandle (handle);
	setType (MX_WINDOW);
	setParent (parent);
	//setLabel (label);
	//setBounds (x, y, w, h);

	if (!parent && !g_mainWindow)
		g_mainWindow = this;
}
Example #25
0
Schema::Schema(MainWin *mainwin, Database *database, QString schema_name, int schema_index, uint number_of_schemas)
{
    this->mainwin = mainwin;
    this->schema_index = schema_index;
    this->number_of_schemas = number_of_schemas;
    qreal dtheta = -2*M_PI*schema_index/number_of_schemas - M_PI_2;
    setParent(database);
    setParentItem(database);
    /*
    if(mainwin->isColumnView())
        setPos((a_radius/2)*(schema_index) + a_radius/2/2 -(parent_database->getSchemaCount()*a_radius/2/2), b_radius/2);
    else
        setPos(a_radius*sin(dtheta), b_radius*cos(dtheta));
    */
    setName(schema_name);
    setStatus(false);
    setSchemaCollapsed(true);

    setFlag(ItemIsSelectable);
    //setFlag(ItemSendsGeometryChanges);

    setToolTip(this->getName());
    setCacheMode(DeviceCoordinateCache);
    setZValue(-1);
    /*if(mainwin->isColumnView()) {
        populateSchemaTablesColumnwise();
        populateSchemaFunctionsColumnwise();
    }
    else {
        populateSchemaTables();
        populateSchemaFunctions();
    }*/
    populateSchemaTables();
    populateSchemaViews();
    populateSchemaFunctions();
}
Example #26
0
SummaryInspectorWidget::SummaryInspectorWidget(const IdentifiedObjectAbstract* obj,
        std::set<const ConstraintModel*> constraints,
        std::set<const TimeNodeModel*> timenodes,
        std::set<const EventModel*> events,
        std::set<const StateModel*> states,
        const iscore::DocumentContext& context,
        QWidget* parent):
    InspectorWidgetBase {*obj, context, parent}
{
    setObjectName("SummaryInspectorWidget");
    setParent(parent);

    auto cSection = new Inspector::InspectorSectionWidget{tr("Constraints"), false, this};
    m_properties.push_back(cSection);

    for(auto c : constraints)
    {
        cSection->addContent(new ConstraintSummaryWidget{*c, context, this});
    }

    auto tnSection = new Inspector::InspectorSectionWidget{tr("TimeNodes"), false, this};
    m_properties.push_back(tnSection);
    for(auto t : timenodes)
    {
        tnSection->addContent(new TimeNodeSummaryWidget{*t, context, this});
    }

    auto evSection = new Inspector::InspectorSectionWidget{tr("Events"), false, this};
    m_properties.push_back(evSection);
    for(auto ev : events)
    {
        evSection->addContent(new EventSummaryWidget{*ev, context, this});
    }

    updateAreaLayout(m_properties);
}
Example #27
0
ProjectClip::ProjectClip(const QString &id, QIcon thumb, ClipController *controller, ProjectFolder* parent) :
    AbstractProjectItem(AbstractProjectItem::ClipItem, id, parent)
    , m_abortAudioThumb(false)
    , m_controller(controller)
    , m_thumbsProducer(NULL)
{
    m_clipStatus = StatusReady;
    m_name = m_controller->clipName();
    m_duration = m_controller->getStringDuration();
    m_date = m_controller->date;
    m_description = m_controller->description();
    m_type = m_controller->clipType();
    if (m_type == Audio) {
        m_thumbnail = QIcon::fromTheme(QStringLiteral("audio-x-generic"));
    } else {
        m_thumbnail = thumb;
    }
    // Make sure we have a hash for this clip
    hash();
    setParent(parent);
    connect(this, &ProjectClip::updateJobStatus, this, &ProjectClip::setJobStatus);
    bin()->loadSubClips(id, m_controller->getPropertiesFromPrefix(QStringLiteral("kdenlive:clipzone.")));
    createAudioThumbs();
}
PropertyListGraphicsItem::PropertyListGraphicsItem(PropertyOwnerGraphicsItem* parent)
    : NWEBaseGraphicsItem(parent->getNetworkEditor())
    , parent_(parent)
    , currentHeaderMode_(NO_HEADER)
    , currentPropertyMode_(SHOW_LINKED_PROPERTIES)
    , currentPropertyModifier_(HIDE_NO_PROPERTIES)
    , currentLinkArrowMode_(SHOW_NO_ARROWS)
    , friendList_(0)
    , isVisibleInEditor_(false)
    , currentHeight_(0.f)
    , currentWidth_(0.f)
{
    tgtAssert(parent != 0, "passed null pointer");
    setZValue(ZValuesPropertyListGraphicsItem);
    setParent(parent);

    parent->getNetworkEditor()->scene()->addItem(this);

    parentLabel_ = new QGraphicsTextItem(this);
    parentLabel_->setParentItem(this);
    currentWidth_ = getParentLabel()->boundingRect().width();
    paint(0,0,0);
    createChildItems();
}
Example #29
0
Tax::Tax(double bT, double sT, double brT, QWidget *parent)
{
    setParent(parent);

    lSell	= new QLabel (tr("sell tax"), this);
    lBuy	= new QLabel (tr("buy tax"), this);
    lBroker	= new QLabel (tr("broker fee"), this);

    sbSell	= new QDoubleSpinBox (this);
    sbBuy	= new QDoubleSpinBox (this);
    sbBroker= new QDoubleSpinBox (this);

    sbSell->setSuffix("%");
    sbSell->setValue(sT);
    sbBuy->setSuffix("%");
    sbBuy->setValue(bT);
    sbBroker->setSuffix("%");
    sbBroker->setValue(brT);;

    layout   = new QVBoxLayout(this);

    layout->addWidget(lBuy);
    layout->addWidget(sbBuy);

    layout->addWidget(lSell);
    layout->addWidget(sbSell);

    layout->addWidget(lBroker);
    layout->addWidget(sbBroker);

    adjustSize();

    connect(sbSell,	  SIGNAL(valueChanged(double)),	this, SLOT(onSellChange(double)));
    connect(sbBuy,	  SIGNAL(valueChanged(double)), this, SLOT(onBuyChange(double)));
    connect(sbBroker, SIGNAL(valueChanged(double)), this, SLOT(onBrokerChange(double)));
}
Example #30
0
//----------------------------------------
ofEasyFingerCam::ofEasyFingerCam()
{
    selectedPlane = new AxisPlane();
    drag = 0.1f;
    zoomSpeed = 2.0f;
    bMouseInputEnabled = false;
    bFingerInputEnabled = false;
    mousePosViewPrev.set(0, 0);
    lastFrame = 0;
    bDistanceSet = false;
    lastDistance = 0;
    distanceScaleVelocity = 0;
    fingers = std::vector<Finger *>();
    target.setPosition(0, 0, 0);
    zooming = true;
    reset();
    setParent(target);
    prevDistance = 0;
    ofVec3f center = ofVec3f(0.0f, 0.0f, 0.0f);
    ofVec3f normal = ofVec3f(0.0f, 1.0f, 0.0f).normalize();
    ofVec2f scale = ofVec2f(1.0f, 1.0f);
    enableMouseInput();
    enableFingerInput();
}