Esempio n. 1
0
QOptionsDialog::QOptionsDialog(const std::string &id, const std::string &caption) :
    FullScreenDialog(caption.c_str()),
    ZLOptionsDialog(id),
    tabno(0)
{
	cap = caption;
	myTabWidget = new MyTabWidget(this);
	setContentWidget(myTabWidget);


	ZSoftKey *softKey = (ZSoftKey *)getCSTWidget(true);

	QRect rect;
	menu = new ZOptionsMenu(rect, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	softKey->setOptMenu(ZSoftKey::LEFT, menu);
	softKey->setText(ZSoftKey::LEFT, "Menu", (ZSoftKey::TEXT_PRIORITY)0);

	QRect rect2;
	ZOptionsMenu * menu2 = new ZOptionsMenu(rect2, softKey, NULL, 0, (ZSkinService::WidgetClsID)4);
	menu2->insertItem(QString("Accept"), NULL, NULL, true, 0, 0);
	menu2->insertItem(QString("Cancel"), NULL, NULL, true, 1, 1 );
	softKey->setOptMenu(ZSoftKey::RIGHT, menu2);
	softKey->setText(ZSoftKey::RIGHT, "Done", (ZSoftKey::TEXT_PRIORITY)0);

	connect(menu, SIGNAL(activated(int)), this, SLOT(selectTab(int)));

	menu2->connectItem(0, this, SLOT(accept()));
	menu2->connectItem(1, this, SLOT(reject()));
}
Esempio n. 2
0
ZLQtOptionsDialog::ZLQtOptionsDialog(const ZLResource &resource, shared_ptr<ZLRunnable> applyAction) : ZLFullScreenDialog(std::string("X3")), ZLOptionsDialog(resource, applyAction) {
	QWidget *title = getTitleBarWidget();
	if (title->isA("QLabel")) {
		((QLabel *)title)->setText(::qtString(ZLOptionsDialog::caption()));
	}

	myTabWidget = new MyQTabWidget(this);
	setContentWidget(myTabWidget);

	UTIL_CST *cst = (UTIL_CST*)getCSTWidget();
	myMenu = new QPopupMenu(cst);
	QFont f(qApp->font());
	f.setPointSize(15);
	myMenu->setFont(f);
	connect(myMenu, SIGNAL(activated(int)), this, SLOT(selectTab(int)));
	cst->getLeftBtn()->setEnabled(true);
	cst->getLeftBtn()->setPopup(myMenu);
}