BOOL AP_Win32Dialog_Columns::_onDeltaPos(NM_UPDOWN * pnmud)
{
	wchar_t buf[BUFSIZE];
	UT_Win32LocaleString str;
    
	switch( pnmud->hdr.idFrom )
	{
	case AP_RID_DIALOG_COLUMN_SPIN_NUMCOLUMNS:
		if( pnmud->iDelta < 0 )
		{
			setColumns( getColumns() + 1 );
		}
		else
		{
			if( getColumns() > 1 )
			{
				setColumns( getColumns() - 1 );
			}
		}
		SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_NUMCOLUMNS, _itow(getColumns(),buf,10));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_ONE, (getColumns()==1));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_TWO, (getColumns()==2));
		checkButton(AP_RID_DIALOG_COLUMN_RADIO_THREE, (getColumns()==3));
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_SPACEAFTER:
		if( pnmud->iDelta < 0 )
		{
			incrementSpaceAfter( true );
		}
		else
		{
			incrementSpaceAfter( false );
		}
        str.fromUTF8 (getSpaceAfterString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_SPACEAFTER, str.c_str ());
		return 1;

	case AP_RID_DIALOG_COLUMN_SPIN_MAXSIZE:
		if( pnmud->iDelta < 0 )
		{
			incrementMaxHeight( true );
		}
		else
		{
			incrementMaxHeight( false );
		}
        str.fromUTF8 (getHeightString());
        SetDlgItemTextW(m_hDlg, AP_RID_DIALOG_COLUMN_EDIT_MAXSIZE, str.c_str ());
		return 1;

	default:
		return 0;
	}
}
Пример #2
0
void MWO_EqualsElementCopyResize::operator()(const MatrixAliasConstant& copy) const
{
		unsigned int i, j;

		//printf("MWO_EqualsElementCopyResize called\n");

		//printf("copy.getRows():%d\ngetRows():%d\ncopy.getColumns():%d\ncopy.getColumns():%d\n",copy.getRows(),getRows(),copy.getColumns(),copy.getColumns());

		if(copy.getRows() != getRows() || copy.getColumns() != getColumns()) {
			// Resize!!

			// Change values
			setRows(copy.getRows());
			setColumns(copy.getColumns());

			// Delete old memory
			delete[] getDataPointer();

			// Allocate new memory
			setDataPointer(new double[getRows()*getColumns()]);
		}


		for (i = 0; i < getRows(); i++) {
			for (j = 0; j < getColumns(); j++) {
				element(i, j) = copy.element(i, j);
			}
		}

}
Пример #3
0
void TableData::insertColumn(int beforecol) {
  int R = rows();
  int C = columns();
  if (beforecol<0)
    beforecol = 0;
  if (beforecol>C)
    beforecol = C;

  qDebug() << "old text[" << text() << "]";

  QMap<RCPair, QString> oldcont = allContents(this);
  QMap<RCPair, QString> newcont;
  for (int r=0; r<R; r++)
    for (int c=0; c<C; c++)
      newcont[RCPair(r, c>=beforecol ? c+1 : c)] = oldcont[RCPair(r, c)];
  
  QMap<MarkupData *, MDPos> allmarks = allMarkupPos(this);

  for (auto pos: allmarks) 
    qDebug() << "old pos" << pos.toString();
  
  for (auto &pos: allmarks) 
    pos.insertColumn(beforecol);

  for (auto pos: allmarks) 
    qDebug() << "new pos" << pos.toString();
  
  qDebug() << "new text[" << buildContents(R, C+1, newcont) << "]";

  setColumns(C+1);
  setText(buildContents(R, C+1, newcont));
  for (auto *md: markups())
    updateMD(md, allmarks[md], this);
}
Пример #4
0
QSizeF QgsComposerLegend::paintAndDetermineSize( QPainter* painter )
{
  QSizeF size( 0, 0 );
  QStandardItem* rootItem = mLegendModel.invisibleRootItem();
  if ( !rootItem ) return size;

  if ( painter )
  {
    painter->save();
    drawBackground( painter );
    painter->setPen( QPen( QColor( 0, 0, 0 ) ) );
  }

  QList<Atom> atomList = createAtomList( rootItem, mSplitLayer );

  setColumns( atomList );

  double maxColumnWidth = 0;
  if ( mEqualColumnWidth )
  {
    foreach ( Atom atom, atomList )
    {
      maxColumnWidth = qMax( atom.size.width(), maxColumnWidth );
    }
  }
Пример #5
0
void SqMWO_EqualsElementCopyResize::operator()(const MatrixAliasConstant& copy) const
{
		unsigned int i, j;

		if(copy.isSquareMatrix() == 0)
		{
			error("SqMWO_EqualsElementCopyResize: Matrix to copy is not a square matrix\n");
			return;
		}


		if(copy.getColumns() != getColumns()) {
			// Resize!!

			// Change values
			setRows(copy.getRows());
			setColumns(copy.getColumns());

			// Delete old memory
			delete[] getDataPointer();

			// Allocate new memory
			setDataPointer(new double[getRows()*getColumns()]);
		}


		for (i = 0; i < getRows(); i++) {
			for (j = 0; j < getColumns(); j++) {
				element(i, j) = copy.element(i, j);
			}
		}
}
Пример #6
0
void TableData::deleteColumn(int col) {
  int R = rows();
  int C = columns();
  if (col<0 || col>=C || C==1)
    return;

  qDebug() << "old text[" << text() << "]";

  QMap<RCPair, QString> oldcont = allContents(this);
  QMap<RCPair, QString> newcont;
  for (int r=0; r<R; r++)
    for (int c=0; c<C-1; c++)
      newcont[RCPair(r, c)] = oldcont[RCPair(r, c>=col ? c+1 : c)];
  
  QMap<MarkupData *, MDPos> allmarks = allMarkupPos(this);

  for (auto pos: allmarks) 
    qDebug() << "old pos" << pos.toString();

  for (auto &pos: allmarks) 
    pos.deleteColumn(col);
  
  for (auto pos: allmarks) 
    qDebug() << "new pos" << pos.toString();

  qDebug() << "new text[" << buildContents(R, C-1, newcont) << "]";

  setColumns(C-1);
  setText(buildContents(R, C-1, newcont));
  for (auto *md: markups()) {
    updateMD(md, allmarks[md], this);
    if (md->start()>=md->end())
      deleteMarkup(md);
  }
}
Пример #7
0
void pHexEdit::constructor() {
  qtWidget = qtHexEdit = new QtHexEdit(*this);

  qtHexEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  qtHexEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  qtHexEdit->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);

  qtLayout = new QHBoxLayout;
  qtLayout->setAlignment(Qt::AlignRight);
  qtLayout->setMargin(0);
  qtLayout->setSpacing(0);
  qtHexEdit->setLayout(qtLayout);

  qtScroll = new QtHexEditScrollBar(*this);
  qtScroll->setSingleStep(1);
  qtLayout->addWidget(qtScroll);

  connect(qtScroll, SIGNAL(actionTriggered(int)), SLOT(onScroll()));

  pWidget::synchronizeState();
  setColumns(hexEdit.state.columns);
  setRows(hexEdit.state.rows);
  setLength(hexEdit.state.length);
  setOffset(hexEdit.state.offset);
  update();
}
Пример #8
0
/**
 * Constructs a new JTextArea with the specified number of rows
 * and columns, and the given model.  All of the constructors
 * feed through this constructor.
 *
 * @param doc the model to use, or create a default one if NULL
 * @param text the text to be displayed, NULL if none
 * @param rows the number of rows >= 0
 * @param columns the number of columns >= 0
 * @exception IllegalArgumentException if the rows or columns
 *  arguments are negative.
 */
