예제 #1
0
BOOL CRangeRenderPage::OnInitDialog()
{
	CDialog::OnInitDialog();

	
	Init();

	CSpinButtonCtrl	* pSpinTolerance = NULL;
	pSpinTolerance = (CSpinButtonCtrl *)GetDlgItem(IDC_RANGE_NUM_SPIN);
	if (pSpinTolerance)
		pSpinTolerance->SetRange(0, 1000);

	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
예제 #2
0
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);
}
예제 #3
0
void ExtFrame::IncrementSpin(CSpinButtonCtrl& spin, CEdit& edit, unsigned int val)
{
    char num[33];
    _ultoa_s(val, num, sizeof(num), 10);
    spin.SetPos(val);
    edit.SetWindowText(num);
    ScrollEnd(edit);
}   
예제 #4
0
void CInstrumentEditorDPCM::OnNMClickTable(NMHDR *pNMHDR, LRESULT *pResult)
{
	CSpinButtonCtrl *pSpinButton;
	CComboBox *pSampleBox, *pPitchBox;
	CEdit *pDeltaValue;
	CString Text;

	m_pTableListCtrl	= reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_TABLE));
	m_iSelectedKey		= m_pTableListCtrl->GetSelectionMark();

	int Sample			= m_pInstrument->GetSample(m_iOctave, m_iSelectedKey) - 1;
	int Pitch			= m_pInstrument->GetSamplePitch(m_iOctave, m_iSelectedKey);
	int Delta			= m_pInstrument->GetSampleDeltaValue(m_iOctave, m_iSelectedKey);

	m_pTableListCtrl	= static_cast<CListCtrl*>(GetDlgItem(IDC_TABLE));
	pSampleBox			= static_cast<CComboBox*>(GetDlgItem(IDC_SAMPLES));
	pPitchBox			= static_cast<CComboBox*>(GetDlgItem(IDC_PITCH));
	pDeltaValue			= static_cast<CEdit*>(GetDlgItem(IDC_DELTA_COUNTER));
	pSpinButton			= static_cast<CSpinButtonCtrl*>(GetDlgItem(IDC_DELTA_SPIN));

	Text.Format(_T("%02i - %s"), Sample, (LPCTSTR)m_pTableListCtrl->GetItemText(m_pTableListCtrl->GetSelectionMark(), 2));

	if (Sample != -1)
		pSampleBox->SelectString(0, Text);
	else
		pSampleBox->SetCurSel(0);
	
	if (Sample >= 0) {
		pPitchBox->SetCurSel(Pitch & 0x0F);

		if (Pitch & 0x80)
			CheckDlgButton(IDC_LOOP, 1);
		else
			CheckDlgButton(IDC_LOOP, 0);

		if (Delta == -1)
			pDeltaValue->SetWindowText(_T("Off"));
		else
			SetDlgItemInt(IDC_DELTA_COUNTER, Delta, FALSE);

		pSpinButton->SetPos(Delta);
	}

	*pResult = 0;
}
예제 #5
0
void CInstrumentEditorN163Wave::SelectInstrument(int Instrument)
{
	m_pInstrument = (CInstrumentN163*)GetDocument()->GetInstrument(Instrument);

	CComboBox *pSizeBox = (CComboBox*)GetDlgItem(IDC_WAVE_SIZE);
	CComboBox *pPosBox = (CComboBox*)GetDlgItem(IDC_WAVE_POS);

	CString SizeStr;
	SizeStr.Format(_T("%i"), m_pInstrument->GetWaveSize());
	pSizeBox->SelectString(0, SizeStr);

	FillPosBox(m_pInstrument->GetWaveSize());

	CString PosStr;
	PosStr.Format(_T("%i"), m_pInstrument->GetWavePos());
	pPosBox->SetWindowText(PosStr);

	/*
	if (m_pInstrument->GetAutoWavePos()) {
		CheckDlgButton(IDC_POSITION, 1);
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(FALSE);
	}
	else {
		CheckDlgButton(IDC_POSITION, 0);
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(TRUE);
	}
	*/

	if (m_pWaveEditor) {
		m_pWaveEditor->SetInstrument(m_pInstrument);
		m_pWaveEditor->SetLength(m_pInstrument->GetWaveSize());
	}

	CSpinButtonCtrl *pIndexSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_INDEX_SPIN);
	CSpinButtonCtrl *pWavesSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_WAVES_SPIN);

	int WaveCount = m_pInstrument->GetWaveCount();

	pIndexSpin->SetRange(0, WaveCount - 1);
	pIndexSpin->SetPos(0);
	pWavesSpin->SetPos(WaveCount - 1);

	m_iWaveIndex = 0;
}
예제 #6
0
BOOL COptionsMisc::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  for (int i = 0; i < 2; i++) {
    m_chkbox[i].SetTextColour(CR_DATABASE_OPTIONS);
    m_chkbox[i].ResetBkgColour();//Use current window's background
  }

  OnUseDefUser();

  // For some reason, MFC calls us twice when initializing.
  // Populate the combo box only once.
  if (m_dblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_dblclk_cbox);
  }

  if (m_shiftdblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_shiftdblclk_cbox);
  }

  m_dblclk_cbox.SetCurSel(m_DCA_to_Index[m_DoubleClickAction]);
  m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[m_ShiftDoubleClickAction]);

  GetDlgItem(IDC_OTHERBROWSERLOCATION)->SetWindowText(m_OtherBrowserLocation);
  GetDlgItem(IDC_OTHEREDITORLOCATION)->SetWindowText(m_OtherEditorLocation);

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_DADSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_DB_DEF_AUTOTYPE_DELAY));
  pspin->SetRange32(1, 60000);
  pspin->SetBase(10);
  pspin->SetPos(m_AutotypeDelay);

  InitToolTip();
  // Note naming convention: string IDS_xxx corresponds to control IDC_xxx
  AddTool(IDC_MAINTAINDATETIMESTAMPS, IDS_MAINTAINDATETIMESTAMPS);
  AddTool(IDC_OTHERBROWSERLOCATION,   IDS_OTHERBROWSERLOCATION);
  AddTool(IDC_OTHEREDITORLOCATION,    IDS_OTHEREDITORLOCATION);
  ActivateToolTip();

  return TRUE;
}
예제 #7
0
/////////////////////////////////////////////////////////////////////////////
// CElementPropPage message handlers
BOOL CElementPropPage::OnInitDialog() 
{
	COlePropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	CSpinButtonCtrl* pSpin;
	pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_WIDTH);


	// Set the buddy control
	pSpin->SetBuddy (GetDlgItem(IDC_EDIT_WIDTH));

	// Set Spin Control Range
	pSpin->SetRange(0,5);

	int count;
    GetPropText(L"ElementCount",&count);

	CString str("0");

	if(count)
	{
		SetPropText(L"Element", str);
		str = "Element-0";
		m_lbElementList.AddString(str);
		m_lbElementList.SetCurSel(0);
		UpdateControls();
	}

	m_lbElementList.ResetContent();
	for (int i=0; i<count; i++) 
	{
		str.Format(L"Element-%d",i);
		m_lbElementList.AddString(str);
		str.Format(L"%d",count-1); 
		SetPropText(L"Element", str);
		m_lbElementList.SetCurSel(count-1);
		UpdateControls();
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
예제 #8
0
unsigned int ExtFrame::SetDollarsAndCents(CSpinButtonCtrl& spinDollars, CEdit& editDollars,
    CSpinButtonCtrl& spinCents, CEdit& editCents,
    unsigned int val, unsigned int maxDollars)
{
    spinDollars.SetRange(0, maxDollars);
    spinCents.SetRange(0, 99);
    char num[33];
    _ultoa_s(maxDollars, num, sizeof(num), 10);

    editDollars.SetLimitText((unsigned int)strlen(num));
    editCents.SetLimitText(2);

    unsigned int dollars = val / 1000;
    SetSpinValue(spinDollars, editDollars, dollars, false);
    unsigned int tenthcents = val - 1000 * dollars;
    unsigned int cents = tenthcents / 10;
    SetSpinValue(spinCents, editCents, cents, true);
    return tenthcents - 10 * cents;
}
예제 #9
0
/*
void CInstrumentEditorN163Wave::OnPositionClicked()
{
	if (IsDlgButtonChecked(IDC_POSITION)) {
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(FALSE);
		m_pInstrument->SetAutoWavePos(true);
	}
	else {
		GetDlgItem(IDC_WAVE_POS)->EnableWindow(TRUE);
		m_pInstrument->SetAutoWavePos(false);
	}
}
*/
void CInstrumentEditorN163Wave::OnWavesChange()
{
	CSpinButtonCtrl *pIndexSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_INDEX_SPIN);

	int count = GetDlgItemInt(IDC_WAVES) + 1;
	
	if (m_pInstrument != NULL)
		m_pInstrument->SetWaveCount(count);

	pIndexSpin->SetRange(0, count - 1);
	pIndexSpin->RedrawWindow();

	if (pIndexSpin->GetPos() > (count - 1))
		pIndexSpin->SetPos(count - 1);

	if (m_pWaveEditor != NULL) {
		m_pWaveEditor->SetWave(m_iWaveIndex);
		m_pWaveEditor->WaveChanged();
	}
}
/*
	OnInitDialog()
*/
BOOL CWallPaperDrawSettingsAlphaDlg::OnInitDialog(void)
{
	// classe base
	CPropertyPage::OnInitDialog();

	// imposta lo spin button per la trasparenza
	CSpinButtonCtrl* pSpin;
	pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_LAYERED);
	pSpin->SetRange(LWA_ALPHA_INVISIBLE,LWA_ALPHA_OPAQUE);
	pSpin->SetPos(m_nLayered);
	pSpin->SetBuddy(GetDlgItem(IDC_EDIT_LAYERED));

	// abilita i controlli
	GetDlgItem(IDC_CHECK_LAYERED)->EnableWindow(m_enumOsVer==WINDOWS_2000 || m_enumOsVer==WINDOWS_XP || m_enumOsVer==WINDOWS_VISTA || m_enumOsVer==WINDOWS_SEVEN);
	GetDlgItem(IDC_STATIC_LAYERED)->EnableWindow(m_enumOsVer==WINDOWS_2000 || m_enumOsVer==WINDOWS_XP || m_enumOsVer==WINDOWS_VISTA || m_enumOsVer==WINDOWS_SEVEN);
	GetDlgItem(IDC_EDIT_LAYERED)->EnableWindow(m_bLayered);
	GetDlgItem(IDC_SPIN_LAYERED)->EnableWindow(m_bLayered);

	char szBuffer[2048] = {"The transparency effect requires Windows 2000 or higher, currently you are running on:\r\n\r\n"};
	int n = strlen(szBuffer)-1;
	m_winVer.GetPlatformInfo(szBuffer+n,sizeof(szBuffer)-n);
	GetDlgItem(IDC_STATIC_OS)->SetWindowText(szBuffer);

	CString strLayered;
	strLayered.Format("(%d = invisible, %d = opaque)",LWA_ALPHA_INVISIBLE,LWA_ALPHA_OPAQUE);
	SetDlgItemText(IDC_STATIC_LAYERED,strLayered);

	// aggiunge i tooltips
	if(m_Tooltip.Create(this,TTS_ALWAYSTIP))
	{
		m_Tooltip.SetWidth(TOOLTIP_REASONABLE_WIDTH);
		m_Tooltip.SetDelay(TOOLTIP_REASONABLE_DELAYTIME);
		m_Tooltip.AddTooltip(GetDlgItem(IDC_CHECK_LAYERED),IDC_CHECK_LAYERED,IDS_TOOLTIP_OPTIONS_DRAW_TRANSPARENCY);
		m_Tooltip.AddTooltip(GetDlgItem(IDC_EDIT_LAYERED),IDC_EDIT_LAYERED,IDS_TOOLTIP_OPTIONS_DRAW_TRANSPARENCYVALUE);
		m_Tooltip.AddTooltip(GetDlgItem(IDC_SPIN_LAYERED),IDC_SPIN_LAYERED,IDS_TOOLTIP_OPTIONS_DRAW_TRANSPARENCYVALUE);
	}

	UpdateData(FALSE);

	return(FALSE);
}
예제 #11
0
int DiskEditDialog::ReplaceSpinCtrl(MySpinCtrl* pNewSpin, int idSpin, int idEdit)
{
    CSpinButtonCtrl* pSpin;
//  CRect rect;
    DWORD style;
        
    pSpin = (CSpinButtonCtrl*)GetDlgItem(idSpin);
    if (pSpin == NULL)
        return -1;
//  pSpin->GetWindowRect(&rect);
//  ScreenToClient(&rect);
    style = pSpin->GetStyle();
    style &= ~(UDS_SETBUDDYINT);
    //style |= UDS_AUTOBUDDY;
    ASSERT(!(style & UDS_AUTOBUDDY));
    pSpin->DestroyWindow();
    pNewSpin->Create(style, CRect(0,0,0,0), this, idSpin);
    pNewSpin->SetBuddy(GetDlgItem(idEdit));

    return 0;
}
예제 #12
0
BOOL CDownloaderProperties_ListPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	CSpinButtonCtrl *pSpin = (CSpinButtonCtrl*) GetDlgItem (IDC_WC_SPIN);
	pSpin->SetRange (1, UD_MAXVAL);

	
	m_wndWhenDel.AddString (LS (L_ASK));			
	m_wndWhenDel.AddString (LS (L_DONTDELFILE));	
	m_wndWhenDel.AddString (LS (L_DELFILE));		

	m_wndWhenDel.SetCurSel (_DldsMgr.m_enDDR);	

	CheckDlgButton (IDC_DONTSAVELOGS, _App.DontSaveLogs () ? BST_CHECKED : BST_UNCHECKED);
	
	CheckDlgButton (IDC_AUTODEL, _DldsMgr.m_bAutoDelCompleted ? BST_CHECKED : BST_UNCHECKED);
	CheckDlgButton (IDC_DETAILEDLOG, _DldsMgr.m_bDetLog ? BST_CHECKED : BST_UNCHECKED);

	CheckDlgButton (IDC_SIZEINBYTES, _pwndDownloads->m_wndDownloads.m_tasks.m_bSizesInBytes ? BST_CHECKED : BST_UNCHECKED);

	AvirToDlg ();

	CheckDlgButton (IDC_SHOWDLDDLG, _App.DownloadDialog_Use () ? BST_CHECKED : BST_UNCHECKED);

	DWORD dw = _App.FileWriteCacheSize () / 1024 / 1024;
	CheckDlgButton (IDC_USEWC, dw ? BST_CHECKED : BST_UNCHECKED);
	SetDlgItemInt (IDC_WC_SIZE, dw ? dw : 1, FALSE);

	CheckDlgButton (IDC_PREVENT_STANDBY, _App.PreventStandbyWhileDownloading () ? BST_CHECKED : BST_UNCHECKED);

	ApplyLanguage ();

	UpdateEnabled ();
	
	return TRUE;  
	              
}
예제 #13
0
BOOL CInstrumentEditorN163::OnInitDialog()
{
	CSequenceInstrumentEditPanel::OnInitDialog();

	// Instrument settings
	CListCtrl *pList = (CListCtrl*) GetDlgItem(IDC_INSTSETTINGS);
	pList->DeleteAllItems();
	pList->InsertColumn(0, _T(""), LVCFMT_LEFT, 26);
	pList->InsertColumn(1, _T("#"), LVCFMT_LEFT, 30);
	pList->InsertColumn(2, _T("Effect name"), LVCFMT_LEFT, 84);
	pList->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
	
	for (int i = 0; i < CInstrumentN163::SEQUENCE_COUNT; ++i) {
		pList->InsertItem(i, _T(""), 0);
		pList->SetCheck(i, 0);
		pList->SetItemText(i, 1, _T("0"));
		pList->SetItemText(i, 2, INST_SETTINGS_N163[i]);
	}

	pList->SetItemState(m_iSelectedSetting, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);

	SetDlgItemInt(IDC_SEQ_INDEX, m_iSelectedSetting);

	CSpinButtonCtrl *pSequenceSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_SEQUENCE_SPIN);
	pSequenceSpin->SetRange(0, MAX_SEQUENCES - 1);

	CRect rect(190 - 2, 30 - 2, CSequenceEditor::SEQUENCE_EDIT_WIDTH, CSequenceEditor::SEQUENCE_EDIT_HEIGHT);
	
	m_pSequenceEditor = new CSequenceEditor(GetDocument());	
	m_pSequenceEditor->CreateEditor(this, rect);
	m_pSequenceEditor->ShowWindow(SW_SHOW);
	m_pSequenceEditor->SetMaxValues(MAX_VOLUME, CInstrumentN163::MAX_WAVE_COUNT - 1);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
