From fe3dc8373055499d526be8c39c3656af615e4af9 Mon Sep 17 00:00:00 2001 From: yamat0jp Date: Wed, 22 Sep 2021 22:07:16 +0900 Subject: [PATCH] =?utf8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?utf8?q?=E6=83=85=E5=A0=B1=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Unit1.dfm | 62 ++++++++++++++++++++++++++++++++++++++++++++++-------- Unit1.pas | 20 +++++++++++++++++- json_checker.dproj | 2 +- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/Unit1.dfm b/Unit1.dfm index aa748e7..f27f368 100644 --- a/Unit1.dfm +++ b/Unit1.dfm @@ -12,16 +12,18 @@ object Form1: TForm1 Font.Style = [] Menu = MainMenu1 OldCreateOrder = False + OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 28 object Memo1: TMemo Left = 0 Top = 25 Width = 625 - Height = 335 + Height = 287 Align = alClient PopupMenu = PopupMenu1 TabOrder = 0 + ExplicitHeight = 335 end object ToolBar1: TToolBar Left = 0 @@ -75,11 +77,12 @@ object Form1: TForm1 Left = 625 Top = 25 Width = 275 - Height = 335 + Height = 287 Align = alRight Indent = 19 ReadOnly = True TabOrder = 2 + ExplicitHeight = 335 end object StatusBar1: TStatusBar Left = 0 @@ -90,19 +93,60 @@ object Form1: TForm1 item Width = 50 end> + ExplicitLeft = 8 end - object Memo2: TMemo + object TabControl1: TTabControl Left = 0 - Top = 360 + Top = 312 Width = 900 - Height = 103 + Height = 151 Align = alBottom - Lines.Strings = ( - 'json'#25991#23383#21015#12434#20837#21147#12375#12390#12367#12384#12373#12356#12290 - #35299#26512#32080#26524#12364#21491#12395#12290#12463#12522#12483#12503#12508#12540#12489#12395#32232#38598#20013#12398#20869#23481#12364#12467#12500#12540#12373#12428#12414#12377#12290) - ReadOnly = True TabOrder = 4 + Tabs.Strings = ( + #12504#12523#12503 + #12496#12540#12472#12519#12531#24773#22577) + TabIndex = 0 Visible = False + OnChange = TabControl1Change + object Memo2: TMemo + Left = 4 + Top = 39 + Width = 892 + Height = 108 + Align = alClient + Lines.Strings = ( + '') + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + ExplicitLeft = 5 + ExplicitTop = 40 + end + object Memo3: TMemo + Left = 360 + Top = 32 + Width = 185 + Height = 89 + Lines.Strings = ( + 'json'#25991#23383#21015#12434#20837#21147#12375#12390#12367#12384#12373#12356#12290 + #35299#26512#32080#26524#12364#21491#12395#12290#12463#12522#12483#12503#12508#12540#12489#12395#32232#38598#20013#12398#20869#23481#12364#12467#12500#12540#12373#12428#12414#12377#12290) + TabOrder = 1 + Visible = False + WordWrap = False + end + object Memo4: TMemo + Left = 448 + Top = 56 + Width = 185 + Height = 89 + Lines.Strings = ( + 'TJSONArray '#12395#23550#24540#12375#12414#12375#12383' ' + ' --------------------' + #21021#20844#38283) + TabOrder = 2 + Visible = False + WordWrap = False + end end object ImageList1: TImageList Left = 200 diff --git a/Unit1.pas b/Unit1.pas index 9462bb3..6743a89 100644 --- a/Unit1.pas +++ b/Unit1.pas @@ -38,8 +38,13 @@ type Action2: TAction; Action11: TMenuItem; H1: TMenuItem; + TabControl1: TTabControl; + Memo3: TMemo; + Memo4: TMemo; procedure ToolButton2Click(Sender: TObject); procedure ToolButton5Click(Sender: TObject); + procedure TabControl1Change(Sender: TObject); + procedure FormCreate(Sender: TObject); private { Private éŒ¾ } procedure loop(item: TTreeNode; JSON: TJSONObject); @@ -77,6 +82,11 @@ begin end; end; +procedure TForm1.FormCreate(Sender: TObject); +begin + TabControl1Change(nil); +end; + procedure TForm1.loop(item: TTreeNode; JSON: TJSONObject); var i, j: integer; @@ -107,6 +117,14 @@ begin end; end; +procedure TForm1.TabControl1Change(Sender: TObject); +begin + if TabControl1.TabIndex = 0 then + Memo2.Text:=Memo3.Text + else + Memo2.Text:=Memo4.Text; +end; + procedure TForm1.ToolButton2Click(Sender: TObject); var i: integer; @@ -129,7 +147,7 @@ end; procedure TForm1.ToolButton5Click(Sender: TObject); begin - Memo2.Visible := not Memo2.Visible; + TabControl1.Visible:=not TabControl1.Visible; end; end. diff --git a/json_checker.dproj b/json_checker.dproj index 0cbb561..5b02ad6 100644 --- a/json_checker.dproj +++ b/json_checker.dproj @@ -5,7 +5,7 @@ VCL json_checker.dpr True - Release + Debug Win64 3 Application -- 2.11.0