VoidT SetupADCLIniDialog(StringT filename, F_ObjHandleT bookId) { F_ObjHandleT dlgId = 0; IntT i = 0; /* open resource for Help Settings dialog box. */ dlgId = F_ApiOpenResource(FO_DialogResource, "m2rseta"); DlgIds[DLG_SETUP_ADCL_INI - 1] = dlgId; /* set CurrProjectName and Path at top of dialog */ SetDlgProject(dlgId, DLG_SA_PROJDESC); /* set checkboxes for TOC and IX inclusion */ UseFmTOC = UseFmIX = UseFmGenFiles = True; SetDlgState(dlgId, DLG_SA_FM_TOC, UseFmTOC); SetDlgState(dlgId, DLG_SA_FM_IX, UseFmIX); SetDlgState(dlgId, DLG_SA_FM_GEN, UseFmGenFiles); /* set rad and checkboxes for graphic export */ SetDlgState(dlgId, DLG_SA_GXRAD + ImpGraphics, True); SetImpGrDef(dlgId, ImpGraphics, True); /* set numbers for export names */ SetDlgText(dlgId, DLG_SA_NMCBOX, ImpGraphicsNameChars); SetDlgText(dlgId, DLG_SA_DGCBOX, ImpGraphicsDigits); /* turn off everything under template and compiler */ SetFrameTemplateDlg(dlgId, DLG_SA_TPL_CK); SetupCancelled = True; /* default if closed */ F_ApiModalDialog(DLG_SETUP_ADCL_INI, dlgId); }
void CConfigAlarm::DoTab(int nTab) { //Check nTab is within the threshold if(nTab>3) { nTab=3; } if(nTab<0) { nTab=0; } BOOL bTab[6]; bTab[0]=bTab[1]=bTab[2]=bTab[3]=FALSE; bTab[nTab]=TRUE; //Hide or display dialogue box SetDlgState(&m_TabAlarmInput,bTab[0]); SetDlgState(&m_TabMotion,bTab[1]); SetDlgState(&m_TabVideoLost,bTab[2]); SetDlgState(&m_TabShelter,bTab[3]); // 更新报警名称,页面显示 m_TabAlarmInput.RefreshAlarmName(); m_TabMotion.RefreshAlarmName(); m_TabVideoLost.RefreshAlarmName(); m_TabShelter.RefreshAlarmName(); /*if (bTab[2]) { m_TabMotion.SaveAll(); for(int i = 0; i < DH_MAX_VIDEO_IN_NUM_EX; i++) { memcpy(m_TabVideoLost.m_VideoLostInfo[i].stSect, m_TabMotion.m_AlarmMotionInfo[i].stSect, DH_N_WEEKS*DH_N_REC_TSECT*sizeof(DH_TSECT)); m_TabVideoLost.UpdateSchedule(); } } if (bTab[3]) { m_TabMotion.SaveAll(); for(int i = 0; i < DH_MAX_VIDEO_IN_NUM_EX; i++) { memcpy(m_TabShelter.m_AlarmShelterInfo[i].stSect, m_TabMotion.m_AlarmMotionInfo[i].stSect, DH_N_WEEKS*DH_N_REC_TSECT*sizeof(DH_TSECT)); m_TabShelter.UpdateSchedule(); } }*/ }
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CNewDiskImageDlg:: OnInitDialog() { CCommonDlg::OnInitDialog(); strcpy( m_szDiskName, "Empty" ); m_nFormat = 0; m_nDriveNumber = 1; #ifdef WIN_NETWORK_GAMES if( ST_KAILLERA_ACTIVE ) { m_bAttachDisk = FALSE; } else #endif m_bAttachDisk = TRUE; SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CNewDiskImageDlg::OnInitDialog */
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CTapeDlg:: OnInitDialog() { CCommonDlg::OnInitDialog(); /* Cache the kernel values */ _strncpy( m_szTapeFile, cassette_filename, FILENAME_MAX - 1 ); /* Backup a current tape file name and position */ _strncpy( m_szTapeBack, cassette_filename, FILENAME_MAX - 1 ); _strncpy( m_szTapeLast, cassette_filename, FILENAME_MAX - 1 ); m_nCurrentBack = cassette_current_block; /* Check if the tape image is a cassette file */ UINT unFileType = IAF_CAS_IMAGE; m_bCasImage = IsAtariFile( m_szTapeFile, &unFileType ); /* Cache some descriptions */ _LoadStringSx( IDS_TAPE_NO_CAS_IMAGE, m_szLabels[ LABEL_NOCASIMAGE ] ); _LoadStringSx( IDS_TAPE_NO_TAPE, m_szLabels[ LABEL_NOTAPE ] ); _LoadStringSx( IDS_TAPE_END_OF_TAPE, m_szLabels[ LABEL_ENDOFTAPE ] ); _LoadStringSx( IDS_TAPE_BLOCK_NO, m_szLabels[ LABEL_BLOCKNO ] ); _LoadStringSx( IDS_TAPE_EMPTY_TAPE, m_szLabels[ LABEL_EMPTYTAPE ] ); SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CTapeDlg::OnInitDialog */
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CFileAssociationsDlg:: OnInitDialog() { CCommonDlg::OnInitDialog(); CFileAssociationsBase::InitDialog(); const UINT anCtrls[ /*m_nFileExtInfoNo*/ ] = { IDC_FILEASSOCIATIONS_ATR, IDC_FILEASSOCIATIONS_XFD, IDC_FILEASSOCIATIONS_DCM, IDC_FILEASSOCIATIONS_ATZ, IDC_FILEASSOCIATIONS_XFZ, IDC_FILEASSOCIATIONS_XEX, IDC_FILEASSOCIATIONS_CAS, IDC_FILEASSOCIATIONS_ROM, IDC_FILEASSOCIATIONS_BIN, IDC_FILEASSOCIATIONS_CAR, IDC_FILEASSOCIATIONS_A8S }; /* Set the appropriate controls IDs */ for( int i = 0; i < m_nFileExtInfoNo; i++ ) m_pFileExtInfo[ i ].nCtrlID = anCtrls[ i ]; m_ulMiscState = g_Misc.ulState; SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CFileAssociationsDlg::OnInitDialog */
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CWizardStep1:: OnInitDialog() { CWizardPage::OnInitDialog(); char szShortPath[ MAX_PATH + 1 ]; CFileStatus fsStatus; /* Init the COM library */ if( !m_bInitCOM ) { CoInitialize( NULL ); m_bInitCOM = TRUE; } /* Prepare the shortcuts */ if( !Misc_GetHomeDirectory( m_szHomeDir ) ) GetCurrentDirectory( MAX_PATH, m_szHomeDir ); /* We are satisfied if there is a folder for shortcuts in the Start Menu */ GetMenuFolder( szShortPath ); m_bShortMenu = CFile::GetStatus( szShortPath, fsStatus ); GetDeskFolder( szShortPath ); sprintf( szShortPath, "%s\\%s", szShortPath, m_pShortInfo[ 0 ].pszShortcut ); m_bShortDesk = CFile::GetStatus( szShortPath, fsStatus ); SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CWizardStep1::OnInitDialog */
VoidT SetImpGrDef(F_ObjHandleT dlgId, IntT gdef, BoolT set) { IntT i = 0; switch (gdef) { case 0: // Normal, default for (i = 0; i < DLG_SA_GX_COUNT; i++) GxDef[i] = GxRef[i]; break; case 1: // Retain, False for (i = 0; i < DLG_SA_GX_COUNT; i++) GxDef[i] = False; break; case 2: // Export, True for (i = 0; i < DLG_SA_GX_COUNT; i++) GxDef[i] = True; break; default: break; } if (set) for (i = 0; i < DLG_SA_GX_COUNT; i++) SetDlgState(dlgId, i + DLG_SA_GX_BASE, GxDef[i]); }
VoidT SetHelpTopicDesigner(F_ObjHandleT dlgId) { if ((CurrDesStyle->helptyp != 1) || CurrDesStyle->remap || CurrDesStyle->replace) EnableItems(dlgId, DLG_DSHS_NORMAL_RAD, DLG_DSHS_XNSCR_CK3, False); else if (CurrDesStyle->topictyp == 2) { EnableItems(dlgId, DLG_DSHS_NORMAL_RAD, DLG_DSHS_RESUME_RAD, True); EnableItems(dlgId, DLG_DSHS_BROWSE_CK, DLG_DSHS_XNSCR_CK3, False); } else { EnableItems(dlgId, DLG_DSHS_NORMAL_RAD, DLG_DSHS_XNSCR_CK3, True); EnableDlgItem(dlgId, DLG_DSHS_BR_PX_BOX, CurrDesStyle->browse); EnableItems(dlgId, DLG_DSHS_CONT_V_RAD, DLG_DSHS_CONT_B_RAD, CurrDesStyle->cont); EnableDlgItem(dlgId, DLG_DSHS_CONT_LEV_BOX, CurrDesStyle->cont); EnableDlgItem(dlgId, DLG_DSHS_WINDOW_BOX, CurrDesStyle->window); EnableDlgItem(dlgId, DLG_DSHS_TITLE_SX_BOX, CurrDesStyle->titsx && !CurrDesStyle->notitle); EnableDlgItem(dlgId, DLG_DSHS_TITLE_SX_CK, !CurrDesStyle->notitle); EnableDlgItem(dlgId, DLG_DSHS_REF_SX_BOX, CurrDesStyle->refer); } SetDlgState(dlgId, DLG_DSHS_NORMAL_RAD + CurrDesStyle->topictyp, True); SetDlgState(dlgId, DLG_DSHS_BROWSE_CK, CurrDesStyle->browse); SetDlgText(dlgId, DLG_DSHS_BR_PX_BOX, CurrDesStyle->br_px); SetDlgState(dlgId, DLG_DSHS_CONT_CK, CurrDesStyle->cont); SetDlgState(dlgId, DLG_DSHS_CONT_V_RAD + CurrDesStyle->conttyp, True); SetDlgText(dlgId, DLG_DSHS_CONT_LEV_BOX, CurrDesStyle->contlev); SetDlgState(dlgId, DLG_DSHS_WINDOW_CK, CurrDesStyle->window); SetDlgText(dlgId, DLG_DSHS_WINDOW_BOX, CurrDesStyle->win_name); SetDlgState(dlgId, DLG_DSHS_NO_TITLE_CK, CurrDesStyle->notitle); SetDlgState(dlgId, DLG_DSHS_TITLE_SX_CK, CurrDesStyle->titsx); SetDlgText(dlgId, DLG_DSHS_TITLE_SX_BOX, CurrDesStyle->title_sx); SetDlgState(dlgId, DLG_DSHS_REFER_CK, CurrDesStyle->refer); SetDlgText(dlgId, DLG_DSHS_REF_SX_BOX, CurrDesStyle->ref_sx); SetDlgState(dlgId, DLG_DSHS_NSCR_CK3, CurrDesStyle->noscr_used ? (CurrDesStyle->noscroll ? 1 : 0) : 2); SetDlgState(dlgId, DLG_DSHS_XNSCR_CK3, CurrDesStyle->xtscr_used ? (CurrDesStyle->xtscroll ? 1 : 0) : 2); }
/* #FN# Sets a state of the object regarding to an appropriate combo box */ void /* #AS# Nothing */ CNewDiskImageDlg:: OnSelchangeBytesPerSector() { SetDlgState(); } /* #OF# CNewDiskImageDlg::OnSelchangeBytesPerSector */
/* #FN# Sets a state of the object regarding to an appropriate radio button */ void /* #AS# Nothing */ CNewDiskImageDlg:: OnNewDiskImage180k() { m_nFormat = 2; SetDlgState(); } /* #OF# CNewDiskImageDlg::OnNewDiskImage180k */
/* #FN# Sets a state of the object regarding to an appropriate radio button */ void /* #AS# Nothing */ CNewDiskImageDlg:: OnNewDiskImageOther() { m_nFormat = 3; SetDlgState(); } /* #OF# CNewDiskImageDlg::OnNewDiskImageOther */
/* #FN# Called when the user clicks the REWIND button */ void /* #AS# Nothing */ CTapeDlg:: OnRewind() { cassette_current_block = 1; /* Display the new tape position */ SetDlgState(); } /* #OF# CTapeDlg::OnRewind */
void CConfigVehicle::DoTab(int nTab) { if(nTab>2) { nTab=2; } if(nTab<0) { nTab=0; } BOOL bTab[3]; bTab[0]=bTab[1]=bTab[2]=FALSE; bTab[nTab]=TRUE; SetDlgState(&m_TabVehicleSt,bTab[0]); SetDlgState(&m_TabTimeLS,bTab[1]); SetDlgState(&m_TabVehicleDa,bTab[2]); }
/* #FN# Called when the user clicks the EJECT button */ void /* #AS# Nothing */ CTapeDlg:: OnEject() { /* Eject an inserted tape image */ EjectTape(); /* Set the dialog controls */ SetDlgState(); } /* #OF# CTapeDlg::OnEject */
/* #FN# Allows selecting a keyboard template using FileDialog window */ void /* #AS# Nothing */ CKeyboardDlg:: OnLoadTemplate() { if( PickFileName( TRUE, m_szTemplateFile, IDS_SELECT_A8K_LOAD, IDS_FILTER_A8K, "a8k", PF_LOAD_FLAGS, FALSE, DEFAULT_A8K, this ) && *m_szTemplateFile != '\0' ) { /* Read the template from a file */ PrepareTemplate( m_szTemplateFile, m_szTemplateDesc, FALSE ); /* Set the dialog controls */ SetDlgState(); } } /* #OF# CKeyboardDlg::OnLoadTemplate */
/* #FN# Displays "Keyboard Template" dialog box */ void /* #AS# Nothing */ CKeyboardDlg:: OnEditTemplate() { CKeyTemplateDlg dlgKeyTemplate( m_szTemplateFile, m_szTemplateDesc, s_anKBTable, this ); dlgKeyTemplate.DoModal(); /* Read the template from a file */ PrepareTemplate( m_szTemplateFile, m_szTemplateDesc ); /* Set the dialog controls */ SetDlgState(); } /* #OF# CKeyboardDlg::OnEditTemplate */
/* #FN# Sets a state of the object regarding to an appropriate check box */ void /* #AS# Nothing */ CKeyboardDlg:: OnUseTemplate() { _ClickButton( IDC_KEYBOARD_USETEMPLATE, m_ulInputState, IS_KEY_USE_TEMPLATE ); /* Read the template from a file */ if( _IsFlagSet( m_ulInputState, IS_KEY_USE_TEMPLATE ) ) { PrepareTemplate( m_szTemplateFile, m_szTemplateDesc ); } /* Set the dialog controls */ SetDlgState(); } /* #OF# CKeyboardDlg::OnUseTemplate */
/* #FN# Allows selecting a cassette image using FileDialog window */ void /* #AS# Nothing */ CTapeDlg:: OnBrowse() { if( PickFileName( TRUE, m_szTapeFile, IDS_SELECT_CAS_LOAD, IDS_FILTER_CAS, "cas", PF_LOAD_FLAGS, TRUE, DEFAULT_TAP, this ) && *m_szTapeFile != '\0' ) { SetDlgItemText( IDC_TAPE_FILE, m_szTapeFile ); /* Open a tape image */ PrepareTape( m_szTapeFile, FALSE ); SetDlgState(); } } /* #OF# CTapeDlg::OnBrowse */
VoidT SetAdvancedTextDesigner(F_ObjHandleT dlgId) { EnableDlgItem(dlgId, DLG_DTXA_IXS_RAD, (CurrPropSetNum == DES_PROPSET_WORD)); EnableDlgItem(dlgId, DLG_DTXA_IXH_RAD, (CurrPropSetNum == DES_PROPSET_HELP)); EnableDlgItem(dlgId, DLG_DTXA_XRS_RAD, (CurrPropSetNum == DES_PROPSET_WORD)); EnableDlgItem(dlgId, DLG_DTXA_XRH_RAD, (CurrPropSetNum == DES_PROPSET_HELP)); EnableDlgItem(dlgId, DLG_DTXA_QTS_RAD, (CurrPropSetNum != DES_PROPSET_HELP)); EnableDlgItem(dlgId, DLG_DTXA_SBHT_CK, (CurrPropSetNum == DES_PROPSET_HELP)); EnableDlgItem(dlgId, DLG_DTXA_SBWF_CK, (CurrPropSetNum == DES_PROPSET_WORD)); SetDlgState(dlgId, DLG_DTXA_IXS_RAD + CurrDesText.idx_usage, True); SetDlgState(dlgId, DLG_DTXA_XRS_RAD + CurrDesText.xref_usage, True); SetDlgState(dlgId, DLG_DTXA_XTF_RAD + CurrDesText.xref_type, True); SetDlgState(dlgId, DLG_DTXA_QTS_RAD + CurrDesText.quote_usage, True); SetDlgState(dlgId, DLG_DTXA_TBR_RAD + CurrDesText.occluded_tabs, True); SetDlgState(dlgId, DLG_DTXA_FMSP_CK, CurrDesText.frame_spacing); SetDlgState(dlgId, DLG_DTXA_CHST_CK, CurrDesText.char_styles); SetDlgState(dlgId, DLG_DTXA_SBHT_CK, CurrDesText.secbk_help); SetDlgState(dlgId, DLG_DTXA_SBWF_CK, CurrDesText.secbk_word); DesignerChanged = False; }
/* #FN# The framework calls this function before an edit losing input focus */ void /* #AS# Nothing */ CKeyboardDlg:: OnKillfocusTemplateFile() { char szTemplateOld[ MAX_PATH + 1 ]; strcpy( szTemplateOld, m_szTemplateFile ); GetDlgItemText( IDC_KEYBOARD_TEMPLATEFILE, m_szTemplateFile, MAX_PATH ); if( !m_bExitPass && _stricmp( szTemplateOld, m_szTemplateFile ) != 0 ) { /* Read the template from a file */ PrepareTemplate( m_szTemplateFile, m_szTemplateDesc ); /* Set the dialog controls */ SetDlgState(); } } /* #OF# CKeyboardDlg::OnKillfocusTemplateFile */
/* #FN# The framework calls this function before an edit losing input focus */ void /* #AS# Nothing */ CTapeDlg:: OnKillfocusFile() { char szTapeOld[ FILENAME_MAX ]; strcpy( szTapeOld, m_szTapeFile ); GetDlgItemText( IDC_TAPE_FILE, m_szTapeFile, FILENAME_MAX - 1 ); if( !m_bExitPass && _stricmp( szTapeOld, m_szTapeFile ) != 0 ) { /* Open a tape image */ PrepareTape( m_szTapeFile ); /* Set the dialog controls */ SetDlgState(); } } /* #OF# CTapeDlg::OnKillfocusFile */
/* #FN# Displays New Tape Image dialog box */ void /* #AS# Nothing */ CTapeDlg:: OnNewImage() { CNewTapeImageDlg dlgNewTapeImage; if( IDOK == dlgNewTapeImage.DoModal() && /* Attach tape image to the tape recorder if it was expected */ dlgNewTapeImage.m_bAttachTape ) { /* Set a name of the created image */ _strncpy( m_szTapeFile, dlgNewTapeImage.m_szTapeName, FILENAME_MAX - 1 ); SetDlgItemText( IDC_TAPE_FILE, m_szTapeFile ); /* Open a tape image */ PrepareTape( m_szTapeFile, FALSE, TRUE ); SetDlgState(); } } /* #OF# CTapeDlg::OnNewImage */
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CKeyboardDlg:: OnInitDialog() { CCommonDlg::OnInitDialog(); m_ulInputState = g_Input.ulState; m_nArrowsMode = g_Input.Key.nArrowsMode; _strncpy( m_szTemplateFile, g_szTemplateFile, MAX_PATH ); _strncpy( m_szTemplateDesc, g_szTemplateDesc, TEMPLATE_DESC_LENGTH ); /* Read the template from a file */ PrepareTemplate( m_szTemplateFile, m_szTemplateDesc ); SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CKeyboardDlg::OnInitDialog */
/* #FN# Performs special processing when the dialog box is initialized */ BOOL /* #AS# TRUE unless you set the focus to a control */ CJoystickDlg:: OnInitDialog() { CCommonDlg::OnInitDialog(); m_ulInputState = g_Input.ulState; m_ulAutoSticks = g_Input.Joy.ulAutoSticks; m_nAutoMode = g_Input.Joy.nAutoMode; m_nBlockOpposite = INPUT_joy_block_opposite_directions; m_nMultiJoy = INPUT_joy_multijoy; m_bSmallMode = _IsFlagSet( g_Screen.ulState, SM_ATTR_SMALL_DLG ); for( int i = 0; i < MAX_ATARI_JOYPORTS; i++ ) m_anDevSelected[ i ] = g_Input.anDevSelected[ i ]; SetDlgState(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } /* #OF# CJoystickDlg::OnInitDialog */
VoidT SetTemplateDesigner(F_ObjHandleT dlgId) { IntT val = 0; FMTemplateName = CurrDesText.fm_tpl_name; WDTemplateName = CurrDesText.wd_tpl_name; EnableItems(dlgId, DLG_DTPL_FMTPL_BOX, DLG_DTPL_PBRKS_CK, CurrDesText.fm_tpl_apply); EnableItems(dlgId, DLG_DTPL_AUTOUP_CK, DLG_DTPL_WDTPL_BTN, CurrDesText.wd_tpl_apply); SetDlgState(dlgId, DLG_DTPL_FMTPL_CK, CurrDesText.fm_tpl_apply); SetDlgText(dlgId, DLG_DTPL_FMTPL_BOX, FMTemplateName); val = CurrDesText.fm_tpl_flags; SetDlgState(dlgId, DLG_DTPL_PSTYL_CK, (val & FF_UFF_PGF) ? True : False); SetDlgState(dlgId, DLG_DTPL_CSTYL_CK, (val & FF_UFF_FONT) ? True : False); SetDlgState(dlgId, DLG_DTPL_TABLS_CK, (val & FF_UFF_TABLE) ? True : False); SetDlgState(dlgId, DLG_DTPL_XREFS_CK, (val & FF_UFF_XREF) ? True : False); SetDlgState(dlgId, DLG_DTPL_CONDS_CK, (val & FF_UFF_COND) ? True : False); SetDlgState(dlgId, DLG_DTPL_CFNTS_CK, (val & FF_UFF_COMBINED_FONTS) ? True : False); SetDlgState(dlgId, DLG_DTPL_PAGES_CK, (val & FF_UFF_PAGE) ? True : False); SetDlgState(dlgId, DLG_DTPL_REFPGS_CK, (val & FF_UFF_REFPAGE) ? True : False); SetDlgState(dlgId, DLG_DTPL_VARS_CK, (val & FF_UFF_VAR) ? True : False); SetDlgState(dlgId, DLG_DTPL_COLORS_CK, (val & FF_UFF_COLOR) ? True : False); SetDlgState(dlgId, DLG_DTPL_EQUS_CK, (val & FF_UFF_MATH) ? True : False); SetDlgState(dlgId, DLG_DTPL_DOCS_CK, (val & FF_UFF_DOCUMENT_PROPS) ? True : False); SetDlgState(dlgId, DLG_DTPL_OVERS_CK, (val & FF_UFF_REMOVE_EXCEPTIONS) ? True : False); SetDlgState(dlgId, DLG_DTPL_PBRKS_CK, (val & FF_UFF_REMOVE_PAGE_BREAKS) ? True : False); SetDlgState(dlgId, DLG_DTPL_WDTPL_CK, CurrDesText.wd_tpl_apply); SetDlgText(dlgId, DLG_DTPL_WDTPL_BOX, WDTemplateName); SetDlgState(dlgId, DLG_DTPL_AUTOUP_CK, CurrDesText.wd_tpl_auto); DesignerChanged = False; }
INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { TCHAR folder_buff[MAX_PATH] = { 0 }; switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); memcpy(&new_options, &options, sizeof(Options)); if (ServiceExists(MS_FOLDERS_GET_PATH)) { ShowWindow(GetDlgItem(hwndDlg, IDC_ED_FOLDER), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_BUT_BROWSE), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_LNK_FOLDERS), SW_SHOW); } else { TCHAR tszTooltipText[4096]; mir_sntprintf(tszTooltipText, _countof(tszTooltipText), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"), _T("%miranda_path%"), TranslateT("path to Miranda root folder"), _T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"), _T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"), _T("%miranda_userdata%"), TranslateT("will return parsed string %miranda_profilesdir%\\%miranda_profilename%"), _T("%appdata%"), TranslateT("same as environment variable %APPDATA% for currently logged-on Windows user"), _T("%username%"), TranslateT("username for currently logged-on Windows user"), _T("%mydocuments%"), TranslateT("\"My Documents\" folder for currently logged-on Windows user"), _T("%desktop%"), TranslateT("\"Desktop\" folder for currently logged-on Windows user"), _T("%xxxxxxx%"), TranslateT("any environment variable defined in current Windows session (like %systemroot%, %allusersprofile%, etc.)") ); hPathTip = CreateToolTip(GetDlgItem(hwndDlg, IDC_ED_FOLDER), tszTooltipText, TranslateT("Variables")); } SetDlgState(hwndDlg); SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("days")); SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("hours")); SendDlgItemMessage(hwndDlg, IDC_PT, CB_ADDSTRING, 0, (LPARAM)TranslateT("minutes")); switch (new_options.period_type) { case PT_DAYS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 0, 0); break; case PT_HOURS: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 1, 0); break; case PT_MINUTES: SendDlgItemMessage(hwndDlg, IDC_PT, CB_SETCURSEL, 2, 0); break; } if (hPathTip) SetTimer(hwndDlg, 0, 3000, NULL); return TRUE; case WM_COMMAND: if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) { switch (LOWORD(wParam)) { case IDC_ED_PERIOD: case IDC_ED_FOLDER: case IDC_ED_NUMBACKUPS: SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } } if (HIWORD(wParam) == CBN_SELCHANGE) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); if (HIWORD(wParam) == BN_CLICKED) { switch (LOWORD(wParam)) { case IDC_RAD_DISABLED: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_DISABLED)) new_options.backup_types = BT_DISABLED; SetDlgState(hwndDlg); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_START: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_START)) new_options.backup_types |= BT_START; else new_options.backup_types &= ~BT_START; SetDlgState(hwndDlg); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_EXIT: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_EXIT)) new_options.backup_types |= BT_EXIT; else new_options.backup_types &= ~BT_EXIT; SetDlgState(hwndDlg); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_PERIODIC: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_PERIODIC)) new_options.backup_types |= BT_PERIODIC; else new_options.backup_types &= ~BT_PERIODIC; SetDlgState(hwndDlg); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_BUT_BROWSE: { BROWSEINFO bi; bi.hwndOwner = hwndDlg; bi.pidlRoot = 0; bi.pszDisplayName = folder_buff; bi.lpszTitle = TranslateT("Select backup folder"); bi.ulFlags = BIF_NEWDIALOGSTYLE; bi.lpfn = BrowseProc; bi.lParam = 0; bi.iImage = 0; LPCITEMIDLIST pidl = SHBrowseForFolder(&bi); if (pidl != 0) { SHGetPathFromIDList(pidl, folder_buff); SetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); CoTaskMemFree((void *)pidl); } break; } case IDC_BUT_NOW: BackupStart(NULL); break; case IDC_CHK_NOPROG: new_options.disable_progress = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOPROG); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_CHK_NOPOPUP: new_options.disable_popups = IsDlgButtonChecked(hwndDlg, IDC_CHK_NOPOPUP); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_CHK_USEZIP: new_options.use_zip = IsDlgButtonChecked(hwndDlg, IDC_CHK_USEZIP); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_LNK_FOLDERS: { OPENOPTIONSDIALOG ood = { 0 }; ood.cbSize = sizeof(ood); ood.pszGroup = "Customize"; ood.pszPage = "Folders"; Options_Open(&ood); break; } } } break; case WM_TIMER: if (IsWindow(hPathTip)) KillTimer(hPathTip, 4); // It will prevent tooltip autoclosing break; case WM_NOTIFY: if (((LPNMHDR)lParam)->code == PSN_APPLY) { TCHAR buff[10]; GetDlgItemText(hwndDlg, IDC_ED_PERIOD, buff, _countof(buff)); new_options.period = _ttoi(buff); GetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, buff, _countof(buff)); new_options.num_backups = _ttoi(buff); switch (SendDlgItemMessage(hwndDlg, IDC_PT, CB_GETCURSEL, 0, 0)) { case 0: new_options.period_type = PT_DAYS; break; case 1: new_options.period_type = PT_HOURS; break; case 2: new_options.period_type = PT_MINUTES; break; } GetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff, _countof(folder_buff)); { TCHAR backupfolder[MAX_PATH] = { 0 }; BOOL folder_ok = TRUE; TCHAR *tmp = Utils_ReplaceVarsT(folder_buff); if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':') _tcsncpy_s(backupfolder, tmp, _TRUNCATE); else mir_sntprintf(backupfolder, _countof(backupfolder), _T("%s\\%s"), profilePath, tmp); mir_free(tmp); int err = CreateDirectoryTreeT(backupfolder); if (err != ERROR_ALREADY_EXISTS && err != 0) { TCHAR msg_buff[512]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0); MessageBox(0, msg_buff, TranslateT("Error creating backup folder"), MB_OK | MB_ICONERROR); folder_ok = FALSE; } if (folder_ok) { _tcsncpy_s(new_options.folder, folder_buff, _TRUNCATE); memcpy(&options, &new_options, sizeof(Options)); SaveOptions(); } else { memcpy(&new_options, &options, sizeof(Options)); SetDlgState(hwndDlg); } } return TRUE; } break; case WM_DESTROY: if (hPathTip) { KillTimer(hwndDlg, 0); DestroyWindow(hPathTip); hPathTip = 0; } return FALSE; } return FALSE; }
VoidT SetupOMHIniDialog(StringT filename, F_ObjHandleT bookId) { F_ObjHandleT dlgId = 0; F_ObjHandleT compId = 0; StringT basename = NULL; StringT compname = NULL; StringT topicfile = NULL; basename = BaseFileName(filename); /* open resource for OMH Settings dialog box. */ dlgId = F_ApiOpenResource(FO_DialogResource, "m2rsetc"); DlgIds[DLG_SETUP_OMH_INI - 1] = dlgId; /* set CurrProjectName and Path at top of dialog */ SetDlgProject(dlgId, DLG_SC_PROJDESC); /* set up name for [MAP] file */ CshMapFileSet = False; CshMapFile = NULL; //SetDlgText(dlgId, DLG_SC_CSHMAP, "resource.h"); /* set checkboxes for TOC and IX inclusion and search generation */ UseFmTOC = UseFmIX = False; UseFmGenFiles = True; UseOHTOC = UseOHIX = UseOHFTS = UseOHREL = True; /* these are always the same */ GenTOC = GenIX = True; WrapAndShip = True; SetDlgState(dlgId, DLG_SC_FM_TOC, UseFmTOC); SetDlgState(dlgId, DLG_SC_FM_IX, UseFmIX); SetDlgState(dlgId, DLG_SC_FM_GEN, UseFmGenFiles); SetDlgState(dlgId, DLG_SC_USE_TOC, UseOHTOC); SetDlgState(dlgId, DLG_SC_USE_IX, UseOHIX); SetDlgState(dlgId, DLG_SC_USE_FTS, UseOHFTS); SetDlgState(dlgId, DLG_SC_USE_REL, UseOHREL); #if 0 SetDlgState(dlgId, DLG_SC_COPY_TO, WrapAndShip); SetDlgText(dlgId, DLG_SC_HP_PATH, WrapPath); SetDlgText(dlgId, DLG_SC_VW_PATH, OHVName); #endif if (bookId) { /* get basename of first file in book */ compId = F_ApiGetId(FV_SessionId, bookId, FP_FirstComponentInBook); compname = F_ApiGetString(bookId, compId, FP_Name); topicfile = BaseFileName(compname); F_StrFree(compname); } else topicfile = F_StrCopyString(basename); SetDlgText(dlgId, DLG_SC_CONTENTS, topicfile); DefaultTopicFile = NULL; TopicFileSet = False; SetDlgText(dlgId, DLG_SC_PROJECT, basename); /* put dummy title */ SetDlgText(dlgId, DLG_SC_TITLE, HelpTitle); UseCSS = True; CssFileName = "ohmain.css"; SetDlgText(dlgId, DLG_SC_CSS, CssFileName); /* turn off everything under template */ SetFrameTemplateDlg(dlgId, DLG_SC_TPL_CK); SetupCancelled = True; /* default if closed */ F_ApiModalDialog(DLG_SETUP_OMH_INI, dlgId); WriteEqns = True; WriteAllGraphics = True; F_StrFree(basename); }