Esempio n. 1
0
void TwoFilePanesWnd::ShowLeftPane(bool show)
{
    EnableCtrl(&pImpl_->left_, show);

    Invalidate();
    pImpl_->Resize(this);
}
Esempio n. 2
0
//----------------------------------------
void CUnitFieldDlg::Init()
{
  bool isFieldNetCdfCFAttr = (CFieldNetCdfCFAttr::GetFieldNetCdfCFAttr(m_field, false) != NULL);

  if (!isFieldNetCdfCFAttr)
  {
    EnableCtrl();
    return;
  }

  GetUnitfieldField()->SetValue(m_field->GetName().c_str());
  GetUnitfieldActualunit()->SetValue(m_field->GetUnit().c_str());

  EnableCtrl();

}
Esempio n. 3
0
void 
DestinationDlg::CheckControls()
{
  bool ok = !m_comboDestination->GetValue().IsEmpty();

  EnableCtrl(m_buttonOK, ok);
}
Esempio n. 4
0
//----------------------------------------
void CEndedPanel::LoadTasks()
{
  wxLogInfo("Loading ended tasks...");
  
  ClearTaskList();
  
  GetListEnded()->InsertTasks(CSchedulerTaskConfig::GetInstance()->GetMapEndedBratTask());
  
  wxLogInfo("%d ended task(s) loaded.",  GetListEnded()->GetItemCount());


  EnableCtrl();

}
Esempio n. 5
0
void CDlgDialbox::OnBnClickedDialboxConnect()
{
	CString sComPort = "";
	const int iItem = m_ComPort.GetCurSel();
	if (iItem < 0) return;
	m_ComPort.GetLBText(iItem, sComPort);
	if (sComPort.IsEmpty()) return;
	int err = OpenDialboxBluetoothSPP("\\\\.\\" + sComPort.SpanExcluding(" "));
	if (err) {
		AfxMessageBox( 
			"Error on connecting the device.\r\n1. Is the selected device placed near your PC? Is it turned on?\r\n"
			"2. If this error repeatedly occurs even when the correct device is selected, "
			"go to the Bluetooth config window and remove the device and do pairing again."
		);
	}
	EnableCtrl();
}
Esempio n. 6
0
void CDlgBlockAnalysis::OnBeginAnalyse() 
{
	int			iCurTab = m_Tab_Ctrl.GetCurSel();
	TYPEANDBLOCK *pBlock = m_TypeAndBlock->m_ayBlockCalc.GetAt(iCurTab);

//	this->EnableWindow(FALSE);
	if( m_AryListColHandName.GetSize() <= 2 )
	{
		//AfxMessageBox(_T("请增加项目(列)再开始计算!"));
		MessageBox(_T("请增加项目(列)再开始计算!"), _T("提示..."),MB_ICONINFORMATION);
		return;
	}
	if( pBlock->ayBlock.GetSize() <= 0 )
	{
		return;
	}
	EnableCtrl(FALSE);
	::SendMessage(g_hParentWnd, HX_USER_COMPILEDATA, 11, (LPARAM)iCurTab);
	CArray<StockUserInfo*,StockUserInfo*>*	payStock = &pBlock->ayCalcStock;
	TabStockSortData*						pIndex = m_ayStockIndex.GetAt(iCurTab);
	BuildStockIndex(payStock, pIndex);
	//EnableCtrl(TRUE);
}
Esempio n. 7
0
void CDlgDialbox::OnBnClickedDialboxDisconnect()
{
	CloseDialboxBluetoothSPP(30);
	EnableCtrl();
}
Esempio n. 8
0
BOOL CDlgDialbox::OnInitDialog()
{
	CDialog::OnInitDialog();

	sComPortList = EnumComPort();
	bool bSelected = false;
	if (!sComPortList.IsEmpty()) {
		int ipos = 0;
		CString sPortName = sComPortList.Tokenize(_T("\r"), ipos);
		while (!sPortName.IsEmpty()) {
			CString sDeviceName = sComPortList.Tokenize(_T("\r"), ipos);
			int iItem = m_ComPort.AddString(sPortName + " (" + sDeviceName + ")");
			if (!bSelected) {
				if (sCommConnected.IsEmpty()) {
					if (sDeviceName.Find(BLUETOOTH_DEVICENAME_KEY) >= 0) {
						m_ComPort.SetCurSel(iItem);
						bSelected = true;
					}
				} else if (sCommConnected == sPortName) {
					m_ComPort.SetCurSel(iItem);
					bSelected = true;
				}
			}
			sPortName = sComPortList.Tokenize(_T("\r"), ipos);
		}
		if (!bSelected) m_ComPort.SetCurSel(0);
	}

	CString sAction[(DIALBOX_NACTION > DIALBOX_NBUTTONACTION) ? DIALBOX_NACTION : DIALBOX_NBUTTONACTION];
	sAction[DIALBOX_SCROLLX] = DIALBOX_SCROLLX_STR;//=0
	sAction[DIALBOX_SCROLLY] = DIALBOX_SCROLLY_STR;
	sAction[DIALBOX_MAG] = DIALBOX_MAG_STR;
	sAction[DIALBOX_FRAME] = DIALBOX_FRAME_STR;
	sAction[DIALBOX_FRAMEFAST] = DIALBOX_FRAMEFAST_STR;
	sAction[DIALBOX_CONTRAST] = DIALBOX_CONTRAST_STR;
	sAction[DIALBOX_BRIGHTNESS] = DIALBOX_BRIGHTNESS_STR;
	sAction[DIALBOX_NOACTION] = DIALBOX_NOACTION_STR;//=7
	for (int i=0; i<DIALBOX_NDIALS; i++) {
		for (int j=0; j<DIALBOX_NACTION; j++) {
			int iItem = m_cmbDialAction[i].AddString(sAction[j]);
			m_cmbDialAction[i].SetItemData(iItem, j);
			if (m_ucDialAction[i] == j) m_cmbDialAction[i].SetCurSel(iItem);
		}
	}

	sAction[DIALBOX_OPENQUEUE] = DIALBOX_OPENQUEUE_STR;
	sAction[DIALBOX_NOBUTTONACTION] = DIALBOX_NOBUTTONACTION_STR;
	for (int i=0; i<DIALBOX_NBUTTONS; i++) {
		for (int j=0; j<DIALBOX_NBUTTONACTION; j++) {
			int iItem = m_cmbButtonAction[i].AddString(sAction[j]);
			m_cmbButtonAction[i].SetItemData(iItem, j);
			if (m_ucButtonAction[i] == j) m_cmbButtonAction[i].SetCurSel(iItem);
		}
	}

	SetDlgItemText(IDC_DIALBOX_RX, "0");
	ciDialbox.hViewWnd = this->m_hWnd;
	EnableCtrl();
	return TRUE;	// return TRUE unless you set the focus to a control
	// 例外 : OCX プロパティ ページは必ず FALSE を返します。
}
Esempio n. 9
0
long CDlgBlockAnalysis::GetBlockStockEventPress(WPARAM wp,LPARAM lp)
{
	if(wp == 0)		//得到初始页--也就是第0页的所有股票
	{
		m_TypeAndBlock = (BlockTabInitData *)lp;

		CArray<TYPEANDBLOCK*, TYPEANDBLOCK*>	*payType = &m_TypeAndBlock->m_ayBlockCalc;
		TYPEANDBLOCK	*pType;
		CArray<BlockInfo*, BlockInfo*>	*payBlock;
		BlockInfo	*pBlock;
		ListDrowData	*pList;
		LineDrowData	*pLine;
		int				iEnd = payType->GetSize();
		int				jEnd;
		int				iColLen = m_AryListColHandName.GetSize();

		pList = new ListDrowData;
		pList->iDrowNum = 2;
		pType = payType->GetAt(0);

		jEnd = pType->ayBlock.GetSize();
		payBlock = &pType->ayBlock;

		if( m_bClickFlag.GetSize() > 0 )
			m_bClickFlag.RemoveAll();
		TabStockSortData* pIndex;
		for(int i = 0; i < iEnd; i++)
		{
			m_bClickFlag.Add(FALSE);
			pIndex = new TabStockSortData;
			m_ayStockIndex.Add(pIndex);
		}
		for(int j = 0; j < jEnd; j++)
		{
			pBlock = payBlock->GetAt(j);
			pLine = new LineDrowData;
			pLine->strLineName = pBlock->strBlockName;
			pLine->ayLine.SetSize(iColLen - 1);
			pLine->ayLine.SetAt(0, pBlock->ayStockList.GetSize());
			pList->ayList.Add(pLine);
		}
		m_ayDrowData.Add(pList);
		for( int i = 1; i < iEnd; i++ )
		{
			pList = new ListDrowData;
			m_ayDrowData.Add(pList);
		}
		EnableCtrl(TRUE);
		return 0;
	}
	else if( wp == 1 )		//本地统计开始
	{
		int	iCurTab = (int)lp;
		ComputeListData(iCurTab);
		ReDrowListData(iCurTab);
		EnableCtrl(TRUE);
	}
	else if( wp == 2 )		//返回当前Tab的所有板块的股票
	{
		int nCurTab = (int)lp;

		CArray<TYPEANDBLOCK*, TYPEANDBLOCK*>	*payType = &m_TypeAndBlock->m_ayBlockCalc;
		TYPEANDBLOCK	*pType;
		CArray<BlockInfo*, BlockInfo*>	*payBlock;
		BlockInfo	*pBlock;
		ListDrowData	*pList;
		LineDrowData	*pLine;
		int				jEnd;
		int				iColLen = m_AryListColHandName.GetSize();

		pList = m_ayDrowData.GetAt(nCurTab);
		pList->iDrowNum = 2;
		pType = payType->GetAt(nCurTab);

		jEnd = pType->ayBlock.GetSize();
		payBlock = &pType->ayBlock;

		for(int j = 0; j < jEnd; j++)
		{
			pBlock = payBlock->GetAt(j);
			pLine = new LineDrowData;
			pLine->strLineName = pBlock->strBlockName;
			pLine->ayLine.SetSize(iColLen - 1);
			pLine->ayLine.SetAt(0, pBlock->ayStockList.GetSize());
			pList->ayList.Add(pLine);
		}
		m_ayDrowData.SetAt(nCurTab, pList);
		//EnableCtrl(TRUE);
		return 0;
	}
	else if( wp == 3 )		//中止运行时,使窗体及按钮有效
	{
		if( !m_begin.IsWindowEnabled() )
			EnableCtrl(TRUE);
	}
	else if( wp == 10 )			//从handcol得到当前列
	{
		m_iCurHandlerNum = (int)lp;
	}
	return 0;
}