Example #1
0
void CReferenceDlg::OnSelchangeCombobook() 
{
	int nMaxChapter, nMaxVerse;
	CWnd* pWnd;
	CSpinButtonCtrl* pSpin;
	CReferenceUtils ref;

	UpdateData(TRUE);
	m_nBook=m_ncboBook+1;                //get the selected book
	nMaxChapter=ref.GetMaxChapter(m_nBook, m_nSourceText); //get num of chapters in book
	pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINCHAPTER);
	pSpin->SetRange(1,nMaxChapter);       
	pSpin->SetPos(1);
	m_strChapter=L"1";
	pWnd=GetDlgItem(IDC_SPINCHAPTER);
	if (nMaxChapter==1) pWnd->EnableWindow(FALSE);    //if only one chapter in book, disable
	else pWnd->EnableWindow(TRUE);

	nMaxVerse=ref.GetMaxVerse(m_nBook,1, m_nSourceText, m_pDoc);   //get verses in first chapter
	pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
	pSpin->SetRange(1,nMaxVerse);
	pSpin->SetPos(1);
	m_strVerse=L"1";
	pWnd=GetDlgItem(IDC_SPINVERSE);
	if (nMaxVerse==1) pWnd->EnableWindow(FALSE);    //if only one chapter in book, disable
	else pWnd->EnableWindow(TRUE);
	UpdateData(FALSE);
	m_nChapter=m_nVerse=1;	
}
BOOL CInstrumentEditorN163Wave::OnInitDialog()
{
	CInstrumentEditPanel::OnInitDialog();

	// Create wave editor
	CRect rect(SX(20), SY(30), 0, 0);
	m_pWaveEditor = new CWaveEditorN163(10, 8, 32, 16);
	m_pWaveEditor->CreateEx(WS_EX_CLIENTEDGE, NULL, _T(""), WS_CHILD | WS_VISIBLE, rect, this);
	m_pWaveEditor->ShowWindow(SW_SHOW);
	m_pWaveEditor->UpdateWindow();

	CComboBox *pSize = (CComboBox*)GetDlgItem(IDC_WAVE_SIZE);

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

	pIndexSpin->SetRange(0, CInstrumentN163::MAX_WAVE_COUNT - 1);
	pWavesSpin->SetRange(0, CInstrumentN163::MAX_WAVE_COUNT - 1);
	
	CComboBox *pWaveSize = (CComboBox*)GetDlgItem(IDC_WAVE_SIZE);

	for (int i = 0; i < CInstrumentN163::MAX_WAVE_SIZE; i += 4) {
		CString txt;
		txt.Format(_T("%i"), i + 4);
		pWaveSize->AddString(txt);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
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
}
BOOL
CColorAdjustDialog::OnInitDialog()
{
  UpdateButtons();
  CheckDlgButton(IDC_USE_RED,   BST_CHECKED);
  CheckDlgButton(IDC_USE_GREEN, BST_CHECKED);
  CheckDlgButton(IDC_USE_BLUE,  BST_CHECKED);
  CheckDlgButton(IDC_USE_ALPHA, BST_UNCHECKED);
  SetDlgItemInt(IDC_EDIT_RED,   m_RedValue);
  SetDlgItemInt(IDC_EDIT_GREEN, m_GreenValue);
  SetDlgItemInt(IDC_EDIT_BLUE,  m_BlueValue);
  SetDlgItemInt(IDC_EDIT_ALPHA, m_AlphaValue);
  CSpinButtonCtrl* spin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_RED);
  if (spin) {
    spin->SetRange(-255, 255);
  }
  spin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_GREEN);
  if (spin) {
    spin->SetRange(-255, 255);
  }
  spin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_BLUE);
  if (spin) {
    spin->SetRange(-255, 255);
  }
  spin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_ALPHA);
  if (spin) {
    spin->SetRange(-255, 255);
  }
  OnChannelChanged();
  return FALSE;
}
void C3DGORangeWire::UpdateWireIntervalRange()
{
	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);
	}
}
Example #6
0
BOOL CDialogReBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle, UINT nID)
{
	CSpinButtonCtrl *Spin;

	if (!CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID))
		return FALSE;

	Spin = (CSpinButtonCtrl*)GetDlgItem(IDC_HIGHLIGHTSPIN1);
	Spin->SetRange(0, 32);

	Spin = (CSpinButtonCtrl*)GetDlgItem(IDC_HIGHLIGHTSPIN2);
	Spin->SetRange(0, 32);

	return TRUE;
}
Example #7
0
BOOL COptionsDisplay::OnInitDialog() 
{
  COptions_PropertyPage::OnInitDialog();

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

  if (m_ShowUsernameInTree == FALSE) {
    m_ShowPasswordInTree = FALSE;
    GetDlgItem(IDC_DEFPWSHOWINTREE)->EnableWindow(FALSE);
  }

  OnPreWarn();
  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_PREWARNEXPIRYSPIN);

  pspin->SetBuddy(GetDlgItem(IDC_PREEXPIRYWARNDAYS));
  pspin->SetRange(1, 30);
  pspin->SetBase(10);
  pspin->SetPos(m_PreExpiryWarnDays);

  return TRUE;  // return TRUE unless you set the focus to a control
  // EXCEPTION: OCX Property Pages should return FALSE
}
Example #8
0
BOOL COptionsSecurity::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
  }

  OnLockOnIdleTimeout();
  CSpinButtonCtrl *pspin;

  pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_IDLESPIN);
  pspin->SetBuddy(GetDlgItem(IDC_IDLE_TIMEOUT));
  pspin->SetRange(1, 120);
  pspin->SetBase(10);
  pspin->SetPos(m_IdleTimeOut);

  CSliderCtrl *pslider = (CSliderCtrl *)GetDlgItem(IDC_HASHITERSLIDER);
  pslider->SetRange(MinHIslider, MaxHIslider);
  pslider->SetTicFreq(1);
  pslider->SetPos(m_HashIterSliderValue);

  return TRUE;
}
Example #9
0
// CEmployeeModify 消息处理程序
BOOL CEmployeeModify::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  在此添加额外的初始化
	CSpinButtonCtrl* pSpin = (CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_AGE);
	pSpin->SetRange(0,100);
	pSpin->SetPos(m_nAge);

	//
	pConn=mySql.openConnection(_com_util::ConvertStringToBSTR(m_strConn),"","",adOpenUnspecified);
	_RecordsetPtr pSet;
	try
	{
		pSet = mySql.getUserDetailsByUserId(m_strNo,pConn);
	}
	catch(_com_error e)
	{
		AfxMessageBox(e.Description());
	}
	if( !pSet->EndOfFile )
	{
		pSet->MoveFirst();
		m_strSex = (LPCTSTR)(_bstr_t)pSet->GetCollect(_variant_t("Sex"));
		m_nAge = atoi((_bstr_t)pSet->GetCollect(_variant_t("Age")));
		m_strPwd1 = m_strPwd2 = (LPCTSTR)(_bstr_t)pSet->GetCollect(_variant_t("Pwd"));
	}

	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
