コード例 #1
0
int CFMTempSendUnPaidPatientList::SetMode(int nMode){
 		int nOldMode = GetMode();
 		CGuiView::SetMode(nMode);
 		CHMSMainFrame *pMF = (CHMSMainFrame *) AfxGetMainWnd();
 		CString szSQL;
 		CRecord rs(&pMF->m_db);
  		switch(nMode){
 		case VM_ADD: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			SetDefaultValues();
 			break;
 		case VM_EDIT: 
 			EnableControls(TRUE);
 			EnableButtons(TRUE, 3, 4, -1);
 			break;
 		case VM_VIEW: 
 			EnableControls(FALSE);
 			EnableButtons(FALSE, 3, 4, -1);
 			break;
 		case VM_NONE: 
 			EnableControls(FALSE);
 			EnableButtons(TRUE, 0, 6, -1);
 			SetDefaultValues();
 			break;
 		};
 		UpdateData(FALSE);
 		return nOldMode;
}
コード例 #2
0
ファイル: WndMain.c プロジェクト: arcanelab/WinGHCi
VOID LoadFile(LPTSTR File)
{
	TCHAR Command[2*MAX_PATH], fName[MAX_PATH], fExt[MAX_PATH], Buffer[MAX_PATH];

	//Move the current directory
	SetWorkingDirToFileLoc(File);

	

	// get file name and extension
	_tsplitpath (File, NULL, NULL, fName, fExt);
	wsprintf(Buffer,TEXT("%s%s"),fName,fExt);

	wsprintf(Command, TEXT(":load %s"), ExpandFileName(Buffer));
	AddMruFile(File);


	RtfWindowSetCommand(TEXT(":load "));
	StartOfInput += 6;	
	WinGHCiHyperlink(ExpandFileName(Buffer));
	StartOfInput += StringLen(ExpandFileName(Buffer));
	
	RtfWindowStartNextOutput();
	AddHistory(Command);
	SendToGHCiStdinLn(Command);

	Running = TRUE;
	EnableButtons();
	
	PrintGHCiOutputIfAvailable(hChildStderrRd, ErrorColor);
	PrintGHCiOutput(hChildStdoutRd, ForegroundColor);
	
	Running = FALSE;
	EnableButtons();
}
コード例 #3
0
ファイル: OpenSubDlg.cpp プロジェクト: iuliua/OpenSub
void COpenSubDlg::OnBnClickedPlay()
{
	IOpenSubtitlesAPI::subtitle_info selected_sub;
	
	if (GetSelectedSubtitle(selected_sub))
	{
		WCHAR                existing_subtitle[512];
		WCHAR                temp_subtitle[512];
		bool                 subtitle_exists = false;
		swprintf_s(existing_subtitle, sizeof(existing_subtitle) / sizeof(WCHAR), L"%s\\%s.%s",
			m_api->GetFileDirectory(theApp.m_lpCmdLine).c_str(),
			m_api->GetFileNameNoExt(theApp.m_lpCmdLine).c_str(),
			selected_sub.format.c_str());
		swprintf_s(temp_subtitle, sizeof(temp_subtitle) / sizeof(WCHAR), L"%s\\temp_moved_open_sub.tmp",
			m_api->GetFileDirectory(theApp.m_lpCmdLine).c_str());
		::DeleteFile(temp_subtitle);

		subtitle_exists = (GetFileAttributes(existing_subtitle) != INVALID_FILE_ATTRIBUTES);
		if ((subtitle_exists && ::MoveFile(existing_subtitle, temp_subtitle)) || !subtitle_exists)
		{
			EnableButtons(FALSE);
			PrintMessage(GetSafeHwnd(), L"Downloading");
			Tools::SetCurrDirToFileLocation(theApp.m_lpCmdLine);
            Tools::MemoryStruct memory;
            Tools::MemoryStruct extracted_sub;
            Tools::DownloadLink(selected_sub.zip_link, memory);
            Tools::UnzipFileType(memory.memory, memory.size, selected_sub.format, extracted_sub);
            std::ofstream out((m_api->GetFileNameNoExt(theApp.m_lpCmdLine) + L'.' + selected_sub.format).c_str(), std::ios::binary);
            out.write(extracted_sub.memory, extracted_sub.size);
            out.close();
            delete[] extracted_sub.memory;
			
			HANDLE hProc;
			if (Launch(theApp.m_lpCmdLine, &hProc))
			{
				PrintMessage(GetSafeHwnd(), L"Playing...");
				::WaitForSingleObject(hProc, INFINITE);
				CloseHandle(hProc);
				if (subtitle_exists)
				{
					if (!::DeleteFile(existing_subtitle) || !::MoveFile(temp_subtitle, existing_subtitle))
						PrintMessage(GetSafeHwnd(), L"Cannot rename temporary file.");
				}
				else
				{
					if (!::DeleteFile(existing_subtitle))
						PrintMessage(GetSafeHwnd(), L"Cannot delete test subtitle.");
				}
			}
			else
				PrintMessage(GetSafeHwnd(), L"failed to open video");
			PrintMessage(GetSafeHwnd(), L"Done");
			EnableButtons(TRUE);
		}
		return;
	}
}
コード例 #4
0
void CheckCurAFSel(HWND hwnd)
{
    AFPlugin* plugin;

    if ((plugin=(AFPlugin*)GetCurPlugin(hwnd))==NULL)
		EnableButtons(hwnd,FALSE,FALSE);
    else
		EnableButtons(hwnd,(plugin->Config!=NULL),(plugin->About!=NULL));
}
コード例 #5
0
ファイル: updatedlg.cpp プロジェクト: DowerChest/codeblocks
void UpdateDlg::InternetUpdate(bool forceDownload)
{
    UpdateStatus(_("Please wait..."));
    m_HasUpdated = false;
    m_Net.SetServer(GetCurrentServer());

    EnableButtons(false);
    forceDownload = forceDownload || !XRCCTRL(*this, "chkCache", wxCheckBox)->GetValue();

    bool forceDownloadMirrors = forceDownload || !wxFileExists(GetMirrorsFilename());
    if (forceDownloadMirrors)
    {
        if (!m_Net.DownloadFile(_T("mirrors.cfg"), GetMirrorsFilename()))
        {
            UpdateStatus(_("Error downloading list of mirrors"), 0, 0);
            return;
        }
        else
        {
            FillServers();
            m_Net.SetServer(GetCurrentServer()); // update server based on mirrors
        }
    }

    wxString config = GetConfFilename();
    forceDownload = forceDownload || !wxFileExists(config);
    if (forceDownload && !m_Net.DownloadFile(_T("webupdate.conf"), config))
    {
        UpdateStatus(_("Error downloading list of updates"), 0, 0);
        return;
    }
    else
    {
        IniParser ini;
        if (!ini.ParseFile(config))
        {
            UpdateStatus(_("Failed to retrieve the list of updates"), 0, 0);
            return;
        }
        ini.Sort();

        if (m_Recs)
            delete[] m_Recs;

        // remember to delete[] m_Recs when we 're done with it!!!
        // it's our responsibility once given to us
        m_Recs = ReadConf(ini, &m_RecsCount, GetCurrentServer(), GetPackagePath());

        FillGroups();
    }
    EnableButtons();
    UpdateStatus(_("Ready"), 0, 0);

    m_HasUpdated = true;
}
コード例 #6
0
ファイル: updatedlg.cpp プロジェクト: DowerChest/codeblocks
void UpdateDlg::DownloadFile(bool dontInstall)
{
    UpdateStatus(_("Please wait..."));
    UpdateRec* rec = GetRecFromListView();
    if (!rec)
    {
        wxMessageBox(_("No file selected!"), _("Error"), wxICON_ERROR);
        UpdateStatus(_("Ready"), 0, 0);
        return;
    }

    if (rec->version == rec->installed_version)
    {
        if (wxMessageBox(_("You seem to have installed the latest version.\nAre you sure you want to proceed?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO) == wxNO)
            return;
    }

    if (!CreateDirRecursively(GetPackagePath()))
    {
        wxMessageBox(_("Can't create directory ") + GetPackagePath(), _("Error"), wxICON_ERROR);
        return;
    }

    if (wxFileExists(GetPackagePath() + rec->local_file))
    {
        if (wxMessageBox(_("This file already exists!\nAre you sure you want to download it again?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO) == wxNO &&
            rec->installable)
        {
            if (!dontInstall && wxMessageBox(_("Do you want to force-install it?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO) == wxYES)
                InstallFile();
            return;
        }
    }

    m_Net.SetServer(rec->remote_server);

    EnableButtons(false);
    if (!m_Net.DownloadFile(rec->remote_file, GetPackagePath() + rec->local_file))
    {
        rec->downloaded = false;
        UpdateStatus(_("Error downloading file: ") + rec->remote_server + _T(" > ") + rec->remote_file, 0, 0);
        return;
    }
    else
        rec->downloaded = true;
    UpdateStatus(_("Ready"), 0, 0);
    EnableButtons();
}
コード例 #7
0
BOOL CxDlgAccountPassword::OnInitDialog() 
{
	CDialog::OnInitDialog();
	EnableButtons();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
コード例 #8
0
ファイル: TaskPage.cpp プロジェクト: MiKTeX/miktex
BOOL TaskPage::OnInitDialog()
{
  BOOL ret = TRUE;
  sheet = reinterpret_cast<SetupWizard*>(GetParent());
  try
  {
    switch (SetupApp::Instance->GetTask())
    {
    case SetupTask::Download:
      task = 0;
      break;
    case SetupTask::InstallFromLocalRepository:
      task = 1;
      break;
    }
    ret = CPropertyPage::OnInitDialog();
    EnableButtons();
  }
  catch (const MiKTeXException& e)
  {
    ReportError(e);
  }
  catch (const exception& e)
  {
    ReportError(e);
  }
  return ret;
}
コード例 #9
0
void
PropPageFormats::OnRemove ()
{
  try
    {
      int n = listControl.GetSelectedCount();
      for (int i = 0; i < n; ++i)
	{
	  int idx = GetSelectedItem();
	  CString formatKey = listControl.GetItemText(idx, 0);
	  SessionWrapper(true)->DeleteFormatInfo (TU_(formatKey));
	  if (! listControl.DeleteItem(idx))
	    {
	      FATAL_WINDOWS_ERROR ("CListCtrl::DeleteItem", 0);
	    }
	}
      EnableButtons ();
    }
  catch (const MiKTeXException & e)
    {
      ErrorDialog::DoModal (this, e);
    }
  catch (const exception & e)
    {
      ErrorDialog::DoModal (this, e);
    }
}
コード例 #10
0
void t4p::FindInFilesResultsPanelClass::Find(const FindInFilesClass& findInFiles, bool doHiddenFiles) {
    FindInFiles.Copy(findInFiles);
    MatchedFiles = 0;
    ReplaceWithText->SetValue(t4p::IcuToWx(FindInFiles.ReplaceExpression));
    RegexReplaceWithHelpButton->Enable(t4p::FinderClass::REGULAR_EXPRESSION == FindInFiles.Mode);

    // for now disallow another find when one is already active
    if (RunningActionId > 0) {
        wxMessageBox(_("Find in files is already running. Please wait for it to finish."), _("Find In Files"));
        return;
    }
    std::vector<wxString> skipFiles = View.AllOpenedFiles();
    t4p::FindInFilesBackgroundReaderClass* reader =
        new t4p::FindInFilesBackgroundReaderClass(RunningThreads, FindInFilesGaugeId);
    if (reader->InitForFind(FindInFiles, doHiddenFiles, skipFiles)) {
        RunningActionId = RunningThreads.Queue(reader);
        EnableButtons(true, false, false);
        Gauge->AddGauge(_("Find In Files"), FindInFilesGaugeId, StatusBarWithGaugeClass::INDETERMINATE_MODE,
                        wxGA_HORIZONTAL);
        SetStatus(_("Searching"));

        // lets do the find in the opened files ourselves so that the hits are not stale
        FindInOpenedFiles();
    } else {
        wxMessageBox(_("Please enter a valid expression and path."));
        delete reader;
    }
}
コード例 #11
0
ファイル: OpenSubDlg.cpp プロジェクト: iuliua/OpenSub
void COpenSubDlg::OnSearchComplete()
{
    if (m_results_list_control.GetSafeHwnd())//if close window before search finish
    {
        std::sort(m_subtitles.begin(), m_subtitles.end());

        for (unsigned int i = 0; i < m_subtitles.size(); i++)
        {
            LVITEM lvItem;
            lvItem.mask = LVIF_TEXT | LVIF_PARAM;
            lvItem.iItem = 0;
            lvItem.iSubItem = 0;
            lvItem.pszText = const_cast<LPWSTR>(m_subtitles[i].download_count.c_str());
            lvItem.lParam = i;
            m_results_list_control.InsertItem(&lvItem);

            if (m_subtitles[i].sub_file_name.size())
                m_results_list_control.SetItemText(0, 1, m_subtitles[i].sub_file_name.c_str());
            else
                if (m_subtitles[i].release_name.size())
                    m_results_list_control.SetItemText(0, 1, m_subtitles[i].release_name.c_str());
        }
        if (m_subtitles.size())
            m_results_list_control.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
        EnableButtons(TRUE);
        PrintMessage(GetSafeHwnd(), L"Search finished");
    }
}
コード例 #12
0
ファイル: OpenSubDlg.cpp プロジェクト: iuliua/OpenSub
BOOL COpenSubDlg::OnInitDialog()
  {
   CDialog::OnInitDialog();
   // Add "About..." menu item to system menu.

   // IDM_ABOUTBOX must be in the system command range.
   ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
   ASSERT(IDM_ABOUTBOX < 0xF000);

   CMenu* pSysMenu = GetSystemMenu(FALSE);
   if (pSysMenu != NULL)
   {
      BOOL bNameValid;
      CString strAboutMenu;
      bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
      ASSERT(bNameValid);
      if (!strAboutMenu.IsEmpty())
      {
         pSysMenu->AppendMenu(MF_SEPARATOR);
         pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
      }
   }
   // Set the icon for this dialog.  The framework does this automatically
   //  when the application's main window is not a dialog
   SetIcon(m_hIcon, TRUE);         // Set big icon
   SetIcon(m_hIcon, FALSE);      // Set small icon
//--- set dialog title
   std::wstring path(theApp.m_lpCmdLine);
   SetWindowText(path.substr(path.rfind(L'\\') + 1).c_str());
//--- create list columns
   InitializeList();
   EnableButtons(FALSE);
   PrintMessage(GetSafeHwnd(), L"Searching");
   return(TRUE);
  }
コード例 #13
0
void CuDlgReplicationServerPageStartupSetting::OnButtonRestoreAll()
{
	CString strMessage;
	int i,answ, nCount = m_cListCtrl.GetItemCount();
	if (nCount == 0)
		return;
	m_cListCtrl.HideProperty(TRUE);
	answ = AfxMessageBox(IDS_A_RESTORE_ALL , MB_ICONEXCLAMATION | MB_YESNO );
	if ( answ == IDYES ) {
		for (i=0; i<nCount; i++)
		{
			CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(i);
			if ( pItem != NULL)
			{
				BOOL bNotUsed;
				pItem->SetToDefault();
				pItem->SetValueModifyByUser(TRUE);
				if (pItem->GetType() == CaReplicationItem::REP_BOOLEAN)
				{
					CString strValue = pItem->GetFlagContent(bNotUsed);
					if (strValue.CompareNoCase (_T("TRUE")) == 0)
						m_cListCtrl.SetCheck (i, 1, TRUE);
					else
						m_cListCtrl.SetCheck (i, 1, FALSE);
				}
				else
					m_cListCtrl.SetItemText (i, 1, pItem->GetFlagContent(bNotUsed));
			}
		}
	}
	EnableButtons();
}
コード例 #14
0
void
InverseSearchOptionsPage::OnSelChangeEditor ()
{
  try
    {
      int idx = editorListBox.GetCurSel();
      if (idx >= static_cast<int>(editors.size()))
	{
	  UNEXPECTED_CONDITION
	    ("InverseSearchOptionsPage::OnSelChangeEditor");
	}
      commandLineIdx = idx;
      if (idx >= 0)
	{
	  commandLineDisplay.SetWindowText
	    (UT_(editors[idx].GetCommandLine().c_str()));
	}
      else
	{
	  commandLineDisplay.SetWindowText (_T(""));
	}
      SetModified (TRUE);
      EnableButtons ();
    }
  catch (const MiKTeXException & e)
    {
      ErrorDialog::DoModal (this, e);
    }
  catch (const exception & e)
    {
      ErrorDialog::DoModal (this, e);
    }
}
コード例 #15
0
void CuDlgReplicationServerPageStartupSetting::OnButtonRestore()
{
	UINT nState = 0;
	CString strMessage;
	int answ, nCount = m_cListCtrl.GetItemCount(),iIndex = -1;

	m_cListCtrl.HideProperty(TRUE);
	iIndex = m_cListCtrl.GetNextItem (-1, LVNI_SELECTED);

	if (iIndex == -1)
		return;
	CaReplicationItem* pItem = (CaReplicationItem*)m_cListCtrl.GetItemData(iIndex);
	if (!pItem)
		return;
	//"Do you want to restore '%s' "
	//"to its default setting ?"
	strMessage.Format(IDS_F_RESTORE_DEFAULT,(LPCTSTR)pItem->GetDescription());
	answ = AfxMessageBox(strMessage , MB_ICONEXCLAMATION | MB_YESNO);
	if ( answ == IDYES ){
		BOOL bNotUsed;
		pItem->SetToDefault();
		pItem->SetValueModifyByUser(TRUE);
		if (pItem->GetType() == CaReplicationItem::REP_BOOLEAN)
		{
			CString strValue = pItem->GetFlagContent(bNotUsed);
			if (strValue.CompareNoCase (_T("TRUE")) == 0)
				m_cListCtrl.SetCheck (iIndex, 1, TRUE);
			else
				m_cListCtrl.SetCheck (iIndex, 1, FALSE);
		}
		else
			m_cListCtrl.SetItemText (iIndex, 1, pItem->GetFlagContent(bNotUsed));
	}
	EnableButtons();
}
コード例 #16
0
void CuDlgReplicationServerPageStatus::OnButtonStart() 
{
	CWaitCursor hourglass;
	try
	{
		CfIpmFrame* pFrame = (CfIpmFrame*)GetParentFrame();
		CdIpmDoc* pDoc = (CdIpmDoc*)pFrame->GetActiveDocument();

		IPM_StartReplicationServer(pDoc, &m_SvrDta, m_strEdit2);
		UpdateData (FALSE);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage();
		e->Delete();
	}
	catch (CeIpmException e)
	{
		AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK);
	}
	catch (...)
	{
	}

	EnableButtons();
}
コード例 #17
0
ファイル: cOrderArray.cpp プロジェクト: roeland-frans/q-rap
//*****************************************************************
void cOrderArray::CastRow(QTableWidget* from,QTableWidget* to,int fromRow, int toRow)
{
	to->insertRow(toRow);
 				
 	for (int i = 0;i<8;i++)
 	{
 		QTableWidgetItem *It = static_cast<QTableWidgetItem*>(from->item(fromRow,i));
 		QTableWidgetItem *Is = new QTableWidgetItem(It->text());
 		to->setItem(toRow,i, Is);
 	}
 	from->removeRow(fromRow);
 	
 	if (from->rowCount() > 0)
 	{
 		if (fromRow-1 > 0)
 		{
 			from->setCurrentCell(fromRow-1,0);
 		}
 		else
 		{
 			from->setCurrentCell(0,0);
 		}
 	}
 	
 	if (to->rowCount() > 0)
 	{
 		to->setCurrentCell(toRow,0);
 	}
 	EnableButtons();
 	
}
コード例 #18
0
void CuDlgDomPropTableStatistic::OnRemove() 
{
	CWaitCursor doWaitCursor;
	SORTPARAMS s;
	s.m_bAsc  = m_statisticData.m_bAsc;
	s.m_nItem = m_statisticData.m_nCurrentSort;
	int nSelected = m_cListColumn.GetNextItem (-1, LVNI_SELECTED);

	if (nSelected != -1)
	{
		CaTableStatisticColumn* pColumn = (CaTableStatisticColumn*)m_cListColumn.GetItemData (nSelected);
		if (!pColumn)
			return;
		CString strColumn = pColumn->m_strColumn;

		if (!Table_RemoveStatistics (pColumn, m_statisticData))
			return;
		if (!QueryStatColumns())
			return;
		m_cListColumn.SortItems(CaTableStatisticColumn::Compare, (LPARAM)&s);
		//
		// Try to selected the old selected item:
		nSelected = Find (strColumn);
		if (nSelected != -1)
		{
			//
			// This line cause to execute the member: OnItemchangedList1()
			// and then draw the statistic:
			m_cListColumn.SetItemState (nSelected, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
		}
	}
	EnableButtons();
}
コード例 #19
0
void ExecutionFinished()
{
    RtfWindowFlushBuffer();
    RtfWindowStartInput();
    Running = FALSE;
    EnableButtons();
}
コード例 #20
0
void
QvisSubsetPanelWidget::Clear()
{
    tree->clear();
    tree->setEnabled(false);
    tree->headerItem()->setText(0,"");
    EnableButtons(false);
}
コード例 #21
0
void CuDlgReplicationStaticPageRaiseEvent::OnButtonRaiseEventAllServer() 
{
	CdIpmDoc* pIpmDoc = NULL;
	CfIpmFrame* pIpmFrame = (CfIpmFrame*)GetParentFrame();
	ASSERT(pIpmFrame);
	if (pIpmFrame)
	{
		pIpmDoc = pIpmFrame->GetIpmDoc();
		ASSERT (pIpmDoc);
	}
	if (!pIpmDoc)
		return;

	CxDlgReplicationServerList dlg;
	dlg.m_pDBResourceDataMin = m_pSvrDta;
	dlg.m_pIpmDoc = pIpmDoc;

	int i, nSel = -1, nCount = m_cListCtrl.GetItemCount();
	for (i=0; i<nCount; i++)
	{
		if (m_cListCtrl.GetItemState(i, LVIS_SELECTED) & LVIS_SELECTED)
		{
			nSel = i;
			dlg.m_strEventFlag = m_cListCtrl.GetItemText(i, 1);
			dlg.m_strServerFlag= m_cListCtrl.GetItemText(i, 2);
			break;
		}
	}
	if (nSel == -1)
		return;
	int iret;
	CaReplicationRaiseDbevent* pItem = (CaReplicationRaiseDbevent*)m_cListCtrl.GetItemData (nSel);
	if(pItem->AskQuestion()) 
	{
		iret = pItem->AskQuestion4FilledServerFlag(&dlg.m_strServerFlag);
		if (iret == IDCANCEL) {
			m_cListCtrl.SetFocus();
			EnableButtons();
			return;
		}
	}

	dlg.DoModal();
	m_cListCtrl.SetFocus();
	EnableButtons();
}
コード例 #22
0
ファイル: WndMain.c プロジェクト: arcanelab/WinGHCi
VOID FireCommandAux(LPCTSTR Command, BOOL WaitForResponse, BOOL startThread, BOOL StopStdoutPrinterThread, BOOL WantPreprocess, FireCommandThreadArgs *pArgs) 
{

	#define MAXLEN    (3*1024)

	TCHAR NewCommand[MAXLEN];

	if(StopStdoutPrinterThread)
		//stop StdoutPrinterThread
		SignalObjectAndWait( hSigSuspendStdoutPrinterThread
			                ,hSigStdoutPrinterThreadSuspended, INFINITE, FALSE);


	RtfWindowSetCommand(Command);
	RtfWindowStartNextOutput();
	AddHistory(Command);

	if(WantPreprocess) {
		PreprocessCommand(Command, NewCommand);
		SendToGHCiStdinLn(NewCommand);
	}
	else
		SendToGHCiStdinLn(Command);


	if(WaitForResponse) {
		Running = TRUE;
		EnableButtons();
		
		PrintGHCiOutput(hChildStdoutRd, ForegroundColor);
		
		Running = FALSE;
		EnableButtons();

	}

	// resume StdoutPrinterThread
	if(StopStdoutPrinterThread)
		SetEvent(hSigResumeStdoutPrinterThread);

	if(startThread) {
		// free arguments
		free((LPTSTR)Command);
		free(pArgs);
	}
}
コード例 #23
0
ファイル: updatedlg.cpp プロジェクト: DowerChest/codeblocks
void UpdateDlg::ApplyFilter()
{
    wxTreeCtrl* tree = XRCCTRL(*this, "tvCategories", wxTreeCtrl);

    FillGroups();
    FillFiles(tree->GetSelection());
    EnableButtons();
}
コード例 #24
0
BOOL
InverseSearchOptionsPage::OnInitDialog ()
{
  BOOL ret = CPropertyPage::OnInitDialog();

  try
    {
      CollectEditors ();

      int idx = 0;

      for (vector<EditorInfo>::const_iterator it = editors.begin();
	   it != editors.end();
	   ++ it, ++ idx)
	{
	  if (g_pYapConfig->inverseSearchCommandLine
	      == editors[idx].GetCommandLine().c_str())
	    {
	      commandLineIdx = idx;
	    }
	  CString str = UT_(it->name.c_str());
	  if (idx < firstCustomIdx)
	    {
	      str += T_(_T(" (auto-detected)"));
	    }
	  if (editorListBox.AddString(str) < 0)
	    {
	      UNEXPECTED_CONDITION
		("InverseSearchOptionsPage::OnInitDialog");
	    }
	}

      if (commandLineIdx >= 0)
	{
	  if (editorListBox.SetCurSel(commandLineIdx) < 0)
	    {
	      UNEXPECTED_CONDITION
		("InverseSearchOptionsPage::OnInitDialog");
	    }
	  commandLineDisplay.SetWindowText
	    (UT_(editors[commandLineIdx].GetCommandLine().c_str()));
	}
      
      EnableButtons ();
    }

  catch (const MiKTeXException & e)
    {
      ErrorDialog::DoModal (0, e);
    }

  catch (const exception & e)
    {
      ErrorDialog::DoModal (0, e);
    }

  return (ret);
}
コード例 #25
0
void CxDlgSystemInfo::OnChangeEditPassword() 
{
	// TODO: If this is a RICHEDIT control, the control will not
	// send this notification unless you override the CDialog::OnInitDialog()
	// function to send the EM_SETEVENTMASK message to the control
	// with the ENM_CHANGE flag ORed into the lParam mask.
	
	EnableButtons();
}
コード例 #26
0
void
QvisSubsetPanelWidget::ViewCollection(int id)
{
    avtSILRestriction_p restriction = viewerProxy->GetPlotSILRestriction();
    avtSILCollection_p collection = restriction->GetSILCollection(id);
    numCheckable = 0;
    numChecked = 0;
    tree->clear();

    if(*collection != NULL)
    {
        tree->setEnabled(true);
        blockSignals(true);
          
        SetTitle(collection->GetCategory().c_str());
        const avtSILNamespace *ns = collection->GetSubsets();
        int numElems = ns->GetNumberOfElements();

        avtSILRestrictionTraverser trav(restriction);
        for(int i = 0; i < numElems; ++i)
        {
            int setIdx = ns->GetElement(i);
            avtSILSet_p set = restriction->GetSILSet(setIdx);

            // Create an item for the set and set its checked value.
            CheckedState s = S2S(trav.UsesSetData(setIdx));
            QString cname(set->GetName().c_str());
            QvisSubsetPanelItem *item = new QvisSubsetPanelItem(tree,
                                                                cname,
                                                                s,
                                                                setIdx);
            numCheckable++;

            if(s == CompletelyChecked)
                numChecked++;
            
            // Add all of the collections that come out of the set. Note that
            // they are added as uncheckable items.
            QvisSubsetPanelItem *cItem = NULL;
            const std::vector<int> &mapsOut = set->GetMapsOut();
            for(size_t j = 0; j < mapsOut.size(); ++j)
            {
                int cIndex = mapsOut[j];

                avtSILCollection_p c = restriction->GetSILCollection(cIndex);
                QString collectionName(c->GetCategory().c_str());
                cItem = new QvisSubsetPanelItem(item,
                                                collectionName,
                                                cIndex);
            }
        }
        blockSignals(false);
    }
    EnableButtons(true);
    
    
}
コード例 #27
0
void CuDlgReplicationServerPageStartupSetting::OnButtonSave() 
{
	int iret;
	CWaitCursor hourglass;

	CdIpmDoc* pIpmDoc = NULL;
	CfIpmFrame* pIpmFrame = (CfIpmFrame*)GetParentFrame();
	ASSERT(pIpmFrame);
	if (pIpmFrame)
	{
		pIpmDoc = pIpmFrame->GetIpmDoc();
		ASSERT (pIpmDoc);
	}
	if (!pIpmDoc)
		return;

	ASSERT (m_FlagsList.IsEmpty());
	while (!m_FlagsList.IsEmpty())
		delete m_FlagsList.RemoveHead();
	int i, nCount = m_cListCtrl.GetItemCount();
	CaReplicationItem* pItem = NULL;
	for (i=0; i<nCount; i++)    {
		pItem = (CaReplicationItem*)m_cListCtrl.GetItemData (i);
		if (pItem)
			m_FlagsList.AddTail (pItem);
	}

	CString csVnodeAndUsers;
	int nNodeHdl = -1;
	if (lstrcmp((char *)m_pSvrDta->LocalDBNode,(char *)m_pSvrDta->RunNode) == 0)
		csVnodeAndUsers.Format(_T("%s%s%s%s"), m_pSvrDta->LocalDBNode,
		                                   LPUSERPREFIXINNODENAME,
		                                   (LPCTSTR)m_csDBAOwner,
										   LPUSERSUFFIXINNODENAME);
	else
		csVnodeAndUsers = m_pSvrDta->RunNode;

	nNodeHdl  = LIBMON_OpenNodeStruct ((LPUCHAR)(LPCTSTR)csVnodeAndUsers);
	if (nNodeHdl == -1) {
		CString strMsg,strMsg1;
		strMsg.LoadString(IDS_MAX_NB_CONNECT);   // _T("Maximum number of connections has been reached"
		strMsg1.LoadString(IDS_E_SAVE_FILE);     //    " - Cannot save file."
		strMsg += _T("\n")+strMsg1;
		AfxMessageBox(strMsg, NULL, MB_ICONHAND | MB_OK | MB_TASKMODAL);
		return;
	}
	iret = SetReplicServerParams ( pIpmDoc, m_pSvrDta, &m_FlagsList );
	LIBMON_CloseNodeStruct (nNodeHdl);

	if ( iret == RES_SUCCESS )
		m_FlagsList.SetModifyEdit(); // Not modify.
	if (!m_FlagsList.IsEmpty())
		m_FlagsList.RemoveAll();

	EnableButtons();
}
コード例 #28
0
void t4p::FindInFilesResultsPanelClass::Stop() {
    RunningThreads.CancelAction(RunningActionId);
    Gauge->StopGauge(FindInFilesGaugeId);
    if (AllHits.size() >= MAX_HITS) {
        SetStatus(_("Too many hits, Search stopped"));
    } else {
        SetStatus(_("Search stopped"));
    }
    bool enableIterators = MatchedFiles > 0;
    EnableButtons(false, enableIterators, enableIterators);
}
コード例 #29
0
void CuDlgDomPropTableStatistic::OnGenerate() 
{
	CWaitCursor doWaitCursor;
	SORTPARAMS s;
	s.m_bAsc  = m_statisticData.m_bAsc;
	s.m_nItem = m_statisticData.m_nCurrentSort;
	int nSelected = m_cListColumn.GetNextItem (-1, LVNI_SELECTED);

	if (nSelected != -1)
	{
		CaTableStatisticColumn* pColumn = (CaTableStatisticColumn*)m_cListColumn.GetItemData (nSelected);
		if (!pColumn)
			return;
		if(pColumn->m_bComposite && m_statisticData.m_nNumColumnKey<2)
		{
			if (m_statisticData.m_nOT == OT_TABLE)
			{
				//
				// There is only one column in the key structure of the base table,
				// therefore a composite histogram cannot be generated.
				//
				AfxMessageBox(VDBA_MfcResourceString(IDS_ERR_TBL_ONLY_WITH_TWO_KEY_COL));
				return;
			}
			else if (m_statisticData.m_nOT == OT_INDEX)
			{
				//
				// Statistics cannot be generated on this index since it has only
				// 1 key column. This operation is used to generate a composite histogram.
				AfxMessageBox(VDBA_MfcResourceString(IDS_ERR_ONLY_WITH_TWO_KEY_COL));
				return;
			}
		}

		CString strColumn = pColumn->m_strColumn;

		if (!Table_GenerateStatistics (this->m_hWnd ,pColumn, m_statisticData))
			return;
		if (!QueryStatColumns())
			return;
		m_cListColumn.SortItems(CaTableStatisticColumn::Compare, (LPARAM)&s);
		//
		// Try to selected the old selected item:
		nSelected = Find (strColumn);
		if (nSelected != -1)
		{
			//
			// This line cause to execute the member: OnItemchangedList1()
			// and then draw the statistic:
			m_cListColumn.SetItemState (nSelected, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
		}
	}
	EnableButtons();
}
コード例 #30
0
LONG CuDlgDomPropTableStatistic::OnLoad (WPARAM wParam, LPARAM lParam)
{
	int nCount = 0;
	try
	{
		LPCTSTR pClass = (LPCTSTR)wParam;
		ASSERT (lstrcmp (pClass, "CuDomPropDataTableStatistic") == 0);
		CuDomPropDataTableStatistic* pData = (CuDomPropDataTableStatistic*)lParam;
		m_nOT = pData->m_statisticData.m_nOT;
		m_statisticData = pData->m_statisticData;
		InitializeStatisticHeader(m_statisticData.m_nOT);

		//
		// List of statistic columns;
		CaTableStatisticColumn* pColumn = NULL;
		while (!m_statisticData.m_listColumn.IsEmpty())
		{
			pColumn = m_statisticData.m_listColumn.RemoveHead();
			if (m_cListColumn.InsertItem (nCount, "") != -1)
			{
				m_cListColumn.SetItemData (nCount, (DWORD)pColumn);
				nCount++;
			}
		}
		UpdateDisplayList1();
		m_bLoad = TRUE; // Prevent from calling OnItemchangedList1()
		m_cListColumn.SetItemState (pData->m_nSelectColumn, LVIS_SELECTED, LVIS_SELECTED);
		m_bLoad = FALSE;
		//
		// Draw statistic Items:
		DrawStatistic ();
		//
		// Extra information:
		m_bUniqueFlag          = m_statisticData.m_bUniqueFlag;
		m_bCompleteFlag        = m_statisticData.m_bCompleteFlag;
		m_strUniqueValues.Format (_T("%ld"), m_statisticData.m_lUniqueValue);
		m_strRepetitionFactors.Format (_T("%ld"), m_statisticData.m_lRepetitionFlag);
		UpdateData (FALSE);
		m_bExecuted = TRUE;
	}
	catch (CMemoryException* e)
	{
		VDBA_OutOfMemoryMessage();
		e->Delete();
	}
	catch (...)
	{
		//CString strMsg = _T("Internal error: cannot display the statistic of the table.");
		AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE));
	}
	EnableButtons();
	return 0L;
}