Simon Grossenbacher 9 лет назад
Родитель
Сommit
db054b8387

+ 10 - 0
AppConfig.json

@@ -0,0 +1,10 @@
+{
+	"MainWindowPos": {
+		"Left": 711,
+		"Top": 375,
+		"StayOnTop": false
+	},
+	"Dialogs": {
+		"LastOpenDir": "C:\\dev\\RESTDebugger\\src\\"
+	}
+}

BIN
RESTDebugger.exe


BIN
Resources/RESTDebugger.ico


BIN
Resources/debug-32px.png



Разница между файлами не показана из-за своего большого размера
+ 1 - 1
prj/RESTDebugger.dproj


BIN
prj/RESTDebugger.res


+ 55 - 0
prj/RESTDebugger.skincfg

@@ -0,0 +1,55 @@
+[ExpressSkins]
+Default=0
+ShowNotifications=0
+Enabled=1
+dxSkinBlack=0
+dxSkinBlue=0
+dxSkinBlueprint=0
+dxSkinCaramel=0
+dxSkinCoffee=0
+dxSkinDarkRoom=0
+dxSkinDarkSide=0
+dxSkinDevExpressDarkStyle=0
+dxSkinDevExpressStyle=0
+dxSkinFoggy=0
+dxSkinGlassOceans=0
+dxSkinHighContrast=0
+dxSkiniMaginary=0
+dxSkinLilian=0
+dxSkinLiquidSky=0
+dxSkinLondonLiquidSky=0
+dxSkinMcSkin=0
+dxSkinMetropolis=0
+dxSkinMetropolisDark=0
+dxSkinMoneyTwins=0
+dxSkinOffice2007Black=0
+dxSkinOffice2007Blue=0
+dxSkinOffice2007Green=0
+dxSkinOffice2007Pink=0
+dxSkinOffice2007Silver=0
+dxSkinOffice2010Black=0
+dxSkinOffice2010Blue=0
+dxSkinOffice2010Silver=0
+dxSkinOffice2013DarkGray=0
+dxSkinOffice2013LightGray=0
+dxSkinOffice2013White=0
+dxSkinOffice2016Colorful=1
+dxSkinOffice2016Dark=0
+dxSkinPumpkin=0
+dxSkinSeven=0
+dxSkinSevenClassic=0
+dxSkinSharp=0
+dxSkinSharpPlus=0
+dxSkinSilver=0
+dxSkinSpringTime=0
+dxSkinStardust=0
+dxSkinSummer2008=0
+dxSkinTheAsphaltWorld=0
+dxSkinsDefaultPainters=0
+dxSkinValentine=0
+dxSkinVisualStudio2013Blue=0
+dxSkinVisualStudio2013Dark=0
+dxSkinVisualStudio2013Light=0
+dxSkinVS2010=0
+dxSkinWhiteprint=0
+dxSkinXmas2008Blue=0

+ 10 - 0
prj/RESTDebugger.stat

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

BIN
prj/RESTDebugger_Icon.ico


+ 299 - 2
src/_frmMain.dfm

@@ -1,9 +1,11 @@
 object frmMain: TfrmMain
   Left = 0
   Top = 0
+  BorderIcons = [biSystemMenu, biMinimize]
+  BorderStyle = bsSingle
   Caption = 'REST Debugger'
-  ClientHeight = 586
-  ClientWidth = 918
+  ClientHeight = 737
+  ClientWidth = 1014
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
@@ -11,6 +13,301 @@ object frmMain: TfrmMain
   Font.Name = 'Tahoma'
   Font.Style = []
   OldCreateOrder = False
+  Position = poDefault
+  OnClose = FormClose
+  OnCreate = FormCreate
+  OnDestroy = FormDestroy
+  OnShow = FormShow
   PixelsPerInch = 96
   TextHeight = 13
