{"id":1261,"date":"2014-04-22T22:14:33","date_gmt":"2014-04-22T21:14:33","guid":{"rendered":"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1261"},"modified":"2014-04-23T22:56:42","modified_gmt":"2014-04-23T21:56:42","slug":"tulip-ui-checkboxes-pas","status":"publish","type":"page","link":"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1261","title":{"rendered":"Tulip.UI.CheckBoxes.pas"},"content":{"rendered":"<div style=\"background-color: #FFFFFF; width: 680px\">\n<header class=\"entry-meta\" style=\"text-align: Right;\"><a title=\"Source Files\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1091\">Source Files<\/a><span> | Tulip.UI.CheckBoxes.pas<\/span><\/header>\n<p><code><\/p>\n<pre>\r\n{******************************************************************************}\r\n{                                                                              }\r\n{                        Tulip - User Interface Library                        }\r\n{                                                                              }\r\n{             Copyright(c) 2012 Marcos Gomes. All rights Reserved.             }\r\n{                                                                              }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{  This product is based on Asphyre Sphinx (c) 2000 - 2012  Yuriy Kotsarenko.  }\r\n{       All rights reserved. Official web site: http:\/\/www.afterwarp.net       }\r\n{                                                                              }\r\n{******************************************************************************}\r\n{                                                                              }\r\n{  Important Notice:                                                           }\r\n{                                                                              }\r\n{  If you modify\/use this code or one of its parts either in original or       }\r\n{  modified form, you must comply with Mozilla Public License Version 2.0,     }\r\n{  including section 3, \"Responsibilities\". Failure to do so will result in    }\r\n{  the license breach, which will be resolved in the court. Remember that      }\r\n{  violating author's rights either accidentally or intentionally is           }\r\n{  considered a serious crime in many countries. Thank you!                    }\r\n{                                                                              }\r\n{  !! Please *read* Mozilla Public License 2.0 document located at:            }\r\n{  http:\/\/www.mozilla.org\/MPL\/                                                 }\r\n{                                                                              }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{  The contents of this file are subject to the Mozilla Public License         }\r\n{  Version 2.0 (the \"License\"); you may not use this file except in            }\r\n{  compliance with the License. You may obtain a copy of the License at        }\r\n{  http:\/\/www.mozilla.org\/MPL\/                                                 }\r\n{                                                                              }\r\n{  Software distributed under the License is distributed on an \"AS IS\"         }\r\n{  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the     }\r\n{  License for the specific language governing rights and limitations          }\r\n{  under the License.                                                          }\r\n{                                                                              }\r\n{  The Original Code is Tulip.UI.CheckBoxes.pas.                               }\r\n{                                                                              }\r\n{  The Initial Developer of the Original Code is Marcos Gomes.                 }\r\n{  Portions created by Marcos Gomes are Copyright (C) 2012, Marcos Gomes.      }\r\n{  All Rights Reserved.                                                        }\r\n{                                                                              }\r\n{******************************************************************************}\r\n{                                                                              }\r\n{  Tulip.UI.CheckBoxes.pas                              Modified: 05-Out-2012  }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{                   Base Implementations for CheckBox Controls                 }\r\n{                                                                              }\r\n{                                Version 1.02                                  }\r\n{                                                                              }\r\n{******************************************************************************}\r\n\r\nunit Tulip.UI.CheckBoxes;\r\n\r\ninterface\r\n\r\nuses\r\n  System.SysUtils, System.Classes,\r\n  \/\/ Asphyre Units\r\n  AbstractCanvas, AsphyreFonts, AsphyreImages, AsphyreTypes, Vectors2,\r\n  \/\/ Tulip UI Units\r\n  Tulip.UI.Types, Tulip.UI.Classes, Tulip.UI.Controls, Tulip.UI.Helpers,\r\n  Tulip.UI.Utils;\r\n\r\ntype\r\n{$REGION 'TCustomACheckBox'}\r\n  TCustomACheckBox = class(TWControl)\r\n  private\r\n    FAntialiased: Boolean;\r\n    FBorder: TBorder;\r\n    FBox: TCkBox;\r\n    FCaption: String;\r\n    FChecked: Boolean;\r\n    FColor: TFillColor;\r\n    FFocusRect: TFocusRect;\r\n    FFont: TFormatedFont;\r\n    FImage: TImage;\r\n    FMargin: Word;\r\n    FReadOnly: Boolean;\r\n    FTransparent: Boolean;\r\n\r\n    procedure SetAntialiased(Value: Boolean);\r\n    procedure SetBorder(Value: TBorder);\r\n    procedure SetBox(Value: TCkBox);\r\n    procedure SetCaption(Value: String);\r\n    procedure SetChecked(Value: Boolean);\r\n    procedure SetColor(Value: TFillColor);\r\n    procedure SetFocusRect(Value: TFocusRect);\r\n    procedure SetFont(Value: TFormatedFont);\r\n    procedure SetImage(Value: TImage);\r\n    procedure SetMargin(Value: Word);\r\n    procedure SetReadOnly(Value: Boolean);\r\n    procedure SetTransparent(Value: Boolean);\r\n  protected\r\n    procedure AssignTo(Dest: TPersistent); override;\r\n    procedure Paint; override;\r\n\r\n    procedure SetHeight(Value: Integer); override;\r\n    procedure SetWidth(Value: Integer); override;\r\n  public\r\n    constructor Create(AOwner: TComponent); override;\r\n    destructor Destroy; override;\r\n\r\n    procedure DblClick; override;\r\n    procedure KeyDown(var Key: Word; Shift: TShiftState); override;\r\n    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;\r\n      X, Y: Integer); override;\r\n    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;\r\n      X, Y: Integer); override;\r\n\r\n    property Antialiased: Boolean read FAntialiased write SetAntialiased;\r\n    property Border: TBorder read FBorder write SetBorder;\r\n    property Box: TCkBox read FBox write SetBox;\r\n    property Caption: String read FCaption write SetCaption;\r\n    property Checked: Boolean read FChecked write SetChecked;\r\n    property Color: TFillColor read FColor write SetColor;\r\n    property FocusRect: TFocusRect read FFocusRect write SetFocusRect;\r\n    property Font: TFormatedFont read FFont write SetFont;\r\n    property Image: TImage read FImage write SetImage;\r\n    property Margin: Word read FMargin write SetMargin;\r\n    property ReadOnly: Boolean read FReadOnly write SetReadOnly;\r\n    property Transparent: Boolean read FTransparent write SetTransparent;\r\n  end;\r\n{$ENDREGION}\r\n\r\nimplementation\r\n\r\n{$REGION 'TCustomACheckBox'}\r\n{ TCustomACheckBox }\r\n\r\nprocedure TCustomACheckBox.AssignTo(Dest: TPersistent);\r\nbegin\r\n  ControlState := ControlState + [csReadingState];\r\n\r\n  inherited AssignTo(Dest);\r\n\r\n  if Dest is TCustomACheckBox then\r\n    with TCustomACheckBox(Dest) do\r\n    begin\r\n      Antialiased := Self.Antialiased;\r\n      Border := Self.Border;\r\n      Box := Self.Box;\r\n      Caption := Self.Caption;\r\n      Checked := Self.Checked;\r\n      Color := Self.Color;\r\n      FocusRect := Self.FocusRect;\r\n      Font := Self.Font;\r\n      Image := Self.Image;\r\n      Margin := Self.Margin;\r\n      ReadOnly := Self.ReadOnly;\r\n      Transparent := Self.Transparent;\r\n    end;\r\n\r\n  ControlState := ControlState - [csReadingState];\r\nend;\r\n\r\nconstructor TCustomACheckBox.Create(AOwner: TComponent);\r\nvar\r\n  Num: Integer;\r\nbegin\r\n  ControlState := ControlState + [csCreating];\r\n\r\n  inherited Create(AOwner);\r\n\r\n  if (AOwner <> nil) and (AOwner <> Self) and (AOwner is TWControl) then\r\n  begin\r\n    \/\/ Auto generate name\r\n    Num := 1;\r\n    begin\r\n      while AOwner.FindComponent('CheckBox' + IntToStr(Num)) <> nil do\r\n        Inc(Num);\r\n      Name := 'CheckBox' + IntToStr(Num);\r\n    end;\r\n  end;\r\n\r\n  \/\/ Fields\r\n  FAntialiased := True;\r\n  FBorder := TBorder.Create;\r\n  FBorder.Color := $B0FFFFFF;\r\n  FBorder.Size := 0;\r\n  FBox := TCkBox.Create;\r\n  FCaption := Name;\r\n  FChecked := True;\r\n  FColor := TFillColor.Create($FF4090F0, $FF4090F0, $FF4090F0, $FF4090F0);\r\n  FFocusRect := fDark;\r\n  FFont := TFormatedFont.Create;\r\n  FFont.HorizontalAlign := aLeft;\r\n  FImage := TImage.Create;\r\n  FMargin := 2;\r\n  FReadOnly := False;\r\n  FTransparent := True;\r\n\r\n  \/\/ Properties\r\n  Self.Left := 0;\r\n  Self.Top := 0;\r\n  Self.Width := 120;\r\n  Self.Height := 24;\r\n  Self.TabStop := True;\r\n  Self.Visible := True;\r\n\r\n  ControlState := ControlState - [csCreating];\r\nend;\r\n\r\nprocedure TCustomACheckBox.DblClick;\r\nbegin\r\n  if not(FReadOnly) then\r\n  begin\r\n    FChecked := not FChecked;\r\n  end;\r\n\r\n  inherited DblClick;\r\nend;\r\n\r\ndestructor TCustomACheckBox.Destroy;\r\nbegin\r\n  FBorder.Free;\r\n  FBox.Free;\r\n  FColor.Free;\r\n  FFont.Free;\r\n  FImage.Free;\r\n\r\n  inherited;\r\nend;\r\n\r\nprocedure TCustomACheckBox.KeyDown(var Key: Word; Shift: TShiftState);\r\nbegin\r\n  if not(FReadOnly) then\r\n  begin\r\n    if (Key = $20) then\r\n    begin\r\n      FChecked := not FChecked;\r\n    end;\r\n  end;\r\n\r\n  inherited KeyDown(Key, Shift);\r\nend;\r\n\r\nprocedure TCustomACheckBox.MouseDown(Button: TMouseButton; Shift: TShiftState;\r\n  X, Y: Integer);\r\nbegin\r\n  Self.SetFocus;\r\n\r\n  inherited MouseDown(Button, Shift, X, Y);\r\nend;\r\n\r\nprocedure TCustomACheckBox.MouseUp(Button: TMouseButton; Shift: TShiftState;\r\n  X, Y: Integer);\r\nvar\r\n  L, T, H, W: Integer;\r\nbegin\r\n  T := Self.ClientTop + FBorder.Size + FMargin;\r\n  H := Self.Height - (FBorder.Size * 2) - (FMargin * 2);\r\n  T := T + (H div 2 - FBox.Size div 2);\r\n\r\n  L := Self.ClientLeft + FBorder.Size + FMargin;\r\n  W := Self.ClientLeft + FBorder.Size + FMargin + FBox.Size;\r\n  H := T + FBox.Size;\r\n\r\n  if not(FReadOnly) then\r\n  begin\r\n    if (X >= L) and (X < W) and (Y >= T) and (Y < H) then\r\n    begin\r\n      FChecked := not FChecked;\r\n    end;\r\n  end;\r\n\r\n  inherited MouseUp(Button, Shift, X, Y);\r\nend;\r\n\r\nprocedure TCustomACheckBox.Paint;\r\nvar\r\n  X, Y: Integer;\r\n  AFont: TAsphyreFont;\r\n  AImage: TAsphyreImage;\r\n  bTop, bBottom: TConstraintSize;\r\n  L, T, H, W: Integer;\r\nbegin\r\n  \/\/ Set initial values\r\n  X := ClientLeft;\r\n  Y := ClientTop;\r\n\r\n  ControlManager.Canvas.Antialias := FAntialiased;\r\n\r\n  \/\/ Draw Background\r\n  if not FTransparent then\r\n  begin\r\n    AImage := ControlManager.Images.Image[FImage.Image];\r\n    if AImage <> nil then\r\n    begin\r\n      ControlManager.Canvas.UseImagePx(AImage, pRect4(FImage.Rect));\r\n      ControlManager.Canvas.TexMap(pRect4(Rect(X, Y, X + Width, Y + Height)),\r\n        cAlpha4(FColor), beNormal);\r\n    end\r\n    else\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y, X + Width, Y + Height),\r\n        cColor4(FColor), beNormal);\r\n    end;\r\n  end;\r\n\r\n  \/\/ Draw Border\r\n  if Border.Size > 0 then\r\n  begin\r\n    bTop := 0;\r\n    bBottom := 0;\r\n\r\n    if eTop in Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y, X + Width, Y + Border.Size),\r\n        Border.Color, beNormal);\r\n      bTop := Border.Size;\r\n    end;\r\n\r\n    if eBottom in Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y + Height - Border.Size,\r\n        X + Width, Y + Height), Border.Color, beNormal);\r\n      bBottom := Border.Size;\r\n    end;\r\n\r\n    if eLeft in Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(X, Y + bTop, X + Border.Size,\r\n        Y + Height - bBottom), Border.Color, beNormal);\r\n\r\n    if eRight in Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(X + Width - Border.Size, Y + bTop,\r\n        X + Width, Y + Height - bBottom), Border.Color, beNormal);\r\n  end;\r\n\r\n  \/\/ Draw DisplayText\r\n  AFont := ControlManager.Fonts.Font[FFont.Name];\r\n  if (AFont <> nil) and (FCaption <> '') then\r\n  begin\r\n    AFont.TextRectEx(Point2(X + Border.Size + Box.Size + (Margin * 3),\r\n      Y + Border.Size + Margin + 1), Point2(Width - Box.Size - (Border.Size * 2)\r\n      - (Margin * 4), Height - (Border.Size * 2) - (Margin * 2)), FCaption,\r\n      cColor2(FFont.Color), 1.0, FFont.HorizontalAlign, FFont.VerticalAlign,\r\n      FFont.ParagraphLine);\r\n  end;\r\n\r\n  \/\/ Draw box\r\n  \/\/ Draw box Background\r\n  T := Y + Border.Size + Margin;\r\n  H := Height - (Border.Size * 2) - (Margin * 2);\r\n  T := T + (H div 2 - FBox.Size div 2);\r\n\r\n  L := X + Border.Size + Margin;\r\n  W := X + Border.Size + Margin + FBox.Size;\r\n  H := T + FBox.Size;\r\n\r\n  if FChecked then\r\n    AImage := ControlManager.Images.Image[FBox.CheckedImage.Image]\r\n  else\r\n    AImage := ControlManager.Images.Image[FBox.Image.Image];\r\n\r\n  if AImage <> nil then\r\n  begin\r\n    if FChecked then\r\n      ControlManager.Canvas.UseImagePx(AImage, pRect4(FBox.CheckedImage.Rect))\r\n    else\r\n      ControlManager.Canvas.UseImagePx(AImage, pRect4(FBox.Image.Rect));\r\n\r\n    ControlManager.Canvas.TexMap(pRect4(Rect(L, T, W, H)), cAlpha4(FColor),\r\n      beNormal);\r\n  end\r\n  else\r\n  begin\r\n    ControlManager.Canvas.FillRect(Rect(L, T, W, H), cColor4(FBox.Color),\r\n      beNormal);\r\n    \/\/ draw check\r\n    if FChecked then\r\n    begin\r\n      ControlManager.Canvas.FillQuad(Point4(Point2(L + 2 + (FBox.Size div 8),\r\n        T + 1 + ((FBox.Size div 8) * 3)), Point2(L + 2 + (FBox.Size div 3),\r\n        H - 1 - (FBox.Size div 4)), Point2(L + 2 + (FBox.Size div 3), H - 1),\r\n        Point2(L + 2, T + 1 + (FBox.Size div 2))), cColor4(FBox.CheckedColor),\r\n        beNormal);\r\n\r\n      ControlManager.Canvas.FillQuad(Point4(Point2(L + 2 + (FBox.Size div 3),\r\n        H - 2 - (FBox.Size div 4)), Point2(W - 2, T + 2),\r\n        Point2(W - 2, T + 2 + (FBox.Size div 4)),\r\n        Point2(L + 2 + (FBox.Size div 3), H - 2)), cColor4(FBox.CheckedColor),\r\n        beNormal);\r\n    end;\r\n  end;\r\n\r\n  \/\/ Draw box Border\r\n  if FBox.Border.Size > 0 then\r\n  begin\r\n    bTop := 0;\r\n    bBottom := 0;\r\n\r\n    if eTop in FBox.Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(L, T, W, T + FBox.Border.Size),\r\n        FBox.Border.Color, beNormal);\r\n      bTop := FBox.Border.Size;\r\n    end;\r\n\r\n    if eBottom in FBox.Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(L, H - FBox.Border.Size, W, H),\r\n        FBox.Border.Color, beNormal);\r\n      bBottom := FBox.Border.Size;\r\n    end;\r\n\r\n    if eLeft in FBox.Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(L, T + bTop, L + FBox.Border.Size,\r\n        H - bBottom), FBox.Border.Color, beNormal);\r\n\r\n    if eRight in FBox.Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(W - FBox.Border.Size, T + bTop, W,\r\n        H - bBottom), FBox.Border.Color, beNormal);\r\n  end;\r\n\r\n  \/\/ Draw box Focus rect\r\n  if (ControlManager.ActiveControl = Self) and (Self.FocusRect = fLight) then\r\n  begin\r\n    ControlManager.Canvas.FrameRect(Rect(L - 1, T - 1, W + 1, H + 1),\r\n      cColor4($40FFFFFF), beNormal);\r\n  end;\r\n  if (ControlManager.ActiveControl = Self) and (Self.FocusRect = fDark) then\r\n  begin\r\n    ControlManager.Canvas.FrameRect(Rect(L - 1, T - 1, W + 1, H + 1),\r\n      cColor4($30000000), beNormal);\r\n  end;\r\n\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetAntialiased(Value: Boolean);\r\nbegin\r\n  FAntialiased := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetBorder(Value: TBorder);\r\nbegin\r\n  if Value <> nil then\r\n    FBorder.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetBox(Value: TCkBox);\r\nbegin\r\n  if Value <> nil then\r\n    FBox.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetCaption(Value: String);\r\nbegin\r\n  FCaption := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetChecked(Value: Boolean);\r\nbegin\r\n  FChecked := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetColor(Value: TFillColor);\r\nbegin\r\n  if Value <> nil then\r\n    FColor.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetFocusRect(Value: TFocusRect);\r\nbegin\r\n  FFocusRect := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetFont(Value: TFormatedFont);\r\nbegin\r\n  if Value <> nil then\r\n    FFont.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetHeight(Value: Integer);\r\nvar\r\n  MinH: Integer;\r\nbegin\r\n  MinH := FBorder.Size * 2 + FMargin * 2 + FBox.Size;\r\n\r\n  if Value < MinH then\r\n    Value := MinH;\r\n\r\n  inherited SetHeight(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetImage(Value: TImage);\r\nbegin\r\n  if Value <> nil then\r\n    FImage.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetMargin(Value: Word);\r\nbegin\r\n  FMargin := Value;\r\n\r\n  SetHeight(Self.Height);\r\n  SetWidth(Self.Width);\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetReadOnly(Value: Boolean);\r\nbegin\r\n  FReadOnly := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetTransparent(Value: Boolean);\r\nbegin\r\n  FTransparent := Value;\r\nend;\r\n\r\nprocedure TCustomACheckBox.SetWidth(Value: Integer);\r\nvar\r\n  MinW: Integer;\r\nbegin\r\n  MinW := FBorder.Size * 2 + FMargin * 2 + FBox.Size;\r\n\r\n  if Value < MinW then\r\n    Value := MinW;\r\n\r\n  inherited SetWidth(Value);\r\nend;\r\n{$ENDREGION}\r\n\r\nend.\r\n<\/pre>\n<p><\/code><\/p>\n<footer class=\"entry-meta\" style=\"text-align: Right;\"><a title=\"Source Files\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1091\">Source Files<\/a><span> | Tulip.UI.CheckBoxes.pas<\/span><\/footer>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Source Files | Tulip.UI.CheckBoxes.pas {******************************************************************************} { } { Tulip &#8211; User Interface Library } { } { Copyright(c) 2012 Marcos Gomes. All rights Reserved. } { } { &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; } <a class=\"more-link\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1261\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1091,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1261"}],"collection":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1261"}],"version-history":[{"count":4,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1261\/revisions"}],"predecessor-version":[{"id":2841,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1261\/revisions\/2841"}],"up":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1091"}],"wp:attachment":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}