/*public*/ JTextArea::JTextArea(Document* doc, QString text, int rows, int columns, QWidget *parent) : QTextEdit(parent){
    //super();
 common();
    this->rows = rows;
    setColumns(columns);
    if (doc == NULL) {
        doc = createDefaultModel();
    }
    else
     setDocument(doc);
    if (text != NULL) {
        setText(text);
//        select(0, 0);
    }
    if (rows < 0) {
        throw new IllegalArgumentException("rows: " + QString::number(rows));
    }
    if (columns < 0) {
        throw new IllegalArgumentException("columns: " + QString::number(columns));
    }
#if 0
    LookAndFeel.installProperty(this,
                                "focusTraversalKeysForward",
                                JComponent.
                                getManagingFocusForwardTraversalKeys());
    LookAndFeel.installProperty(this,
                                "focusTraversalKeysBackward",
                                JComponent.
                                getManagingFocusBackwardTraversalKeys());
#endif
}
Пример #9
0
void CameraLayout::setGrid( int rows, int columns ){
    //clear all widgets;
    setRows( rows );
    setColumns ( columns );
    reset();

}
Пример #10
0
int eListBoxBase::setProperty(const eString &prop, const eString &value)
{
	if (prop == "noPageMovement")
	{
		if (value == "off")
			flags &= ~flagNoPageMovement;
		else
			flags |= flagNoPageMovement;
	}
	else if (prop == "noUpDownMovement")
	{
		if (value == "off")
			flags &= ~flagNoUpDownMovement;
		else
			flags |= flagNoUpDownMovement;
	}
	else if (prop=="activeForegroundColor")
		colorActiveF=eSkin::getActive()->queryScheme(value);
	else if (prop=="activeBackgroundColor")
		colorActiveB=eSkin::getActive()->queryScheme(value);
	else if (prop=="showEntryHelp")
		setFlags( flagShowEntryHelp );
	else if (prop=="columns")
		setColumns( value?atoi(value.c_str()):1 );
	else
		return eDecoWidget::setProperty(prop, value);

	return 0;
}
StorageSystemReplicationQueue::StorageSystemReplicationQueue(const std::string & name_)
    : name(name_)
{
    setColumns(ColumnsDescription({
        /// Table properties.
        { "database",                std::make_shared<DataTypeString>() },
        { "table",                   std::make_shared<DataTypeString>() },
        { "replica_name",            std::make_shared<DataTypeString>() },
        /// Constant element properties.
        { "position",                std::make_shared<DataTypeUInt32>() },
        { "node_name",               std::make_shared<DataTypeString>() },
        { "type",                    std::make_shared<DataTypeString>() },
        { "create_time",             std::make_shared<DataTypeDateTime>() },
        { "required_quorum",         std::make_shared<DataTypeUInt32>() },
        { "source_replica",          std::make_shared<DataTypeString>() },
        { "new_part_name",           std::make_shared<DataTypeString>() },
        { "parts_to_merge",          std::make_shared<DataTypeArray>(std::make_shared<DataTypeString>()) },
        { "is_detach",               std::make_shared<DataTypeUInt8>() },
        /// Processing status of item.
        { "is_currently_executing",  std::make_shared<DataTypeUInt8>() },
        { "num_tries",               std::make_shared<DataTypeUInt32>() },
        { "last_exception",          std::make_shared<DataTypeString>() },
        { "last_attempt_time",       std::make_shared<DataTypeDateTime>() },
        { "num_postponed",           std::make_shared<DataTypeUInt32>() },
        { "postpone_reason",         std::make_shared<DataTypeString>() },
        { "last_postpone_time",      std::make_shared<DataTypeDateTime>() },
    }));
}
Пример #12
0
void RVWO_EqualsElementCopyResize::operator()(const MatrixAliasConstant& copy) const
{
		unsigned int i;

		if(copy.isRowVector() == 0)
		{
			error("RVWO_EqualsElementCopyResize: Matrix to copy is not a row vector\n");
			return;
		}


		if(copy.getColumns() != getColumns()) {
			// Resize!!

			// Change values
			setColumns(copy.getColumns());

			// Delete old memory
			delete[] getDataPointer();

			// Allocate new memory
			setDataPointer(new double[getColumns()]);
		}


		for (i = 0; i < getColumns(); i++) {
			element(0, i) = copy.element(0, i);
		}

}
Пример #13
0
Heightmap::Heightmap(int columns, int rows) {
    setColumns(columns);
    setRows(rows);
    
    vector<vec3> vertices;
    vector<unsigned int> indices;
    vector<vec2> texcoords;
    for(int z = 0; z <= rows; z++) {
        for(int x = 0; x <= columns; x++) {
            vertices.push_back(vec3(x*(1.0f/columns), 0, z*(1.0f/rows)));
            texcoords.push_back(vec2(x*0.5f, z*0.5f));
        }
    }
    
    for(int row = 0; row < rows; row++) {
        for(int column = 0; column < columns; column++) {
            indices.push_back(column + row * (columns + 1));
            indices.push_back(column + (row + 1) * (columns + 1));
            indices.push_back(column + 1 + row * (columns + 1));
            indices.push_back(column + 1 + row * (columns + 1));
            indices.push_back(column + (row + 1) * (columns + 1));
            indices.push_back(column + 1 + (row + 1) * (columns + 1));
        }
    }
    
    setVertices(vertices);
    setIndices(indices);
    setTexcoords(texcoords);
    material.setSpecularReflectance(0.05f);
    material.setShininess(1.0f);
    material.setAmbientReflectance(0.5f);
    init();
    calculateNormals();
}
StorageSystemBuildOptions::StorageSystemBuildOptions(const std::string & name_)
    : name(name_)
{
    setColumns(ColumnsDescription({
        { "name", std::make_shared<DataTypeString>() },
        { "value", std::make_shared<DataTypeString>() },
    }));
}
Пример #15
0
/**
 * Constructs a new empty TextArea with the specified number of
 * rows and columns.  A default model is created, and the initial
 * string is NULL.
 *
 * @param rows the number of rows >= 0
 * @param columns the number of columns >= 0
 * @exception IllegalArgumentException if the rows or columns
 *  arguments are negative.
 */
