| 1 |
unit FormImportStarling; |
| 2 |
|
| 3 |
{$mode objfpc}{$H+} |
| 4 |
|
| 5 |
interface |
| 6 |
|
| 7 |
uses |
| 8 |
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, |
| 9 |
Spin, ButtonPanel, Buttons; |
| 10 |
|
| 11 |
type |
| 12 |
TImportStarlingForm = class(TForm) |
| 13 |
ButtonDefault: TBitBtn; |
| 14 |
ButtonPanel1: TButtonPanel; |
| 15 |
FloatSpinEditFPS: TFloatSpinEdit; |
| 16 |
Label1: TLabel; |
| 17 |
LabelStarlingOptions: TLabel; |
| 18 |
LabelStrictDesc: TLabel; |
| 19 |
LabelNamingConvention: TLabel; |
| 20 |
LabelTralingDesc: TLabel; |
| 21 |
EditURL: TEdit; |
| 22 |
LabelURLTitle: TLabel; |
| 23 |
PanelNamingConvention: TPanel; |
| 24 |
LabelFPS: TLabel; |
| 25 |
PanelURL: TPanel; |
| 26 |
PanelFPS: TPanel; |
| 27 |
RadioStrictUnderscore: TRadioButton; |
| 28 |
RadioTralingNumber: TRadioButton; |
| 29 |
procedure ButtonDefaultClick(Sender: TObject); |
| 30 |
procedure LabelTralingDescClick(Sender: TObject); |
| 31 |
procedure LabelStrictDescClick(Sender: TObject); |
| 32 |
procedure OptionsChange(Sender: TObject); |
| 33 |
strict private |
| 34 |
function GetURL: String; |
| 35 |
public |
| 36 |
procedure Initialize(const URL: String); |
| 37 |
|
| 38 |
property URL: String read GetURL; |
| 39 |
end; |
| 40 |
|
| 41 |
var |
| 42 |
ImportStarlingForm: TImportStarlingForm; |
| 43 |
|
| 44 |
implementation |
| 45 |
|
| 46 |
uses |
| 47 |
Math, |
| 48 |
CastleUriUtils; |
| 49 |
|
| 50 |
{$R *.lfm} |
| 51 |
|
| 52 |
{ TImportStarlingForm } |
| 53 |
|
| 54 |
procedure TImportStarlingForm.OptionsChange(Sender: TObject); |
| 55 |
var |
| 56 |
URLAnchor: String; |
| 57 |
begin |
| 58 |
if RadioStrictUnderscore.Checked then |
| 59 |
URLAnchor := '#anim-naming:strict-underscore' |
| 60 |
else |
| 61 |
URLAnchor := '#anim-naming:trailing-number'; |
| 62 |
|
| 63 |
if not SameValue(FloatSpinEditFPS.Value, 8.0) then |
| 64 |
URLAnchor := URLAnchor + ',fps:' + Format('%f', [FloatSpinEditFPS.Value]); |
| 65 |
|
| 66 |
EditURL.Text := URIDeleteAnchor(EditURL.Text) + URLAnchor; |
| 67 |
EditURL.Hint := URIDeleteAnchor(EditURL.Text) + URLAnchor; |
| 68 |
end; |
| 69 |
|
| 70 |
procedure TImportStarlingForm.ButtonDefaultClick(Sender: TObject); |
| 71 |
begin |
| 72 |
RadioStrictUnderscore.Checked := true; |
| 73 |
FloatSpinEditFPS.Value := 8.0; |
| 74 |
end; |
| 75 |
|
| 76 |
procedure TImportStarlingForm.LabelTralingDescClick(Sender: TObject); |
| 77 |
begin |
| 78 |
RadioTralingNumber.Checked := true; |
| 79 |
end; |
| 80 |
|
| 81 |
procedure TImportStarlingForm.LabelStrictDescClick(Sender: TObject); |
| 82 |
begin |
| 83 |
RadioStrictUnderscore.Checked := true; |
| 84 |
end; |
| 85 |
|
| 86 |
function TImportStarlingForm.GetURL: String; |
| 87 |
begin |
| 88 |
Result := EditURL.Text; |
| 89 |
end; |
| 90 |
|
| 91 |
procedure TImportStarlingForm.Initialize(const URL: String); |
| 92 |
begin |
| 93 |
EditURL.Text := URL; |
| 94 |
end; |
| 95 |
|
| 96 |
end. |
| 97 |
|