LRESULT DlgSettingsBehavior::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_behaviorSettings.Load(m_pOptionsRoot);

	m_nCopyNewlineChar	= static_cast<int>(m_behaviorSettings.copyPasteSettings.copyNewlineChar);
	m_nScrollPageType	= m_behaviorSettings.scrollSettings.dwPageScrollRows ? 1 : 0;
	m_bFlashInactiveTab	= (m_behaviorSettings.tabHighlightSettings.dwFlashes > 0);
	m_strLeftDelimiters	= m_behaviorSettings.copyPasteSettings.strLeftDelimiters.c_str();
	m_strRightDelimiters	= m_behaviorSettings.copyPasteSettings.strRightDelimiters.c_str();

	CUpDownCtrl	spin;
	UDACCEL		udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_SCROLL_PAGE_ROWS));
	spin.SetRange(1, 500);
	udAccel.nSec = 2;
	udAccel.nInc = 1;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_TAB_FLASHES));
	spin.SetRange(1, 500);
	udAccel.nSec = 2;
	udAccel.nInc = 1;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	DoDataExchange(DDX_LOAD);

	EnableScrollControls();
	EnableFlashTabControls();

	return TRUE;
}
Exemple #2
0
LRESULT DlgSettingsFont::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_comboFontSmoothing.Attach(GetDlgItem(IDC_COMBO_SMOOTHING));
	Helpers::LoadCombo(m_comboFontSmoothing, IDC_COMBO_SMOOTHING);

	m_fontSettings.Load(m_pOptionsRoot);

	m_strFontName	= m_fontSettings.strName.c_str();

	m_comboFontSmoothing.SetCurSel(static_cast<int>(m_fontSettings.fontSmoothing));

	CUpDownCtrl	spin;

	spin.Attach(GetDlgItem(IDC_SPIN_FONT_SIZE));
	spin.SetRange(5, 36);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_FONT_EXTRAWIDTH));
	spin.SetRange(0, 30);
	spin.Detach();

	EnableControls();

	DoDataExchange(DDX_LOAD);
	return TRUE;
}
LRESULT DlgSettingsBehavior::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_behaviorSettings.Load(m_pOptionsRoot);

	m_nCopyNewlineChar	= static_cast<int>(m_behaviorSettings.copyPasteSettings.copyNewlineChar);
	m_nScrollPageType	= m_behaviorSettings.scrollSettings.dwPageScrollRows ? 1 : 0;
	m_bFlashInactiveTab	= (m_behaviorSettings.tabHighlightSettings.dwFlashes > 0);
	// vds: >>
	m_nAllowMultipleInstances = m_behaviorSettings.oneInstanceSettings.bAllowMultipleInstances ? 1 : 0;
	m_nReuseTab = m_behaviorSettings.oneInstanceSettings.bReuseTab ? 1 : 0;
	m_nReuseBusyTab = m_behaviorSettings.oneInstanceSettings.bReuseBusyTab ? 1 : 0;

	m_nIntegrateWithExplorer = m_behaviorSettings.shellSettings.IsConsoleIntegratedWithExplorer();
	m_nRunConsoleMenuItem = m_behaviorSettings.shellSettings.bRunConsoleMenItem ? 1 : 0;
	m_nRunConsoleTabMenuItem = m_behaviorSettings.shellSettings.bRunConsoleTabMenuItem ? 1 : 0;
	m_nPostConsoleMenuItem = m_behaviorSettings.shellSettings.bPostConsoleMenItem ? 1 : 0;
	m_nPostConsoleTabMenuItem = m_behaviorSettings.shellSettings.bPostConsoleTabMenuItem ? 1 : 0;
	// vds: <<

	CUpDownCtrl	spin;
	UDACCEL		udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_SCROLL_PAGE_ROWS));
	spin.SetRange(1, 500);
	udAccel.nSec = 2;
	udAccel.nInc = 1;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_TAB_FLASHES));
	spin.SetRange(1, 500);
	udAccel.nSec = 2;
	udAccel.nInc = 1;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	DoDataExchange(DDX_LOAD);

	EnableScrollControls();
	EnableFlashTabControls();

	// vds: >>
	if (!m_behaviorSettings.shellSettings.CouldIntegrateConsoleWithExplorer()) {
		GetDlgItem(IDC_INTEGRATE_WITH_EXPLORER).EnableWindow(False);
	}
	EnableOnInstanceControls();
	// vds: <<

	return TRUE;
}
LRESULT DlgSettingsBehavior::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_behaviorSettings.Load(m_pOptionsRoot);

	m_nCopyOnSelect	= m_behaviorSettings.copyPasteSettings.bCopyOnSelect ? 1 : 0;
	m_nNoWrap		= m_behaviorSettings.copyPasteSettings.bNoWrap ? 1 : 0;
	m_nTrimSpaces	= m_behaviorSettings.copyPasteSettings.bTrimSpaces ? 1 : 0;

	m_nScrollPageType= m_behaviorSettings.scrollSettings.dwPageScrollRows ? 1 : 0;

	CUpDownCtrl	spin;
	UDACCEL		udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_SCROLL_PAGE_ROWS));
	spin.SetRange(1, 500);
	udAccel.nSec = 2;
	udAccel.nInc = 1;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	EnableScrollControls();
	
	DoDataExchange(DDX_LOAD);
	return TRUE;
}
LRESULT DlgSettingsStyles::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    m_controlsSettings.Load(m_pOptionsRoot);
    m_stylesSettings.Load(m_pOptionsRoot);
    m_transparencySettings.Load(m_pOptionsRoot);

    CUpDownCtrl	spin;
    UDACCEL udAccel;

    spin.Attach(GetDlgItem(IDC_SPIN_INSIDE_BORDER));
    spin.SetRange(0, 10);
    spin.Detach();

    spin.Attach(GetDlgItem(IDC_SPIN_QUAKE_ANIMATION_TIME));
    spin.SetRange(10, 20000);
    udAccel.nSec = 0;
    udAccel.nInc = 10;
    spin.SetAccel(1, &udAccel);
    spin.Detach();

    m_sliderActiveAlpha.Attach(GetDlgItem(IDC_ACTIVE_ALPHA));
    m_sliderActiveAlpha.SetRange(0, 255 - TransparencySettings::minAlpha);
    m_sliderActiveAlpha.SetTicFreq(5);
    m_sliderActiveAlpha.SetPageSize(5);

    m_sliderInactiveAlpha.Attach(GetDlgItem(IDC_INACTIVE_ALPHA));
    m_sliderInactiveAlpha.SetRange(0, 255 - TransparencySettings::minAlpha);
    m_sliderInactiveAlpha.SetTicFreq(5);
    m_sliderInactiveAlpha.SetPageSize(5);

    m_sliderActiveAlpha.SetPos(255 - m_transparencySettings.byActiveAlpha);
    m_sliderInactiveAlpha.SetPos(255 - m_transparencySettings.byInactiveAlpha);

    UpdateSliderText(m_sliderActiveAlpha.m_hWnd);
    UpdateSliderText(m_sliderInactiveAlpha.m_hWnd);

    EnableTabControls();
    EnableScrollbarControls();
    EnableQuakeControls();
    EnableTransparencyControls();

    DoDataExchange(DDX_LOAD);
    return TRUE;
}
LRESULT DlgSettingsStyles::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_controlsSettings.Load(m_pOptionsRoot);
	m_stylesSettings.Load(m_pOptionsRoot);
	m_transparencySettings.Load(m_pOptionsRoot);

	m_nShowMenu		= m_controlsSettings.bShowMenu ? 1 : 0;
	m_nShowToolbar	= m_controlsSettings.bShowToolbar ? 1 : 0;
	m_nShowStatusbar= m_controlsSettings.bShowStatusbar ? 1 : 0;
	m_nShowTabs		= m_controlsSettings.bShowTabs ? 1 : 0;
	m_nHideSingleTab= m_controlsSettings.bHideSingleTab ? 1 : 0;
	m_nTabsOnBottom	= m_controlsSettings.bTabsOnBottom ? 1 : 0;
	m_nShowScrollbars= m_controlsSettings.bShowScrollbars ? 1 : 0;
	m_nFlatScrollbars= m_controlsSettings.bFlatScrollbars ? 1 : 0;

	m_nShowCaption	= m_stylesSettings.bCaption ? 1 : 0;
	m_nResizable	= m_stylesSettings.bResizable ? 1 : 0;
	m_nTaskbarButton= m_stylesSettings.bTaskbarButton ? 1 : 0;
	m_nBorder		= m_stylesSettings.bBorder ? 1 : 0;
	m_nTrayIcon		= m_stylesSettings.bTrayIcon ? 1 : 0;
	
	CUpDownCtrl	spin;

	spin.Attach(GetDlgItem(IDC_SPIN_INSIDE_BORDER));
	spin.SetRange(0, 10);
	spin.Detach();

	m_sliderActiveAlpha.Attach(GetDlgItem(IDC_ACTIVE_ALPHA));
	m_sliderActiveAlpha.SetRange(0, 255);
	m_sliderActiveAlpha.SetTicFreq(5);
	m_sliderActiveAlpha.SetPageSize(5);

	m_sliderInactiveAlpha.Attach(GetDlgItem(IDC_INACTIVE_ALPHA));
	m_sliderInactiveAlpha.SetRange(0, 255);
	m_sliderInactiveAlpha.SetTicFreq(5);
	m_sliderInactiveAlpha.SetPageSize(5);

	m_sliderActiveAlpha.SetPos(255 - m_transparencySettings.byActiveAlpha);
	m_sliderInactiveAlpha.SetPos(255 - m_transparencySettings.byInactiveAlpha);

	UpdateSliderText(m_sliderActiveAlpha.m_hWnd);
	UpdateSliderText(m_sliderInactiveAlpha.m_hWnd);

	EnableTabControls();
	EnableTransparencyControls();

	DoDataExchange(DDX_LOAD);
	return TRUE;
}
LRESULT DlgSettingsConsole::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_consoleSettings.Load(m_pOptionsRoot);
	m_strShell		= m_consoleSettings.strShell.c_str();
	m_strInitialDir	= m_consoleSettings.strInitialDir.c_str();

	m_nStartHidden	= m_consoleSettings.bStartHidden ? 1 : 0;
	m_nSaveSize		= m_consoleSettings.bSaveSize ? 1 : 0;

	CUpDownCtrl	spin;
	UDACCEL udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_CHANGE_REFRESH));
	spin.SetRange(5, 200);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_REFRESH));
	spin.SetRange(50, 2000);
	udAccel.nSec = 0;
	udAccel.nInc = 10;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_ROWS));
	spin.SetRange(10, 200);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_BUFFER_ROWS));
	spin.SetRange(10, 9999);
	udAccel.nSec = 0;
	udAccel.nInc = 10;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_COLUMNS));
	spin.SetRange(10, 200);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_BUFFER_COLUMNS));
	spin.SetRange(10, 200);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	DoDataExchange(DDX_LOAD);
	return TRUE;
}
Exemple #8
0
// При инициализации.
LRESULT RSSPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	if (m_CodeingList.empty())
	{
		m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_AUTO), RSSManager::getInstance()->getCodeing(0)));
		m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_UTF8), RSSManager::getInstance()->getCodeing(1)));
		m_CodeingList.insert(CodeingMapPair(TSTRING(RSS_CODEING_CP1251), RSSManager::getInstance()->getCodeing(2)));
	}
	
	PropPage::translate((HWND)(*this), texts);
	PropPage::read((HWND)*this, items);
	
	CRect rc;
	
	ctrlCommands.Attach(GetDlgItem(IDC_RSS_ITEMS));
	ctrlCommands.GetClientRect(rc);
	
	ctrlCommands.InsertColumn(0, CTSTRING(RSS_URL), LVCFMT_LEFT, rc.Width() / 3, 0);
	ctrlCommands.InsertColumn(1, CTSTRING(RSS_TITLE), LVCFMT_LEFT, rc.Width() / 3, 1);
	ctrlCommands.InsertColumn(2, CTSTRING(RSS_CODEING), LVCFMT_LEFT, rc.Width() / 3, 1);
	SET_EXTENDENT_LIST_VIEW_STYLE(ctrlCommands);
