Simon Grossenbacher 9 年之前
父节点
当前提交
c20a68a42a
共有 6 个文件被更改,包括 792 次插入41 次删除
  1. 7 4
      AppConfig.json
  2. 310 0
      Highlighters/JSON.json
  3. 二进制
      RESTDebugger.exe
  4. 6 6
      prj/RESTDebugger.stat
  5. 345 22
      src/_frmMain.dfm
  6. 124 9
      src/_frmMain.pas

+ 7 - 4
AppConfig.json

@@ -1,10 +1,13 @@
 {
 	"MainWindowPos": {
-		"Left": 711,
-		"Top": 375,
-		"StayOnTop": false
+		"Left": 843,
+		"Top": 270,
+		"StayOnTop": false,
+		"Width": 934,
+		"Height": 797
 	},
 	"Dialogs": {
-		"LastOpenDir": "C:\\dev\\RESTDebugger\\src\\"
+		"LastOpenDir": "C:\\dev\\RESTDebugger\\src\\",
+		"LastSaveDir": "C:\\dev\\RESTDebugger\\"
 	}
 }

+ 310 - 0
Highlighters/JSON.json

@@ -0,0 +1,310 @@
+{
+   "Highlighter": {
+      "Info": {
+         "General": {
+            "Version": "1.7.0",
+            "Date": "20.09.2016",
+            "Sample": [
+               "{\r\n",
+               "  \"firstName\": \"John\",\r\n",
+               "  \"lastName\": \"Smith\",\r\n",
+               "  \"age\": 25,\r\n",
+               "  \"address\":\r\n",
+               "  {\r\n",
+               "    \"streetAddress\": \"21 2nd Street\",\r\n",
+               "    \"city\": \"New York\",\r\n",
+               "    \"state\": \"NY\",\r\n",
+               "    \"postalCode\": \"10021\"\r\n",
+               "  },\r\n",
+               "  \"phoneNumber\":\r\n",
+               "  [\r\n",
+               "    {\r\n",
+               "      \"type\": \"home\",\r\n",
+               "      \"number\": \"212 555-1234\"\r\n",
+               "    },\r\n",
+               "    {\r\n",
+               "      \"type\": \"fax\",\r\n",
+               "      \"number\": \"646 555-4567\"\r\n",
+               "    }\r\n",
+               "  ]\r\n",
+               "}"
+            ]
+         },
+         "Author": {
+            "Name": "Lasse Rautiainen",
+            "Mail": "lasse@bonecode.com"
+         }
+      },
+      "MainRules": {
+         "Attributes": {
+            "Element": "Editor"
+         },
+         "Delimiters": "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~",
+         "SubRules": {
+            "Range": [
+               {
+                  "Type": "String",
+                  "Attributes": {
+                     "Element": "Attribute"
+                  },
+                  "Properties": {
+                     "CloseOnEndOfLine": true
+                  },
+                  "TokenRange": {
+                     "Open": "\"",
+                     "Close": "\""
+                  },
+                  "SubRules": {
+                     "Range": [
+                        {
+                           "Type": "String",
+                           "Attributes": {
+                              "Element": "Attribute"
+                           },
+                           "Properties": {
+                              "CloseOnEndOfLine": true,
+                              "CloseOnTerm": true
+                           },
+                           "TokenRange": {
+                              "Open": "\\\"",
+                              "Close": "\""
+                           }
+                        },
+                        {
+                           "Type": "String",
+                           "Attributes": {
+                              "Element": "Attribute"
+                           },
+                           "Properties": {
+                              "CloseOnEndOfLine": true,
+                              "CloseOnTerm": true
+                           },
+                           "TokenRange": {
+                              "Open": "\\\\",
+                              "Close": ""
+                           }
+                        }
+                     ]
+                  }
+               },
+               {
+                  "Type": "String",
+                  "Attributes": {
+                     "Element": "Symbol"
+                  },
+                  "Properties": {
+                     "CloseOnEndOfLine": true
+                  },
+                  "TokenRange": {
+                     "Open": ":"
+                  },
+                  "SubRules": {
+                     "Range": [
+                        {
+                           "Type": "String",
+                           "Attributes": {
+                              "Element": "Symbol"
+                           },
+                           "Properties": {
+                              "AlternativeClose": [
+                                 "{"
+                              ]
+                           },
+                           "TokenRange": {
+                              "Open": "[",
+                              "Close": "]"
+                           },
+                           "SubRules": {
+                              "Range": [
+                                 {
+                                    "Type": "String",
+                                    "Attributes": {
+                                       "Element": "String"
+                                    },
+                                    "Properties": {
+                                       "CloseOnEndOfLine": true
+                                    },
+                                    "TokenRange": {
+                                       "Open": "\"",
+                                       "Close": "\""
+                                    },
+                                    "SubRules": {
+                                       "Range": [
+                                          {
+                                             "Type": "String",
+                                             "Attributes": {
+                                                "Element": "String"
+                                             },
+                                             "Properties": {
+                                                "CloseOnEndOfLine": true,
+                                                "CloseOnTerm": true
+                                             },
+                                             "TokenRange": {
+                                                "Open": "\\\"",
+                                                "Close": "\""
+                                             }
+                                          },
+                                          {
+                                             "Type": "String",
+                                             "Attributes": {
+                                                "Element": "String"
+                                             },
+                                             "Properties": {
+                                                "CloseOnEndOfLine": true,
+                                                "CloseOnTerm": true
+                                             },
+                                             "TokenRange": {
+                                                "Open": "\\\\",
+                                                "Close": ""
+                                             }
+                                          }
+                                       ]
+                                    }
+                                 }
+                              ]
+                           }
+                        },
+                        {
+                           "Type": "String",
+                           "Attributes": {
+                              "Element": "String"
+                           },
+                           "TokenRange": {
+                              "Open": "\"",
+                              "Close": "\""
+                           },
+                           "SubRules": {
+                              "Range": [
+                                 {
+                                    "Type": "String",
+                                    "Attributes": {
+                                       "Element": "String"
+                                    },
+                                    "Properties": {
+                                       "CloseOnEndOfLine": true,
+                                       "CloseOnTerm": true
+                                    },
+                                    "TokenRange": {
+                                       "Open": "\\\"",
+                                       "Close": "\""
+                                    }
+                                 },
+                                 {
+                                    "Type": "String",
+                                    "Attributes": {
+                                       "Element": "String"
+                                    },
+                                    "Properties": {
+                                       "CloseOnEndOfLine": true,
+                                       "CloseOnTerm": true
+                                    },
+                                    "TokenRange": {
+                                       "Open": "\\\\",
+                                       "Close": ""
+                                    }
+                                 }
+                              ]
+                           }
+                        }
+                     ]
+                  }
+               }
+            ],
+            "KeyList": [
+               {
+                  "Type": "Symbol",
+                  "Words": [
+                     ":",
+                     ";",
+                     "<",
+                     ">",
+                     "=",
+                     "/",
+                     "*",
+                     ".",
+                     ",",
+                     "-",
+                     "+",
+                     "(",
+                     ")",
+                     "[",
+                     "]",
+                     "{",
+                     "}"
+                  ],
+                  "Attributes": {
+                     "Element": "Symbol"
+                  }
+               }
+            ],
+            "Set": [
+               {
+                  "Type": "Numbers",
+                  "Symbols": "0123456789",
+                  "Attributes": {
+                     "Element": "Number"
+                  }
+               },
+               {
+                  "Type": "Float",
+                  "Symbols": ".0123456789",
+                  "Attributes": {
+                     "Element": "Number"
+                  }
+               }
+            ]
+         }
+      }
+   },
+   "CodeFolding": {
+      "Ranges": [
+         {
+            "Options": {
+               "StringEscapeChar": "\\"
+            },
+            "SkipRegion": [
+               {
+                  "OpenToken": "\"",
+                  "CloseToken": "\"",
+                  "RegionType": "SingleLineString"
+               }
+            ],
+            "FoldRegion": [
+               {
+                  "OpenToken": "{",
+                  "CloseToken": "}"
+               },
+               {
+                  "OpenToken": "[",
+                  "CloseToken": "]"
+               }
+            ]
+         }
+      ]
+   },
+   "MatchingPair": {
+      "Pairs": [
+         {
+            "OpenToken": "(",
+            "CloseToken": ")"
+         },
+         {
+            "OpenToken": "[",
+            "CloseToken": "]"
+         },
+         {
+            "OpenToken": "{",
+            "CloseToken": "}"
+         }
+      ]
+   },
+   "CompletionProposal": {
+      "SkipRegion": [
+         {
+            "OpenToken": "\"",
+            "CloseToken": "\"",
+            "RegionType": "SingleLineString"
+         }
+      ]
+   }
+}

