void TwitterAuthSelectDialog::ShowCurrentStatus( bool rescan /* = FALSE */ )
{
    CButton *bp = (CButton *)GetDlgItem( IDC_BUTTON_GET_TOKEN );
    bp->EnableWindow( m_useOAuth );

    bp = (CButton *)GetDlgItem( IDC_RADIO_OAUTH );
    bp->SetCheck( m_useOAuth ? 1 : 0 );

    bp = (CButton *)GetDlgItem( IDC_RADIO_BASIC );
    bp->SetCheck( m_useBASIC ? 1 : 0 );

    CString status;
    CStatic *sp = (CStatic *)GetDlgItem( IDC_TOKEN_STATUS );
    if ( (m_oauthToken.GetLength()       > 0) &&
         (m_oauthTokenSecret.GetLength() > 0)    )
	    status.LoadString( IDS_ACCESSTOKEN_ACQUIRED );
    else
	    status.LoadString( IDS_ACCESSTOKEN_UNTAKEN );
    sp->SetWindowText( status );

    CEdit   *p = (CEdit *)GetDlgItem(IDC_EDIT_USERNAME);
    if ( rescan )
        p->GetWindowText( m_username );
    p->SetWindowText( m_username );
    p->EnableWindow( m_useBASIC );

    p = (CEdit *)GetDlgItem(IDC_EDIT_PASSWORD);
    if ( rescan )
        p->GetWindowText( m_password );
    p->SetWindowText( m_password );
    p->EnableWindow( m_useBASIC );
}
Esempio n. 2
0
void WFXEdit::RefreshDialog()
{
  CEdit *chkctrl;

  SetWindowText("Edit wave effect: "+itemname);
  chkctrl = (CEdit *) GetDlgItem(IDC_VOLUME);  
  chkctrl->EnableWindow(!!(the_wfx.header.flags&WFX_VOLUME));
  chkctrl = (CEdit *) GetDlgItem(IDC_FREQUENCY);  
  chkctrl->EnableWindow(!!(the_wfx.header.flags&WFX_FREQUENCY));
  chkctrl = (CEdit *) GetDlgItem(IDC_RADIUS);  
  chkctrl->EnableWindow(!!(the_wfx.header.flags&WFX_SRCURVE));
}
Esempio n. 3
0
void CVNOCLoginDlg::_SetVerifyState( BOOL bVerifying )
{
	m_bVerifying = bVerifying;
	CEdit* pEditun = (CEdit*)GetDlgItem(IDC_LoginDlg_EDIT_USERNAME);	ATLASSERT(pEditun);
	CEdit* pEditpw = (CEdit*)GetDlgItem(IDC_LoginDlg_EDIT_PWD);			ATLASSERT(pEditpw);
	CButton* pBtnrp = (CButton*)GetDlgItem(IDC_LoginDlg_CHECKBOX_R);		ATLASSERT(pBtnrp);
	CButton* pBtnLogin = (CButton*)GetDlgItem(IDOK);						ATLASSERT(pBtnLogin);

	pEditun->EnableWindow(!bVerifying);
	pEditpw->EnableWindow(!bVerifying);
	pBtnrp->EnableWindow(!bVerifying);
	pBtnLogin->EnableWindow(!bVerifying);
}
Esempio n. 4
0
void CRasterPropShowPage::OnBnClickedCheckSet()
{
	CButton* pCheck =(CButton*)GetDlgItem(IDC_CHECK_SET);

	CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT_INVALIDVAL);

	if(BST_UNCHECKED == pCheck->GetCheck())
	{
		pEdit->EnableWindow(false);		                              
	}
	else
		pEdit->EnableWindow(true);

	UpdateChannelStaticInfo(m_comboBand.GetCurSel()+1);
}
Esempio n. 5
0
BOOL CxDlgVirtualNodeLogin::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CButton* pButtonPrivate = (CButton*)GetDlgItem (IDC_MFC_CHECK1);
	pButtonPrivate->EnableWindow (m_bEnableCheck);
	m_cOK.EnableWindow (FALSE);    

	if (m_bAlter)
	{
		CString strTitle;
#ifdef	EDBC
		if (!strTitle.LoadString (IDS_ALTER_SERVERLOGIN_TITLE))
			strTitle = _T("Alter the Definition of Server");
#else
		if (!strTitle.LoadString (IDS_ALTER_NODELOGIN_TITLE))
			strTitle = _T("Alter the Definition of Virtual Node");
#endif
		CEdit* pEdit = (CEdit*)GetDlgItem (IDC_MFC_EDIT1);
		pEdit->SetReadOnly();
		pEdit->EnableWindow (FALSE);
		SetWindowText (strTitle);
		   m_strOldVNodeName    = m_strVNodeName;
		m_strOldUserName        = m_strUserName;
		m_strOldPassword        = _T("");
		m_strOldConfirmPassword = _T("");
		m_bOldPrivate           = m_bPrivate;
		CEdit* pEdit2 = (CEdit*)GetDlgItem (IDC_MFC_EDIT2);
		pEdit2->SetFocus();
		pEdit2->SetSel (0, -1);
		OnKillfocusPassword();
		return FALSE;
	}
	return TRUE;  // return TRUE unless you set the focus to a control
				  // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 6