예제 #14
0
void CPage_Status::Display()
{
	if (*m_ppbFile == NULL) return;

	PBYTE pbMSFI = (PBYTE)&m_pMsFileInfo->HPMax;
	for (WORD nID = IDC_STATUS_HP_UP; nID != IDC_STATUS_HP_DEF + 1; ++nID)
	{
		SetDlgItemInt(nID, *(DWORD *)pbMSFI);
		pbMSFI += sizeof(DWORD);
	}

	for (WORD nID = IDC_STATUS_EP_UP; nID != IDC_STATUS_RNG + 1; ++nID)
	{
		SetDlgItemInt(nID, *(WORD *)pbMSFI);
		pbMSFI += sizeof(WORD);
	}

	CSpinButtonCtrl *pSpin;
	for (WORD nID = 0; nID != 7; ++nID)
	{
		pSpin = ((CSpinButtonCtrl *)GetDlgItem(IDC_STATUS_CHI_SPIN + nID));
		pSpin->SetPos(m_pMsFileInfo->ConditionGuard[nID]);
	}
}
예제 #15
0
BOOL CPage_Status::OnInitDialog()
{
	CMyPropertyPage::OnInitDialog();
	
	for (WORD nID = IDC_STATUS_HP_UP; nID != IDC_STATUS_HP_DEF + 1; ++nID)
	{
		((CEdit *)GetDlgItem(nID))->SetLimitText(11);
	}
	
	for (WORD nID = IDC_STATUS_EP_UP; nID != IDC_STATUS_RNG + 1; ++nID)
	{
		((CEdit *)GetDlgItem(nID))->SetLimitText(6);
	}

	CSpinButtonCtrl *pSpin;
	for (WORD nID = 0; nID != 7; ++nID)
	{
		pSpin = ((CSpinButtonCtrl *)GetDlgItem(IDC_STATUS_CHI_SPIN + nID));
		pSpin->SetBuddy(GetDlgItem(IDC_STATUS_CHI + nID));
		pSpin->SetRange(0, MAX_CONDITION);
	}

	return TRUE;
}
//******************************************************************************************
void CCxNDArrayDimGrid::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{

	if (m_nDraggedColumn >= 0 || m_bTracking || m_bSelecting)
	{
		return;
	}

	CBCGPGridRow* pSel = GetCurSel ();

// 	if (pSel && pSel->IsInPlaceEditing())
// 	{
// 		return;
// 	}

	if (pSel != NULL && 
		pScrollBar->GetSafeHwnd () != NULL)
	{
		CSpinButtonCtrl* pWndSpin = pSel->GetSpinWnd ();
		if (pWndSpin != NULL && 
			pWndSpin->GetSafeHwnd () == pScrollBar->GetSafeHwnd ())
		{
			return;
		}
	}

	SetEndEditReason (EndEdit_Cancel | EndEdit_Layout);
	EndEditItem (TRUE);

	SCROLLINFO info;
	info.cbSize = sizeof(SCROLLINFO);
	info.fMask = SIF_TRACKPOS;

	if (nSBCode == SB_THUMBTRACK || nSBCode == SB_THUMBPOSITION)
	{
		GetScrollInfo(SB_VERT, &info);
		nPos = info.nTrackPos;
	}

	int nPrevOffset = m_nVertScrollOffset;

	int nVertScrollPage = m_nVertScrollPage;
	if (m_bVirtualMode)
	{
		int nItemsCount = max (1, m_nVertScrollPage / m_nRowHeight);
		nVertScrollPage = nItemsCount * m_nRowHeight;
	}

	switch (nSBCode)
	{
	case SB_LINEUP:
		m_nVertScrollOffset -= m_nRowHeight;
		break;

	case SB_LINEDOWN:
		m_nVertScrollOffset += m_nRowHeight;
		break;

	case SB_TOP:
		m_nVertScrollOffset = 0;
		break;

	case SB_BOTTOM:
		m_nVertScrollOffset = m_nVertScrollTotal;
		break;

	case SB_PAGEUP:
		m_nVertScrollOffset -= nVertScrollPage;
		break;

	case SB_PAGEDOWN:
		m_nVertScrollOffset += nVertScrollPage;
		break;

	case SB_THUMBPOSITION:
	case SB_THUMBTRACK:
		m_nVertScrollOffset = nPos;
		break;

	default:
		return;
	}

	m_nVertScrollOffset = max (0, min (m_nVertScrollOffset, 
		m_nVertScrollTotal - nVertScrollPage + 1));
	if (m_bVirtualMode)
	{
		// row alignment
		int nResidue = m_nVertScrollOffset % m_nRowHeight;
		if (nResidue > 0)
		{
			m_nVertScrollOffset -= nResidue;
			if (m_nVertScrollOffset + m_nVertScrollPage < m_nVertScrollTotal)
			{
				m_nVertScrollOffset += m_nRowHeight;
			}
		}
	}

	if (m_nVertScrollOffset == nPrevOffset)
	{
		return;
	}

	OnUpdateVScrollPos (m_nVertScrollOffset, nPrevOffset);

	SetScrollPos (SB_VERT, m_nVertScrollOffset);

	int dy = nPrevOffset - m_nVertScrollOffset;

	ShiftItems (0, dy);
	OnPosSizeChanged ();
	m_rectTrackSel = OnGetSelectionRect ();
	ScrollWindow (0, dy, m_rectList, m_rectList);
	ScrollWindow (0, dy, m_rectRowHeader, m_rectRowHeader);

	pSel = GetCurSel ();
	if (pSel != NULL)
	{
		pSel->AdjustButtonRect ();
	}

	OnAfterVScroll (m_nVertScrollOffset, nPrevOffset);
	
	UpdateWindow ();
}
BOOL CDownloaderProperties_BtPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	m_tabTrafficModes.InsertItem (0, LS (L_LIGHT));
	m_tabTrafficModes.InsertItem (1, LS (L_MEDIUM));
	m_tabTrafficModes.InsertItem (2, LS (L_HEAVY));
	m_iOldMode = 0;

	CString str;
	str.Format ("%s/%s", LS (L_B), LS (L_S)); m_wndLimitDim.AddString (str);
	str.Format ("%s/%s", LS (L_KB), LS (L_S)); m_wndLimitDim.AddString (str);
	str.Format ("%s/%s", LS (L_MB), LS (L_S)); m_wndLimitDim.AddString (str);
	m_wndLimitDim.SetCurSel (0);

	UINT aSpinIds [] = {
		IDC_UPLLIMITVALSPIN, IDC_PORT_FROM_SPIN, IDC_PORT_TO_SPIN,
		IDC_MAXHALFSSPIN
	};
	int i = 0;
	for (i = 0; i < sizeof (aSpinIds) / sizeof (UINT); i++)
	{
		CSpinButtonCtrl *pSpin = (CSpinButtonCtrl*) GetDlgItem (aSpinIds [i]);
		pSpin->SetRange (1, UD_MAXVAL);
	}

	for (i = 0; i < 3; i++)
	{
		m_vModes.push_back (
			_inc_ModeStgs (_App.Bittorrent_UploadTrafficLimit (i), 
				_App.Bittorrent_UploadConnectionLimit (i),
				_App.Bittorrent_MaxHalfConnections (i)));
	}
	SetDlgItemInt (IDC_UPLLIMITVAL, 1);
	ModeToDlg ();
	
	CheckDlgButton (IDC_ENABLE,
		_App.Bittorrent_Enable () ? BST_CHECKED : BST_UNCHECKED);

	SetDlgItemInt (IDC_PORT_FROM, _App.Bittorrent_ListenPort_From ());
	SetDlgItemInt (IDC_PORT_TO, _App.Bittorrent_ListenPort_To ());

	CheckDlgButton (IDC_USE_DHT,
		_App.Bittorrent_EnableDHT () ? BST_CHECKED : BST_UNCHECKED);

	CheckDlgButton (IDC_ASSOCWITHTORRENT, 
		vmsTorrentExtension::IsAssociatedWithUs () ? BST_CHECKED : BST_UNCHECKED);

	CheckDlgButton (IDC_DISABLE_SEEDING, 
		_App.Bittorrent_DisableSeedingByDef () ? BST_CHECKED : BST_UNCHECKED);

	ApplyLanguage ();

	UpdateEnabled ();

	if (vmsBtSupport::getBtDllVersion () < 751)
	{
		GetDlgItem (IDC_MAXHALFSVAL)->EnableWindow (FALSE);
		GetDlgItem (IDC__MAXHALFS)->EnableWindow (FALSE);
	}
	
	return TRUE;  
	              
}
예제 #18
0
BOOL COptionsBackup::OnInitDialog()
{
  COptions_PropertyPage::OnInitDialog();

  m_chkbox.SetTextColour(CR_DATABASE_OPTIONS);
  m_chkbox.ResetBkgColour(); //Use current window's background

  if (GetMainDlg()->IsDBOpen() && !GetMainDlg()->IsDBReadOnly()) {
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->ShowWindow(SW_HIDE);
  }

  // Database preferences - can't change in R/O mode of if no DB is open
  if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) {
    CString cs_Preference_Warning;
    CString cs_temp(MAKEINTRESOURCE(GetMainDlg()->IsDBOpen() ? IDS_DB_READ_ONLY : IDS_NO_DB));

    cs_Preference_Warning.Format(IDS_STATIC_DB_PREFS_RO_WARNING, static_cast<LPCWSTR>(cs_temp));
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->SetWindowText(cs_Preference_Warning);

    GetDlgItem(IDC_SAVEIMMEDIATELY)->EnableWindow(FALSE);
  }

  if (m_backupsuffix_cbox.GetCount() == 0) {
    // add the strings in alphabetical order
    CString cs_text(MAKEINTRESOURCE(IDS_NONE));
    int nIndex;
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_None);
    m_BKSFX_to_Index[PWSprefs::BKSFX_None] = nIndex;

    cs_text.LoadString(IDS_DATETIMESTRING);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_DateTime);
    m_BKSFX_to_Index[PWSprefs::BKSFX_DateTime] = nIndex;

    cs_text.LoadString(IDS_INCREMENTNUM);
    nIndex = m_backupsuffix_cbox.AddString(cs_text);
    m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_IncNumber);
    m_BKSFX_to_Index[PWSprefs::BKSFX_IncNumber] = nIndex;
  }

  m_backupsuffix_cbox.SetCurSel(m_BKSFX_to_Index[m_BackupSuffix]);

  GetDlgItem(IDC_BACKUPEXAMPLE)->SetWindowText(L"");

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_BKPMAXINCSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_BACKUPMAXINC));
  pspin->SetRange(1, 999);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxNumIncBackups);

  OnComboChanged();
  OnBackupBeforeSave();

  if (m_BackupLocation == 1) {
    ExpandBackupPath();
  }

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);
    m_Help3.Init(IDB_QUESTIONMARK);
    m_Help4.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_BACKUPBEFORESAVEHELP, IDS_BACKUPBEFORESAVE);
    AddTool(IDC_USERBACKUPOTHERLOCATIONHELP, IDS_USERBACKUPOTHERLOCATION);
    AddTool(IDC_USERBACKUPOTHERLOCATIONHELP2, IDS_USERBACKUPOTHERLOCATION2);
    AddTool(IDC_SAVEIMMEDIATELYHELP, IDS_SAVEIMMEDIATELY);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
    m_Help3.EnableWindow(FALSE);
    m_Help3.ShowWindow(SW_HIDE);
    m_Help4.EnableWindow(FALSE);
    m_Help4.ShowWindow(SW_HIDE);
  }

  return TRUE;
}
예제 #19
0
void CElementFramePage::SetCtrls()
{
	if(!m_pElement)
		return;

	//border
	m_bDrawBorder = m_pElement->GetDrawBorder();
	m_PreviewBorderBtn.SetSymbol(m_BorderSymbol.get());
	m_pBorder->GetGap(m_fBorderGapX, m_fBorderGapY);
	CSpinButtonCtrl	* pSpinBorderX = NULL;
	pSpinBorderX = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_BORDER_X);
	if (pSpinBorderX)
		pSpinBorderX->SetRange(-1000, 1000);

	CSpinButtonCtrl	* pSpinBorderY = NULL;
	pSpinBorderY = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_BORDER_Y);
	if (pSpinBorderY)
		pSpinBorderY->SetRange(-1000, 1000);

	//background
	m_bDrawBg= m_pElement->GetDrawBackground();
	m_PreviewBgBtn.SetSymbol(m_BgSymbol.get());
	m_pBg->GetGap(m_fBgGapX, m_fBgGapY);

	CSpinButtonCtrl	* pSpinBgX = NULL;
	pSpinBgX = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_BG_X);
	if (pSpinBgX)
		pSpinBgX->SetRange(-1000, 1000);

	CSpinButtonCtrl	* pSpinBgY = NULL;
	pSpinBgY = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_BG_Y);
	if (pSpinBgY)
		pSpinBgY->SetRange(-1000, 1000);

	//shadow
	m_bDrawShadow = m_pElement->GetDrawShadow();
	m_PreviewShadowBtn.SetSymbol(m_ShadowSymbol.get());
	m_pShadow->GetGap(m_fShadowGapX, m_fShadowGapY);

	CSpinButtonCtrl	* pSpinShadowX = NULL;
	pSpinShadowX = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_SHADOW_X);
	if (pSpinShadowX)
		pSpinShadowX->SetRange(-1000, 1000);

	CSpinButtonCtrl	* pSpinShadowY = NULL;
	pSpinShadowY = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_SHADOW_Y);
	if (pSpinShadowY)
		pSpinShadowY->SetRange(-1000, 1000);

	//draft mode
	if(m_pElement->GetDrawMode() == Element::EDM_NORMAL)
		m_bDrawDraftMode = FALSE;
	else if(m_pElement->GetDrawMode() == Element::EDM_DRAFT)
		m_bDrawDraftMode = TRUE;

	UpdateData(FALSE);
	UpdateCtrl();
}
BOOL C3DGORangeWire::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	CSpinButtonCtrl *pXint = (CSpinButtonCtrl*) GetDlgItem(IDC_X_INTERVAL_SPIN);
	pXint->SetRange(1, 10000);
	pXint->SetPos(m_XIntervals);	

	CSpinButtonCtrl *pYint = (CSpinButtonCtrl*) GetDlgItem(IDC_Y_INTERVAL_SPIN);
	pYint->SetRange(1, 10000);
	pYint->SetPos(m_YIntervals);	

	CSpinButtonCtrl *pWW = (CSpinButtonCtrl*) GetDlgItem(IDC_WIRE_WIDTH_SPIN);
	pWW->SetRange(1, 20);
	pWW->SetPos(m_WireWidth);	

	CSpinButtonCtrl *pWI = (CSpinButtonCtrl*) GetDlgItem(IDC_WIRE_SPACE_SPIN);
	if(m_XIntervals > m_YIntervals){
		m_max_interval = m_XIntervals;
		pWI->SetRange(1, m_XIntervals);
	}
	else{
		m_max_interval = m_YIntervals;
		pWI->SetRange(1, m_YIntervals);
	}
	pWI->SetPos(m_WireInterval);
	
	UpdateGraphMode();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
