bool iProgressDialog::CreateProgressDlg(const iStringT &caption, const iStringT &lbl_text, bool cancel_btn, bool visible)
{
	m_CanCanceled = cancel_btn;
	m_IsCanceled = false;
	
	iSize clsize(300,50);

	iSize wsize(clsize.w + GetSystemMetrics(SM_CXDLGFRAME)*2,clsize.h+GetSystemMetrics(SM_CYSMCAPTION)+GetSystemMetrics(SM_CYDLGFRAME)*2);

	if (m_CanCanceled) wsize.h += (25+5);

	if (!CreateBaseDialog(wsize, caption,DLGSTL_TOOLWINDOW | DLGSTL_TOPMOST, visible)) return false;

	HFONT fnt = (HFONT)GetStockObject(DEFAULT_GUI_FONT);

	RECT lblrect = { 5,5,295,25};
	if (!m_TextLabel.Create(m_hWnd,lblrect,lbl_text.CStr(),SS_CENTER | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)) return false;
	m_TextLabel.SetFont(fnt);

	RECT prgrect = { 5,25,295,45 };
	if (!m_ProgressCtrl.Create(m_hWnd,prgrect,0,WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)) return false;

	if (m_CanCanceled)
	{
		RECT btnrect = { 100,50,200,75 };
		if (!m_CancelBtn.Create(m_hWnd,btnrect, _T("Cancel"),WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,0,1024)) return false;
		m_CancelBtn.SetFont(fnt);
	}

	return true;
}
Esempio n. 2
0
bool QCSVWriter::write()
{
    QStringList row;

    row.reserve(size());
    for (QVector<QCSVCell>::iterator icells(begin());
         icells != end(); ++icells) {
        const QString &val(*icells);

        if (val.contains(_cellSeparator_) ||
                val.contains("\"") ||
                val.contains("\n") ||
                val.contains("\r")) {
            QString s(val);
            s.replace("\"", "\"\"");
            row.append(QString("\"%1\"").arg(s));
        }
        else
            row.append(val);
        (*icells).clear();
    }

    QString rowS(row.join(_cellSeparator_));
    if (hasRows) {
        rowS = QString("\r\n") + rowS;
    } else
        hasRows = true;

    const QByteArray array(rowS.toUtf8());
    qint64 wsize(file.write(array));

    return (wsize == array.size());
}
Esempio n. 3
0
void Zredisplay(void)
{
	zbuff_t *buff;

	wsize();
	redisplay();

	foreachbuff(buff)
		uncomment(buff);
}