Ejemplo n.º 1
0
FieldEditor::FieldEditor(QWidget* parent, Qt::WindowFlags fl)
    : QDialog(parent, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    connect(btnFont, SIGNAL(clicked()), this, SLOT(btnFont_clicked()));
    connect(rbVAlignBottom, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(tbColumn, SIGNAL(textChanged(const QString&)), this, SLOT(tbText_textChanged(const QString&)));
    connect(rbHAlignNone, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbHAlignLeft, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbHAlignCenter, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbHAlignRight, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbVAlignNone, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbVAlignTop, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(rbVAlignMiddle, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(_cbWordWrap, SIGNAL(clicked()), this, SLOT(rbAlign_changed()));
    connect(_cbRTotal, SIGNAL(toggled(bool)), _cbSubTotal, SLOT(setEnabled(bool)));
    connect(_rbStringFormat, SIGNAL(toggled(bool)), _leRTotalFormat, SLOT(setEnabled(bool)));
    connect(_rbStringFormat, SIGNAL(toggled(bool)), _lblRTotalExample, SLOT(setEnabled(bool)));
    connect(_rbBuiltinFormat, SIGNAL(toggled(bool)), _cbBuiltinFormat, SLOT(setEnabled(bool)));

    leXPos->setValidator(new QDoubleValidator(0.0,100.0,3,leXPos));
    leYPos->setValidator(new QDoubleValidator(0.0,100.0,3,leYPos));
    
    leWidth->setValidator(new QDoubleValidator(0.01,100.0,3,leWidth));
    leHeight->setValidator(new QDoubleValidator(0.01,100.0,3,leHeight));
    
    _cbBuiltinFormat->addItems(getNameList());
}
Ejemplo n.º 2
0
void GroundEyeshot::load(xs::Stream* pMapFile)
{
	m_pMapStream = pMapFile;
	pMapFile->seekToBegin();

	m_vTextures.clear();
	safeDeleteArray(m_pGroundTileTable);

    m_strDistanceTextureFileName.clear();

	xs::DataChunk chunk;
	xs::DataChunk::stChunk *pChunk = chunk.beginChunk(pMapFile);
	while(pChunk)
	{
		switch(pChunk->m_ui32Type)
		{
		case 'MTEX':
			{
				// 纹理列表
				getNameList(m_vTextures,(char*)pChunk->m_pData,pChunk->m_ui32DataSize);
			}
			break;
		case 'MTID':
			{
				// 对应的纹理ID
				m_pGroundTileTable = new DWORD[m_nTotalGridX * m_nTotalGridY];
				memcpy(m_pGroundTileTable,pChunk->m_pData,pChunk->m_ui32DataSize);
			}
			break;

        case 'MDIS':
            {
				// 远景图片
                ASSERT(pChunk->m_pData != NULL);
                BYTE cbFileNameLength = *((BYTE*)(pChunk->m_pData));
                char* szFileName = new char[cbFileNameLength + 1];
                memcpy(szFileName, (BYTE*)(pChunk->m_pData) + sizeof(BYTE), cbFileNameLength);
                szFileName[cbFileNameLength] = 0;
				normalize_path(szFileName,strlen(szFileName));
                SetDistanceTexture(szFileName);

                delete[] szFileName;
            }
            break;
		}
		pChunk = chunk.nextChunk(pMapFile);
	}

	for(int i = 0;i < m_nTotalGridX;i++)
	for(int j = 0;j < m_nTotalGridY;j++)
	{
		GroundTile *pTile = static_cast<GroundTile*>(getGroundTile(i,j));
		m_pMapStream->seek(m_pGroundTileTable[j * m_nTotalGridX + i]);
		pTile->loadBasicInfo(m_pMapStream,m_vTextures);
	}
}
Ejemplo n.º 3
0
void FieldEditor::init()
{
    leXPos->setValidator(new QDoubleValidator(0.0,100.0,3,leXPos));
    leYPos->setValidator(new QDoubleValidator(0.0,100.0,3,leYPos));
    
    leWidth->setValidator(new QDoubleValidator(0.01,100.0,3,leWidth));
    leHeight->setValidator(new QDoubleValidator(0.01,100.0,3,leHeight));
    
    _cbBuiltinFormat->insertStringList(getNameList());
}
void GTUtilsMSAEditorSequenceArea::checkSorted(HI::GUITestOpStatus &os, bool sortedState) {

    QStringList names = getNameList(os);

    QStringList sortedNames = names;
    qSort(sortedNames);

    bool sorted = (sortedNames == names);
    GT_CHECK(sorted == sortedState, "Sorted state differs from needed sorted state");
}
bool GTUtilsMSAEditorSequenceArea::collapsingMode(HI::GUITestOpStatus &os){
    QAbstractButton* collapce = GTAction::button(os, "Enable collapsing");
    bool nameLists = getVisibleNames(os)==getNameList(os);
    if(nameLists && !collapce->isChecked()){
        return false;
    }else if (!nameLists && collapce->isChecked()) {
        return true;
    }else{
        GT_CHECK_RESULT(false, "somithing wrong with collapsing mode", false);
    }
}
QString GTUtilsMSAEditorSequenceArea::getSequenceData(HI::GUITestOpStatus &os, const QString &sequenceName) {
    Q_UNUSED(os);
    MSAEditorSequenceArea *sequenceArea = getSequenceArea(os);
    GT_CHECK_RESULT(NULL != sequenceArea, "Sequence area is NULL", "");

    const QStringList names = getNameList(os);
    const int rowNumber = names.indexOf(sequenceName);
    GT_CHECK_RESULT(0 <= rowNumber, QString("Sequence '%1' not found").arg(sequenceName), "");

    GTUtilsMsaEditor::clickSequenceName(os, sequenceName);
    GTKeyboardUtils::copy(os);
    return GTClipboard::text(os);
}
bool GTUtilsMSAEditorSequenceArea::isCollapsed(HI::GUITestOpStatus &os, QString seqName){
    QStringList names = getNameList(os);
    QStringList visiable = getVisibleNames(os);
    GT_CHECK_RESULT(names.contains(seqName), "sequence " + seqName + " not found", false);
    return !visiable.contains(seqName);
}