* Applied patch to create popup menu for TreeView (bug ID #31747)

git-svn-id: trunk@56867 -
This commit is contained in:
michael 2017-12-29 12:33:28 +00:00
parent 3374ff6e7d
commit 645d8d86a9
5 changed files with 84 additions and 32 deletions

View File

@ -4,7 +4,7 @@ object MainForm: TMainForm
Top = 125
Width = 695
Caption = 'JSON Viewer'
ClientHeight = 488
ClientHeight = 486
ClientWidth = 695
Icon.Data = {
7E04000000000100010010100000010020006804000016000000280000001000
@ -128,18 +128,20 @@ object MainForm: TMainForm
end
object TVJSON: TTreeView
Left = 0
Height = 483
Height = 460
Top = 26
Width = 695
Align = alClient
HideSelection = False
Images = ILJSON
PopupMenu = PMTreeView
RightClickSelect = True
TabOrder = 1
OnEdited = TVJSONEdited
OnEditing = TVJSONEditing
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoRightClickSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end
object ActionList1: TActionList
object ALJSON: TActionList
Images = ILJSON
left = 88
top = 128
@ -1007,4 +1009,39 @@ object MainForm: TMainForm
left = 376
top = 128
end
object PMTreeView: TPopupMenu
Images = ILJSON
left = 123
top = 215
object MenuItem4: TMenuItem
Action = ANewNullValue
end
object MenuItem5: TMenuItem
Action = ANewBooleanValue
end
object MenuItem6: TMenuItem
Action = ANewNumberValue
end
object MenuItem7: TMenuItem
Action = ANewStringValue
end
object MenuItem9: TMenuItem
Action = ANewArray
end
object MenuItem10: TMenuItem
Action = ANewObject
end
object MenuItem11: TMenuItem
Caption = '-'
end
object MenuItem12: TMenuItem
Action = ADeleteValue
end
object MenuItem13: TMenuItem
Caption = '-'
end
object MenuItem14: TMenuItem
Action = AExpandCurrentContainer
end
end
end

View File

@ -37,8 +37,8 @@
{"hash":246305444,"name":"tmainform.apasteasdocument.hint","sourcebytes":[80,97,115,116,101,32,74,83,79,78,32,100,97,116,97,32,105,110,32,99,108,105,112,98,111,97,114,100,32,97,115,32,110,101,119,32,100,111,99,117,109,101,110,116],"value":"Paste JSON data in clipboard as new document"},
{"hash":108454787,"name":"tmainform.aexpandall.caption","sourcebytes":[69,38,120,112,97,110,100,32,97,108,108,32,110,111,100,101,115],"value":"E&xpand all nodes"},
{"hash":25630004,"name":"tmainform.aexpandall.hint","sourcebytes":[69,120,112,97,110,100,32,97,108,108,32,110,111,100,101,115,32,105,110,32,116,104,101,32,100,111,99,117,109,101,110,116],"value":"Expand all nodes in the document"},
{"hash":115078537,"name":"tmainform.aexpandcurrentcontainer.caption","sourcebytes":[69,120,112,97,110,100,32,38,99,117,114,114,101,110,116,32,111,98,106,101,99,116,47,97,114,114,97,121],"value":"Expand &current object\/array"},
{"hash":179714329,"name":"tmainform.aexpandcurrentcontainer.hint","sourcebytes":[69,120,112,97,110,100,32,97,108,108,32,110,111,100,101,115,32,105,110,32,116,104,101,32,99,117,114,114,101,110,116,32,111,98,106,101,99,116,47,97,114,114,97,121],"value":"Expand all nodes in the current object\/array"},
{"hash":115078537,"name":"tmainform.aexpandcurrentcontainer.caption","sourcebytes":[69,120,112,97,110,100,32,38,99,117,114,114,101,110,116,32,111,98,106,101,99,116,47,97,114,114,97,121],"value":"Expand &current object/array"},
{"hash":179714329,"name":"tmainform.aexpandcurrentcontainer.hint","sourcebytes":[69,120,112,97,110,100,32,97,108,108,32,110,111,100,101,115,32,105,110,32,116,104,101,32,99,117,114,114,101,110,116,32,111,98,106,101,99,116,47,97,114,114,97,121],"value":"Expand all nodes in the current object/array"},
{"hash":2805828,"name":"tmainform.afind.caption","sourcebytes":[38,70,105,110,100],"value":"&Find"},
{"hash":127763701,"name":"tmainform.afindnext.caption","sourcebytes":[70,105,110,100,32,38,110,101,120,116,32,111,99,99,117,114,114,101,110,99,101],"value":"Find &next occurrence"},
{"hash":2805797,"name":"tmainform.mfile.caption","sourcebytes":[38,70,105,108,101],"value":"&File"},

View File

@ -54,12 +54,22 @@ type
ASave: TAction;
AOpen: TAction;
ANew: TAction;
ActionList1: TActionList;
ALJSON: TActionList;
FDJSON: TFindDialog;
ILJSON: TImageList;
MEDit: TMenuItem;
MenuItem10: TMenuItem;
MenuItem11: TMenuItem;
MenuItem12: TMenuItem;
MenuItem13: TMenuItem;
MenuItem14: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
MenuItem5: TMenuItem;
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
MenuItem9: TMenuItem;
MIQuoteStrings: TMenuItem;
MIAllowTrailingComma: TMenuItem;
MIAllowComments: TMenuItem;
@ -74,6 +84,7 @@ type
MISortMembers: TMenuItem;
MenuItem8: TMenuItem;
MIDelete: TMenuItem;
PMTreeView: TPopupMenu;
PSMain: TIniPropStorage;
MenuItem1: TMenuItem;
MINewNull: TMenuItem;
@ -750,6 +761,7 @@ begin
begin
P.ImageIndex:=ImageTypeMap[D.JSONType];
P.SelectedIndex:=ImageTypeMap[D.JSONType];
P.MakeVisible;
end;
ShowJSONData(P,D);
end;
@ -779,18 +791,21 @@ Var
F : TFileStream;
begin
F:=TFileStream.Create(AFileName,fmCreate);
try
If Assigned(FRoot) then
S:=FRoot.AsJSON;
If length(S)>0 then
F.WriteBuffer(S[1],Length(S));
FModified:=False;
finally
F.Free;
if (AFileName<>'') then
begin
F:=TFileStream.Create(AFileName,fmCreate);
try
If Assigned(FRoot) then
S:=FRoot.AsJSON;
If length(S)>0 then
F.WriteBuffer(S[1],Length(S));
FModified:=False;
finally
F.Free;
end;
FFileName:=AFileName;
SetCaption;
end;
FFileName:=AFileName;
SetCaption;
end;
Function TMainForm.GetSaveFileName(Force : Boolean) : String;

Binary file not shown.

View File

@ -117,7 +117,7 @@ msgstr "Den gewählten Wert löschen"
#: tmainform.aexpandall.caption
msgid "E&xpand all nodes"
msgstr ""
msgstr "Alle Knoten erweitern"
#: tmainform.aexpandall.hint
msgid "Expand all nodes in the document"
@ -133,7 +133,7 @@ msgstr ""
#: tmainform.afind.caption
msgid "&Find"
msgstr ""
msgstr "Suchen"
#: tmainform.afindnext.caption
msgid "Find &next occurrence"
@ -165,11 +165,11 @@ msgstr "Einen neuen booleschen Wert hinzufügen"
#: tmainform.anewnullvalue.caption
msgid "New N&ull value"
msgstr ""
msgstr "Neuer N&ull Wert"
#: tmainform.anewnullvalue.hint
msgid "Add a new null value"
msgstr ""
msgstr "Neuen Null Wert hinzufügen"
#: tmainform.anewnumbervalue.caption
msgid "&New numerical Value"
@ -189,7 +189,7 @@ msgstr "Ein neues JSON-Objekt hinzufügen"
#: tmainform.anewstringvalue.caption
msgid "New &string value"
msgstr ""
msgstr "Neuer &String Wert"
#: tmainform.anewstringvalue.hint
msgid "Add a new string value"
@ -197,7 +197,7 @@ msgstr ""
#: tmainform.aopen.caption
msgid "&Open"
msgstr ""
msgstr "Ö&ffnen"
#: tmainform.aopen.hint
msgid "Open JSON document from file"
@ -260,15 +260,15 @@ msgstr "Datei"
#: tmainform.miallowcomments.caption
msgctxt "tmainform.miallowcomments.caption"
msgid "Allow comments"
msgstr ""
msgstr "Kommentare erlauben"
#: tmainform.miallowtrailingcomma.caption
msgid "Allow trailing comma"
msgstr ""
msgstr "Abschließendes Komma erlauben"
#: tmainform.micompact.caption
msgid "Compact display"
msgstr ""
msgstr "Kompakte Darstellung"
#: tmainform.midocument.caption
msgid "&New document with object"
@ -280,15 +280,15 @@ msgstr "Werte"
#: tmainform.miquotestrings.caption
msgid "Quote string values"
msgstr ""
msgstr "Stringwerte in Anführungszeichen"
#: tmainform.misortmembers.caption
msgid "Sort object members"
msgstr ""
msgstr "Objektfelder sortieren "
#: tmainform.mistrict.caption
msgid "&Strict JSON"
msgstr ""
msgstr "&Striktes JSON"
#: tmainform.moptions.caption
msgid "&Options"
@ -296,11 +296,11 @@ msgstr "Einstellungen"
#: tmainform.odjson.title
msgid "Select a JSON file"
msgstr ""
msgstr "Wählen Sie eine JSON Datei"
#: tmainform.sdjson.title
msgid "Save JSON document to file"
msgstr ""
msgstr "JSON Dokument in Datei speichern"
#: tmainform.tbjson.caption
msgid "TBJSON"