Example #10
0
void CReferenceDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	int nMaxVerse;
	wchar_t c[5];
	CSpinButtonCtrl* pSpin;
	CReferenceUtils ref;

	switch(pScrollBar->GetDlgCtrlID())
	{
		case IDC_SPINCHAPTER:
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINCHAPTER);
			m_nChapter=pSpin->GetPos();
			_itow(m_nChapter,c,10);
			m_strChapter=c;
			nMaxVerse=ref.GetMaxVerse(m_nBook,m_nChapter, m_nSourceText, m_pDoc);
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
			pSpin->SetRange(1,nMaxVerse);  //set the verse spinner's range
			pSpin->SetPos(1);                //select first verse
			m_nVerse=1;
			m_strVerse=L"1";
			break;
		case IDC_SPINVERSE:
			pSpin=(CSpinButtonCtrl*) GetDlgItem(IDC_SPINVERSE);
			m_nVerse=pSpin->GetPos();
			_itow(m_nVerse,c,10);
			m_strVerse=c;
			break;
	}
	UpdateData(FALSE);
}
void CSequenceInstrumentEditPanel::SetupDialog(LPCTSTR *pListItems)
{
	// Instrument settings
	CListCtrl *pList = static_cast<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 = SEQ_COUNT - 1; i > -1; i--) {
		pList->InsertItem(0, _T(""), 0);
		pList->SetCheck(0, 0);
		pList->SetItemText(0, 1, _T("0"));
		pList->SetItemText(0, 2, pListItems[i]);
	}
	
	pList->SetItemState(m_iSelectedSetting, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);

	SetDlgItemInt(IDC_SEQ_INDEX, m_iSelectedSetting);

	CSpinButtonCtrl *pSequenceSpin = static_cast<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);
}
Example #12
0
BOOL CColorPage2::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	m_wndColorPicker.SetPalette (m_pDialog->GetPalette ());
	m_wndColorPicker.SetType(CBCGColorPickerCtrl::PICKER);

	double hue, luminance, saturation;

	m_wndColorPicker.GetHLS(&hue, &luminance, &saturation);
	
	m_wndLuminance.SetPalette (m_pDialog->GetPalette ());
	m_wndLuminance.SetType(CBCGColorPickerCtrl::LUMINANCE);
	m_wndLuminance.SetHLS(hue, luminance, saturation);
	m_wndLuminance.SetLuminanceBarWidth(14);

	// Initialize spin controls:
	for (UINT uiID = IDC_BCGBARRES_SPIN1; uiID <= IDC_BCGBARRES_SPIN6; uiID++)
	{
		CSpinButtonCtrl* pWnd = (CSpinButtonCtrl*) GetDlgItem (uiID);
		if (pWnd == NULL)
		{
			VERIFY (FALSE);
			break;
		}

		pWnd->SetRange (0, 255);
	}

	m_bIsReady = TRUE;
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
/*
	OnInitDialog()
*/
BOOL CWallBrowserOneParamDlg::OnInitDialog(void)
{
	CDialog::OnInitDialog();

	HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	SetIcon(hIcon,TRUE);
	SetIcon(hIcon,FALSE);
	
	SetDlgItemText(IDC_STATIC_PROPERTY,m_strProperty);
	SetDlgItemText(IDC_STATIC_OPERATION,m_strOperation);

	CSpinButtonCtrl *pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_VALUE);
	pSpin->SetRange((int)m_nMin,(int)m_nMax); 
	pSpin->SetPos((int)m_nDefaultValue);
	pSpin->SetBuddy(GetDlgItem(IDC_EDIT_VALUE));

	m_ctrlSlider.SetRangeMin((int)m_nMin,TRUE);
	m_ctrlSlider.SetRangeMax((int)m_nMax,TRUE);
	m_ctrlSlider.SetPos((int)m_nDefaultValue);

	CString strValue;
	strValue.Format("%d",(int)m_nMin);
	SetDlgItemText(IDC_STATIC_RANGE_MIN,strValue);
	strValue.Format("%d",(int)m_nMax);
	SetDlgItemText(IDC_STATIC_RANGE_MAX,strValue);

	UpdateData(FALSE);

	return(TRUE); 
}
BOOL CPrg_Data::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	CSpinButtonCtrl *pSpin = (CSpinButtonCtrl*) GetDlgItem (IDC_AUTOSAVESPIN);
	pSpin->SetRange (1, UD_MAXVAL);
	SetDlgItemInt (IDC_AUTOSAVE, _App.AutosaveInterval () / 60 / 1000, FALSE);

	ApplyLanguage ();

	CString str = _App.DataFolder ();
	if (str.IsEmpty ())
	{
		CheckDlgButton (IDC_KEEP_1, BST_CHECKED);
	}
	else
	{
		CheckDlgButton (IDC_KEEP_2, BST_CHECKED);
		SetDlgItemText (IDC_FOLDER, str);
	}

	UpdateEnabled ();
		
	return TRUE;  
	              
}
Example #15
0
// Following copied from AddEdit_PasswordPolicy.cpp. Move to common mixin?
static void setupBuddy(CWnd *p, int spinid, int id, int &length, short min = 0)
{
  CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)p->GetDlgItem(spinid);
  pspin->SetBuddy(p->GetDlgItem(id));
  pspin->SetRange(min, 1024);
  pspin->SetBase(10);
  pspin->SetPos((int)length);
}
BOOL CInstrumentEditorDPCM::OnInitDialog()
{
	CInstrumentEditPanel::OnInitDialog();

	CString Text;

	m_iOctave = 3;
	m_iSelectedKey = 0;

	CComboBox *pPitch  = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH));
	CComboBox *pOctave = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_OCTAVE));

	m_pTableListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_TABLE));
	m_pTableListCtrl->DeleteAllItems();
	m_pTableListCtrl->InsertColumn(0, _T("Key"), LVCFMT_LEFT, 30);
	m_pTableListCtrl->InsertColumn(1, _T("Pitch"), LVCFMT_LEFT, 35);
	m_pTableListCtrl->InsertColumn(2, _T("Sample"), LVCFMT_LEFT, 90);
	m_pTableListCtrl->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);

	m_pSampleListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_SAMPLE_LIST));
	m_pSampleListCtrl->DeleteAllItems();
	m_pSampleListCtrl->InsertColumn(0, _T("#"), LVCFMT_LEFT, 22);
	m_pSampleListCtrl->InsertColumn(1, _T("Name"), LVCFMT_LEFT, 88);
	m_pSampleListCtrl->InsertColumn(2, _T("Size"), LVCFMT_LEFT, 39);
	m_pSampleListCtrl->SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);

	for (int i = 0; i < 16; ++i) {
		Text.Format(_T("%i"), i);
		pPitch->AddString(Text);
	}

	pPitch->SetCurSel(15);

	for (int i = 0; i < OCTAVE_RANGE; ++i) {
		Text.Format(_T("%i"), i);
		pOctave->AddString(Text);
	}

	pOctave->SetCurSel(3);
	CheckDlgButton(IDC_LOOP, 0);
	m_pTableListCtrl->DeleteAllItems();

	for (int i = 0; i < 12; ++i)
		m_pTableListCtrl->InsertItem(i, KEY_NAMES[i], 0);

	BuildSampleList();
	m_iSelectedSample = 0;

	CSpinButtonCtrl *pSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_DELTA_SPIN);
	pSpin->SetRange(-1, 127);
	pSpin->SetPos(-1);

	SetDlgItemText(IDC_DELTA_COUNTER, _T("Off"));

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Example #17
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;
}
Example #18
0
BOOL CGrid::OnInitDialog() {
	CDialog::OnInitDialog();

	CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_SPIN_GRID_SIZE);
	pSpin->SetRange(2, 20);
	if ((m_GridSize < 2) || (m_GridSize > 20))
		m_GridSize = The_grid->ncols / 5;
	pSpin->SetPos(m_GridSize);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL C3DGOAxes::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	CSpinButtonCtrl *pAW = (CSpinButtonCtrl*) GetDlgItem(IDC_AXIS_WIDTH_SPIN);
	pAW->SetRange(1, 20);
	pAW->SetPos(m_AxisWidth);

	SetEnabledFields(m_AxisOn);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CDownloaderProperties_MirrorsPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	UINT anIDs [] = {
		IDC_MAXMIRRORSSPIN, IDC_RECALCSPIN
	};

	for (int i = 0; i < sizeof (anIDs) / sizeof (UINT); i++)
	{
		CSpinButtonCtrl *p = (CSpinButtonCtrl*) GetDlgItem (anIDs [i]);
		p->SetRange (1, UD_MAXVAL);
	}

	m_wndMinSizeDim.AddString (LS (L_B)); 
	m_wndMinSizeDim.AddString (LS (L_KB)); 
	m_wndMinSizeDim.AddString (LS (L_MB));

	CheckDlgButton (IDC_AUTO, _App.Mirr_AutoSearch () ? BST_CHECKED : BST_UNCHECKED);
	if (_App.Mirr_MaxCount () != UINT_MAX)
	{
		CheckDlgButton (IDC_MAXMIRRORS, BST_CHECKED);
		SetDlgItemInt (IDC_MAXMIRRORSVAL, _App.Mirr_MaxCount (), FALSE);
	}
	else
		SetDlgItemInt (IDC_MAXMIRRORSVAL, 10, FALSE);

	CheckDlgButton (IDC_CALCSPEED, _App.Mirr_CalcSpeed () ? BST_CHECKED : BST_UNCHECKED);

	if (_App.Mirr_RecalcSpeedTime ())
	{
		CheckDlgButton (IDC_RECALCSPEED, BST_CHECKED);
		SetDlgItemInt (IDC_RECALCVAL, _App.Mirr_RecalcSpeedTime (), FALSE);
	}
	else
		SetDlgItemInt (IDC_RECALCVAL, 60, FALSE);

	vmsDialogHelper::SetDlgBytesGroup (this, _App.Mirr_FileMinSize (), IDC_FILEMINSIZE, IDC_FILEMINSIZEDIM);

	CheckDlgButton (IDC_DONTIFSIZEUNK, _App.Mirr_DontSearchIfSizeUnk () ? BST_CHECKED : BST_UNCHECKED);

	m_wndMirrServers.AddString ("FileSearching.com");
	m_wndMirrServers.AddString ("FindFiles.com");
	m_wndMirrServers.SetCurSel (_App.Mirr_Server ());
	
	ApplyLanguage ();
	UpdateEnabled ();
	
	return TRUE;  
	              
}
BOOL COptionsBackup::OnInitDialog()
{
  COptions_PropertyPage::OnInitDialog();

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

  if (!GetMainDlg()->IsDBReadOnly())
    GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->ShowWindow(SW_HIDE);

  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();

  InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 4);
  // Note naming convention: string IDS_xxx corresponds to control IDC_xxx
  AddTool(IDC_BACKUPBEFORESAVE,        IDS_BACKUPBEFORESAVE);
  AddTool(IDC_USERBACKUPOTHERLOCATION, IDS_USERBACKUPOTHERLOCATION);
  ActivateToolTip();

  return TRUE;
}
Example #22
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();
}
Example #23
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
}
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;
}
Example #25
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
}
/*
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);
}
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;  
	              
}
Example #29
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;
}
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
}