/*
*
* PrefGeneral.xml : PrefGeneral
*
*/
function OnPrefGeneralEvent_CtrlClicked(pPlusWnd, sControlId) {
switch (sControlId) {
case 'BtnSave' :
Preferences_Save('PrefGeneral');
case 'BtnBack' :
Preferences_ShowChild('PrefDashboard');
break;
case 'BtnBrowse':
pPlusWnd.SetControlText('tSaveDirectory', BrowseForFolder());
break;
case 'cPreviews':
_win32.EnableWindow(objChildWindows['PrefFtp'].GetControlHandle('cUploadScreenshots'), !pPlusWnd.Button_IsChecked(sControlId));
break;
case 'lnkTags':
_win32.MessageBoxW(pPlusWnd.Handle, _lang.text['MsgBoxTags'], _lang.text['MsgBoxTagsFilename_Title'], 32);
break;
}
}
function OnPrefGeneralEvent_EditTextChanged(pPlusWnd, sControlId) {
if (sControlId === 'tTimeDelay') {
var RangeMin = 0, RangeMax = 3600;
var nValue = 1*pPlusWnd.GetControlText(sControlId);
if (nValue < RangeMin)
pPlusWnd.SetControlText(sControlId, RangeMin);
else if (nValue > RangeMax)
pPlusWnd.SetControlText(sControlId, RangeMax);
}
}
function OnPrefGeneralEvent_ComboSelChanged(pPlusWnd, sControlId) {
if (sControlId === 'cFileType') {
var bEnable = pPlusWnd.Combo_GetCurSel(sControlId) === /* JPEG */ 1;
_win32.EnableWindow(pPlusWnd.GetControlHandle('lblQuality'), bEnable);
_win32.EnableWindow(pPlusWnd.GetControlHandle('lblQualityPercent'), bEnable);
_win32.EnableWindow(pPlusWnd.GetControlHandle('sldrQuality'), bEnable);
}
}
function OnPrefGeneralEvent_MessageNotification(pPlusWnd, nMessage, wParam, lParam) {
switch (nMessage) {
case _win32._const._WM_NOTIFY:
var NMHDR = Interop.Allocate(12);
_win32.RtlMoveMemory(NMHDR.DataPtr, lParam, 12);
if (NMHDR.ReadDWORD(0) === pPlusWnd.GetControlHandle('sldrQuality') && NMHDR.ReadDWORD(8) === _win32._const._NM_RELEASEDCAPTURE)
pPlusWnd.SetControlText('lblQualityPercent', pPlusWnd.SendControlMessage('sldrQuality', _win32._const._TBM_GETPOS, 0, 0) + '%');
break;
}
}