示例#1
0
unsigned TaskbarPreviews::addTab(QWidget *tab, QWidget *owner, const QString &title, QWidget *before, PreviewProvider *pp)
{
	_tab t;
	t.internalTabWidget = new QWidget;
	t.pp            = pp;
	t.userTabWidget = tab;
	t.tabHandle     = (HWND)t.internalTabWidget->winId();
	t.userTabOwner  = owner;
	t.type          = (tab->window() == tab) ? ttWindow : ttWidget;
	if (!title.isNull())
		t.internalTabWidget->setWindowTitle(title);
	else
		t.internalTabWidget->setWindowTitle(t.userTabOwner->windowTitle());
	HWND afterHwnd = before ? reinterpret_cast<HWND>(m_tabs.internal(before)->winId()) : 0; // will return zero if after == 0 or there's no such tab, in that cases tab will be added to the end
	if (tab->window() == tab) {
		if(pp){
			ForceIconicRepresentation((HWND)t.internalTabWidget->winId());
		}
	} else // tab is not a window so previews must be created by library or user anyway
		ForceIconicRepresentation((HWND)t.internalTabWidget->winId());
	m_tabs.append(t);
	RegisterTab(t.tabHandle, (HWND)owner->winId());
	SetTabOrder(t.tabHandle, afterHwnd);
	return t.id;
}
示例#2
0
UserCfgDlg::UserCfgDlg
(QWidget * parent,
const char *name):Inherited (parent, name), pTimer (new QTimer (this))
{
	setCaption (tr ("User Configuration"));
	//
	// retrive a table of user names
	//
	connect (GetConfigureDb (), SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	
	GetConfigureDb()->DoExec(this,"select NAME from USERS order by NAME asc;",tList);
	ButtonState (false);
	connect (pTimer, SIGNAL (timeout ()), this, SLOT (DoSelChange ()));	// wire up the item selection timer
	//
	Comment->setMaxLength(MAX_LENGHT_OF_STRING);
	//set the tab order
	// 
	QWidget *pL[] = {
		Name,
		Password,
		Comment,
		Language,
		AgePassword,
		AgeDays,
		AllPriv,
		AlarmAckPriv,
		ReportsPriviledge,
		ReportsPriv,
		ExitApp,
		FactoryAdministrator,
		0
	};
	SetTabOrder (this, pL);
}
示例#3
0
ScheduleCfg::ScheduleCfg
(QWidget * parent,
const char *name):Inherited (parent, name), pTimer (new QTimer (this))
{
	setCaption (tr("Scheduled Event Configuration"));
	connect (GetConfigureDb (),
	SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	// connect to the database
	GetConfigureDb()->DoExec(this,"select NAME from SCHEDULE order by NAME asc;",tList);
	QString cmd = "select NAME from REPORTS order by NAME asc;";
	GetConfigureDb ()->DoExec (this, cmd,tReportList);
	cmd = "select NAME from SAMPLE order by NAME asc;";
	GetConfigureDb ()->DoExec (this,  cmd, tSamplePointList);
	cmd = "select NAME from RECEIPE order by NAME asc;";
	GetConfigureDb ()->DoExec (this, cmd, tReceipeList);
	ButtonState (false);
	connect (pTimer, SIGNAL (timeout ()), this, SLOT (DoSelChange ()));	// wire up the item selection timer
	//
	Comment->setMaxLength(MAX_LENGHT_OF_STRING);

	//set the tab order
	// 
	QWidget *pL[] = 
	{
		Name, Comment, FrequencyMode, Time,
		SamplePointList, TagList, RelOp, TriggerValue,
		ReportList, PrintReport, EditReportButton,
		ReceipeList, EditReceipeButton,	Action,
		ApplyButton, NewButton, DeleteButton,
		0
	};
	SetTabOrder (this, pL);
}
示例#4
0
void TaskbarPreviews::changeOrder(unsigned tabid, unsigned beforeid)
{
	QWidget *inttab   = m_tabs.internal(tabid);
	QWidget *intbefore = m_tabs.internal(beforeid);
	if(!(inttab && intbefore))
		return;
	SetTabOrder((HWND)inttab->winId(), (HWND)intbefore->winId());
}
示例#5
0
void TaskbarPreviews::changeOrder(QWidget *tab, QWidget *before)
{
	QWidget *inttab    = m_tabs.internal(tab);
	QWidget *intbefore = m_tabs.internal(before);
	if(!(inttab && intbefore))
		return;
	SetTabOrder((HWND)inttab->winId(), (HWND)intbefore->winId());
}
示例#6
0
LoginView::LoginView(Rect cRect,Window* pcParent) : View(cRect,"login_view")
{	
	pcParentWindow = pcParent;
	Layout();
	
	String cName = GetHighlightName();
	if (cName != "")
	{
		FindUser(cName);
	}


	pcParentWindow->SetFocusChild(pcPassText);
	pcParentWindow->SetDefaultButton(pcLoginButton);
	SetTabOrder( NO_TAB_ORDER );
}
示例#7
0
SerialCfg::SerialCfg
(QWidget * parent,
const char *name):Inherited (parent, name), pTimer (new QTimer (this))
{
	setCaption (tr ("Serial Port Configuration"));
	connect (GetConfigureDb (),
	SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	// connect to the databas
	GetConfigureDb()->DoExec(this,"select NAME from SERIAL order by NAME asc;",tList);
	ButtonState (false);
	connect (pTimer, SIGNAL (timeout ()), this, SLOT (DoSelChange ()));	// wire up the item selection timer
	//
	Comment->setMaxLength(MAX_LENGHT_OF_STRING);
	//set the tab order
	// 
	QWidget *pL[] = {
		Name, Enabled, Comment, DataBits, StopBits, Parity, BaudRate, 0
	};
	SetTabOrder (this, pL);
}
示例#8
0
unsigned TaskbarPreviews::addVirtualTab(PreviewProvider *pp, QWidget *owner, const QString &title, QWidget *before)
{
	_tab t;
	t.internalTabWidget = new QWidget;
	t.pp            = pp;
	t.userTabWidget = 0;
	t.tabHandle     = (HWND)t.internalTabWidget->winId();
	t.userTabOwner  = owner;
	t.type          = ttVirtual;
	if (!title.isNull())
		t.internalTabWidget->setWindowTitle(title);
	else
		t.internalTabWidget->setWindowTitle(t.userTabOwner->windowTitle());
	HWND afterHwnd = before ? reinterpret_cast<HWND>(m_tabs.internal(before)->winId()) : 0;
	ForceIconicRepresentation((HWND)t.internalTabWidget->winId());
	m_tabs.append(t);
	RegisterTab(t.tabHandle, (HWND)owner->winId());
	SetTabOrder(t.tabHandle, afterHwnd);
	return t.id;
}
示例#9
0
SampleCfg::SampleCfg
(QWidget * parent,
const char *name):Inherited (parent, name),
pTimer (new QTimer (this)),pConfig (0),
pCfgDriver(0)
{
	IT_IT("SampleCfg::SampleCfg");
	
	setCaption (tr ("Sample Point Configuration"));
	unit_type = tr(NONE_STR);
	//
	connect (GetConfigureDb(),
	SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	// connect to the database
	connect (GetResultDb(),
	SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	// connect to the database
	//
	GetConfigureDb()->DoExec(this,"select NAME,COMMENT from SAMPLE order by NAME asc;",tList);
	GetConfigureDb()->DoExec(this,"select NAME from UNITS order by NAME asc;",tUnitList);
	ButtonState (false);
	//
	connect (pTimer, SIGNAL (timeout ()), this, SLOT (DoSelChange ()));	// wire up the item selection timer
		
	InputIndex->insertItem(tr(NONE_STR));
			
	Type->insertItem (tr(NONE_STR));
	//
	Comment->setMaxLength(MAX_LENGHT_OF_STRING);
	//set the tab order
	// 
	QWidget *pL[] =
	{
		List, Comment, Unit, Type, InputIndex, Units,
		Enabled, Fileable,LogMode,Retrigger,AlarmThreshold, 0
	};
	SetTabOrder (this, pL);
}
示例#10
0
UnitCfg::UnitCfg  (QWidget * parent,
const char *name):Inherited (parent, name), pTimer (new QTimer (this)),fNew(0)
{
	setCaption (tr ("Unit Configuration"));
	connect (GetConfigureDb (),
	SIGNAL (TransactionDone (QObject *, const QString &, int, QObject*)), this,
	SLOT (QueryResponse (QObject *, const QString &, int, QObject*)));	// connect to the databas
	GetConfigureDb()->DoExec(this,"select NAME from UNITS order by NAME asc;",tList);
	ButtonState (false);
	connect (pTimer, SIGNAL (timeout ()), this, SLOT (DoSelChange ()));	// wire up the item selection timer
	//
	// Fill the unit type list
	QDir d (QSDRIVER_DIR, "*" DLL_EXT, QDir::Name, QDir::Files);	// get the directory listing
	// 
	if (d.count ())
	{
		const QFileInfoList *pD = d.entryInfoList ();
		QFileInfoListIterator it (*pD);
		QFileInfo *fi;
		//
		while ((fi = it.current ()))
		{
			UnitType->insertItem (fi->baseName ());
			++it;
		};
	};
	//
	Comment->setMaxLength(MAX_LENGHT_OF_STRING);
	//set the tab order
	// 
	QWidget *pL[] = 
	{
		Name, Comment, UnitType, Enabled, ApplyButton, NewButton,
		DeleteButton,0
	};
	SetTabOrder (this, pL);
}
示例#11
0
LoginImageView::LoginImageView(const Rect& cRect) : View(cRect,"login_image_view")
{
	pcImage = LoadImageFromResource("background.png");
	ResizeBackground();
	SetTabOrder( NO_TAB_ORDER );
}