0
BOOL PropCodepage::OnInitDialog() 
{
	theApp.TranslateDialog(m_hWnd);
	CPropertyPage::OnInitDialog();
	
	CEdit * pEdit = (CEdit *) GetDlgItem(IDC_CUSTOM_CP_NUMBER);

	// Enable/disable "Custom codepage" edit field
	if (IsDlgButtonChecked(IDC_CP_CUSTOM))
		pEdit->EnableWindow(TRUE);
	else
		pEdit->EnableWindow(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 7
0
BOOL
COptions4Page::OnInitDialog() 
{
    CEdit *pEditOutput = (CEdit *)GetDlgItem(IDC_EDIT_OUTPUT_LOG);
    CEdit *pEditError = (CEdit *)GetDlgItem(IDC_EDIT_ERROR_LOG);
    CEdit *pEditOptions = (CEdit *)GetDlgItem(IDC_EDIT_OPTIONS_LOG);
    CEdit *pEditSQL = (CEdit *)GetDlgItem(IDC_EDIT_SQL_COPY);
    CButton *pButtonOutput = (CButton *)GetDlgItem(IDC_BUTTON_OUTFILE);
    CButton *pButtonError = (CButton *)GetDlgItem(IDC_BUTTON_ERRFILE);
    CButton *pButtonOptions = (CButton *)GetDlgItem(IDC_BUTTON_OPTFILE);
    CButton *pButtonSQL = (CButton *)GetDlgItem(IDC_BUTTON_SQLFILE);

    Message.LoadString(IDS_OPTIONS4_HEADING);
    SetDlgItemText(IDC_OPTIONS4_HEADING, Message);
    Message.LoadString(IDS_CHECK_OUTFILE);
    SetDlgItemText(IDC_CHECK_OUTFILE, Message);
    Message.LoadString(IDS_CHECK_ERRFILE);
    SetDlgItemText(IDC_CHECK_ERRFILE, Message);
    Message.LoadString(IDS_CHECK_OPTFILE);
    SetDlgItemText(IDC_CHECK_OPTFILE, Message);
    Message.LoadString(IDS_CHECK_SQLFILE);
    SetDlgItemText(IDC_CHECK_SQLFILE, Message);
    Message.LoadString(IDS_BUTTON_OUTFILE);
    SetDlgItemText(IDC_BUTTON_OUTFILE, Message);
    Message.LoadString(IDS_BUTTON_ERRFILE2);
    SetDlgItemText(IDC_BUTTON_ERRFILE, Message);
    Message.LoadString(IDS_BUTTON_OPTFILE);
    SetDlgItemText(IDC_BUTTON_OPTFILE, Message);
    Message.LoadString(IDS_BUTTON_SQLFILE);
    SetDlgItemText(IDC_BUTTON_SQLFILE, Message);

    pEditOutput->EnableWindow(FALSE);
    pEditError->EnableWindow(FALSE);
    pEditOptions->EnableWindow(FALSE);
    pEditSQL->EnableWindow(FALSE);
    pButtonOutput->EnableWindow(FALSE);
    pButtonError->EnableWindow(FALSE);
    pButtonOptions->EnableWindow(FALSE);
    pButtonSQL->EnableWindow(FALSE);

    OutputLog = ErrorLog = FALSE;

    CPropertyPage::OnInitDialog();	
	
    return TRUE;
}
void dialogEditor_dataitem::SetByteBitState(BOOL bState)
{
	CSpinButtonCtrl* pSpin = NULL;
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_SPINBYTE)) == NULL)
		return;
	pSpin->EnableWindow(bState);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_SPINBIT)) == NULL)
		return;
	pSpin->EnableWindow(bState);
	CEdit* pEdit = NULL;
	if((pEdit = (CEdit*)GetDlgItem(IDC_EDITOR_DATAITEM_BYTE)) == NULL)
		return;
	pEdit->EnableWindow(bState);
	if((pEdit = (CEdit*)GetDlgItem(IDC_EDITOR_DATAITEM_BIT)) == NULL)
		return;
	pEdit->EnableWindow(bState);
}
Esempio n. 9
0
void
COptions4Page::OnCheckSqlfile() 
{
    CButton *pCheckSQL = (CButton *)GetDlgItem(IDC_CHECK_SQLFILE);
    CEdit *pEditSQL = (CEdit *)GetDlgItem(IDC_EDIT_SQL_COPY);
    CButton *pButtonSQL = (CButton *)GetDlgItem(IDC_BUTTON_SQLFILE);

    pEditSQL->EnableWindow(pCheckSQL->GetCheck());
    pButtonSQL->EnableWindow(pCheckSQL->GetCheck());
}
Esempio n. 10
0
void
COptions4Page::OnCheckOptfile() 
{
    CButton *pCheckOptions = (CButton *)GetDlgItem(IDC_CHECK_OPTFILE);
    CEdit *pEditOptions = (CEdit *)GetDlgItem(IDC_EDIT_OPTIONS_LOG);
    CButton *pButtonOptions = (CButton *)GetDlgItem(IDC_BUTTON_OPTFILE);
    
    pEditOptions->EnableWindow(pCheckOptions->GetCheck());
    pButtonOptions->EnableWindow(pCheckOptions->GetCheck());
}
Esempio n. 11
0
void
COptions4Page::OnCheckErrfile() 
{
    CButton *pCheckError = (CButton *)GetDlgItem(IDC_CHECK_ERRFILE);
    CEdit *pEditError = (CEdit *)GetDlgItem(IDC_EDIT_ERROR_LOG);
    CButton *pButtonError = (CButton *)GetDlgItem(IDC_BUTTON_ERRFILE);

    pEditError->EnableWindow(pCheckError->GetCheck());
    pButtonError->EnableWindow(pCheckError->GetCheck());
    ErrorLog = pCheckError->GetCheck();
}
Esempio n. 12
0
void
COptions4Page::OnCheckOutfile() 
{
    CButton *pCheckOutput = (CButton *)GetDlgItem(IDC_CHECK_OUTFILE);
    CEdit *pEditOutput = (CEdit *)GetDlgItem(IDC_EDIT_OUTPUT_LOG);
    CButton *pButtonOutput = (CButton *)GetDlgItem(IDC_BUTTON_OUTFILE);

    pEditOutput->EnableWindow(pCheckOutput->GetCheck());
    pButtonOutput->EnableWindow(pCheckOutput->GetCheck());
    OutputLog = pCheckOutput->GetCheck();
}
void dialogEditor_dataitem::SetAddressState(BOOL bState)
{
	CEdit* pEdit = NULL;
	if((pEdit = (CEdit*)GetDlgItem(IDC_EDITOR_DATAITEM_ADDRESSHIGH)) == NULL)
		return;
	pEdit->EnableWindow(bState);
	CSpinButtonCtrl* pSpin = NULL;
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_ADDRESSHIGHSPIN)) == NULL)
		return;
	pSpin->EnableWindow(bState);
}
Esempio n. 14
0
BOOL CEdgeTab::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CButton* pButton = (CButton*)GetDlgItem(IDC_NETWORK_EDGE_CHECK);
	CComboBox* pCombo = (CComboBox*)GetDlgItem(IDC_COMBO);
	CEdit* pEdit = (CEdit*)GetDlgItem(IDC_WEIGHT_EDIT);
	pButton->EnableWindow(m_bEmptyE);
	pCombo->EnableWindow(m_bEmptyE);
	pCombo->SetCurSel(m_lpControlStruct->edgeType);
	if (m_lpControlStruct->edgeType == None) {
		pEdit->EnableWindow(FALSE);
		pButton->EnableWindow(FALSE);	
	}
	else{
		pEdit->EnableWindow(TRUE);
		pEdit->SetWindowText(m_lpControlStruct->defaultWeightOfEdge);
	}
	GetDlgItem(IDC_CAPACITY_EDIT)->EnableWindow(pButton->GetCheck() == 1);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 15
