Ejemplo n.º 1
0
void WizardConnspeed::fixcontrols() {
	BOOL dl = cAutoDL.GetCheck() == 0;
	::EnableWindow(GetDlgItem(IDC_DOWNLOAD_SLOTS),					dl);
	::EnableWindow(GetDlgItem(IDC_MAX_DOWNLOAD_SP),					dl);

	::EnableWindow(GetDlgItem(IDC_SETTINGS_DOWNLOADS_MAX),			dl);
	::EnableWindow(GetDlgItem(IDC_SETTINGS_DOWNLOADS_SPEED_PAUSE),	dl);
	::EnableWindow(GetDlgItem(IDC_SETTINGS_KBPS2),					dl);


	BOOL ul = cAutoUL.GetCheck() == 0;
	::EnableWindow(GetDlgItem(IDC_UPLOAD_SLOTS),				ul);
	::EnableWindow(GetDlgItem(IDC_MAX_UPLOAD_SP),				ul);
	::EnableWindow(GetDlgItem(IDC_MAX_AUTO_OPENED),				ul);

	::EnableWindow(GetDlgItem(IDC_SETTINGS_UPLOADS_MIN_SPEED),	ul);
	::EnableWindow(GetDlgItem(IDC_SETTINGS_AUTO_SLOTS),			ul);
	::EnableWindow(GetDlgItem(IDC_SETTINGS_UPLOADS_SLOTS),		ul);
	::EnableWindow(GetDlgItem(IDC_SETTINGS_KBPS),				ul);


	TCHAR buf[64];
	GetDlgItemText(IDC_CONNECTION, buf, sizeof(buf) +1);
	double uploadvalue = Util::toDouble(Text::fromT(buf));
	setUploadLimits(uploadvalue);

	TCHAR buf2[64];
	GetDlgItemText(IDC_DOWN_SPEED, buf2, sizeof(buf2) +1);
	double downloadvalue = Util::toDouble(Text::fromT(buf2));
	setDownloadLimits(downloadvalue);
}
Ejemplo n.º 2
0
void WizardConnspeed::updateAutoValues() {
	fixcontrols();

	TCHAR buf1[64];
	GetDlgItemText(IDC_DOWN_SPEED, buf1, sizeof(buf1) +1);
	double valueDL = Util::toDouble(Text::fromT(buf1));
	setDownloadLimits(valueDL);

	TCHAR buf2[64];
	GetDlgItemText(IDC_CONNECTION, buf2, sizeof(buf2) +1);
	double valueUL = Util::toDouble(Text::fromT(buf2));
	setUploadLimits(valueUL);
}
Ejemplo n.º 3
0
LRESULT WizardConnspeed::OnUploadSpeed(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/)
{
	WinUtil::onConnSpeedChanged(wNotifyCode, wID, hWndCtl);
	TCHAR buf2[64];
	switch(wNotifyCode) {
		case CBN_EDITCHANGE:
			GetDlgItemText(IDC_CONNECTION, buf2, sizeof(buf2) +1);
			break;
		case CBN_SELENDOK:
			ctrlUpload.GetLBText(ctrlUpload.GetCurSel(), buf2);
			break;

	}

	double value = Util::toDouble(Text::fromT(buf2));
	setUploadLimits(value);

	return 0;
}
Ejemplo n.º 4
0
void SpeedPage::updateValues(WORD wNotifyCode) {

		//upload
		TCHAR buf[64];
		if (wNotifyCode == CBN_SELENDOK) {
			ctrlUpload.GetLBText(ctrlUpload.GetCurSel(), buf);
		} else {
			GetDlgItemText(IDC_CONNECTION, buf, sizeof(buf) +1);
		}

		double uploadvalue = Util::toDouble(Text::fromT(buf));
		setUploadLimits(uploadvalue);

		//download
		TCHAR buf2[64];
		if (wNotifyCode == CBN_SELENDOK) {
			ctrlDownload.GetLBText(ctrlDownload.GetCurSel(), buf2);
		} else {
			GetDlgItemText(IDC_DL_SPEED, buf2, sizeof(buf2) +1);
		}

		double downloadvalue = Util::toDouble(Text::fromT(buf2));
		setDownloadLimits(downloadvalue);
}