/cwxeditor_src/cwx/editor/gui/dwt/settingsdialog.d
D | 3195 lines | 3083 code | 106 blank | 6 comment | 400 complexity | d1722b509d8bfadc6ca58aed0450e4d7 MD5 | raw file
Possible License(s): LGPL-2.1
Large files files are truncated, but you can click here to view the full file
- /// ?????????????????
- module cwx.editor.gui.dwt.settingsdialog;
- import cwx.background;
- import cwx.utils;
- import cwx.xml;
- import cwx.summary;
- import cwx.skin;
- import cwx.graphics;
- import cwx.structs;
- import cwx.menu;
- import cwx.variables;
- import cwx.cab;
- import cwx.script;
- import cwx.props;
- import cwx.features;
- import cwx.types;
- import cwx.editor.gui.sound;
- import cwx.editor.gui.dwt.dprops;
- import cwx.editor.gui.dwt.properties;
- import cwx.editor.gui.dwt.dutils;
- import cwx.editor.gui.dwt.dskin;
- import cwx.editor.gui.dwt.centerlayout;
- import cwx.editor.gui.dwt.absdialog;
- import cwx.editor.gui.dwt.splitpane;
- import cwx.editor.gui.dwt.commons;
- import cwx.editor.gui.dwt.areaview;
- import cwx.editor.gui.dwt.areaviewutils;
- import cwx.editor.gui.dwt.xmlbytestransfer;
- import cwx.editor.gui.dwt.dockingfolder;
- import cwx.editor.gui.dwt.customtext;
- import cwx.editor.gui.dwt.undo;
- import cwx.editor.gui.dwt.dmenu;
- import cwx.editor.gui.dwt.customtable;
- import cwx.editor.gui.dwt.loader;
- import cwx.editor.gui.dwt.scripterrordialog;
- import cwx.editor.gui.dwt.incsearch;
- import std.path;
- import std.file;
- import std.string;
- import std.functional;
- import std.traits;
- import std.array;
- import std.ascii;
- import std.exception;
- import std.algorithm : iota;
- import org.eclipse.swt.all;
- import java.lang.all;
- enum BackupType {
- Time = 0,
- Edit = 1,
- }
- class SettingsDialog : AbsDialog {
- private:
- Commons _comm;
- Props _prop;
- Summary _summ;
- DockingFolderCTC _dock;
- void delegate() _sendReloadProps;
- CTabItem _tabB;
- Text _enginePath;
- Button _refEnginePath;
- Button _findEnginePath;
- Text _tempDir;
- Text _backupDir;
- Button _backupEnabled;
- Button _backupIntervalTypeTime;
- Button _backupIntervalTypeEdit;
- Spinner _backupIntervalTime;
- Spinner _backupIntervalEdit;
- Spinner _backupCount;
- Button _backupRefAuthor;
- Button _autoSave;
- Button _backupArchived;
- Button _backupRef;
- Button _backupDirOpen;
- Text _backupBeforeSaveDir;
- Button _backupBeforeSaveEnabled;
- Button _backupBeforeSaveRef;
- Button _backupBeforeSaveDirOpen;
- Text _author;
- Text _wallpaper;
- Combo _wallpaperStyle;
- int[int] _wallpaperStyleTbl;
- int[int] _wallpaperStyleTbl2;
- Button _clearHist;
- Spinner _histMax;
- Button _clearSHist;
- Spinner _sHistMax;
- Spinner _undoMaxMainView;
- Spinner _undoMaxEvent;
- Spinner _undoMaxReplace;
- Spinner _undoMaxEtc;
- CTabFolder _tabf;
- CTabItem _tabS;
- BgImageS[] _bgImagesDefault;
- ToolsPane!BgImageSetting _bgStgs;
- Text _keyCodes;
- CTabItem _tabT;
- ToolsPane!OuterTool _tools;
- ToolsPane!ClassicEngine _cEngines;
- CTabItem _tabC;
- ToolsPane!ScTemplate _scTempls;
- ToolsPane!EvTemplate _evTempls;
- CTabItem _tabE;
- Combo _language;
- string[int] _msgsTableIndex;
- string[string] _msgsTableFile;
- Text _ignorePaths;
- TableItem _singleWindow = null;
- TableItem _showAreaDirTree;
- TableItem _showSummaryInAreaTable;
- TableItem _clickIsOpenEvent;
- TableItem _smoothingCard;
- TableItem _showImagePreview;
- TableItem _editTriggerTypeIsQuick;
- TableItem _classicStyleTree;
- TableItem _adjustContentName;
- TableItem _radarStyleParams;
- TableItem _showEventTreeMark;
- TableItem _showCardListHeader;
- TableItem _showCardListTitle;
- TableItem _showSkillCardLevel;
- TableItem _ignoreEmptyStart;
- TableItem _expandXMLs;
- TableItem _contentsFloat;
- TableItem _contentsAutoHide;
- TableItem _comboListVisible;
- TableItem _xmlCopy;
- TableItem _showSpNature;
- TableItem _saveInnerImagePath;
- TableItem _linkCard;
- TableItem _traceDirectories;
- TableItem _logicalSort;
- TableItem _copyDesc;
- TableItem _refCardsAtEditBgImage;
- TableItem _floatMessagePreview;
- TableItem _addNewClassicEngine;
- TableItem _doubleIO;
- TableItem _switchTabWheel;
- TableItem _closeTabWithMiddleClick;
- TableItem _openTabAtRightOfCurrentTab;
- TableItem _reconstruction;
- TableItem _openLastScenario;
- TableItem _showVariableValuesInEventText;
- TableItem _cautionBeforeReplace;
- TableItem _saveNeedChanged;
- TableItem _applyDialogsBeforeSave;
- TableItem _useNamesAfterStandard;
- TableItem _selectVariableWithTree;
- TableItem _autoUpdateJpy1File;
- TableItem _straightEventTreeView;
- TableItem _gentleAngleEventTree;
- TableItem _forceIndentBranchContent;
- TableItem _showTerminalMark;
- TableItem _clickIconIsStartEdit;
- Combo _targetVersion;
- int[string] _targetVersionTbl;
- string[int] _targetVersionTbl2;
- Combo _soundPlayType;
- int[int] _soundPlayTypeTbl;
- int[int] _soundPlayTypeTbl2;
- Spinner _bgmVolume;
- Combo _soundEffectPlayType;
- int[int] _soundEffectPlayTypeTbl;
- int[int] _soundEffectPlayTypeTbl2;
- Spinner _seVolume;
- Combo _dialogStatus;
- int[int] _dialogStatusTbl;
- int[int] _dialogStatusTbl2;
- Text _savedSound;
- Text _mnemonic;
- HotKeyField _hotkey;
- Table _menu;
- Button _menuApply;
- Button _menuDel;
- class SMenuData {
- MenuID id;
- string mnemonic;
- string hotkey;
- }
- IncSearch _menuIncSearch;
- void menuIncSearch() { mixin(S_TRACE);
- _menuIncSearch.startIncSearch();
- }
- class RefE : SelectionAdapter, ModifyListener {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- refreshEnabled();
- }
- override void modifyText(ModifyEvent e) { mixin(S_TRACE);
- refreshEnabled();
- }
- }
- string dropEngine(string[] files) { mixin(S_TRACE);
- if (!files.length) return "";
- string file = files[0];
- if (cfnmatch(baseName(file), _prop.var.etc.engine)) { mixin(S_TRACE);
- return file;
- } else { mixin(S_TRACE);
- return "";
- }
- }
- const SYSTEM_SOUND_EXT = [
- ".aiff", // AIFF
- ".mid", ".midi", // MIDI
- ".mod", ".s3m", ".xm", ".it", ".mt2", ".669", ".med", // MOD
- ".ogg", ".ogv", ".oga", ".ogx", // Ogg
- ".voc", // VOC
- ".wav" // WAV/RIFF
- ];
- string dropSysSound(string[] files) { mixin(S_TRACE);
- if (!files.length) return "";
- foreach (file; files) { mixin(S_TRACE);
- string ext = .toLower(.extension(file));
- if (.contains!("a == b", string, string)(SYSTEM_SOUND_EXT, ext)) { mixin(S_TRACE);
- return file;
- }
- }
- return "";
- }
- const WALLPAPER_EXT = [".bmp", ".ico", ".icon", ".jpg", ".jpeg", ".gif", ".png", ".tif", ".tiff"];
- string dropWallpaper(string[] files) { mixin(S_TRACE);
- if (!files.length) return "";
- foreach (file; files) { mixin(S_TRACE);
- if (.contains!("a == b", string, string)(WALLPAPER_EXT, .toLower(.extension(file)))) { mixin(S_TRACE);
- return file;
- }
- }
- return "";
- }
- void selectEngine() { mixin(S_TRACE);
- selectFile(_enginePath, [_prop.var.etc.engine], [_prop.var.etc.engine],
- _prop.var.etc.engine, .tryFormat(_prop.msgs.dlgTitEnginePath, _prop.var.etc.engine),
- _prop.var.etc.enginePath);
- }
- void selectSysSound(Text widget) { mixin(S_TRACE);
- string[] extArr;
- foreach (sse; SYSTEM_SOUND_EXT) { mixin(S_TRACE);
- extArr ~= "*." ~ sse;
- }
- string exts = std.string.join(extArr, ";");
- selectFile(widget, [.tryFormat(_prop.msgs.playableSounds, exts)], [exts],
- baseName(widget.getText()), _prop.msgs.dlgTitSystemSound,
- widget.getText());
- }
- void selectTemp() { mixin(S_TRACE);
- selectDir(_prop, _tempDir, _prop.msgs.tempDir, _prop.msgs.tempDirDesc, _prop.tempPath);
- }
- void selectBackup() { mixin(S_TRACE);
- selectDir(_prop, _backupDir, _prop.msgs.backupDir, _prop.msgs.backupDirDesc, _prop.backupPath);
- }
- void selectBackupBeforeSave() { mixin(S_TRACE);
- selectDir(_prop, _backupBeforeSaveDir, _prop.msgs.backupBeforeSaveDir, _prop.msgs.backupBeforeSaveDirDesc, _prop.backupBeforeSavePath);
- }
- void selectWallpaper() { mixin(S_TRACE);
- string[] filterName = [_prop.msgs.filterWallpaper, _prop.msgs.filterAll];
- string[] filter = [
- "*" ~ std.string.join(WALLPAPER_EXT.dup, ";*"),
- "*"
- ];
- selectFile(_wallpaper, filterName, filter, _prop.var.etc.wallpaper, _prop.msgs.dlgTitWallpaper, getcwd());
- }
- class SelEngine : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) {selectEngine();}
- }
- class SelTemp : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) {selectTemp();}
- }
- class SelBackup : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) {selectBackup();}
- }
- class SelBackupBeforeSave : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) {selectBackupBeforeSave();}
- }
- class SelWallpaper : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) {selectWallpaper();}
- }
- class SelSysSound : SelectionAdapter {
- private Text _text;
- this (Text text) { mixin(S_TRACE);
- _text = text;
- }
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- selectSysSound(_text);
- }
- }
- void refHistories() { mixin(S_TRACE);
- _clearHist.setEnabled(_prop.var.etc.openHistories.length > 0);
- }
- void refSearchHistories() { mixin(S_TRACE);
- _clearSHist.setEnabled(_prop.var.etc.searchHistories.length || _prop.var.etc.replaceHistories.length);
- }
- class ClearHist : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- auto dlg = new MessageBox(_histMax.getShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
- dlg.setText(_prop.msgs.dlgTitQuestion);
- dlg.setMessage(_prop.msgs.dlgMsgHistoryClear);
- if (SWT.OK == dlg.open()) { mixin(S_TRACE);
- _prop.var.etc.openHistories = [];
- _comm.refHistories.call();
- _prop.var.save(_dock);
- _sendReloadProps();
- }
- }
- }
- class ClearSHist : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- auto dlg = new MessageBox(_sHistMax.getShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
- dlg.setText(_prop.msgs.dlgTitQuestion);
- dlg.setMessage(_prop.msgs.dlgMsgSearchHistoryClear);
- if (SWT.OK == dlg.open()) { mixin(S_TRACE);
- _prop.var.etc.searchHistories = [];
- _prop.var.etc.replaceHistories = [];
- _prop.var.etc.grepDirHistories = [];
- _comm.refSearchHistories.call();
- _prop.var.save(_dock);
- _sendReloadProps();
- }
- }
- }
- void construct1(CTabFolder tabf) { mixin(S_TRACE);
- auto comp = new Composite(tabf, SWT.NONE);
- comp.setLayout(new GridLayout(1, false));
- _tabB = new CTabItem(tabf, SWT.NONE);
- _tabB.setText(_prop.msgs.baseSettings);
- _tabB.setControl(comp);
- { mixin(S_TRACE);
- auto comp2 = new Composite(comp, SWT.NONE);
- comp2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- comp2.setLayout(zeroMarginGridLayout(2, false));
- { mixin(S_TRACE);
- auto grp = new Group(comp2, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setLayout(new GridLayout(3, false));
- grp.setText(.tryFormat(_prop.msgs.enginePath, _prop.var.etc.engine));
- _enginePath = new Text(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _enginePath, &catchMod);
- _enginePath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_enginePath);
- _refEnginePath = new Button(grp, SWT.PUSH);
- _refEnginePath.setText(_prop.msgs.reference);
- _refEnginePath.addSelectionListener(new SelEngine);
- createOpenButton(_comm, grp, &_enginePath.getText, false);
- _findEnginePath = new Button(grp, SWT.CHECK);
- mod(_findEnginePath);
- _findEnginePath.setText(_prop.msgs.findEnginePath);
- auto gd = new GridData;
- gd.horizontalSpan = 3;
- _findEnginePath.setLayoutData(gd);
- setupDropFile(grp, _enginePath, &dropEngine);
- .listener(_enginePath, SWT.Modify, { mixin(S_TRACE);
- _findEnginePath.setEnabled(0 == _enginePath.getText().length);
- });
- .listener(_findEnginePath, SWT.Selection, { mixin(S_TRACE);
- _enginePath.setEnabled(!_findEnginePath.getSelection());
- _refEnginePath.setEnabled(!_findEnginePath.getSelection());
- });
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp2, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- grp.setText(_prop.msgs.languageSetting);
- grp.setLayout(new GridLayout(1, true));
- string defLocale;
- auto msgsTable = _prop.parent.msgsTable(_prop.var.etc.languageDir, _msgsTableFile, defLocale);
- _language = new Combo(grp, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.BORDER);
- mod(_language);
- _language.setVisibleItemCount(_prop.var.etc.comboVisibleItemCount);
- _language.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- _language.add(_prop.msgs.languageSystem);
- _language.select(0);
- string curLocale = _prop.msgs.locale;
- foreach (locale; msgsTable.keys.sort) { mixin(S_TRACE);
- _language.add(msgsTable[locale].localeName);
- int index = _language.getItemCount() - 1;
- _msgsTableIndex[index] = locale;
- if (!_prop.var.etc.useSystemLanguage && 0 == icmp(curLocale, locale)) { mixin(S_TRACE);
- _language.select(index);
- }
- }
- auto l = new Label(grp, SWT.NONE);
- l.setText(_prop.msgs.languageCaution);
- }
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- grp.setLayout(new GridLayout(3, false));
- grp.setText(_prop.msgs.tempDir);
- _tempDir = new Text(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _tempDir, &catchMod);
- _tempDir.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_tempDir);
- auto refr = new Button(grp, SWT.PUSH);
- refr.setText(_prop.msgs.reference);
- refr.addSelectionListener(new SelTemp);
- createOpenButton(_comm, grp, &_tempDir.getText, true);
- setupDropFile(grp, _tempDir, toDelegate(&dropDir));
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- grp.setText(_prop.msgs.backupDir);
- auto gl = new GridLayout(3, false);
- gl.horizontalSpacing = 10;
- grp.setLayout(gl);
- { mixin(S_TRACE);
- _backupEnabled = new Button(grp, SWT.CHECK);
- _backupEnabled.setText(_prop.msgs.backupEnabled);
- mod(_backupEnabled);
- _backupEnabled.addSelectionListener(_refe);
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(grp, SWT.NONE);
- comp2.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- comp2.setLayout(zeroMarginGridLayout(6, false));
- _backupIntervalTypeTime = new Button(comp2, SWT.RADIO);
- _backupIntervalTypeTime.setText(_prop.msgs.backupIntervalTime);
- _backupIntervalTime = new Spinner(comp2, SWT.BORDER);
- initSpinner(_backupIntervalTime);
- _backupIntervalTime.setMinimum(1);
- _backupIntervalTime.setMaximum(99);
- mod(_backupIntervalTime);
- auto l2 = new Label(comp2, SWT.CENTER);
- l2.setText(_prop.msgs.minute);
- _backupIntervalTypeTime.addSelectionListener(_refe);
- _backupIntervalTypeEdit = new Button(comp2, SWT.RADIO);
- _backupIntervalTypeEdit.setText(_prop.msgs.backupIntervalEdit);
- _backupIntervalEdit = new Spinner(comp2, SWT.BORDER);
- initSpinner(_backupIntervalEdit);
- _backupIntervalEdit.setMinimum(1);
- _backupIntervalEdit.setMaximum(9999);
- mod(_backupIntervalEdit);
- auto l3 = new Label(comp2, SWT.CENTER);
- l3.setText(_prop.msgs.count);
- _backupIntervalTypeEdit.addSelectionListener(_refe);
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(grp, SWT.NONE);
- comp2.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- comp2.setLayout(zeroMarginGridLayout(2, false));
- auto l = new Label(comp2, SWT.CENTER);
- l.setText(_prop.msgs.backupCount);
- _backupCount = new Spinner(comp2, SWT.BORDER);
- initSpinner(_backupCount);
- _backupCount.setMinimum(0);
- _backupCount.setMaximum(99);
- mod(_backupCount);
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(grp, SWT.NONE);
- auto gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- comp2.setLayoutData(gd);
- comp2.setLayout(zeroMarginGridLayout(4, false));
- auto l = new Label(comp2, SWT.NONE);
- l.setText(_prop.msgs.backupPath);
- _backupDir = new Text(comp2, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _backupDir, &catchMod);
- _backupDir.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_backupDir);
- _backupRef = new Button(comp2, SWT.PUSH);
- _backupRef.setText(_prop.msgs.reference);
- _backupRef.addSelectionListener(new SelBackup);
- _backupDirOpen = createOpenButton(_comm, comp2, &_backupDir.getText, true);
- setupDropFile(grp, _backupDir, toDelegate(&dropDir));
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(grp, SWT.NONE);
- auto gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- comp2.setLayoutData(gd);
- comp2.setLayout(zeroMarginGridLayout(3, false));
- _backupRefAuthor = new Button(comp2, SWT.CHECK);
- _backupRefAuthor.setText(_prop.msgs.backupRefAuthor);
- mod(_backupRefAuthor);
- _backupRefAuthor.addSelectionListener(_refe);
- _autoSave = new Button(comp2, SWT.CHECK);
- _autoSave.setText(_prop.msgs.autoSave);
- mod(_autoSave);
- _autoSave.addSelectionListener(_refe);
- _backupArchived = new Button(comp2, SWT.CHECK);
- _backupArchived.setText(_prop.msgs.backupArchived);
- mod(_backupArchived);
- _backupArchived.addSelectionListener(_refe);
- }
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- grp.setText(_prop.msgs.backupBeforeSaveDir);
- grp.setLayout(new GridLayout(1, false));
- { mixin(S_TRACE);
- _backupBeforeSaveEnabled = new Button(grp, SWT.CHECK);
- _backupBeforeSaveEnabled.setText(_prop.msgs.backupBeforeSaveEnabled);
- mod(_backupBeforeSaveEnabled);
- _backupBeforeSaveEnabled.addSelectionListener(_refe);
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(grp, SWT.NONE);
- auto gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
- comp2.setLayoutData(gd);
- comp2.setLayout(zeroMarginGridLayout(4, false));
- auto l = new Label(comp2, SWT.NONE);
- l.setText(_prop.msgs.backupBeforeSavePath);
- _backupBeforeSaveDir = new Text(comp2, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _backupBeforeSaveDir, &catchMod);
- _backupBeforeSaveDir.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_backupBeforeSaveDir);
- _backupBeforeSaveRef = new Button(comp2, SWT.PUSH);
- _backupBeforeSaveRef.setText(_prop.msgs.reference);
- _backupBeforeSaveRef.addSelectionListener(new SelBackupBeforeSave);
- _backupBeforeSaveDirOpen = createOpenButton(_comm, comp2, &_backupBeforeSaveDir.getText, true);
- setupDropFile(grp, _backupBeforeSaveDir, toDelegate(&dropDir));
- }
- }
- { mixin(S_TRACE);
- auto comp2 = new Composite(comp, SWT.NONE);
- comp2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- comp2.setLayout(zeroMarginGridLayout(2, false));
- { mixin(S_TRACE);
- auto comp3 = new Composite(comp2, SWT.NONE);
- comp3.setLayoutData(new GridData(GridData.FILL_BOTH));
- comp3.setLayout(zeroMarginGridLayout(1, false));
- { mixin(S_TRACE);
- auto grp = new Group(comp3, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- auto cl = new CenterLayout;
- cl.fillHorizontal = true;
- grp.setLayout(cl);
- grp.setText(_prop.msgs.scenarioAuthor);
- _author = new Text(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _author, &catchMod);
- mod(_author);
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp3, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setLayout(new GridLayout(1, true));
- grp.setText(_prop.msgs.wallpaper);
- { mixin(S_TRACE);
- auto comp4 = new Composite(grp, SWT.NONE);
- comp4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- comp4.setLayout(zeroMarginGridLayout(3, false));
- _wallpaper = new Text(comp4, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _wallpaper, &catchMod);
- _wallpaper.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_wallpaper);
- auto refr = new Button(comp4, SWT.PUSH);
- refr.setText(_prop.msgs.reference);
- refr.addSelectionListener(new SelWallpaper);
- createOpenButton(_comm, comp4, &_wallpaper.getText, false);
- }
- { mixin(S_TRACE);
- auto comp4 = new Composite(grp, SWT.NONE);
- comp4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- comp4.setLayout(zeroMarginGridLayout(2, false));
- int[] styles;
- string[] names;
- foreach (s; [WallpaperStyle.Center, WallpaperStyle.Tile, WallpaperStyle.ExpandFull, WallpaperStyle.Expand]) { mixin(S_TRACE);
- styles ~= cast(int) s;
- names ~= _prop.msgs.wallpaperStyleName(s);
- }
- _wallpaperStyle = createEnumC(comp4, _prop.msgs.wallpaperStyle, styles, names, _wallpaperStyleTbl, _wallpaperStyleTbl2);
- }
- setupDropFile(grp, _wallpaper, &dropWallpaper);
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp3, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setText(_prop.msgs.systemSounds);
- grp.setLayout(new GridLayout(7, false));
- auto l = new Label(grp, SWT.NONE);
- l.setText(_prop.msgs.soundSaved);
- _savedSound = new Text(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _savedSound, &catchMod);
- _savedSound.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- mod(_savedSound);
- auto refr = new Button(grp, SWT.PUSH);
- refr.setText(_prop.msgs.reference);
- refr.addSelectionListener(new SelSysSound(_savedSound));
- createOpenButton(_comm, grp, &_savedSound.getText, false);
- setupDropFile(grp, _savedSound, &dropSysSound);
- auto sep = new Label(grp, SWT.SEPARATOR);
- auto sgd = new GridData(GridData.FILL_VERTICAL);
- sgd.heightHint = 0;
- sep.setLayoutData(sgd);
- auto play = new Button(grp, SWT.PUSH);
- play.setToolTipText(_prop.msgs.menuText(MenuID.PlaySE));
- play.setImage(_prop.images.menu(MenuID.PlaySE));
- .listener(play, SWT.Selection, { mixin(S_TRACE);
- string file = _savedSound.getText();
- if (file.length && .exists(file)) { mixin(S_TRACE);
- playSE(file, SOUND_TYPE_SDL);
- }
- });
- auto stop = new Button(grp, SWT.PUSH);
- stop.setToolTipText(_prop.msgs.menuText(MenuID.StopSE));
- stop.setImage(_prop.images.menu(MenuID.StopSE));
- .listener(stop, SWT.Selection, { mixin(S_TRACE);
- stopSE();
- });
- }
- }
- { mixin(S_TRACE);
- auto comp3 = new Composite(comp2, SWT.NONE);
- comp3.setLayout(zeroMarginGridLayout(1, true));
- comp3.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- { mixin(S_TRACE);
- auto grp = new Group(comp3, SWT.NONE);
- grp.setText(_prop.msgs.historiesSettings);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setLayout(new GridLayout(3, false));
- { mixin(S_TRACE);
- auto lComp = new Composite(grp, SWT.NONE);
- auto cl = new CenterLayout(SWT.HORIZONTAL | SWT.VERTICAL, 0);
- cl.fillHorizontal = true;
- lComp.setLayout(cl);
- lComp.setLayoutData(new GridData(GridData.FILL_BOTH));
- auto l = new Label(lComp, SWT.NONE);
- l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- l.setText(_prop.msgs.openHistoryMax);
- _histMax = new Spinner(grp, SWT.BORDER);
- initSpinner(_histMax);
- _histMax.setMinimum(0);
- _histMax.setMaximum(99);
- mod(_histMax);
- _clearHist = new Button(grp, SWT.PUSH);
- _clearHist.setEnabled(_prop.var.etc.openHistories.length > 0);
- _clearHist.setText(_prop.msgs.openHistoryClear);
- _clearHist.addSelectionListener(new ClearHist);
- }
- { mixin(S_TRACE);
- auto lComp = new Composite(grp, SWT.NONE);
- auto cl = new CenterLayout(SWT.HORIZONTAL | SWT.VERTICAL, 0);
- cl.fillHorizontal = true;
- lComp.setLayout(cl);
- lComp.setLayoutData(new GridData(GridData.FILL_BOTH));
- auto l = new Label(lComp, SWT.NONE);
- l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- l.setText(_prop.msgs.searchHistoryMax);
- _sHistMax = new Spinner(grp, SWT.BORDER);
- initSpinner(_sHistMax);
- _sHistMax.setMinimum(0);
- _sHistMax.setMaximum(99);
- mod(_sHistMax);
- _clearSHist = new Button(grp, SWT.PUSH);
- _clearSHist.setEnabled(_prop.var.etc.searchHistories.length || _prop.var.etc.grepDirHistories.length);
- _clearSHist.setText(_prop.msgs.searchHistoryClear);
- _clearSHist.addSelectionListener(new ClearSHist);
- }
- }
- { mixin(S_TRACE);
- auto grp = new Group(comp3, SWT.NONE);
- grp.setText(_prop.msgs.undoMax);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setLayout(new GridLayout(2, false));
- Spinner createUndoMax(string title) { mixin(S_TRACE);
- auto l = new Label(grp, SWT.NONE);
- l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- l.setText(title);
- auto spn = new Spinner(grp, SWT.BORDER);
- initSpinner(spn);
- mod(spn);
- spn.setMaximum(_prop.var.etc.undoMaxLimit);
- spn.setMinimum(0);
- return spn;
- }
- _undoMaxMainView = createUndoMax(_prop.msgs.undoMaxMainView);
- _undoMaxEvent = createUndoMax(_prop.msgs.undoMaxEvent);
- _undoMaxReplace = createUndoMax(_prop.msgs.undoMaxReplace);
- _undoMaxEtc = createUndoMax(_prop.msgs.undoMaxEtc);
- }
- }
- }
- }
- class DefBgSetting : SelectionAdapter {
- private DefBgImgDialog _dlg = null;
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- if (_dlg) { mixin(S_TRACE);
- _dlg.active();
- return;
- }
- _dlg = new DefBgImgDialog(_comm, _prop, getShell(), _bgImagesDefault);
- _dlg.appliedEvent ~= { mixin(S_TRACE);
- _bgImagesDefault = _dlg.backs;
- applyEnabled();
- };
- _dlg.closeEvent ~= { mixin(S_TRACE);
- _dlg = null;
- };
- _dlg.open();
- }
- }
- class DBgImgStg : DisposeListener {
- override void widgetDisposed(DisposeEvent e) { mixin(S_TRACE);
- auto ws = (cast(SplitPane) e.widget).getWeights();
- _prop.var.etc.bgImageSettingsSashL = ws[0];
- _prop.var.etc.bgImageSettingsSashR = ws[1];
- }
- }
- class DBgImgKeyCodeSash : DisposeListener {
- override void widgetDisposed(DisposeEvent e) { mixin(S_TRACE);
- auto ws = (cast(SplitPane) e.widget).getWeights();
- _prop.var.etc.bgImageKeyCodeSashL = ws[0];
- _prop.var.etc.bgImageKeyCodeSashR = ws[1];
- }
- }
- void construct2(CTabFolder tabf) { mixin(S_TRACE);
- auto comp = new Composite(tabf, SWT.NONE);
- _tabS = new CTabItem(tabf, SWT.NONE);
- _tabS.setText(_prop.msgs.bgImageAndKeyCode);
- _tabS.setControl(comp);
- comp.setLayout(new GridLayout(1, true));
- auto sash = new SplitPane(comp, SWT.HORIZONTAL);
- sash.setLayoutData(new GridData(GridData.FILL_BOTH));
- auto back = new Composite(sash, SWT.NONE);
- back.setLayout(zeroMarginGridLayout(1, true));
- { mixin(S_TRACE);
- auto grp = new Group(back, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- auto cl = new CenterLayout;
- cl.fillHorizontal = true;
- grp.setLayout(cl);
- grp.setText(_prop.msgs.bgImagesDefault);
- auto defBtn = new Button(grp, SWT.PUSH);
- defBtn.setText(_prop.msgs.setBgImagesDefault);
- defBtn.addSelectionListener(new DefBgSetting);
- }
- { mixin(S_TRACE);
- _bgStgs = new ToolsPane!BgImageSetting(_comm, (b) { ignoreMod = b; }, &catchMod, &applyEnabled, back, SWT.NONE);
- _bgStgs.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
- { mixin(S_TRACE);
- auto grp = new Group(sash, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_BOTH));
- grp.setLayout(new GridLayout(1, false));
- grp.setText(_prop.msgs.standardKeyCode);
- _keyCodes = new Text(grp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- createTextMenu!Text(_comm, _prop, _keyCodes, &catchMod);
- mod(_keyCodes);
- auto gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = _prop.var.etc.keyCodeWidth;
- gd.heightHint = 0;
- _keyCodes.setLayoutData(gd);
- }
- sash.setWeights([_prop.var.etc.bgImageKeyCodeSashL, _prop.var.etc.bgImageKeyCodeSashR]);
- sash.addDisposeListener(new DBgImgKeyCodeSash);
- }
- void construct3(CTabFolder tabf) { mixin(S_TRACE);
- auto comp = new Composite(tabf, SWT.NONE);
- comp.setLayout(new GridLayout(1, false));
- _tabT = new CTabItem(tabf, SWT.NONE);
- _tabT.setText(_prop.msgs.templates);
- _tabT.setControl(comp);
- auto sash = new SplitPane(comp, SWT.VERTICAL);
- sash.setLayoutData(new GridData(GridData.FILL_BOTH));
- _evTempls = new ToolsPane!EvTemplate(_comm, (b) { ignoreMod = b; }, &catchMod, &applyEnabled, sash, SWT.NONE);
- _evTempls.setLayoutData(new GridData(GridData.FILL_BOTH));
- _scTempls = new ToolsPane!ScTemplate(_comm, (b) { ignoreMod = b; }, &catchMod, &applyEnabled, sash, SWT.NONE);
- _scTempls.setLayoutData(new GridData(GridData.FILL_BOTH));
- sash.setWeights([_prop.var.etc.templatesSashL, _prop.var.etc.templatesSashR]);
- listener(sash, SWT.Dispose, { mixin(S_TRACE);
- auto ws = sash.getWeights();
- _prop.var.etc.templatesSashL = ws[0];
- _prop.var.etc.templatesSashR = ws[1];
- });
- }
- void construct4(CTabFolder tabf) { mixin(S_TRACE);
- auto comp = new Composite(tabf, SWT.NONE);
- comp.setLayout(new GridLayout(1, false));
- _tabC = new CTabItem(tabf, SWT.NONE);
- _tabC.setText(_prop.msgs.outerToolsAndClassicEngines);
- _tabC.setControl(comp);
- auto sash = new SplitPane(comp, SWT.VERTICAL);
- sash.setLayoutData(new GridData(GridData.FILL_BOTH));
- _tools = new ToolsPane!OuterTool(_comm, (b) { ignoreMod = b; }, &catchMod, &applyEnabled, sash, SWT.NONE);
- _tools.setLayoutData(new GridData(GridData.FILL_BOTH));
- _cEngines = new ToolsPane!ClassicEngine(_comm, (b) { ignoreMod = b; }, &catchMod, &applyEnabled, sash, SWT.NONE);
- _cEngines.setLayoutData(new GridData(GridData.FILL_BOTH));
- .listener(_tabf, SWT.Selection, { mixin(S_TRACE);
- if (_tabf.getSelection() !is _tabT && _cEngines.ceNameWin.getVisible()) { mixin(S_TRACE);
- _cEngines.ceNameWin.setVisible(false);
- _cEngines.features.setSelection(false);
- }
- });
- sash.setWeights([_prop.var.etc.toolsClassicEnginesSashL, _prop.var.etc.toolsClassicEnginesSashR]);
- listener(sash, SWT.Dispose, { mixin(S_TRACE);
- auto ws = sash.getWeights();
- _prop.var.etc.toolsClassicEnginesSashL = ws[0];
- _prop.var.etc.toolsClassicEnginesSashR = ws[1];
- });
- }
- Combo createEnumC(I)(Composite grp, string title, in I[] values, in string[] names, ref int[I] tblA, ref I[int] tblB, int hSpan = 1) { mixin(S_TRACE);
- assert (values.length == names.length);
- auto l = new Label(grp, SWT.NONE);
- l.setText(title);
- auto combo = new Combo(grp, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
- mod(combo);
- auto gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hSpan;
- combo.setLayoutData(gd);
- combo.setVisibleItemCount(_prop.var.etc.comboVisibleItemCount);
- foreach (i, val; values) { mixin(S_TRACE);
- tblA[val] = i;
- tblB[i] = val;
- combo.add(names[i]);
- }
- return combo;
- }
- class DMISash : DisposeListener {
- override void widgetDisposed(DisposeEvent e) { mixin(S_TRACE);
- auto ws = (cast(SplitPane) e.widget).getWeights();
- _prop.var.etc.ignoreMenuSashL = ws[0];
- _prop.var.etc.ignoreMenuSashR = ws[1];
- }
- }
- void selectMenu() { mixin(S_TRACE);
- ignoreMod = true;
- scope (exit) ignoreMod = false;
- auto i = _menu.getSelectionIndex();
- if (-1 == i) return;
- auto itm = _menu.getItem(i);
- auto data = cast(SMenuData) itm.getData();
- _mnemonic.setText(data.mnemonic);
- _hotkey.accelerator = data.hotkey;
- _menuApply.setEnabled(false);
- _menuDel.setEnabled(_mnemonic.getText().length || _hotkey.widget.getText().length);
- }
- void applyMenu() { mixin(S_TRACE);
- ignoreMod = true;
- scope (exit) ignoreMod = false;
- auto i = _menu.getSelectionIndex();
- assert (i != -1);
- auto itm = _menu.getItem(i);
- auto data = cast(SMenuData) itm.getData();
- data.mnemonic = _mnemonic.getText();
- data.hotkey = _hotkey.acceleratorText;
- itm.setText(MenuProps.buildMenuSample(_prop.parent, data.id, data.mnemonic, data.hotkey));
- _menuApply.setEnabled(false);
- applyEnabled();
- }
- void refreshMenu() { mixin(S_TRACE);
- auto selID = MenuID.None;
- int selIndex = _menu.getSelectionIndex();
- if (-1 != selIndex) { mixin(S_TRACE);
- selID = (cast(SMenuData) _menu.getItem(selIndex).getData()).id;
- }
- _menu.removeAll();
- foreach (id; EnumMembers!MenuID) { mixin(S_TRACE);
- if (id == MenuID.None) continue;
- if (isNoKeyBindMenu(id)) continue;
- string name = _prop.var.menu.buildMenuSample(_prop.parent, id);
- if (!_menuIncSearch.match(name)) continue;
- auto itm = new TableItem(_menu, SWT.NONE);
- itm.setText(name);
- itm.setImage(_prop.images.menu(id));
- auto data = new SMenuData();
- data.id = id;
- data.mnemonic = _prop.var.menu.mnemonic(id);
- data.hotkey = _prop.var.menu.hotkey(id);
- itm.setData(data);
- if (id == selID) { mixin(S_TRACE);
- _menu.select(_menu.getItemCount() - 1);
- }
- }
- if (-1 == _menu.getSelectionIndex()) _menu.select(0);
- _menu.showSelection();
- selectMenu();
- }
- class SelectMenu : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- selectMenu();
- }
- }
- class ModMenu : ModifyListener {
- override void modifyText(ModifyEvent e) { mixin(S_TRACE);
- if (ignoreMod) return;
- _menuApply.setEnabled(true);
- _menuDel.setEnabled(_mnemonic.getText().length || _hotkey.widget.getText().length);
- }
- }
- class DelMenuAccel : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- ignoreMod = true;
- scope (exit) ignoreMod = false;
- _mnemonic.setText("");
- _hotkey.widget.setText("");
- applyMenu();
- _menuDel.setEnabled(false);
- }
- }
- class ApplyMenu : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- applyMenu();
- }
- }
- class SelBoolTable : SelectionAdapter {
- override void widgetSelected(SelectionEvent e) { mixin(S_TRACE);
- if (e.detail != SWT.CHECK) return;
- applyEnabled();
- if (e.item is _contentsFloat && _contentsFloat.getChecked()) { mixin(S_TRACE);
- _contentsAutoHide.setChecked(false);
- }
- if (e.item is _contentsAutoHide && _contentsAutoHide.getChecked()) { mixin(S_TRACE);
- _contentsFloat.setChecked(false);
- }
- }
- }
- void construct5(CTabFolder tabf) { mixin(S_TRACE);
- auto comp = new Composite(tabf, SWT.NONE);
- _tabE = new CTabItem(tabf, SWT.NONE);
- _tabE.setText(_prop.msgs.etcSettings);
- _tabE.setControl(comp);
- comp.setLayout(new GridLayout(2, false));
- { mixin(S_TRACE);
- auto grp = new Group(comp, SWT.NONE);
- grp.setLayoutData(new GridData(GridData.FILL_VERTICAL));
- grp.setText(_prop.msgs.etcSettingsTitle);
- grp.setLayout(new GridLayout(5, false));
- auto boolTable = new Table(grp, SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK);
- new FullTableColumn(boolTable, SWT.NONE);
- boolTable.addSelectionListener(new SelBoolTable);
- auto tgd = new GridData(GridData.FILL_BOTH);
- tgd.horizontalSpan = 5;
- tgd.heightHint = 0;
- boolTable.setLayoutData(tgd);
- TableItem createB(string text) { mixin(S_TRACE);
- auto itm = new TableItem(boolTable, SWT.NONE);
- itm.setText(text);
- return itm;
- }
- if (!_comm.singleWindowMode(_prop)) { mixin(S_TRACE);
- _singleWindow = createB(_prop.msgs.singleWindow);
- }
- _showAreaDirTree = createB(_prop.msgs.showAreaDirTree);
- _showSummaryInAreaTable = createB(_prop.msgs.showSummaryInAreaTable);
- _clickIsOpenEvent = createB(_prop.msgs.clickIsOpenEvent);
- _smoothingCard = createB(_prop.msgs.smoothingCard);
- _showImagePreview = createB(_prop.msgs.showImagePreview);
- _editTriggerTypeIsQuick = createB(_prop.msgs.editTriggerTypeIsQuick);
- _classicStyleTree = createB(_prop.msgs.classicStyleTree);
- _adjustContentName = createB(_prop.msgs.adjustContentName);
- _radarStyleParams = createB(_prop.msgs.radarStyleParams);
- _showEventTreeMark = createB(_prop.msgs.showEventTreeMark);
- _showCardListHeader = createB(_prop.msgs.showCardListHeader);
- _showCardListTitle = createB(_prop.msgs.showCardListTitle);
- _showSkillCardLevel = createB(_prop.msgs.showSkillCardLevel);
- _ignoreEmptyStart = createB(_prop.msgs.ignoreEmptyStart);
- _expandXMLs = createB(_prop.msgs.expandXMLs);
- _contentsFloat = createB(_prop.msgs.contentsFloat);
- _contentsAutoHide = createB(_prop.msgs.contentsAutoHide);
- _comboListVisible = createB(_prop.msgs.comboListVisible);
- _xmlCopy = createB(_prop.msgs.xmlCopy);
- _showSpNature = createB(_prop.msgs.showSpNature);
- _saveInnerImagePath = createB(_prop.msgs.saveInnerImagePath);
- _linkCard = createB(_prop.msgs.linkCard);
- _traceDirectories = createB(_prop.msgs.traceDirectories);
- _logicalSort = createB(_prop.msgs.logicalSort);
- _copyDesc = createB(_prop.msgs.copyDesc);
- _refCardsAtEditBgImage = createB(_prop.msgs.refCardsAtEditBgImage);
- _floatMessagePreview = createB(_prop.msgs.floatMessagePreview);
- _addNewClassicEngine = createB(_prop.msgs.addNewClassicEngine);
- _doubleIO = createB(_prop.msgs.doubleIO);
- _switchTabWheel = createB(_prop.msgs.switchTabWheel);
- _closeTabWithMiddleClick = createB(_prop.msgs.closeTabWithMiddleClick);
- _openTabAtRightOfCurrentTab = createB(_prop.msgs.openTabAtRightOfCurrentTab);
- _reconstruction = createB(_prop.msgs.reconstruction);
- _openLastScenario = createB(_prop.msgs.openLastScenario);
- _showVariableValuesInEventText = createB(_prop.msgs.showVariableValuesInEventText);
- _cautionBeforeReplace = createB(_prop.msgs.cautionBeforeReplace);
- _saveNeedChanged = createB(_prop.msgs.saveNeedChanged);
- _applyDialogsBeforeSave = createB(_prop.msgs.applyDialogsBeforeSave);
- _useNamesAfterStandard = createB(_prop.msgs.useNamesAfterStandard);
- _selectVariableWithTree = createB(_prop.msgs.selectVariableWithTree);
- _autoUpdateJpy1File = createB(_prop.msgs.autoUpdateJpy1File);
- _straightEventTreeView = createB(_prop.msgs.straightEventTreeView);
- _gentleAngleEventTree = createB(_prop.msgs.gentleAngleEventTree);
- _forceIndentBranchContent = createB(_prop.msgs.forceIndentBranchContent);
- _showTerminalMark = createB(_prop.msgs.showTerminalMark);
- _clickIconIsStartEdit = createB(_prop.msgs.clickIconIsStartEdit);
- auto sep = new Label(grp, SWT.SEPARATOR | SWT.HORIZONTAL);
- auto sepgd = new GridData(GridData.FILL_HORIZONTAL);
- sepgd.horizontalSpan = 5;
- sep.setLayoutData(sepgd);
- immutable string[] targetVersionVals = [
- "CardWirthPy",
- // FIXME: CardWirth 1.60
- /+ "1.60",
- +/ "1.50",
- "1.30",
- "1.29",
- "1.28",
- ];
- string[] targetVersionNames = [
- _prop.msgs.cardWirthPy.value,
- ] ~ std.algorithm.map!((s) => .tryFormat(_prop.msgs.cardWirthWithVersion, s))(targetVersionVals[1..$]).array();
- _targetVersion = createEnumC(grp, _prop.msgs.targetVersion, targetVersionVals, targetVersionNames, _targetVersionTbl, _targetVersionTbl2, 4);
- auto dummy2 = new Composite(grp, SWT.NONE);
- auto dgd2 = new GridData(GridData.FILL_HORIZONTAL);
- dgd2.widthHint = 0;
- dgd2.heightHint = 0;
- dummy2.setLayoutData(dgd2);
- auto tvHint = new Label(grp, SWT.NONE);
- tvHint.setText(_prop.msgs.targetVersionHint);
- auto tvHintGD = new GridData(GridData.FILL_HORIZONTAL);
- tvHintGD.horizontalSpan = 4;
- tvHint.setLayoutData(tvHintGD);
- version (Windows) {
- immutable int[] soundPlayTypeVals = [
- SOUND_TYPE_AUTO,
- SOUND_TYPE_SDL,
- SOUND_TYPE_MCI,
- SOUND_TYPE_APP
- ];
- immutable string[] soundPlayTypeNames = [
- _prop.msgs.soundPlayTypeDef,
- _prop.msgs.soundPlayTypeSDL,
- _prop.msgs.soundPlayTypeMCI,
- _prop.msgs.soundPlayTypeApp
- ];
- } else { mixin(S_TRACE);
- immutable int[] soundPlayTypeVals = [
- SOUND_TYPE_AUTO,
- SOUND_TYPE_SDL,
- SOUND_TYPE_APP
- ];
- immutable string[] soundPlayTypeNames = [
- _prop.msgs.soundPlayTypeDef,
- _prop.msgs.soundPlayTypeSDL,
- _prop.msgs.soundPlayTypeApp
- ];
- }
- Spinner createVolume() { mixin(S_TRACE);
- auto l1 = new Label(grp, SWT.CENTER);
- l1.setText(_prop.msgs.soundVolume);
- auto spn = new Spinner(grp, SWT.BORDER);
- initSpinner(spn);
- spn.setMinimum(0);
- spn.setMaximum(100);
- mod(spn);
- auto l2 = new Label(grp, SWT.CENTER);
- l2.setText(_prop.msgs.soundVolumePer);
- return spn;
- }
- _soundPlayType = createEnumC(grp, _prop.msgs.soundPlayType, soundPlayTypeVals, soundPlayTypeNames, _soundPlayTypeTbl, _soundPlayTypeTbl2);
- _bgmVolume = createVolume();
- string sameBGM = _prop.msgs.soundPlaySameBGM;
- _soundEffectPlayType = createEnumC(grp, _prop.msgs.soundEffectPlayType, [SOUND_TYPE_SAME_BGM] ~ soundPlayTypeVals, sameBGM ~ soundPlayTypeNames, _soundEffectPlayTypeTbl, _soundEffectPlayTypeTbl2);
- _seVolume = createVolume();
- auto dummy = new Composite(grp, SWT.NONE);
- auto dgd = new GridData(GridData.FILL_HORIZONTAL);
- dgd.widthHint = 0;
- dgd.heightHint = 0;
- dummy.setLayoutData(dgd);
- auto volc = new Label(grp, SWT.NONE);
- volc.setText(_prop.msgs.soundCaution);
- auto volcgd = new GridData(GridData.FILL_HORIZONTAL);
- volcgd.horizontalSpan = 4;
- volc.setLayoutData(volcgd);
- _dialogStatus = createEnumC(grp, _prop.msgs.dialogStatus, [
- cast(int) DialogStatus.Top,
- cast(int) DialogStatus.Under,
- cast(int) DialogStatus.UnderWithCoupon,
- ], [
- _prop.msgs.dialogStatusName(DialogStatus.Top),
- _prop.msgs.dialogStatusName(DialogStatus.Under),
- _prop.msgs.dialogStatusName(DialogStatus.UnderWithCoupon),
- ], _dialogStatusTbl, _dialogStatusTbl2, 4);
- }
- { mixin(S_TRACE);
- auto sash = new SplitPane(comp, SWT.VERTICAL);
- sash.setLayoutData(new GridData(GridData.FILL_BOTH));
- { mixin(S_TRACE);
- auto grp = new Group(sash, SWT.NONE);
- grp.setText(_prop.msgs.keyBind);
- grp.setLayout(new GridLayout(4, false));
- auto l1 = new Label(grp, SWT.NONE);
- l1.setText(_prop.msgs.mnemonic);
- _mnemonic = mnemonicText(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _mnemonic, &catchMod);
- _mnemonic.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- _mnemonic.addModifyListener(new ModMenu);
- _menuApply = new Button(grp, SWT.PUSH);
- _menuApply.setText(_prop.msgs.apply);
- _menuApply.addSelectionListener(new ApplyMenu);
- _menuDel = new Button(grp, SWT.PUSH);
- _menuDel.setText(_prop.msgs.del);
- _menuDel.addSelectionListener(new DelMenuAccel);
- auto l2 = new Label(grp, SWT.NONE);
- l2.setText(_prop.msgs.hotkey);
- _hotkey = new HotKeyField(grp, SWT.BORDER);
- createTextMenu!Text(_comm, _prop, _hotkey.widget, &catchMod);
- auto hgd = new GridData(GridData.FILL_HORIZONTAL);
- hgd.horizontalSpan = 3;
- _hotkey.widget.setLayoutData(hgd);
- _hotkey.widget.addModifyListener(new ModMenu);
- _menu = new Table(grp, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION);
- auto mgd = new GridData(GridData.FILL_BOTH);
- mgd.horizontalSpan = 4;
- mgd.heightHint = _prop.var.etc.menuSettingsHeight;
- _menu.setLayoutData(mgd);
- new FullTableColumn(_menu, SWT.NONE);
- _menu.addSelectionListener(new SelectMenu);
- _menuIncSearch = new IncSearch(_comm, _menu);
- _menuIncSearch.modEvent ~= &refreshMenu;
- auto menu = new Menu(_menu.getShell(), SWT.POP_UP);
- createMenuItem(_comm, menu, MenuID.IncSearch, &menuIncSearch, null);
- _menu.setMenu(menu);
- refreshMenu();
- grp.setTabList([_menuApply, _menuDel, _menu]);
- }
- { mixin(S_TRACE);
- auto grp = new Group(sash, SWT.NONE);
- grp.setText(_prop.msgs.ignorePaths);
- grp.setLayout(new GridLayout(1, false));
- _ignorePaths = new Text(grp, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
- createTextMenu!Text(_comm, _prop, _ignorePaths, &catchMod);
- mod(_ignorePaths);
- auto gdp = new GridData(GridData.FILL_BOTH);
- gdp.widthHint = _prop.var.etc.ignorePathsWidth;
- gdp.heightHint = 0;
- _ignorePaths.setLayoutData(gdp);
- }
- sash.setWeights([_prop.var.etc.ignoreMenuSashL, _prop.var.etc.ignoreMenuSashR]);
- sash.addDisposeListener(new DMISash);
- }
- }
- private RefE _refe;
- private void refreshScenario(Summary summ) { mixin(S_TRACE);
- _summ = summ;
- }
- private void refreshEnabled() { mixin(S_TRACE);
- _backupDir.setEnabled(_backupEnabled.getSelection());
- _backupIntervalTypeTime.setEnabled(_backupEnabled.getSelection());
- _backupIntervalTypeEdit.setEnabled(_backupEnabled.getSelection());
- _backupIntervalTime.setEnabled(_backupEnabled.getSelection() && _backupIntervalTypeTime.getSelection());
- _backupIntervalEdit.setEnabled(_backupEnabled.getSelection() && _backupIntervalTypeEdit.getSelection());
- _backupCount.setEnabled(_backupEnabled.getSelection());
- _backupRef.setEnabled(_backupEnabled.getSelection());
- _backupRefAuthor.setEnabled(_backupEnabled.getSelection());
- _autoSave.setEnabled(_backupEnabled.getSelection());
- _backupArchived.setEnabled(_backupEnabled.getSelection());
- _backupBeforeSaveDir.setEnabled(_backupBeforeSaveEnabled.getSelection());
- _backupBeforeSaveRef.setEnabled(_backupBeforeSaveEnabled.getSelection());
- }
- void refEngineEnabled() { mixin(S_TRACE);
- _findEnginePath.setEnabled(0 == _enginePath.getText().length);
- _enginePath.setEnabled(!_findEnginePath.getSelection() || _enginePath.getText().length);
- _refEnginePath.setEnabled(_enginePath.getEnabled());
- }
- public:
- this (Commons comm, Props prop, Shell shell, DockingFolderCTC dock, Summary summ, void delegate() sendReloadProps) { mixin(S_TRACE);
- super(prop, shell, false, prop.msgs.dlgTitSettings, prop.images.menu(MenuID.Settings), true, prop.var.settingsDlg, true);
- _comm = comm;
- _prop = prop;
- _dock = dock;
- _summ = summ;
- _sendReloadProps = sendReloadProps;
- }
- protected:
- override void setup(Composite area) { mixin(S_TRACE);
- area.setLayout(windowGridLayout(1, true));
- _comm.refScenario.add(&refreshScenario);
- _comm.refHistories.add(&refHistories);
- _comm.refSearchHistories.add(&refSearchHistories);
- area.addDisposeListener(new class DisposeListener {
- override void widgetDisposed(DisposeEvent e) { mixin(S_TRACE);
- _comm.refScenario.remove(&refreshScenario);
- _comm.refHistories.remove(&refHistories);
- _comm.refSearchHistories.remove(&refSearchHistories);
- }
- });
- _tabf = new CTabFolder(area, SWT.BORDER);
- _tabf.setLayoutData(new GridData(GridData.FILL_BOTH));
- _refe = new RefE;
- construct1(_tabf);
- construct2(_tabf);
- construct3(_tabf);
- construct4(_tabf);
- construct5(_tabf);
- _bgStgs.setup(_prop.var.etc.bgImageSettings, _prop.var.etc.bgImageSettingsSashL.value, _prop.var.etc.bgImageSettingsSashR.value);
- _cEngines.setup(_prop.var.etc.classicEngines, _prop.var.etc.classicEnginesSashL.value, _prop.var.etc.classicEnginesSashR.value);
- _tools.setup(_prop.var.etc.outerTools, _prop.var.etc.outerToolsSashL.value, _prop.var.etc.outerToolsSashR.value);
- _scTempls.setup(_prop.var.etc.scenarioTemplates, _prop.var.etc.scenarioTemplatesSashL.value, _prop.var.etc.scenarioTemplatesSashR.value);
- _evTempls.setup(_prop.var.etc.eventTemplates, _prop.var.etc.eventTemplatesSashL.value, _prop.var.etc.eventTemplatesSashR.value);
- _tools.setShortcutWeights(_prop.var.etc.outerToolShortcutSashL.value, _prop.var.etc.outerToolShortcutSashR.value);
- _cEngines.setShortcutWeights(_prop.var.etc.classicEngineShortcutSashL.value, _prop.var.etc.classicEngineShortcutSashR.value);
- _evTempls.setShortcutWeights(_prop.var.etc.eventTemplateShortcutSashL.value, _prop.var.etc.eventTemplateShortcutSashR.value);
- _enginePath.setText(_prop.var.etc.enginePath);
- _findEnginePath.setSelection(_prop.var.etc.findEnginePath);
- refEngineEnabled();
- _tempDir.setText(_prop.var.etc.tempPath);
- _backupDir.setText(_prop.var.etc.backupPath);
- _backupEnabled.setSelection(_prop.var.etc.backupEnabled);
- _backupIntervalTypeTime.setSelection(_prop.var.etc.backupIntervalType != BackupType.Edit);
- _backupIntervalTypeEdit.setSelection(_prop.var.etc.backupIntervalType == BackupType.Edit);
- _backupIntervalTime.setSelection(_prop.var.etc.backupInterval);
- _backupIntervalEdit.setSelection(_prop.var.etc.backupIntervalEdit);
- _backupCount.setSelection(_prop.var.etc.backupCount);
- _backupRefAuthor.setSelection(_prop.var.etc.backupRefAuthor);
- _autoSave.setSelection(_prop.var.etc.autoSave);
- _backupArchived.setSelection(_prop.var.etc.backupArchived);
- _backupBeforeSaveDir.setText(_prop.var.etc.backupBeforeSavePath);
- _backupBeforeSaveEnabled.setSelection(_prop.var.etc.backupBeforeSaveEnabled);
- _author.setText(_prop.var.etc.defaultAuthor);
- _wallpaper.setText(_prop.var.etc.wallpaper);
- auto wsp = _prop.var.etc.wallpaperStyle in _wallpaperStyleTbl;
- if (wsp) { mixin(S_TRACE);
- _wallpaperStyle.select(*wsp);
- } else { mixin(S_TRACE);
- _wallpaperStyle.select(WallpaperStyle.Tile);
- }
- _histMax.setSelection(_prop.var.etc.historyMax);
- _sHistMax.setSelection(_prop.var.etc.searchHistoryMax);
- _undoMaxMainView.setSelection(_prop.var.etc.undoMaxMainView);
- _undoMaxEvent.setSelection(_prop.var.etc.undoMaxEvent);
- _undoMaxReplace.setSelection(_prop.var.etc.undoMaxReplace);
- _undoMaxEtc.setSelection(_prop.var.etc.undoMaxEtc);
- string ipbuf = "";
- foreach (path; _prop.var.etc.ignorePaths) { mixin(S_TRACE);
- ipbuf ~= path ~ "\n";
- }
- _ignorePaths.setText(ipbuf);
- _showAreaDirTree.setChecked(_prop.var.etc.showAreaDirTree);
- _showSummaryInAreaTable.setChecked(_prop.var.etc.showSummaryInAreaTable);
- _clickIsOpenEvent.setChecked(_prop.var.etc.clickIsOpenEvent);
- _expandXMLs.setChecked(_prop.var.etc.expandXMLs);
- _smoothingCard.setChecked(_prop.var.etc.smoothingCard);
- _showImagePreview.setChecked(_prop.var.etc.showImagePreview);
- _editTriggerTypeIsQuick.setChecked(_prop.var.etc.editTriggerType is EditTrigger.Quick);
- _classicStyleTree.setChecked(_prop.var.etc.classicStyleTree);
- _adjustContentName.setChecked(_prop.var.etc.adjustContentName);
- _radarStyleParams.setChecked(_prop.var.etc.radarStyleParams);
- _showEventTreeMark.setChecked(_prop.var.etc.showEventTreeMark);
- _showCardListHeader.setChecked(_prop.var.etc.showCardListHeader);
- _showCardListTitle.setChecked(_prop.var.etc.showCardListTitle);
- _showSkillCardLevel.setChecked(_prop.var.etc.showSkillCardLevel);
- _ignoreEmptyStart.setChecked(_prop.var.etc.ignoreEmptyStart);
- if (_singleWindow) { mixin(S_TRACE);
- _singleWindow.setChecked(_prop.var.etc.singleWindow);
- }
- _contentsFloat.setChecked(_prop.var.etc.contentsFloat);
- _contentsAutoHide.setChecked(_prop.var.etc.contentsAutoHide);
- _comboListVisible.setChecked(_prop.var.etc.comboListVisible);
- _xmlCopy.setChecked(_prop.var.etc.xmlCopy);
- _showSpNature.setChecked(_prop.var.etc.showSpNature);
- _saveInnerImagePath.setChecked(_prop.var.etc.saveInnerImagePath);
- _linkCard.setChecked(_prop.var.etc.lin…
Large files files are truncated, but you can click here to view the full file