#ifdef USE_SET_LIST_COLOR_IN_SETTINGS
	SET_LIST_COLOR_IN_SETTING(ctrlCommands);
#endif
	
	
	CUpDownCtrl spin;
	spin.Attach(GetDlgItem(IDC_RSS_AUTO_REFRESH_TIME_SPIN));
	spin.SetRange(1, 10);
	spin.Detach();
	
	// Do specialized reading here
	const RSSManager::FeedList& lst = RSSManager::getInstance()->lockFeedList();
	auto cnt = ctrlCommands.GetItemCount();
	for (auto i = lst.cbegin(); i != lst.cend(); ++i)
	{
		addEntry((*i), cnt++);
	}
	RSSManager::getInstance()->unlockFeedList();
	
	return TRUE;
}
Exemple #9
0
LRESULT OperaColorsPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	PropPage::translate((HWND)(*this), texts);
	PropPage::read(*this, items);
	PropPage::read(*this, items, listItems, GetDlgItem(IDC_OPERACOLORS_BOOLEANS));
	
	ctrlList.Attach(GetDlgItem(IDC_OPERACOLORS_BOOLEANS));
	
	crProgressDown = SETTING(DOWNLOAD_BAR_COLOR);
	crProgressUp = SETTING(UPLOAD_BAR_COLOR);
	crProgressTextDown = SETTING(PROGRESS_TEXT_COLOR_DOWN);
	crProgressTextUp = SETTING(PROGRESS_TEXT_COLOR_UP);
	
	ctrlProgressDownDrawer.Attach(GetDlgItem(IDC_PROGRESS_COLOR_DOWN_SHOW));
	ctrlProgressUpDrawer.Attach(GetDlgItem(IDC_PROGRESS_COLOR_UP_SHOW));
	
	CUpDownCtrl ctrlSpin;
	ctrlSpin.Attach(GetDlgItem(IDC_FLAT_SPIN));
	ctrlSpin.SetRange(1, 5);
	ctrlSpin.Detach();
	
	updateProgress();
	
	crMenubarLeft = SETTING(MENUBAR_LEFT_COLOR);
	crMenubarRight = SETTING(MENUBAR_RIGHT_COLOR);
	ctrlLeftColor.Attach(GetDlgItem(IDC_SETTINGS_ODC_MENUBAR_LEFT));
	ctrlRightColor.Attach(GetDlgItem(IDC_SETTINGS_ODC_MENUBAR_RIGHT));
	ctrlTwoColors.Attach(GetDlgItem(IDC_SETTINGS_ODC_MENUBAR_USETWO));
	ctrlBumped.Attach(GetDlgItem(IDC_SETTINGS_ODC_MENUBAR_BUMPED));
	ctrlMenubarDrawer.Attach(GetDlgItem(IDC_SETTINGS_ODC_MENUBAR_COLOR));
	
	checkBox(IDC_SETTINGS_ODC_MENUBAR_BUMPED, BOOLSETTING(MENUBAR_BUMPED));
	checkBox(IDC_SETTINGS_ODC_MENUBAR_USETWO, BOOLSETTING(MENUBAR_TWO_COLORS));
	BOOL b;
	onMenubarClicked(0, IDC_SETTINGS_ODC_MENUBAR_USETWO, 0, b);
	// Do specialized reading here
	
	return TRUE;
}
LRESULT DlgSettingsAppearance::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	m_comboDocking.Attach(GetDlgItem(IDC_COMBO_DOCKING));
	Helpers::LoadCombo(m_comboDocking, IDC_COMBO_DOCKING);
	m_comboZOrder.Attach(GetDlgItem(IDC_COMBO_ZORDER));
	Helpers::LoadCombo(m_comboZOrder, IDC_COMBO_ZORDER);

	m_windowSettings.Load(m_pOptionsRoot);
	m_positionSettings.Load(m_pOptionsRoot);

	m_strWindowTitle = m_windowSettings.strTitle.c_str();
	m_strMainTitleFormat = m_windowSettings.strMainTitleFormat.c_str();
	m_strTabTitleFormat  = m_windowSettings.strTabTitleFormat.c_str();
	m_bTrimTabTitles = (m_windowSettings.dwTrimTabTitles > 0);
	m_strWindowIcon  = m_windowSettings.strIcon.c_str();

	m_bShowMaximized = m_positionSettings.bShowMaximized;

	m_bUsePosition   = ((m_positionSettings.nX == -1) && (m_positionSettings.nY == -1)) ? false : true;
	m_nX             = m_bUsePosition ? m_positionSettings.nX : 0;
	m_nY             = m_bUsePosition ? m_positionSettings.nY : 0;

	m_bUseSize       = ((m_positionSettings.nW == -1) && (m_positionSettings.nH == -1)) ? false : true;
	m_nW             = m_bUseSize ? m_positionSettings.nW : 0;
	m_nH             = m_bUseSize ? m_positionSettings.nH : 0;

	m_bSnapToEdges   = (m_positionSettings.nSnapDistance != -1);
	if (!m_bSnapToEdges) m_positionSettings.nSnapDistance = 0;

	m_comboDocking.SetCurSel(static_cast<int>(m_positionSettings.dockPosition) + 1);
	m_comboZOrder.SetCurSel(static_cast<int>(m_positionSettings.zOrder));

	CUpDownCtrl	spin;
	UDACCEL udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_TRIM_TAB_TITLES));
	spin.SetRange(1, 100);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_TRIM_TAB_TITLES_RIGHT));
	spin.SetRange(1, 100);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_X));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_Y));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_W));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_H));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_SNAP));
	spin.SetRange(0, 20);
	spin.Detach();

	EnableControls();

	DoDataExchange(DDX_LOAD);
	return TRUE;
}
LRESULT DlgSettingsAppearance::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	ExecuteDlgInit(IDD);

	m_comboFontSmoothing.Attach(GetDlgItem(IDC_COMBO_SMOOTHING));
	m_comboDocking.Attach(GetDlgItem(IDC_COMBO_DOCKING));
	m_comboZOrder.Attach(GetDlgItem(IDC_COMBO_ZORDER));

	m_windowSettings.Load(m_pOptionsRoot);
	m_fontSettings.Load(m_pOptionsRoot);
	m_positionSettings.Load(m_pOptionsRoot);

	m_strWindowTitle	= m_windowSettings.strTitle.c_str();
	m_nUseTabTitle		= m_windowSettings.bUseTabTitles ? 1 : 0;
	m_nUseConsoleTitle	= m_windowSettings.bUseConsoleTitle ? 1 : 0;
	m_nShowCommand		= m_windowSettings.bShowCommand ? 1 : 0;
	m_nShowCommandTabs	= m_windowSettings.bShowCommandInTabs ? 1 : 0;
	m_nTrimTabTitles	= (m_windowSettings.dwTrimTabTitles > 0) ? 1 : 0;
	m_strWindowIcon		= m_windowSettings.strIcon.c_str();
	m_nUseTabIcon		= m_windowSettings.bUseTabIcon ? 1 : 0;

	m_strFontName	= m_fontSettings.strName.c_str();
	m_nFontBold		= m_fontSettings.bBold ? 1 : 0;
	m_nFontItalic	= m_fontSettings.bItalic ? 1 : 0;

	m_comboFontSmoothing.SetCurSel(static_cast<int>(m_fontSettings.fontSmoothing));

	m_nUseFontColor	= m_fontSettings.bUseColor ? 1 : 0;

	m_nUsePosition	= ((m_positionSettings.nX == -1) && (m_positionSettings.nY == -1)) ? 0 : 1;
	m_nX			= ((m_positionSettings.nX == -1) && (m_positionSettings.nY == -1)) ? 0 : m_positionSettings.nX;
	m_nY			= ((m_positionSettings.nX == -1) && (m_positionSettings.nY == -1)) ? 0 : m_positionSettings.nY;
	m_nSavePosition	= m_positionSettings.bSavePosition ? 1 : 0;

	m_nSnapToEdges	= (m_positionSettings.nSnapDistance == -1) ? 0 : 1;
	if (m_nSnapToEdges == 0) m_positionSettings.nSnapDistance = 0;

	m_comboDocking.SetCurSel(static_cast<int>(m_positionSettings.dockPosition) + 1);
	m_comboZOrder.SetCurSel(static_cast<int>(m_positionSettings.zOrder));

	CUpDownCtrl	spin;
	UDACCEL udAccel;

	spin.Attach(GetDlgItem(IDC_SPIN_TRIM_TAB_TITLES));
	spin.SetRange(1, 100);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_FONT_SIZE));
	spin.SetRange(5, 36);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_X));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_Y));
	spin.SetRange(-2048, 2048);
	udAccel.nSec = 0;
	udAccel.nInc = 5;
	spin.SetAccel(1, &udAccel);
	spin.Detach();

	spin.Attach(GetDlgItem(IDC_SPIN_SNAP));
	spin.SetRange(0, 20);
	spin.Detach();

	EnableControls();

	DoDataExchange(DDX_LOAD);
	return TRUE;
}
LRESULT SpeedPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
	PropPage::translate((HWND)(*this), texts);
	bool found=false;

	ctrlDownload.Attach(GetDlgItem(IDC_DL_SPEED));
	for(StringIter i = SettingsManager::connectionSpeeds.begin(); i != SettingsManager::connectionSpeeds.end(); ++i) {
		if (Util::toDouble(SETTING(DOWNLOAD_SPEED)) < Util::toDouble(*i) && !found) {
			ctrlDownload.AddString(Text::toT(SETTING(DOWNLOAD_SPEED)).c_str());
			found=true;
		} else if (SETTING(DOWNLOAD_SPEED) == (*i)) {
			found=true;
		}
		ctrlDownload.AddString(Text::toT(*i).c_str());
	}
	ctrlDownload.SetCurSel(ctrlDownload.FindString(0, Text::toT(SETTING(DOWNLOAD_SPEED)).c_str()));

	found=false;
	ctrlUpload.Attach(GetDlgItem(IDC_CONNECTION));
	for(StringIter i = SettingsManager::connectionSpeeds.begin(); i != SettingsManager::connectionSpeeds.end(); ++i) {
		if (Util::toDouble(SETTING(UPLOAD_SPEED)) < Util::toDouble(*i) && !found) {
			ctrlUpload.AddString(Text::toT(SETTING(UPLOAD_SPEED)).c_str());
			found=true;
		} else if (SETTING(UPLOAD_SPEED) == (*i)) {
			found=true;
		}
		ctrlUpload.AddString(Text::toT(*i).c_str());
	}
	ctrlUpload.SetCurSel(ctrlUpload.FindString(0, Text::toT(SETTING(UPLOAD_SPEED)).c_str()));


	PropPage::read((HWND)*this, items);

	CUpDownCtrl updown;
	updown.Attach(GetDlgItem(IDC_SLOTSPIN));
	updown.SetRange(1, UD_MAXVAL);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_MIN_UPLOAD_SPIN));
	updown.SetRange32(0, UD_MAXVAL);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_EXTRA_SLOTS_SPIN));
	updown.SetRange(3, 100);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_SMALL_FILE_SIZE_SPIN));
	updown.SetRange32(64, 30000);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_EXTRASPIN));
	updown.SetRange(0, 10);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_AUTO_SLOTS_SPIN));
	updown.SetRange(0, 100);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_PARTIAL_SLOTS_SPIN));
	updown.SetRange(0, 10);
	updown.Detach();

	updown.Attach(GetDlgItem(IDC_SLOTSSPIN));
	updown.SetRange32(0, 100);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_SPEEDSPIN));
	updown.SetRange32(0, 10000);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_EXTRASLOTSSPIN));
	updown.SetRange32(0, 100);
	updown.Detach();

	updown.Attach(GetDlgItem(IDC_MCN_SPIN));
	updown.SetRange32(1, 100);
	updown.Detach();
	updown.Attach(GetDlgItem(IDC_MCN_SPIN2));
	updown.SetRange32(1, 100);
	updown.Detach();

	fixControls();

	//update auto detection values
	if (SETTING(DL_AUTODETECT)) {
		SetDlgItemText(IDC_DOWNLOADS, Util::toStringW(AirUtil::getSlots(true)).c_str());
		SetDlgItemText(IDC_MAXSPEED, Util::toStringW(AirUtil::getSpeedLimit(true)).c_str());
	}
	if (SETTING(UL_AUTODETECT)) {
		SetDlgItemText(IDC_SLOTS, Util::toStringW(AirUtil::getSlots(false)).c_str());
		SetDlgItemText(IDC_MIN_UPLOAD_SPEED, Util::toStringW(AirUtil::getSpeedLimit(false)).c_str());
		SetDlgItemText(IDC_AUTO_SLOTS, Util::toStringW(AirUtil::getMaxAutoOpened()).c_str());
	}
	if (SETTING(MCN_AUTODETECT)) {
		SetDlgItemText(IDC_MCNDLSLOTS, Util::toStringW(AirUtil::getSlotsPerUser(true)).c_str());
		SetDlgItemText(IDC_MCNULSLOTS, Util::toStringW(AirUtil::getSlotsPerUser(false)).c_str());
	}

	return TRUE;
}