예제 #21
0
BOOL COptionsSystem::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  PWSprefs *prefs = PWSprefs::GetInstance();
  if (!m_bShowConfigFile) {
    GetDlgItem(IDC_STATIC_CONFIGFILE)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_STATIC_RWSTATUS)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_CONFIGFILE)->ShowWindow(SW_HIDE);
  } else {
    PWSprefs::ConfigOption configoption;
    std::wstring wsCF = prefs->GetConfigFile(configoption);
    std::wstring wsCO(L"");
    switch (configoption) {
      case PWSprefs::CF_NONE:
        LoadAString(wsCF, IDS_NONE);
        break;
      case PWSprefs::CF_REGISTRY:
        LoadAString(wsCF, IDS_REGISTRY);
        break;
      case PWSprefs::CF_FILE_RO:
        LoadAString(wsCO, IDS_READ_ONLY);
        break;
      case PWSprefs::CF_FILE_RW:
      case PWSprefs::CF_FILE_RW_NEW:
        LoadAString(wsCO, IDS_READ_WRITE);
        break;
      default:
        ASSERT(0);
    }
    GetDlgItem(IDC_CONFIGFILE)->SetWindowText(wsCF.c_str());
    GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());
  }

  bool bofferdeleteregistry = prefs->OfferDeleteRegistry();

  bool boffermigrate2appdata = OfferConfigMigration();

  if (!bofferdeleteregistry) {
    GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
  }

  if (!boffermigrate2appdata) {
    GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
  }

  if (!bofferdeleteregistry && !boffermigrate2appdata) {
    GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
  } else {
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
  }

  GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);

  pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
  pspin->SetRange(0, ID_TRAYRECENT_ENTRYMAX - ID_TRAYRECENT_ENTRY1 + 1);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxREItems);

  pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
  pspin->SetRange(0, ID_FILE_MRU_ENTRYMAX - ID_FILE_MRU_ENTRY1 + 1);
  pspin->SetBase(10);
  pspin->SetPos(m_MaxMRUItems);

  OnUseSystemTray();

  InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 2);
  AddTool(IDC_REGDEL,           IDS_REGDEL);
  AddTool(IDC_MIGRATETOAPPDATA, IDS_MIGRATETOAPPDATA);
  ActivateToolTip();

  return TRUE;  // return TRUE unless you set the focus to a control
  // EXCEPTION: OCX Property Pages should return FALSE
}
예제 #22
0
BOOL COptionsMisc::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  for (int i = 0; i < 2; i++) {
    m_chkbox[i].SetTextColour(CR_DATABASE_OPTIONS);
    m_chkbox[i].ResetBkgColour(); // Use current window's background
  }

  // Database preferences - can't change in R/O mode of if no DB is open
  if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) {
    GetDlgItem(IDC_DEFUSERNAME)->EnableWindow(FALSE);
    GetDlgItem(IDC_STATIC_USERNAME)->EnableWindow(FALSE);
    GetDlgItem(IDC_STATIC_DEFAUTOTYPE)->EnableWindow(FALSE);
    GetDlgItem(IDC_DB_DEF_AUTOTYPE_TEXT)->EnableWindow(FALSE);
    GetDlgItem(IDC_MAINTAINDATETIMESTAMPS)->EnableWindow(FALSE);
    GetDlgItem(IDC_USEDEFUSER)->EnableWindow(FALSE);
  }

  OnUseDefUser();

  // For some reason, MFC calls us twice when initializing.
  // Populate the combo box only once.
  if (m_dblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_dblclk_cbox);
  }

  if (m_shiftdblclk_cbox.GetCount() == 0) {
    SetupCombo(&m_shiftdblclk_cbox);
  }

  m_dblclk_cbox.SetCurSel(m_DCA_to_Index[m_DoubleClickAction]);
  m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[m_ShiftDoubleClickAction]);

  GetDlgItem(IDC_OTHERBROWSERLOCATION)->SetWindowText(m_OtherBrowserLocation);
  GetDlgItem(IDC_OTHEREDITORLOCATION)->SetWindowText(m_OtherEditorLocation);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_DADSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_DB_DEF_AUTOTYPE_DELAY));
  pspin->SetRange32(M_prefminAutotypeDelay(), M_prefmaxAutotypeDelay());
  pspin->SetBase(10);
  pspin->SetPos(m_AutotypeDelay);

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);
    m_Help3.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_MAINTAINDATETIMESTAMPSHELP, IDS_MAINTAINDATETIMESTAMPS);
    AddTool(IDC_OTHERBROWSERLOCATIONHELP, IDS_OTHERBROWSERLOCATION);
    AddTool(IDC_OTHEREDITORLOCATIONHELP, IDS_OTHEREDITORLOCATION);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
    m_Help3.EnableWindow(FALSE);
    m_Help3.ShowWindow(SW_HIDE);
  }

  return TRUE;  // return TRUE unless you set the focus to a control
}
/*
	OnInitDialog()
*/
BOOL CWallBrowserTwoParamsDlg::OnInitDialog(void)
{
	CDialog::OnInitDialog();

	HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	SetIcon(hIcon,TRUE);
	SetIcon(hIcon,FALSE);

	SetDlgItemText(IDC_STATIC_PROPERTY,m_strProperty);

	CSpinButtonCtrl* pSpinFirst = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_VALUE);
	pSpinFirst->SetRange(m_nFirstMin,m_nFirstMax); 
	pSpinFirst->SetPos(m_nFirstDefaultValue);
	pSpinFirst->SetBuddy(GetDlgItem(IDC_EDIT_VALUE));

	if(m_strSubOperation=="Halftone")
	{
		m_CComboSubValue.AddString("print");		// HT_PRINT
		m_CComboSubValue.AddString("display");		// HT_VIEW
	}
	else if(m_strSubOperation=="Emboss")
	{
		m_CComboSubValue.AddString("north");		// EMBOSS_N
		m_CComboSubValue.AddString("north/east");	// EMBOSS_NE
		m_CComboSubValue.AddString("east");		// EMBOSS_E
		m_CComboSubValue.AddString("south/east");	// EMBOSS_SE
		m_CComboSubValue.AddString("south");		// EMBOSS_S
		m_CComboSubValue.AddString("south/west");	// EMBOSS_SW
		m_CComboSubValue.AddString("west");		// EMBOSS_W
		m_CComboSubValue.AddString("north/west");	// EMBOSS_NW
	}
	else if(m_strSubOperation=="Noise")
	{
		m_CComboSubValue.AddString("all channels");	// NOISE_CHANNEL_MASTER
		m_CComboSubValue.AddString("red channel");	// NOISE_CHANNEL_RED
		m_CComboSubValue.AddString("green channel");	// NOISE_CHANNEL_GREEN
		m_CComboSubValue.AddString("blue channel");	// NOISE_CHANNEL_BLUE
	}
	else
		m_bHaveCombo = FALSE;

	CString str;
	str.Format("%s (%d/%d)",m_strOperation,m_nFirstMin,m_nFirstMax);
	SetDlgItemText(IDC_STATIC_OPERATION,str);

	if(m_bHaveCombo)
	{
		SetDlgItemText(IDC_STATIC_SUBOPERATION,m_strSubOperation);
		GetDlgItem(IDC_EDIT_SUBVALUE)->EnableWindow(FALSE);
		GetDlgItem(IDC_EDIT_SUBVALUE)->ShowWindow(SW_HIDE);
		GetDlgItem(IDC_SPIN_SUBVALUE)->EnableWindow(FALSE);
		GetDlgItem(IDC_SPIN_SUBVALUE)->ShowWindow(SW_HIDE);
		m_CComboSubValue.SetCurSel(0);
	}
	else
	{
		str.Format("%s (%d/%d)",m_strSubOperation,m_nSecondMin,m_nSecondMax);
		SetDlgItemText(IDC_STATIC_SUBOPERATION,str);
		GetDlgItem(IDC_COMBO_SUBVALUE)->EnableWindow(FALSE);
		GetDlgItem(IDC_COMBO_SUBVALUE)->ShowWindow(SW_HIDE);
		CSpinButtonCtrl *pSpinSecond = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_SUBVALUE);
		pSpinSecond->SetRange(m_nSecondMin,m_nSecondMax); 
		pSpinFirst->SetPos(m_nSecondDefaultValue);
		pSpinSecond->SetBuddy(GetDlgItem (IDC_EDIT_SUBVALUE));
	}

	UpdateData(FALSE);

	return(TRUE); 
}
예제 #24
0
BOOL COptionsSystem::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

  PWSprefs *prefs = PWSprefs::GetInstance();

  PWSprefs::ConfigOption configoption;
  StringX sx_CF = prefs->GetConfigFile(configoption).c_str();
  std::wstring  wsCO(L"");
  switch (configoption) {
    case PWSprefs::CF_NONE:
      LoadAString(sx_CF, IDS_NONE);
      break;
    case PWSprefs::CF_REGISTRY:
      LoadAString(sx_CF, IDS_REGISTRY);
      break;
    case PWSprefs::CF_FILE_RO:
      LoadAString(wsCO, IDS_READ_ONLY);
      break;
    case PWSprefs::CF_FILE_RW:
    case PWSprefs::CF_FILE_RW_NEW:
      LoadAString(wsCO, IDS_READ_WRITE);
      break;
    default:
      ASSERT(0);
  }

  CString cs_text;

  // R/W status
  GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str());

  // Config file name & location
  cs_text = PWSUtil::NormalizeTTT(sx_CF, 60).c_str();
  GetDlgItem(IDC_CONFIGFILE)->SetWindowText(cs_text);

  // Effective host & user used in config file
  if (configoption == PWSprefs::CF_FILE_RO || 
      configoption == PWSprefs::CF_FILE_RW ||
      configoption == PWSprefs::CF_FILE_RW_NEW) {
    stringT hn = SysInfo::GetInstance()->GetEffectiveHost();
    PWSprefs::XMLify(charT('H'), hn);
    stringT un = SysInfo::GetInstance()->GetEffectiveUser();
    PWSprefs::XMLify(charT('u'), un);

    cs_text.Format(IDS_HOSTUSER, static_cast<LPCWSTR>(hn.c_str()), static_cast<LPCWSTR>(un.c_str()));
    GetDlgItem(IDC_STATIC_HOSTUSER)->SetWindowText(cs_text);
  }

  bool bofferdeleteregistry = prefs->OfferDeleteRegistry();

  bool boffermigrate2appdata = OfferConfigMigration();

  if (!bofferdeleteregistry) {
    GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE);
  }

  if (!boffermigrate2appdata) {
    GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE);
  }

  if (!bofferdeleteregistry && !boffermigrate2appdata) {
    GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE);
  } else {
    GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW);
  }

  GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE);

  CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN);
  pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS));
  pspin->SetRange(M_prefminREItems(), M_prefmaxREItems());
  pspin->SetBase(10);
  pspin->SetPos(m_MaxREItems);

  pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN);
  pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS));
  pspin->SetRange(M_prefminMRU(), M_prefmaxMRU());
  pspin->SetBase(10);
  pspin->SetPos(m_MaxMRUItems);

  OnUseSystemTray();

  if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) {
    m_Help1.Init(IDB_QUESTIONMARK);
    m_Help2.Init(IDB_QUESTIONMARK);

    // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP
    AddTool(IDC_REGDELHELP, IDS_REGDEL);
    AddTool(IDC_MIGRATETOAPPDATAHELP, IDS_MIGRATETOAPPDATA);
    ActivateToolTip();
  } else {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
  }

  if (!bofferdeleteregistry) {
    m_Help1.EnableWindow(FALSE);
    m_Help1.ShowWindow(SW_HIDE);
  }

  if (!boffermigrate2appdata) {
    m_Help2.EnableWindow(FALSE);
    m_Help2.ShowWindow(SW_HIDE);
  }

  return TRUE;  // return TRUE unless you set the focus to a control
}
예제 #25
0
BOOL COpPropertyDlg::Create (COperatorWin *opWindow, const NLTEXGEN::ITexGenOperator *op)
{
	// Save operator parameters
	_OpWindow = opWindow;
	_Op = op;

	// Create the dialog
	if (CDialog::Create (IDD_OP_PROPERTY, theApp.m_pMainWnd))
	{
		// The client RECT
		RECT client;
		GetClientRect (&client);
		client.top = DIALOG_MARGIN;
		client.left = DIALOG_MARGIN;

		// Create each widget
		uint i;
		std::string currentCategory;
		for (i=0; i<_Op->getNumParameter(); i++)
		{
			// The parameter
			const CParameter &param = _Op->getParameter(i);

			// New category ?
			if ((i == 0) || (currentCategory != param.Category))
			{
				if (i != 0)
					endCategory (client, currentCategory.c_str ());
				currentCategory = param.Category;
				beginCategory (client);
			}
			else
			{
				client.top += WIDGET_SPACE;
			}
			

			// Type ?
			switch (param.Type)
			{
			case CParameter::TypeEnum:
				{
					if (param.EnumString)
					{
						// Add label
						client.bottom = client.top + LABEL_HEIGHT;
						client.right = client.left + LABEL_WIDTH;
						addLabel(client, (param.Name+string(":")).c_str());

						client.right = WIDGET_RIGHT;
						client.top = client.bottom;
						client.bottom = client.top + COMBO_WINDOW_HEIGHT;
						CExtComboBox *comboBox = new CExtComboBox;
						comboBox->Create (WS_TABSTOP|CBS_DROPDOWNLIST|WS_VISIBLE|WS_CHILD|WS_VSCROLL|CBS_DISABLENOSCROLL, client, this, i+FirstID);
						client.bottom = client.top + COMBO_HEIGHT;
						comboBox->SetFont (GetFont());
						Widgets.push_back(comboBox);
						int j;
						for (j=0; j<param.IntegerMax; j++)
							comboBox->AddString(param.EnumString[j]);
					}
					else
						Widgets.push_back (NULL);
				}
				break;
			case CParameter::TypeColor:
				{
					// Add label
					client.bottom = client.top + LABEL_HEIGHT;
					client.right = client.left + LABEL_WIDTH;
					addLabel(client, (param.Name+string(":")).c_str());

					client.top = client.bottom;
					client.bottom += COLOR_HEIGHT;
					client.right = WIDGET_RIGHT;
					CColorBox *colorBox = new CColorBox;
					colorBox->Create (WS_TABSTOP|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					colorBox->SetFont (GetFont());
					Widgets.push_back(colorBox);
				}
				break;
			case CParameter::TypeGradient:
				{
					// Add label
					client.bottom = client.top + LABEL_HEIGHT;
					client.right = client.left + LABEL_WIDTH;
					addLabel(client, (param.Name+string(":")).c_str());

					client.right = WIDGET_RIGHT;
					client.top = client.bottom;
					client.bottom = client.top+GRADIENT_HEIGHT;
					CGradientRectWnd *gradient = new CGradientRectWnd (true);
					gradient->Create (WS_TABSTOP|WS_VISIBLE|WS_CHILD|/*WS_BORDER*/0, client, this, i+FirstID);
					Widgets.push_back(gradient);
				}
				break;
			/*case CParameter::TypeFloat:
				{
					// Add label
					client.bottom = client.top + LABEL_HEIGHT;
					client.right = client.left + LABEL_WIDTH;
					addLabel(client, (param.Name+string(":")).c_str());

					client.right = WIDGET_RIGHT;
					client.top = client.bottom;
					client.bottom = client.top+SLIDER_HEIGHT;
					CSliderCtrl *slider = new CSliderCtrl;
					slider->Create (WS_TABSTOP|TBS_HORZ|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					slider->SetRange(SPINNER_MIN, SPINNER_MAX);
					slider->SetFont (GetFont());
					Widgets.push_back(slider);
				}
				break;*/
			case CParameter::TypeFloat:
				{
					client.right = client.left + ROT_BUTTON_WIDTH;
					client.bottom = client.top+ROT_BUTTON_HEIGHT;
					CRotButton *rotButton = new CRotButton;
					rotButton->Create (WS_TABSTOP|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					rotButton->init (param.Setup);
					Widgets.push_back(rotButton);

					// Add label
					RECT clientBox = client;
					clientBox.top --;
					clientBox.left = clientBox.right + ROT_BUTTON_LEFT_MARGIN;
					clientBox.bottom = clientBox.top + LABEL_HEIGHT;
					clientBox.right = clientBox.left + LABEL_WIDTH;
					addLabel(clientBox, (param.Name+string(":")).c_str());

					clientBox = client;
					clientBox.left = clientBox.right + ROT_BUTTON_LEFT_MARGIN;
					clientBox.right = clientBox.left + EDIT_WIDTH;
					clientBox.top = clientBox.bottom - EDIT_HEIGHT;
					CMyEdit *edit = new CMyEdit;
					edit->Create (/*WS_BORDER*/0|WS_TABSTOP|ES_LEFT|WS_VISIBLE|WS_CHILD, clientBox, this, i+FirstID);
					edit->SetFont (GetFont());
					Others.push_back(edit);
					rotButton->setEditBox (edit);

					clientBox.left = clientBox.right + ROT_BUTTON_LABEL_MARGIN;
					clientBox.right = clientBox.left + LABEL_WIDTH;
					clientBox.top = clientBox.bottom - EDIT_HEIGHT;
					addLabel(clientBox, param.Setup.Unit);
				}
				break;
			case CParameter::TypeInt:
				{
					// Add label
					client.bottom = client.top + LABEL_HEIGHT;
					client.right = client.left + LABEL_WIDTH;
					addLabel(client, (param.Name+string(":")).c_str());

					client.top = client.bottom;
					client.bottom += EDIT_HEIGHT;
					client.right = client.left+EDIT_WIDTH;
					CMyEdit *edit = new CMyEdit;
					edit->Create (/*WS_BORDER*/0|WS_TABSTOP|ES_LEFT|ES_NUMBER|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					edit->SetFont (GetFont());
					Widgets.push_back(edit);

					RECT clientBox = client;
					clientBox.left = clientBox.right;
					clientBox.right = clientBox.left+SPIN_WIDTH;
					CSpinButtonCtrl *spin = new CSpinButtonCtrl;
					spin->Create (/*WS_BORDER*/0|WS_TABSTOP|UDS_WRAP|UDS_ARROWKEYS|WS_VISIBLE|WS_CHILD, clientBox, this, i+FirstID);
					spin->SetRange32( param.IntegerMin, param.IntegerMax);
					Others.push_back(spin);
				}
				break;
			case CParameter::TypeString:
				{
					// Add label
					client.bottom = client.top + LABEL_HEIGHT;
					client.right = client.left + LABEL_WIDTH;
					addLabel(client, (param.Name+string(":")).c_str());

					client.top = client.bottom;
					client.bottom += param.Integer?EDIT_MULTI_LINE_HEIGHT:EDIT_HEIGHT;
					client.right = WIDGET_RIGHT;
					CExtEdit *edit;
					if (param.Integer)
					{
						edit = new CExtEdit;
						edit->Create (WS_VSCROLL|ES_OEMCONVERT|ES_MULTILINE|ES_WANTRETURN|WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_AUTOHSCROLL|ES_AUTOVSCROLL, client, this, i+FirstID);
					}
					else
					{
						edit = new CMyEdit;
						edit->Create (/*WS_BORDER*/0|WS_TABSTOP|ES_LEFT|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					}
					edit->SetFont (GetFont());
					Widgets.push_back(edit);
				}
				break;
			case CParameter::TypeBool:
				{
					client.right = WIDGET_RIGHT;
					client.bottom = client.top+CHECKBOX_HEIGHT;
					CExtBtnOnFlat *edit = new CExtBtnOnFlat;
					string tmp = param.Name;
					tmp[0] = toupper (tmp[0]);
					edit->Create (tmp.c_str(), WS_TABSTOP|BS_AUTOCHECKBOX|WS_VISIBLE|WS_CHILD, client, this, i+FirstID);
					//edit->SetFlat (FALSE);
					edit->SetFont (GetFont());
					Widgets.push_back(edit);
				}
				break;
			default:
				Widgets.push_back (NULL);
			}
		
			client.top = client.bottom;
		}

		if (_Op->getNumParameter())
			endCategory (client, currentCategory.c_str ());
		client.bottom = client.top + DIALOG_MARGIN;
		client.top = 0;
		client.left = 0;
		client.right = DIALOG_CLIENT_WIDTH;

		// Resize the client window
		RECT window;
		RECT realClient;
		GetWindowRect (&window);
		GetClientRect (&realClient);
		SetWindowPos (NULL, 0, 0, 
			(window.right-window.left)+(client.right-client.left)-(realClient.right-realClient.left),
			(window.bottom-window.top)+(client.bottom-client.top)-(realClient.bottom-realClient.top),
			SWP_NOMOVE|SWP_NOZORDER);

		_Initialized = true;

		// Set the name
		updateData();

		return TRUE;
	}
	return FALSE;
}
예제 #26
0
void COpPropertyDlg::updateData ()
{
	// Operator name
	SetWindowText (theApp.getOperatorName (const_cast<ITexGenOperator*>(_Op)->getClassName().c_str()));

	// Update each widget
	// Create each widget
	uint i;
	for (i=0; i<_Op->getNumParameter(); i++)
	{
		// The parameter
		const CParameter &param = _Op->getParameter(i);

		// Type ?
		if (Widgets[i])
		{
			switch (param.Type)
			{
			case CParameter::TypeEnum:
				{
					if (param.EnumString)
					{
						CExtComboBox *comboBox = (CExtComboBox*)Widgets[i];
						comboBox->SetCurSel(param.Integer);
					}
				}
				break;
			case CParameter::TypeColor:
				{
					CColorBox *colorBox = (CColorBox*)Widgets[i];
					colorBox->setColor(getColorRef(param.Color));
				}
				break;
			case CParameter::TypeGradient:
				{
					CGradientRectWnd *gradientWnd = (CGradientRectWnd*)Widgets[i];
					gradientWnd->setGradient(param.Gradient);
				}
				break;
			case CParameter::TypeFloat:
				{
					/* CSliderCtrl *spinner = (CSliderCtrl*)Widgets[i];
					spinner->SetPos((int)(param.Color[0]*(float)SPINNER_MAX));					*/

					CRotButton *rotButton = (CRotButton*)Widgets[i];
					rotButton->setValue (param.Value);
				}
				break;
			case CParameter::TypeInt:
				{
					char number[100];
					Widgets[i]->GetWindowText (number, 100);
					int oldValue = atoi(number);
					if ((oldValue != param.Integer) || (number[0] == 0))
					{
						itoa(param.Integer, number, 10);
						Widgets[i]->SendMessage(WM_SETTEXT, 0, (LPARAM)number);
					}

					uint j;
					for (j=0; j<Others.size(); j++)
					{
						if (Others[j]->GetDlgCtrlID() == (sint)(i + FirstID))
						{
							CSpinButtonCtrl *spin = (CSpinButtonCtrl*)Others[j];
							spin->SetPos (param.Integer);
						}
					}
				}
				break;
			case CParameter::TypeBool:
				{
					((CExtBtnOnFlat*)(Widgets[i]))->SetCheck(param.Integer);
				}
				break;
			case CParameter::TypeString:
				{
					CString text;
					Widgets[i]->GetWindowText (text);
					if ((const char*)text != param.StringValue)
					{
						Widgets[i]->SendMessage(WM_SETTEXT, 0, (LPARAM)param.StringValue.c_str());
					}
				}
				break;
			}
		}
	}

	// Update
	UpdateData (FALSE);
}
예제 #27
0
void ExtFrame::AdjustEdit(CSpinButtonCtrl& spin, CEdit& edit, bool two)
{
    int rangeMin;
    int rangeMax;
    spin.GetRange32(rangeMin, rangeMax);
    if(rangeMin <= rangeMax)
    {
        int length = edit.GetWindowTextLength();
        char* temp = new char[length + 1];
        edit.GetWindowText(temp, length + 1);
        int value;
        bool changed = false;
        if(length == 0)
        {
            value = rangeMin;
            changed = true;
        }
        else
        {
            value = atoi(temp);
            if(value < rangeMin)
            {
                value = rangeMin;
                changed = true;
            }
            else if(value > rangeMax)
            {
                value = rangeMax;
                changed = true;
            }
        }
        char numValue[33];
        _itoa_s(value, numValue, 10);
        length = (int)strlen(numValue);

        if(length == 0)
        {
            edit.SetWindowText(two ? "00" : "0");
        }
        else if(two)
        {
            if(length == 1)
            {
                char num[33];
                *num = '0';
                strcpy_s(num + 1, sizeof(num) - 1, numValue);
                edit.SetWindowText(num);
            }
            else if(changed)
            {
                edit.SetWindowText(numValue);
            }
        }
        else
        {
            if(length == 2)
            {
                if(*numValue == '0')
                {
                    edit.SetWindowText(numValue + 1);
                }
                else if(changed)
                {
                    edit.SetWindowText(numValue);
                }
            }
            else if(changed)
            {
                edit.SetWindowText(numValue);
            }
        }
        delete[] temp;
    }
}
예제 #28
0
BOOL CAddEdit_Additional::OnInitDialog()
{
  CAddEdit_PropertyPage::OnInitDialog();

  ModifyStyleEx(0, WS_EX_CONTROLPARENT);

  m_stc_warning.SetColour(RGB(255, 0, 0));
  m_stc_warning.ShowWindow(SW_HIDE);

  CString cs_dats;
  StringX sx_dats = PWSprefs::GetInstance()->
                           GetPref(PWSprefs::DefaultAutotypeString);
  if (sx_dats.empty())
    cs_dats = DEFAULT_AUTOTYPE;
  else
    cs_dats.Format(IDS_DEFAULTAUTOTYPE, sx_dats.c_str());

  GetDlgItem(IDC_DEFAULTAUTOTYPE)->SetWindowText(cs_dats);

  if (M_uicaller() != IDS_ADDENTRY) {
    InitToolTip();
    AddTool(IDC_STATIC_AUTO, IDS_CLICKTOCOPYEXPAND);
    AddTool(IDC_STATIC_RUNCMD, IDS_CLICKTOCOPYEXPAND);
    AddTool(IDC_ENTKBSHCTHOTKEY, IDS_KBS_TOOLTIP0);
    ActivateToolTip();

    m_stc_autotype.SetHighlight(true, CAddEdit_PropertyPage::crefWhite);
    m_stc_runcommand.SetHighlight(true, CAddEdit_PropertyPage::crefWhite);
  }

  m_KBShortcutCtrl.SetMyParent(this);

  // These wil be zero for Add entry
  WORD wVirtualKeyCode = M_KBShortcut() & 0xff;
  WORD wPWSModifiers = M_KBShortcut() >> 16;

  // Translate from PWS to CHotKeyCtrl modifiers
  WORD wHKModifiers = ConvertModifersPWS2MFC(wPWSModifiers);

  m_KBShortcutCtrl.SetHotKey(wVirtualKeyCode, wHKModifiers);

  // We could do this to ensure user has at least Alt or Ctrl key
  // But it gets changed without the user knowing - so we do it elsewhere
  // instead and tell them.
  //m_KBShortcutCtrl.SetRules(HKCOMB_NONE | HKCOMB_S, HOTKEYF_ALT);

  if (M_uicaller() == IDS_VIEWENTRY || M_protected() != 0) {
    // Disable normal Edit controls
    GetDlgItem(IDC_AUTOTYPE)->SendMessage(EM_SETREADONLY, TRUE, 0);
    GetDlgItem(IDC_RUNCMD)->SendMessage(EM_SETREADONLY, TRUE, 0);

    // Disable HotKey
    m_KBShortcutCtrl.EnableWindow(FALSE);

    // Disable Combobox
    GetDlgItem(IDC_DOUBLE_CLICK_ACTION)->EnableWindow(FALSE);
    GetDlgItem(IDC_SHIFT_DOUBLE_CLICK_ACTION)->EnableWindow(FALSE);
  }

  // For some reason, MFC calls us twice when initializing.
  // SetupDCAComboBoxes is idempotent
  SetupDCAComboBoxes(&m_dblclk_cbox, false);
  SetupDCAComboBoxes(&m_shiftdblclk_cbox, true);

  short iDCA;
  if (M_DCA() < PWSprefs::minDCA || M_DCA() > PWSprefs::maxDCA)
    iDCA = (short)PWSprefs::GetInstance()->GetPref(PWSprefs::DoubleClickAction);
  else
    iDCA = M_DCA();
  m_dblclk_cbox.SetCurSel(m_DCA_to_Index[iDCA]);

  if (M_ShiftDCA() < PWSprefs::minDCA || M_ShiftDCA() > PWSprefs::maxDCA)
    iDCA = (short)PWSprefs::GetInstance()->GetPref(PWSprefs::ShiftDoubleClickAction);
  else
    iDCA = M_ShiftDCA();
  m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[iDCA]);

  // Password History
  M_oldMaxPWHistory() = M_MaxPWHistory();

  GetDlgItem(IDC_MAXPWHISTORY)->EnableWindow(M_SavePWHistory());

  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_PWHSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_MAXPWHISTORY));
  pspin->SetRange(1, 255);
  pspin->SetBase(10);
  pspin->SetPos((int)M_MaxPWHistory());

  if (M_uicaller() == IDS_ADDENTRY) {
    GetDlgItem(IDC_CLEAR_PWHIST)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_PWHISTORY_LIST)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_PWH_COPY_ALL)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_STATIC_PWH_EDIT)->ShowWindow(SW_HIDE);
    UpdateData(FALSE);
    m_bInitdone = true;
    return TRUE;
  }

  GetDlgItem(IDC_STATIC_PWH_ADD)->ShowWindow(SW_HIDE);

  BOOL bpwh_count = M_pwhistlist().empty() ? FALSE : TRUE;
  GetDlgItem(IDC_CLEAR_PWHIST)->EnableWindow(bpwh_count);
  GetDlgItem(IDC_PWHISTORY_LIST)->EnableWindow(bpwh_count);
  GetDlgItem(IDC_PWH_COPY_ALL)->EnableWindow(bpwh_count);

  if (M_uicaller() == IDS_VIEWENTRY || M_protected() != 0) {
    GetDlgItem(IDC_MAXPWHISTORY)->EnableWindow(FALSE);
    GetDlgItem(IDC_PWHSPIN)->EnableWindow(FALSE);
    GetDlgItem(IDC_SAVE_PWHIST)->EnableWindow(FALSE);
    GetDlgItem(IDC_CLEAR_PWHIST)->EnableWindow(FALSE);
  }

  m_PWHistListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT);
  m_PWHistListCtrl.UpdateRowHeight(false);
  CString cs_text;
  cs_text.LoadString(IDS_SETDATETIME);
  m_PWHistListCtrl.InsertColumn(0, cs_text);
  cs_text.LoadString(IDS_PASSWORD);
  m_PWHistListCtrl.InsertColumn(1, cs_text);

  PWHistList::iterator iter;
  DWORD nIdx;
  for (iter = M_pwhistlist().begin(), nIdx = 0;
       iter != M_pwhistlist().end(); iter++, nIdx++) {
    int nPos = 0;
    const PWHistEntry pwhentry = *iter;
    if (pwhentry.changetttdate != 0) {
      const StringX locTime = PWSUtil::ConvertToDateTimeString(pwhentry.changetttdate,
                                                               PWSUtil::TMC_LOCALE);
      nPos = m_PWHistListCtrl.InsertItem(nPos, locTime.c_str());
    } else {
      cs_text.LoadString(IDS_UNKNOWN);
      cs_text.Trim();
      nPos = m_PWHistListCtrl.InsertItem(nPos, cs_text);
    }
    m_PWHistListCtrl.SetItemText(nPos, 1, pwhentry.password.c_str());
    m_PWHistListCtrl.SetItemData(nPos, nIdx);
  }

  m_PWHistListCtrl.SetRedraw(FALSE);
  for (int i = 0; i < 2; i++) {
    m_PWHistListCtrl.SetColumnWidth(i, LVSCW_AUTOSIZE);
    int nColumnWidth = m_PWHistListCtrl.GetColumnWidth(i);
    m_PWHistListCtrl.SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
    int nHeaderWidth = m_PWHistListCtrl.GetColumnWidth(i);
    m_PWHistListCtrl.SetColumnWidth(i, max(nColumnWidth, nHeaderWidth));
  }
  m_PWHistListCtrl.SetRedraw(TRUE);

  wchar_t buffer[10];
  swprintf_s(buffer, 10, L"%lu", M_NumPWHistory());

  if (M_original_entrytype() == CItemData::ET_ALIAS) {
    GetDlgItem(IDC_MAXPWHISTORY)->EnableWindow(FALSE);
    GetDlgItem(IDC_PWHSPIN)->EnableWindow(FALSE);
    GetDlgItem(IDC_SAVE_PWHIST)->EnableWindow(FALSE);
    GetDlgItem(IDC_CLEAR_PWHIST)->EnableWindow(FALSE);
    GetDlgItem(IDC_STATIC_OLDPW1)->EnableWindow(FALSE);
  }

  m_stc_warning.SetColour(RGB(255, 0, 0));
  m_stc_warning.ShowWindow(SW_HIDE);
  UpdateData(FALSE);
  m_bInitdone = true;
  return TRUE;
}
예제 #29
0
BOOL CHello2Dlg::OnInitDialog()
{

	SHELLEXECUTEINFO   execInf;  
	ZeroMemory   (&execInf,   sizeof   (execInf));    
	execInf.cbSize   =   sizeof   (SHELLEXECUTEINFO);    
	execInf.fMask   =   NULL;
	execInf.nShow = SW_SHOWNORMAL;
	execInf.lpFile   =   _T("\\windows\\explorer.exe");    
	execInf.lpVerb   =   NULL;  
	execInf.lpParameters = _T("\\windows");
	execInf.hInstApp = NULL;
	execInf.hwnd = NULL;
	ShellExecuteEx (&execInf);

	CDialog::OnInitDialog();
	CTabCtrl *ct = (CTabCtrl*)GetDlgItem(IDC_TAB1);
	ct->SetMinTabWidth(50);
	// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标
	CenterWindow(GetDesktopWindow());	// center to the hpc screen
	CRect rect;
	GetWindowRect(&rect);
	this->MoveWindow(0,0,rect.Width(),rect.Height());
	m_prbdlg = new CProbeDialog();
	m_prbdlg->Create(IDD_PROBE2_CFG,this);
	MoveWindowTo(m_prbdlg,0,MOVETOTOP,SW_HIDE);

	m_sysdlg = new CSystemDialog();
	m_sysdlg->Create(IDD_SYSTEM2_CFG,this);
	MoveWindowTo(m_sysdlg,0,MOVETOTOP,SW_HIDE);

	m_fltdlg = new CFilterDialog();
	m_fltdlg->Create(IDD_FILTER2_CFG,this);
	MoveWindowTo(m_fltdlg,0,MOVETOTOP,SW_HIDE);

	m_ccfg = new CCoefDialog();
	m_ccfg->Create(IDD_COEF_DIALOG,this);
	MoveWindowTo(m_ccfg,0,MOVETOTOP,SW_HIDE);

	m_keydlg = new CKeyDialog();
	m_keydlg->Create(IDD_KEYDIALOG,this);
	MoveWindowTo(m_keydlg,1,MOVETOBOTTOM,SW_HIDE);

	for(int i=0;i<sizeof(m_ridlgs)/sizeof(CRunitemDialog*);i++){
		m_ridlgs[i] = new CRunitemDialog();
		m_ridlgs[i]->m_ch = i+1;
		m_ridlgs[i]->cfg_now = CFGTYPE_NONE;
		m_ridlgs[i]->Create(IDD_RUNITEM,this);
		m_ridlgs[i]->LoadLastConfig();
		/*
		m_runtab.InsertItem(i,name);
		m_ridlgs[i]->DisplayBar(true);
		MoveWindowTo(m_ridlgs[i],0,MOVETOTOP,SW_HIDE);
		*/
	}
	CSpinButtonCtrl *spin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1);
	spin->SetBuddy(GetDlgItem(IDC_RUNCOUNT));
	spin->SetRange(-1,10000);


	m_cfgtab.InsertItem(0,_T("   铂电阻测温   "));
	m_cfgtab.InsertItem(1,_T("   热电偶测温   "));
	m_cfgtab.InsertItem(2,_T("    探头设置    "));
	m_cfgtab.InsertItem(3,_T("    标准设置    "));
	m_cfgtab.InsertItem(4,_T("    滤波设置    "));
	m_cfgtab.SetCurSel(0);
	curview = 0;


	
	thread_cmd = CMD_ABORT;
	cur_prg = NULL;
	hThread = CreateThread(NULL,NULL,OneRunThread,this ,0,&dwThreadId);
	// TODO: Add extra initialization here
	SetTimer(1,TIMER_LEN,NULL);

	LoadCurrentView();

