Beispiel #1
0
	View::View() : BaseLayout("View.layout")
	{
		assignWidget(mImageView, "view_Image");
		assignWidget(mMultiList, "multi_List");
		assignWidget(mEditResourceName, "edit_ResourceName");
		assignWidget(mEditResourceID, "edit_ResourceID");
		assignWidget(mEditFileName, "edit_FileName");

		//const int column_width = 300;
		mMultiList->addColumn("name", 100/*column_width*/);
		mMultiList->addColumn("id", 100/*mMultiList->getClientCoord().width - column_width*/);
		mMultiList->eventListChangePosition = MyGUI::newDelegate(this, &View::notifyListChangePosition);

		initialiseImages();

		m_CurrentTime = 0;
		MyGUI::Gui::getInstance().eventFrameStart += MyGUI::newDelegate(this, &View::notifyFrameStart);

		updateColumn();

		MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>(false);
		if (window != nullptr)
		{
			window->eventWindowChangeCoord = MyGUI::newDelegate(this, &View::notifyWindowChangeCoord);
		}
	}
void setColValuesDialog::setTable(Table* w)
{
table=w;
QStringList colNames=w->colNames();
int cols = w->tableCols();
for (int i=0; i<cols; i++)
	boxColumn->insertItem("col(\""+colNames[i]+"\")",i); 

int s = w->table()->currentSelection();
if (s >= 0)
	{
	QTableSelection sel = w->table()->selection(s);
	w->setSelectedCol(sel.leftCol());

	start->setValue(sel.topRow() + 1);
	end->setValue(sel.bottomRow() + 1);
	}
else
	{
	start->setValue(1);
	end->setValue(w->tableRows());
	}

updateColumn(w->selectedColumn());
commandes->setContext(w);
}
Beispiel #3
0
void PlaylistItem::reactToChanges( const QValueList<int> &columns )
{
    MetaBundle::reactToChanges(columns);
    bool totals = false, ref = false, length = false, url = false;
    for( int i = 0, n = columns.count(); i < n; ++i )
      {
        if( columns[i] == Mood )
          moodbar().reset();
	if ( !length && columns[i] == Length ) {
	    length = true;
	    incrementLengths();
	    listView()->countChanged();
	}
        switch( columns[i] )
        {
            case Artist: case Album: ref = true; //note, no breaks
            case Track: case Rating: case Score: case LastPlayed:
                totals = true; break;
            case Filename: case Directory: url = true;
        }
        updateColumn( columns[i] );
      }
    if ( url )
        Playlist::instance()->m_urlIndex.add(this);
    if( ref )
        refAlbum();
    if( totals )
        incrementTotals();
}
Beispiel #4
0
void RKMatrixInput::setColumnValue (int column, const QString& value) {
	RK_TRACE (PLUGIN);

	if (!expandStorageForColumn (column)) return;
	columns[column].storage = value.split ('\t', QString::KeepEmptyParts);
	updateColumn (column);
	model->dataChanged (model->index (0, column), model->index (row_count->intValue () + trailing_rows, column));
}
void FolderTreeWidgetItem::setIsCloseToQuota( bool closeToQuota )
{
  if ( ( mIsCloseToQuota == 1 ) == closeToQuota )
    return;
  mIsCloseToQuota = closeToQuota ? 1 : 0;

  FolderTreeWidget * tree = dynamic_cast< FolderTreeWidget * >( treeWidget() );
  if ( tree && tree->labelColumnVisible() )
    updateColumn( tree->labelColumnIndex() );
}
void FolderTreeWidgetItem::updateColumn( int columnIndex )
{
  FolderTreeWidget * tree = dynamic_cast< FolderTreeWidget * >( treeWidget() );
  if ( tree ) {
    tree->updateColumnForItem( this, columnIndex );
    if ( columnIndex!=tree->labelColumnIndex() && !tree->unreadColumnVisible() && tree->labelColumnVisible() ) {
      updateColumn( tree->labelColumnIndex() );
    }
  }
}
Beispiel #7
0
void RKMatrixInput::setCellValue (int row, int column, const QString& value) {
	RK_TRACE (PLUGIN);

	if ((!expandStorageForColumn (column)) || (row < 0) || (!allow_user_resize_rows && (row >= row_count->intValue ()))) {
		RK_ASSERT (false);
		return;
	}

	Column &col = columns[column];
	if (col.storage.value (row) == value) return;

	while (row >= col.storage.size ()) {
		col.storage.append (QString ());
	}
	col.storage[row] = value;
	updateColumn (column);
	model->dataChanged (model->index (row, column), model->index (row, column));
}
void SetColValuesDialog::setTable(Table *w) {
  table = w;
  QStringList colNames = w->colNames();
  int cols = w->numCols();
  for (int i = 0; i < cols; i++)
    boxColumn->insertItem(i, "col(\"" + colNames[i] + "\")");

  if (w->hasSelection()) {
    w->setSelectedCol(w->leftSelectedColumn());

    start->setValue(w->topSelectedRow() + 1);
    end->setValue(w->bottomSelectedRow() + 1);
  } else {
    start->setValue(1);
    end->setValue(w->numRows());
  }

  updateColumn(w->selectedColumn());
}
void setColValuesDialog::nextColumn()
{
int sc = table->selectedColumn();
updateColumn(++sc);
}
void setColValuesDialog::prevColumn()
{
int sc = table->selectedColumn();
updateColumn(--sc);
}
Beispiel #11
0
TableDialog::TableDialog(Table *t, QWidget* parent, Qt::WFlags fl )
    : QDialog( parent, fl),
    d_table(t)
{
    setName( "TableDialog" );
    setWindowTitle( tr( "MantidPlot - Column options" ) );
    setSizeGripEnabled(true);

	QHBoxLayout *hboxa = new QHBoxLayout();
	hboxa->addWidget(new QLabel(tr( "Column Name:" )));
    colName = new QLineEdit();
    hboxa->addWidget(colName);

	enumerateAllBox = new QCheckBox(tr("Enumerate all to the right" ));

	buttonPrev = new QPushButton("&<<");
	buttonPrev->setAutoDefault(false);
	buttonPrev->setMaximumWidth(40);

	buttonNext = new QPushButton("&>>");
	buttonNext->setAutoDefault(false);
	buttonNext->setMaximumWidth(40);

	QHBoxLayout *hboxb = new QHBoxLayout();
    hboxb->addWidget(buttonPrev);
    hboxb->addWidget(buttonNext);
    hboxb->addStretch();

    QVBoxLayout *vbox1 = new QVBoxLayout();
    vbox1->addLayout(hboxa);
    vbox1->addWidget(enumerateAllBox);
    vbox1->addLayout(hboxb);

	buttonOk = new QPushButton(tr( "&OK" ));
    buttonOk->setDefault(true);

	buttonApply = new QPushButton(tr("&Apply"));
	buttonApply->setAutoDefault(false);

	buttonCancel = new QPushButton(tr( "&Cancel" ));
	buttonCancel->setAutoDefault(false);

	QVBoxLayout  *vbox2 = new QVBoxLayout();
	vbox2->setSpacing(5);
	vbox2->setMargin(5);
	vbox2->addWidget(buttonOk);
	vbox2->addWidget(buttonApply);
	vbox2->addWidget(buttonCancel);

    QHBoxLayout  *hbox1 = new QHBoxLayout();
	hbox1->setSpacing(5);
	hbox1->addLayout(vbox1);
	hbox1->addLayout(vbox2);

	QGridLayout *gl1 = new QGridLayout();
    gl1->addWidget(new QLabel( tr("Plot Designation:")), 0, 0);

   	columnsBox = new QComboBox();
	columnsBox->addItem(tr("None"));
	columnsBox->addItem(tr("X (abscissae)"));
	columnsBox->addItem(tr("Y (ordinates)"));
	columnsBox->addItem(tr("Z (height)"));
	columnsBox->addItem(tr("X Error"));
	columnsBox->addItem(tr("Y Error"));
	columnsBox->addItem(tr("Label"));
    gl1->addWidget(columnsBox, 0, 1);

    gl1->addWidget(new QLabel(tr("Display")), 1, 0);

   	displayBox = new QComboBox();
	displayBox->addItem(tr("Numeric"));
	displayBox->addItem(tr("Text"));
	displayBox->addItem(tr("Date"));
	displayBox->addItem(tr("Time"));
	displayBox->addItem(tr("Month"));
	displayBox->addItem(tr("Day of Week"));
    gl1->addWidget(displayBox, 1, 1);

    labelFormat = new QLabel(tr( "Format:" ));
 	gl1->addWidget(labelFormat, 2, 0);

    formatBox = new QComboBox();
    gl1->addWidget(formatBox, 2, 1);

	labelNumeric = new QLabel(tr( "Precision:" ));
	gl1->addWidget(labelNumeric, 3, 0);

    precisionBox = new QSpinBox();
    precisionBox->setRange(0, 13);
    gl1->addWidget(precisionBox, 3, 1);

    boxReadOnly = new QCheckBox(tr("&Read-only" ));
    gl1->addWidget(boxReadOnly, 4, 0);

	boxHideColumn = new QCheckBox(tr("&Hidden" ));
    gl1->addWidget(boxHideColumn, 4, 1);
	
	applyToRightCols = new QCheckBox(tr( "Apply to all columns to the right" ));

    QVBoxLayout *vbox3 = new QVBoxLayout();
    vbox3->addLayout(gl1);
    vbox3->addWidget(applyToRightCols);

    QGroupBox *gb = new QGroupBox(tr("Options"));
    gb->setLayout(vbox3);

    QHBoxLayout  *hbox2 = new QHBoxLayout();
    hbox2->addWidget(new QLabel(tr( "Column Width:" )));

	colWidth = new QSpinBox();
    colWidth->setRange(0, 1000);
	colWidth->setSingleStep(10);

	hbox2->addWidget(colWidth);

    applyToAllBox = new QCheckBox(tr( "Apply to all" ));
	hbox2->addWidget(applyToAllBox);

	comments = new QTextEdit();
	boxShowTableComments = new QCheckBox(tr("&Display Comments in Header"));
	boxShowTableComments->setChecked(d_table->commentsEnabled());

	QVBoxLayout* vbox4 = new QVBoxLayout();
    vbox4->addLayout(hbox1);
	vbox4->addWidget(gb);
	vbox4->addLayout(hbox2);
	vbox4->addWidget(new QLabel(tr( "Comment:" )));
	vbox4->addWidget(comments);
	vbox4->addWidget(boxShowTableComments);

    setLayout(vbox4);
    setFocusProxy (colName);

    updateColumn(d_table->selectedColumn());

   // signals and slots connections
	connect(colWidth, SIGNAL(valueChanged(int)), this, SLOT(setColumnWidth(int)));
	connect(buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
    connect(buttonCancel, SIGNAL( clicked() ), this, SLOT( close() ) );
	connect(columnsBox, SIGNAL(activated(int)), this, SLOT(setPlotDesignation(int)) );
	connect(displayBox, SIGNAL(activated(int)), this, SLOT(updateDisplay(int)));
	connect(buttonPrev, SIGNAL(clicked()), this, SLOT(prevColumn()));
	connect(buttonNext, SIGNAL(clicked()), this, SLOT(nextColumn()));
	connect(formatBox, SIGNAL(activated(int)), this, SLOT(enablePrecision(int)) );
	connect(precisionBox, SIGNAL(valueChanged(int)), this, SLOT(updatePrecision(int)));
	connect(boxShowTableComments, SIGNAL(toggled(bool)), d_table, SLOT(showComments(bool)));
}
Beispiel #12
0
void TableDialog::nextColumn()
{
int sc = d_table->selectedColumn();
apply();
updateColumn(++sc);
}
Beispiel #13
0
void TableDialog::prevColumn()
{
int sc = d_table->selectedColumn();
apply();
updateColumn(--sc);
}
  /** Updates one column (FTRAN) from regionSparse2
      Tries to do FT update
      number returned is negative if no room
      regionSparse starts as zero and is zero at end.
      Note - if regionSparse2 packed on input - will be packed on output
  */
  virtual inline int updateColumnFT ( CoinIndexedVector * regionSparse,
				      CoinIndexedVector * regionSparse2,
				      bool = false)
  { return updateColumn(regionSparse,regionSparse2);}
Beispiel #15
0
	void View::notifyWindowChangeCoord(MyGUI::Window* _sender)
	{
		updateColumn();
	}