diff --git a/History.txt b/History.txt index 951aa41..9b4bcbd 100755 --- a/History.txt +++ b/History.txt @@ -1,5 +1,10 @@ 【なでしこ更新履歴】※(@数値)がバグ掲示板のスレッド番号です。(#数値)は旧Tracの番号。(r数値)は旧SVNの番号。 +2024/03/09 version 1.589 +- Shift_JISの解析が失敗する不具合を修正(@994) +- セキュリティ保全のため、なでしこエディタのブラウザ部品を廃止。 +- 日本語環境以外では実行できない旨を表示(@401) + 2023/03/13 version 1.588 - なでしこのトップページURL変更を反映(@985) - 『デバッグ』コマンドでデバッグウィンドウにメインプログラムが表示されない問題を修正(@984) diff --git a/hi_unit/dll_plugin_helper.dcu b/hi_unit/dll_plugin_helper.dcu index d6b3849..60d0c78 100644 Binary files a/hi_unit/dll_plugin_helper.dcu and b/hi_unit/dll_plugin_helper.dcu differ diff --git a/hi_unit/hima_system.pas b/hi_unit/hima_system.pas index 6619f02..9407b53 100644 --- a/hi_unit/hima_system.pas +++ b/hi_unit/hima_system.pas @@ -273,6 +273,10 @@ procedure AddStrVar(name, value: AnsiString; tag: Integer; kaisetu, yomigana: An +function GetUserDefaultLocaleName( + lpLocaleName : LPWSTR; + cchLocaleName : Integer) : Integer; stdcall; external 'Kernel32.dll'; + var FHiSystem: THiSystem = nil;// private にすべし var dnako_dll_handle: THandle = 0; @@ -2923,9 +2927,33 @@ constructor HException.Create(msg: AnsiString); Exception(Self).Create(string(msg)); end; + +function GetUserLocale(): string; +var + p: array of WideChar; +begin + SetLength(p, 256); + GetUserDefaultLocaleName(@p[0], Length(p)); + Result := trim(string(PWideChar(p))); +end; + +var + loc, s: string; + i: Integer; initialization begin - HiSystem.CheckInitSystem; // 起動 + // 日本語環境以外では動作しない旨を報告(@401) + loc := GetUserLocale(); + if loc <> 'ja-JP' then + begin + s := 'This app only works in Japanese locale.'#13#10'Do you want to quit?'; + i := MessageBox(0, PChar(s), 'Information', MB_YESNO); + if i = IDYES then begin + System.Exit; + end; + end; + // 起動 + HiSystem.CheckInitSystem; end; finalization diff --git a/hi_unit/unit_string.pas b/hi_unit/unit_string.pas index 83067a1..15ca5ca 100644 --- a/hi_unit/unit_string.pas +++ b/hi_unit/unit_string.pas @@ -20,7 +20,7 @@ interface // SJIS Support type TChars = set of AnsiChar; -const SJISLeadBytes: TChars = [#$81..#$9F,#$E0..#$EF]; +const SJISLeadBytes: TChars = [#$81..#$9F,#$E0..#$FC]; //------------------------------------------------------------------------------ // PAnsiChar 関連 diff --git a/nadesiko_version.pas b/nadesiko_version.pas index 7a6697e..885312e 100644 --- a/nadesiko_version.pas +++ b/nadesiko_version.pas @@ -4,8 +4,8 @@ interface const //todo 1:★★★なでしこバージョン - NADESIKO_VER = '1.588'; - NADESIKO_DATE = '2022/03/13'; + NADESIKO_VER = '1.589'; + NADESIKO_DATE = '2024/03/09'; NADESIKO_GUID = '8EBAA659-590A-487A-8260-00F32660E014'; // REPORT : LocalAppData diff --git a/nakopad_unit/frmNakopadU.dfm b/nakopad_unit/frmNakopadU.dfm index 20e1e4e..a48f665 100644 --- a/nakopad_unit/frmNakopadU.dfm +++ b/nakopad_unit/frmNakopadU.dfm @@ -1,6 +1,6 @@ object frmNakopad: TfrmNakopad - Left = 198 - Top = 139 + Left = 149 + Top = 125 Width = 823 Height = 574 Caption = 'frmNakopad' @@ -22,13 +22,13 @@ object frmNakopad: TfrmNakopad object splitPanel: TSplitter Left = 217 Top = 29 - Height = 475 + Height = 467 end object pageLeft: TPageControl Left = 0 Top = 29 Width = 217 - Height = 475 + Height = 467 ActivePage = sheetAction Align = alLeft MultiLine = True @@ -41,7 +41,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 209 - Height = 431 + Height = 423 Align = alClient BevelOuter = bvNone TabOrder = 0 @@ -70,14 +70,14 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 267 Width = 209 - Height = 164 + Height = 156 Align = alClient TabOrder = 1 object Panel2: TPanel Left = 1 - Top = 147 + Top = 128 Width = 207 - Height = 16 + Height = 27 Align = alBottom BevelInner = bvSpace BevelOuter = bvLowered @@ -85,46 +85,21 @@ object frmNakopad: TfrmNakopad object btnActionOpenBrowser: TButton Left = 1 Top = 1 - Width = 33 - Height = 15 + Width = 96 + Height = 24 Hint = #12502#12521#12454#12470#12391#38283#12367 - Caption = #9633 + Caption = #12502#12521#12454#12470#12391#38283#12367 TabOrder = 0 OnClick = btnActionOpenBrowserClick end - object btnWebBack: TButton - Left = 33 - Top = 1 - Width = 33 - Height = 15 - Hint = #25147#12427 - Caption = #8592 - TabOrder = 1 - OnClick = btnWebBackClick - end end - object webAction: TUIWebBrowser + object webAction: TMemo Left = 1 Top = 1 Width = 207 - Height = 146 + Height = 127 Align = alClient TabOrder = 1 - OnBeforeNavigate2 = webActionBeforeNavigate2 - IeNoContext = False - IeNO3DBORDER = False - IeSCROLL_hidden = False - IeDontSCRIPT = False - IeEnableAccelerator = True - IeNoBehavior = False - IeAutoComplete = False - DownLoadControl = [CS_Images, CS_NoScripts, CS_NoJava, CS_NoActiveXRun, cs_NoActiveXDownLoad, CS_Silent] - ControlData = { - 4C00000065150000170F00000000000000000000000000000000000000000000 - 000000004C000000000000000000000001000000E0D057007335CF11AE690800 - 2B2E126202000000000000004C0000000114020000000000C000000000000046 - 8000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000100000000000000000000000000000000000000} end end end @@ -136,7 +111,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 209 - Height = 431 + Height = 423 Align = alClient BevelOuter = bvLowered TabOrder = 0 @@ -153,7 +128,7 @@ object frmNakopad: TfrmNakopad Width = 193 Height = 20 AutoComplete = False - ItemHeight = 0 + ItemHeight = 12 PopupMenu = popFind TabOrder = 0 OnEnter = cmbFindEnter @@ -198,7 +173,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 97 Width = 207 - Height = 333 + Height = 325 Style = lbOwnerDrawFixed Align = alClient ItemHeight = 20 @@ -216,7 +191,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 209 - Height = 431 + Height = 423 Align = alClient BevelOuter = bvLowered TabOrder = 0 @@ -252,7 +227,7 @@ object frmNakopad: TfrmNakopad Width = 193 Height = 20 AutoComplete = False - ItemHeight = 0 + ItemHeight = 12 PopupMenu = popFind TabOrder = 2 OnEnter = cmbGroupEnter @@ -272,7 +247,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 81 Width = 207 - Height = 349 + Height = 341 Align = alClient TabOrder = 1 object Splitter1: TSplitter @@ -303,7 +278,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 92 Width = 205 - Height = 227 + Height = 219 Style = lbOwnerDrawVariable Align = alClient DragMode = dmAutomatic @@ -316,7 +291,7 @@ object frmNakopad: TfrmNakopad end object pnlGroupFilter: TPanel Left = 1 - Top = 319 + Top = 311 Width = 205 Height = 29 Align = alBottom @@ -372,7 +347,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 204 Width = 209 - Height = 227 + Height = 219 Align = alClient Columns = <> DragMode = dmAutomatic @@ -392,13 +367,13 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 209 - Height = 431 + Height = 423 Align = alClient BevelOuter = bvLowered TabOrder = 0 object Splitter6: TSplitter Left = 1 - Top = 356 + Top = 348 Width = 207 Height = 3 Cursor = crVSplit @@ -434,7 +409,7 @@ object frmNakopad: TfrmNakopad Width = 193 Height = 20 AutoComplete = False - ItemHeight = 0 + ItemHeight = 12 PopupMenu = popFind TabOrder = 2 OnEnter = cmbCmdEnter @@ -453,7 +428,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 68 Width = 207 - Height = 288 + Height = 280 Style = lbOwnerDrawVariable Align = alClient DragMode = dmAutomatic @@ -467,7 +442,7 @@ object frmNakopad: TfrmNakopad end object Panel13: TPanel Left = 1 - Top = 359 + Top = 351 Width = 207 Height = 71 Align = alBottom @@ -553,7 +528,7 @@ object frmNakopad: TfrmNakopad Width = 193 Height = 20 AutoComplete = False - ItemHeight = 0 + ItemHeight = 12 PopupMenu = popFind TabOrder = 1 OnEnter = cmbVarEnter @@ -600,7 +575,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 81 Width = 209 - Height = 350 + Height = 342 Style = lbOwnerDrawFixed Align = alClient DragMode = dmAutomatic @@ -618,7 +593,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 33 Width = 209 - Height = 398 + Height = 390 Align = alClient TabOrder = 0 object Splitter4: TSplitter @@ -643,7 +618,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 108 Width = 207 - Height = 289 + Height = 281 Style = lbOwnerDrawFixed Align = alClient DragMode = dmAutomatic @@ -681,7 +656,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 209 - Height = 431 + Height = 423 Align = alClient BevelOuter = bvLowered TabOrder = 0 @@ -709,7 +684,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 33 Width = 207 - Height = 397 + Height = 389 Align = alClient TabOrder = 1 OnEditButtonClick = propGuiEditButtonClick @@ -726,7 +701,7 @@ object frmNakopad: TfrmNakopad object ToolBar1: TToolBar Left = 0 Top = 0 - Width = 815 + Width = 807 Height = 29 ButtonHeight = 26 ButtonWidth = 27 @@ -842,8 +817,8 @@ object frmNakopad: TfrmNakopad end object Status: TStatusBar Left = 0 - Top = 504 - Width = 815 + Top = 496 + Width = 807 Height = 19 Panels = < item @@ -862,8 +837,8 @@ object frmNakopad: TfrmNakopad object tabsMain: TTabControl Left = 220 Top = 29 - Width = 595 - Height = 475 + Width = 587 + Height = 467 Align = alClient Style = tsFlatButtons TabOrder = 3 @@ -876,8 +851,8 @@ object frmNakopad: TfrmNakopad object pageMain: TPageControl Left = 4 Top = 26 - Width = 587 - Height = 445 + Width = 579 + Height = 437 ActivePage = tabSource Align = alClient TabOrder = 0 @@ -888,7 +863,7 @@ object frmNakopad: TfrmNakopad object splitEdit: TSplitter Left = 0 Top = 0 - Width = 579 + Width = 571 Height = 2 Cursor = crVSplit Align = alTop @@ -896,12 +871,12 @@ object frmNakopad: TfrmNakopad object splitLR: TSplitter Left = 3 Top = 2 - Height = 418 + Height = 410 end object edtA: TEditorEx Left = 0 Top = 2 - Width = 579 + Width = 571 Height = 0 Cursor = crIBeam Align = alTop @@ -1079,8 +1054,8 @@ object frmNakopad: TfrmNakopad object edtB: TEditorEx Left = 6 Top = 2 - Width = 573 - Height = 418 + Width = 565 + Height = 410 Cursor = crIBeam Align = alClient Caret.AutoCursor = True @@ -1261,7 +1236,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 2 Width = 3 - Height = 418 + Height = 410 Align = alLeft BevelOuter = bvNone Caption = 'panelOtehon' @@ -1270,7 +1245,7 @@ object frmNakopad: TfrmNakopad Left = 0 Top = 0 Width = 3 - Height = 283 + Height = 275 Cursor = crIBeam Align = alClient Caret.AutoCursor = True @@ -1446,7 +1421,7 @@ object frmNakopad: TfrmNakopad end object panelOtehonBottom: TPanel Left = 0 - Top = 283 + Top = 275 Width = 3 Height = 135 Align = alBottom @@ -1653,16 +1628,16 @@ object frmNakopad: TfrmNakopad Caption = #12487#12470#12452#12531 ImageIndex = 1 object Splitter5: TSplitter - Left = 450 + Left = 442 Top = 0 - Height = 420 + Height = 412 Align = alRight end object panelDesign: TPanel Left = 0 Top = 0 - Width = 450 - Height = 420 + Width = 442 + Height = 412 Align = alClient BevelInner = bvRaised BevelOuter = bvLowered @@ -1698,10 +1673,10 @@ object frmNakopad: TfrmNakopad end end object panelTools: TPanel - Left = 453 + Left = 445 Top = 0 Width = 126 - Height = 420 + Height = 412 Align = alRight TabOrder = 1 object Panel11: TPanel @@ -1718,7 +1693,7 @@ object frmNakopad: TfrmNakopad Left = 1 Top = 33 Width = 124 - Height = 386 + Height = 378 Align = alClient ItemHeight = 12 TabOrder = 1 diff --git a/nakopad_unit/frmNakopadU.pas b/nakopad_unit/frmNakopadU.pas index e7e3ecc..bd7ba55 100644 --- a/nakopad_unit/frmNakopadU.pas +++ b/nakopad_unit/frmNakopadU.pas @@ -10,7 +10,7 @@ interface XPMan, NadesikoFountain, PerlFountain, JavaFountain, CppFountain, HTMLFountain, DelphiFountain, HimawariFountain, HViewEdt, AppEvnts, TrackBox, unit_guiParts, Grids, ValEdit, OleCtrls, SHDocVw, - Buttons, UIWebBrowser; + Buttons; const NAKO_VNAKO = 0; @@ -23,7 +23,7 @@ interface DIR_TOOLS = 'tools\'; DIR_TEMPLATE = 'tools\template\'; MODE_HINT_STR = '※【なでしこ実行モード】'; - WEB_NEWS = 'https://nadesi.com/index.php?NakopadEntry&simple'; + WEB_NEWS = 'https://nadesi.com/index.php?NakopadEntry'; NAKOPAD1_INI = 'nakopad.ini'; NAKOPAD3_INI = 'nakopad3.ini'; NAKOPAD_VER3_FILE = 'nakopad_detect_ver3.bin'; @@ -408,12 +408,11 @@ TfrmNakopad = class(TForm) timerShowWeb: TTimer; pnlAction: TPanel; Panel2: TPanel; - webAction: TUIWebBrowser; btnActionOpenBrowser: TButton; - btnWebBack: TButton; mnuNakoC3: TMenuItem; mnuShowNewsWakeup: TMenuItem; mnuFindTansakan: TMenuItem; + webAction: TMemo; procedure mnuCloseClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure mnuViewLeftPanelClick(Sender: TObject); @@ -638,7 +637,6 @@ TfrmNakopad = class(TForm) procedure popGUIPasteClick(Sender: TObject); procedure timerShowWebTimer(Sender: TObject); procedure btnActionOpenBrowserClick(Sender: TObject); - procedure btnWebBackClick(Sender: TObject); procedure webActionBeforeNavigate2(Sender: TObject; const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, Headers: OleVariant; var Cancel: WordBool); @@ -3220,8 +3218,6 @@ procedure TfrmNakopad.lstActionClick(Sender: TObject); cap, fname: string; function showDescript(path: string): Boolean; - var - tempPath: string; begin Result := False; fname := path + 'tools\action\' + fname; @@ -3234,15 +3230,11 @@ procedure TfrmNakopad.lstActionClick(Sender: TObject); if (Copy(s, 1, 4) = 'WEB=') then begin System.Delete(s, 1, 4); - webAction.Navigate(s); + webAction.Text := s + #13#10 + '---'#13#10'上記URLを開きます。ダブルクリックするか、↓の「ブラウザ」を開くをクリックしてください。'; Result := True; Exit; end; - s := JReplace(Trim(s), #13#10, '
', True); - tempPath := TempDir + 'tmp_nakopad_action.html'; - FileSaveAll('' + s + '', tempPath); - //edtAction.Lines.Text := Trim(s) + #13#10#13#10 + '→リストをダブルクリックすると実行できます。'; - webAction.Navigate('file://' + tempPath); + webAction.Text := s; Result := True; end; @@ -6251,7 +6243,7 @@ procedure TfrmNakopad.timerShowWebTimer(Sender: TObject); // if IsGlobalOffline then Exit; // timerShowWeb.Enabled := False; - webAction.Navigate(WEB_NEWS); + webAction.Text := (WEB_NEWS); end; @@ -6259,7 +6251,7 @@ procedure TfrmNakopad.btnActionOpenBrowserClick(Sender: TObject); var url: string; begin - url := webAction.LocationURL; + url := webAction.Text; if (Copy(url, 1, 4) = 'http') then begin OpenApp(url); @@ -6280,14 +6272,6 @@ procedure TfrmNakopad.clearNakoTypeInMenu; mnuNakoC3.Checked := False; end; -procedure TfrmNakopad.btnWebBackClick(Sender: TObject); -begin - try - webAction.GoBack; - except - end; -end; - procedure TfrmNakopad.webActionBeforeNavigate2(Sender: TObject; const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, Headers: OleVariant; var Cancel: WordBool); diff --git a/pro_unit/unit_pack_files_pro.dcu b/pro_unit/unit_pack_files_pro.dcu index b627cfd..a332bc6 100644 Binary files a/pro_unit/unit_pack_files_pro.dcu and b/pro_unit/unit_pack_files_pro.dcu differ