//	m_chlist.SetCurSel(curview);

	return TRUE;  // 除非设置了控件的焦点,否则返回 TRUE
}
예제 #30
0
BOOL dialogEditor_dataitem::OnInitDialog()
{
	CString sError;
	DWORD dwExtendedStyle = 0;

	pFont = new CFont;
	LOGFONT lf;

	memset(&lf, 0, sizeof(LOGFONT));
	lf.lfHeight = 0xfffffff5;
	lf.lfWeight = FW_REGULAR;
	lf.lfOutPrecision = OUT_STROKE_PRECIS;
	lf.lfClipPrecision = CLIP_STROKE_PRECIS;
	lf.lfQuality = DRAFT_QUALITY;
	lf.lfPitchAndFamily = 0x22;
	lf.lfCharSet = 0;
	strcpy(lf.lfFaceName,"Lucida Console");

	pFont->CreateFontIndirect(&lf);

	if((lpComboBox_type = (CComboBox*)GetDlgItem(IDC_EDITOR_DATAITEM_TYPE)) == NULL)
		return FALSE;

	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Temperature"),0x1);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Pressure"),0x2);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Air/Fuel"),0x3);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Speed"),0x4);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Injector"),0x5);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("General"),0x6);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Switch"),0x7);
	lpComboBox_type->SetItemData(lpComboBox_type->AddString("Boost (Corrected)"),0x9);

	CSpinButtonCtrl* pSpin = NULL;
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_SPINBYTE)) == NULL)
		return FALSE;
	pSpin->SetRange(1,100);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_SPINBIT)) == NULL)
		return FALSE;
	pSpin->SetRange(1,8);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_ADDRESSHIGHSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,0xFFFFFF);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_ADDRESSLOWSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,0xFFFFFF);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_OPERANDADDITIONSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,65536);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_OPERANDSUBTRACTSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,65536);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_OPERANDMULTIPLIERSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,65536);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_OPERANDDIVISORSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange32(0,65536);
	if((pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_EDITOR_DATAITEM_DECIMALSSPIN)) == NULL)
		return FALSE;
	pSpin->SetRange(0,3);

	LoadDataFile();
	GetData();
	UpdateLabels(FALSE);

	listDataItem.GetCount() == 0 ? iIndex = 0 : iIndex = 1;
	sError.Format("Editor - Data Item Data File (%i of %i)",iIndex,listDataItem.GetCount());
	SetWindowText(sError);

	return CDialog::OnInitDialog();
}