+  object Panel1: TPanel
+    Left = 0
+    Top = 23
+    Width = 1014
+    Height = 76
+    Align = alTop
+    BevelOuter = bvNone
+    Color = clWhite
+    ParentBackground = False
+    TabOrder = 0
+    ExplicitLeft = -2
+    ExplicitTop = 120
+    DesignSize = (
+      1014
+      76)
+    object Label1: TLabel
+      Left = 25
+      Top = 31
+      Width = 86
+      Height = 13
+      Caption = 'REST Debugger'
+      Font.Charset = DEFAULT_CHARSET
+      Font.Color = clWindowText
+      Font.Height = -11
+      Font.Name = 'Tahoma'
+      Font.Style = [fsBold]
+      ParentFont = False
+    end
+    object Image: TImage
+      Left = 965
+      Top = 25
+      Width = 32
+      Height = 32
+      Anchors = [akTop, akRight]
+      AutoSize = True
+      Picture.Data = {
+        0B546478504E47496D61676589504E470D0A1A0A0000000D4948445200000020
+        000000200806000000737A7AF4000002974944415478DAED573B681451149D65
+        2B0BC1F8D95664B368C862B2368BD8042CD20936228A8D885A5818499DCE42DC
+        2D6C4444B0D4761B414190809F421321D8242A1A104320B2D8EC42C28EE7C879
+        F0F29CCF9B9D8985387098F7DEDCCF79F7DEF79920F8FFE4786AB5DA0CB029CC
+        146DFCB550B2C64A8ECC34100AD3CEB76D7AB2F5CA9BC091C3A35F64B8698D5D
+        42BF2AA323346811607B44DFAA94B5083429439B5922D092E19645E02DFA1BC0
+        73A06B3937E8EADB0665936CF910684AE91B50D1583FC2691CFAD2A9C8C6B668
+        FA1060DE16A438A7FE5C0602AECE825B433E24C8FE29C2B91F7889F6247011ED
+        1F098EBBCC3F30411DEAD28689E230AB81B39895F19FC055161B0C9FC5FB21F0
+        1558071E01178E4F1EDA8B6F97251B4AB79467399681556796EB70F200EF338A
+        D21EE0147017E3DF1D59EA96F310984AC9F500D84A9199CA158188959115B780
+        71E9674FC7E776101222711E78A299FB1278511F1B3DA1F63BAF8284C3C6A776
+        700FEF6543806D8D35349B0F3E04581713E3D57DD67EB0144BE2FDCDF2AE8FAD
+        E03E9C0C2CC72E0694993D7DA0A29D2F8DC4A6B5AC97CCBE10E91CC6E7E5A407
+        27ED95DBA563C631DB1CE3378DCD8B445A24B69CBD859BD29B3F0868E634BC0A
+        D4A36A40FDBA6442EA281D83A41478E55C61EF19E7C8F718DA1D2BF41D8E5924
+        7AD269A830E322F02C95808A8B336A5BCED7D0BF86F722A1F69A21A17484D4D5
+        EA8823701D389758FDA6DA9967F53B74C836C68E12724A121D8D9BFA584ED827
+        BA3A0F56620FA4846A5F348E0D114523525E245C0257B007EC4E3C927790C01D
+        EF4B49C129E823EC37A22E38B1D7B2828A9087D263A01673ACFFBEE8EEC832C4
+        CC4EC2F8C15C57F16137A2C2FE0586D98AA953E80F4996C3A870E7598EE3BFFA
+        0FE8D6C03FF5FC02C53E1BF02DDC32610000000049454E44AE426082}
+      Transparent = True
+      ExplicitLeft = 955
+    end
+  end
+  object dxStatusBar: TdxStatusBar
+    Left = 0
+    Top = 717
+    Width = 1014
+    Height = 20
+    Panels = <
+      item
+        PanelStyleClassName = 'TdxStatusBarTextPanelStyle'
+        Text = 'Copyright '#169' by Simnet'
+        Width = 200
+      end
+      item
+        PanelStyleClassName = 'TdxStatusBarTextPanelStyle'
+        Text = 'Loaded Project:'
+      end>
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -11
+    Font.Name = 'Tahoma'
+    Font.Style = []
+    ExplicitLeft = 510
+    ExplicitTop = 375
+    ExplicitWidth = 0
+  end
+  object OpenDialog: TOpenDialog
+    Filter = 'REST Debugger Project (*.rdproj)|*.rdproj'
+    Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing]
+    Left = 735
+    Top = 40
+  end
+  object SaveDialog: TSaveDialog
+    Filter = 'REST Debugger Project (*.rdproj)|*.rdproj'
+    Left = 575
+    Top = 30
+  end
+  object dxSkinController: TdxSkinController
+    SkinName = 'Office2016Colorful'
+    Left = 645
+    Top = 30
+  end
+  object HTTP: TIdHTTP
+    IOHandler = SSLIOHandlerSocketOpenSSL
+    AllowCookies = True
+    HandleRedirects = True
+    ProxyParams.BasicAuthentication = False
+    ProxyParams.ProxyPort = 0
+    Request.ContentLength = -1
+    Request.ContentRangeEnd = -1
+    Request.ContentRangeStart = -1
+    Request.ContentRangeInstanceLength = -1
+    Request.Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
+    Request.BasicAuthentication = False
+    Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
+    Request.Ranges.Units = 'bytes'
+    Request.Ranges = <>
+    HTTPOptions = [hoForceEncodeParams]
+    Left = 425
+    Top = 15
+  end
+  object SSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL
+    MaxLineAction = maException
+    Port = 0
+    DefaultPort = 0
+    SSLOptions.Method = sslvSSLv23
+    SSLOptions.SSLVersions = [sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2]
+    SSLOptions.Mode = sslmUnassigned
+    SSLOptions.VerifyMode = []
+    SSLOptions.VerifyDepth = 0
+    Left = 835
+    Top = 15
+  end
+  object dxBarManager: TdxBarManager
+    AllowReset = False
+    Font.Charset = DEFAULT_CHARSET
+    Font.Color = clWindowText
+    Font.Height = -12
+    Font.Name = 'Segoe UI'
+    Font.Style = []
+    CanCustomize = False
+    Categories.Strings = (
+      'Default')
+    Categories.ItemsVisibles = (
+      2)
+    Categories.Visibles = (
+      True)
+    LookAndFeel.NativeStyle = False
+    PopupMenuLinks = <>
+    UseF10ForMenu = False
+    UseSystemFont = True
+    Left = 135
+    Top = 35
+    DockControlHeights = (
+      0
+      0
+      23
+      0)
+    object dxBarManagerBar1: TdxBar
+      AllowClose = False
+      AllowCustomizing = False
+      AllowQuickCustomizing = False
+      AllowReset = False
+      Caption = 'MainMenu'
+      CaptionButtons = <>
+      DockedDockingStyle = dsTop
+      DockedLeft = 0
+      DockedTop = 0
+      DockingStyle = dsTop
+      FloatLeft = 692
+      FloatTop = 134
+      FloatClientWidth = 51
+      FloatClientHeight = 24
+      IsMainMenu = True
+      ItemLinks = <
+        item
+          Visible = True
+          ItemName = 'dxBarSubItem3'
+        end
+        item
+          Visible = True
+          ItemName = 'dxBarSubItem2'
+        end
+        item
+          Visible = True
+          ItemName = 'dxBarSubItem1'
+        end>
+      MultiLine = True
+      OneOnRow = True
+      Row = 0
+      SizeGrip = False
+      UseOwnFont = False
+      UseRecentItems = False
+      Visible = True
+      WholeRow = True
+    end
+    object dxBarButton1: TdxBarButton
+      Caption = 'Datei'
+      Category = 0
+      Hint = 'Datei'
+      Visible = ivAlways
+    end
+    object dxBarSubItem3: TdxBarSubItem
+      Caption = 'File'
+      Category = 0
+      Visible = ivAlways
+      ItemLinks = <
+        item
+          Visible = True
+          ItemName = 'dxBarButton3'
+        end
+        item
+          Visible = True
+          ItemName = 'btnSave'
+        end
+        item
+          Visible = True
+          ItemName = 'btnSaveAs'
+        end
+        item
+          BeginGroup = True
+          Visible = True
+          ItemName = 'dxBarButton6'
+        end>
+      OnPopup = dxBarSubItem3Popup
+    end
+    object dxBarButton3: TdxBarButton
+      Caption = 'Open...'
+      Category = 0
+      Hint = 'Open'
+      Visible = ivAlways
+      OnClick = dxBarButton3Click
+    end
+    object btnSave: TdxBarButton
+      Caption = 'Save'
+      Category = 0
+      Hint = 'Save'
+      Visible = ivAlways
+    end
+    object btnSaveAs: TdxBarButton
+      Caption = 'Save As...'
+      Category = 0
+      Hint = 'Save As'
+      Visible = ivAlways
+      OnClick = btnSaveAsClick
+    end
+    object dxBarButton6: TdxBarButton
+      Caption = 'Close'
+      Category = 0
+      Hint = 'Close'
+      Visible = ivAlways
+      OnClick = dxBarButton6Click
+    end
+    object dxBarSubItem1: TdxBarSubItem
+      Caption = 'Info'
+      Category = 0
+      Visible = ivAlways
+      ItemLinks = <
+        item
+          Visible = True
+          ItemName = 'dxBarButton7'
+        end>
+    end
+    object dxBarButton7: TdxBarButton
+      Caption = 'About...'
+      Category = 0
+      Hint = 'About'
+      Visible = ivAlways
+      OnClick = dxBarButton7Click
+    end
+    object dxBarSubItem2: TdxBarSubItem
+      Caption = 'Action'
+      Category = 0
+      Visible = ivAlways
+      ItemLinks = <
+        item
+          Visible = True
+          ItemName = 'btnRun'
+        end>
+    end
+    object btnRun: TdxBarButton
+      Caption = 'Run'
+      Category = 0
+      Hint = 'Run'
+      Visible = ivAlways
+      ShortCut = 116
+      OnClick = btnRunClick
+    end
+  end
 end

