示例#1
0
/*!
 * This function is called whenever the user clicks "Add". It calls NewJob().
 */
void GamessQFrame::OnADDClick( wxCommandEvent& event )
{
	GreyButtons();
	NewJob();
	RefreshList();
	RefreshButtons();
}
示例#2
0
/*!
 * This function is called when the user clicks "Clear". It deletes all the
 * done, canceled or error jobs.
 */
void GamessQFrame::OnClearClick( wxCommandEvent& event )
{
	GreyButtons();
	mQueueManager.Clear();
	RefreshList();
	RefreshButtons();
}
示例#3
0
/*!
 * This function is called when the refresh timer goes off (at a
 * user-determined interval). It calls RefreshList().
 */
void GamessQFrame::OnTimer( wxTimerEvent& event )
{
	if (mConnected) {
		GreyButtons();
		RefreshList();
		RefreshButtons();
	}
}
示例#4
0
/*!
 * This function is called when someone tries to edit a field in the queue. It
 * veto's the event unless they are trying to edit a job's name.
 */
void GamessQFrame::OnJoblistctrlBeginLabelEdit( wxListEvent& event )
{
	if (event.GetColumn() != 0) {
		event.Veto();
	} else {
		GreyButtons();
	}
}
示例#5
0
void GamessQFrame::OnRemoveClick( wxCommandEvent& event )
{
	GreyButtons();
	int index = jobListCtrl->GetNextItem(-1, wxLIST_NEXT_ALL,
			wxLIST_STATE_SELECTED);
	while (index != -1) {
		Job *job = mJobList.Item(index)->GetData();
		mQueueManager.Remove(job->GetId());
		index = jobListCtrl->GetNextItem(index, wxLIST_NEXT_ALL,
				wxLIST_STATE_SELECTED);
	}
	RefreshList();
	RefreshButtons();
}
void CTemplateWizardDialog::Render()
{
	// Enable and disable the proper buttons.
	GreyButtons();

	// Set the new title.
	CString title;
	GetWindowText(title);
	int parenPos = title.Find(" (", 0);
	if (parenPos != -1)
		title = title.Left(parenPos);
	CString newTitle;
	if (m_curPage == -1)
	{
		newTitle = title;
	}
	else
	{
		newTitle.Format("%s (Page %d of %d)", title, m_curPage + 1, m_code.GetPageCount());
	}
	SetWindowText(newTitle);

	// Get the module name and strip the module filename from it, leaving the
	// module path.
	TCHAR moduleName[_MAX_PATH];
	moduleName[0] = 0;
	::GetModuleFileName(AfxGetInstanceHandle(), (TCHAR*)&moduleName, _MAX_PATH);
	TCHAR* ptr = _tcsrchr(moduleName, '\\');
	if (ptr)
	{
		ptr++;
		*ptr = 0;
	}

	///////////////////////////////////////////////////////////////////////////
	// Render the page.
	const CString& pageStr = (m_curPage == -1) ? m_page : m_code.GetPage(m_curPage);

	CRect clientRect;
	GetClientRect(clientRect);

	int curPos = 0;
//	while (true)
//	{
		// Grab the text.
		CString staticStr = pageStr;

//	}

	// See if it is a special case of a URL.
	bool isURL = false;
	CString leftStaticStr = staticStr.Left(7);
	if (leftStaticStr == "http://"  ||  leftStaticStr == "file://")
	{
		isURL = true;
	}

	CString strURL;
	if (!isURL)
	{
		m_htmlFile.SetLength(0);
		if (strnicmp(staticStr, "<html>", 6) != 0)
		{
			WriteString("<html><head>");
			WriteString("</head><body>");
			WriteString(staticStr);
			WriteString("</body></html>");
		}
		else
		{
			WriteString(staticStr);
		}

		// Generate a unique temporary name.
		char* asciiTempName = _tempnam(NULL, "WW200_");
		m_asciiFilename = CString(asciiTempName);
		free(asciiTempName);

		DWORD size = (DWORD)m_htmlFile.GetLength();
		BYTE* mem = m_htmlFile.Detach();
		CFile asciiFile;
		asciiFile.Open(m_asciiFilename, CFile::modeCreate | CFile::modeWrite);
		asciiFile.Write(mem, size);
		asciiFile.Close();
		free(mem);

//	CComBSTR bstrURL = "about:blank";
//	m_pBrowserApp->Navigate(bstrURL, NULL, NULL, NULL, NULL);

		strURL = m_asciiFilename;
	}
	else
	{
		m_asciiFilename.Empty();
		strURL = pageStr;
		strURL = "http://workspacewhiz.com";
	}

	m_pBrowserApp->Navigate2(COleVariant(strURL), NULL, NULL, NULL, NULL);
}