/*public*/ JTextArea::JTextArea(int rows, int columns, QWidget * parent)
 : QTextEdit(parent)
{
    //this(NULL, NULL, rows, columns);
 common();
 this->rows = rows;
 setColumns(columns);
}
Пример #16
0
void StorageMerge::alter(const AlterCommands & params, const String & database_name, const String & table_name, const Context & context)
{
    auto lock = lockStructureForAlter();

    ColumnsDescription new_columns = getColumns();
    params.apply(new_columns);
    context.getDatabase(database_name)->alterTable(context, table_name, new_columns, {});
    setColumns(new_columns);
}
Пример #17
0
/**
 * Constructs a new TextArea with the specified text and number
 * of rows and columns.  A default model is created.
 *
 * @param text the text to be displayed, or NULL
 * @param rows the number of rows >= 0
 * @param columns the number of columns >= 0
 * @exception IllegalArgumentException if the rows or columns
 *  arguments are negative.
 */
/*public*/ JTextArea::JTextArea(QString text, int rows, int columns, QWidget *parent)
: QTextEdit(parent)
{
 // this(NULL, text, rows, columns);
 common();
 this->rows = rows;
 setColumns(columns);
 setText(text);
}
Пример #18
0
AddresseeEdit::AddresseeEdit(const WString& label, WContainerWidget *parent,
			     WContainerWidget *labelParent)
  : WTextArea(parent)
{
  label_ = new Label(label, labelParent);

  setRows(3); setColumns(55);
  resize(WLength(99, WLength::Percentage), WLength::Auto);

  setInline(false); // for IE to position the suggestions well
}
Пример #19
0
void MWO_Reshape::operator()(const unsigned int rows, const unsigned int columns) const
{
	if((rows * columns) != (getRows() * getColumns())) {
		error("MWO_Reshape : Dimensions are not consistent\n");
		return;
	}

	// Change values
	setRows(rows);
	setColumns(columns);
}
Пример #20
0
void JabberAdd::addAttrs()
{
    if (m_fields.size() <= m_nFields)
        return;
    QStringList attrs;
    for (; m_nFields < m_fields.size(); m_nFields++){
        attrs.append(m_fields[m_nFields].c_str());
        attrs.append(m_labels[m_nFields]);
    }
    emit setColumns(attrs, 0, this);
}
Пример #21
0
void MWO_Resize::operator()(const unsigned int rows, const unsigned int columns) const
{
	// Change values
	setRows(rows);
	setColumns(columns);

	// Delete old memory
	delete[] getDataPointer();

	// Allocate new memory
	setDataPointer(new double[rows*columns]);
}
Пример #22
0
void SqMWO_Resize::operator()(const unsigned int size) const
{
	// Change values
	setRows(size);
	setColumns(size);

	// Delete old memory
	delete[] getDataPointer();

	// Allocate new memory
	setDataPointer(new double[size*size]);
}
Пример #23
0
StorageSystemGraphite::StorageSystemGraphite(const std::string & name_)
    : name(name_)
{
    setColumns(ColumnsDescription({
        {"config_name", std::make_shared<DataTypeString>()},
        {"regexp",      std::make_shared<DataTypeString>()},
        {"function",    std::make_shared<DataTypeString>()},
        {"age",         std::make_shared<DataTypeUInt64>()},
        {"precision",   std::make_shared<DataTypeUInt64>()},
        {"priority",    std::make_shared<DataTypeUInt16>()},
        {"is_default",  std::make_shared<DataTypeUInt8>()},
    }));
}
Пример #24
0
void ExtendedTableData::init(vector<ColRef> colRefs) {
    assert(colRefs.size() > 0);
    this->colRefs = colRefs;
    setRowCount(colRefs[0].getTable()->getRowCount());
    vector<ColDef> colDefs;
    for (auto& colRef:colRefs) {
        if (colRef.getTable()->getRowCount() != getRowCount()) {
            throw runtime_error("tables need same row count to be extendable");
        }
        colDefs.push_back(colRef.getTable()->getColumns()[colRef.getColIdx()]);
    }
    setColumns(colDefs);
}
Пример #25
0
DatatypeCombobox::DatatypeCombobox(int nRow, int nColumn, QObject *oParent)
{
	if(nRow != -1)
	{
		std::vector<int> l;
		l.append(nRow);
		setRows(l);
	}

	if(nColumn != -1)
	{
		std::vector<int> l;
		l.append(nColumn);
		setColumns(l);
	}
}
Пример #26
0
PageItem_NoteFrame::PageItem_NoteFrame(NotesStyle *nStyle, ScribusDoc *doc, double x, double y, double w, double h, double w2, QString fill, QString outline)
    : PageItem_TextFrame(doc, x, y, w, h, w2, fill, outline)
{
	m_nstyle = nStyle;
	m_masterFrame = NULL;
	itemText.clear();

	AnName = generateUniqueCopyName(nStyle->isEndNotes() ? tr("Endnote frame ") + m_nstyle->name() : tr("Footnote frame ") + m_nstyle->name(), false);
	AutoName = false; //endnotes frame will saved with name
	setUName(AnName);
	
	//set default style for note frame
	ParagraphStyle newStyle;
	if (nStyle->notesParStyle().isEmpty() || (nStyle->notesParStyle() == tr("No Style")))
	{
		if (nStyle->isEndNotes())
			//set default doc style
			newStyle.setParent(m_Doc->paragraphStyles()[0].name());
		else
		{
			newStyle.setParent(m_masterFrame->itemText.defaultStyle().parent());
			newStyle.applyStyle(m_masterFrame->currentStyle());
		}
	}
	else
		newStyle.setParent(nStyle->notesParStyle());
	itemText.blockSignals(true);
	itemText.setDefaultStyle(newStyle);
	itemText.blockSignals(false);

	textFlowModeVal = TextFlowUsesFrameShape;
	setColumns(1);

	if (m_nstyle->isAutoNotesHeight())
		m_SizeVLocked = true;
	else
		m_SizeVLocked = false;
	if (m_nstyle->isAutoNotesWidth())
		m_SizeHLocked = true;
	else
		m_SizeHLocked = false;
	if (m_nstyle->isAutoNotesHeight() && m_nstyle->isAutoNotesWidth())
		m_SizeLocked = true;
	else
		m_SizeLocked = false;
	deleteIt = false;
}
Пример #27
0
QSizeF QgsLegendRenderer::paintAndDetermineSize( QPainter* painter )
{
  QSizeF size( 0, 0 );
  QgsLayerTreeGroup* rootGroup = mLegendModel->rootGroup();
  if ( !rootGroup ) return size;

  QList<Atom> atomList = createAtomList( rootGroup, mSettings.splitLayer() );

  setColumns( atomList );

  qreal maxColumnWidth = 0;
  if ( mSettings.equalColumnWidth() )
  {
    Q_FOREACH ( const Atom& atom, atomList )
    {
      maxColumnWidth = qMax( atom.size.width(), maxColumnWidth );
    }
Пример #28
0
constraint::constraint(sudoku& puzzle) : n(puzzle.getN()), p(puzzle.getP()), q(puzzle.getQ())
{
	rows_init(puzzle);
	setColumns();
	setBlocks();
	domain_init();
	if(tokenReader::lcv) {
		lcv_init();
	}
	if(tokenReader::dh) {
		dh_init();
	}
	if(tokenReader::mrv) {
		mrv_init();	
	}
	solution_init();
}
Пример #29
0
KWDocumentColumns::KWDocumentColumns(QWidget *parent, const KoColumns &columns)
        : QWidget(parent)
{
    widget.setupUi(this);

    setColumns(columns);
    setUnit(KoUnit(KoUnit::Millimeter));

    QGridLayout *layout = new QGridLayout(widget.previewPane);
    layout->setMargin(0);
    widget.previewPane->setLayout(layout);
    m_preview = new KoPagePreviewWidget(this);
    layout->addWidget(m_preview);
    m_preview->setColumns(columns);

    connect(widget.columns, SIGNAL(valueChanged(int)), this, SLOT(optionsChanged()));
    connect(widget.spacing, SIGNAL(valueChangedPt(qreal)), this, SLOT(optionsChanged()));
    connect(this, SIGNAL(columnsChanged(const KoColumns&)), m_preview, SLOT(setColumns(const KoColumns&)));
}
DynamicAlbumList::DynamicAlbumList(MWidget *parent) : DynamicMList(parent,  MContentItem::IconAndTwoTextLabels, 1), albumListDeleteConfirm(NULL)
{
    connect(this, SIGNAL(panningStopped()), this, SLOT(doTasklet()));
    connect(AppWindow::instance(), SIGNAL(orientationChanged(M::Orientation)), this, SLOT(onOrientationChanged(M::Orientation)));
    MPListModel *albumListModel = new MPListModel(this, "", MPListModel::Album);
    albumTasklet = new PhotosTasklet(parent);
    setItemModel(albumListModel);
    setTasklet(albumTasklet);
    MContentItemCreator *albumThumbnailCreator = dynamic_cast<MContentItemCreator *>(cellCreator());
    albumThumbnailCreator->setCellProcessor(new AlbumThumbnailsCellProcessor(this));
    onOrientationChanged(AppWindow::instance()->orientation());

    setColumns(2);
    setObjectName("albumList");
    connect(this, SIGNAL(itemClicked(const QModelIndex&)), this, SLOT(onClick(const QModelIndex&)));
    QPixmapCache::setCacheLimit (4096);

    QTimer::singleShot(1500, this, SLOT(doTasklet()));
}