二进制
RESTDebugger.exe


+ 6 - 6
prj/RESTDebugger.stat

@@ -1,10 +1,10 @@
 [Stats]
-EditorSecs=1174
-DesignerSecs=735
-InspectorSecs=354
-CompileSecs=20125
-OtherSecs=277
+EditorSecs=2254
+DesignerSecs=1542
+InspectorSecs=822
+CompileSecs=63183
+OtherSecs=973
 StartTime=27.10.2016 18:27:37
 RealKeys=0
 EffectiveKeys=0
-DebugSecs=189
+DebugSecs=1315

+ 345 - 22
src/_frmMain.dfm

@@ -2,10 +2,9 @@ object frmMain: TfrmMain
   Left = 0
   Top = 0
   BorderIcons = [biSystemMenu, biMinimize]
-  BorderStyle = bsSingle
   Caption = 'REST Debugger'
-  ClientHeight = 737
-  ClientWidth = 1014
+  ClientHeight = 820
+  ClientWidth = 1004
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -17,24 +16,21 @@ object frmMain: TfrmMain
   OnClose = FormClose
   OnCreate = FormCreate
   OnDestroy = FormDestroy
+  OnResize = FormResize
   OnShow = FormShow
   PixelsPerInch = 96
   TextHeight = 13
   object Panel1: TPanel
     Left = 0
     Top = 23
