Ejemplo n.º 1
0
Bool SerialDialog::AskClose(void)
{
	String v;
	GetString(IDC_SERIALNUMBER,v);
	v.GetCString(str,SERIAL_SIZE-1);
	if (!Validate(str)) 
	{
		LONG time=GeGetTimer();
		GeShowMouse(MOUSE_BUSY);
		Enable(IDC_SERIALNUMBER,FALSE);
		while (GeGetTimer()-time<8000) {}
		Enable(IDC_SERIALNUMBER,TRUE);
		GeShowMouse(MOUSE_NORMAL);
		return TRUE;
	}
	return FALSE;
}
Ejemplo n.º 2
0
Bool MenuTest::Execute(BaseDocument* doc)
{
	ControlThread ct;
	String msg;

	GeShowMouse(MOUSE_BUSY);
	if (ct.Start())
	{
		ct.Wait();
		msg = ct.GetResult();
	}
	else
		msg = "Thread start failed";
	GeShowMouse(MOUSE_NORMAL);

	MessageDialog(msg);

	return true;
}
Bool SerialDialog::AskClose(void)
{
	String v;
	GetString(IDC_SERIALNUMBER, v);
	v.GetCString(str, SERIAL_SIZE - 1);
	if (!Validate(str))
	{
		Int32 time = GeGetTimer();
		GeShowMouse(MOUSE_BUSY);
		Enable(IDC_SERIALNUMBER, false);
		while (GeGetTimer() - time < 8000)
		{
		}
		Enable(IDC_SERIALNUMBER, true);
		GeShowMouse(MOUSE_NORMAL);
		return true;
	}
	return false;
}
Ejemplo n.º 4
0
/*********************************************************************\
	Function name    : CResEditBrowser::FillList
	Description      :
	Created at       : 25.09.01, @ 22:58:07
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CResEditBrowser::FillList()
{
	SetTitle(GeLoadString(IDS_BROWSER_CAPT) + " - " + m_strPath.GetString());
	GeShowMouse(MOUSE_BUSY);

	m_wndTreeView.LockWindowUpdate();
	m_wndTreeView.Reset();

	m_pDialogsItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_DIALOGS));
	m_pImagesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_IMAGES));
	m_pStringTablesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_STRIG_TABLES));

	BrowsePath(m_strPath);

	// add global string table(s)
	CDoubleLinkedList <CStringTableName> stringList;

	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(m_strPath, false);
	while (pBrowse->GetNext())
	{
		if (!pBrowse->IsDir()) continue;

		Filename fnNew = pBrowse->GetFilename();

		if (fnNew.GetString().SubStr(0, 8).ToLower() == "strings_")
		{
			Filename fnStringTable = m_strPath + fnNew;
			TRACE("Found string table path ");
			//TRACE_STRING(fnStringTable.GetString());

			AutoAlloc <BrowseFiles> pBrowseTable;
			pBrowseTable->Init(fnStringTable, false);

			while (pBrowseTable->GetNext())
			{
				Filename fnTable = pBrowseTable->GetFilename();
				if (fnTable.CheckSuffix("str"))
				{
					TRACE("  ");
					//TRACE_STRING(fnTable.GetString());

					String strNewName = fnTable.GetString();
					// check, if we didn't find this table before

					CStringTableName *pSearch = stringList.First();
					Bool bFound = false;
					while (pSearch)
					{
						if (pSearch->strName == strNewName)
						{
							bFound = true;
							break;
						}
						pSearch = stringList.Next(pSearch);
					}
					if (bFound) continue;

					CStringTableName *pNewItem = NewObjClear(CStringTableName);
					pNewItem->strName = strNewName;
					stringList.Append(pNewItem);
				}
			}
		}
	}

	CStringTableName *pInsert = stringList.First();
	while (pInsert)
	{
		TreeViewItem* pNewItem = m_wndTreeView.AddItem(pInsert->strName, m_pStringTablesItem);
		pNewItem->GetData()->SetString(ITEM_PATH_NAME, pInsert->strName);
		pInsert = stringList.Next(pInsert);
	}
	stringList.FreeList();

	m_wndTreeView.SortChildren(m_pDialogsItem);
	m_wndTreeView.SortChildren(m_pImagesItem);
	m_wndTreeView.SortChildren(m_pStringTablesItem);

	m_wndTreeView.UnlockWindowUpdate();

	GeShowMouse(MOUSE_NORMAL);
}