0
BOOL CChangePasDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	if (m_First)
	{
		SetWindowText("Задание начального пароля");
		CEdit *Ed = (CEdit *)GetDlgItem(IDC_PWDOLD);
		Ed->EnableWindow(false);
		Ed = (CEdit *)GetDlgItem(IDC_PWDNEW);
		Ed->SetFocus();
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 16
0
void CSchedule::OnRadioDeleteRecycle() 
{
	// TODO: Add your control notification handler code here
	
	CEdit *pEdit;
	CButton *pButton;

	m_ScheduleInfo.ulDeleteObjectType = DELETE_OBJECT_RECYCLER;

	pEdit = (CEdit *)GetDlgItem(IDC_FILE_PATH);
	pEdit->EnableWindow(FALSE);
	pButton = (CButton *)GetDlgItem(IDC_REFER);
	pButton->EnableWindow(FALSE);
	pButton = (CButton *)GetDlgItem(IDC_CHECK_LOG);
	pButton->EnableWindow(FALSE);
}
Esempio n. 17
0
LRESULT CMainDlg::OnEnableSaveCheckboxClicked(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	CButton enableSaveCheckBox = (CButton)GetDlgItem(IDC_ENABLE_SAVE_CHECKBOX);
	CEdit targetEdit = (CEdit)GetDlgItem(IDC_TARGET_EDIT);
	CButton browseButton = (CButton)GetDlgItem(IDC_BROWSE_BUTTON);
	
	bool isChecked = enableSaveCheckBox.GetCheck();
	targetEdit.EnableWindow(isChecked);
	browseButton.EnableWindow(isChecked);
	if (isChecked)
	{
		selectPath();
	} else {
		callback_handler_->SetDownloadTarget(NULL);
	}
	return 0;
}
BOOL CPropPageTargetGeneral::OnInitDialog() 
{
	CDialog::OnInitDialog();

    FillCombos();

    CheckCommChannels();

    // if properties dialog, disable name edit
    if(!m_bNewDlg)
    {
        CEdit*   pEdit = (CEdit*)GetDlgItem(IDC_PROPGEN_NAME);
        pEdit->EnableWindow(FALSE);
    }

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 19
0
BOOL CConnectionSettingsAdvanced::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
   if(m_pConnSettings->GetType() == CConnectionSettings::typeModemAOL)
      {
         CEdit    *pEditAppTitle;

         m_btnAppPath.EnableWindow(FALSE);
         pEditAppTitle = (CEdit *)  GetDlgItem(IDC_CONNECTION_APPTITLE);
         ASSERT(pEditAppTitle);
         if(pEditAppTitle)
            pEditAppTitle->EnableWindow(FALSE);
      }
   m_btnRestoreAutodial.EnableWindow(!m_bUsesDialup);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 20
0
BOOL CWSPrintDialog::OnInitDialog()
{
	bool bShowPrintRedlineOptions = Workshare::OptionApi::GetBool( L"ShowPrintRedlineOptions");
	CButton *pButton;
	pButton = (CButton*)GetDlgItem(IDC_CHECK_BW);
	if( bShowPrintRedlineOptions)
	{
		pButton->SetCheck(m_bBlackAndWhite);
	}
	else
	{
		pButton->ShowWindow( SW_HIDE);
	}

	pButton = (CButton*)GetDlgItem(IDC_CHECK_CHANGES);
	if( bShowPrintRedlineOptions)
	{
		pButton->SetCheck(m_bChangesOnly);
	}
	else
	{
		pButton->ShowWindow(SW_HIDE);
	}

	// resize the control to 3 times the width
	CRect rcIcon;
	GetDlgItem(1086)->GetWindowRect(rcIcon);

	GetDlgItem(1086)->SetWindowPos(&wndTop, 0, 0, 2+rcIcon.Width()*3, 2+rcIcon.Height(), SWP_NOMOVE);

	CEdit *pEdit = (CEdit *)GetDlgItem(1154);
	pEdit->EnableWindow(TRUE);	

	CButton *pCheck = (CButton *)GetDlgItem( 1041 );
	m_bCollate = pCheck->GetCheck();

	CButton *pCheckPrintToFile = (CButton *)GetDlgItem( 1040 );
	pCheckPrintToFile->SetCheck(FALSE);

	return TRUE;
}
Esempio n. 21
0
void CModifyDlg::CreateCtrl()
{
	CRect rcClient;
	GetClientRect(&rcClient);
	int top = rcClient.top + TOPINCREMENT;
	int Left = rcClient.left + LEFTINCREMENT;
	CRect CTRRECT;

	if (PUBLIC == m_tableType || INCODE == m_tableType){
		for (int i = 0;i < m_vHead.size();i++){
			CStatic *Static = new CStatic;
			CTRRECT = SetCtrlPos(Left,top,88,CTRLHEIGHT);
			Static->Create(m_vHead[i],WS_CHILD|WS_VISIBLE,CTRRECT,this);
			Static->SetFont(GetFont());
			Left += 88 + HINCREMENT;
			CEdit *Edit = new CEdit;
			CTRRECT = SetCtrlPos(Left,top - 3,380,EDITHEIGHT);
			Edit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER|ES_MULTILINE|ES_AUTOVSCROLL,CTRRECT,this,IDC_MODIFY_EDIT);
			Edit->SetFont(GetFont());
			Edit->SetWindowText(m_vData[i]);
			top += VINCREMENT + CTRLHEIGHT ;
			Left = rcClient.left + LEFTINCREMENT;

			if (i == 0){
				Static->EnableWindow(FALSE);
				Edit->EnableWindow(FALSE);
			}
			if (i == m_vHead.size()-1 && INCODE == m_tableType)
			{
				CStatic *Static1 = new CStatic;
				CTRRECT = SetCtrlPos(Left,top,450,CTRLHEIGHT);
				Static1->Create("调度规则 1:最大空闲时间调度 2:最短会话时间调度 3:最高优先级调度",WS_CHILD|WS_VISIBLE,CTRRECT,this);
				Static1->SetFont(GetFont());
				m_StaticObject.push_back(Static1);
			}
			m_StaticObject.push_back(Static);
			m_EidtObject.push_back(Edit);
		}
	}
	if (TP == m_tableType) SetTPRuleCtrl();
}
Esempio n. 22
0
BOOL CxDlgVirtualNodeData::OnInitDialog() 
{
	CDialog::OnInitDialog();
	InitProtocol();
	if (!m_strProtocol.IsEmpty())
	{
		int idx = m_cCombo1.FindStringExact (-1, m_strProtocol);
		if (idx != CB_ERR)
			m_cCombo1.SetCurSel (idx);
	}

	m_cOK.EnableWindow (FALSE);
	if (m_bAlter)
	{
		CString strTitle;
#ifdef	EDBC
		if (!strTitle.LoadString (IDS_ALTER_SERVERDATA_TITLE))
			strTitle = _T("Alter the Definition of Server");
#else
		if (!strTitle.LoadString (IDS_ALTER_NODEDATA_TITLE))
			strTitle = _T("Alter the Definition of Virtual Node");
#endif
		CEdit* pEdit = (CEdit*)GetDlgItem (IDC_MFC_EDIT1);
		pEdit->SetReadOnly();
		pEdit->EnableWindow (FALSE);
		SetWindowText (strTitle);

		m_strOldVNodeName       = m_strVNodeName;
		m_strOldRemoteAddress   = m_strRemoteAddress;
		m_strOldListenAddress   = m_strListenAddress;
		m_bOldPrivate           = m_bPrivate;
		m_strOldProtocol        = m_strProtocol;
		CEdit* pEdit2 = (CEdit*)GetDlgItem (IDC_MFC_EDIT2);
		pEdit2->SetFocus();
		pEdit2->SetSel (0, -1);
		return FALSE;
	}
	return TRUE;  // return TRUE unless you set the focus to a control
				  // EXCEPTION: OCX Property Pages should return FALSE    
}
Esempio n. 23
0
/*
** COptions4Page message handlers
*/
BOOL
COptions4Page::OnSetActive() 
{
    CButton *pCheckSQL = (CButton *)GetDlgItem(IDC_CHECK_SQLFILE);
    CEdit *pEditSQL = (CEdit *)GetDlgItem(IDC_EDIT_SQL_COPY);
    CButton *pButtonSQL = (CButton *)GetDlgItem(IDC_BUTTON_SQLFILE);

    m_propertysheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);

    if (!FFFLAG && !OFFLAG)
    {
	pCheckSQL->SetCheck(FALSE);
	pCheckSQL->EnableWindow(FALSE);
	pEditSQL->EnableWindow(FALSE);
	pButtonSQL->EnableWindow(FALSE);
    }
    else
    {
	pCheckSQL->EnableWindow(TRUE);
    }

    return CPropertyPage::OnSetActive();
}
void CProcessingOptions::OnClickedRadioLikelihood()
{
	CEdit * ctrlEditCoverage = reinterpret_cast<CEdit *> (GetDlgItem(IDC_PERCENT_COVERAGE));
	ctrlEditCoverage->EnableWindow(TRUE);
}
void CProcessingOptions::OnClickedRadioEntireImage()
{
	CEdit * ctrlEditCoverage = reinterpret_cast<CEdit *> (GetDlgItem(IDC_PERCENT_COVERAGE));
	ctrlEditCoverage->EnableWindow(FALSE);
}
Esempio n. 26
0
void CQuickParseView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CQuickParseView)
	DDX_Check(pDX, IDC_CHECKTrace, m_bTrace);
	DDX_Text(pDX, IDC_EDITInput, m_sInput);
	DDX_Text(pDX, IDC_EDITAmpleOutput, m_sOutput);
	DDX_Text(pDX, IDC_EDITTraceMorphs, m_sTraceMorphs);
	DDX_Check(pDX, IDC_CHECKManualParse, m_bManualParse);
	//}}AFX_DATA_MAP

	if(!pDX->m_bSaveAndValidate)
	{
		CEdit* pE = (	CEdit*)GetDlgItem(IDC_EDITTraceMorphs);
		if(pE)
			pE->EnableWindow(m_bTrace);
#ifndef hab218
		CButton* pB = (CButton*)GetDlgItem(IDC_CHECKManualParse);
		if (pB)
			pB->EnableWindow(m_bTrace);
		CStatic* pS = (CStatic*)GetDlgItem(IDC_STATICManualParse);
		if (pS)
			pS->EnableWindow(m_bTrace);
#endif // hab218
	}
		// i removed the button because opening a window with this text
	// will take some more work

	if(!pDX->m_bSaveAndValidate && m_pAmpleProcess)
	{
		//CWnd* pButton = GetDlgItem(IDC_Errors);
		CWnd* pMessage = GetDlgItem(IDC_ErrorStatic);
		CWnd* pMessageNoTrace = GetDlgItem(IDC_ErrorStatic2);
		CWnd* pIcon = GetDlgItem(IDC_ErrorIcon);
		CWnd* pMessageRefreshed = GetDlgItem(IDC_RefreshNotice);


		// jdh 3/14/2000
		if(m_bDidRefresh)
			pMessageRefreshed->ModifyStyle(NULL, WS_VISIBLE);
		else
			pMessageRefreshed->ModifyStyle(WS_VISIBLE,NULL);
		pMessageRefreshed->Invalidate();


		if(/*pButton &&*/ pIcon && m_pAmpleProcess->getLastRunHadError())
		{
			//pButton->ModifyStyle(NULL, WS_VISIBLE);
			pMessage->ModifyStyle(NULL, WS_VISIBLE);
			pMessage->Invalidate();
			if(!m_bTrace)
			{
				pMessageNoTrace->ModifyStyle(NULL, WS_VISIBLE);
				pMessageNoTrace->Invalidate();
			}
			else // trace is on
			{
				pMessageNoTrace->ModifyStyle(WS_VISIBLE, NULL);
				pMessageNoTrace->Invalidate();
			}

			pIcon->ModifyStyle(NULL, WS_VISIBLE);
			pIcon->Invalidate();
		}
		else if(/*pButton &&*/ pIcon)
		{
			//pButton->ModifyStyle(WS_VISIBLE, NULL);
			pMessage->ModifyStyle(WS_VISIBLE, NULL);
			pMessage->Invalidate();
			pMessageNoTrace->ModifyStyle(WS_VISIBLE, NULL);
			pMessageNoTrace->Invalidate();
			pIcon->ModifyStyle(WS_VISIBLE, NULL);
			pIcon->Invalidate();
		}
		this->Invalidate();
	}
}
Esempio n. 27
0
void CPartDlg::DoDataExchange(CDataExchange* pDX)
{
	CString name,model,obj,descr,slot;
	CString todo1 = "";
	int uid,usemask;
	int ss5,ss1,ss2,ss3,ss4;
	float s1,s2,s3,s4,*sigm;
	CString ls1,ls2,ls3,ls4,ls7;
	CString lss5,lss1,lss2,lss3,lss4;
	if (!ppart) return;
	if (!pcore) return;
	CComboBox *cbpt = (CComboBox *)CWnd::GetDlgItem(IDC_PARTTYPE);
	CComboBox *cbac = (CComboBox *)GetDlgItem(IDC_AC);
	CEdit *cename = (CEdit *)CWnd::GetDlgItem(IDC_NAME);
	CEdit *cemodel = (CEdit *)CWnd::GetDlgItem(IDC_MODEL);
	CEdit *ceicon = (CEdit *)CWnd::GetDlgItem(IDC_OBJ);
	ls1 = ""; ls2 = ""; ls3 = ""; ls4 = ""; ls7= ""; 
	lss1 = ""; lss2 = ""; lss3 = ""; lss4 = ""; lss5 = "";

	sigm = (float *)&(ppart->suk1);
	if (!pDX->m_bSaveAndValidate) // data to dialog
	{
		cbpt->ResetContent();
		if (ppart->isspec)
		{
			cbpt->AddString("Proxy");
			cbpt->SetCurSel(0);
			s1 = ppart->type; ls1 = "Launch count";
			s2 = ppart->suk2; ls2 = "Amount";

			cename->EnableWindow(FALSE);
			cemodel->EnableWindow(FALSE);
			ceicon->EnableWindow(FALSE);
			model = "";
			descr = "**** 'PROXY' PART : see name for real part ****";
			obj = "";
			name = "!!! NO MATCHING PART !!!"; 
			for (int i=0;i<pcore->cl_Counters.GetCount();i++)
			{
				PtrCoreCounter pcounter = pcore->cl_Counters.GetAt(i);
				if (pcounter->uid == ppart->usemask)
					name = pcounter->name;
			}
			for (int i=0;i<pcore->cl_Mines.GetCount();i++)
			{
				PtrCoreMine pmine = pcore->cl_Mines.GetAt(i);
				if (pmine->uid == ppart->usemask)
					name = pmine->name;
			}
			for (int i=0;i<pcore->cl_Probes.GetCount();i++)
			{
				PtrCoreProbe pprobe = pcore->cl_Probes.GetAt(i);
				if (pprobe->uid == ppart->usemask)
					name = pprobe->name;
			}
			for (int i=0;i<pcore->cl_Missiles.GetCount();i++)
			{
				PtrCoreMissile pmis = pcore->cl_Missiles.GetAt(i);
				if (pmis->uid == ppart->usemask)
					name = pmis->name;
			}
		}
		else
		{
			DDX_Text(pDX, IDC_SIGM,*sigm);
			ls7 = "Sig %";
			for (int  i=0;i<AGCEquipmentType_MAX;i++)
				cbpt->AddString(ICGPartType[i]);
			cename->EnableWindow(TRUE);
			cemodel->EnableWindow(TRUE);
			ceicon->EnableWindow(TRUE);
			name = ppart->name;
			model = ppart->model;
			descr = ppart->description;
			obj = ppart->icon;
			usemask = ppart->usemask;
			for (int i=0;i<16;i++) 
			{
				CButton *cbb = (CButton *)CWnd::GetDlgItem(IDC_USEM0+i);
				if (ppart->isspec)
				{
					cbb->EnableWindow(FALSE);
					cbb->SetCheck(BST_UNCHECKED);
				}
				else
				{
					cbb->SetCheck((ppart->usemask & (1<<i))?BST_CHECKED:BST_UNCHECKED);
					cbb->EnableWindow(TRUE);
				}
			}
			OnBnClickedUsem0();
			todo1.AppendFormat("GS1 = %g\r\n",ppart->stats_s1);
			todo1.AppendFormat("usemask = %d (%04X)\r\n",ppart->usemask,ppart->usemask);
			switch (ppart->type)
			{
				case AGCEquipmentType_Weapon:
					s1 = ppart->specs.wep.wep_stats_s1; ls1 = "Time ready";
					s2 = ppart->specs.wep.wep_stats_s2; ls2 = "Shot interval";
					s3 = ppart->specs.wep.wep_stats_s3; ls3 = "Energy consumption";
					s4 = ppart->specs.wep.wep_stats_s4; ls4 = "Particle spread";
					ss1 = ppart->specs.wep.wep_stats_ss1; lss1 = "Bullets per shot";
					ss2 = ppart->specs.wep.wep_stats_ss2; lss2 = "Activation sound";
					ss3 = ppart->specs.wep.wep_stats_ss3; lss3 = "Shoot sound";
					ss4 = ppart->specs.wep.wep_stats_ss4; lss4 = "Burst sound";
					ss5 = ppart->specs.wep.wep_projectile_uid;  lss5 = "Projectile";
					break;
				case AGCEquipmentType_Cloak:
					s1 = ppart->specs.clk.clk_stats_s1; ls1 = "Energy drain";
					s2 = ppart->specs.clk.clk_stats_s2; ls2 = "Sig reduction";
					s3 = ppart->specs.clk.clk_stats_s3; ls3 = "Activation duration";
					s4 = ppart->specs.clk.clk_stats_s4; ls4 = "Release duration";
					ss1 = ppart->specs.clk.clk_sound1; lss1 = "Sound On";
					ss2 = ppart->specs.clk.clk_sound2; lss2 = "Sound Off";
				break;
				case AGCEquipmentType_Afterburner:
					s1 = ppart->specs.aftb.aftb_stats_s1; ls1 = "Rate of consumption";
					s2 = ppart->specs.aftb.aftb_stats_s2; ls2 = "Thrust amount";
					s3 = ppart->specs.aftb.aftb_stats_s3; ls3 = "% acceleration";
					s4 = ppart->specs.aftb.aftb_stats_s4; ls4 = "Release duration";
					ss1 = ppart->specs.aftb.aftb_stats_ss1; lss1 = "Sound activate";
					ss2 = ppart->specs.aftb.aftb_stats_ss2; lss2 = "Sound desactivate";
				break;
				case AGCEquipmentType_Pack:
					ss1 = ppart->specs.pak.pak_stats_ss1; lss1 = "Type (0=Ammo,1=fuel)";
					ss2 = ppart->specs.pak.pak_stats_ss2; lss2 = "Quantity";
				break;
				case AGCEquipmentType_Shield:
					s1 = ppart->specs.shld.shld_stats_s1; ls1 = "Recharge rate";
					s2 = ppart->specs.shld.shld_stats_s2; ls2 = "Hitpoints";
					ss1 = ppart->specs.shld.shld_sound1; lss1 = "Sound activate";
					ss2 = ppart->specs.shld.shld_sound2; lss2 = "Sound desactivate";
					cbac->SetCurSel(ppart->specs.shld.shld_AC);
				break;
			}
			cbpt->SetCurSel(ppart->type);
		}
		slot = ppart->slot;
		uid = ppart->uid;
		
		todo1.AppendFormat("suk1 = %d (%04X)\r\n",ppart->suk1,ppart->suk1);
		todo1.AppendFormat("suk2 = %d (%04X)\r\n",ppart->suk2,ppart->suk2);
		char *p1 = (char *)ppart;
		char *p2 = (char *)(&(ppart->TODO[0]));
		int maxi = ppart->size-(int)(p2-p1);
		for (int i=0;i<maxi;i++)
		{
			todo1.AppendFormat("%02X ",ppart->TODO[i]);
			if (!((i+1)%16)) todo1.AppendFormat("\r\n");
		}
		todo1.AppendFormat("\r\nType = %04x\r\n",ppart->type);
		todo1.AppendFormat("\r\npad3 = %02x\r\n",ppart->pad3[0]);
		todo1.AppendFormat("\r\npad4 = %02x%02x\r\n",ppart->pad4[0],ppart->pad4[1]);
	}
	DDX_Text(pDX, IDC_NAME, name);
	DDX_Text(pDX, IDC_MODEL, model);
	DDX_Text(pDX, IDC_OBJ, obj);
	DDX_Text(pDX, IDC_SLOT, slot);
	DDX_Text(pDX, IDC_DESCRIPTION, descr);
	DDX_Text(pDX, IDC_TODO1, todo1);
	DDX_Text(pDX, IDC_UID, uid);
	DDX_Text(pDX, IDC_OVUID, ppart->overriding_uid);
	DDX_Text(pDX, IDC_SIZEOFTAG, ppart->size);
	cbac->ShowWindow(SW_HIDE);
	GetDlgItem(IDC_ACC)->ShowWindow(SW_HIDE);
	if (ppart->isspec)
	{
		CString gs1 = "N/A";
		GetDlgItem(IDC_GS1)->EnableWindow(FALSE);
		GetDlgItem(IDC_USEMASK)->EnableWindow(FALSE);
		DDX_Text(pDX, IDC_GS1, gs1);
		DDX_Text(pDX, IDC_USEMASK, gs1);
	}
	else
	{
		GetDlgItem(IDC_GS1)->EnableWindow(TRUE);
		GetDlgItem(IDC_USEMASK)->EnableWindow(TRUE);
		DDX_Text(pDX, IDC_GS1, ppart->stats_s1);
		DDX_Text(pDX, IDC_USEMASK, usemask);
		if (ppart->type == AGCEquipmentType_Shield)
		{
			cbac->ShowWindow(SW_SHOWNA);
			GetDlgItem(IDC_ACC)->ShowWindow(SW_SHOWNA);
		}
	}
	SetDlgItemText(IDC_PS1,ls1);
	SetDlgItemText(IDC_PS2,ls2);
	SetDlgItemText(IDC_PS3,ls3);
	SetDlgItemText(IDC_PS4,ls4);
	SetDlgItemText(IDC_PS7,ls7);
	SetDlgItemText(IDC_PSS1,lss1);
	SetDlgItemText(IDC_PSS2,lss2);
	SetDlgItemText(IDC_PSS3,lss3);
	SetDlgItemText(IDC_PSS4,lss4);
	SetDlgItemText(IDC_PSS5,lss5);
	GetDlgItem(IDC_S1)->ShowWindow(ls1==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_S2)->ShowWindow(ls2==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_S3)->ShowWindow(ls3==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_S4)->ShowWindow(ls4==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SIGM)->ShowWindow(ls7==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SS1)->ShowWindow(lss1==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SS2)->ShowWindow(lss2==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SS3)->ShowWindow(lss3==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SS4)->ShowWindow(lss4==""?SW_HIDE:SW_SHOWNA);
	GetDlgItem(IDC_SS5)->ShowWindow(lss5==""?SW_HIDE:SW_SHOWNA);

	DDX_Text(pDX, IDC_SS1, ss1);
	DDX_Text(pDX, IDC_SS2, ss2);
	DDX_Text(pDX, IDC_SS3, ss3);
	DDX_Text(pDX, IDC_SS4, ss4);
	DDX_Text(pDX, IDC_SS5, ss5);

	DDX_Text(pDX, IDC_S1, s1);
	DDX_Text(pDX, IDC_S2, s2);
	DDX_Text(pDX, IDC_S3, s3);
	DDX_Text(pDX, IDC_S4, s4);

	if (pDX->m_bSaveAndValidate) // dialog to data
	{
		if (!ppart->isspec)
		{
			DDX_Text(pDX, IDC_SIGM,*sigm);
			strcpy(ppart->name,name);
			strcpy(ppart->model,model);
			strcpy(ppart->icon,obj);
			strcpy(ppart->slot,slot);
			strncpy(ppart->description,descr,IGC_DESCRIPTIONMAX);
			
			// usemask
			ppart->usemask = usemask;
			ppart->usemask = 0;
			for (int i=0;i<16;i++) 
			{
				CButton *cbb = (CButton *)CWnd::GetDlgItem(IDC_USEM0+i);
				ppart->usemask += cbb->GetCheck()?(1<<i):0;
			}

			switch (ppart->type)
			{
				case AGCEquipmentType_Weapon:
					ppart->specs.wep.wep_stats_s1 = s1;
					ppart->specs.wep.wep_stats_s2 = s2;
					ppart->specs.wep.wep_stats_s3 = s3;
					ppart->specs.wep.wep_stats_s4 = s4;
					ppart->specs.wep.wep_stats_ss1 = ss1;
					ppart->specs.wep.wep_stats_ss2 = ss2;
					ppart->specs.wep.wep_stats_ss3 = ss3;
					ppart->specs.wep.wep_stats_ss4 = ss4;
					ppart->specs.wep.wep_projectile_uid = ss5;
					break;
				case AGCEquipmentType_Cloak:
					ppart->specs.clk.clk_stats_s1 = s1;
					ppart->specs.clk.clk_stats_s2 = s2;
					ppart->specs.clk.clk_stats_s3 = s3;
					ppart->specs.clk.clk_stats_s4 = s4;
					ppart->specs.clk.clk_sound1 = ss1;
					ppart->specs.clk.clk_sound2 = ss2;
				break;
				case AGCEquipmentType_Afterburner:
					ppart->specs.aftb.aftb_stats_s1 = s1;
					ppart->specs.aftb.aftb_stats_s2 = s2;
					ppart->specs.aftb.aftb_stats_s3 = s3;
					ppart->specs.aftb.aftb_stats_s4 = s4;
					ppart->specs.aftb.aftb_stats_ss1 = ss1;
					ppart->specs.aftb.aftb_stats_ss2 = ss2;
				break;
				case AGCEquipmentType_Pack:
					ppart->specs.pak.pak_stats_ss1 = ss1;
					ppart->specs.pak.pak_stats_ss2 = ss2;
				break;
				case AGCEquipmentType_Shield:
					ppart->specs.shld.shld_stats_s1 = s1;
					ppart->specs.shld.shld_stats_s2 = s2;
					ppart->specs.shld.shld_sound1 = ss1;
					ppart->specs.shld.shld_sound2 = ss2;
					//ppart->specs.shld.shld_b1 = ss3;
					ppart->specs.shld.shld_AC = cbac->GetCurSel();
				break;
			}
		}
		else
		{
			ppart->type	= (int)s1;
			ppart->suk2 = (int)s2;
		}
	}
	CDialog::DoDataExchange(pDX);
}
Esempio n. 28
0
// CFAVRMCDlg message handlers
//===========================================================================
BOOL CFAVRMCDlg::OnInitDialog()
//===========================================================================
{
	CDialogEx::OnInitDialog();

	// TODO:  Add extra initialization here
	//! @defgroup Setting groups initialization
	//! @{
	//! @{ Key Define
	CEdit* pEditKeyDef = (CEdit*)GetDlgItem(IDC_RMC_KEYDEFINE_DATA);
	pEditKeyDef->SetWindowText(_T("SN pairing"));
	//! @}

	//! @{ Command
	CComboBox* pCMDCBox = (CComboBox*)GetDlgItem(IDC_RMC_CMD_DATA);
	pCMDCBox->InsertString(0,_T("M0"));
	pCMDCBox->InsertString(1,_T("M1"));
	pCMDCBox->SetCurSel(0);
	//! @}

	//! @{ Key
	CEdit* pEditKey = (CEdit*)GetDlgItem(IDC_RMC_KEY_DATA);
	pEditKey->SetWindowText(_T("50"));
	//! @}

	//! @{ Flag
	CComboBox* pFLAGCBox = (CComboBox*)GetDlgItem(IDC_RMC_FLAG_DATA);
	pFLAGCBox->InsertString(0,_T("0: No Double Key"));
	pFLAGCBox->InsertString(1,_T("1: Flag1"));
	pFLAGCBox->InsertString(2,_T("2: Flag2"));
	pFLAGCBox->InsertString(3,_T("3: Flag1 + Flag2"));
	pFLAGCBox->InsertString(4,_T("4: Flag3"));
	pFLAGCBox->InsertString(5,_T("5: Flag1 + Flag3"));
	pFLAGCBox->InsertString(6,_T("6: Flag2 + Flag3"));
	pFLAGCBox->SetCurSel(0);
	//! @}

	//! @{ SN
	CEdit* pEditSN = (CEdit*)GetDlgItem(IDC_RMC_SN_DATA);
	pEditSN->LimitText(8);
	pEditSN->SetWindowText(_T("FFFFFFFF"));
	pEditSN->EnableWindow(FALSE);
	//! @}

	//! @{ Number of times
	CEdit* pEditTimes = (CEdit*)GetDlgItem(IDC_RMC_TIMES_DATA);
	pEditTimes->LimitText(2);
	pEditTimes->SetWindowText(_T("37"));
	//! @}
	EnableGroupboxControls(::GetDlgItem(m_hWnd, IDC_RMC_SETTINGS), FALSE);		//Close groups
	//! @}


	//! @defgroup Send Sequences groups initialization
	//! @{
	//! @{ ListCtrl
	m_ListCtrl.InsertColumn(0, "Key Define", LVCFMT_CENTER, 100);
	m_ListCtrl.InsertColumn(1, "Command", LVCFMT_CENTER, 75);
	m_ListCtrl.InsertColumn(2, "Key", LVCFMT_CENTER, 40);
	m_ListCtrl.InsertColumn(3, "Flag", LVCFMT_CENTER, 50);
	m_ListCtrl.InsertColumn(4, "SN", LVCFMT_CENTER, 80);
	m_ListCtrl.InsertColumn(5, "Times", LVCFMT_CENTER, 40);
	m_ListCtrl.SetColumnWidth(5,LVSCW_AUTOSIZE_USEHEADER);
	m_ListCtrl.SetExtendedStyle(m_ListCtrl.GetExtendedStyle()|
		LVS_EX_FULLROWSELECT|
		LVS_EX_GRIDLINES);
	// http://msdn.microsoft.com/zh-tw/magazine/cc164140(en-us).aspx
	// Fixed column width
	CHeaderCtrl* pHeaderCtrl = (CHeaderCtrl*)m_ListCtrl.GetHeaderCtrl();
	pHeaderCtrl-> EnableWindow(FALSE);
	//! @}
	//EnableGroupboxControls(::GetDlgItem(m_hWnd, IDC_RMC_SEQUENCES), FALSE);		//Close groups
	//! @}

	// Create tooltips
	m_ToolTipsRMC.Create(this, TTS_ALWAYSTIP);
	::SendMessage(m_ToolTipsRMC.m_hWnd, TTM_SETMAXTIPWIDTH, 0, SHRT_MAX);
	CString str = _T("");
	str.Format(_T("Power"));
	m_ToolTipsRMC.AddTool(GetDlgItem(IDC_RMC_DEMO_POWER), str);
	str.Format(_T("Light OFF"));
	m_ToolTipsRMC.AddTool(GetDlgItem(IDC_RMC_DEMO_BULBOFF), str);

	CRect BtnRectPower; 
	m_ButtonPower.GetWindowRect(BtnRectPower);
	ScreenToClient(BtnRectPower);
	m_ButtonPower.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectPower);
	m_ButtonPower.SetRgnStyle(0);
	m_ButtonPower.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonPower.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonPower.SetBitmapId(0, IDB_RMCDEMO_POWER_NOMAL, IDB_RMCDEMO_POWER_MOVE,
		IDB_RMCDEMO_POWER_DOWN, IDB_RMCDEMO_POWER_MOVE);

	CRect BtnRectBulbOFF; 
	m_ButtonBulbOFF.GetWindowRect(BtnRectBulbOFF);
	ScreenToClient(BtnRectBulbOFF);
	m_ButtonBulbOFF.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectBulbOFF);
	m_ButtonBulbOFF.SetRgnStyle(0);
	m_ButtonBulbOFF.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBulbOFF.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBulbOFF.SetBitmapId(1, IDB_RMCDEMO_BULBOFF_NORMAL, IDB_RMCDEMO_BULBOFF_MOVE,
		IDB_RMCDEMO_BULBOFF_DOWN, IDB_RMCDEMO_BULBOFF_MOVE);

	CRect BtnRectBulbON; 
	m_ButtonBulbON.GetWindowRect(BtnRectBulbON);
	ScreenToClient(BtnRectBulbON);
	m_ButtonBulbON.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectBulbON);
	m_ButtonBulbON.SetRgnStyle(0);
	m_ButtonBulbON.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBulbON.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBulbON.SetBitmapId(2, IDB_RMCDEMO_BULBON_NORMAL, IDB_RMCDEMO_BULBON_MOVE,
		IDB_RMCDEMO_BULBON_DOWN, IDB_RMCDEMO_BULBON_MOVE);

	CRect BtnRectBON; 
	m_ButtonBuleON.GetWindowRect(BtnRectBON);
	ScreenToClient(BtnRectBON);
	m_ButtonBuleON.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectBON);
	m_ButtonBuleON.SetRgnStyle(0);
	m_ButtonBuleON.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBuleON.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBuleON.SetBitmapId(3, IDB_RMCDEMO_BON_NORMAL, IDB_RMCDEMO_BON_MOVE,
		IDB_RMCDEMO_BON_DOWN, IDB_RMCDEMO_BON_MOVE);

	CRect BtnRectBOFF; 
	m_ButtonBuleOFF.GetWindowRect(BtnRectBOFF);
	ScreenToClient(BtnRectBOFF);
	m_ButtonBuleOFF.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectBOFF);
	m_ButtonBuleOFF.SetRgnStyle(0);
	m_ButtonBuleOFF.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBuleOFF.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonBuleOFF.SetBitmapId(4, IDB_RMCDEMO_BOFF_NOMAL, IDB_RMCDEMO_BOFF_MOVE,
		IDB_RMCDEMO_BOFF_DOWN, IDB_RMCDEMO_BOFF_MOVE);

	CRect BtnRectGON; 
	m_ButtonGreenON.GetWindowRect(BtnRectGON);
	ScreenToClient(BtnRectGON);
	m_ButtonGreenON.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectGON);
	m_ButtonGreenON.SetRgnStyle(0);
	m_ButtonGreenON.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonGreenON.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonGreenON.SetBitmapId(5, IDB_RMCDEMO_GON_NORMAL, IDB_RMCDEMO_GON_MOVE,
		IDB_RMCDEMO_GON_DOWN, IDB_RMCDEMO_GON_MOVE);

	CRect BtnRectGOFF; 
	m_ButtonGreenOFF.GetWindowRect(BtnRectGOFF);
	ScreenToClient(BtnRectGOFF);
	m_ButtonGreenOFF.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectGOFF);
	m_ButtonGreenOFF.SetRgnStyle(0);
	m_ButtonGreenOFF.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonGreenOFF.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonGreenOFF.SetBitmapId(6, IDB_RMCDEMO_GOFF_NORMAL, IDB_RMCDEMO_GOFF_MOVE,
		IDB_RMCDEMO_GOFF_DOWN, IDB_RMCDEMO_GOFF_MOVE);

	CRect BtnRectRON; 
	m_ButtonRedON.GetWindowRect(BtnRectRON);
	ScreenToClient(BtnRectRON);
	m_ButtonRedON.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectRON);
	m_ButtonRedON.SetRgnStyle(0);
	m_ButtonRedON.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonRedON.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonRedON.SetBitmapId(7, IDB_RMCDEMO_RON_NORMAL, IDB_RMCDEMO_RON_MOVE,
		IDB_RMCDEMO_RON_DOWN, IDB_RMCDEMO_RON_MOVE);

	CRect BtnRectROFF; 
	m_ButtonRedOFF.GetWindowRect(BtnRectROFF);
	ScreenToClient(BtnRectROFF);
	m_ButtonRedOFF.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectROFF);
	m_ButtonRedOFF.SetRgnStyle(0);
	m_ButtonRedOFF.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonRedOFF.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonRedOFF.SetBitmapId(8, IDB_RMCDEMO_ROFF_NORMAL, IDB_RMCDEMO_ROFF_MOVE,
		IDB_RMCDEMO_ROFF_DOWN, IDB_RMCDEMO_ROFF_MOVE);

	CRect BtnRectPair; 
	m_ButtonPair.GetWindowRect(BtnRectPair);
	ScreenToClient(BtnRectPair);
	m_ButtonPair.SetBackBmp(IDB_RMCDEMO_BK1, BtnRectPair);
	m_ButtonPair.SetRgnStyle(0);
	m_ButtonPair.SetRgnMask(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonPair.SetMaskBitmapId(IDB_RMCDEMO_MASK, TRUE);
	m_ButtonPair.SetBitmapId(9, IDB_RMCDEMO_PAIR_NORMAL, IDB_RMCDEMO_PAIR_MOVE,
		IDB_RMCDEMO_PAIR_DOWN, IDB_RMCDEMO_PAIR_MOVE);



	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}