+ 145 - 2
src/_frmMain.pas

@@ -4,12 +4,52 @@ interface
 
 uses
   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
-  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
+  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, dxSkinsCore, dxSkinOffice2016Colorful,
+  Vcl.StdCtrls, cxClasses, cxLookAndFeels, dxSkinsForm, Vcl.ExtCtrls,
+  dxGDIPlusClasses, cxGraphics, cxControls, cxLookAndFeelPainters,
+  dxSkinsdxStatusBarPainter, dxStatusBar, IdIOHandler, IdIOHandlerSocket,
+  IdIOHandlerStack, IdSSL, IdSSLOpenSSL, IdBaseComponent, IdComponent,
+  IdTCPConnection, IdTCPClient, IdHTTP, _JSONConfig, dxSkinsdxBarPainter, dxBar;
 
 type
   TfrmMain = class(TForm)
+    OpenDialog: TOpenDialog;
+    SaveDialog: TSaveDialog;
+    Panel1: TPanel;
+    dxSkinController: TdxSkinController;
+    Label1: TLabel;
+    Image: TImage;
+    HTTP: TIdHTTP;
+    SSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL;
+    dxStatusBar: TdxStatusBar;
+    dxBarManager: TdxBarManager;
+    dxBarManagerBar1: TdxBar;
+    dxBarButton1: TdxBarButton;
+    dxBarSubItem3: TdxBarSubItem;
+    dxBarButton3: TdxBarButton;
+    btnSave: TdxBarButton;
+    btnSaveAs: TdxBarButton;
+    dxBarButton6: TdxBarButton;
+    dxBarSubItem1: TdxBarSubItem;
+    dxBarButton7: TdxBarButton;
+    dxBarSubItem2: TdxBarSubItem;
+    btnRun: TdxBarButton;
+    procedure FormShow(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure FormDestroy(Sender: TObject);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure dxBarButton6Click(Sender: TObject);
+    procedure dxBarButton3Click(Sender: TObject);
+    procedure btnSaveAsClick(Sender: TObject);
+    procedure dxBarButton7Click(Sender: TObject);
+    procedure btnRunClick(Sender: TObject);
+    procedure dxBarSubItem3Popup(Sender: TObject);
   private
-    { Private-Deklarationen }
+    FMainConfig: TJSONConfig;
+    FProjectConfig: TJSONConfig;
+    FActiveProject: string;
+    procedure LoadProject;
+    procedure SaveProject;
   public
     { Public-Deklarationen }
   end;
@@ -21,4 +61,107 @@ implementation
 
 {$R *.dfm}
 
+procedure TfrmMain.btnRunClick(Sender: TObject);
+begin
+  ShowMessage('run');
+end;
+
+procedure TfrmMain.dxBarButton3Click(Sender: TObject);
+begin
+  OpenDialog.InitialDir := FMainConfig.ReadString('Dialogs', 'LastOpenDir', ExtractFilePath(ParamStr(0)));
+  if OpenDialog.Execute then
+  begin
+    FMainConfig.WriteString('Dialogs', 'LastOpenDir', ExtractFilePath(OpenDialog.FileName));
+    FActiveProject := OpenDialog.FileName;
+    LoadProject;
+  end;
+end;
+
+procedure TfrmMain.btnSaveAsClick(Sender: TObject);
+begin
+  SaveDialog.InitialDir := FMainConfig.ReadString('Dialogs', 'LastSaveDir', ExtractFilePath(ParamStr(0)));
+  if SaveDialog.Execute then
+  begin
+    FMainConfig.WriteString('Dialogs', 'LastSaveDir', ExtractFilePath(SaveDialog.FileName));
+
+
+  end;
+end;
+
+procedure TfrmMain.dxBarButton6Click(Sender: TObject);
+begin
+  Close;
+end;
+
+procedure TfrmMain.dxBarButton7Click(Sender: TObject);
+begin
+  ShowMessage('About REST Debugger');
+end;
+
+procedure TfrmMain.dxBarSubItem3Popup(Sender: TObject);
+begin
+  btnSave.Enabled := FActiveProject <> '';
+end;
+
+procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
+begin
+  FMainConfig.WriteInteger('MainWindowPos', 'Left', Left);
+  FMainConfig.WriteInteger('MainWindowPos', 'Top', Top);
+  FMainConfig.WriteBool('MainWindowPos', 'StayOnTop', FormStyle = fsStayOnTop);
+end;
+
+procedure TfrmMain.FormCreate(Sender: TObject);
+begin
+  FMainConfig := TJSONConfig.Create(ExtractFilePath(ParamStr(0)) + 'AppConfig.json');
+  FActiveProject := '';
+
+  if ParamStr(1) <> '' then
+  begin
+    FActiveProject := ParamStr(1);
+    LoadProject;
+  end;
+end;
+
+procedure TfrmMain.FormDestroy(Sender: TObject);
+begin
+  FMainConfig.Free;
+end;
+
+procedure TfrmMain.FormShow(Sender: TObject);
+begin
+  dxStatusBar.Panels[0].Text := 'Copyright © by Simnet ' + FormatDateTime('yyyy', now);
+
+  if FActiveProject = '' then
+  begin
+    dxStatusBar.Panels[1].Text := 'No project loaded.';
+  end
+  else
+  begin
+    dxStatusBar.Panels[1].Text := 'Loaded project: ' + FActiveProject;
+  end;
+
+
+
+  Left := FMainConfig.ReadInteger('MainWindowPos', 'Left', Round((Screen.Width - Width) div 2));
+  Top := FMainConfig.ReadInteger('MainWindowPos', 'Top', Round((Screen.Height - Height) div 2));
+  if FMainConfig.ReadBool('MainWindowPos', 'StayOnTop') then
+  begin
+    FormStyle := fsStayOnTop;
+  end
+  else
+  begin
+    FormStyle := fsNormal;
+  end;
+end;
+
+procedure TfrmMain.LoadProject;
+begin
+  FProjectConfig := TJSONConfig.Create(FActiveProject);
+end;
+
+procedure TfrmMain.SaveProject;
+begin
+//   .
+end;
+
 end.


Некоторые файлы не были показаны из-за большого количества измененных файлов