-    Width = 1014
+    Width = 1004
     Height = 76
     Align = alTop
     BevelOuter = bvNone
     Color = clWhite
     ParentBackground = False
     TabOrder = 0
-    ExplicitLeft = -2
-    ExplicitTop = 120
-    DesignSize = (
-      1014
-      76)
+    ExplicitWidth = 1014
     object Label1: TLabel
       Left = 25
       Top = 31
@@ -49,11 +45,10 @@ object frmMain: TfrmMain
       ParentFont = False
     end
     object Image: TImage
-      Left = 965
-      Top = 25
+      Left = 955
+      Top = 24
       Width = 32
       Height = 32
-      Anchors = [akTop, akRight]
       AutoSize = True
       Picture.Data = {
         0B546478504E47496D61676589504E470D0A1A0A0000000D4948445200000020
@@ -80,13 +75,12 @@ object frmMain: TfrmMain
         CC4EC2F8C15C57F16137A2C2FE0586D98AA953E80F4996C3A870E7598EE3BFFA
         0FE8D6C03FF5FC02C53E1BF02DDC32610000000049454E44AE426082}
       Transparent = True
-      ExplicitLeft = 955
     end
   end
   object dxStatusBar: TdxStatusBar
     Left = 0
-    Top = 717
-    Width = 1014
+    Top = 800
+    Width = 1004
     Height = 20
     Panels = <
       item
@@ -103,9 +97,289 @@ object frmMain: TfrmMain
     Font.Height = -11
     Font.Name = 'Tahoma'
     Font.Style = []
-    ExplicitLeft = 510
-    ExplicitTop = 375
-    ExplicitWidth = 0
+    ExplicitTop = 717
+    ExplicitWidth = 1014
+  end
+  object cxPageControl1: TcxPageControl
+    Left = 0
+    Top = 353
+    Width = 1004
+    Height = 447
+    Align = alClient
+    TabOrder = 6
+    Properties.ActivePage = tabContent
+    Properties.CustomButtons.Buttons = <>
+    ExplicitTop = 296
+    ExplicitWidth = 1014
+    ExplicitHeight = 514
+    ClientRectBottom = 443
+    ClientRectLeft = 4
+    ClientRectRight = 1000
+    ClientRectTop = 24
+    object tabContent: TcxTabSheet
+      Caption = 'Content'
+      ImageIndex = 0
+      ExplicitWidth = 1006
+      ExplicitHeight = 486
+      object EditorContent: TBCEditor
+        Left = 0
+        Top = 0
+        Width = 996
+        Height = 419
+        Cursor = crIBeam
+        ActiveLine.Indicator.Visible = False
+        Align = alClient
+        Caret.MultiEdit.Enabled = True
+        Caret.NonBlinking.Enabled = False
+        Caret.Options = []
+        CodeFolding.Colors.Indent = clBlack
+        CodeFolding.Hint.Font.Charset = DEFAULT_CHARSET
+        CodeFolding.Hint.Font.Color = clWindowText
+        CodeFolding.Hint.Font.Height = -11
+        CodeFolding.Hint.Font.Name = 'Courier New'
+        CodeFolding.Hint.Font.Style = []
+        CodeFolding.Hint.Indicator.Glyph.Visible = False
+        CodeFolding.Visible = True
+        CompletionProposal.CloseChars = '()[]. '
+        CompletionProposal.Columns = <
+          item
+          end>
+        CompletionProposal.Font.Charset = DEFAULT_CHARSET
+        CompletionProposal.Font.Color = clWindowText
+        CompletionProposal.Font.Height = -11
+        CompletionProposal.Font.Name = 'Courier New'
+        CompletionProposal.Font.Style = []
+        CompletionProposal.ShortCut = 16416
+        CompletionProposal.Trigger.Chars = '.'
+        CompletionProposal.Trigger.Enabled = False
+        Directories.Colors = 'Colors'
+        Directories.Highlighters = 'Highlighters'
+        Font.Charset = DEFAULT_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -13
+        Font.Name = 'Courier New'
+        Font.Style = []
+        LeftMargin.Bookmarks.Visible = False
+        LeftMargin.Font.Charset = DEFAULT_CHARSET
+        LeftMargin.Font.Color = 13408665
+        LeftMargin.Font.Height = -11
+        LeftMargin.Font.Name = 'Courier New'
+        LeftMargin.Font.Style = []
+        LeftMargin.Marks.Visible = False
+        LeftMargin.MarksPanel.Visible = False
+        LeftMargin.Width = 35
+        Lines.Strings = (
+          'EditorContent')
+        LineSpacing = 0
+        MatchingPair.Enabled = True
+        Minimap.Font.Charset = DEFAULT_CHARSET
+        Minimap.Font.Color = clWindowText
+        Minimap.Font.Height = -1
+        Minimap.Font.Name = 'Courier New'
+        Minimap.Font.Style = []
+        Minimap.Width = 140
+        PopupMenu = PopupMenuEditorContent
+        RightMargin.Position = 80
+        RightMargin.Visible = True
+        SpecialChars.Style = scsDot
+        SyncEdit.ShortCut = 24650
+        TabOrder = 0
+        WordWrap.Enabled = False
+        WordWrap.Indicator.Glyph.Data = {
+          7E030000424D7E0300000000000036000000280000000F0000000E0000000100
+          2000000000004803000000000000000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
+          000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000000000000000
+          0000FF00FF00FF00FF00FF00FF00FF00FF008000000080000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF008000000080000000800000008000000080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF008000000080000000FF00FF00FF00FF0080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF0080000000FF00FF00FF00FF0080000000FF00FF00FF00
+          FF00FF00FF000000000000000000000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF0080000000FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF0080000000FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00800000008000000080000000800000008000
+          00008000000080000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00}
+        WordWrap.Indicator.MaskColor = clFuchsia
+        WordWrap.Width = wwwPage
+        ExplicitTop = -2
+      end
+    end
+    object tabHeaders: TcxTabSheet
+      Caption = 'Headers'
+      ImageIndex = 1
+      ExplicitWidth = 1006
+      ExplicitHeight = 486
+      object EditorHeaders: TBCEditor
+        Left = 0
+        Top = 0
+        Width = 996
+        Height = 419
+        Cursor = crIBeam
+        ActiveLine.Indicator.Visible = False
+        Align = alClient
+        Caret.MultiEdit.Enabled = True
+        Caret.NonBlinking.Enabled = False
+        Caret.Options = []
+        CodeFolding.Colors.Indent = clBlack
+        CodeFolding.Hint.Font.Charset = DEFAULT_CHARSET
+        CodeFolding.Hint.Font.Color = clWindowText
+        CodeFolding.Hint.Font.Height = -11
+        CodeFolding.Hint.Font.Name = 'Courier New'
+        CodeFolding.Hint.Font.Style = []
+        CodeFolding.Hint.Indicator.Glyph.Visible = False
+        CompletionProposal.CloseChars = '()[]. '
+        CompletionProposal.Columns = <
+          item
+          end>
+        CompletionProposal.Enabled = False
+        CompletionProposal.Font.Charset = DEFAULT_CHARSET
+        CompletionProposal.Font.Color = clWindowText
+        CompletionProposal.Font.Height = -11
+        CompletionProposal.Font.Name = 'Courier New'
+        CompletionProposal.Font.Style = []
+        CompletionProposal.ShortCut = 16416
+        CompletionProposal.Trigger.Chars = '.'
+        CompletionProposal.Trigger.Enabled = False
+        Directories.Colors = 'Colors'
+        Directories.Highlighters = 'Highlighters'
+        Font.Charset = DEFAULT_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -13
+        Font.Name = 'Courier New'
+        Font.Style = []
+        LeftMargin.Bookmarks.Visible = False
+        LeftMargin.Font.Charset = DEFAULT_CHARSET
+        LeftMargin.Font.Color = 13408665
+        LeftMargin.Font.Height = -11
+        LeftMargin.Font.Name = 'Courier New'
+        LeftMargin.Font.Style = []
+        LeftMargin.Marks.Visible = False
+        LeftMargin.MarksPanel.Visible = False
+        LeftMargin.Width = 35
+        Lines.Strings = (
+          'EditorHeaders')
+        LineSpacing = 0
+        MatchingPair.Enabled = True
+        Minimap.Font.Charset = DEFAULT_CHARSET
+        Minimap.Font.Color = clWindowText
+        Minimap.Font.Height = -1
+        Minimap.Font.Name = 'Courier New'
+        Minimap.Font.Style = []
+        Minimap.Width = 140
+        RightMargin.Position = 80
+        RightMargin.Visible = True
+        SpecialChars.Style = scsDot
+        SyncEdit.ShortCut = 24650
+        TabOrder = 0
+        WordWrap.Enabled = False
+        WordWrap.Indicator.Glyph.Data = {
+          7E030000424D7E0300000000000036000000280000000F0000000E0000000100
+          2000000000004803000000000000000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
+          000000000000000000000000000000000000FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000000000000000
+          0000FF00FF00FF00FF00FF00FF00FF00FF008000000080000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF008000000080000000800000008000000080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF008000000080000000FF00FF00FF00FF0080000000FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF0080000000FF00FF00FF00FF0080000000FF00FF00FF00
+          FF00FF00FF000000000000000000000000000000000000000000FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF0080000000FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF0080000000FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00800000008000000080000000800000008000
+          00008000000080000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
+          FF00}
+        WordWrap.Indicator.MaskColor = clFuchsia
+        WordWrap.Width = wwwPage
+        ExplicitLeft = 379
+        ExplicitTop = 336
+        ExplicitWidth = 200
+        ExplicitHeight = 150
+      end
+    end
+  end
+  object Panel2: TPanel
+    Left = 0
+    Top = 99
+    Width = 1004
+    Height = 254
+    Align = alTop
+    BevelOuter = bvNone
+    TabOrder = 7
+    object Label2: TLabel
+      Left = 8
+      Top = 16
+      Width = 40
+      Height = 13
+      Caption = 'Presets:'
+    end
+    object Label3: TLabel
+      Left = 8
+      Top = 72
+      Width = 49
+      Height = 13
+      Caption = 'Base URL:'
+    end
+    object edtURL: TcxTextEdit
+      Left = 8
+      Top = 136
+      TabOrder = 0
+      Text = 
+        'https://merp.iblnet.ch/MobileERPService/?action=GetPresentoDayVi' +
+        'ew&token=70f12f9439554198b2e6965b2b14b9e6&day=30.08.2016'
+      Width = 577
+    end
+    object btnRun: TcxButton
+      Left = 664
+      Top = 76
+      Width = 75
+      Height = 25
+      Caption = 'Run'
+      TabOrder = 1
+      OnClick = btnRunClick
+    end
+    object cxPopupEdit1: TcxPopupEdit
+      Left = 8
+      Top = 32
+      TabOrder = 2
+      Text = 'cxPopupEdit1'
+      Width = 464
+    end
+    object edtBaseURL: TcxTextEdit
+      Left = 8
+      Top = 88
+      TabOrder = 3
+      Width = 577
+    end
   end
   object OpenDialog: TOpenDialog
     Filter = 'REST Debugger Project (*.rdproj)|*.rdproj'
@@ -204,6 +478,10 @@ object frmMain: TfrmMain
           Visible = True
           ItemName = 'dxBarSubItem2'
         end
+        item
+          Visible = True
+          ItemName = 'dxBarSubItem4'
+        end
         item
           Visible = True
           ItemName = 'dxBarSubItem1'
@@ -259,6 +537,7 @@ object frmMain: TfrmMain
       Category = 0
       Hint = 'Save'
       Visible = ivAlways
+      ShortCut = 16467
     end
     object btnSaveAs: TdxBarButton
       Caption = 'Save As...'
@@ -272,10 +551,11 @@ object frmMain: TfrmMain
       Category = 0
       Hint = 'Close'
       Visible = ivAlways
+      ShortCut = 32883
       OnClick = dxBarButton6Click
     end
     object dxBarSubItem1: TdxBarSubItem
-      Caption = 'Info'
+      Caption = 'Help'
       Category = 0
       Visible = ivAlways
       ItemLinks = <
@@ -298,16 +578,59 @@ object frmMain: TfrmMain
       ItemLinks = <
         item
           Visible = True
-          ItemName = 'btnRun'
+          ItemName = 'tbbtnRun'
         end>
     end
-    object btnRun: TdxBarButton
+    object tbbtnRun: TdxBarButton
       Caption = 'Run'
       Category = 0
       Hint = 'Run'
       Visible = ivAlways
       ShortCut = 116
-      OnClick = btnRunClick
+      OnClick = tbbtnRunClick
+    end
+    object dxBarSubItem4: TdxBarSubItem
+      Caption = 'View'
+      Category = 0
+      Visible = ivAlways
+      ItemLinks = <
+        item
+          Visible = True
+          ItemName = 'tbbtnStayOnTop'
+        end>
+    end
+    object tbbtnStayOnTop: TdxBarButton
+      Caption = 'Stay on Top'
+      Category = 0
+      Hint = 'Stay on Top'
+      Visible = ivAlways
+      ButtonStyle = bsChecked
+      OnClick = tbbtnStayOnTopClick
+    end
+  end
+  object PopupMenuEditorContent: TPopupMenu
+    Left = 768
+    Top = 424
+    object Cut1: TMenuItem
+      Caption = 'Cut'
+      ShortCut = 16472
+      OnClick = Cut1Click
+    end
+    object Paste1: TMenuItem
+      Caption = 'Paste'
+      ShortCut = 16470
+      OnClick = Paste1Click
+    end
+    object Copy1: TMenuItem
+      Caption = 'Copy'
+      ShortCut = 16451
+      OnClick = Copy1Click
+    end
+    object N1: TMenuItem
+      Caption = '-'
+    end
+    object pbtnFormatCode: TMenuItem
+      Caption = 'Format Code'
     end
   end
 end

+ 124 - 9
src/_frmMain.pas

@@ -9,7 +9,10 @@ uses
   dxGDIPlusClasses, cxGraphics, cxControls, cxLookAndFeelPainters,
   dxSkinsdxStatusBarPainter, dxStatusBar, IdIOHandler, IdIOHandlerSocket,
   IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdBaseComponent, IdComponent,
-  IdTCPConnection, IdTCPClient, IdHTTP, _JSONConfig, dxSkinsdxBarPainter, dxBar;
+  IdTCPConnection, IdTCPClient, IdHTTP, _JSONConfig, dxSkinsdxBarPainter, dxBar,
+  cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxDropDownEdit, Vcl.Menus,
+  cxButtons, BCEditor.Editor.Base, BCEditor.Editor, dxSkinscxPCPainter,
+  dxBarBuiltInMenu, cxPC;
 
 type
   TfrmMain = class(TForm)
@@ -33,7 +36,27 @@ type
     dxBarSubItem1: TdxBarSubItem;
     dxBarButton7: TdxBarButton;
     dxBarSubItem2: TdxBarSubItem;
-    btnRun: TdxBarButton;
+    tbbtnRun: TdxBarButton;
+    Label2: TLabel;
+    cxPopupEdit1: TcxPopupEdit;
+    edtURL: TcxTextEdit;
+    btnRun: TcxButton;
+    EditorContent: TBCEditor;
+    cxPageControl1: TcxPageControl;
+    tabContent: TcxTabSheet;
+    tabHeaders: TcxTabSheet;
+    EditorHeaders: TBCEditor;
+    Panel2: TPanel;
+    dxBarSubItem4: TdxBarSubItem;
+    tbbtnStayOnTop: TdxBarButton;
+    PopupMenuEditorContent: TPopupMenu;
+    pbtnFormatCode: TMenuItem;
+    Copy1: TMenuItem;
+    Cut1: TMenuItem;
+    Paste1: TMenuItem;
+    N1: TMenuItem;
+    edtBaseURL: TcxTextEdit;
+    Label3: TLabel;
     procedure FormShow(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
@@ -42,14 +65,20 @@ type
     procedure dxBarButton3Click(Sender: TObject);
     procedure btnSaveAsClick(Sender: TObject);
     procedure dxBarButton7Click(Sender: TObject);
-    procedure btnRunClick(Sender: TObject);
+    procedure tbbtnRunClick(Sender: TObject);
     procedure dxBarSubItem3Popup(Sender: TObject);
+    procedure btnRunClick(Sender: TObject);
+    procedure FormResize(Sender: TObject);
+    procedure tbbtnStayOnTopClick(Sender: TObject);
+    procedure Cut1Click(Sender: TObject);
+    procedure Paste1Click(Sender: TObject);
+    procedure Copy1Click(Sender: TObject);
   private
     FMainConfig: TJSONConfig;
-    FProjectConfig: TJSONConfig;
     FActiveProject: string;
     procedure LoadProject;
     procedure SaveProject;
+    procedure Run;
   public
     { Public-Deklarationen }
   end;
@@ -61,9 +90,21 @@ implementation
 
 {$R *.dfm}
 
-procedure TfrmMain.btnRunClick(Sender: TObject);
+procedure TfrmMain.tbbtnRunClick(Sender: TObject);
+begin
+  Run;
+end;
+
+procedure TfrmMain.tbbtnStayOnTopClick(Sender: TObject);
 begin
-  ShowMessage('run');
+  if tbbtnStayOnTop.Down then
+  begin
+    FormStyle := fsStayOnTop;
+  end
+  else
+  begin
+    FormStyle := fsNormal;
+  end;
 end;
 
 procedure TfrmMain.dxBarButton3Click(Sender: TObject);
@@ -77,17 +118,39 @@ begin
   end;
 end;
 
+procedure TfrmMain.btnRunClick(Sender: TObject);
+begin
+  Run;
+end;
+
 procedure TfrmMain.btnSaveAsClick(Sender: TObject);
+var
+  fname: string;
 begin
   SaveDialog.InitialDir := FMainConfig.ReadString('Dialogs', 'LastSaveDir', ExtractFilePath(ParamStr(0)));
   if SaveDialog.Execute then
   begin
-    FMainConfig.WriteString('Dialogs', 'LastSaveDir', ExtractFilePath(SaveDialog.FileName));
+    fname := SaveDialog.FileName;
+    FMainConfig.WriteString('Dialogs', 'LastSaveDir', ExtractFilePath(fname));
 
+    fname := ChangeFileExt(fname, '');
+    fname := fname + '.rdproj';
 
+    FActiveProject := fname;
+    SaveProject;
   end;
 end;
 
+procedure TfrmMain.Copy1Click(Sender: TObject);
+begin
+  EditorContent.CopyToClipboard;
+end;
+
+procedure TfrmMain.Cut1Click(Sender: TObject);
+begin
+  EditorContent.CutToClipboard;
+end;
+
 procedure TfrmMain.dxBarButton6Click(Sender: TObject);
 begin
   Close;
@@ -107,6 +170,8 @@ procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
 begin
   FMainConfig.WriteInteger('MainWindowPos', 'Left', Left);
   FMainConfig.WriteInteger('MainWindowPos', 'Top', Top);
+  FMainConfig.WriteInteger('MainWindowPos', 'Width', Width);
+  FMainConfig.WriteInteger('MainWindowPos', 'Height', Height);
   FMainConfig.WriteBool('MainWindowPos', 'StayOnTop', FormStyle = fsStayOnTop);
 end;
 
@@ -115,6 +180,9 @@ begin
   FMainConfig := TJSONConfig.Create(ExtractFilePath(ParamStr(0)) + 'AppConfig.json');
   FActiveProject := '';
 
+  EditorContent.Highlighter.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'Highlighters\JSON.json');
+
+
   if ParamStr(1) <> '' then
   begin
     FActiveProject := ParamStr(1);
@@ -127,6 +195,11 @@ begin
   FMainConfig.Free;
 end;
 
+procedure TfrmMain.FormResize(Sender: TObject);
+begin
+  Image.Left := Width - 70;
+end;
+
 procedure TfrmMain.FormShow(Sender: TObject);
 begin
   dxStatusBar.Panels[0].Text := 'Copyright © by Simnet ' + FormatDateTime('yyyy', now);
@@ -144,24 +217,66 @@ begin
 
   Left := FMainConfig.ReadInteger('MainWindowPos', 'Left', Round((Screen.Width - Width) div 2));
   Top := FMainConfig.ReadInteger('MainWindowPos', 'Top', Round((Screen.Height - Height) div 2));
+  Width := FMainConfig.ReadInteger('MainWindowPos', 'Width', 1000);
+  Height := FMainConfig.ReadInteger('MainWindowPos', 'Height', 800);
   if FMainConfig.ReadBool('MainWindowPos', 'StayOnTop') then
   begin
     FormStyle := fsStayOnTop;
+    tbbtnStayOnTop.Down := True;
   end
   else
   begin
     FormStyle := fsNormal;
+    tbbtnStayOnTop.Down := False;
   end;
+
+  EditorContent.Lines.Clear;
+  EditorHeaders.Lines.Clear;
 end;
 
 procedure TfrmMain.LoadProject;
+var
+  conf: TJSONConfig;
+begin
+  conf := TJSONConfig.Create(FActiveProject);
+  try
+
+  finally
+    conf.Free;
+  end;
+end;
+
+procedure TfrmMain.Paste1Click(Sender: TObject);
 begin
-  FProjectConfig := TJSONConfig.Create(FActiveProject);
+  EditorContent.PasteFromClipboard;
+end;
+
+procedure TfrmMain.Run;
+var
+  dmy: string;
+begin
+  dmy := HTTP.Get(edtURL.Text);
+  EditorContent.Lines.Text := dmy;
+
+
+  EditorHeaders.Lines.Text := HTTP.Response.RawHeaders.Text;
 end;
 
 procedure TfrmMain.SaveProject;
+var
+  conf: TJSONConfig;
 begin
-//   .
+  if FileExists(FActiveProject) then
+  begin
+    DeleteFile(FActiveProject);
+  end;
+
+  conf := TJSONConfig.Create(FActiveProject, False);
+  try
+    conf.WriteString('Temp', 'BaseURL', edtBaseURL.Text);
+  finally
+    conf.Free;
+  end;
 end;
 
 end.