?? queryctlbar.cpp
字號:
// QueryCtlBar.cpp : 實現文件
//
#include "stdafx.h"
#include "QueryTerminal.h"
#include "QueryCtlBar.h"
#include ".\queryctlbar.h"
// CQueryCtlBar 對話框
IMPLEMENT_DYNAMIC(CQueryCtlBar, CDialogBar)
CQueryCtlBar::CQueryCtlBar()
{
}
CQueryCtlBar::~CQueryCtlBar()
{
}
void CQueryCtlBar::DoDataExchange(CDataExchange* pDX)
{
CDialogBar::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CQueryCtlBar, CDialogBar)
ON_BN_CLICKED(IDC_CHECK_STN, OnBnClickedCheckStn)
ON_BN_CLICKED(IDC_CHECK_TRAIN, OnBnClickedCheckTrain)
END_MESSAGE_MAP()
void CQueryCtlBar::AddComboData(CString str)
{
if(str.IsEmpty()) return;
((CComboBox *)GetDlgItem(IDC_COMBO_STN))->AddString(str);
}
void CQueryCtlBar::RemoveAllComboData(void)
{
((CComboBox *)GetDlgItem(IDC_COMBO_STN))->ResetContent();
}
void CQueryCtlBar::SetComboCursel(int nIndex)
{
CComboBox * pCombo = (CComboBox *)GetDlgItem(IDC_COMBO_STN);
if(pCombo->GetCount() > 0)
pCombo->SetCurSel(0);
}
CString CQueryCtlBar::GetComboCurSelText(void)
{
CString str = "";
CComboBox * pCombo = (CComboBox *)GetDlgItem(IDC_COMBO_STN);
if(pCombo->GetCount() > 0)
{
int nIndex = pCombo->GetCurSel();
pCombo->GetLBText(nIndex,str);
}
return str;
}
void CQueryCtlBar::GetEditBoxText(CString& strText)
{
strText = "";
((CEdit *)GetDlgItem(IDC_EDIT_TRAIN))->GetWindowText(strText);
}
bool CQueryCtlBar::GetStnCheckStatus(void)
{
int nStatus = ((CButton *)GetDlgItem(IDC_CHECK_STN))->GetCheck();
bool bRtn = false;
switch(nStatus)
{
case 0:
break;
case 1:
bRtn = true;
break;
default:
break;
}
return bRtn;
}
bool CQueryCtlBar::GetTrainCheckStatus(void)
{
int nStatus = ((CButton *)GetDlgItem(IDC_CHECK_TRAIN))->GetCheck();
bool bRtn = false;
switch(nStatus)
{
case 0:
break;
case 1:
bRtn = true;
break;
default:
break;
}
return bRtn;
}
void CQueryCtlBar::OnBnClickedCheckStn()
{
CComboBox * pCombo = (CComboBox *)GetDlgItem(IDC_COMBO_STN);
if(GetStnCheckStatus())
{
pCombo->EnableWindow();
}
else
{
pCombo->EnableWindow(FALSE);
}
}
void CQueryCtlBar::OnBnClickedCheckTrain()
{
CEdit* pEdit = (CEdit *)GetDlgItem(IDC_EDIT_TRAIN);
if(GetTrainCheckStatus())
{
pEdit->EnableWindow();
}
else
{
pEdit->EnableWindow(FALSE);
}
}
void CQueryCtlBar::SetRetBtnVisible(bool bFlag)
{
if(bFlag)
((CButton *)GetDlgItem(IDC_BTN_RTN_SHOW))->ShowWindow(SW_SHOW);
else
((CButton *)GetDlgItem(IDC_BTN_RTN_SHOW))->ShowWindow(SW_HIDE);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -