hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
476a4b7da0ac931061cd3cccba952c1fd7e7ca06 | 2,650 | pas | Pascal | drives/0083.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 11 | 2015-12-12T05:13:15.000Z | 2020-10-14T13:32:08.000Z | drives/0083.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| null | null | null | drives/0083.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 8 | 2017-05-05T05:24:01.000Z | 2021-07-03T20:30:09.000Z | {
> What I need is a routine that will give back the letters of the active
> drives on a system. Can anyone help me.
}
Program ListAvailableDrives;
(*
Public Domain, (c) 1994 by Andrew Eigus Fidonet: 2:5100/33 }
These routines are taken from my EnhDOS unit where are lot of useful
stuff.
MATERIAL RELEASED FOR SWAG
*)
const
{ GetDriveType return values }
dtError = $00; { Bad drive }
dtFixed = $01; { Fixed drive }
dtRemovable = $02; { Removable (floppy) drive }
dtRemote = $03; { Remote (network) drive }
dtCDROM = $04; { CD-ROM V2.00+ drive }
dtDblSpace = $05; { DoubleSpace compressed drive }
Function GetDriveType(Drive : byte) : byte; assembler;
{ 0=current (default) drive,1=A,2=B,3=C... }
Asm
cmp Drive,0
jne @@1
mov ah,19h
int 21h
mov Drive,al
inc Drive
@@1:
mov ax,1500h
xor bx,bx
int 2Fh
or bx,0 { works with CD-ROM v2.00+ }
jz @@2
mov ax,150Bh
xor ch,ch
mov cl,Drive
int 2Fh
cmp bx,0ADADh
jne @@2
or ax,0
jz @@2
mov bl,dtCDROM
jmp @@7
@@2:
mov ax,4A11h
mov bx,1
mov dl,Drive
dec dl
int 2Fh
xor cl,cl { mov cl,False }
or ax,0 { is DoubleSpace loaded? }
jnz @@3
cmp dl,bl { if a host drive equal to compressed, then get out... }
je @@3
test bl,10000000b { bit 7=1: DL=compressed,BL=host
=0: DL=host,BL=compressed }
jz @@3 { so avoid host drives, assume host=fixed :) }
inc dl
cmp Drive,dl
jne @@3
mov bl,dtDblSpace
jmp @@7
@@3:
mov ax,4409h
mov bl,Drive
int 21h
jc @@5
or al,False
jz @@4
mov bl,dtRemote
jmp @@7
@@4:
mov ax,4408h
mov bl,Drive
int 21h
jc @@5
or al,False
jz @@6
mov bl,dtFixed
jmp @@7
@@5:
xor bl,bl { mov bl,dtError cuz dtError=0 }
jmp @@7
@@6:
mov bl,dtRemovable
@@7:
mov al,bl
End; { GetDriveType }
var
Drive : byte;
DriveType : byte;
Begin
WriteLn(#13#10'Drives available:');
WriteLn('-----------------------------');
for Drive := (Ord('A') - Ord('A') + 1) to (Ord('Z') - Ord('A') + 1) do
begin
DriveType := GetDriveType(Drive);
if DriveType <> dtError then
begin
Write('Drive ', Chr(Drive + Ord('A') - 1), ': ');
case DriveType of
dtRemovable: WriteLn('Removable (floppy)');
dtFixed: WriteLn('Fixed (hard disk)');
dtRemote: WriteLn('Remote (network)');
dtCDROM: WriteLn('CD-ROM');
dtDblSpace: WriteLn('DoubleSpace')
end
end
end;
WriteLn('-----------------------------')
End.
| 22.268908 | 73 | 0.551698 |
f1cd4106b00ddc4abdae486bb3c998b43c3370a3 | 27,019 | pas | Pascal | Libraries/KControls/source/kbuttons.pas | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| 62 | 2016-01-20T16:26:25.000Z | 2022-02-28T14:25:52.000Z | Libraries/KControls/source/kbuttons.pas | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| null | null | null | Libraries/KControls/source/kbuttons.pas | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| 20 | 2016-09-08T00:15:22.000Z | 2022-01-26T13:13:08.000Z | { @abstract(This file is part of the KControls component suite for Delphi and Lazarus.)
@author(Tomas Krysl)
Copyright (c) 2020 Tomas Krysl<BR><BR>
<B>License:</B><BR>
This code is licensed under BSD 3-Clause Clear License, see file License.txt or https://spdx.org/licenses/BSD-3-Clause-Clear.html.
}
unit kbuttons; // lowercase name because of Lazarus/Linux
{$include kcontrols.inc}
{$WEAKPACKAGEUNIT ON}
interface
uses
{$IFDEF FPC}
LCLType, LCLIntf, LMessages, LCLProc, LResources,
{$ELSE}
Windows, Messages,
{$ENDIF}
SysUtils, Classes, Controls, Forms, Graphics,
ActnList, StdCtrls, Dialogs, Buttons, ImgList,
KFunctions, KGraphics, KControls
{$IFDEF USE_THEMES}
, Themes
{$IFNDEF FPC}
, UxTheme
{$ENDIF}
{$ENDIF}
;
const
cGlyphUp = 0;
cGlyphDisabled = 1;
cGlyphClicked = 2;
cGlyphDown = 3;
type
TKButtonState = (cbsPressed, cbsWasPressed, cbsMouseCapture, cbsFocused, cbsLostFocus, cbsHot, cbsCheck);
TKButtonStates = set of TKButtonState;
{ Base control for KControls buttons. }
{ TKButtonControl }
TKButtonControl = class(TKCustomControl)
private
FCancel: Boolean;
FDefault: Boolean;
FFocusRect: Boolean;
FHAlign: TKHAlign;
FModalResult: TModalResult;
FVAlign: TKVAlign;
FWordWrap: Boolean;
procedure WMSetFocus(var Msg: TLMSetFocus); message LM_SETFOCUS;
procedure WMKillFocus(var Msg: TLMKillFocus); message LM_KILLFOCUS;
procedure CMDialogKey(var Msg: TCMDialogKey); message CM_DIALOGKEY;
procedure CMDialogChar(var Msg: TCMDialogChar); message CM_DIALOGCHAR;
procedure CMEnabledChanged(var Msg: TLMessage); message CM_ENABLEDCHANGED;
procedure CMFocusChanged(var Msg: TLMessage); message CM_FOCUSCHANGED;
procedure CMMouseEnter(var Msg: TLMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Msg: TLMessage); message CM_MOUSELEAVE;
procedure CMTextChanged(var Msg: TLMessage); message CM_TEXTCHANGED;
function GetDown: Boolean;
function GetIsCheck: Boolean;
procedure SetCancel(AValue: Boolean);
procedure SetDefault(AValue: Boolean);
procedure SetDown(const Value: Boolean);
procedure SetFocusRect(const Value: Boolean);
procedure SetHAlign(const Value: TKHAlign);
procedure SetIsCheck(const Value: Boolean);
procedure SetModalResult(AValue: TModalResult);
procedure SetVAlign(const Value: TKVAlign);
procedure SetWordWrap(const Value: Boolean);
protected
FStates: TKButtonStates;
procedure DrawCaption(ACanvas: TCanvas; const ARect: TRect); virtual;
procedure DrawFocusRect(ACanvas: TCanvas; ARect: TRect); virtual;
procedure DrawInterior(ACanvas: TCanvas; ARect: TRect); virtual; abstract;
function GetSkinned: Boolean; virtual;
procedure Loaded; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure PaintToCanvas(ACanvas: TCanvas); override;
procedure UpdateSize; override;
procedure WndProc(var Msg: TLMessage); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AfterConstruction; override;
procedure Invalidate; override;
property Cancel: Boolean read FCancel write SetCancel default false;
property Default: Boolean read FDefault write SetDefault default false;
property HAlign: TKHAlign read FHAlign write SetHAlign default halCenter;
property ModalResult: TModalResult read FModalResult write SetModalResult default mrNone;
property Skinned: Boolean read GetSkinned;
property VAlign: TKVAlign read FVAlign write SetVAlign default valCenter;
property WordWrap: Boolean read FWordWrap write SetWordWrap default False;
published
property Action;
property Anchors;
property Caption;
property Constraints;
property DoubleBuffered;
property DragCursor;
property DragKind;
property DragMode;
property Down: Boolean read GetDown write SetDown default False;
property FocusRect: Boolean read FFocusRect write SetFocusRect default True;
property Enabled;
property Font;
property IsCheck: Boolean read GetIsCheck write SetIsCheck default False;
property ParentDoubleBuffered;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop default True;
property Visible;
property OnClick;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
{$IFDEF COMPILER9_UP}
property OnMouseEnter;
property OnMouseLeave;
{$ENDIF}
property OnMouseMove;
property OnMouseUp;
property OnStartDock;
property OnStartDrag;
end;
{$IFDEF FPC}
TColorDialogOption = (cdFullOpen, cdPreventFullOpen, cdShowHelp, cdSolidColor, cdAnyColor);
TColorDialogOptions = set of TColorDialogOption;
{$ENDIF}
{ Custom drawn TBitBtn using TKAlphaBitmap as Glyph. }
TKBitBtn = class(TKButtonControl)
private
FLayout: TButtonLayout;
FKind: TBitBtnKind;
FSpacing: Integer;
FMargin: Integer;
FMaskGlyph: Boolean;
FNumGlyphs: Integer;
FGlyph: TKAlphaBitmap;
function GetGlyph: TKAlphaBitmap;
function IsGlyphStored: Boolean;
procedure SetGlyph(const Value: TKAlphaBitmap);
procedure SetKind(Value: TBitBtnKind);
procedure SetLayout(Value: TButtonLayout);
procedure SetMargin(Value: Integer);
procedure SetNumGlyphs(Value: Integer);
procedure SetSpacing(Value: Integer);
procedure SetMaskGlyph(const Value: Boolean);
protected
FGlyphs: array of TKAlphaBitmap;
FGrayedGlyph: TKAlphaBitmap;
procedure GlyphChange(Sender: TObject);
procedure DrawInterior(ACanvas: TCanvas; ARect: TRect); override;
procedure UpdateGlyphs; virtual;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property MaskGlyph: Boolean read FMaskGlyph write SetMaskGlyph;
published
property Cancel;
property Default;
property Glyph: TKAlphaBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
property Kind: TBitBtnKind read FKind write SetKind default bkCustom;
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
property Margin: Integer read FMargin write SetMargin default 3;
property ModalResult;
property NumGlyphs: Integer read FNumGlyphs write SetNumGlyphs default 1;
property Spacing: Integer read FSpacing write SetSpacing default 4;
property WordWrap;
end;
{ Custom drawn TColorButton using rectangle as color indication. }
TKColorButton = class(TKButtonControl)
private
FDlgColor: TColor;
FColorDlgOptions: TColorDialogOptions;
procedure SetDlgColor(Value: TColor);
protected
procedure DrawInterior(ACanvas: TCanvas; ARect: TRect); override;
public
constructor Create(AOwner: TComponent); override;
procedure Click; override;
published
property DlgColor: TColor read FDlgColor write SetDlgColor default clRed;
property ColorDlgOptions: TColorDialogOptions read FColorDlgOptions write FColorDlgOptions;
end;
{ Custom drawn TSpeedBtn using TKAlphaBitmap as Glyph. }
TKSpeedButton = class(TKButtonControl)
private
FGlyph: TKAlphaBitmap;
FImages: TCustomImageList;
FImageIndex: TImageIndex;
function GetGlyph: TKAlphaBitmap;
function IsGlyphStored: Boolean;
procedure SetGlyph(const Value: TKAlphaBitmap);
procedure SetImages(const Value: TCustomImageList);
procedure SetImageIndex(Value: TImageIndex);
protected
procedure GlyphChange(Sender: TObject);
procedure DrawInterior(ACanvas: TCanvas; ARect: TRect); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Cancel;
property Default;
property Glyph: TKAlphaBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
property Images: TCustomImageList read FImages write SetImages;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex default -1;
property ModalResult;
end;
implementation
uses
Math, Types;
{ TKButtonControl }
constructor TKButtonControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle := bsNone;
ControlStyle := [csClickEvents, csCaptureMouse];
Font.Color := clBtnText;
Width := 70;
Height := 25;
TabStop := True;
FCancel := False;
FDefault := False;
FFocusRect := True;
FHAlign := halCenter;
FVAlign := valCenter;
FModalResult := mrNone;
FStates := [];
FWordWrap := False;
end;
destructor TKButtonControl.Destroy;
begin
inherited;
end;
procedure TKButtonControl.AfterConstruction;
begin
inherited;
end;
procedure TKButtonControl.CMDialogChar(var Msg: TCMDialogChar);
begin
with Msg do
if IsAccel(CharCode, Caption) and CanFocus then
begin
Click;
Result := 1;
end else
inherited;
end;
procedure TKButtonControl.CMDialogKey(var Msg: TCMDialogKey);
begin
with Msg do
if (KeyDataToShiftState(KeyData) = []) and CanFocus and
{$IFDEF FPC}
(CharCode = VK_RETURN) and (cbsFocused in FStates)
{$ELSE}
(((CharCode = VK_RETURN) and (FDefault or (cbsFocused in FStates))) or
((CharCode = VK_ESCAPE) and FCancel))
{$ENDIF}
then
begin
Click;
Result := 1;
end else
inherited;
end;
procedure TKButtonControl.CMEnabledChanged(var Msg: TLMessage);
begin
inherited;
Invalidate;
end;
procedure TKButtonControl.CMFocusChanged(var Msg: TLMessage);
begin
inherited;
Exclude(FStates, cbsLostFocus);
end;
procedure TKButtonControl.CMMouseEnter(var Msg: TLMessage);
begin
inherited;
if Enabled then
Include(FStates, cbsHot);
Invalidate;
end;
procedure TKButtonControl.CMMouseLeave(var Msg: TLMessage);
begin
inherited;
if Enabled then
Exclude(FStates, cbsHot);
Invalidate;
end;
procedure TKButtonControl.CMTextChanged(var Msg: TLMessage);
begin
inherited;
Invalidate;
end;
procedure TKButtonControl.DrawCaption(ACanvas: TCanvas; const ARect: TRect);
var
TB: TKTextBox;
begin
TB := TKTextBox.Create;
try
ACanvas.Font := Font;
if not (Enabled or Skinned) then
ACanvas.Font.Color := clGrayText;
TB.HAlign := FHAlign;
TB.VAlign := FVAlign;
TB.Attributes := [taTrimWhiteSpaces];
if FWordWrap then
TB.Attributes := TB.Attributes + [taWordBreak];
TB.Text := Caption;
TB.Draw(ACanvas, ARect);
finally
TB.Free;
end;
end;
procedure TKButtonControl.DrawFocusRect(ACanvas: TCanvas; ARect: TRect);
begin
if cbsFocused in FStates then with ACanvas do
begin
InflateRect(ARect, -3, -3);
Pen.Color := clWindowFrame;
Brush.Color := clBtnFace;
SetBkColor(Handle, $FFFFFF);
SetTextColor(Handle, 0);
DrawFocusRect(ARect);
end;
end;
function TKButtonControl.GetDown: Boolean;
begin
Result := cbsPressed in FStates;
end;
function TKButtonControl.GetIsCheck: Boolean;
begin
Result := cbsCheck in FStates;
end;
function TKButtonControl.GetSkinned: Boolean;
begin
Result := False;
end;
procedure TKButtonControl.Invalidate;
begin
inherited;
end;
procedure TKButtonControl.KeyDown(var Key: Word; Shift: TShiftState);
begin
inherited;
if Key = VK_RETURN then Click;
end;
procedure TKButtonControl.Loaded;
begin
inherited;
end;
procedure TKButtonControl.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
inherited;
if Enabled and (Button = mbLeft) then
begin
SetFocus;
Invalidate;
if cbsPressed in FStates then
Include(FStates, cbsWasPressed);
FStates := FStates + [cbsMouseCapture, cbsPressed];
end;
end;
procedure TKButtonControl.MouseMove(Shift: TShiftState; X, Y: Integer);
var
P: TPoint;
begin
inherited;
if (cbsMouseCapture in FStates) then
begin
P := Point(X, Y);
if PtInRect(ClientRect, P) then
begin
if FStates * [cbsPressed, cbsCheck] = [] then
begin
Include(FStates, cbsPressed);
Invalidate;
end;
end else
if cbsPressed in FStates then
begin
Exclude(FStates, cbsPressed);
Invalidate;
end;
end;
end;
procedure TKButtonControl.MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
if cbsPressed in FStates then
begin
if not (cbsCheck in FStates) or (cbsWasPressed in FStates) then
Exclude(FStates, cbsPressed);
Invalidate;
end;
Exclude(FStates, cbsWasPressed);
Exclude(FStates, cbsMouseCapture);
inherited;
end;
procedure TKButtonControl.PaintToCanvas(ACanvas: TCanvas);
var
Ofs: Integer;
R: TRect;
States: TKButtonDrawStates;
begin
R := ClientRect;
if cbsPressed in FStates then
Ofs := 1
else
Ofs := 0;
States := [];
if ThemeServices.ThemesEnabled then
Include(States, bsUseThemes);
if not Enabled then
Include(States, bsDisabled);
if cbsPressed in FStates then
Include(States, bsPressed);
if (cbsFocused in FStates) or Default then
Include(States, bsFocused);
if FStates * [cbsHot, cbsMouseCapture] <> [] then
Include(States, bsHot);
KGraphics.DrawButtonFrame(ACanvas, R, States);
KFunctions.OffsetRect(R, Ofs, Ofs);
DrawInterior(ACanvas, R);
KFunctions.OffsetRect(R, -Ofs, -Ofs);
if FFocusRect then
DrawFocusRect(ACanvas, R);
end;
procedure TKButtonControl.SetCancel(AValue: Boolean);
{$IFDEF FPC}
var
Form: TCustomForm;
{$ENDIF}
begin
if FCancel = AValue then Exit;
FCancel := AValue;
{$IFDEF FPC}
Form := GetParentForm(Self);
if Assigned(Form) then
begin
if AValue then
Form.CancelControl := Self
else
Form.CancelControl := nil;
end;
{$ENDIF}
end;
procedure TKButtonControl.SetDefault(AValue: Boolean);
{$IFDEF FPC}
var
Form: TCustomForm;
{$ENDIF}
begin
if FDefault = AValue then Exit;
FDefault := AValue;
{$IFDEF FPC}
Form := GetParentForm(Self);
if Assigned(Form) then
begin
if AValue then
begin
Form.DefaultControl := Self;
end else
begin
if Form.DefaultControl = Self then
Form.DefaultControl := nil;
end;
end;
{$ENDIF}
end;
procedure TKButtonControl.SetDown(const Value: Boolean);
begin
if IsCheck then
begin
if Value <> Down then
begin
if Value then
Include(FStates, cbsPressed)
else
Exclude(FStates, cbsPressed);
Invalidate;
end;
end;
end;
procedure TKButtonControl.SetFocusRect(const Value: Boolean);
begin
if Value <> FFocusRect then
begin
FFocusRect := Value;
Invalidate;
end;
end;
procedure TKButtonControl.SetHAlign(const Value: TKHAlign);
begin
if Value <> FHAlign then
begin
FHAlign := Value;
Invalidate;
end;
end;
procedure TKButtonControl.SetIsCheck(const Value: Boolean);
begin
if Value then
Include(FStates, cbsCheck)
else
Exclude(FStates, cbsCheck);
end;
procedure TKButtonControl.SetModalResult(AValue: TModalResult);
begin
if AValue = FModalResult then Exit;
FModalResult := AValue;
end;
procedure TKButtonControl.SetVAlign(const Value: TKVAlign);
begin
if Value <> FVAlign then
begin
FVAlign := Value;
Invalidate;
end;
end;
procedure TKButtonControl.SetWordWrap(const Value: Boolean);
begin
if Value <> FWordWrap then
begin
FWordWrap := Value;
Invalidate;
end;
end;
procedure TKButtonControl.UpdateSize;
begin
Invalidate;
end;
procedure TKButtonControl.WMKillFocus(var Msg: TLMKillFocus);
begin
inherited;
Exclude(FStates, cbsFocused);
Include(FStates, cbsLostFocus);
Invalidate;
end;
procedure TKButtonControl.WMSetFocus(var Msg: TLMSetFocus);
begin
inherited;
Include(FStates, cbsFocused);
Invalidate;
end;
procedure TKButtonControl.WndProc(var Msg: TLMessage);
begin
inherited;
end;
{ TKBitBtn }
constructor TKBitBtn.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FGlyph := TKAlphaBitmap.Create;
FGlyph.OnChange := GlyphChange;
FGlyphs := nil;
FGrayedGlyph := nil;
FKind := bkCustom;
FLayout := blGlyphLeft;
FMargin := 3;
FMaskGlyph := False;
FNumGlyphs := 1;
FSpacing := 4;
UpdateGlyphs;
end;
destructor TKBitBtn.Destroy;
begin
FNumGlyphs := 0;
UpdateGlyphs;
FGlyph.Free;
FGrayedGlyph.Free;
inherited;
end;
function TKBitBtn.GetGlyph: TKAlphaBitmap;
begin
Result := FGlyph;
end;
procedure TKBitBtn.GlyphChange(Sender: TObject);
begin
UpdateGlyphs;
Invalidate;
end;
function TKBitBtn.IsGlyphStored: Boolean;
begin
Result := (Kind = bkCustom) and not FGlyph.Empty and
(FGlyph.Width > 0) and (FGlyph.Height > 0);
end;
procedure TKBitBtn.DrawInterior(ACanvas: TCanvas; ARect: TRect);
var
InteriorRect, TextRect, ModRect: TRect;
GlyphPos, GlyphSize, TextSize, ModSize: TPoint;
TB: TKTextBox;
BM: TKAlphaBitmap;
begin
InteriorRect := ARect;
if FMargin > 0 then
InflateRect(InteriorRect, -FMargin, -FMargin);
if Length(FGlyphs) > 0 then
begin
GlyphSize.X := FGlyphs[cGlyphUp].Width;
GlyphSize.Y := FGlyphs[cGlyphUp].Height;
if (GlyphSize.X > 0) and (GlyphSize.Y > 0) then
begin
TB := TKTextBox.Create;
try
ACanvas.Font := Font;
if not Enabled then
ACanvas.Font.Color := clGrayText;
TB.HAlign := HAlign;
TB.VAlign := VAlign;
TB.Attributes := [taTrimWhiteSpaces];
if WordWrap then
TB.Attributes := TB.Attributes + [taWordBreak];
TB.Text := Caption;
TextRect := InteriorRect;
// first measure text extent
case FLayout of
blGlyphLeft: Inc(TextRect.Left, GlyphSize.X + FSpacing);
blGlyphRight: Dec(TextRect.Right, GlyphSize.X + FSpacing);
end;
TB.Measure(ACanvas, TextRect, TextSize.X, TextSize.Y);
if TextSize.X > TextRect.Right - TextRect.Left then
begin
// measure again to get correct height because text is wider than box
TextRect.Right := TextRect.Left + TextSize.X;
TB.Measure(ACanvas, TextRect, TextSize.X, TextSize.Y);
end;
// then compute glyph position and text rect
case FLayout of
blGlyphLeft, blGlyphRight:
begin
ModSize.X := GlyphSize.X + FSpacing + TextSize.X;
ModSize.Y := TextSize.Y;
end;
blGlyphTop, blGlyphBottom:
begin
ModSize.X := TextSize.X;
ModSize.Y := GlyphSize.Y + FSpacing + TextSize.Y;
end;
end;
ModRect.Left := HorizontalShapePosition(HAlign, InteriorRect, ModSize);
ModRect.Top := VerticalShapePosition(VAlign, InteriorRect, ModSize);
ModRect.Right := ModRect.Left + ModSize.X;
ModRect.Bottom := ModRect.Top + ModSize.Y;
TextRect := ModRect;
case FLayout of
blGlyphLeft:
begin
Inc(TextRect.Left, GlyphSize.X + FSpacing);
GlyphPos.X := ModRect.Left;
GlyphPos.Y := VerticalShapePosition(VAlign, ModRect, GlyphSize);
end;
blGlyphRight:
begin
Dec(TextRect.Right, GlyphSize.X + FSpacing);
GlyphPos.X := ModRect.Right - GlyphSize.X;
GlyphPos.Y := VerticalShapePosition(VAlign, ModRect, GlyphSize);
end;
blGlyphTop:
begin
Inc(TextRect.Top, GlyphSize.Y + FSpacing);
GlyphPos.X := HorizontalShapePosition(HAlign, ModRect, GlyphSize);
GlyphPos.Y := ModRect.Top;
end;
blGlyphBottom:
begin
Dec(TextRect.Bottom, GlyphSize.Y + FSpacing);
GlyphPos.X := HorizontalShapePosition(HAlign, ModRect, GlyphSize);
GlyphPos.Y := ModRect.Bottom - GlyphSize.Y;
end;
end;
if Enabled then
begin
if (cbsHot in FStates) and (Length(FGlyphs) >= 3) then
BM := FGlyphs[cGlyphClicked]
else if (cbsPressed in FStates) and (Length(FGlyphs) >= 4) then
BM := FGlyphs[cGlyphDown]
else
BM := FGlyphs[cGlyphUp]
end else
begin
if Skinned then
BM := FGlyphs[cGlyphUp]
else if Length(FGlyphs) >= 2 then
BM := FGlyphs[cGlyphDisabled]
else
BM := FGrayedGlyph;
end;
BM.AlphaDrawTo(ACanvas, GlyphPos.X, GlyphPos.Y);
TB.Draw(ACanvas, TextRect);
finally
TB.Free;
end;
end else
DrawCaption(ACanvas, ARect);
end else
DrawCaption(ACanvas, ARect);
end;
procedure TKBitBtn.SetGlyph(const Value: TKAlphaBitmap);
begin
FGlyph.Assign(Value);
end;
procedure TKBitBtn.SetKind(Value: TBitBtnKind);
{$IFnDEF FPC}
var
Bu: TBitBtn;
{$ENDIF}
begin
if Value <> FKind then
begin
FKind := Value;
if FKind <> bkCustom then
begin
// simply steal bitmaps either from Delphi or Lazarus :-)
{$IFDEF FPC}
FNumGlyphs := 1;
FMaskGlyph := False;
FGlyph.Assign(GetLCLDefaultBtnGlyph(FKind));
{$ELSE}
// Delphi is more complicated, we must steal directly from TBitBtn
Bu := TBitBtn.Create(nil);
try
Bu.Kind := FKind;
FNumGlyphs := 2;
FMaskGlyph := True;
FGlyph.Assign(Bu.Glyph);
finally
Bu.Free;
end;
{$ENDIF}
end else
begin
// reset corresponding properties
FNumGlyphs := 1;
FMaskGlyph := False;
end;
end;
end;
procedure TKBitBtn.SetLayout(Value: TButtonLayout);
begin
if Value <> FLayout then
begin
FLayout := Value;
Invalidate;
end;
end;
procedure TKBitBtn.SetMargin(Value: Integer);
begin
if Value <> FMargin then
begin
FMargin := Value;
Invalidate;
end;
end;
procedure TKBitBtn.SetMaskGlyph(const Value: Boolean);
begin
if FMaskGlyph <> Value then
begin
FMaskGlyph := Value;
UpdateGlyphs;
Invalidate;
end;
end;
procedure TKBitBtn.SetNumGlyphs(Value: Integer);
begin
Value := MinMax(Value, 1, 4);
if Value <> FNumGlyphs then
begin
FNumGlyphs := Value;
UpdateGlyphs;
Invalidate;
end;
end;
procedure TKBitBtn.SetSpacing(Value: Integer);
begin
if Value <> FSpacing then
begin
FSpacing := Value;
Invalidate;
end;
end;
procedure TKBitBtn.UpdateGlyphs;
var
I, GlyphWidth: Integer;
begin
if Length(FGlyphs) <> FNumGlyphs then
begin
for I := 0 to Length(FGlyphs) - 1 do
FreeAndNil(FGlyphs[I]);
SetLength(FGlyphs, FNumGlyphs);
for I := 0 to Length(FGlyphs) - 1 do
FGlyphs[I] := TKAlphaBitmap.Create;
end;
if Length(FGlyphs) > 0 then
begin
GlyphWidth := FGlyph.Width div Length(FGlyphs);
for I := 0 to Length(FGlyphs) - 1 do
begin
FGlyphs[I].SetSize(GlyphWidth, FGlyph.Height);
if not FGlyph.Empty then
FGlyphs[I].CopyFromXY(-I * GlyphWidth, 0, FGlyph);
end;
if Length(FGlyphs) = 1 then
begin
// create disabled icon as grayscale of the first icon
if FGrayedGlyph = nil then
FGrayedGlyph := TKAlphaBitmap.Create;
FGrayedGlyph.Assign(FGlyphs[cGlyphUp]);
FGrayedGlyph.GrayScale;
end else
begin
FreeAndNil(FGrayedGlyph);
if FMaskGlyph then
begin
// if source for Glyph was transparent bitmap
// (old Delphi approach with bottom-leftmost pixel) then unmask it
for I := 0 to Length(FGlyphs) - 1 do
FGlyphs[I].AlphaFillOnColorMatch(
ColorRecToColor(FGlyphs[I].Pixel[0, FGlyphs[I].Height - 1]), 0);
end;
end;
end;
end;
{ TKColorButton }
constructor TKColorButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FDlgColor := clRed;
FColorDlgOptions := [];
end;
procedure TKColorButton.Click;
var
Dlg: TColorDialog;
begin
Exclude(FStates, cbsPressed);
Dlg := TColorDialog.Create(Self);
try
Dlg.Color := FDlgColor;
{$IFnDEF FPC}
Dlg.Options := FColorDlgOptions;
{$ENDIF}
if Dlg.Execute then
begin
FDlgColor := Dlg.Color;
Invalidate;
end;
finally
Dlg.Free;
end;
inherited Click;
end;
procedure TKColorButton.DrawInterior(ACanvas: TCanvas; ARect: TRect);
var
C: TKColorRec;
ExOfs: Integer;
begin
with ACanvas do
begin
ExOfs := 0;
C := ColorToColorRec(FDlgColor);
if (C.R < 128) and (C.G < 128) and (C.B < 128) then
Pen.Color := clWhite
else
Pen.Color := clBlack;
Brush.Color := FDlgColor;
InflateRect(ARect, -10 + ExOfs, -6 + ExOfs);
Rectangle(ARect);
if not Enabled then
begin
MoveTo(ARect.Left, ARect.Top);
LineTo(ARect.Right, ARect.Bottom - 1);
MoveTo(ARect.Right - 1, ARect.Top);
LineTo(ARect.Left, ARect.Bottom - 1);
end;
end;
end;
procedure TKColorButton.SetDlgColor(Value: TColor);
begin
if Value <> FDlgColor then
begin
FDlgColor := Value;
Invalidate;
end;
end;
{ TKSpeedButton }
constructor TKSpeedButton.Create(AOwner: TComponent);
begin
inherited;
Width := Height;
FGlyph := TKAlphaBitmap.Create;
FGlyph.OnChange := GlyphChange;
FImages := nil;
FImageIndex := -1;
end;
destructor TKSpeedButton.Destroy;
begin
FGlyph.Free;
inherited;
end;
function TKSpeedButton.GetGlyph: TKAlphaBitmap;
begin
Result := FGlyph;
end;
procedure TKSpeedButton.GlyphChange(Sender: TObject);
begin
Invalidate;
end;
procedure TKSpeedButton.DrawInterior(ACanvas: TCanvas; ARect: TRect);
begin
if (FImages <> nil) and (FImageIndex >= 0) and (FImageIndex < FImages.Count) then
begin
FImages.Draw(ACanvas,
ARect.Left + (ARect.Right - ARect.Left - FImages.Width) div 2,
ARect.Top + (ARect.Bottom - ARect.Top - FImages.Height) div 2,
FImageIndex, Enabled);
end else
FGlyph.AlphaDrawTo(ACanvas,
ARect.Left + (ARect.Right - ARect.Left - FGlyph.Width) div 2,
ARect.Top + (ARect.Bottom - ARect.Top - FGlyph.Height) div 2);
end;
function TKSpeedButton.IsGlyphStored: Boolean;
begin
Result := not FGlyph.Empty and
(FGlyph.Width > 0) and (FGlyph.Height > 0);
end;
procedure TKSpeedButton.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited;
if (Operation = opRemove) and (AComponent = Images) then
Images := nil;
end;
procedure TKSpeedButton.SetGlyph(const Value: TKAlphaBitmap);
begin
FGlyph.Assign(Value);
end;
procedure TKSpeedButton.SetImageIndex(Value: TImageIndex);
begin
if Value <> FImageIndex then
begin
FImageIndex := Value;
Invalidate;
end;
end;
procedure TKSpeedButton.SetImages(const Value: TCustomImageList);
begin
if Value <> FImages then
begin
FImages := Value;
Invalidate;
end;
end;
end.
| 25.659069 | 132 | 0.693253 |
f1b016625ce24f365a0fe0bbeab37f70d69de9cb | 15,837 | pas | Pascal | windows/src/global/delphi/general/RegKeyboards.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| null | null | null | windows/src/global/delphi/general/RegKeyboards.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| null | null | null | windows/src/global/delphi/general/RegKeyboards.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| null | null | null | (*
Name: RegKeyboards
Copyright: Copyright (C) SIL International.
Documentation:
Description:
Create Date: 14 Sep 2006
Modified Date: 28 May 2014
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 14 Sep 2006 - mcdurdin - Add Icon property, remove Bitmap property
04 Dec 2006 - mcdurdin - Add menmonic layout
12 Dec 2006 - mcdurdin - Fix keyboard not activating when installed with a language
15 Jan 2007 - mcdurdin - Load 16x16 kbd_noicon instead of 32x32
12 Oct 2007 - mcdurdin - I1105 - Handle invalid keyboard file, just mark keyboard as corrupt or missing
27 Mar 2008 - mcdurdin - I1374 - Add support for font helper
27 Mar 2008 - mcdurdin - I1358 - Add multiple language information
27 Mar 2008 - mcdurdin - I1345 - Get User Default Keyboard instead of default language keyboard
14 Jun 2008 - mcdurdin - Remove DefaultLanguageID, add KeyboardLanguageID
14 Jun 2008 - mcdurdin - I1400 - Move language info to the system config item check
16 Jan 2009 - mcdurdin - I1675 - Fix crash when KMX file is corrupt
26 Jul 2010 - mcdurdin - I2467 - 8.0 renumber
03 May 2011 - mcdurdin - I2890 - Record diagnostic data when encountering registry errors
18 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support
17 Aug 2012 - mcdurdin - I3377 - KM9 - Update code references from 8.0 to 9.0
20 Nov 2012 - mcdurdin - I3581 - V9.0 - KMTip needs to pass activated profile guid through to Keyman32 to switch keyboards
28 Nov 2012 - mcdurdin - I3599 - V9.0 - Refactor GetKeyboardIconFileName
01 Dec 2012 - mcdurdin - I3613 - V9.0 - System shadow keyboards obsolete, strip out remaining code
19 Mar 2014 - mcdurdin - I4136 - V9.0 - Add keyboard version information to Keyman Configuration
28 May 2014 - mcdurdin - I4220 - V9.0 - Remove references to LoadKeyboardLayout, Preload, Substitutes, etc. and use only TSF
*)
unit RegKeyboards; // I3306
interface
uses
Classes,
Graphics,
Contnrs,
kmxfile,
kmxfileconsts,
kmxfileusedscripts,
kmxfileutils,
Unicode,
UnicodeBlocks,
utilkeyman,
SysUtils,
HotkeyUtils;
{$R kbd_noicon.res}
{$R-}
type
TRegKeyboard = class
private
{ Installed Keyboards settings }
FDefaultHotkey: Integer;
FKeymanFile: string;
Legacy_FKeyboardID: Integer; // I3613
FPackageName: string;
FPackageDescription: string;
{ Active Keyboards settings }
FEnabled: Boolean;
FKeymanID: Integer;
FName: string;
{ Properties from the keyboard files }
FKeyboardName: WideString;
FEncodings: TKIEncodings;
FIsRegistered: Boolean;
FVisualKeyboardInstalled: Boolean;
FCopyright: WideString;
FMessage: WideString;
FVisualKeyboardFileName: string;
FProductID: Integer;
FIcon: TIcon;
FMnemonicLayout: Boolean;
//FNewlyInstalled: Boolean;
FWindowsLanguages: WideString;
FKeyboardLanguageID: Cardinal;
FIconFileName: string; // I3581
FKeyboardVersion: string;
FISO6393Languages: WideString; // I4136
FCanEnable: Boolean;
// procedure InstallLanguage;
public
constructor Create(const AName: string);
destructor Destroy; override;
procedure ApplySettings(src: TRegKeyboard);
procedure Load(FLoadKeyboard: Boolean);
procedure Save;
function GetUsedChars: WideString;
function GetUsedScripts: TUnicodeBlockDataArray;
property Name: string read FName;
{ Installed Keyboards settings }
property DefaultHotkey: Integer read FDefaultHotkey;
property KeymanFile: string read FKeymanFile;
property Legacy_KeyboardID: Integer read Legacy_FKeyboardID; // I3613
property PackageName: string read FPackageName;
property PackageDescription: string read FPackageDescription;
property VisualKeyboardInstalled: Boolean read FVisualKeyboardInstalled;
property VisualKeyboardFileName: string read FVisualKeyboardFileName;
property IconFileName: string read FIconFileName; // I3581
{ Active Keyboards settings }
property KeymanID: Integer read FKeymanID;
{ Properties from keyboard }
property KeyboardName: WideString read FKeyboardName;
property Encodings: TKIEncodings read FEncodings;
property IsRegistered: Boolean read FIsRegistered;
property Copyright: WideString read FCopyright;
property Message: WideString read FMessage;
property Icon: TIcon read FIcon;
property ProductID: Integer read FProductID;
property MnemonicLayout: Boolean read FMnemonicLayout;
property WindowsLanguages: WideString read FWindowsLanguages;
property ISO6393Languages: WideString read FISO6393Languages;
property KeyboardLanguageID: Cardinal read FKeyboardLanguageID;
property KeyboardVersion: string read FKeyboardVersion; // I4136
property CanEnable: Boolean read FCanEnable;
{ Modifiable settings -- Active Keyboards }
property Enabled: Boolean read FEnabled write FEnabled;
end;
TRegKeyboardList = class(TObjectList)
protected
function Get(Index: Integer): TRegKeyboard;
procedure Put(Index: Integer; Item: TRegKeyboard);
public
procedure ApplySettings(src: TRegKeyboardList);
procedure Sort;
function IndexOfName(const Name: string): Integer;
procedure Load(FLoadKeyboards: Boolean);
procedure Save; // Updates Enabled only
property Items[Index: Integer]: TRegKeyboard read Get write Put; default;
function Add(Item: TRegKeyboard): Integer;
end;
implementation
uses
GetOSVersion,
Glossary,
isadmin,
KLog,
kmxfileusedchars,
OnlineConstants,
ErrorControlledRegistry,
RegistryKeys,
utilolepicture,
Windows;
{-------------------------------------------------------------------------------
- TRegKeyboardList -
------------------------------------------------------------------------------}
procedure RemoveActiveKeyboard(FName: string);
begin
{ Find whether Keyman installed a language with the keyboard } // I4220
with TRegistryErrorControlled.Create do // I2890
try
{ Remove all Active Keyboards details of the keyboard }
DeleteKey(SRegKey_ActiveKeyboards_CU + '\' + FName);
finally
Free;
end;
end;
function TRegKeyboardList.Add(Item: TRegKeyboard): Integer; begin Result := inherited Add(Item); end;
function TRegKeyboardList.Get(Index: Integer): TRegKeyboard; begin Result := TRegKeyboard(inherited Get(Index)); end;
procedure TRegKeyboardList.Put(Index: Integer; Item: TRegKeyboard); begin inherited Put(Index, Item); end;
procedure TRegKeyboardList.Load(FLoadKeyboards: Boolean);
var
str: TStringList;
rk: TRegKeyboard;
i: Integer;
begin
str := TStringList.Create;
with TRegistryErrorControlled.Create do // I2890
try
{ Load all installed keyboards }
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly(SRegKey_InstalledKeyboards_LM) then
begin
GetKeyNames(str);
for i := 0 to str.Count - 1 do
begin
rk := TRegKeyboard.Create(str[i]);
rk.Load(FLoadKeyboards);
Add(rk);
end;
CloseKey;
end;
RootKey := HKEY_CURRENT_USER;
{ Find all "Active Keyboards" that have been uninstalled }
if OpenKeyReadOnly('\'+SRegKey_ActiveKeyboards_CU) then
begin
GetKeyNames(str);
for i := 0 to str.Count - 1 do
if IndexOfName(str[i]) < 0 then
RemoveActiveKeyboard(str[i]);
end;
Sort; // Order by name
finally
str.Free;
Free;
end;
end;
procedure TRegKeyboardList.Save;
var
i, n: Integer;
str: TStringList;
begin
{ Renumber KeymanIDs for all keyboards before saving }
n := 0;
for i := 0 to Count - 1 do
begin
if Items[i].Enabled then
begin
Items[i].FKeymanID := n;
Inc(n);
end
else
Items[i].FKeymanID := -1;
end;
{ Save all KeymanIDs }
for i := 0 to Count - 1 do
Items[i].Save;
{ Rewrite the KeymanIDs in HKCU\Software\...\Keyman\5.0\Active Keyboards }
str := TStringList.Create;
with TRegistryErrorControlled.Create do // I2890
try
RootKey := HKEY_CURRENT_USER;
if OpenKey(SRegKey_ActiveKeyboards_CU, True) then
begin
GetValueNames(str);
for i := 0 to str.Count - 1 do DeleteValue(str[i]);
for i := 0 to Count - 1 do
if Items[i].Enabled then
WriteString(IntToStr(Items[i].KeymanID), Items[i].Name);
end;
finally
Free;
str.Free;
end;
end;
function TRegKeyboardList.IndexOfName(const Name: string): Integer;
var
i: Integer;
begin
for i := 0 to Count - 1 do
if LowerCase(Items[i].Name) = LowerCase(Name) then
begin
Result := i;
Exit;
end;
Result := -1;
end;
function SortRegKeyboardList(Item1, Item2: Pointer): Integer;
var
rk1, rk2: TRegKeyboard;
begin
rk1 := TRegKeyboard(Item1);
rk2 := TRegKeyboard(Item2);
if LowerCase(rk1.Name) < LowerCase(rk2.Name) then Result := -1
else if LowerCase(rk1.Name) > LowerCase(rk2.Name) then Result := 1
else Result := 0;
end;
procedure TRegKeyboardList.Sort;
begin
inherited Sort(SortRegKeyboardList);
end;
{-------------------------------------------------------------------------------
- TRegKeyboard -
------------------------------------------------------------------------------}
constructor TRegKeyboard.Create(const AName: string);
begin
FName := AName;
end;
procedure TRegKeyboard.Load(FLoadKeyboard: Boolean);
var
ki: TKeyboardInfo;
begin
FCanEnable := True;
FDefaultHotkey := 0;
FKeymanFile := '';
Legacy_FKeyboardID := 0; // I3613
FPackageName := '';
FPackageDescription := '';
FKeymanID := -1;
FEnabled := False;
FKeyboardName := '';
FEncodings := [];
FIsRegistered := False;
FVisualKeyboardInstalled := False;
FMessage := '';
FCopyright := '';
FKeyboardVersion := ''; // I4136
FProductID := OnlineProductID_KeymanDesktop_100; // I3377
with TRegistryErrorControlled.Create do // I2890
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly(GetRegistryKeyboardInstallKey_LM(FName)) then
begin
FKeymanFile := ReadString(SRegValue_KeymanFile);
Legacy_FKeyboardID := StrToIntDef('$'+ReadString(SRegValue_Legacy_KeymanKeyboardID), 0); // I3613
FPackageName := ReadString(SRegValue_PackageName);
FVisualKeyboardInstalled := ValueExists(SRegValue_VisualKeyboard);
if FVisualKeyboardInstalled
then FVisualKeyboardFileName := ReadString(SRegValue_VisualKeyboard)
else FVisualKeyboardFileName := '';
if FPackageName <> '' then
with TRegistryErrorControlled.Create do // I2890
try
RootKey := HKEY_LOCAL_MACHINE;
if OpenKeyReadOnly(GetRegistryPackageInstallKey_LM(FPackageName)) and ValueExists(SRegValue_PackageDescription)
then FPackageDescription := ReadString(SRegValue_PackageDescription)
else FPackageDescription := FPackageName;
finally
Free;
end;
CloseKey;
end;
RootKey := HKEY_CURRENT_USER;
if OpenKeyReadOnly(GetRegistryKeyboardActiveKey_CU(FName)) then
begin
{ Currently installed keyboard }
if ValueExists(SRegValue_KeymanID) then
begin
FKeymanID := StrToIntDef(ReadString(SRegValue_KeymanID), -1);
FEnabled := FKeymanID >= 0;
end;
end
else
begin
{ Newly installed keyboard -- perform installation into end-user settings }
FEnabled := True;
end;
finally
Free;
end;
FIconFileName := GetKeyboardIconFileName(FKeymanFile); // I3581 // I3599
if not FileExists(FIconFileName, False) then
FIconFileName := '';
if FLoadKeyboard then
try
try
GetKeyboardInfo(FKeymanFile, False, ki, True);
except
on E:EFileStreamError do
begin
{ I1105 - Fix crash when keyboard file is invalid - just mark keyboard as in list but not loaded }
FEnabled := False;
FCanEnable := False;
FKeyboardName := GetShortKeyboardName(FName);
FIsRegistered := True;
FMessage := 'This keyboard could not be loaded. It may be corrupt or missing: '+E.Message;
FIcon := nil;
Exit;
end;
on E:EKMXError do
begin
{ I1675 - Fix crash when KMX file is corrupt - mark keyboard as in list but not loaded }
FEnabled := False;
FCanEnable := False;
FKeyboardName := GetShortKeyboardName(FName);
FIsRegistered := True;
FMessage := 'This keyboard could not be loaded. It may be corrupt or missing: '+E.Message;
FIcon := nil;
Exit;
end;
end;
FKeyboardName := ki.KeyboardName;
FEncodings := ki.Encodings;
FIsRegistered := ki.IsRegistered;
FMessage := ki.MessageString;
FCopyright := ki.CopyrightString;
FWindowsLanguages := ki.WindowsLanguages;
FISO6393Languages := ki.ISO6393Languages;
FKeyboardLanguageID := ki.KeyboardID;
FDefaultHotkey := ki.DefaultHotkey;
FKeyboardVersion := ki.KeyboardVersion; // I4136
if ki.Icon <> nil then
begin
FIcon := ki.Icon;
end
else if ki.Bitmap <> nil then
begin
FIcon := TIcon.Create;
LoadIconFromBitmap(FIcon, ki.Bitmap);
FreeAndNil(ki.Bitmap);
end
else
begin
FIcon := TIcon.Create;
FIcon.Handle := LoadImage(HInstance, 'kbd_noicon', IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
//FIcon.LoadFromResourceName(HInstance, 'kbd_noicon');
end;
FProductID := ki.ProductID;
FMnemonicLayout := ki.MnemonicLayout;
except
on E:Exception do
KL.LogError(E.Message);
// swallow exceptions here
end;
KL.Log('TRegKeyboard.Load: '+FKeyboardName);
end;
procedure TRegKeyboard.Save;
begin
with TRegistryErrorControlled.Create do // I2890
try
RootKey := HKEY_CURRENT_USER;
if OpenKey(GetRegistryKeyboardActiveKey_CU(FName), True) then
begin
if FKeymanID >= 0 then
WriteString(SRegValue_KeymanID, IntToStr(FKeymanID))
else if ValueExists(SRegValue_KeymanID) then
DeleteValue(SRegValue_KeymanID);
CloseKey;
end;
finally
Free;
end;
end;
procedure TRegKeyboardList.ApplySettings(src: TRegKeyboardList);
var
i, n: Integer;
begin
for i := 0 to src.Count - 1 do
begin
n := IndexOfName(src[i].Name);
if n >= 0 then Items[n].ApplySettings(src[i]);
end;
end;
procedure TRegKeyboard.ApplySettings(src: TRegKeyboard);
begin
Enabled := src.Enabled;
end;
destructor TRegKeyboard.Destroy;
begin
FreeAndNil(FIcon);
inherited Destroy;
end;
function GetSystemStore(Memory: PChar; SystemID: DWord; var Buffer: WideString): Boolean;
var
pch: PChar;
kfs: PKeyboardFileStore;
kfh: PKeyboardFileHeader;
i: Integer;
begin
kfh := PKeyboardFileHeader(Memory);
pch := Memory;
Inc(pch, kfh.dpStoreArray);
for i := 0 to kfh.cxStoreArray - 1 do
begin
kfs := PKeyboardFileStore(pch);
if kfs.dwSystemID = SystemID then
begin
pch := PChar(Memory);
Inc(pch, kfs.dpString);
Buffer := PWideChar(pch);
Result := True;
Exit;
end;
Inc(pch, SizeOf(TKeyboardFileStore));
end;
Buffer := '';
Result := False;
end;
function TRegKeyboard.GetUsedChars: WideString;
begin
Result := KMXFile_GetUsedChars(FKeymanFile);
end;
function TRegKeyboard.GetUsedScripts: TUnicodeBlockDataArray;
begin
Result := KMXFile_GetUsedScripts(FKeymanFile);
end;
{$R+}
end.
| 29.824859 | 144 | 0.662183 |
fc142b72355bb45605e85eabf917b58d197a7018 | 2,301 | pas | Pascal | Source/Services/SimpleEmailV2/Base/Transform/AWS.SESv2.Transform.KinesisFirehoseDestinationUnmarshaller.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 67 | 2021-07-28T23:47:09.000Z | 2022-03-15T11:48:35.000Z | Source/Services/SimpleEmailV2/Base/Transform/AWS.SESv2.Transform.KinesisFirehoseDestinationUnmarshaller.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 5 | 2021-09-01T09:31:16.000Z | 2022-03-16T18:19:21.000Z | Source/Services/SimpleEmailV2/Base/Transform/AWS.SESv2.Transform.KinesisFirehoseDestinationUnmarshaller.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 13 | 2021-07-29T02:41:16.000Z | 2022-03-16T10:22:38.000Z | unit AWS.SESv2.Transform.KinesisFirehoseDestinationUnmarshaller;
interface
uses
AWS.SESv2.Model.KinesisFirehoseDestination,
AWS.Transform.JsonUnmarshallerContext,
AWS.Transform.ResponseUnmarshaller,
AWS.Internal.Request,
AWS.Transform.SimpleTypeUnmarshaller;
type
IKinesisFirehoseDestinationUnmarshaller = IUnmarshaller<TKinesisFirehoseDestination, TJsonUnmarshallerContext>;
TKinesisFirehoseDestinationUnmarshaller = class(TInterfacedObject, IUnmarshaller<TKinesisFirehoseDestination, TJsonUnmarshallerContext>)
strict private
class var FJsonInstance: IKinesisFirehoseDestinationUnmarshaller;
class constructor Create;
public
function Unmarshall(AContext: TJsonUnmarshallerContext): TKinesisFirehoseDestination;
class function JsonInstance: IKinesisFirehoseDestinationUnmarshaller; static;
end;
implementation
{ TKinesisFirehoseDestinationUnmarshaller }
function TKinesisFirehoseDestinationUnmarshaller.Unmarshall(AContext: TJsonUnmarshallerContext): TKinesisFirehoseDestination;
var
TargetDepth: Integer;
UnmarshalledObject: TKinesisFirehoseDestination;
begin
UnmarshalledObject := TKinesisFirehoseDestination.Create;
try
AContext.Read;
if AContext.CurrentTokenType = TJsonToken.Null then
Exit(nil);
TargetDepth := AContext.CurrentDepth;
while AContext.ReadAtDepth(TargetDepth) do
begin
if AContext.TestExpression('DeliveryStreamArn', TargetDepth) then
begin
var Unmarshaller := TStringUnmarshaller.JsonInstance;
UnmarshalledObject.DeliveryStreamArn := Unmarshaller.Unmarshall(AContext);
Continue;
end;
if AContext.TestExpression('IamRoleArn', TargetDepth) then
begin
var Unmarshaller := TStringUnmarshaller.JsonInstance;
UnmarshalledObject.IamRoleArn := Unmarshaller.Unmarshall(AContext);
Continue;
end;
end;
Result := UnmarshalledObject;
UnmarshalledObject := nil;
finally
UnmarshalledObject.Free;
end;
end;
class constructor TKinesisFirehoseDestinationUnmarshaller.Create;
begin
FJsonInstance := TKinesisFirehoseDestinationUnmarshaller.Create;
end;
class function TKinesisFirehoseDestinationUnmarshaller.JsonInstance: IKinesisFirehoseDestinationUnmarshaller;
begin
Result := FJsonInstance;
end;
end.
| 31.958333 | 138 | 0.798783 |
8591b41bec22fe4fadf9eb0997f53303665740f6 | 370 | dpr | Pascal | Demos/FMX/Android/PyPIPackages/PyPIPackages.dpr | shineworld/python4delphi | 7bba18fbf9201a7b378b38e56becfc2884f5c7e0 | [
"MIT"
]
| 29 | 2020-10-13T13:02:08.000Z | 2022-03-08T20:56:25.000Z | Demos/FMX/Android/PyPIPackages/PyPIPackages.dpr | shineworld/python4delphi | 7bba18fbf9201a7b378b38e56becfc2884f5c7e0 | [
"MIT"
]
| 5 | 2021-11-23T17:53:09.000Z | 2022-03-26T15:18:18.000Z | Demos/FMX/Android/PyPIPackages/PyPIPackages.dpr | shineworld/python4delphi | 7bba18fbf9201a7b378b38e56becfc2884f5c7e0 | [
"MIT"
]
| 12 | 2021-03-09T08:44:16.000Z | 2022-03-09T07:03:43.000Z | program PyPIPackages;
uses
System.StartUpCopy,
FMX.Forms,
MainForm in 'MainForm.pas' {PyMainForm},
PythonLoad in 'PythonLoad.pas',
ProgressFrame in 'ProgressFrame.pas' {ProgressViewFrame: TFrame},
AppEnvironment in 'AppEnvironment.pas';
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TPyMainForm, PyMainForm);
Application.Run;
end.
| 20.555556 | 67 | 0.756757 |
47365ce1172dff567ecd448dbaa51228e2f7abdf | 443 | pas | Pascal | Source/Samples/BoldCheckListBox/BoldCheckListBox.pas | LenakeTech/BoldForDelphi | 3ef25517d5c92ebccc097c6bc2f2af62fc506c71 | [
"MIT"
]
| 121 | 2020-09-22T10:46:20.000Z | 2021-11-17T12:33:35.000Z | Source/Samples/BoldCheckListBox/BoldCheckListBox.pas | LenakeTech/BoldForDelphi | 3ef25517d5c92ebccc097c6bc2f2af62fc506c71 | [
"MIT"
]
| 8 | 2020-09-23T12:32:23.000Z | 2021-07-28T07:01:26.000Z | Source/Samples/BoldCheckListBox/BoldCheckListBox.pas | LenakeTech/BoldForDelphi | 3ef25517d5c92ebccc097c6bc2f2af62fc506c71 | [
"MIT"
]
| 42 | 2020-09-22T14:37:20.000Z | 2021-10-04T10:24:12.000Z | unit BoldCheckListBox;
interface
uses
BoldCustomCheckListBox;
type
{forward declarations}
TBoldCheckListBox = class;
{ TBoldCheckListBox }
TBoldCheckListBox = class(TBoldCustomCheckListBox)
published
property BoldListProperties;
property BoldListHandle;
property BoldRowStringProperties;
property BoldRowCheckBoxProperties;
property Alignment;
property BoldHandleIndexLock;
end;
implementation
end.
| 17.038462 | 52 | 0.783296 |
47fe639131e5c81ef7ac64e793ec63ddf545d505 | 107,622 | dfm | Pascal | View/TelaSobre.dfm | marcoazevedo01/SystemWorks | ef853db1675e9f49c3a61e014cf16fbd9b55a1f5 | [
"MIT"
]
| null | null | null | View/TelaSobre.dfm | marcoazevedo01/SystemWorks | ef853db1675e9f49c3a61e014cf16fbd9b55a1f5 | [
"MIT"
]
| null | null | null | View/TelaSobre.dfm | marcoazevedo01/SystemWorks | ef853db1675e9f49c3a61e014cf16fbd9b55a1f5 | [
"MIT"
]
| null | null | null | object fmTelaSobre: TfmTelaSobre
Left = 0
Top = 0
BorderIcons = [biSystemMenu]
Caption = 'Sobre o Sistema'
ClientHeight = 512
ClientWidth = 616
Color = clInactiveBorder
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDesktopCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Image1: TImage
Left = 104
Top = 59
Width = 401
Height = 382
Picture.Data = {
0954506E67496D61676589504E470D0A1A0A0000000D49484452000001900000
017C0806000000E139ED3500000A376943435073524742204945433631393636
2D322E310000789C9D96775453D91687CFBD37BD5092108A94D06B685202480D
BD48912E2A3109104AC090002236445470445191A6083228E080A34391B1228A
850151B1EB041944D47170141B964964AD19DFBC79EFCD9BDF1FF77E6B9FBDCF
DD67EF7DD6BA0090FC8305C24C5809800CA15814E1E7C5888D8B676007010CF0
00036C00E070B3B34216F8460299027CD88C6C9913F817BDBA0E20F9FB2AD33F
8CC100FF9F94B95922310050988CE7F2F8D95C1917C9383D579C25B74FC998B6
344DCE304ACE22598232569373F22C5B7CF699650F39F332843C19CB73CEE265
F0E4DC27E38D3912BE8C91601917E708F8B932BE26638374498640C66FE4B119
7C4E36002892DC2EE67353646C2D63922832822DE37900E048C95FF0D22F58CC
CF13CB0FC5CECC5A2E1224A78819265C53868D93138BE1CFCF4DE78BC5CC300E
378D23E231D89919591CE1720066CFFC5914796D19B2223BD8383938306D2D6D
BE28D47F5DFC9B92F776965E847FEE19441FF8C3F6577E990D00B0A665B5D9FA
876D6915005DEB0150BBFD87CD602F008AB2BE750E7D711EBA7C5E52C4E22C67
2BABDCDC5C4B019F6B292FE8EFFA9F0E7F435F7CCF52BEDDEFE56178F3933892
7431435E376E667AA644C4C8CEE270F90CE69F87F81F07FE751E1611FC24BE88
2F944544CBA64C204C96B55BC813880599428640F89F9AF80FC3FEA4D9B99689
DAF811D0965802A5211A407E1E00282A1120097B642BD0EF7D0BC64703F9CD8B
D199989DFBCF82FE7D57B84CFEC816247F8E63474432B81251CEEC9AFC5A0234
2000454003EA401BE80313C004B6C011B8000FE0030241288804716031E08214
90014420171480B5A0189482AD6027A80675A0113483367018748163E0343807
2E81CB6004DC0152300E9E8029F00ACC40108485C810155287742043C81CB285
58901BE403054311501C940825434248021540EBA052A81CAA86EAA166E85BE8
28741ABA000D43B7A0516812FA157A07233009A6C15AB0116C05B3604F38088E
8417C1C9F032381F2E82B7C09570037C10EE844FC397E011580A3F81A7118010
113AA28B301116C24642917824091121AB9012A4026940DA901EA41FB98A4891
A7C85B1406454531504C940BCA1F1585E2A296A156A136A3AA5107509DA83ED4
55D4286A0AF5114D466BA2CDD1CEE800742C3A199D8B2E4657A09BD01DE8B3E8
11F438FA150683A1638C318E187F4C1C2615B302B319B31BD38E398519C68C61
A6B158AC3AD61CEB8A0DC572B0626C31B60A7B107B127B053B8E7D8323E27470
B6385F5C3C4E882BC455E05A702770577013B819BC12DE10EF8C0FC5F3F0CBF1
65F8467C0F7E083F8E9F2128138C09AE8448422A612DA192D046384BB84B7841
2412F5884EC470A280B88658493C443C4F1C25BE255148662436298124216D21
ED279D22DD22BD2093C946640F723C594CDE426E269F21DF27BF51A02A582A04
28F014562BD428742A5C5178A688573454F4545CAC98AF58A178447148F1A912
5EC94889ADC4515AA554A37454E986D2B43255D9463954394379B3728BF205E5
47142CC588E243E1518A28FB286728635484AA4F6553B9D475D446EA59EA380D
4333A605D05269A5B46F6883B429158A8A9D4AB44A9E4A8DCA7115291DA11BD1
03E8E9F432FA61FA75FA3B552D554F55BEEA26D536D52BAAAFD5E6A879A8F1D5
4AD4DAD546D4DEA933D47DD4D3D4B7A977A9DFD340699869846BE46AECD138AB
F1740E6D8ECB1CEE9C923987E7DCD68435CD3423345768EED31CD09CD6D2D6F2
D3CAD2AAD23AA3F5549BAEEDA19DAABD43FB84F6A40E55C74D47A0B343E7A4CE
63860AC39391CEA864F431A6743575FD7525BAF5BA83BA337AC67A517A857AED
7AF7F409FA2CFD24FD1DFABDFA53063A0621060506AD06B70DF1862CC314C35D
86FD86AF8D8C8D628C361875193D3256330E30CE376E35BE6B423671375966D2
6072CD1463CA324D33DD6D7AD90C36B3374B31AB311B3287CD1DCC05E6BBCD87
2DD0164E16428B068B1B4C12D39399C36C658E5AD22D832D0B2DBB2C9F591958
C55B6DB3EAB7FA686D6F9D6EDD687DC7866213685368D363F3ABAD992DD7B6C6
F6DA5CF25CDFB9ABE776CF7D6E676EC7B7DB6377D39E6A1F62BFC1BED7FE8383
A383C8A1CD61D2D1C031D1B1D6F1068BC60A636D669D77423B7939AD763AE6F4
D6D9C159EC7CD8F91717A64B9A4B8BCBA379C6F3F8F31AE78DB9EAB9725CEB5D
A56E0CB744B7BD6E52775D778E7B83FB030F7D0F9E4793C784A7A967AAE741CF
675ED65E22AF0EAFD76C67F64AF6296FC4DBCFBBC47BD087E213E553ED73DF57
CF37D9B7D577CACFDE6F85DF297FB47F90FF36FF1B015A01DC80E680A940C7C0
95817D41A4A00541D5410F82CD8245C13D21704860C8F690BBF30DE70BE77785
82D080D0EDA1F7C28CC396857D1F8E090F0BAF097F1861135110D1BF80BA60C9
829605AF22BD22CB22EF44994449A27AA315A313A29BA35FC778C794C74863AD
6257C65E8AD38813C475C763E3A3E39BE2A717FA2CDCB9703CC13EA138E1FA22
E345798B2E2CD6589CBEF8F812C5259C254712D18931892D89EF39A19C06CEF4
D280A5B54BA7B86CEE2EEE139E076F076F92EFCA2FE74F24B92695273D4A764D
DE9E3C99E29E5291F254C016540B9EA7FAA7D6A5BE4E0B4DDB9FF6293D26BD3D
0397919871544811A609FB32B533F33287B3CCB38AB3A4CB9C97ED5C36250A12
356543D98BB2BBC534D9CFD480C444B25E329AE3965393F326373AF7489E729E
306F60B9D9F24DCB27F27DF3BF5E815AC15DD15BA05BB0B66074A5E7CAFA55D0
AAA5AB7A57EBAF2E5A3DBEC66FCD81B584B5696B7F28B42E2C2F7CB92E665D4F
9156D19AA2B1F57EEB5B8B158A45C53736B86CA8DB88DA28D838B869EEA6AA4D
1F4B7825174BAD4B2B4ADF6FE66EBEF895CD57955F7DDA92B465B0CCA16CCF56
CC56E1D6EBDBDCB71D28572ECF2F1FDB1EB2BD73076347C98E973B97ECBC5061
5751B78BB04BB24B5A195CD95D6550B5B5EA7D754AF5488D574D7BAD66EDA6DA
D7BB79BBAFECF1D8D356A755575AF76EAF60EFCD7ABFFACE06A3868A7D987D39
FB1E364637F67FCDFABAB949A3A9B4E9C37EE17EE98188037DCD8ECDCD2D9A2D
65AD70ABA475F260C2C1CBDF787FD3DDC66CAB6FA7B7971E028724871E7F9BF8
EDF5C341877B8FB08EB47D67F85D6D07B5A3A413EA5CDE39D595D225ED8EEB1E
3E1A78B4B7C7A5A7E37BCBEFF71FD33D56735CE578D909C289A2139F4EE69F9C
3E9575EAE9E9E4D363BD4B7AEF9C893D73AD2FBC6FF06CD0D9F3E77CCF9DE9F7
EC3F79DEF5FCB10BCE178E5E645DECBAE470A973C07EA0E307FB1F3A061D063B
871C87BA2F3B5DEE199E377CE28AFB95D357BDAF9EBB1670EDD2C8FC91E1EB51
D76FDE48B821BDC9BBF9E856FAADE7B7736ECFDC5973177DB7E49ED2BD8AFB9A
F71B7E34FDB15DEA203D3EEA3D3AF060C1833B63DCB1273F65FFF47EBCE821F9
61C584CE44F323DB47C7267D272F3F5EF878FC49D69399A7C53F2BFF5CFBCCE4
D977BF78FC3230153B35FE5CF4FCD3AF9B5FA8BFD8FFD2EE65EF74D8F4FD5719
AF665E97BC517F73E02DEB6DFFBB98771333B9EFB1EF2B3F987EE8F918F4F1EE
A78C4F9F7E03F784F3FB8F70662A000000097048597300002E2300002E230178
A53F760000ADE14944415478DAEC9D05DCDC44FAC767EB9496160EB716E77097
03FE14EE385C2A48295237BCB817D7E390BA53A5B89562A5C5F5703DE070772B
2DA5DDFFEFB799BCEFEC6C928D27FBBEF37C18B2CD48267977E79B9947A6502C
16851123468C183112540A0620468C183162248C1880183162C4889150620062
C488112346428901881123468C1809250620468C18316224941880183162C488
9150620062A4A664F0E0E39EC261DD40950A5E5905FFEDF8682F4C252567DAB0
61D79D14E901193192A2188018A9290140DEC66183488D14DC4E670E93F1C387
5DD737D2BD193192A2188018A929890520AAE40B260620466A4A0C408CD4940C
D200126ACC76933897BAC2750C00B9DE00C448CD880188919A92411E3390DCC2
C47FE70C408CD494188018A9291934F8580D20BE94D3D1251DA0188018A92931
00315253520910556A1E260620466A4A0C408CD4940C1AA401C475BCAE49988C
1F3EDC00C448ED880188919A920A80A8120226D5730348A15A76D52B198018A9
293100315253E209105D6A0F280620466A4A0C408CD4940C1C74CCDB187883FB
8114C265A6BCDC650062A4A6C400C4484D090122B41948BC3E1A99C264FC88E1
37188018A9193100315253E20410555C60321DE92287C21E1219245B214DF37D
6356A30620466A4A0C408CD4945403882E1228C3478E1C766C9AFD1C3CF8B89D
70782260B5F12346188018A91D31003152533270A00448B0F5A4E1A3460E3700
31622466310031525352071055AAC32475800C920009A8373100315253620062
A4A6C41120BA548EDA9901C4BB5B15620062A4A6C400C4484D892F80A8628DDA
1900E458099040CA780310233525062046722B03060E5E1A879591369489E038
0CA96D40D3DDE1A3466505105D3C814238D262EC1DA437913E46FA0550313F52
23B91403102399CB80018339AAFE455890D80223E9E6386E86B4B63C5FC5E0B6
2A4CD207C8200520E1E375FD82F411D21B48AF20BD8CF43AD2E780CAE234EFC7
88112731003192BA0018AD70D804693BA4ED91B641EA80B47445E150C16D2B2A
650B10DFF753F073F60FA42F905E427A0EE959A41701941FD3BC3F2346280620
46129501030661FC2BB4111628FE0F6967A4AD91DA8AA078080F93FC00C4F7FD
F882892D0B90DE92D77B4C1EBF065496A479CF461A9F188018895DFAF71FD4A6
50287962EF8EF47761CD305A59B9310604F1DFD4F0D1A346E40F2081EE271050
080EEA50E6213D8CF424D277469762246E3100311259008C26C2D257FC03692F
61CD32A8BB108590E142028B7753A90364E0A063CA0012EF36B881C3ACCC477A
11E97EA407905E054CFE48F3791869986200622494F4EF3FB019BE3E9C59EC87
B43FD25F919A7BD5C910269903A4BC7B99C284B3934F901E44BA1B691E60F26B
9ACFC648C311031023BE05D02020383076453A106975511AA7820F8829C32457
0029EF5E9C3071CFF4A842E5FB4348B721CD064C7E4EF13119A971310031E229
FDFA0D6C81C19ED652DD913A23AD52BD56EE80327CF4E87C02A4F24E33050A67
225CE2BA8947C0E497841F93911A17031023150268707CA199EDE148DD90D6E5
F942A8713C6E98846A337D800CD400128F39B29F4A81335DAA7C87740FD254A4
C78DCEC48893188018A9138063791C0E463A5A58A6B6CDBCCAA701949860923D
40C23F02A55AF2BA1387B31C203E109687FC1480E4BFF13E2923B52C06208D5C
FAF51B400B2A0E76FD446989AAE4B31158F2313B71CDCC1740A23D02592D1345
FC9FC2F2331983741760B220FA933252CB6200D24805E0584E584B540384B55C
E522E146B89C012575800C183878270CF2817520350494AF906E441A8BF4BEF1
31699C6200D2C8A46FDF011BE33010A90706DF6583D5AE5998002023530788A8
08E71EE7DEED5ED552D59D5037321B6998B04C82FF0CD76B23B52806208D4000
0D2E53D12BFC44A47F0A077F8D1C0CF2495E27170029BFA3B807F9B4AEE30A13
0E240CF8781DD2CD00C9FCE01736526B6200D280A56FDFFE548277C39FF9141C
195AC4D768926F9884BAD6F03163F20590F2BBC9314C3CAFE59AF1297286E338
CA04796CD86200D20005E0688DC31148A70A69825B2FF99D352478ADF4013240
022417B386B4AE5591F113D208A4612347DCF079B81E1AC9B318803420013868
41D50BE964618547AF228D0626D90124E263682030A177FB04A46B00924FC2F5
CE481EC500A401489F3EA519476F242E5575486B69284598FC816B716325EED8
C790F0ED025E2B1F00A9FE28B803E1F748EB082BDCBD56BCE66142CFF6F14857
991949C31003901A168083CAF0A390CE465ACBA94C8A7A8610D772ACB010E935
61458FE5A649DC858FE0F865ECD8518BFBF51BF836AEE37F4F744B009051F903
48E5A3E0E04A7F9CA5843583DC02694B61E9AF98962DAF52B3565D9C9170698B
20F93E5CAF8CE4410C406A50FAF4E9D7148783F0E7BB485851707D4BCE804293
CF4F919E41E9A784B5BBDEAB0085AB831A01224439407C5C27FF00B164FCE8D1
23FA3AB63770302DE9D643DA16E96F32F139B4AA7B0E7956C63B57213CAE441A
3E72C4301311B806C500A48604E0E0CF9003D3A548BB94E7E6DA0ACABE16F7F1
7E1FE971A44785B5D1D18763C78EF6BD739E13407CDC17E1744742F7E496DB11
FF3B266093AE007112406505616D0BDC0969576139842E65DD4D8E97BB2A8B73
79F27CA4E900C9A270BD3092851880D488001E5C17BF4458A1D49B55AF911B05
F9B7C28205F79F988B6BFC0FC0581CF639F801480AF714E03A81DA0A04105500
135E6845616DE6B587B076825CC7EA5A8E61527E2DEEF17E06D23C80C40C4C35
20062039973EBDFB2D8DC3E9484390960EF7C34E7D76C2419E915C67213D376E
DCE8DFE37A1EFDFA0D40DB85A03A9008F7942A4C4203441700852F197C4EFB08
6BD32F2E7935AB0198F0E5E276A45301918FE2781646921303909C4AEFDEFDB8
E6CDD9C6D5F819AEE95A30F341B1245C76A0B29B9B12DD396EDC9877927A2E16
40F41948E666C221AF5391111B4074015018699920E1776A37C1971191EBA52E
7AB25F2E68FA3B72D86F493C1323D1C5002487D2BB77DF0DF1A7B9061FF7D6F3
E2DF7729F480480538A17133D21D80C67B693C1B6780C4764F416BC57C9D4262
00510530E17EF5DCBB9E9B8475121226D61DE54E11CF971186E0790020318355
CEC4002447027050014A5F8ED39094B0EA81B7294D1226040577AC9B81C1F06D
80C3B7023C0EF10790C80F222E93E4A0D7004046260E10550013EE30C9ED898F
44DA1EA969FD1DE56676C2652DBEA89C0A887C96E6F331E22D06203911C0836B
D4A39036F52E190226BE0A7856E212C2AD4813919E1E3F7E4C66BBD3F5ED6B01
A4463DE2AB5D277580D822CD84096686C0E18662AB95DF4D2E6042838CB390C6
99D9483EC4002463E9DDABEF3238D09FE318FC6E9A066F2131A07066C1E8AA63
50F82640231741F16C8054DC4EC300CAF83163B201882A52014FE53BFBB22752
8BCABBC914287390060122EF66FAA08C18806429BD7AF5DDBD60CD3AD6ABC88C
79900AB0DCC5D9067D26D8AFA7C68F1F9BAB2F881B40CA6E2717FA8C50D7CA05
4054014C680ADC4758B392559DEF261398D09B9D1118460124660F928CC40024
03E9D5AB4F1B3CFA0BF191DED1757B73C4ABD3080C93CF91C1AD4A27001AB90D
78E7072065F79AEBB86015D7C91D406C0148189BAB9BB09C23B776BF9BB843C6
7B552955A27FD14040E483AC9F51631403909405F0E08F6F92A8DB46365B0539
CEBE89C3BF91668C9F3036F7E6927DFBF6570052ABD656AE02808CCA25406C01
48B8CC4A3360467CE6E6644D3C9F433AB393EF904E429A3A6AE47033A0A52806
202909C0C175657EC92F160E6BCAF5920A5096A012BD7E69677FEF840963437B
86A72DE50089FE20720694DC034415C064736139B9D2B7A4859F3A0902850319
2DB50603222640634A62009282F4EAD9670DFC081869758F603543E834BC7F6C
548C33ACC8654873264C1897AA096E1C0280309CCBCADEA56A16248F03209342
3F9C8C042021D0B979D9E142C6E2F2F52C9281C9FF907A01228F65FD5C1A8318
80242C80C7BE388C13EAA0979682BC3E837FE479C28AA535B716C16124FF3260
C0E0F5F09D632C2B82A45590BA31C384D19C39D3BF0220310AF604C5002421E9
D9B30F95E343914E2B540B7E18AF4E431786483F0F199C71D4CC529591DA1580
64431CCE453A54D031318D90F1CEC56723F50444BECEFA993454310049407AF6
EC4D73C7A978BCBB39E5C7EFF4E758E1AD82F523BE63C24433E33092BE0024DC
108BCBA5E5CAF6C06C8864D9C55D1E0F07449ECCFA79344431008959000F86D3
66A88FD5CA7362F1D1F0235F4A13E10913278E5B98F5F330D2B80510E13798BA
3F2E9F6E5351209D0DAD16A00A7534230012F33215A31880C4240007DFB00622
5D2DAA2A1263578E5318BD94DB845E3E71E2F8EFB27E1E468CA80290704997CE
884345C5CB95946461C2818EA1788E1F356A78EECDD56B450C406210C0A3250E
D70B2BF44393E02D4436DDE5BE1BA7001C6F67FD2C8C18F1128084FBBA9F8974
3C524BD782C9C1E469A4430191DC3ACBD69218804494A38FEEB552A150A0FDF9
FFC5D7AA6FA0707BD893917137E061FE90466A4600928D70B84E583B27561FF9
E3050A23FA7603449EC9FA39D4BA18804410C06333616DA2B4AE7ABE103EAE85
8338B6B50067AFC5F1928993C6FF9AF5733062248C00229CADD3E4F70AE11267
CB55A20385CB58FD906E0248CC2018520C40420AE0C10D79A622FDC5AB5C0230
A135C9B193268D7F39EB6760C4481C029070B7444645E829448888D4E161421F
910B902E03448C897B083100092180476F6129AC5B06A9171126BF08FA73E0BA
93264DC86C3F0E23469210C55A6BB8D066F4BE25DCCF8B03E004A4C1A3478D30
BFAB8062001240000E4EB9CF413A5F845296974B00A0302C435F80C3EC7F60A4
410B40C2A8BF97220D12616623AA0403CA7D48DD01919FB37E06B52406203E05
F060B0382AFD0626D1BE0B4CA8DFE0ACE306C0C3846430D2680420F9070EA391
D68EADD1EA406180D18300912FB2BEFF5A1103101F72F451BDE8D77123BE8007
A7713D099317907A031CAF657DFF468C642103060CA27EF11A51DAAF3D5665A2
174C680ABF2F20F2BFACEFBF16C400A48A1C7554CF650AA264A6BB675946BC5F
6755A8CCE3FE1CE7DD78E3C4DFB3BE7F238D5BD6EAD081CB48D44BDCF9C1471F
DD9FF6F50111FED20E937D58B63E27C61F6065530C7FB20F20F246DAF75B6B62
00E2218007DF80EE42DA89FF76B52B8FEFBBFC39521F8023F51FAA1123BA001E
FC6633B2C21024BECCF402446666D11780845BEBDE28E46FB15C1281C957C29A
89FC278BFBAD1531007111C063456129D6826FDF19EEFBFC302F0B7898F55723
998B840743B3338695FD8D5E84340810199F459FFAF71F443D24C3B40F2914BC
14ECB1018521810E1C3D7A8409C4E82206200E0278AC222C786CE1B74E0498F0
47C988A597001EC68CD0482E040061589E51A2DC128ADFCFEE00C8ED59F60D20
390887B148CBDBE70A1182C855911F850511B341958318806872D4912578701F
81CD4B27E28EC9539EC5379C9E00C7BD59DFB71123B6001E07E2700B5273E534
757383018F317276C225257A8FF33BFC0ECE47B61244BB345629A2AD05D5CA02
22EB092BEAF5567A5E0230F909E90003914A31005104F0E0B2D543489B391688
17262FD3AA0BF0782FEBFB3662C4160CE28CE9C6D9F7D2CA690E12F47FE24C99
CE7E57216D2CACD909C3A353E94C5DC9E8B020C175B9E91A8D47B893E16968E7
876A750011F671A4285969394B214044D22A4288EC0F883C1EE9013730310091
0278703A4C78F85EB60A09143E705A75F5BB71F2C45FB2BE6F23466CC120CEEF
3E75717A781EC65DA3227D00D20DC27D874DCEA40FC1E01FC87A50CE68E89CFB
00D24748DCCFE662B4F361B5BA8008EB9E2C2C5D4D8B6AE5230285CB597B0322
2608A3140310C891471E4DF340BE75EDC07FC7BC3FB32A5C0660EC9D4B274F9E
6462EF18C98D6010A7C3DE3CA435B42CC67BEB85441F285A4135AFD2D4280CFC
83025E9B60FA16F56E93FF5E4658B39D0938E7CB0A0A20D90787C9A24A6C3A55
42C2E45BA47F02222F05B9C7862A8D1E2080471B1CEE4672D97E36369830FA67
7F80637AD6F76CC4882AD2D783EBFB7FD3B2F852D50D89BB6CD29C5DDF288D4A
75FDAD9F46215B63E0F7E5008B6BEF8BC33A287FBD769E71E6382B79CCAFFF49
FFFE0337C1E10EFC0043C5D20AA03BA1B9FD1E80C89B61AED390A4510304F0E0
979F6F3DFBF9AD1318285671DA9477013C9ECAFA9E8D18D1058335234B1316EA
979BCB34749EDD40584BBBEDB46AD4577080E78BD70CA4D64ADEB918F42FF671
DD2D8535B33907E59738E433DEDC4948DF217F929F7B01445612D66F5AFA8B84
539CFB80C907BC7740E4A350176820D268010278701D97F6EC474569C7075018
1A61FFC953261965B9915C0A06EA2B71385539C58DCAB89CBB02D223482B6B55
68423BD01EF4519FD16C7B29F9E390D7AFCA35B9547616D20928FB4795B23D70
581DE96A94ADBAF40B8850B9CEED6B1D420FC50A14CE403A8D1E3DF29B508D36
0069940039F288A3F866C3FD074E8D33C48E034C38E3E80C787C9DF53D1B31E2
2618A069C9A40609E58C834AF33B8565AEAB0ACF5151BE48D6E55213BFE7AA39
ED95C83FDDE37A9CCDD06AEB1494FBC9671F195C911660E7FB33F31DD85C5EE3
3821E2F5F8D5860C3A19EE0D88344A8398C60A90138415A4AD3C247BBC30E13E
E53D000F5F3F102346D212B934D4CC7EF3C7BF39C85EAF15A339AE6E6D350F69
7FD4FB55D6A3EE649CB03682B28503CA7E28739FCBB5B96CCCDFDE55281368F9
0775695E4F05FD99A8FB63B5F28008EFF36CA4A1C2D7F60BC17FFF72C8A06365
7740A4D13902373A801C71C4515D84E580D4DCDB0823124CB826DC7BCA941BAB
BE29193192B66020A64FC7740CC2FF93FFA6DEE02D5116ACB042B803E63F50E7
3B59873F106E457BAA568E0108B7725A9692752E125660C617AAF491CB4FAD50
6E8A767E356199F90E45DE274E75970CDF06D72952AFB3D2A2254D3E39EBADCD
37FFE5CF66EC6B33E15B02FFFE69DE7CC29831231BD580DAA80002786C8FC31C
51EE2455FF30BC2AFB030A1F26D78707031EC64CD748EE04033097AA8621AD64
C3409EA7F7395FAC5A3954FB2FD2EE28FF992CCB1FC369C232B5557F18F4FFF8
3BCA3DED72ED6371F808F9F754E92315E07F17964F08FDB3FEAD2AD9E51218AF
3D06E72BB6765E327CEB138535CB29086B78FBE2CE2F567BF9BEAF56F9077EC6
CDC3ED0CEAABCEC900C83561FF36B5288D062080C75AC232555CDD4FF91030E1
83A4C3D5A9061E46F228187869924B3372EA2F56C4E0FB9B964F735DBEA96F2B
2C7F0FAEEBD37C97BA8AAF9472DCD2798CA88C937504CADDE272EDCE38AC8CFC
9155FAB83E0EC7200DA1C21CFFA625182DBDA8FB58A894A3EE8533918771FE21
FB3CE0C1EBCC2CF5BF6C682B2E99F5C50A4FDCF6D9EADB356DDAB4152162A530
4FD2B51297FDBA022277C7F647CBB9340A80001E744CE2CC639B30F5AB7EC70A
25EF722AECCE34F0309247C180CB41989EE234B7A551C79AEA80AC94A3AE80F1
E0F896FF851E5204F9FBE370AB28F7FFE077FE383738A00E67FE74F4E3B293EB
808372B4FAA2F9EFC9B69E459EA782BE0FD259AAD25D9A01F7C0B953F86FC083
E0E3EFBCAD060FEBFFC5E2827FBFB9EAE8577F5BB17FB3664D976AD2A469D94E
A031C184BA99DD00919743345673D2E00172448F92C5D54D71ED26E8F21DE35B
DB5953A64E5E12A831234652100CB41BE1C0184ECBC95334D3DD3068DC2AB4B3
0B0E340E69AB9CE600427F908B9DE0803A9CF9D3A26B886DB9E5D13E670FECEB
A57A5BC8EB80C3B948E721EF73A90BE1BF8FA7BE05F0E888CF4F20AD56D7ABF2
0FA5CF3F2D108FF57962AD9B976EBBCCBF9A376FDE12B311D7FE44000A4DF677
02441ABCF565630008BF641756DE792CCD17D1CCBF703C0DF068D80FD248CD8A
0CCD3E5639F51206DDAD02B6C1E8D47CBBD74385DC80B68E77A943A53C032F9E
8432BECC5C51E700612DA15DA0030E79ED71A0CF0AFD4E382329055D043C08C6
B98241501D661E75C762E9BFC567CC6DDAEDBD256BAEDE7699765713224D9AF8
30D0128181C267B5CF9831A31AB465568306488F1E4772BA4D13BB660142ACFB
153E385A5E0C993A75B259B632929A602065F89DDFFD38D5C9F2B494BA523935
1775770F703DCE22E621ADA965519F72B4D34C46EA28AE43BAC856BE07B81E97
BCE83C78B60E1ED92E97B94620EF03C083FFA69EC6DA72BA62E65114FAF993E7
34EBFFF4674DDE58BD43C7ADDBB6697B55D366CD5A0655ACFB2CFE6F006448A0
866B4C1A2C40000F2AE3E8E4B3BC9E17134CE8C53E10F088BC0F8211237E0503
282D08E96341B3DBE3AB7971CB3A8C547B9672EA76D4EB1AE09AB4B8BA423BCD
F8545DD1CE7C87F25C17BA5458A6C2AF84BC4FEEF741DDC679AA025F15C08353
87D1487D4B275C96ADF4F3C73FD86CC80B5F36A117F9176BAFB7FE6EAD5BB7BE
1A009126BEA17D419C84803F0A1069B0F1EF1A2440000F2A0A6971B575B5B255
439138675389D8DDC0C3489A229DF0686174903CC56D018E7252866BF586E330
5839C528B77D025C9703F57932F117F11CD23FDDBCC8519E6FDD6F20FF8188F7
CBFD79083F7AB6BFABE7032084E2C5A2DE5C57B8C3A33E6FF003CDCE7CF9AB26
0C31F43946FF2F36DA64D3AE4D9B36BD4654FCDA6381099FD1CE80C8EB519E45
5EA5C10104F0E09F9026867D433D90EA40A1C9E0018087711234929A48DF0BBE
6DEB31A61E44EAE6A563405DBE0177574EFDCBB65C0AD887E3E5F5E913F28D4B
9943716813D7BEE97297422EBFCD409B75C148018F23709824684A1C001E3C0E
BABFF9B9AF7C2D01825908D2979B6EB12597F9868AAAD408B5D44578EC0488FC
1CC733C993344480707732EE5B108B9A5C03CAF3487B4E9D36B9EA6E69468CC4
2D32A82095E17A58755A1F75F118D4B945F35ECA2946BFBD24641F96D6FD4794
3CFA91EC86FC8B62BE6F06763C00ED9696E1008F4EC2B2066B1D141E1400E43C
00E41D510E103A41526773ACFF9E051A623826F51A3B7654831A701B14407A1C
7EE45F8515D8AD7DFD1DC6D6FCFF00935D018F4FB3BE4F238D57309872EB0186
CA69A3657183230EB29F3AD4A167F80ECAA963516EB84BFBFCC5B492ED2F2D8F
F409E1F927DDFC38A4032097C94EF6ABDC776987BA0846F6BD91FA1D69BE4B1D
CC49D25C97E1E56992BC421878509C00F2CCF3CFFDD6AFDF8016F2D97609DEF3
AA030D3BD01300991CF6D9E4511A0C407A1C7E04DFCAE6E196B673BFDBD0CD7F
8FF47FD3A64D7923EBFB34620483EAAEA2B4715245EC2AEA09F6B2635CC9B2FC
D65361BCA1528EA14458866068AF1D9968D9D44C262AC4A9A83FC86D63275C83
862A549A9FE4363BF1795FF6D6B68C71B58D6C93FFA60FC9CF80077522D46D6E
E00A892AF0E0C7410F380384D97DFB0E2030B94CBD43F87078AE15A90FD91E10
79276CCB7993860410DA9B3BACEB46B6B8A2AE637FC0E3E1ACEFD188115BA477
3641B0AA964593D97D30E0BE2ACB3124091D07D70876853AA1A10815F5335CFA
C117372EFD9CEB662D15E09EFA0B6BF3A8DBE4CC83BF69C2E353C083B3212EC5
ED12051E251DC8032D5C01420144B8FF095732D6D2FB1883B7FAB3489D009106
A1436D1000013CB85700DF8E9A562F1D686B007A960F063C46677D8F468CE882
4196B30AEA02D6D6B2A80BE98C81F74969F6CBA084BEF70A5784DF7F0EE0D7B9
5C9FBF372AB8B981D45B11EF85A14ED673BA16E0C19910977EBA478507A51A40
2880C816C2DA4CCB35427104985C0A809C1DE579E5456A1E2087773F6239FC21
FF838F1D43DC7EB5D30C8E380400A9ED8764A4C10A065E3AF7D12F64632D8BCB
25B488A247347F1F9B056C9ADF792E219DEB12A284BF126E1AF52CF2E746BC07
CE92E80C78A893351900C2C8BB67C4010F8A1F8050001146286670C8E6D5EE21
204C18D265F7B163473F11E5B9E5416A1A208007FF6C0C6BD0B3EE86E25BB7E4
92D53ED3A64F5914A23123461215FA84281B42713F0F4680D5F57FB42CA25522
6720DCC39C213F7E72483F3A9CA3A5E19B6E0A715C93ED16913F3560BFFF8903
83205EA982493A0E52594EEFF3BA1852800797B54662FC57E28DB87B99579429
569E1FF4404B5F00A10022B4FC0A64B1E6730C6288FCAD01915F7D95CEA9D438
407A30F81A9DFA9AB8CD26424E334B7B42031EDF667D8F468CE882C1969648D4
7F1C6F2BB6E51E19FC2DFC432BCE17205A4795FC32BCA2E106B83EC3A06C8BB6
AE08588FB320FA6F7056C4FD3ECE513DE9A585D95F718EBA0FC2636F41638162
49A92F251A3C28C100D29F2308F74939C43A13ABA7FA3000E4B8707F857C48CD
0204F060E8E71785E3FE1EEE7F311F40E11BC1EED3A64F7D3EEB7B3462441719
85969648D47B7086D10B03EE4C99C7080C9C1174D6AA71167186B01C0823FDE0
65645F3B90A16F735DD4A3B29F9EEC27D0735E06671C20AC10ED3FE2DFEB0ACB
07837B8FFC09787096320763BEA283080A0F873A221840288008E14CD3E14D2B
7323C5D0A281C29E80C82311FE24994A2D0364A228DF8BD9ED16DD732AB3A834
EC0F78C4E2456BC4489C8241968A707A9EAB917439C3A027FADDB20CDFD64789
CADF86ADD3384FDDDD2FE0F5B94FC8506141C0B71511EA713F9E52D46A757F11
69694565327D52080F9A01FF0A78F0A5F009F4B84379F795CF21E15132E37D30
18402880C826C282487BF752A16627ECC7B68088AF68C579939A0408E0B1070E
8CB3136281CA73A98B50EA0380D4DE4331D2A0455A5371D96A372D8BE6BABB6B
DBD3D26A89CB402788F22F3CBFD723904E0CB11708AF4F3D0A670C8196766574
5DEA4C4ED0672DC8A35E86F1AC2E44DE978007F71A79043D55367F8B0F1E9430
00A100228C04406B301FF1DF030D4D578E1B37FAF42015F222350790EEDD7BB4
29584B57EBC5F408EC0FAF21ED387DC6D4D08E50468C2421D24A89CB54FAD214
9D017775F13EE7179B7BE10C1595A3196363F5F13B8B90E6BA0C3638CC29A8A1
CF3608047A989FAEEE36A80AE0414F705A3D1DE037B26EC5E732BD47D1A14811
0069150A20144084B3BB01C19F80275008F3ED009197C23CDB2CA516016299F4
8938A39470EFE7C2CE80C7AB59DF9F1123AAC8C19B5BC5EA411439F0FDBD9AFF
05EA7316C2D9886E8A4AFF91C3DC0673A5BE0DA239F42B89782FEB08CBD28A5B
DB7EA1E6C9D0EC562CAA04E1418902903E7DFA53CFC4D03025B3E818F7547F06
E9FF00919AB2FAAC2980743FACC7A678F6F4E45CCA293F2450F8008E9D3E63DA
88ACEFCF881155E4E0CDE59D3345F9D79B66B67B62107ED6671B47092B926F4B
2D9B9EDDFB7B29C3E56E863FA3CCCD31DD138D5F186CF15AB4F9B67D1E006108
F8ABF16B94F7192CBE955F7850AC25ACA6A1004201446800401F0E3D1E5908A0
D45560078F014046066D214BA91980001E7C43A1DEA3DE4C319E4D06EF44EA06
80985D058DE44A30D832043BADAAD43577EEFDC1A0890F066C8B4E715CBA6A2D
4FF1FB7EB817185087117CB977FAB531DF17CD733745BBA55D12010F062F9C89
21546EEA941C3CEA97B0C203840288D0FCF67AAF322166278C20B0F9B87163BE
085C3323A921801C4EAFDA9BC252C325EB4BA42D008F48317C8C18895B30C832
222EDFD0154BA492C5D5D16E71A97CB449053CB778A6551423F28EF428CBB76C
02ECACB0565BCA7D70B0E516B4BFE1DF8C98CDE5B85339F3013C7614B42C2BDA
6FF351E0A17CF658062B01E49BC800E1D2228D1AF6F65BC72750C60320A1F632
CA426A022080072D33A8E4EE509E130926FC5174053CEECCFAFE8C18D1457A6C
AB3BFAF1FB4A33D7EB433669B74B6FF59D84B584E4169A9DBE26E708CB5A6B61
90F6B5763873A2E970691F1D61BDB11F27EF633EE041DF8F4731A8CB809071C3
43AB576785151D20144084E6C62F8B1071C63C604285FACE8048D5E5C93C48AD
00E40261392155BB9D20A727E3744F0024FF0FC048A3130CBE8C2C7D95728A8A
DB9DA3CC067C5ED7F6D9E00CE1C7886DD56D6DAB6C4F5B0A550278D07C97F0D8
C42A9D303C94435C00A1F4E9D38FE6C9CA1E1FB178AA53BFB22B2092E8DF3A0E
C93D400E3BECF08E78BEAF086BDA1DE4D6BC4ED3EC71AB1933A67DE3BF3D2346
D2130CB8DC62F54AE514F7A2D93ACA8CC0C73569A94573DD6B709D0F22B67518
0EADD1CE043D0FF0A032FF5E0CE84AD895E8214A9CEB55B637E8C1A5E2040867
595C163CB032379C594FC1DAE1FD7000E4A6500DA428B906C86187762FE0694E
129615497DA7C3DDAAFD81543F78C64DD36ECFFAFE8C1871130CC07496D515E5
8C75C5BD397E4FE07AFC8170A67F2FDA7F2E625BD47BD06F856156BE57F3000F
EA0EC66288EC557F367C64DD20338F7A33DEF800420144B8D70A7D38AA2C6505
1AB9DE43DA62FCF831B9F64BCB3B40B616D6D4BDB9DBA2610898E04758380400
C9EF8D1B69F4C268BBC27298D5C3B473B73C862EF939E6EB0DC2E10BB41B4827
887AD46D306AEF27DA79EA352E44BA18791FF21CE061F994144BA092520D1ECA
E718E041891B20144084CE85344AF03924F92A762A007275947E252D79070823
8DEE59D9EBD030611C9E4D67DC34FDB3ACEFCD88916A8241F8FF84B5D7C7D25A
1677CBE316B3B12CC14A13DFD5DDF649F7A8470BAA0384B50DEE18D47F59CBEF
22DB2D29FE0190A3308E73494B6EFC963E3C280901A4192EF33006A15D83D776
1DB918D67E634024B751C1730B10C08326870CFBECCD050F7306879CE3018F1B
B2BE372346FC0A06E17D85154E5C775AA35E703FA7302601DBDF565810382F48
A45EE9554E2FF793850504CE361E441B0FCB7C46AEE5D23343972C013C3A6180
250CA51370BCF1ADFCB567FD7BD083AD630708A54FEF7EBCE717905A944EC4B3
37D16500C85951FB9694E41220800715530C59BD53F03B729D9D705D771700E4
8F600D1A31928C283E1134ADE520FCBAB01C071FD3365BDA45580EAFCB694D70
9D7C9F08F1A93AE2406BAF21EABE1C3EEAB11F57C87ABFC873FCCD52F14FA0CD
1356F89352E876C063238CDB8FE2DFCB5B2D24A530979F3DE051F20379281980
5000912BE5737096E050F91595D60344BE8CA37F714B5E01C28D65189E3A7AB8
2B0B2874C0DAEDA69BA6478AE563C4481C2215D6C70886EEA80C2FC21F24030A
F653F51CA8C3FD31E8B8B69A569E832021F24AC03EB497D71F12549F82BA34C7
7D04F5E638E4F5C481BFDFFE54A0031EAB4878AC577F7BCAADA638F3A833E34D
1020BD7BF7E3721E63EA71AB61EF01CCFFE876DDF8F1634F8CA37F714BEE0072
E8A1DD19CE8076D0DBC7182CF1C69B66CEE899F5BD193142C120CBBD2F1838D0
2B2C388D470E52B77745BD0D05CD5F8558472B4B5D481794F5B5C7B6DC3384E1
492EA9B60486B287E3305BDBC783E15018A3EB4E9C7FCCA97D39F3581A83369D
21E54A4286F0A83B140190A51303080510E1AE8BF40DA918C25CC734EFC18E01
2F3706443E8EAB8F71491E01B23F0E7709ED91468009DFAE3602408CE2DC48E6
22FD2338B834F7519C6FB2FBA9164EA8CF375BEA1274EB2C06583CCCDEE2D6E3
FA841607FF5B50F6A52A65090F6E22C5A536EED7F1B192C7173D06797C1BE76F
D1EB96CC758BA5D85B722BD864E35B0551C2270F90BE7C36DC657017CF0DED82
655C0F809C10571FE3925C01E4D0430EE33A3077FDDAD1EA5D2CA6BBE7001E97
647D6F468C48DF0E2ECDB6524EF30748A0509F41CFED65B56AEF23EDADEA39A4
5737DBD95E29C710188C9335BD4A1F3808BD8B72F75529476B22CE1CB87D029D
782F1796A5D54B4A19FE14FB0B6B19EE065B6F5332D72D967424A7D6DFA272BB
09C4B7AA6C4FCF57CC781306080510E118C6B1AC69794E8831CDCAA4AE692340
2492D144DC923780D033F521E79E8620B9101F216D028078EE7960C448D22263
50F1BBAD4654E08F8F0333C37B1451660B61E93956D7AA7390DB5BD573A02CD7
DAF9E64F28D139F6E46A517351A71B0ECBA1DC982AE536C061906C73B13C47CB
228661A7EEE301ADFCC5F27C696FEF25C3B61E8C03AD1D9BE469E6618BA50369
96284028800861DEDDBB5420A05C357EC2D8D3E2EE6714C91B406802F8777F3D
F7F5E07B011E93B2BE2F238D5BA4B51515CEAB6859639106A9FB71C8C19B7A8E
75B5B21CE87652438C485D04672F8CDA7BAE97192ECAFE4D58B0B9B09AB92ECA
4E139659EFFBDA792E7F7196F40DF26E94E7B83F7B5779FD25800715E8F4986F
994778D4EB4052010875550C02BB94BF1A55C734C6265B1710F9CE5F7BC94B6E
000278F00D8D8A431FFB0DEB77E1F8E05FC1D9ED0190C462071931524D6464DB
79A2120834CB3D0483EE22873A9C8170B3A74DB4ACDB900ED64C7CA94B59EC15
641165786D46C13DD9CF5EE8D24C974B57D7A3FC1B0EF90C204818722F11BE11
336AEF1F80C716F25EDB5925D30D515256AEE87E7ED0C3E90084D2BB57DFEB40
80E383D7745D57396BC284B19725D1D7309227803076CE21D1EFA8F4E079535D
66CE9C6142B51BC94CE41BFB3C5152A69609CD5AF7E5FE181E75B9731FF51C3B
28A7E9ABB136EAF93608413B8CCFC4016748B5ED6BB57A7C6BA6EEF02ED47BD4
219FB31986EFE0DEEA3F011E54EE73CD7F4DAB44365EE6D5E0414919200CE942
08B72F9D88BE052EFBBC2E20127B3CB4503DCB0340000FBE2171AAD72A6A5B52
E834F8B79937DF647619349299489D836EA14425F41E1874AB2E43A0FECA3870
A053F5267BD8DEDE3EEAF3F74473E18A3DC87DD6A70298965654BACF74C82F70
3604787070E412DD566986650F030F4A9A00A1002204B1B3377938F3D23E1326
8C9B10AA66CC921780D0A1E9E4189BDC17F0B82F7A33468C548AB2CFF86CD54F
C3A11C979CBA28A7A8BFF83FBFE147509F1659D443A89659BBA3FE5C1F7539F8
D3126AA2D33254C0FBE50E798CC77583BE54067850B9CEC8D6FB5A6792F2328F
000FE540F3B0810FB7491520BD7AF5A5D5DC5B48CB55E5853FA0F025645B4024
F317E4CC0172C8C187F1ED85268AA5300721F611D6853B79ED0880644F46230D
5230A0D2516CA2B094DDDD5425B856EE4D61F950D8D21765C7FBBC06751B5490
1FA69CA63EAF03DAA8BA05B3DC4FE425BFB3151FED5139CEE5B40B6CBD0DE0C1
5FEB30A4C156A9ACE1E1752D0B1E94B40142014468A976B67E3EA4A73A21BE07
00F248927DF6233900C8A103D08D518E9D0B079303018FBB33BD29230D563090
EE252C05B81D82843BF75DED5296D16937574E5D8EB267FABC0E07E663B4D3BC
6E171F56543D7068665B4AC578EF67E0F03ADA25380910C6D162ECA7427078A8
1FE2095152ED5AF670920D40FA50A7F53F3CAA366E6502C2E43600A45B927DF6
23990204F0A09291D3B1CDB46E3977B63A50FE83B4030052D5D2C48891A02243
8030E0A16A51558AB38641F54987F234D3EDAB9CE24C8566B0377CE0BE1F39BF
E5DCBE79A896454FF31D51EFAD2A7DEC24CB45B2D4413B6D716865878CC7BF39
FBD85B58FA14EA3D0E1556E0C766B954982B8782969F0540288008B7283EA5FC
6C28FF36667236BA2120F261D2FDF6EC46C600D95958961B5E5D74CFA9CC3A1C
F09891D90D1969F0828194A176EE10E51EC6D46DECA0EB43A4F3E0535A592E3F
30F4F9454EA6B7A8C3E5A0EBB53A1C2CBAD96FFE1E7D63AC2C5A469DE2B6ACE6
F31E198A834E89B4C4E20C839064303F9A012F023CE8A1CE90296DF212DFCAEB
5A05ADDEC087DB6605105AA8F105A0B57BA9408E85174E9838EEFCA4FBED2559
038453ECA3FCD7F08409958D9B00200B32BB21238D4230C03ABC49964C6EBBEA
7E16284B589CAB95E58F8E9018A242046569C63E45D8FB49584210507732A94A
9F561216984E8CB2E5AD9C015D28EF87831D2D88E8D7711C43B7031E748EE36C
6BA540F0A8FB98243CF47AFAECC3CA1B38271B805000115A4FF5F257BA2A4C18
236D1D406491BFF6E297CC0002785069FE3FA4B611BAAFFEE3C49B6FB9E9BA4C
6EC648A312B99445B3557DBF1A6E9E74A5569633098600A1FE401F1126210DA0
131ECA310203C398A85ECBFC719EE6A66351AEC1375ACE18CEF1B20AF3796F9C
017D8676EE92FFE66CA42DA3F1021EF42961F4DD8DD283874B9B21E141C91420
3DFB6C868E71D3293FC13415717D79DE7FE2C471F70669294EC90C2007773B64
70A15008B485A687FC805B590B00F929939B31D2E80403EB5AC2B2F85B4139CD
37C17FE821CEE55B3DCDD419F74A0BAE57F25962D45D46BE559736F8C3248CCE
AC12A284EDFD0B6904CAFD37E23D11627F433B17E9798007FB46C0ED5E8BCB56
6ADEC039CB6406100A2052BE557734E7C23B0190CE69F5BDA217590004F0A0F2
9C6BC36A345151086FC37BEDCDB7CC3C29F51B31D2A80503EE41C272146CA69C
66C8F3ED9C4C6D519EBB0FD2BAAA858FE6B9D4D1DF4B9721C14407B5C79DF6E5
A8D2F7BD65BD5F95737458BC5458BE23FFB1CF031E4D657F8ECA6B7C2BCF9987
562F0700D9475826E071841BE772E5BA13278EFF3CADFE977535238070EF605A
5F35752B1300265C73DE080009B5ADA711235104832EDFFE8768A7393874768A
3B25F51CF421F150A496F6C339A4DA36B3688B6BE9BFA3DC4D01FB4CA73F5A55
516F72AE0A3BB93C473D0C7529A5410900B940942CC3E2F6324F1A1E6A7EFDF9
AC01D2B3671F8E7B74EEDCC0EAB387F81B064F04403259BECF0A207CCBF1650F
5FEAA4374C18746E5F00C4380E1A495DE4803B4F94C7ACA29CE5664A8B3ABB0B
CB4950DF9E96B38D91C2D27B782AC2652CAACD50EE5F01FBCBAD710F463A0789
3A0D2AC9AFB697BFE4FEEBBBE2DF747C233C7AE2300E03B0F2B2974088125778
A8F9D1E141C91A201440842B26D738E585D8B5F079A41D0011D7809A4949EA00
013CA83C62F8E9B54377BA1C2807021EC671D04866824197DF65EA4396574E73
F6B02706E2792E75683CC2BD22081ECE4638A0CD44F9377D5C8F337846C43DC3
2B0AAF43BD3584F5E276A23DBB910A78828EB1AEBE178A1930E02137C02A2A31
EA6A73D94ACD1BF870BBF35EF9366B80F4E67785E6DF6DEC3B70131F40E18BC7
E60048A4903561240B80F8F0FDF02D1F02267F05408CE9AE914C050331635E71
1056F5218C79B58D9FD02301AEC3E8AE74342404027DEF5197B31EEE07F29E76
9E7DE68CA423D2318C120C7810520C95B17CF59942849947595EB2338F7A33DE
EC01420144F8F738B23227144C2E044052F709C90220B47F3F2EA6E62EBEE5D6
9BCF8DDE8C112395222DADA8F0A4692C2DA53E70D34B48853697244ED4B2B8C4
7A809F7D387CF4A7ADBC06CD85BF0F519F7B78509F7185C36651ECFF52383F1F
F0601460FA7AAC9D4B2FF308F0B0ACB00890E67900C8AE38CC1555351DBE74ED
9C7D6C3E71D2F854032CA60A906E5D0FE63AEA479835AC16B931CB64725300E4
9DD46EC048A3110CA8F41AA62592BD2CC51F26CDC4B9C4F42212E35CD110E44D
6539884B3DDC3B633BAD39FA675C12B13F9C25101ED7E9837FC07608212E594D
423B2FE8F98007A3EE72EBDD1D73090FE510061E941C0184CBF97C31D9D07F2D
5798F0E6B600405E4DF31ED2060815748FAA4F2182E9EE6380C7AEA975DE48A3
120CB40385A5D0AE268407DFFE08134285906170D0A5B432FB60C09E13B22FFC
917079E27EB4F14C0CF74618D1DBFC49B437CB3E0F7870406328A0AEB1C0A3EC
63D6F0A8CFCB0B40288008970E2F0ADF42D9F879D1A449E3CF4BB3FF6903846F
50AEFE1A0161D20F0019975AE78D342AC120FB4F1C1E88B149EE22B86DC88D9D
A8D8E63EE4B7C7787FFCB14D42BA84165832343B3DDE87F81BEC938487D7B5BC
E0E150CFE17CCE00B29EB05E40027AA63B49E1750064D334FB9F1A40000FBEF5
70FABF9EEFCEB90385CAC35501901F52E9BC914627D2A98E837E9BA86D294220
ED17441F22F7E1580B756E88783F34D95DCF9EC1485362028D9B4E71F671AC28
C5E72ACA1F9D5F78A81F227A99FBBC5621703DDD8C373F00A11C7D74AFC731D6
ED1C4353B4C8FBEBA449132245240822690284FB22704DB96998FA1A4CEE023C
0E4AA5E3461AAD6090A52EE01FCAA95784E5F3B18DB0F6F9080397433168DFEC
F3FA5BE1C03D1FCE0962AEEBD08EBDB52D15EFD4DFF045AEB7B0F63259027810
52B761A0553CE4FD0FE81565720C0F4B89DE3E6F0061FCB1BAB04E1196F52943
00907FA7D5F7340142FBF34B63E974A1D01D0009E47D6BC40845C68E5A526D53
2659F634616D0B6BCB87481BC8E0879C5153F9B9B5B080C2E3C6C2824A138F66
1912FD1A5145A412FF74A493AA79A4FBB85FC6E062E46B2E95F4175610488649
590078B0EF7330B02AFBAEA70C8FBA43F2F0A0E410208C084093EF664EF90181
321700D93DADBEA70210C0834F80B17AE298A6FD82D4E1D6DB6E31CB57460289
1CF419D3894B4867548B5C8BF28402BD7CED5F307F2C5BA2DE2B2EE5A9386778
0ACE1C6CA8AC8FD45E16E1921883157E5CE5BA1CCC0919C226528050A7AD6DF9
1CB88C06787414A5DF65718DFA1A5506E6BA8F49C2A3B29E3F78A8796ED7C20C
E491657305100A20429F9BDDFC94AD0214DEC75A80C83769F43B2D807053F90F
45B9654A58B90BF030CB57460289839F06070EC6B0BAD96D79488629A1C9AC6A
765E11B2BDCA750903EE60B83AD2D3F60E7F1EE5B98CC425882BAA81C6C7B509
B123D1CE097A1EE041A8CDC588BA45FDD924E1E1D266605F8F68F0A0E41420DC
BE7858D07A2E30E90A80C46670E179FD3400D2B54BB7AE38DC5AE5A6FD4A2F00
6452E29D36D2A0048329A3D632BE93FAE5E3979F810FB959D2472EF568D67A98
726A2ECA26B244806B71E98B269DB7ABD1707DD6DD14755E73688F031377341C
6B2FDB011E84D49DB8FDBDCB1E8597CF46DDC78CE151B59E373C28390548071C
1821A059D8369471750C0032208D7EA70590D1C25A7BAD76E3D58401E6D60140
029B421A69BC220752BE85D30BDB6903B39F8515CA63A4C38E8254368F574E71
305E29EAD2924B3F77C4E10061F967F8DE2408F5B83F3995FDDCA0ED0A7D4685
FC11388CE6D21BE0C167311223AAF27B6C3CF0A0E41420FCBB3C2D2A9D50C308
23936F74E38D1323473FA826890304F0201D6856B6AEAF0E79C3E409C06397A4
1F8A9186291848F91DA4B50B83043A7DD118BEE31855C721C399F0FBABBE1932
54FB9D31F78DB1B438B321CC7E1496C5D4F86ACA7ED4A3429C1B4171E6C23574
865E39D78EE62BF7FDA0E2FF5AE9EB713A46D44BEBEF3F283C94CF35080F4A1E
01420144E80478410C4DF10562430024F12D2ED20008A7661F8810FB6E39C0E4
2C00E4B2A0ED1831628B54A433801DADAB567028325F583BFC5DC64158EA4E68
BDF457A5CC18E4C5B644806B30222F07FAA1C252BC739F0F7AB6D33AE772B74D
A5508F0A7A2E510DB1CBC848BD838435A3A2729C117FCF92E6BA876144E55E1F
128671C043ABE70A0F353F083CFCD4738147E9A313406885D5228F00A1CEEA39
11728F424DFA0120893B5AA70190A384654218ADA38502A9BA2D00F262D20FC5
48C31719D596CA6AEE8DE1F4837D1D693006DEC751560F00FA21D23A517C3394
7E30143C15FB43ECE5339CEB282C00D0726A5BA4B3F5C8BB52C14F53F623D55D
05651EC171BEB0E27751BFF307E081994AF14151B7915502F028CBCB273C4A7E
20A519480E0172542FFE4DA907593D06844C05408E8CDC4A154903205C3FEE1D
4353FC63AF79DBEDB7A61A6DD248C31539BBA0CE814E761D1C8A70401F2BACB5
E9C9CA7982630B5D691DE2FACB09CB4783E6BABF38E471B64D6746865539438F
C08B327BE1D049584B568BB43C5A7F15D92EE0C1990ACD7557B2721B2F3C2879
05080510E10CF1888A8CE040A151C8DA8048A29B4CA50110FEA1D68FA1A96980
C711D19B3162A45C30D8D2A495D172A95876B282E1C0BD9C76EE94A0BB016AD7
E4DB26C175A1BD75AC4399A564BFB8AC413DC7A528FB8156863E277D84B54C55
A1D8073C68423F0F83A75C826BDCF028F981CC5D2EB70039EAA89E470B2B4619
9E890B35FCC3A42300F291EFD22124518074EDDC95CB04FCC25B2112A299EFF6
06402626F9308C346EC160BCABB06CF137F151FC610CD87B84BC0E2D6EA883B9
116DBC5EA52C81468F74FA8F50BF314937F1958AFE338405A3CFECF380070134
1BA3E6AED699300AEE84E0A11CD2840725E700E9282C2BAAB217999030E90180
4C4FB2BF8902A44BE7AEFB174A5B623A5D39304CD606403E085AC988912082C1
98FB619C2E530B8FA2B4965A2BE4C64E27E3F01AEA3EE8B33C7F2C7D919615D6
4C681EEADEAF9561B0442E1777A7F21FF0600893491835E5ACBDA1C0C3A58FA5
8F1EF050F2F30C100A2042AB3FD7A0B3052F6A94670D0340E2DABCCFF9720903
84D3EFB39CEFCDA937AE2568DFBEBED17F18494B30206F26AC7D3D76F428C69D
06EF09D82E9D12B9F3DFC42AE5D6C1E17B94FB4139C7A0877F1316BCB84DEE24
DBCC17798CCEB02AFE3D429AEB5E8411F36CAB6615B3DBBA83DBC0AC7FF00B0F
AF6B450FCB5EDEA63F78506A0020D4BBF5F55BDE0328CFDF3879621C7E25EED7
4E18207A3453E5A6ABF5ACAC84D17F18495D3028738F069AC90E456AE7506404
06EC6302B4471F262E275DE2E5DF8172DC5296BE1A54E253EFF1A19247AB2CAE
9353814FDD0DF7F0A0E92FE132549AEB62F029D279B749FCF0909F23C2831F7C
07478C111E252BACB97FC937408EEC596FB91A62D55F010AEF696540E4D7E0AD
F8BC565200013C18429A4B4E2BFBBB69AFCCC26000C4CFEE70468CC42E723640
535EFA6AA85FD53B306077F1D906832CD23FE36437BF0E598ED17C695E4C9D06
CB71163F0E755E52CAD0219241121F47DA5EF6698865AEBB152DB6EE426A6595
F63FA05794C9033CEA0EF1C083520300E1DFB7D20930384C8A80C90E00C87349
F5354980F021F08FD4244C7DED596D79DB1DB7BD9CD4433062A49AC8B0E8870B
EB8D9F964D0C69D20583F67D3EEAB23CE3709D88F2F33DCA3593ED0F47B977E5
395A6B71FBD939AACE446993214FE64A73DD4D316670CBE865AD52412DAE82C0
C321AFA23DE77A497A997BEB446A0620FC1E3090E62AAE85FCC364E0E4C99346
27D5D72401C237B3DB6268EA3B3CAB8E004862D3302346FC8A545677427A0383
F6DB3ECAD312EA5AA4F350FEAB2A6519F5977E21C76BBA0FBE8451F1CEFA53B8
FCA598015F44CB2BCC3C58973392B5AC5A7E94CEEABF23CE3C2ADA73AE176758
F64AA90E0F1E06CECB3740288008756BFBF9AEE00E945100C8A0A4FA991C400E
EAC2B7A673EBAF14DA84F789DBEFB8CDC4BF32527322672D57092B12EE5B3EEB
30ECFB506199E47EACE5D1B3986FA55CE2E2EF6B26CABC0C78D06990B393EDAD
9249C2C3A5CD30338F0CE051D281CC5B3EF70039F2C8A3EBE2621582AE5D9517
7F1A00F95B52FD2C0348E783BA30164BA4BD9795FE3344C38ACE05023D906F85
E5DEEFE35955BDCED1B7DD7E6B6AFB051B69DC82019FBB70720F907901EB5161
4F2F74C6DC7A59CBA3EF0915F78CAE3B1BF0A0A27F265267AB8459B672AE57FF
3949801C79C45184FB0ED64D47F27B639CB675F4938161C2A5D682782948058F
6BBC70E3E472B3E072801CD899DEAE0F47BC71870E7965C6772D1FD7D90A0009
F4308D18092318E86929F52706F96921EB73898A6FA08FE8FE22C85BD65EE202
403860C94DB282C243F91CB7AF872B3CFCD4738140E9A307408A5EF5EAFF9D30
4066E3B0976366ECE36A2813AD28D79903809459D53A0324C11B4F0B262ED7DA
EAB63B6E330069A0224392D0EE9D4B3A9C69BEE165F194603FF83B628891ABFD
ECBDEED18EADFBF812ED4CD1F3010FEE714280140C3CFCC1C35AC25A2131801C
A10024DDB12E1598CC993C79923B400E520092A359439CD732006980C2377261
E90418B4B3B592C57D3D4EC2E03B37C5BE6C2CAC70ECA7C7052FB449BF000642
BCC66E13F0E0921597AE9AC7030FBFCB566A7E4AF070D5D3068707252D803889
EB88561B40F10F902C6E3C05986C75BB014883120CAE542A7389C72D7E15CD6D
8F17CA96AE09F6853E4F438565AEBB20423BFCB237A75F87FCF7F2C2DACFBD3F
DB053C38CBA293EE3266E6110C1E942C01A24A0DC2243C40B2B971AFCC50D732
0069402297AC38906E53A528DFDA19D6E3CAA420221D0039C89F896B7C17B12D
028FA1544E41228868AE7B3EDAFD12F0E888CF4F20AD5675165177F0B2C4523F
44808772881EDF4A6D3388D2DC0734457E00A24A8D2C77C503105F379E4F9818
803410C120CBA52A7A5CEBA17238E3A0CFD05FB4F3FCA23302EE597143443A00
32B4FB0D68FBBD886DD17F8A163874503C5F58E14CAE47BB6F021E5CAA9B274A
70C90A1E5ED7CA2EBE955F7894C2B91320DFB5CC154054C9314CE64C9E123340
7CDF7C3E806200D20044C6A8A275D3C15AD687487BCA23614125B3FE656080C4
13ECE5A118FAC2F669B3FF10DA7C2A625B3BCAFE5F209D0569CECB9D0F5F043C
189AE44E2B3F8C696D42CB56CA217FCB56CE6D260A901E1220310E7739024AF2
00C9E2C6035CC700A4010806567A769FA09DA697F61EF62E81D2828991A0690A
AB87D39981D48761CF63E84B3F1C7E445BB704ACD75A0D6B2267310444777D77
42C083FD67388ABEFE671EEA072F78C8CF89CD3CBCA0E33DD03BD6ABC8F7090F
A55E2A005125DE313E4BDD4935801CA4002417338678AF4380DC79BB01488D8B
D4115CA79C6278F37D30F03EE95296CB4BFA4E835C223A54DF4F3C603FF6C161
7DB4716DC07AD4D9D06AEC0AD47D5439BF85B07645E432DB8FF679008420BC24
123CBCEAA5B96C55774871D94AAB9724407AF4387236065EF725ACDA86491080
247BE7192D751980D4B0C88197C1067712E540E0D251670CBA5FBBD4A319EC18
A4965A1663471D147253280EF687229DCD10EA01EA75105624DD53647A0FF56F
52F2E969BE13CE0DE5BF010F06709C8C11B069A940E6F0A8CCCB32B2AE739BEE
F0B0FC40564C142042998154D531A4B1D415DF983A67CA941B3D0072800610EF
69437C779ECECD53B6BAC300A42605032BF51D1848ED30E515F23ED2BE1878DF
71A9BFBFB096AE96D6B2F87DD85FDD0AD6475F18AF8AB302FA982C0C508F5663
8C8DC590EE3F4BFD09F733A70517C3C533F40F97DC4EB47615DCAA133ECFC2A0
67F9B634D665ABB03A8F8ABAF612567A00D1251740296586BA504080F8EFCD40
FCEF93946F986F719D025EC200A40645BE95736BE456558A7240D84FDD3B436B
67376145885E56394D13DF23D4594095BED0CB9D4B62A7AACB4C3EEB0E15566C
AC07B4F38CBACA5915B7AB3D973329C063437CE6F2D68AEE4AF338661E0E7975
8780330FC77A71CF3C7C5CAB4ABD2C01A28B04CAF3C2F21FB24FC62A2ECDD14A
71B255C0F705BD0172A006900013908DEEBCEB4E5FD146E392CE07769E861B3F
3C603503901A130CAE749AE380DB5ECB62904DCE2696D2CED30783CB524F78B4
47F35F3AFDF1CB7F0ED2657E4C7B51977BA4D3D7E32A94FF28C4BDB0AFDCC3E3
1E3DC0A25C9EFB19E7FF0B78D08C97FD5FBF2A3CEA3EE6111E6ABD20F0F0CAF7
01CD2AF5063E9A1F804899356DDA14FFA1DB6390238F386A551C2A67DDDE3009
0690B2825ECD16320288B5C18F9F1BB7C500A48644EEE23757546EACC3ED3E07
CBF377206DAAE5D38AE930B7CD9ED0EE46C252A2B3EE109FF0A025149797EE46
F9E723DC137537A723BD8B766ED6F3010F2E57DD8FB44B3EE19174645DAFFCE8
F028E9401E5DA9D103E408052001D407E10152D176F93F37BAF3EE7401721000
52500152FDE6290620352252CFC0259CB5B52C9ABA1E82C177912CC7A93837DF
D9512B470FEEDE2837C3A57DEA1BBEF5AB0047798650FF14E5EF8AE9FE68FE4B
58DC60F701F0205CB8ACD03DF565ABB00AF3BA431E15E6CE7D491420872B00F1
BF1495294074F1004A7C00D164A3BB320088D000E283A406203520185CA90B98
83B48596354F580AEF5FB5F274B86360C13DB5F2F4E2E6FE05A32346C53D1087
D5D0C68898EF93339A2719AE1DF0E097F45251DA0B3D8E998796EF0A0F353FA5
9947E96308A579A49947FD87D400A28A374C7205108F6ECF993275B20740F63F
50B3C2F28DD05C00C4E3C66DD9EA8EBBEE3000C9B1C85DFCB8CFB7FE23E4C64A
FF708B33857AD4874C1495DEE954927367CCCBC34044EA4C68C1755E440851FF
411364C6E3FA08FFE6B21B77183C8333100084FE1F2331C83509060FE5B38187
AF7A031F5D3941801CA100C46514AA3C9D5B8068DD0E0890B2929E30C91D40B4
1BB7C50024E78281B5A3B076A06CAA9C260436633CA82A7519E2048370C93456
157EC9693E7B66409F0DF685BE1A27D94B6621EFC9DEDA96965E3D850548CE6A
8E634815C08333A7BBD0CD96F987879F7A398147C5F3B26720690144154F98D4
04402073A6860648C58D973D905C034491ADEE3400C9B5C8E5286E06A56F874C
C5F5018C485BA53E95DD57220D11E5BF5A5A4D6DE7E66CE8D0CEB2B29D92CF46
84FB611FA8347F869657D2928B26E823B8AB20E0B1A5282DD715978D1D1E6579
350A8F8AFB8E060F4A3600D1A56CFC9C356D7ACA00E9018014B20448B96C74D7
3D77198018894530C8F24B7A2B523B2DEB0D61E9403EA8529F10E17EE4D431F0
ED9FD0F8871D27CBC7F539C83354CA25A8F369C47BA1B73AB7A01DA5E7011E6B
E0F01806B78EA5135515E37987874B1F4B1FF3018F9219EF637900882A856C00
A2CE40FC692B1A12400E024082FB811880D486C8C8B4B4785A41CB223CE871FE
5695FAFC490C12A51852A599CBE33EAF4BF850993D03755E09D867C262B63A63
91D6648CD67B89EA3B0278B4152513E5E2D6A513A9C3C3A1CD08F0585C148B9A
8862D342C10E5C994F789474202580B44A04208777AF074800676F00646AB600
51C5BDDFDE00394002248423644600D16720557B6E00524382C1979B2A515FB0
8696C5652C7A9CFFC7471BABA0DC1701AE79120E6FA3CEEC807DE57791B0A0EF
CA39EA35E5B21C7D57E8F1FE2BE0415DCD2D18CC0E2C15F07A7B77038BAB6EA3
982A3C7E5850F8E296FF2E356BD6872DDF5FA6C5926683369BBFF38EAB2CDCA3
604740CE141EFAF3923A909400A28B07505207488F1E479601C433C44A7D963F
80B8D77795F40172800448B0785D06203912B9547400D2DEC2F20CE70F9A0E7E
F72A7E1EF403E18F727DADFA0F485DE3DCEF1CD73A048765D0E6B880F5761556
00C44BA5EE847B915C877FBF21F369C5D501FF1E2643B35F8BC1ECB852E53CC0
43390481C7BB3F367DF9F8B9ED66FCB8B0409F1B9A4C738F953F2FDCF1E75DFE
B1E6C25E185C1C7E9D6E33131F10085B4F3B9F2C407A54B7C292A20025738094
F5CBBDDF73A64EF302C87E075800F140A54B4E7600F1D13925D300242722BDCC
A70AE7ED68E940783806DCCF65597ED967894ABF10FA831C1187731FAEC15854
FCFE5F14C45C57DE0797CAA86C5F2CCFD164F72261CD9ED8C7838465064C73DD
2118CC68CE5B08050FC73CF93945787CFA4BD377FA3ED46EFC4F7F14B8A70A03
4ACE97E9F7E64D44F1E67DBE3B6BE5D68BFFAFA2BDBA8FD9C0C35AC25A252580
E8E23A40CD9A3E233F00A9EC755DBF7D02A4A285824BC375923A400E94000918
301800B9D3002463C100CBD9041D0557F728F62AD22EB63E017596C7E176510A
F151261CBCFAA2DCD408FD590F87638505813F3DCAD1D7647D3558A35C666330
D13334DD07BDCA4F43EA20EACD75BB6200A3677CF3ECE1519E17644F8F1F1634
F962D09C65467CF44BD39F70820061E8187E66704942A478C486F3D719BCE9AF
333174B4A8BC87ECE041C90E20AA945B61E519208ACC99366D4A088094D5701C
B237BA3B23809475CDB3DFA5FF1B80642CD44908CBA37C7D1FC5AFC6C07BAA52
979170E94BB1B7568ECB5D8C69352C447F180AE53261F97AFCE6518ED65CFF92
FF7C0C656F57F2D6125678F7F334DD07BF75CD253CB6C700C6DF569BE4E0E195
E70D08BF7B7AFCFE67E197531E6B7BDD8B5F37FF4658F02034B99FCAB7F2385F
566AF9E041DF8C6EDBA2B86F76F0707E8EF900882A854604908A7B2F7DF57201
10C7EE95FF73AB3BEF3600C94AE47E188F206DA99CE6179050603CAB5E487B28
791C90D6D2DEECB929D424A4C3B4E6E920C865AF9901FAC3A526EE2678BE977F
8904C1D9488FD29A0BFFE69215751923ECE52E197EE572B6A73B3C021EEB88D2
E655C55582594E458447DD21203C1CEB15C5A22562E195CFB71975EF072D6909
47BD07FF2E0407B71326507E92E74B0079A8F33717B769BEE4E4FA265C94DF81
E0E1A39ED773147904086720D3D205C8E11220C12CA6120088251BDD7DEFDDB9
0448D9CD1A806426DC035C587B7AFC5DCB1A8B3488FA03B944F43A5247257F7B
E43DA7B5452BA61B84B5FDABFD13784C589659BF081F22CD75E91D3EC156767B
9425D816A88119718E7A0DEA642E5114FEDCAF8426C077D866C38007673834D7
DDD4131E751FF3098F2545B178CA9B4B4D19F55A6B9A3673D9D08607C14B7870
F96A0106E292A7FF0EDB6E5778ACDBD797346F523CD36AC20B022EF75DB55E70
78B0BD818FAF9A1840BA0320855A02882AD561D28000B2FF81D20A2B1042B7BA
CB00247591D65653900ED1B2184E9D61D7FF90E5F8C77C16695BA54C2775DF70
A54D2E29716F0D7A79D341908E82DF04E813EB3D8F3A8F5429C73E71696C1ACA
3EA5E5FD4D58DBDA3244CA7C798E66C0FFC5BF67011E9C2DDD8B51EB1FF98347
A0F856C5073E6C71F7D067DACE1396A5150D0318938CF0E0ECA3A4FBB0E161CB
922B3B5C849FE739A9C1C3EB392AED250D1051B6A5AD2FC90020474880F88ED7
45F106C8FE122061FC40320348D9DD54F70331004957E49B3E07E0415A16670C
FBA87A07946570C149C2F621B0741BEBB96DDEA4380B728326DF3B62A2DE11BC
06EA4CF6599E0A716E3CF5AAAAFB907954C013467CD3A6D5D15F50668C34D7C5
ECAAD83B3A3CB47C5778A8F9B1C143BCF475F3278E9DBBCCED9885101EFC7B11
1E5FC94473EADF30002FD69F5BF1AA0E1760D03EAFA21F659749171E94440172
180052F0DAD2D6513204888FDED567F90348801BB7251F0071EC7859CF0D4052
160CB027084BCFA00AFF069C317CAF94A3629C7B7DB450CA11329DA244C175E8
0FB7B5DD1EE98A80E6BAFC22D1DA8AC7916A5DE4D15B9ECB61D40D5CF8FEA95C
B56204E0E2D0F255A2DA83C7073F357DBDD783ED262D5C5CB04D75090C7BE641
90101E8E966BC52BD7642899F39CAFE572DFA57F8698B1F88407257180E84B58
D57DF472021097DED5CB9C69D33D01B2BF029040BE20F9054859C70B0620298A
B470FA1FD232CA6946DADD4D8D31259782666BE5F883DED58FB77980FEFC1587
BE48A7D93E1B21DAE88CC3E64817AB26BF5221BF88E730FB380AA3D6048C634A
44E16A839EF23927F0F8667E938FFBCF6937EACBDF9A70C98AF0E05215E38A11
2084C72F18785DA3140320437138DFF9DEB28107EF7FC0E3AB250890C3254002
2D0DCD9A914B8054743C0840FCDDB93C5B1B00E10CE49EBB0C4052120CAADD71
98AE9CA2D295BE1D6F2B653611D6776E25A51C07E61E4E5BBE46E80BDBBF10E9
44B4FB7BC4B6083CEA73CED137B7023C30C329CEC238A5ECD59E477878D7FBF5
8FC2F7273DBACCB0D7BF6B4650F079D1C2CA8607FF8E3456F80303AFEB2CAE1E
2069C143CFAB8407251D80945FD9556438F7B4017278F77A800450230320533D
00B2AF0290601E7A1BDD63006244130CB4347DBD5839750D06DC9395FC3585E5
75DE51294345ECF128371CF9347F5D49575E87E807ADBBFE8D747610457B9536
E981CE7B390B6D7E5BEAF8B0AD30C3293E86716AF9FA927EDEF8ABC0A32C2F79
782C5A2C160C7DA6ED0D8F7CD282038CEDEBC1E766C3833059E8058F524B57AE
797E6919AFACEB01E1E1552F043C28E903A4BC270E326BC64DD901A4AC77DE30
0900105FF75D97993A400ED000E213A20620298A83FE83E148188EBD28FD2608
8F4D947C7E19870A2B0C086363CD43E2179D965AB342F6810A70860EA1CFC67F
23DE4F53255C4953D9EE389A01031E2B4B78AC577E3BDAE79CC363F112F1E7E8
D75A4F98F2D652F465A1DE83330D1B1E75BE1EBAC5959314AF5C83CB57432BEF
3B3B78F0E38027A803592A2380E8521AB93200480F05201EEA8AF2AC080071BC
EF3A0140EE491720FB1D300D77E73803F18089014882C24082DC2449F9374395
732328F54FC24D9AE8B5CD70E634E3EDA4E4D15A8BD0A12EE421511F278B0359
2FD50F23409F683DF5A8DF70EE1EED706B5B5A5B7187C20F8535FB7855EE67DE
0623D3FDF8F74EAE66B77587B8E1E1D0664878602828DEFD7ECB5B2F7FA1CD53
A21E1EB6B92E97AF088FF97EE0516AF1CA35A840BF204FF0E0FF063CB15A6200
394C0224A0252B00323D4380943F3137014C620448F935B30188BA84553D5E17
C500242191BA0C46D2BDD08E662B2D97E867D14929CA2FDC18A4E391E827C1BF
23A3D5D2839CE6B5B4C2A235D61EDA252622F5096839D51B87DF8278A7BBB4D3
5158E0A05511DFAA39A07E867627021E988914A9E739243E78C8CF29C283FF3D
FD45F3874F797C99FBA4B9AEEDEBA19AEBCE7732D77593E215122069C1A3A24D
C5044EA9970640D4733E6092238078F67CCEF4191E00D96FDFFDCA0052F0EFE7
BED13DB3320648D95DB9F67BABBB0D40028B5C061A8C34CA76FAD3F2A9CB98C7
8FC2DABFFC7494FB97CC63CCAB279196D7AA51417E94B0BEA50C64385C58CA73
3A1C1EAA95E58FB233DA5C18A0CFDC677C63D4B926E2BD33FC0AEF85CAF75FA4
53240708FA9E14970CDB92A1DB4FF38447DD472F735D771084014B90E08894FF
7EDFECA57E73DA4DFB6371091EB6C5950D8F92C515FF3ED5F41E6557BC620D9A
325FE87C1F42C419DFAAB23DE51968ED250A9043BB5B00F1F7426B4B4E0152D1
F36000A96CC27560E6DBA4FBD69F85C0197ED0458FDF5DAA17132A500C40028A
5CEB1F8DD44758A1487AA89647324AEE3CA48D956A5CE2E88772136419C6BE62
68F355B5E61F403A580ECC6E0E875C4ED9CB6F8812793D46C8ED212C0F715FCB
2DB25E333D1A2FCE712BDA6138FFBA5E1EF01854EA73D161173EDF16440EF5C2
CC3C9443A09907E4CB5F9BFCAFE743ED47FF64EDEBC1A49BEB5289FE47107894
5ABF627500445CE8782F3145D6756BAFE0D1DE8027564F1E20BA780385A6EA97
04BF5A2053613D8B3AC840FBDE881240A6850748794742F8AB078CBD5EB54A70
D9EAEE7BEF3600F12972098A916A1996DCFE53CC13D6464EDFCBE8B8546EEFAC
557D01E99F9A3E640359761D87B2E385B5CCA5CF3C3868FF1DED7C1DA0CFAB09
CB6B9CD1751704A8C75D03F983E2F2D974254822DB1B2A2CBF0F654BDA2DF9C6
782BC6A396D699B8671E7EE1519E1774E6F1D382C2D7C7CC5D66D8FB3F352B59
56897A8BAB2FE491E05E10141EA52B5CB13AFF0E17E5091E944C00A24AF0FD96
AA883F6244BF4E8C00A9EC50C02E65031303900082C193B30A2AC197D2B238E8
1F8C74BDB0F417AABC2B2CEFF1CF1DDAE3521721B289A82E1FC9763E0CD05F2A
E6B96475BAEAE5EEA31E97A568E64B053F3DD5E900F96F7BF6827C5A847189AD
9B5CB6DA4A703F93A2686FB5908F65ABB2C1D3B39EF579C1A2C22FE73CDD66F8
939FB7E03215614B58D8D175997C5B5C3949F18AD52440D49349C2C37DD94A6D
AF0490EF3304485987E3868947CDE09CD1A50A40F6D10012F20EE29D9DC4FA80
0D40028A8C3A4B7D536B2D8B834D5BED1C7F8CF41E7FD7A3BD1571E00E823B78
5C9683D86E4ECB461EED32422FE1C181FF7F01EAF16B445F95DB6DAF77A93F21
48B804C3C193E6BAD4FFBC03787013AC273110AD59DF4A0065AF9BC5952B3CD4
FC20E6BA6E03A9F5EFC54BC4A27FBFB8F4E8DBDE6BF5BEB0661E6A8044CEF8B8
8CF57B10A5B92E0048B91F5082F1ADCAEEBFCAB261AE00A24B30DD899F06039D
AE9215102031DD458E806200124264FC289ADCB6F328C6E5AA3DFC841E91CB45
0CE3DE55D4074EB4E565616D53FB46B57694F6F8A71F8A741FEA3D1BF0DE1883
6B6BD4BB583B4FBD4D3F610DAA0F21FF31C083330ECE3CB6AA2F590D1E11671E
15ED39D5F31F96BDF4FFA25832E39D56D36F787969FEAD188AC42940E27CB718
577EA50C2009846557A5EACC43C91BF0C41AF905882EF9024A4480C4700719C3
C40024A4483F08CE1C5676C8A6D5CE011864E7046CB393B096C0F836CF01EC41
A47B9D2CBDAAB4C320875FEB91727DD6A59100773DFC18F5A76B791D71D804E7
EF053CA8EBA0CE43B1960933F3881B1EC1661EF8AF38F7D316B3CF7EB2EDC3C5
7A78101804C797A23EBAAE6B8C2BBF0280D0DFE79274671ED5DB4B1220872A00
89597F9B0798CC99E105907DF7D95786738F5B41EE56257545BC014804C1802A
EDFA2B848AD7CED5F6D648A84F1CD0B96BE10D11DBE1A651CB0A6B47C1F27D2D
866D69ED09522C99324B49121E6A7EACF010AF7DDBECE9C173DBDDFAE792123C
D400891C48A9370A6CAEEB262580148B9A755136CB56E566BCE9004497588192
8D22DE1F40CAEBA6039350D70A0E93ADEE3100092518600F1096EF464B97225C
43E7D2D35D29F6899EEE5D8415D430F2802797B3B8A7C7F9EA2C08003905E30F
15ECF24B1540D9EBA6F328CB8B031ED5EB7DF24B93777A3FD47EFCAF8B4AA1D9
19E38AF0B02DAE6C5F8FC0E6BA6E52BC7C55EE917269E5FD0B77487882C5051E
81DA4B1820871C560F904414E44E8DA5069339336E0A0890CAA66B1A28062021
04032BCD74E9B3D1BA4A510EBA7D31F84E49A14F1D84655E7C52D025AF2AEDEE
83C33668B3E4BF00781C8CF1874B5BCDAC12B5A730E77FDF2F287CDEEFE176C3
3FFFAD29416FEF67AE46D7E5BFAB06480C22E500093A53887FE6619F1CF0C49A
E90044979A054A5DCDE800296F32C73071BE1600728F014800C180CABD2FF89D
D03DC9198E845EE69DB4F3B4DAA193E7B0383782D2FA4465366704A7E21A3F45
6887DF9021481FA19D5BA51930BDCEE980F81DE0B133C61B0E086DAC1A798447
F57ABFFD59F8F1B4C7DB0E7BF1EBE604856AAE6BFB7A101EA1CD75DD04003943
94FC88C20CF6F1CF3CEA75201901A4EC26528289C7B5425C070099EE0190BD25
4072A1CF48E45A06200105832A9DFC7A6BA7F9467EB4B0FC43A6221DA0E57320
A2AEE4E2209EE03EFB439F0D46F8BD1C6D7F1CB12D7AAB7366D14A5831B8D645
BA01EDBE0778AC87F1863B224AA3811896AD3280C7A22562C1152FB41935EB83
96F4ABB10324DABE1EAAB96EAC7FA7520F4A00295E567ECBD9C283ED0D78B243
F60029BB29EFF12C8DD9895F3F107F0089D8FB50037C3AD7DAEA9E5906204104
832C97AD1892C4F612E75256677B5326E4B794F97A5C327EB1AE433A392E88C8
7027340BBD156DBE18B1AD4E38EC282C1031BCFC81C2B2E47A1AF0A0232143B3
6F547F2BEA6D091F6FD30EF5AAEA3CBCAF1534444971895832E1CDA5268D7BBD
F56B42940548B443B3070E9018448A97AFC2E8C597D777290084EBFE599E57CD
CBDC131EB2BDDC0144978C97BABCFC40AA0184F6EDEEC1E7FCF79EBBBF6D585F
2DF48C81536BDF03BE8FEBF40340DEF5D396917A91C11447206D2AACB8543F39
E47356402B25FD8F301169601C7A0AB9BFC8FB34AB8DD80ECD863943EAE36071
B514C61BB6BFBB7526EFF070AF77DF872DEEB8E8D9B60C636F0748A49595BD9F
B96DAE1BC9D7C34BEA00922378501206089756B78BE91176C420DFC12D33C0A8
CABFF7DB9E25FC41EB45006448595EB1C2463BBAECBBCFBEFF14D69BAA4B877C
DF3AA7DD6BDD7BDFBD89ACA51BA9140CAE5CEFA702F9527BA73D799E6FFF4BBB
053594F91C9469FBAF3B07D209F148D40DFD239533066ED6C4808C97E8410F3D
EA71FBD93F51FE39E51C7D3F1866E3759CBFCD3E0F7834C378C37858475B6702
0E7A71C223C2B215E585AF9A3D7AC2A3EDEE5A522C99EB72B64860D8F020487E
8DC3D7C34B8A97AD4223872B022F5B95FE59FFEF829F7A3EE141491220710A60
C4EF629FB293E1662757DF3473C6A949F431298074C4E1035F1DF08609157E1D
0010DFC1F48C8417B91CC5B025F4107F05693F0CB09F06A86F2BA519E2BCA996
CDA55146DEFD3144BF18F6A49BB042A73C8144F35D6E253BBF4A3D02E73861CD
649F45F97BB47C2EAF3C643B400220DCFCE83C2BD70B1261661E5E79EE200833
F378FFA726AFF67FB8FD94F97F9699EBEABE1E8BE2B4B872120B20C52B9CFA58
FE2188C5959F19A1F6596B6FC09354A2B7AE05803C83C3F6AE05FCC3A43F0032
36893E2605102A25F9C7593650679C61B20B00F24412376FA45EE4E0CFB0EDFD
94D3DC02763FAFD8562E6DF51556F0C116CA69FE50770E12A74AB6C5E8BD270A
CBB28B7B9BD32C94DF874EC2F2FFF8C6A5DE0AB22C97BDF8224290CC47F9B132
9F31AD186A83FB7C2C043C8EC698435D8E169A3D217854B4E7542F5888121EBE
9E5FF8A8DFC3ED477DFD7B93F9F2BEB9DCA89AEB121EB19AEBBA49F1B295F9D6
7B6565DF5D9E63E99FC9C2A364C65B9A81E41B208007BFEB1F8A4AEB4767F156
C4EF3273E68C44C6D06400B2F7BEBC1B2E19585B9246B3B63A0E001996C4CD1B
A9170CA8F4183E4B3BCDC187F1AD9E0FD11E670C938565A9F5A36CE785806D50
99CD59C249F61E2432682223BC724D77276129C1DFD7EAF105869182CF45DE57
CA791A02705642B85D252C05FF4F4B6ED892C623D47BB4B24AD6123CEAEBFDBA
487C7FECDC76D7BFF343333E6FDBD7C3DECFFC5BF9F75C9884C59593D4032421
7854CD7331E3AD0D805087FCA608337A96C384B3D08E00C89749F43311805000
112A4F7B3A5F3550531367DD37AB77A01A467C8B9C79F00D9F116755DD0507A0
03B9E7B7D46F70031A5A64FDE0777327D4A3C5069D0AA9FF08B44D80840043AC
5FA48786977DE68C84CAE1BF22DDA8E938A8C7B95C9E7F5EABBBABB0625F1DC3
FD3D000F1A06CC15A510EEF958B67284479565AB858BC5FC0B9E69337CEEA72D
3F93CF85F020346C8B2BC22311735D37295EB612B701BEAAF2193ADC7F0A330F
FB30E0A99A0048776199CB47958F0094750190448C259204087FE0D5B713AD0E
935791B600448C223D01C1807AA4B036746AAE9CE6978DDBCDDE84D419890E61
5BC8321C881E12D6C0FEAA8FF697553796F2D927028B009882BAAF7994A3E930
97B8081BEA38EE56F2B87C763ED253383F4BABD71CE7162D19B6E5AA18501E15
96FF8708A4EC758484173CD47C2F7804F7325F5C2C2E1AF5EAD213A6BEBD1467
65840701AF8666E7DF2C31735D377107481078B8D4F3529A7B066FAC1980F085
EEE4189A9A3DF3E69BF649AA9F490284669081A2B3BAC0846BB96B0220DF25F5
101AABC8D84F8C60DB4A39CD3754C29FC109E97341783471A8CEBFCBB1188827
26D02FCE105E46DB0FF928CBEF19032A7230E05BF758653741F69BDB2D73409D
A07AC663E6C13566CE8AE4BE2431C0A32C2F1D7814315ADEF15EAB9957FDA70D
C3D8D3AA8A4B7D5494ABA1D97F4B1B1EA51E5EB61207C0AB73010FA5DE80A73A
D60240E8C4EA6FCB6E6FB902003923A97E2609107AF07E28DC83EFF9E85DDDA7
DD009079493D84C628185C69DDC1015ADD148A5F06EA4268897486FCEC3547E4
804525FB8331F68B53F796687352803A5C863A56583B25AE22340F78E41F26AC
99CAA5A51D056FD8927E2B338465D9256A151EFCDF939FB778E8D4C797995D4C
38347B18295E2A0112141E15F71D1F3C287907C821071FC6173ACE1C4BBFCD42
34EFC14301909B93EA6B9200E1DB1FFF48EBC6D0DCD9B366CFBA347A33462852
39CD8D9B56D7B2460A6B20A6EDF9285139F358E270EE2D61ED9911796D5DEA27
A818BFCC2B8E1697A774C7446955C525AB79C232F33DC736F395B0DC97F9EF9F
42554E49DF231DA2C2C0C3AFCE43CD8F1F1E6F7FDFEC857E73DACFD042B3DB33
0FCED8E9EB115BA0C9A052BC74453EE37F393E979497ADD47AF907C8A1343E7A
DE757B0AFF40E1AC732300E4BF49F535318050F6D97B9F997C1EA50B4573C2BF
0F00D937B18E3632C1805ABED5A825B722F1ED9F71ADA8BC53678E84032DB418
AA9D83423FADEE76612CB5B43E6D800337863AD5CB49502AC819C8918AEF712A
68E44E878CBDF424122308734BDA65846524700AA183D90701C9102B4DFC5947
A53DF3F053AF283EFBB5E9BBFD1E6E37FE87854DE8E7A1866657CD75630BCD1E
465C0192D1CCC3961A0008BFAFFF2E3F1B0A26FC3EAC0A8024166D206980C829
ACC3858301856F53AB022299BD4D3524C140CB01F66FCAA979C2D2236C8B4467
BB364A1EBF207C9BBF54D6A5229D66B36B28657AE8BBF905EC0FF74927D04EB0
636CB994E3D2130D3368A2CBB03B8C06CCD9CA62A50CC1478F78DBCC9733269A
01FF0C7870F7437A9E370F048FB28F59C303A45828BE3A666EFBE1FFFBA92975
3E7C5EAAB92E8F84C7822CE151EAF1A52B4A439AFCC0C3D281AC957780F03BDA
C5BD8487036179D60380477CDBEB3A5D2F5180ECB50F7FC08F8B2ABCF009936D
0090AAFB6D1BF1166902CB65A70D94D37CE3A135127714D49D3FF926748ABD44
85FA746CA263617BA5CC01BA977780FED0349871B408A9AF3DCAB1DF9C51CC41
B927E5396EFEC41FDAE9740654CADADBD4B2BD59F405013CB696F7B74C7AF070
6833223C162C16BF9EFEF832D73FF7557382C2F6F5D0CD75630FCD1E468A97AE
506E89E91B1EFA33F68284D7DFCCB95E9E0102783495FD5AD15F0D4F985C0080
0C4DB2BF4903846FB2FC03B5A9C80C0E94530190AB8591C882019666ADAA691F
071B4E735B6845E908D8C75E52423D5A2ED1547677A50CF356571DF602F48333
0A7A2A8F41FDB7AB94ED2F2C1F945BB4F374B8E25249690F0F798E3F42CE98A6
E3DC2B80474761BDC8AC5ECBCB567F2E117F5CF3629BD177BCDF8ADEFC766876
DD5CF7F72C2CAE9C0400A95F8AC9C1CCC3AE37E0E9B5F30C902D71F88F881478
B7AEEA9E37DF72536C062E8E574A12201440445F2EA972CFFAE9BA8C07009044
A7638D45A45512979CBCBEA4F72175B1DFECA55F05E36475D3CACD4499C342F6
833BD63D8DFAF37C94652812BE718FD315ECC86380452AD0AF60A814FC9B6FBE
6FE1F3FD800767543427DFD29F62DC6BE6213F8799792887A061D97958522C2E
9EF1CE52D387BDB234C3D853694E78D8E6BA0488BDAF4762EBDD41C51D20F145
D6AD3CEFF51CE50C24DF0051F4469184DF83156EBE6566E0D87341240D80D021
ECF460BD723CCB1FCC2AF7CDBE2F177FE85A10B9EC43DDC2AB184C672AE7F986
3E11E94897AA84FE3ED41B28EDD0426B80568E03D70EF4E80ED1B79E38FCE157
7722FB70B070D07BC87C2ACB6976CC01F50BE48F073C08BD3B91F64E051E7587
30F0F0AA5714733E6979EFB94FB57DA458EFEB619BEBDAD175E76765AEEB2600
08E3905D9B0B7828F5F20C9083BB1D52B79F48219AFD2E5F34B60140121DE053
00C8DE5C2A99152120962AFF0440AA3A9719B104832A3D81B944C481E5380CAA
63943C2AC3698D4543077B8991E5187A6488BAE707CA32BCFBB95AF3840BF706
793A44BF18E2644BD4BD2A445D5BEF7106EA2FD0F2784F748EBC479AEB4AE8F9
197092804779BDB0F078F5DBE64F0F7AA4DD2D4B8AA5B74A9AEB121E7680442E
6171F04B3CBA6E50295EB2BC0510E5BEFCC1C325AFF431E0B377A8975780001E
B422FC5094EB174B120226D7021E2725DDE73400C237432AF75A54E6067E28FF
BEEFFEFB8604ADD4180583692F1C1879D60EAB6E9BE25EA999BEF2EF438B260E
BE2FEBD16DE5264E5484EA71B2B82BE1FD21FA45A73F8649393DACEF88A2F738
4BDDB3C416CC3CF8C5928E9045E54B16073CF43C353F88DEC31F3C3EFAA5E99B
BD1E6C3FF1F7F2D0ECFC1B71E0233C5209CD1E4600104601B8AEE2FE33840725
C700E1CBCF7D7ECAFA00CA8100C8DD7EDA8A22890364EFBDF6E69D329470490F
1271F75F2A5A37014472A124CCABC8101E8C38CB2527F5A1F28FCD25C573F525
209776186B6A92A88C93D50BF5A786E817BDC4A9AB38C9CB5CD7675B657A0F35
0F00A13F0B0D009A5557CE66048F8A7E549EFF6E41934F07CC6937F2B35F9B72
C9CA0ECDAE9AEB721698A9AF8797A800C90B3C4A66BC4FAF93578030EAF83141
EB39C084BFAD0E00C83741DB0A7CEDA4014201449C9640C2C08483DE6600C89B
8977BAC6455A3871331F4E637588D0CB9C3E178B3CEAEF292CFD811E278B21D0
AF1501453A0052A17A866D2D15C33D72F644C7415A71BD52EAE00D5BD2819033
A3A56B0B1EE5EDFDB6A8F0E3298F2F73C3CBDF34E7B3E2EC83F0E0670E785CBE
223C520BCD1E4600101A3E5C9F5458F630F0A0583390A5730510C0832F6934AF
5F276A5B000A9795774A5AFF51BA562A00D9736F06057BCCBAA24767FCE59C01
805C218C54153913E1D6AD4345E5E365A4DD9EAAFF84528F7B3AD3FCAF9D9645
D3D873BCC28CB8F4C37600BC4EDFBB2386FB63BBA368060C7870AF0F9AEBAEE4
CF2CB4CADB6F46F058B4442CBCF8D9B6C31FFCB8E527C2820761619BEBF2ADD2
B6B8CA2D3C4A7772C95F8E2D58413903C2437D565EF008534FCE407EC81D40B8
8CCC586ED1225F5972D12DB7DE7C5E1AFD4E0B207416FB106985CA1E7874CEF9
34B779DCE9BEFB67E7FAC79327C140CBF01D1C689B6B59B4F83854DDDF430ECA
347BEDA495A5027E5050BD85B49EE297F9C1300A77ADAD1D7160E20C885F5C5A
F7318CFB5CC0838E577486DC301C3CD47F24010F3FF58A828AF271AFB79E34F1
CDD66F082B343B97AF6C78D0E2CA8647FE97710110418054B5764B0F1E949C02
849BA49D134353BCC95D009027D3E8772A00A100227400EBE659C81F4CB806BF
3E00F2412A1D6F2022F7FD20045A69599C19765595D1288B37F892C3E076F214
43BE1FE6B5E4E5715DC6CDA203E0AD11FBCFA09C5C12A1151E231CD01B7E11DA
9D0278F00585CE919D628147595E7AF0E0A7591FB4BAFD92E7DA50676847D7A5
89AE0D0F5A5FCDCF93AF87A71020453903890B1E61EB955961E50F20DDBA1ECC
65796E8E16D57C97DF95B5009005511AF12B6902A4A7B07C0F02F4CEF5F4C900
48F5CDAA8C940906613B50E2D25A166DC6F75777FEE34650C28A1B25645EE01F
18DAA009F77AA87B5DD0BA5A3BB4C9E5B225CD8B7FC1BF39DDA7AEE386F74F59
8EDF122ACC7BD4323C28CF7DD97CEE498FB5BB07B3103BBAAEBAAF073F67169A
3D945CFC172A8487E5091E94BC0104F0A065A2EBE66C0181321DF0E89156DF53
04C85EABE1F01E2ED92A5403E5CFF0B9D9F7CFDE3E958E3730C1E0BB9BB06614
BAAD39433ED3AFE303A52C41D34CF50909701D8664E01EE46706D59968ED3038
22DF62CF473B5FE8F9987DC8A97F502B27ED5CC6F078FFA7A6AFF479A8FD9485
8B0B5CB6A2158DEA28580ACD2E726AAEEB2A172F2701A2DD7F86F0B0ACB0D6CD
1B40E8EC7BB69FB23E607238003223ADBEA706100A204205E7CE5A17C234458F
A40D00917753EB7C03120CCADC6F804B54AB68599F0ACB03FDB5E0AD96B5CF48
BD0C5372A2BE6F47957A058730259D84B5974785DF08E0D11787D1F83A283E2A
29C343398485C757F39B7CD8EBA1F6A37E5850179A9DC0561D05736DAEEB2A17
2F375894CCC9338247459EAD03C90F40000FFA69D13D21D4BE491A50B86CB52A
0012680BE928922A40F6DA73AF5278779FD656D5E482D90FCC1E9A5AE7732452
D1CDB7BB995E116CABB4C1F5563A2D75D4B2D8DE416115DED2B496B17CB8AF87
EF383C32D616671A0C80F8A896C7D00EBB220DB5ADC6000F69665C5466B47ECD
45D50F59C1C3FAFCF31F856F8E9FD76EF83B3F34E38FDEB6B8B21D05BF95FFCE
3C347B28B978B941B8C711E58F2C2B78D4E7E50C207CA1E6F7BD49D4B6009307
008F54E305A60D1052967FB8BA8715C1B1904B2E1B0322B5A1508C5130A0D2A3
BC14E34A58FA894F42B6D35158CAE78DB42CBE011FEC674F72AD3D5A79D142EA
CA20F1B1241069224C453BC1F02EEADFACE4F32D8D5EF55CC6FA04F0E09AF13C
0C08CBD5B792243C5CDAAC0A0F877ACAF9858B0BBF9DFF4CDBE18F7EDA828398
0D0F35343B019C8BD0ECA1E4E265011031A2FE31049B2954AD17021E3C0C7826
5700A14FD680C80D5932E0D6DB6E1913BD19FF922A40287BFD73AF17F08BDBDA
B133DE5DD54FB0E3BB01208F8A4624D2AA89319EEC1025F4ABA0EEE2BD80EDFC
5358BBFA717B5BEEE5B18D56844ADCCE7EF73B97E6BAD447DC893A2F04EC0BA3
B6BE837AB3653B5C9A6A6D2BDF71EE7C1C1EE63E2080073DD09FC09F7FADFA16
DC40E0050FF9D971494BCF7307445878D05CF7FA97971E33F3BF4B71195635D7
E58046787046521BE6BA6E72F1B2DC6172A427844B1FBD667761A0E3DDDE8067
D6CB0540000FCED6F9BB5D216A5BC2FA0E750440BE88DC5200C90220A709CBA2
46E9854BE7BCBBCEFF4D06408E4EF5061214B9AFF74148239CFC2DE4F210F732
5F4BCBE20F615FD479D9E775188B6ABCB0F42034EFE5F21115EBBB6945B99CB5
39DAFDD2479BB4F9FF186503C5DF413D46D86D8F7A63B5F3DC21710761E965BE
E78C04F0E0FD635654DCAEBE641578440444B89987F700869F5CF196775BCDF8
F74B6DB80DB01A5DD7DED7C38EAE5BDBB36B02A4C8979D7CCC3CEA96B0720290
AE5DBA1D21ACE0A5258968BECBD5823D01905407F42C00B2B6B0969F9A3A1608
06134EF9D79DFDC0FD89C77C495AA4A92A77CCDB4C58213F4E77DA1B1CE518CE
9CBA0B3DE401973EB87FC7E355AEC381993E39B6EE805F3CEE5BCF37185A6F1C
A055A1DEE1822A6D127AABA0DCC880F7CC3F2BF525773BED09827C5ADA6D83BC
E13234FB4D18043AD7978863E6912E3CF8BFC73E6BF1E0194F2EF340B158E7EB
C1A52ADBD7A3F6CC75DDE4A26519097994E3F3287D0C010FCF7AFE6632790008
E0C1EF3E7FEF9D9CF243C0A42FE0313ECD7B28F5330380F0C9D0796DE7AA85FD
39161E0F80DC90EA4DC42C324E14DFDCD519C00461797EFFE1509E564ED45D6C
AA6511A874F89BED721D7A713F80D45639CD2F407FD419877C4285BE1FEA6E85
4F216F278FBE7336C0BDC6CF0B63AE2BC39CD0A3BC4CEFA10B00722DBA7A4279
B7454AF028CF0B1B969DF2E6F7CD9E1B34A7DDCD7F2C2999EB729990F0E0AC83
0319E1F14B838007E5A2F65CDB570092DDB2952A390108F58EB476ACAA3CF701
13CE60D701404219D44491D401420144EA956BBE7BEA9AC33FC296F73F707F4D
AE154BEB23BEF977D1B2186176073DBCBA528FA13BEE12D6328F2A34E53BCA61
EBD78D85A5F3D0D75BF977384ED9F3BC6C5A0D7913791BBBF4814B69B4AC3BD1
69B614E019D4E93D90AED741047830AA2B0122BF056E6FAB51741E6ABE1720C2
C5B7A27CF66BD3777B3FD46EDCCF7F34E1DFC82D347BED99EBBAC945EDB90DF1
E8CA67E56DD1165C5712C482CBD681B4C91A20343639214C5D07A0DC01787409
D35654C908207B3254069547CA5EE921D6FFEAABFC1D007924F51B8928D2BA88
6F687DB52C2E6774C240FA4E95FAD409D072690F2DABB48194B0A2D41651AE83
28592D5598ECF28DBF87B2E73967208C64BBAB52E67EE4EFED70ED32EFF0989E
87ADF7B8C00E9B027870C96A267EF8328E57420AF3BA83F7ECA220848F7A95E7
7F5CD8E4CBFE73DA0DFBE497A67C567668762E3BAAE6BA0B1B0C3C287500C96A
E6A1B7A9EA40B20308E0C1DFED8748CB466D4BC2A4330072675AFD2FBB7E1600
A100221EB1B102C3E4CEFB1FBCBF73D04A598A7CEBE616AC676A597C2BA555D5
B33EDB594A583386AE5A166764F402A6451443E9AFAFE53F8C7480BD2F875C4A
624890EE5AB963A983D0AE49EF70BE415D82BC4F637C269C8DF18DF56C865501
3CA80379103FFC65AC12B5098FDFFF2CFC74FA136D873FFF550B2E31101E8488
0D0F7B5F8FDA35D775938BDAF7C333A8372B8D392C7BD8994C0E00127C05C65D
F8B2B9F66DB7DF1A697F9DB0922540E85D4CF3D12AB4F00513BEAD6E04880432
65CD523058729F8EAB45F91A28BF04349D7D20605B1CD039C8F7F15985D63F7B
E23A3FC8FA7658747D4AFD81B0B69E55B7B76559EEC131DDDE8323C233D81D07
7A9FCF91401D8A741FE109787079EC71FCF057B34A27B16CE5171EE197ADFE5C
22165EFD629BD177BDDF8ACF92BE1E84871D5D9740A989D0ECA1E4A2763439B7
0092D6B2958FF6063CBB7E6600E9DAB96B734C1B187B6E93989ABC16F0487CEB
5A37C912207CDBE41FB16380EE7A655E07809C98C9CD041419199716136A7875
CE188EC0E0795395BA8C61C5D9C277DAD6B43CC7DD0687547950B480DB4D0B9C
C830D2176AF5F883E24CE809EDFA6CFF8DA09073B80FEA557A0BEB0DFC6361C5
E6FA1CEDDE0978F0F3A3F8B56F6695F65ED3D68B94C125769D879F7A45FB5F4B
26BFD97AF2A8D75A13B4B6AF871A5D97F0985FD3BE1E5E62032485F85641DACB
18205CA6A5C18CF55B8B66BA4BD90C0089147A288A640610CA9E7BEC49F3D0D2
C627E19E635925FE1837004452B744082232422D2D9DF49DFEB843E030973A2B
E34038D267624D79E35C02A1FEE30ADB135DBEC5D3CF865EEACD1C9AE29B0F67
381F2B6DD3D98BB3177526C4C1EE1094BB4BEB0783232E8DF313223E037B3BDA
E3199A44EEDFBE143E8F003CF85C18A2644FAB74909987969FA1C29CF2E0472D
EF3EFF99B6345CB0CD756D5F0F3B34FB6F35EFEBE12517B5EB8B417B6CF9491F
2F03A58FC9C083921540BA74EECADFD8C3854A7FAB7A0936103E85B4330092D9
209E3540381872D9A96CA3A3F0502E9C0B805C9CD90D55110C945410D3EF4231
1E287DC3E9C13DD4C90C562A9627222DEFD22C07A2A351F71EA50E4D6BB91C45
B35DEA4838EBE0CC6622CA2D50CA5107C5F0EEFA9EE703516EBCD60F9A5D7712
96DE23F49706EDD084984B7767E95BDB021ED2A8A0D8B7FED1284FA986E0F1D2
D7CD9F386E5EBBDB17174BCFD3F6F520380810CE427E6D30E6BA6E72E1325C52
1D57F69CCA3EA60F0F4A8600E1EF91337A7FA19CAA0F8447031E9393EEB76717
B304080510B94358DED7CE1D0C06137E1936BCFFC1077ECEF4A61C442ED970A7
BF95B42C3ADFD18C76B1431DFA57D052AA5A087C42A11BDA98A5D5E7D32BB8ED
22887CAE4FF7534EF1CBC0385B5768CB63DC2A969EE6274731D7956D71C6B310
ED4CD4F30090B3D105C2B450ABCB56940F7F6EFA7ADF87DBDFF8DBA202751EB6
B9AE1A5D977A90DA0ACD1E46CA0092EDB2957A7EC0B31B640510CFB18EE23ADC
550E847C19590F0089C50232ACE401203441F5156FC9274C4E0240AECDF4A634
91E6B6B4AADA50CBE212D4E14E3BFDA1CEDF846552DBB6FA154AC22FD46641A2
F34ABD09BDDE8F95A7A8483F55050ECA70E643A53997D8E60768BBB5ECCF33DA
79CE324E1556D893E9F679C0A33B7EDCB42693110AAA585C7929C61D15A95E79
E56D46F03217DFFEDEE4D37E0FB71FF1E5FC261C906C735DEA79088F8669AEEB
26172E431DD7F8C8F0A8C8F3D99E4BBD2C000278D0E997A1867C47DDAD0293AB
018F5393ECB3AF3EE60020CDF187FD8F287955079B6EB800855F8A7501914CCC
DA9C4406031CAA9DA6DFCA7EB619AD569E161A5C3BD797AD38C360D45A7E09E9
BDBD9F96CF68B51706EC1BDBA22E8ACB89BD347870F9EB5AD96ED578584A3D82
E92A61ADFD53C137559BD1D06A8C4B6A341AF80DF0D815DF017ACF2F1569E651
9697D6CCA33E0F338E1F4E78B4DDF56F7C570ACD4E78D8D1756D5F0FC2646183
B4B8729212408AF54BA169C2C3A3BD8C003253582183428B32DC7166BBC96D77
DC96B9D569E600A1ECB9C73FADA89DE55D0B7E33F5554E0440226DA31A97C810
E7F42A5F5D394D60EE619BD16AE569BE4A7874D0B268B97188BD1F866C97CE43
6AD811FA7C6C1732A448130D1E9C09D0517002CEBF19A01DFE15B80CF638EA3D
26033772D9EE1A2ED34960514F752BFEFD22E0F157FCB8E7E1DF2B260F0F8736
6382C71F8B0BF32F7EAECDC8873E6E498306D55CD7F6F5203C1AA6B9AE9B5CD8
96C61113EA1F53F6F0A0A40D902E0775D95CD074BE50681EB9314B6EBFFD8EDB
BA466F26BAE40520ED8465D2BB927389C030A173DBC60F3C94BD2E44EA0FFEAB
9CA20E615BA7C8B9323C09F524BA8D38156F7BA3CEAF5A79CE40EE514EF1C7D0
31C82E801EFDE60CE779B415C8C35F5A54FDAE9A23CBD0F1F4F9188A44EFE4F7
A9AF013CF0F72E321CFF0656C92ACB568E79F273C425AD28F1ADA8281FF77AEB
8993DE6C4DD0AAA1D96D8B2BC2A3E19AEBBA890D9010CB4C95E795BCB0EDC9BC
01CF6E78DE2B3FA60390CE0775E17B2D9DA6CB07FCF09642BCA15D0190C7C336
10A7E40220144044EE6D5DB5CB7E9B3C0300B9C26FE1A44406307C4A3945A8AD
A00FF232A02275413B6A4D7009E8EF4E31B150E7701CA629A7B837C8064E0AF9
807DA69F4A11ED4C0D588FEBBC0C0039D8216F0B61EDFBFC10F2C7001E5CAEA2
2FC92E5689ECE0C10F058FBC8AB6B501ECAEF75BDD72F90B6DF837B6CD75555F
0FCE326B3F347B18B9B06DCFFF6FEF3CE0E328EE3D3E7B773A55DB928C8D3118
0C2610C0F410AA9B5C30C536840E8100A127C023400224804D2FA926104209E6
11C283F770C1C64556A5B880E9066CB0C1807B956D599255EEDEFFB7E5B4B7B7
BBB7EDF6F6A4F97D3EA33D6D999D99BDFD7F6FDA7FA8985EC81E3CF48FF90C10
8C887C9742C44607B999D0A77812012410863B4800C1FADC585CA7D846F2CD0E
C2E01E4A10D99CCD7CE9D440D0843152EDBEDCC00B2EF42D937C627DAF132F16
82C2AF904354BBA7D2B9AEAAB6F2ECF0E398B4AA60DCE43CCC4D09692624A279
EA360AEB68FF4B3AD7F4C2AC76824784DE6695DB940CC123B1B1090FDDEBF4F7
2F5A1FADFE4D7DCF37E3C9733D36B0AEE69ADD89261140585C33DACE2D3C34E7
5A8587EAB85F002178E07DC0D20BA76A8FB918BE7B2EC1E375AFD3EA54810108
3466D418F887B93E9138DBB5BC940B1E2780FC369B79923B94D1073240B51BCB
BD625220FA2CD07C87FE9F0B3597623415E0F1A54E9C802C3A9D87680E9DAFF5
C26B33AD186A8C6687DF99D562E4B91C18BD0518C27BEE52CD71F47BA039EE2F
DA78624F1C858784810077487BBC8087D5E6A7E4636E9AADA095DBC39F5E5959
F6626B4C6CB65286EB6AE77AB86E4ECC594D2AF905FD9DD2B9237BCD56EA63D7
2E3EC42F806084296AD9692D9945A0C0161C490009CC0F92A001048B247D4E21
3F25A1CE66AAE34B713841E4DB6CE64B761572BF6637BE04A899A0DF473BDA0A
CD5C7023B250272EB880C1880EED78729C3BDC69FF07C58B746004D72D66C375
E5CE7BC0030B41AD97F3354BBB20149D875F5D98717BAFD2F10F1140B046047E
28848C3B45DDD43CD4C7ED8CB8B25263E9DCBFAB4D68B8A6BAD79FBED91E41FF
06465CA95DB3A3D68B7E90AEE39ADD89920062051299AD79740EE3CD3C40081E
F8E188A1FBC7D8BDD6C4D4FD72EAF4A9AEBC4078AD4001042288BC489BCB4C13
6D0F26FF9937BFF2926CE649AE31A033FAA7164E87313A878CEE6C9D78CCDCBF
0FA36BBEB210BF51FA305CF70EEDEC70CD7928790CF97D53F1162CA709B58995
5A3F5EF28A8297D27E719E09C1632C93D63089DA8387E67896E101BDB2BCE0DF
933F2E59C25287EB6E64DD69AE87992695C8A3B05CC023F1D11B78403E01E472
267990702DD9DCA17FF3080288E5B9587E288800C14A5DF0D9946FE57C0B3041
13CA5082C882F4B1654E729FC12C0AC79A9C862FC7E57ACD50B2F146D30F4647
A9730D63358AAE79DF61BAF04B09AE459EA438BE4E732EC09EA7E3E604E9C1A4
31346DA1492B26F787602E0886017F4EF0C050C63A263A4DCC6D786CDF2D6C9C
30B3FCB1DD1D82DA35FB7A39A00FA4FBCCF530D3A492DBA9EC1E4BFCEFC32CF3
E47FE3BAFB330D90B3279C8D66E9CFC8380D701D59A7AE9F367DEAD3EEA3F156
8103083466D46874B05EEA722E885A18B9008864B5ED50FEA58F3540E0E241ED
0F0B23743054F7BF8C5CA4D3B558F90F06599D430007CE112DCDE4D789137161
64549DD6EBAEC1F958440A107B0250D0390E17FD98418F5A0A7C717D44E75511
3CF0226119E3819969B6B2DA61EE1E1EF8FF9DB5D1CADBDFEE355B2E7F65B82E
8C1140D2C4E1216B52317E685C297ECE72B3955A3E00049E1BEED03DE8AC2D1E
4DF083A705ACF6216627A000C1C8A28F58522DC4D9B869D5F3BA8600F2ACA348
3C963CDF03861686153508D41EBE341AF524FFF247DB6758B51B308413C5575C
A403206BA4385EB5710D66A76322E04C6DBF877CFC274C7A7970FC458207DCB8
60F1AAE32C354BF856F3B0729DBE917A7959D14B7FFFA4F83D26CDEF003CD6C9
617BB71CAEABA749C5A881C2481F18949A87A24C02E4AC0967C376A16913AE7C
DC3A4B4C2499E0F18CD593FD542001021144E084CD6081244730C18B7E646555
65A0DDBD6B254F16449396DAA1221EDA4D46EEDF2DC68BFE8843298E3F3BB816
204353DA4A3DF8D0712CD5D9B0F2B632348FC1DFD77857F0483A965D7840B3BE
2978FDC1F77B008A4ABF070C118C5060DCE7645D938A3180A29A8CB9E665B532
124BF3BFFAB84B7840990208C1037945CD74ACD1390EE682C05DC9610490408E
E60B3240F6A3CD3296D613AD2D983C4B00B926DB79B32AD9A12286EBF6D41CC2
68A9894E5C96C8F1A23F027330EE32F2D46B210E14BCD214F7376D5AE4E1BA70
277363EEC1C3208DE2C738DBD81CFAFEC239BD1F6E6E17D6B04E806CE4B50F59
938AF1EBBB8ECAEAB8E403D987079441806068FE6B56CFB708939F133C5E4E1F
5B7614588040041174EEDE6A334B6607612C87134402E106C04C260E153104F6
4617861F3EB9E0ABEA16F5F05A17E94CF47BA887101340E43E1BD52FD01C6EB6
923E767EFEBA21F2CE9D0B7A4D5ED31846FB340788A249C598E0FA2F2AABF1C9
07B2DB6CA556260042F040FF20FA2FF7711A878EE582CFBC13A7CD981698791F
29690E3240468F1C8DBE0274D6EEE1629129ED0EB80639812012B80E29456494
0732091E033587D05C74998BB91E182585262B4C14DCEA617A8733C9B33066A1
031EAA85AA8C6A1166F0903FA7AD79E85CA3DAB871CB9E12B7CE7BD2D4CE562F
DF96F752F5F7F9FF971F8EAF1A35A0B9E5805E1DF1FC702C9E7CFBB8941C7DA3
27A4DE4BFC236876A8F39C7A8D145FD2975DE8BC4E73BED17E4D7AE346FB53CA
079E05D062701A85EBE8BABD74CB37A51CBD86875E1CA9F21A20674D388BCA51
784ACCBB4712A41FBB67123CE67815672614688040041118A5C75312EE6E09DC
FB0820F7663B6F7A923BD8D1BE7EB8E610F64DB0B32687265E6502E01F298E55
2ED398F0DC2B0FD705949EA67DCB081EC7CB692DE9CAF0501F8FC7E24D74C366
213922C1204E413F4EF5319DB2EADC9F0A96CEF8928E09C9D729FF09C679D62E
E46568ECB5300CD3FF8526F962A6C76CD4FCDCC203CA0040D0DF8319E7798962
742FAC0574C6F419D3023DA22F170082F6548CC83AC83013F69F173A3B4FA9AC
9AFF61B6F3A71519644CC6BB40B31BE9AC801F2987712A13003163FC3D97E9C3
D2B6689EBA81E25A27CFB2AFA7CF6F133C0E60D270E4BDD2C243F798FC3963F0
30BBCEEAAF5F6D1EBC0092D12F710B7D4706F109E9AE736AB41D5F170C78405E
02E4ACF167A10F700915F8C1FA673882099AAC8E23787CE2E4623F1578804004
919F3169348FA5A761112830CA2713445A2C9DED93C820A32900130E1597EEF8
A28F80B1761127FC8BC1C1E1749769C34B024FBBE8C4C77C10BC80CB31039DE0
81B6EF3A29DD7EC223F958B78387264EC1CA7566E5612B5F66D705131E90C700
8107879B530E18F7905B89F61F048F1BAC9C986DE50A405065AEA4E48EB29D41
F3E7F50001E4EE6CE74F2BD92F151690EACF24CFBD8E5C94C871A133735F3743
7EE578FA3069FE07D6456F94E783E079CC5A795B1946CAC145C9686FE06176CC
1C106EDCB2271FCB263C2CC6A713A790EEBA6E0E0FC82B804C187F163C576312
AF383FCB1933520E6268F86002C806DB19CB82720220D0E891A38EA00D9A5F5C
4D2ED400059DD1230822597573A22732D0A5B4E96F6735409D3830A90F4E17EF
763AE4578E0780984CE11EEDD2B6F2705DCC38BE2263F0486C6CC243F7BA2CC1
23E5BAEE0E0F07E94839EEEC2BED0540081E1875057B3448EFB80B98DC44F078
C251C6B2A09C010844108107D8DF1864C57EE6A54BF0453A9E20E2A87F21A892
9BC230D9EF6632FA968701CAEB95B76AD630478D080319EE50AFFF0111405083
BBCF7A538C669FAFF0505F67071E66C72D4033E5BAAE0A0F27E56431BE94E3CE
ED965B80103C3070E40596C6E9AB221B15100CDB3D79FA8CE9AE87D7FBA55C03
087E956329D8FD2C64CD4ED4F8325C35BF7A7EA0473C58953C131C4EECD0DC64
79595FB9A681B549B024F07D6AF0A8E2FC13465B611FC1E332A9ECE2A14424BE
C3C31BFF56D2A63BC1C349BEB4E9CF3D7840AE01326E02BEF753188ADEC1081E
832BDAE8C00882C7BBAE32E7B3720A20104104B33D31522964FDAAB40F19E0F8
0501C4D612AE4194BC5E083AF61E2643FF838DEB509E8F504019A07FE3E714EE
54D661978701A306086FBB2B081E68FF9D492F73512292B4F0D01C378487FAB8
4FF0103F9A345DF90A0FABF169E1A1735D50E06196E774D7251D776FAFDC0084
E0811546E1BBAE97EE093681A23AFB99E96F4CBFD675E67C56CE016454C52818
BA6914C6BB9C0BA2159AB08E27882CCF761E9D4AE5F2FD3532F21FD9BC16F36D
3EA1EBE6CBFF1F481BACE628F67BD0FF13E9F33C2C7245F080C3B8B7E865EE9C
25CFE1C1D2197B6BFD32D6E34B0B0FB3F2304B9F591A4DF365273E8BD7251DF7
C656390508C14372D1222DF99C5ED60D14D23078C61BD33D9BDCEB97720E2010
41645FDA6019D51E898C7833531D437B871044023B4BDD4C64E4319CF06BBDC5
A8D25C07BF580574DD0B9AFD187905F7F3E838FF988E4F2578A03FE41D7A990F
4C9C98D620AAFFE1F03036CCD6E3E3F0702E27002178C0506020C9AF1DDDD4D8
40216317123C2CFBD00A92721220104104E3A49F34CC98F3DA0946145D936BFD
2164ECE13EA48C8CBC6D97F574ED38DA6006391C34B66B8EE15717E6A1BC49F0
C0A4A9B9F49D3F397142D6E161E53A0E0F4BF9727A5D0EC103720810AC6A8A75
8A6C349D9BA8D3404DA5701E0124A7EC4D221B390C10B80A87FB808AB499B407
1314C80DF3ABAB02B7FA979164AFBDA399D4F1EDE881521C586E17FD1EBFA738
766A8F133CD007F212154FE72C79BBF0483A96A3F048C9B74578A41CEB22F0B0
9C2F1BF1251DF7DE3ED905C8F87113E0BD1A0BA2895EB13D7154226913856366
CC9CB1DAF34CFAA49C05084410817B138CC5EE65F51A8B304113D6688248E0E6
876845861FE3D0D174F51B6DEDC1415CE820445FC8BD3AF33D1EA397F9F6C48E
9C8087411AC58F7EC3C3E03A0E0FE6273C203B00197FE678CCF758408643D755
890B982073BF2078BC94914CFAA49C060834AA62E4AF6823CFB2F66C095C086B
3D1C4F105993ED3C1A890C3EDC8760E41496C2F5644535D99923669C3F86D156
D847F0B88EBEEFF036AAE3EC4FF5D9153C74E2EC56F0304FA37517253E1AFB1C
8407641520040FD4BA3160E78CA4032646C3860542BCE7104072DA00770580A0
4D12BEA34ED3C99EBDC2483D7D21936A229EAD97EC95645722F0AE3BC98D9F2C
39AE30C5D1217FCE97E3158701133CF0F24CA5173A2A9E6CF4EBD7B06F23EE39
3CE2F05B2E1929FDD5EE6C18E6E4EBFC85475CF2BFAEE3CE3D35BEAC3847B408
8FB8F820C4FF056FE0A1178777B2021082078A1CF39E6E4B1BA101504CAC0FEE
7934C12327DC9598663DD701021144B0880B4650F531C9AAED78E5EF05E6455C
411009CC6241F29C8D4729FC3719F9CF5CC685E537D1F7710B852D4C7294389D
E25D42F0389689AED9E3A5E2C97EC143B551E0D111676DCBB7863F7A674DDEA7
5F6D0B6F8E86E3A1A3FAB4F73FB97FEB4FF62E891D9C80895378A41CB75853B0
795D635B68EBFB1B0A162EDA58B8625373B8A96F617BD1097B360F3AAE6FF349
C5915879AEC02316671DDF34162C7D6743CF8FBED85E281AC2C1A54D7D87F4DD
7EECC0E296C1F4EE842CA723DD318F65112057D1E69FCC6EA779FADA097EA8A1
E63123A399F4495D0220104104A39030C1306C21DB76A24601DD5755533531DB
795444461F7D111F9191AF72198FB2B42D7CEFDCCBA4976909C53B93E0318049
C375F74D9442D207AD21D2ECF3101E3B5A85CD7F5C52F8E2FCEFA2E86CC40B08
9863967C5B984EBAED27BB8E1FB77FCB95F4B9C0BA41D4E6C1E83A8334EA5E67
0E8FCFB7E62FBE6B719FE91B9BC3CD723E9007F863EBD8A7B8ADF0D1E3375C72
40CFD621EA6B82E896BDB923B4F39FCBFBBDF4EAAA3DBE8E6B9E07BC9E5EFDA3
75837F7EC0C66BA3A158CFB4F1A53B9601A50308C1030373DE646997D34E237D
983C457B7F9DEB4D57892C762180E069C10D87CDD99C96608221765712445ECC
763EC9E85F4C9B3C32F2AED242F1C0D32FA0711396B6A5FF8BE9F37079B82E5E
FC5A7A998F114FF6051EC9C71478B4B40B8DB7D617FFEDC38D118C58819182FB
7D0C7268963FC38085EFFA69E32967EEDF72A790F4032238F0F8AA21FAE1D575
FD5E6E8D090A349A54F9105DC694E4C5F25F1CB1FAB7FD8BDA87588787491A33
E01CB1232EB4DDF7C98027E6AD2DFD5E4E77B32A1FBB95E771C5A0F58309240F
8504160D123C2033808C3B73FC614C9A2CB88787A3AD2409025A0B4E7A63E68C
465F32EA83BA0C402082088C207CC91CE93C16C3AF0D5E8E09049179D9CA9FBC
74EC89141E71E95D1780C02A82B7513C0DEA63040FF481BC4E2FB3D471E80A1E
66C7CCC1A23C85A95F475F7D7C49D12226195DBCE4F0ED05AF01186A9C000885
FC19E3B63ED0B728766A52FC0180C7EE0E61D795B57B3DFACD8EBC0639CD8D72
1E109AE4BC4191A17B35F57FE8A7EB5F8D08F11EA6E9C8023CA0B737F4ACBCFD
8381586675B7CEF348008442C1CBA77C79D3A092E69FDB2EC30CCB0820E3CE1C
87A6F0B7C806EC6F74AD0BA8A0AC4E7863D61B4B7DCBA80FEA5200810822F805
018353E24D8C495F996D14C6104496F89D2F32FA701F8276D9DF2A1DDE2EE21A
481B78D1C5DAE89B95FD040FB4F73E412FB3B4988DD7F0486CACC1A3850CEF79
337BDCBFB93984974F31BA9BE500C305638CDA21D29DFFC8293B4E19B677EBFF
74F687F8018FF4D77DB2397FC1756FF57B4D4E2FD2BD55CE03B60088E2B41273
9B0A679FB6EAF1F2FC8EF382060FF47B5CBDF0C0073E6F28DA243F8F06D5F350
0082E72102FDB203D61F78C3416B6B18D3E90F49BA9FBF36480F207DF6DC133F
9CB0B6C7B1C9677B32E20A19BC86E0F19CAF19F5415D0E20D0C811232FA7CDBF
04C1CB393F90181DBE74150411DF7C66C923A35EA570899DE1BA72B3147C633D
48D76DD41CEBC7A4E1BAF7D3B1EFB08F00723B7DD71F65BAC375FD8507B4A631
F4F5B9337B62F8309A47006FE461BDBC4539B4A922CC1BB3DFEEB28927EC5825
A0EDDA17CFBA6679EBDCFFEA8A1E2FFFF5B3F2C54C82078CED06391F4A8D44F9
41208270C698EF7EB96761FBE4ECC143BF9CB6B786379E5173E823ED31A151F5
3CD6C979529E0784C718E957D8DAE3F5A19F7F1416E20382020F480B90C2C2A2
ED253D7AE0FDAA486F316C8FB8823083FD0A02484ECE36372D8D2E0A103C4FCC
24BF2691516F51B292C2B0AA9A6ADFE68890C13F9F49EBC23F6CA50642E7E3D7
2C9AA95EA1702593E6757CAD3A8E61B970058349836B091EE7D0CB8C9748EA43
48FBEB57FD8F193CD4C7CDE091EADF6A4543F8934BE7F47C8149350F182BBCF0
30BC5B16BDFF5ECA1A27271CF7D3C8C20B36E1BC32FF5D94185C471FFFF945AF
67A72C2F85734B8C725B2707406417E523C9A8501E84AAD3BF3DA7242FF6BFC6
F0B63A50C0E5759AFD1B5B22DF8DAF3914DFA90639FD4A5E1AF49EC7B8538E8E
CE18FED9FB21217E847E3966C7F6A801120A85369796953F1A0E87C7A79CE80D
4C3EA53084E0617959855C529704084410810FA76A0A27E866DC3D503EA7308A
20B2DE754C1645467F286DCEA6701719FD6693F3903B345155D1790BE49AC8C3
14FE43FF2F52B96E7F09C380091E273171C960562C4690B6E6A1399E0178402B
B61140E6F6846F32C5F02A4D0E3BC960E97E71E38F0FC4B9E53A47E48D4F350F
D5B1A7BF287BE6C5E5BDE0027C832A0F9BF48C2E14BBBFF70432BAD3CDD3E734
5FDA345A8F6F634B1E000297FE9B54F95847F9D0ED149E76793FE1AC019B3EA0
2FE3D1A9F7CB9EDD51002208C2C6E2921EB744A3D1F104106B17DB5B9E16A03D
71E6AC3796652DB31956970508347244C540264D06EC276757BF109CC3042B88
8D25886C761C834D91F13F9449AE4B00912D06E75C4D9B063AFEBFAA7DA89100
2AF8257C0085A574BC92E041B59A781DFDBF97786240E081CD8A861001A417DA
8D95DA875803218365E82D99008267D13BE57EE2C6DF9A87F2BF0C90454C6574
296C3682207BA01CBF866764A6E6E10C1E900C10AC4CB95E950F00A4452F1B6D
BF8F0879A138DE91A393E3CDAECD9101F275343FFF620AE3F2F2F258241CB11F
91394CD04A702EC1637A56339B617569804004118CE9867BF3FCE4239EC1046D
DBA713447CF3E54F3080B19FC4A4D158DF688EA1690A4D51D7D1B10D9A63C81D
DC5137C2753BC1630F191E87892704A0D94A9D0EB1094B02080C961A20BA064B
BC2A0520D98507B6FF24804C595E8AD181895A14E5C1F8FB2202243E433F3E8B
F9D2BDCE393CA08DCD04905A1120EADA20F2D2CA8C747718137C8F0E0A3CA06B
161F32F1D31D3D4F8A46F3C644A3F90C0051D7401C759DA65E3269E6AC9913B3
9DD74CABCB03042288C068C297BFC137C364A485B5EF126A39804883A5B33D90
3C14171DE42F100C3ED01CC39A1DF753785CDDEFA196345C370EB04ADE8C6DC1
43FE6CD6AC62A1A33D9D7F2BF700B16B642DC2C3EC3A9D729401F20E4B06C836
A33CB007CAE41A083387474A1ABDA8B118C727F681D41E661F20F1F8D1BAE59B
259D5D7FD8C7EB5A4B8E2280303D80A8E51026AFD3DF0B092081F15E91297517
80C8C353D90DD6AE700414D444CEF4B9390BCEDEE07AE42D02C51CCD31F467A0
9FE365F47BA88F113CE86D89FF8B3E5E26EEB05BF3483AE645CD43FF3A770009
063C20C700C96287B95E7C6213965D80FC2124D54002020FE8F4EAC16C6B4731
1301926F0E10AD2C0005F91D31F3CD995DB2D35CAB6E0110882082262CFCAA3B
D5DE95B660829AC0993E77AC2315F063058334453DC150EEF7B887C287B45F6C
8B8D3D7124CE9FC8A4FE1021A8F080A43E90520700894B359000C003B20D90FB
CB52FB4092CADF6378A41CD38FCF3940E247B300290920EA1A88A3CA46D24528
9393081EDF653B8F7EA9DB00041A39BC02A373B0308CD4E6EFE19AEA2A9860A6
299AB37EF02B5F3244E0D30A7EAB1E570FF3956B2258730073489A092057D067
AC5A18CE0C3C74E274008FCE3E10BB00D94FAA8104041E88EF9F5F943F33E52B
BB00896B9CED65A7D92AA90FC4114004B906121C1902442DFBB66127C1640CC1
6391ED2B7358DD0A201041040B300122FD934BC2496C8617611D8DD3AB6BABBF
B611996B112CD09F01172477122C5AE5E1BA7FA4F02CFDFF25C1A3D3495CDA4E
60CD3ED34EF3C4B178531BDB01CFB94579F15E6181E569C1925C6226D061F230
DE791E03C4CCD88BFFC6597B4CD8DDD42EECCC0BC5F30B23310B2E45CCE3B30F
90D2CE3E90946763355F8CB5C5584B7347A8311A8A15148462256EE393FA4006
FB0D907853477847478CBE5391187DA7E2792EE2126509206AA5B70D188E7DD1
AC3767BDEE366DB9A66E0710882082E55B31EFC1782543F740C10B368120E2AB
DB1382066A573751B893C2751416103CEA081E8399E424AEB7213C1C7698B777
B0DD0BD746EA5EFA22BA78F9D670438C76F68CC623E71DB4FBA009835AC79615
C407D85A104ADE883510BB00796C5FFD5158898FC6C67E6D6368C5EB2B4BAADE
5855BCB2B93DD41E12E2ECD83EBBCB2F3B78C7C947F66E191A125824B5BCCCE1
01B90388ED9A42FCBBC6FC2F5FFDB6BC66CE9A5EAB5A3B840E02393BA9EFCE3E
970DDA34EC905E4D27265CADDBACC94835107F0002882FDCDCABFEBFBFDD6BD1
B21DC50DB1388BF7C8EB085FB0EF8683260CD834B63CDAB6AFDD38159D5E7D18
DB220224CAF2AD0044AB64DB8089A0B7103C263B4D4F2EAB5B0204228860012A
2C689FDE65B373986006F5F904914A3FF346108153384CF89A49F0F837C103B5
2DD4BA06B9AB79A41A955DADC2B6FB17163CFBD6EA088C89E2D6BB550EEDA5F9
F1BCBF57345E31A8B4A322354EF35FBF2B1A22DE01C4B49989C517ACCFAFBE63
61EF396D31419B07D15DCAE5076FFFF195876CBF956A253DD2C627FEABEE0371
0A107BF040A956AEE9F5C6A48FF7AE27839BF22C70CACD87AE3BF6FC815B6E0C
B398E67B6F5CF348EE03C93C4076B5871BEE5FBAFFB3751BCAD6C8E96E558558
695E7BF489E3965FFEA31E4D1576E255A406088202108723AE1E2678DCE5241D
5D41DD1620104104A390301AC9C6CF0F66172898317E43756DCD143FF326FBCF
6A5D795B299A2EE041F844AFE1816685071715FC7DEEB779E834545C7B2B8E0F
61E4C5618CA505F1C2974FDBF1507901DCC39B375B250FE3750B106B3585655B
F3965C55DBF73F687A639243C026390F8AA75C5C10BEF3982D278F1BD838912A
2661ABF0604C69C22AB30910F53C106BCD4CEF6F2EAEBF69D17ED3E3C96EEF1B
59A7CB789C1C79F4D855A70DDB73C7AD4CBB1AA219D419E68144BE1B5F777846
01D21117DA1F5C3AF089D96BF7582597BDF63B253ACFEC95D75EF49F9397DEDF
3BBFED18AB712B320288561680022F09D7CE9A3DCB9573D35C56B7060854317C
C47F31C9679473DF8BE92F8321151D1712487C73A846350F34B9A096354EDC61
DA09ACD967DAE721FDFFC986F0BBD75715A1DD172F3A5E700C5D6C609D4E0215
571DD19B8E6E3EE2C21FB7FC5BD0EDBC57DFAF73BF3B801875FA27DF17CD6FD7
D5F779E4F3AD51C533AEE265769BFC390190B0C00A679DFEC3E4D2686C88D54E
7834DD3D6D1B20BD54F340CCE0D1F9A1A523D47871FDA087D736E5C12BAEDACD
FA36D6E9F1570448413856FCE6C82FA614476283CD074724D780C41A488601F2
6943C9826B161F020F0A2D723E90073C1BB5FB7E34C145AF3D70CDE1570C5AFB
6F6673D540AB00497E8E292F39DEAB8B091EBBEDDCBBAB890364F8087C3330D4
F55EA641410680822FFB35049166EB9139170104799AE87987B9BC796471FEE4
375646316000060A860AAE5536CA9FD500C90B09ACA8EEBC6D9579218C80B3D2
19ADF48194390088328CD720ED897FE36CD5CEC8E71755F67B4E4EEF76390F9B
E46D124028144C19B1F6DC834B5B9F348A4F2DA5DFC731406C74702FDD56B8E8
AA77F7FF1FF95934A8F2A176192F028442E1ABC3965FBB5F71CB44A3F8F49ACF
FC00C8A35F0C9C3CED873E5FC965BF55CE83DA7D7F0220F49A15D78DFA60767E
387698D5F8211120ED3240F2AD0124F9B90AF3697316C1A3C9F2455D54DD1E20
900C114CBAFBADD1391EC2640113FB456A32EAC997E08197EA7DB20385D21E6F
E1D11E8BB7FE624EC903DF6E0FC150A95DADC37D0A5EF636C5D7133CCCD2265A
7FDEB617A2E1F8457AF1E90FE38D3800C80079149636FDFAC67EC1FA82F9B7BE
BBC72CD6E96A7DBD1C60BC5AD4DE72E1EDF7B961EB8E3AAC7CF77B4C59734413
9F224195B7A7BF740090B8C1305E83B27A7375E9B4FB3FDE1B6B6F00829BE47B
292EE3DB947CC8CF22F2EAD065A3F62BD93DDB4ACD4351A60182D50E2F5D70D8
7DDF3416E2BBA4FC185927E7079E8B1333BB291F804841EDA80F9E2B0CC72EB2
12BFA22480A86B20D65EF1B7299CF1E6EC3777DAB967571507882C8208BE907F
A57063BA733D80C92A0A1711443236669C00F20C6DAEB63DD7234DB395121F86
885E30B364D2FA5D224094F52D60546084776B1D05C270BD7BC1D6A7A926728D
5E7C29F761CC3940E29A3E10939A42ED9AC2D9772DEA0D972E5B996A81210A8D
5A57EBD0967BFA0D2A2FE8C02FE4905E7C90A081B46D80DCD7D36418AF7E794D
FDAEECD5C73EEB5F2F97BF525630C04D7A4E1B77DC597442CF68C7423B7347C4
61BC7547640C206D31A1E5C2770F9FB4A6295FF921A2DC63AB1A1E8A0091B747
2F792A2F14B7B58CB52140B44A7DCDF1BE021EBEF9BD0BBA3840542288A07A8F
E178D7DBB9CEE1E80DB4EFDE481079C1EB7CC87D1FCBC90E1C900978402A80A8
3DB3E285DFAA6778C52BFF7420D6ACBF4E2F3EBDFB8AF3402ACBED01E4D101C9
7D20699A996AD7141040C41AC806D53D36D03D74DBB63B1EEC33902088F56042
7AF1093AC6FEE92F7BBB00487A78405357114096F6AF96F3B146BECF263DC30B
C5EEC93F8E32F09E55782486F1661E201309203F68E2D7750B72FAD8D38FF9DD
011F4F1F56BE6E8095F8158DAB39946D6C2BB1D507420F16EEF84F2778F8E6AA
2817C401A251C5301544DCBB364827185AD4147E535DE75DBF486CF29118A2F9
2DBDF4FD3AF7A68147D2B1F41DDC2A80AC662A80D0CB6EE850B21320E9E10103
26D6401C0124DE3B253E394EEDFDA41AC81E6FB04EA3A8004477644DFCA13E03
19930162011E907380588307D231F5BB720064BE261F9B8D60CEEEC9FF095DF8
BE517C7AFBFD00C845EF1E7ECFEAA6FCEF547940FC49EF0681032F193C2A4CBE
61DFCF8BCFECFBBD95E845C5E2023B8D6A200D1D45760022C1630E8787561C20
3A2288E0DB84E6AC5F271DC81C50E088F11282C84AAFF2109B7C049A654ED3EF
F350FF63AFE6A1A82D162780F49828034431266B8D7E2D8A318800895F67B5D3
D61940F6D1D44092E3D4DE4F06C874966C7837A505483C9E34F2473084B05203
29B709103377EEA9652503649E261F5B0CD71CB9274A0061EFA7C469E6CEDD17
800CBE7B7553C1B79AB24AD406091E70CD8377F39728760208B303902DBB23EC
4C02482C9C9F0048940012320688B85C03C183375BE98803C44032441E6392A3
C2540A780F13F425A02D772A81C4F54369FBDB11C78505564306407261E1AAE6
A13D16676D1D54039965172083FE41975EA7175FE747CD305E470089272F2865
62146B57134016DB04483CDED984C58C6B1ECA0EFB00E961CD9DBB2A5FEE0092
1E1E90B81E487DC601F2070D40D62B00397DEC691818F292149FF42ED905C8EC
3565ECF71FEDA78247547469120AE90204936FCFE6F030160788890822301213
29FC9E998D35F70E26305A68E6B98320B2CB4DDAD169FDFAD92DE3F72C8E3F47
09DFA3F388D1882BEBF0801C01E48F833A9BB0F4D2A3F92E3A03C8DEC933D1D3
3847146B207600F2E01E031953F58130957F2F839A826380D8E8E0760E106BF0
90E68144B30290B2DEBD11FF1582345F2BC9FDD00DFB7E6119203BDBC2ECB277
0E64DFED2A6279A21FACCE26AC50487A9CAAF712DE23CE27786CB71479371507
481A1144F08DFA0D936A23D6262CD9048A0E4C3EA5701941E413A7E996876B16
5F7448FBC1E7FDB8FDF6BE4571ACB3AD725FE11C1ED8887D208E0012BF2E253E
F163EAF7509C0752D9DB4380A4D6146AD714B900487A7848A3B008205FDB0448
DC9E3B7709207BDB0488AA0FC4A89C54C7C426ACFA237D0548498F1EBBF3A251
34599DCF546F96F2C10A4090FA153B0AD8A44F06B0A50D45627F8754F3904224
2FC284E4B519A651B864F69CD9BECCD7CA657180581481E44ADA3CC55296C64D
23E7B5137C7951F3F93B81A4CD7E2C2244B0BC2D562EEC7D7CFF8E038FEC133B
6A77072B6A8FB182589C45E8D10B78FAC953F0E329491634731E042CF81C631D
D356E4AFA4F894B1FAA62366A0B6C70E3874EDAEF0213FEC0C976F6A0E956FDF
2D9437B70B25985321684B4A8073C3F0CECAEF4563B281751AAD0D6600697C60
9FB1AB7745FAACDB1529DFDA2294EF680D9713EC0A521F8594A7A55BF3372CDE
50B08A59074851436BF8CC358D91B28D2D91F286DDA1B2C6B67059473C9ED406
D279AF38AB59DBE3DBAFB6E7ABEF610E90493DFA53DC63D636E5956D6E89946D
A7F89BDB433DE272D9AB8DBD64F7E26CE1C61EDF2FD952F20DB308908EBBA3E5
BBDA43135637E5976DA17B34B4454A9BDAC33DE97B111284B83AF98926BAADAD
79BB5EFC662FFCA851809E16204D7744CEDADC9A3770534B5E69436B5E59637B
B8178122AAFD3E61DB1E173A9E59B1F7E25DED618C225B57505874607E7EFE03
543BD85753A8091D52BC8DED1DDDCE3ADADB5947478718E2B1CE7103BB6321B6
626701FB6A7BA1F8CD464D23128988B50E9D0E749C02D746D7133C1CBD73DD4D
1C20363462D8F0B368F322859E19747BA21586665E5B53576BBB835D996C4501
0E00CBE48026004C2E845BEC90A314750A5F1E8CBAC2AF7E71C6301913D3A637
4A1380B6872AF44C93060C43556655E33E5BCC0C969C67D440FA50E82B87C234
F9C08CE28D7210676F1B8E5E620930ABE3473E2216CA6993720F33D0CAF7E821
C7ADDCA794A57F563B5579C0B6C1B00622DDA350730FAC97936E4A76ABFC1C94
F2C2336F33B947587E1E7D55F7327360DA4AB5815DD168FEC591BCBC73C8C047
04BD6540152F5E70BF4FF0686B6B13433B85988E4DC3E982104A00448108E021
375FE1793F4AE1EED97367775BDF5676C50162530491936903FF4F7B2AFB7C80
098C0FDCB33F4B20B1F5E5965F60D49A8A9864AC61981480D87322992A7C7914
1F58682BDE61563B90D3A3A4A397BC2D4E738F0E75FCF23DDA4DE20FB14E60E2
1EA52C7DADB1452EE3EDF276671A80E4A9E22E953F9B95A5524E4AFC30ECA66E
3064E35EAA0A180C91EE1BA3B83151C2AE3400C9D7E403CF235D336DBBAAACB6
597C1E3D3579891A9D1F0A870F27E37E63381CD90F465EF4926BB28E34EC5747
4CAA790024088A4D4BAE360BA85A89B0409C147F021E143FD28FC1324F123CB8
41B4210E100722881C441B4C3EFB91DE7187130BD3090F0AAE2AAE2788D85AA8
4AEE0F81D12B90038C137E31BB0508841132CD4A303326725AA2F2FD957444D3
C41F57C5DF22DFC3CCB80B72BC45AA1049730FA419C67797BC6D496378C39AF8
11D23DC1DDAAF89B4CFB0D3ACB491D7FFA6507A4DA4193EA1EE9601E51C55F2C
DF235D3E62EA7BC8F7B1FA3C8A59E7772F4964C84BF2A2D19BE9E3B9F4392219
F78481374C0CEC572C164B04C0C4480A40D481E226B00BBF20704CB550BE5C1A
718038144104D5F1D7280C333B2F03B513182178F6FD0B81C4962750F9D76058
156C793135108C07DE5A18E10E33C32BA74190EFAD00CC4A1AD4F1A7AD81C986
314FBE471EB36614DBE47BB4A5BB870AC8115548778F0ECD3D6269EE1152A55F
B9473AB9C98752234D978FB81CBF728FB47D0566CF830C78A8A8B8F85421147A
9868B08FD82182A62674CCC9A153FA49830DD306EDE9822ABE449066EC9F337B
EE9CC516CA964B471C202E4410C1AF2A74AC635D114BA4F010281F51802BFAB7
09248E1EA26C405C2B1D34BCB8BFDD7BA8E2B67A8FB8DDFBD8BC4722DE0CDEC3
8F7C78768F5EA565FB9121C7E8C69F31FC9030EEEA60768E98AAF3328C0E3B67
CEDC39AB9C45C4057180B8144104BFDAE0C5F73E66ED5762421EC004BF02E122
FE0E82C8866C97051797158D1D33167D2FF0F2F00726F58924CBE0B5307F5B6C
BD4B53E9F42B091E7C8E874B7180782402C904DA4C617A2F8405B984094629DD
4FE169BBCD5AB9A6511523D33479D92F47C151D167E43EF1CAAAF95DF6851C3B
E65434509D4A1FFF48C1DA1A1EDEC2044D7A0F51B86FCEBC39A67D755CD6C401
E2A1082287D006ABA9D95AE0464F0E81F205936A43736AEA6B7D5BF9D04F1140
D05E7DA0F959CE601C0090FC9B0072B3F3D209AE081E873269CD9D71AA92B01F
9173A0A0B67125818377967B280E108F4510410D041E76CF65EEE65824C90650
F040E186E1F704910FB25D1E5E8B00B28C36075BBF22A760F23C01E42AE7A513
3C1138FAD3E62E26393F3419499651987C46E1E239F3E62ECD76797435718064
4023860E435F083AB8315A2ADFA135329445986048276A431309242BB25D265E
C93E40B4F20B288EEEF3FCFCEAAE019053479F8AF9253753B9E13D28B31F836D
7F407AC294FA5768FB2B824783BD08B9AC8803248322900CA1CDCB143A17BCF1
1F26980BF03C85470824ABB35D266EE51E206A05AE7692F3002170606422BC4A
DF4E61AFA41270FCD57704137CEF6FA3F08FB9F3E676C9E6DC20880324C32288
C0CD050C38DA7EF5DF040FA16202144CC47B96C2E3B90C9291239201E22D8FFD
EA8037BC57CE02E4D4D1634A284F9733C963427F4B259039A07C49E1D2B99573
BB5C136ED0C401E283860F1D86A1BE18B6F8208562D3AF7FE66102971AF0E7F5
6702C937D92E1BBBD2022429BFB90F939C030881034D55E8DF4053D5004D7EAC
9780373081319B42E11682071FA2EB8338407C1481046EADA7503842BDDFF0DD
C92C4CE0860233E9FF4220F934DB656355234754680092F14A9DE97D0CCF7676
7F0248554E0084C0015F7068AABA9E423FF3B3FD008A80A1EC37517885E0C18D
9A4FE200F1590411F80342E7FA8D4CC717951F3091EE93880FAE28B08E044052
93EDF249A7548024E74A776F966162230D8107C898516330841A438D2FA33CF5
B41F4346CAAE8AC2D5732BE7ADCA76F974377180644904920A260DF71D64769E
CF40F998C2640AFF4730D999ED32D29339405273A5BB37B840092440081A1855
089F6FF8857F063370C29985A1CF688E15D7CC2178F08EF22C8803248B2288A0
FD1893AB60344CDDA0F8D56F22DD4BC03A0FE82741E7FF570493C07C49EC0124
3957864782D3771228808C19351A03402EA414A2A96AB0C33CD9B9CACEC9F574
8FEB081CCBB257425C1C20591641046FCD280A4F3203F7F07AF20928984B524F
40C1B2B2330924595FE273E4700D403C36545986C9F35535D905084103AE624E
A07035052CA0A671CD937557315813063EB49E9E377F1E5F3530CBE200098808
245804E95E263513E4D9B9D6279860195374BABF585B5FF761168A48540A402C
17849902D3D49535808C1E39BA3FE5F7E74CF22C0D973C16DCECFB3E29733685
9B081CB657E7E4CA8C3840022602C9314CAA8D9CE0340E1F8002D71098208999
EEDF12507CFB129902C4B8205EA230D1CE052947EC17DBB14C02AE9DFBF90A10
820696B0C5FCA48B29A04F2ED18CEA577F86C57B61DD8E5B29BC366F7E253758
01120748004510410D0486042EE2F77013578661028FA6706E0890BC416155A6
6152317CC432810976FB409EACAEABF97526D3A5D5A88A9158FAF81DEB5788CF
22E300193D7214414318431FCFC7BF4C5A2AD73C65D983093C4B63F2EBBD048E
AD992C172E67E20009B0082470050137ED6856B0D5ACA5A7B4AFB43BA0A0BF04
4D5BD329BC49E10B8289E723630010A6A9815870E7920300114500A9F61C2004
0DCC0C0734CE66D268AA5E9D477D99A3E124D96FD17D6E25702CF1BA3CB8BC13
0748C0357C88D8C9FE530A7FA6F7F0242FE3CE60ED04EB2EC08123DAACE75078
9B60D2E22642457A0049CE936EBABB154046558C42FFC511F4084FA3ED9914D0
2C6A614DF5AC7790433F30C97BEF2B95559569972FE6CAAE3840724404121885
0B983409F10071A7C79DBC19040AD6717F8BC27C0AD5149611505A9D44940E20
A97912D3ED3B40468E900062B3D81C0184808179197B33A9768166298CEAEBC7
E447EA9B1343C7F7122FC2E8AA3F53F81381A3D1698AB9FC1507488E89408299
ECBF6292B7D3CEFE91DC8109B48EC202264105BFD29713507659B9B062980C10
7B4978B2A6AE362B0051EFB3506C960042B51B3467EE47E1448A75286D4FA170
10B330722A8030413F0796659E5859353F679D7C76577180E4A80824F0450488
6092576A47A88740F16154D766268DEC5A44E13DAA357C42DBEF6BEA6B539A30
1200B197D72C00A4420688AD915DBA002160F465D22A97C751389EC24F9854E3
D0CC080F441394D5FBA07F6C0693C09133BED8B892C50192E31A3E64287E89DE
498FF20ADA46754FF20B26E2099EDC0C13C43651F85486090C0C5693FB8A49EE
56CC9BB0529390458098272C71443AF402939A28018BC3291C49E1282679B92D
B49782ACBBA637529CEE83664CCC795AD895D780EF0EE200E9222290C0A7163A
1F2F615805D1ECA5CE3DA040718209C0126606BE984C12181080E8274E9D47E5
4080FD7539BD0F6A1C68B29C88EDFC6A0E8EAE200E902E260209BCA5FE8EC245
148A3B8F585F40DA8DB2BCD689919EACA90F22405273A5BB376761225E896648
787986CFB75A0E8EAE250E902E2A02C9FE4C72BB8DA62D8DDBED6E0713FF0132
5C05100F7FC9E7104C30C914F3811EA3B0707E751537345D501C205D5CC3860C
DD53305DF827004D5D995F273EBB00B15C10C639323C123CA060BECF7F28FC95
C2520E8EAE2D0E906E22024911937C1EA1567298E0A41A92834051E681040620
B60AC2FE4559040A9C6D3E4FF77F8AA0B1D6EB547005531C20DD4C041274408F
64D25C925329E49B9823E6E4905DF90093276BEBEB820910CB0561FF221F6082
8E71B8AF798AC26B55355596E6F270751D718074630D933ADCAFA47029857DB0
CFDCE664BEEF2443A3BA7C0748C5F0114900B1D9E96FB130AC5FE4314C76528C
D398B4A2E64202075F0DB09B8A03844B69DE1ACBA44584E0064374EB9D6D98A4
8DCEBA55CC3A4092F394B330C19C9C7F5178A5AAA67A93EB42E2CA7971807025
44208169C1A4B54BE500F718097393C34009144052F31468A0001458D7640A85
0F091CBCB6C19510070897AE0826F0AB04B719984FF23326B9CE48520EF59D04
1A20C9790A044CE0D8701E934653CD2368647D2963AE608A03842BAD08267005
0EA77D5884E80CA6331C38D0300140DEAAF71720C3340071C4055F61020FB8B5
4CAA6DCCA9AEADDEE2433171E5B83840B86C49EE2F8171C4E244586B6280F69C
6C3775E944957D807890D70C00653B852A0AE8109F575D5BB3D9CF32E2CA7D71
807039D6B0538646C84061B1A2F1144E679203C088F6BC6CD74E484FD6050920
1EE5D536500471D82D166CC2425FB328D411349AFC2C17AEAE250E102ECF44B5
13D446308A0BF34BD0E49558D44851966A27BE0364C4B0E1279381B7DD079201
98A096F11E854A392CADAEABE11DE15C9E8803842B232298E433C92D790585E1
4C5ACBA2AFFA1C4730497FA19EB20210A65D50CA7E8DC1891AE93E707F5FC724
27864B0818DBFDCC3B57F7110708972F92FB4E7ECCA4D5F3605CB1CE3BD632B1
304CD8354C020190E4647BD69F817E8B251416527897C2873575B5DBFCCC2B57
F7150708575624BB54D98B4935138463291C4DA19C42D8E3A6AEC0012439D996
60821715AE42B0B0D60774C9FB4C6A9A5A49C070B4BE3C17975B7180700546F2
4446D44A06533842DEA2196C5F4172496FB0E6775AA0041A201A61E12C8002CE
09BF641230D02485257FBFAEA9E7B0E00A8E3840B8022F020B16C6C24446F8EE
7A4E906A2E06D285C993756FE704403079EFB7147EA8ADAFE3CD505C81170708
574E8960B28C69D644B7D077B288C24C66ED2247D2896E5F2608D7DA8CE67902
C755DEA68C8B2B73E200E1CA29E90144AD6CCF3971E9FC9103842BA7C401C295
531A768A0E401CB1219040E100E1CA29718070E5947401A2566EC38403842BA7
C401C295534A0B10B51C73216BAEE99FAF7DAB9E03842B67C401C295531A76CA
100288600D206AE5064C3840B8724A1C205C39250920DA1A88F76ECF6D377779
0394E7EB3840B872481C205C39A5A132401CFBD17270BAE0DD45E9C401C29553
E200E1CA290DD5A981780A93349764B8239E03842BA7C401C295531A7AB20C10
AF8DBCCD4B32E4499803842BA7C401C295534A00442BAF0DBDCD4B3C020A0708
574E8903842BA734F4E4535400B16FCDFDA89DB8B8CFF3756F738070E58E3840
B8724A049049B4D93379AF7D4B1ED09AC9BB0490975C171217974FE200E1E2E2
E2E272240E102E2E2E2E2E47E200E1E2E2E2E272240E102E2E2E2E2E47E200E1
E2E2E2E272A4FF07F32856035B665CED0000000049454E44AE426082}
end
object Label1: TLabel
Left = 87
Top = 467
Width = 426
Height = 13
Caption =
'Projeto realizado com aux'#237'lio e supervis'#227'o da entidade de ensino' +
' Etec de Santa F'#233' do Sul'
end
object Label2: TLabel
Left = 225
Top = 28
Width = 32
Height = 13
Caption = 'texto1'
end
object Label3: TLabel
Left = 200
Top = 486
Width = 211
Height = 13
Caption = 'Professor Orientador: Henrique Felipe Alves'
end
object Label4: TLabel
Left = 214
Top = 8
Width = 35
Height = 14
Caption = 'Label4'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
end
end
| 69.929825 | 85 | 0.885209 |
6a37c1b2512ed29e7125f5149fa5d064b9a5f259 | 1,197 | dfm | Pascal | kolmck/mckFileFilterEditor.dfm | thiekus/pascal-launcher | 4ba3b32339ed56851c6d53333c39231aa143af04 | [
"Unlicense"
]
| null | null | null | kolmck/mckFileFilterEditor.dfm | thiekus/pascal-launcher | 4ba3b32339ed56851c6d53333c39231aa143af04 | [
"Unlicense"
]
| null | null | null | kolmck/mckFileFilterEditor.dfm | thiekus/pascal-launcher | 4ba3b32339ed56851c6d53333c39231aa143af04 | [
"Unlicense"
]
| null | null | null | object fmFileFilterEditor: TfmFileFilterEditor
Left = 228
Top = 107
Width = 452
Height = 193
Caption = 'fmFileFilterEditor'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Scaled = False
OnActivate = FormActivate
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 16
object StringGrid1: TStringGrid
Left = 6
Top = 8
Width = 429
Height = 120
ColCount = 2
DefaultColWidth = 204
DefaultRowHeight = 18
FixedCols = 0
RowCount = 50
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goDrawFocusSelected, goRowMoving, goEditing, goAlwaysShowEditor, goThumbTracking]
ScrollBars = ssVertical
TabOrder = 0
Visible = False
end
object Button1: TButton
Left = 272
Top = 136
Width = 75
Height = 25
Caption = 'OK'
TabOrder = 1
Visible = False
OnClick = Button1Click
end
object Button2: TButton
Left = 360
Top = 136
Width = 75
Height = 25
Caption = 'Cancel'
TabOrder = 2
Visible = False
OnClick = Button2Click
end
end
| 21.763636 | 154 | 0.66416 |
8385070a3fd21bafcabf3a9d9b9a676d7a0489e2 | 5,496 | pas | Pascal | windows/src/developer/TIKE/main/RedistFiles.pas | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
]
| 1 | 2021-03-08T09:31:47.000Z | 2021-03-08T09:31:47.000Z | windows/src/developer/TIKE/main/RedistFiles.pas | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
]
| null | null | null | windows/src/developer/TIKE/main/RedistFiles.pas | ermshiperete/keyman | 0eeef1b5794fd698447584e531e2a6c1ef4c05aa | [
"MIT"
]
| null | null | null | (*
Name: RedistFiles
Copyright: Copyright (C) SIL International.
Documentation:
Description:
Create Date: 20 Jun 2006
Modified Date: 9 Aug 2015
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 20 Jun 2006 - mcdurdin - Initial version
01 Aug 2006 - mcdurdin - Add UnicodeDataSourcePath and GetXMLTemplatePath functions
14 Sep 2006 - mcdurdin - Add GetRedistDesktopPath, GetRedistUIPath and GetReditAddinsPath
28 Sep 2006 - mcdurdin - Refactor wtih GetDebugPath function
30 May 2007 - mcdurdin - I817 - Added Debug Redist Setup Path
03 May 2011 - mcdurdin - I2890 - Record diagnostic data when encountering registry errors
08 Oct 2012 - mcdurdin - I3463 - V9.0 - Look up charmap root path from registry when starting Developer
11 Aug 2013 - mcdurdin - I3885 - V9.0 - Touch Layout Editor
09 Aug 2015 - mcdurdin - I4841 - Restructure version 9 developer help
*)
unit RedistFiles;
interface
type
TRedistFile = record
FileName: string;
Description: string;
IsEULAFile: boolean;
end;
const
CRuntimeFiles: array[0..0] of TRedistFile = (
(FileName: 'keymandesktop.msi'; Description: 'Keyman Desktop Installer')
);
CRedistFiles: array[0..11] of TRedistFile = (
(FileName: 'KeymanDesktop.chm'; Description: 'Keyman Help Files'),
(FileName: 'keyman.exe'; Description: 'Keyman Program'),
(FileName: 'keymanx64.exe'; Description: 'Keymanx64 Program'),
(FileName: 'keyman32.dll'; Description: 'Keyman32 Library'),
(FileName: 'keyman64.dll'; Description: 'keyman64 Library'),
(FileName: 'kmcomapi.dll'; Description: 'Keyman COM API Library'),
(FileName: 'kmtip.dll'; Description: 'kmtip Library'),
(FileName: 'kmtip64.dll'; Description: 'kmtip64 Library'),
(FileName: 'mcompile.dll'; Description: 'mcompile Program'),
(FileName: 'tsysinfo.exe'; Description: 'System Information Executable'),
(FileName: 'kmshell.exe'; Description: 'Keyman Configuration Application'),
(FileName: 'license.rtf'; Description: 'Keyman EULA'; IsEULAFile: True)
);
function GetRedistDesktopPath: string;
function GetHelpURL: string; // I4841
function GetRedistUIPath: string;
function GetRedistAddinsPath: string;
function GetRedistSetupPath: string;
function GetRedistProjectTemplatePath: string;
function GetWixPath: string;
function GetStockKCTPath: string;
function GetDebugKMCmpDllPath: string;
function GetUITemplatePath: string;
function GetUnicodeDataSourcePath(DefaultPath: string = ''): string; // I3463
function GetXMLTemplatePath: string;
function GetDeveloperRootPath: string;
function GetLayoutBuilderPath: string; // I3885
implementation
uses
System.SysUtils,
Winapi.Windows,
DebugPaths,
Upload_Settings,
ErrorControlledRegistry,
RegistryKeys;
function GetUnicodeDataSourcePath(DefaultPath: string): string; // I3463
begin
if DefaultPath = '' then // I3463
DefaultPath := ExtractFilePath(ParamStr(0));
Result := GetDebugPath('Debug_UnicodeDataSourcePath', DefaultPath);
end;
function GetHelpURL: string; // I4841
begin
Result := GetDebugPath('Debug_HelpURL', MakeKeymanURL(URLPath_KeymanDeveloperDocumentation), False);
end;
function GetStockKCTPath: string;
begin
Result := GetDebugPath('Debug_StockPath', ExtractFilePath(ParamStr(0)));
end;
function GetRedistUIPath: string;
begin
Result := GetDebugPath('Debug_RedistUIPath', ExtractFilePath(ParamStr(0))+'redist\ui\');
end;
function GetRedistAddinsPath: string;
begin
Result := GetDebugPath('Debug_RedistAddinsPath', ExtractFilePath(ParamStr(0))+'redist\addins\');
end;
function GetRedistDesktopPath: string;
begin
Result := GetDebugPath('Debug_RedistDesktopPath', ExtractFilePath(ParamStr(0))+'redist\desktop\');
end;
function GetRedistSetupPath: string;
begin
Result := GetDebugPath('Debug_RedistSetupPath', ExtractFilePath(ParamStr(0))+'redist\setup\');
end;
function GetWixPath: string;
begin
Result := GetDebugPath('Debug_WixPath', ExtractFilePath(ParamStr(0))+'wix\');
end;
function GetRedistProjectTemplatePath: string;
begin
Result := GetDebugPath('Debug_RedistTemplatePath', ExtractFilePath(ParamStr(0))+'projects\templates\');
end;
function GetDebugKMCmpDllPath: string;
begin
Result := GetDebugPath('Debug_KMCMPDLLPath', ExtractFilePath(ParamStr(0)));
end;
function GetUITemplatePath: string;
begin
Result := GetDebugPath('Debug_UITemplatePath', ExtractFilePath(ParamStr(0))+'uitemplates\');
end;
function GetXMLTemplatePath: string;
begin
Result := GetDebugPath('Debug_XMLTemplatePath', ExtractFilePath(ParamStr(0))+'xml\');
end;
function GetLayoutBuilderPath: string; // I3885
begin
Result := GetXMLTemplatePath + 'layoutbuilder\';
end;
function GetDeveloperRootPath: string;
begin
with TRegistryErrorControlled.Create do // I2890
try
RootKey := HKEY_LOCAL_MACHINE;
if not OpenKeyReadOnly(SRegKey_KeymanDeveloper_LM) then // I2890
RaiseLastRegistryError;
Result := ReadString(SRegValue_RootPath);
if Result = '' then
raise Exception.Create('Unable to find the Keyman Developer directory. '+
'You should reinstall Keyman Developer.');
if Result[Length(Result)] <> '\' then Result := Result + '\';
finally
Free;
end;
end;
end.
| 32.140351 | 123 | 0.715975 |
47b8761448dc5299dbf45767e8fc75328ed67b6b | 259 | dpr | Pascal | Demos/CrossPlatformLocation/Application/CrossPlatformLocation.dpr | barlone/Kastri | fb12d9eba242e67efd87eb1cb7acd123601a58ed | [
"MIT"
]
| 259 | 2020-05-27T03:15:19.000Z | 2022-03-24T16:35:02.000Z | Demos/CrossPlatformLocation/Application/CrossPlatformLocation.dpr | talentedexpert0057/Kastri | aacc0db96957ea850abb7b407be5a0722462eb5a | [
"MIT"
]
| 95 | 2020-06-16T09:46:06.000Z | 2022-03-28T00:27:07.000Z | Demos/CrossPlatformLocation/Application/CrossPlatformLocation.dpr | talentedexpert0057/Kastri | aacc0db96957ea850abb7b407be5a0722462eb5a | [
"MIT"
]
| 56 | 2020-06-04T19:32:40.000Z | 2022-03-26T15:32:47.000Z | program CrossPlatformLocation;
uses
System.StartUpCopy,
FMX.Forms,
CPL.View.Main in 'Views\CPL.View.Main.pas' {MainView};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TMainView, MainView);
Application.Run;
end.
| 17.266667 | 57 | 0.702703 |
47aac87045e63d044510c4ed26840fe05d4957ff | 4,763 | dfm | Pascal | sources/worldeditor/WorldEditor.NewMapForm.dfm | devapromix-roguelikes/forgotten-saga | 2f23be1d356d5469c935c16dfdbf5bb4fa1e2547 | [
"MIT"
]
| 11 | 2017-01-17T21:10:30.000Z | 2020-06-19T19:42:57.000Z | sources/worldeditor/WorldEditor.NewMapForm.dfm | devapromix/forgotten-saga | 2f23be1d356d5469c935c16dfdbf5bb4fa1e2547 | [
"MIT"
]
| null | null | null | sources/worldeditor/WorldEditor.NewMapForm.dfm | devapromix/forgotten-saga | 2f23be1d356d5469c935c16dfdbf5bb4fa1e2547 | [
"MIT"
]
| 1 | 2018-11-20T03:55:03.000Z | 2018-11-20T03:55:03.000Z | object fNew: TfNew
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Tools'
ClientHeight = 379
ClientWidth = 609
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poDefault
PixelsPerInch = 96
TextHeight = 13
object btnClose: TBitBtn
Left = 256
Top = 329
Width = 81
Height = 25
Cancel = True
Caption = 'Close'
Default = True
ModalResult = 1
TabOrder = 0
end
object GroupBox1: TGroupBox
Left = 8
Top = 8
Width = 265
Height = 57
Caption = 'Terrain'
TabOrder = 1
object btTerFill: TBitBtn
Left = 208
Top = 20
Width = 43
Height = 25
Caption = 'Fill'
TabOrder = 0
OnClick = btTerFillClick
end
object cbTerrain: TComboBox
Left = 17
Top = 22
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 1
end
end
object GroupBox2: TGroupBox
Left = 8
Top = 71
Width = 265
Height = 57
Caption = 'Objects'
TabOrder = 2
object btObjFill: TBitBtn
Left = 208
Top = 20
Width = 43
Height = 25
Caption = 'Fill'
TabOrder = 0
OnClick = btObjFillClick
end
object cbObjects: TComboBox
Left = 17
Top = 22
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 1
end
end
object btGen: TBitBtn
Left = 392
Top = 188
Width = 153
Height = 25
Caption = 'Gen Cave'
TabOrder = 3
OnClick = btGenClick
end
object cbFloor: TComboBox
Left = 392
Top = 43
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 4
end
object cbWall: TComboBox
Left = 392
Top = 8
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 5
end
object edNum: TEdit
Left = 400
Top = 88
Width = 25
Height = 21
TabOrder = 6
Text = '7'
end
object UpDown1: TUpDown
Left = 425
Top = 88
Width = 16
Height = 21
Associate = edNum
Min = 1
Max = 20
Position = 7
TabOrder = 7
end
object GroupBox3: TGroupBox
Left = 8
Top = 134
Width = 265
Height = 79
Caption = 'Terrain'
TabOrder = 8
object btAddTerSpot: TBitBtn
Left = 208
Top = 20
Width = 43
Height = 25
Caption = 'Add'
TabOrder = 0
OnClick = btAddTerSpotClick
end
object cbTerSpot: TComboBox
Left = 17
Top = 22
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 1
end
object edTerSpotCount: TEdit
Left = 88
Top = 49
Width = 25
Height = 21
TabOrder = 2
Text = '10'
end
object UpDown2: TUpDown
Left = 113
Top = 49
Width = 16
Height = 21
Associate = edTerSpotCount
Min = 1
Max = 50
Position = 10
TabOrder = 3
end
object edTerSpotSize: TEdit
Left = 210
Top = 51
Width = 25
Height = 21
TabOrder = 4
Text = '25'
end
object UpDown3: TUpDown
Left = 235
Top = 51
Width = 16
Height = 21
Associate = edTerSpotSize
Min = 10
Position = 25
TabOrder = 5
end
end
object GroupBox4: TGroupBox
Left = 8
Top = 219
Width = 265
Height = 79
Caption = 'Objects'
TabOrder = 9
object btAddObjSpot: TBitBtn
Left = 208
Top = 20
Width = 43
Height = 25
Caption = 'Add'
TabOrder = 0
OnClick = btAddObjSpotClick
end
object cbObjSpot: TComboBox
Left = 17
Top = 22
Width = 185
Height = 21
Style = csDropDownList
TabOrder = 1
end
object edObjSpotCount: TEdit
Left = 88
Top = 49
Width = 25
Height = 21
TabOrder = 2
Text = '10'
end
object UpDown4: TUpDown
Left = 113
Top = 49
Width = 16
Height = 21
Associate = edObjSpotCount
Min = 1
Max = 50
Position = 10
TabOrder = 3
end
object edObjSpotSize: TEdit
Left = 208
Top = 51
Width = 25
Height = 21
TabOrder = 4
Text = '25'
end
object UpDown5: TUpDown
Left = 233
Top = 51
Width = 16
Height = 21
Associate = edObjSpotSize
Min = 10
Position = 25
TabOrder = 5
end
end
end
| 19.205645 | 34 | 0.511862 |
83c986cbde4a564a9a68a6afed91f18063369602 | 1,450 | dfm | Pascal | Libraries/DDuce/Modules/Editor/DDuce.Editor.Sortstrings.Toolview.dfm | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| 62 | 2016-01-20T16:26:25.000Z | 2022-02-28T14:25:52.000Z | Libraries/DDuce/Modules/Editor/DDuce.Editor.Sortstrings.Toolview.dfm | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| null | null | null | Libraries/DDuce/Modules/Editor/DDuce.Editor.Sortstrings.Toolview.dfm | jomael/Concepts | 82d18029e41d55e897d007f826c021cdf63e53f8 | [
"Apache-2.0"
]
| 20 | 2016-09-08T00:15:22.000Z | 2022-01-26T13:13:08.000Z | inherited frmSortStrings: TfrmSortStrings
Caption = 'Sort strings'
ClientHeight = 394
ClientWidth = 282
OnResize = FormResize
ExplicitWidth = 298
ExplicitHeight = 433
PixelsPerInch = 96
TextHeight = 13
object rgpSortDirection: TRadioGroup
Left = 0
Top = 0
Width = 282
Height = 54
Align = alTop
Caption = 'Sort direction:'
Columns = 2
ItemIndex = 0
Items.Strings = (
'Ascending'
'Descending')
TabOrder = 0
OnClick = rgpSortDirectionClick
end
object pnlBottom: TPanel
Left = 0
Top = 369
Width = 282
Height = 25
Align = alBottom
AutoSize = True
BevelOuter = bvNone
TabOrder = 2
DesignSize = (
282
25)
object btnOK: TButton
Left = 161
Top = 0
Width = 120
Height = 25
Action = actExecute
Anchors = [akRight, akBottom]
Caption = 'Sort selection'
Default = True
ModalResult = 1
TabOrder = 0
end
end
object rgpSortScope: TRadioGroup
Left = 0
Top = 54
Width = 282
Height = 66
Align = alTop
Caption = 'Scope'
Columns = 3
ItemIndex = 0
Items.Strings = (
'Words'
'Lines'
'Paragraphs')
TabOrder = 1
OnClick = rgpSortScopeClick
end
object aclMain: TActionList
Left = 296
Top = 280
object actExecute: TAction
Caption = 'Execute'
OnExecute = actExecuteExecute
end
end
end
| 19.333333 | 41 | 0.597241 |
47709947b4fe4a2f744e4983d043cf39f7405756 | 634 | dfm | Pascal | MicroGest/StepByStep/MicroGest/UI.Documento.Preventivo.dfm | mauriziodm/DelphiDay_Padova_2018 | f200f06d9ec1eb5f0a28c7eb83358031c3576b5a | [
"MIT"
]
| 2 | 2019-04-19T12:17:01.000Z | 2019-11-15T23:43:46.000Z | MicroGest/StepByStep/MicroGest/UI.Documento.Preventivo.dfm | mauriziodm/DelphiDay_Padova_2018 | f200f06d9ec1eb5f0a28c7eb83358031c3576b5a | [
"MIT"
]
| null | null | null | MicroGest/StepByStep/MicroGest/UI.Documento.Preventivo.dfm | mauriziodm/DelphiDay_Padova_2018 | f200f06d9ec1eb5f0a28c7eb83358031c3576b5a | [
"MIT"
]
| 2 | 2019-04-19T12:19:42.000Z | 2019-11-15T23:43:47.000Z | inherited PreventivoForm: TPreventivoForm
Caption = 'PreventivoForm'
PixelsPerInch = 96
TextHeight = 13
object Label2: TLabel [9]
Left = 256
Top = 648
Width = 74
Height = 13
Alignment = taRightJustify
AutoSize = False
Caption = 'Validit'#224' GG'
end
object DBEditValidita: TDBEdit [18]
Left = 336
Top = 645
Width = 73
Height = 21
DataField = 'VALIDITA_GG'
DataSource = DSDocumento
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 8
end
end
| 21.133333 | 41 | 0.641956 |
478a7b76fba137363701b4ff3568febc1aae0326 | 6,010 | pas | Pascal | Lego/bricxcc/uRICFont.pas | jodosh/Personal | 92c943b95d3a07789d5f24faf60d4708040e22cb | [
"MIT"
]
| null | null | null | Lego/bricxcc/uRICFont.pas | jodosh/Personal | 92c943b95d3a07789d5f24faf60d4708040e22cb | [
"MIT"
]
| 1 | 2017-09-18T14:15:00.000Z | 2017-09-18T14:15:00.000Z | Lego/bricxcc/uRICFont.pas | jodosh/Personal | 92c943b95d3a07789d5f24faf60d4708040e22cb | [
"MIT"
]
| null | null | null | unit uRICFont;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TfrmRICFont = class(TForm)
btnGenerate: TButton;
dlgFont: TFontDialog;
boxScroller: TScrollBox;
imgFont: TImage;
mmoRICScript: TMemo;
btnSave: TButton;
dlgSave: TSaveDialog;
procedure btnGenerateClick(Sender: TObject);
procedure btnSaveClick(Sender: TObject);
private
{ Private declarations }
chWidths : array of byte;
chHeights : array of byte;
bFontIsTrueType : boolean;
charWidths: array[#32..#126] of integer;
ABCWidths: array[#32..#126] of TABC;
public
{ Public declarations }
procedure SaveAsRIC(const name : string);
function CharWidth(ch : char) : integer;
end;
var
frmRICFont: TfrmRICFont;
implementation
{$R *.dfm}
uses
uRICComp;
const
FontCharacters = ' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
procedure TfrmRICFont.btnGenerateClick(Sender: TObject);
var
te : TSize;
i, y, x : integer;
maxX, maxY, lastVal, fcLen, sumX : integer;
line : string;
Row : PByteArray;
ch : Char;
begin
if dlgFont.Execute then
begin
mmoRICScript.Clear;
mmoRICScript.Lines.Add('// ' + dlgFont.Font.Name + ' ' + IntToStr(dlgFont.Font.Size) + 'pt');
fcLen := Length(FontCharacters);
SetLength(chWidths, fcLen);
SetLength(chHeights, fcLen);
maxX := 0;
maxY := 0;
with imgFont.Picture.Bitmap do
begin
sumX := 0;
Canvas.Font := dlgFont.Font;
bFontIsTrueType := True;
//Get Character widths for every printable character of the given font
if not GetCharABCWidths(Canvas.Handle, 32, 126, ABCWidths[#32]) then
begin
bFontIsTrueType := False;
if not GetCharWidth32(Canvas.Handle, 32, 126, charWidths[#32]) then
Exit;
end;
for i := 1 to fcLen do
begin
ch := FontCharacters[i];
te := Canvas.TextExtent(ch);
if te.cx > maxX then
maxX := te.cx;
if te.cy > maxY then
maxY := te.cy;
chWidths[i-1] := te.cx;
chHeights[i-1] := te.cy;
inc(sumX, te.cx);
end;
// Width := sumX;
// Height := maxY;
te := Canvas.TextExtent(FontCharacters);
Width := te.cx;
Height := te.cy;
PixelFormat := pf1bit;
{
x := 0;
for i := 1 to fcLen do
begin
Canvas.TextOut(x, 0, FontCharacters[i]);
x := x + chWidths[i-1];
end;
}
Canvas.TextOut(0, 0, FontCharacters);
// output sprite
mmoRICScript.Lines.Add('sprite(1, ');
//output N lines of hex digit pairs
lastVal := 1 + (Width-1) div 8;
for y := 0 to Height - 1 do
begin
line := ' 0x';
Row := PByteArray(ScanLine[y]);
for x := 0 to lastVal - 1 do
begin
line := line + IntToHex(not Row[x], 2);
end;
if y < Height - 1 then
line := line + ',';
mmoRICScript.Lines.Add(line);
end;
mmoRICScript.Lines.Add(');');
end;
// output varmaps
lastVal := 0;
line := ' ';
mmoRICScript.Lines.Add('varmap(2, ');
for i := 0 to fcLen - 1 do
begin
ch := FontCharacters[i+1];
line := line + Format('f(%d)=%d', [Ord(ch), lastVal]);
inc(lastVal, CharWidth(ch));
// inc(lastVal, chWidths[i]);
if i <> fcLen - 1 then
line := line + ',';
if (i <> 0) and (i mod 6 = 0) then
begin
// output the line and reset it
mmoRICScript.Lines.Add(line);
line := ' ';
end;
end;
if line <> ' ' then
mmoRICScript.Lines.Add(line+');');
mmoRICScript.Lines.Add('varmap(3, f(0)=0, f(255)=0);');
lastVal := -1;
line := ' ';
mmoRICScript.Lines.Add('varmap(4, ');
for i := 0 to fcLen - 1 do
begin
ch := FontCharacters[i+1];
line := line + Format('f(%d)=%d', [Ord(ch), CharWidth(ch)]);
if i <> fcLen - 1 then
line := line + ',';
if (i <> 0) and (i mod 6 = 0) then
begin
// output the line and reset it
mmoRICScript.Lines.Add(line);
line := ' ';
end;
end;
if line <> ' ' then
mmoRICScript.Lines.Add(line+');');
mmoRICScript.Lines.Add(Format('varmap(5, f(0)=%d, f(255)=%d);', [maxY, maxY]));
mmoRICScript.Lines.Add(Format('fontout(%d, %d);', [maxX, maxY]));
end;
end;
procedure TfrmRICFont.btnSaveClick(Sender: TObject);
begin
if dlgSave.Execute then
begin
if dlgSave.FilterIndex = 1 then
begin
// RIC
SaveAsRIC(dlgSave.FileName);
end
else
begin
// RICScript
mmoRICScript.Lines.SaveToFile(ChangeFileExt(dlgSave.FileName, '.rs'));
end;
end;
end;
function TfrmRICFont.CharWidth(ch: char): integer;
var
abc : TABC;
begin
Result := charWidths[ch];
if bFontIsTrueType then
begin
abc := aBCWidths[ch];
Result := abc.abcA + abc.abcB + abc.abcC;
end;
end;
procedure TfrmRICFont.SaveAsRIC(const name: string);
var
sIn, sOut : TMemoryStream;
RIC : TRICComp;
begin
sIn := TMemoryStream.Create;
try
mmoRICScript.Lines.SaveToStream(sIn);
sIn.Position := 0;
// RIC compiler
RIC := TRICComp.Create;
try
RIC.CurrentFile := name;
RIC.EnhancedFirmware := True;
RIC.FirmwareVersion := 128;
RIC.MaxErrors := 0;
RIC.Parse(sIn);
if RIC.CompilerMessages.Count = 0 then
begin
sOut := TMemoryStream.Create;
try
RIC.SaveToStream(sOut);
sOut.SaveToFile(ChangeFileExt(name, '.ric'));
finally
sOut.Free;
end;
end;
finally
RIC.Free;
end;
finally
sIn.Free;
end;
end;
end.
| 26.017316 | 119 | 0.555241 |
fc148869fc714a5c331f06550dde763265847776 | 735 | pas | Pascal | Source/Gold/Properties/AssemblyInfo.pas | remobjects/GoldBaseLibrary | eff554973955b774f60bbeeb757ef515007a0b61 | [
"BSD-2-Clause"
]
| null | null | null | Source/Gold/Properties/AssemblyInfo.pas | remobjects/GoldBaseLibrary | eff554973955b774f60bbeeb757ef515007a0b61 | [
"BSD-2-Clause"
]
| null | null | null | Source/Gold/Properties/AssemblyInfo.pas | remobjects/GoldBaseLibrary | eff554973955b774f60bbeeb757ef515007a0b61 | [
"BSD-2-Clause"
]
| 3 | 2019-07-18T06:54:40.000Z | 2020-06-15T16:55:35.000Z | namespace Gold;
{$IF ECHOES}
uses
System.Reflection,
System.Resources,
System.Runtime.InteropServices;
[assembly: AssemblyTitle('RemObhjects Elements Gold Support Library')]
[assembly: AssemblyDescription('')]
[assembly: AssemblyConfiguration('')]
[assembly: AssemblyCompany('RemObjects Software, LLC')]
[assembly: AssemblyProduct('RemObjects Elements')]
[assembly: AssemblyCopyright('RemObjects Software, LLC, 2018-')]
[assembly: AssemblyTrademark('')]
[assembly: AssemblyCulture('')]
[assembly: AssemblyVersion('1.0.0.1')]
[assembly: NeutralResourcesLanguage('')]
[assembly: ComVisible(false)]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyName("RemObjectsSoftware")]
{$ENDIF}
end. | 27.222222 | 71 | 0.737415 |
fc265edd00af26a3ae003ec216531d9d68a94f5c | 1,699 | pas | Pascal | Examples/Pipe/_fmMain.pas | ryujt/ryulib4delphi | 1269afeb5d55d5d6710cfb1d744d5a1596583a96 | [
"MIT"
]
| 18 | 2015-05-18T01:55:45.000Z | 2019-05-03T03:23:52.000Z | Examples/Pipe/_fmMain.pas | ryujt/ryulib4delphi | 1269afeb5d55d5d6710cfb1d744d5a1596583a96 | [
"MIT"
]
| 1 | 2019-11-08T08:27:34.000Z | 2019-11-08T08:43:51.000Z | Examples/Pipe/_fmMain.pas | ryujt/ryulib4delphi | 1269afeb5d55d5d6710cfb1d744d5a1596583a96 | [
"MIT"
]
| 19 | 2015-05-14T01:06:35.000Z | 2019-06-02T05:19:00.000Z | unit _fmMain;
interface
uses
Pipes, ObserverList, ValueList,
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TfmMain = class(TForm)
moMsg: TMemo;
edMsg: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
FObserverList : TObserverList;
private
FPipeReceiver : TPipeReceiver;
procedure on_ReceiveText(Sender:TObject; const AText:string);
private
FPipeSender : TPipeSender;
public
published
procedure rp_Msg(AValueList:TValueList);
end;
var
fmMain: TfmMain;
implementation
{$R *.dfm}
procedure TfmMain.Button1Click(Sender: TObject);
begin
FPipeSender.SendText(edMsg.Text);
edMsg.Text := '';
end;
procedure TfmMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
FObserverList.Remove(Self);
end;
procedure TfmMain.FormCreate(Sender: TObject);
begin
FObserverList := TObserverList.Create(Self);
FObserverList.Add(Self);
FPipeReceiver := TPipeReceiver.Create('Ryu');
FPipeReceiver.OnReceiveText := on_ReceiveText;
FPipeSender := TPipeSender.Create('Ryu');
end;
procedure TfmMain.FormDestroy(Sender: TObject);
begin
FreeAndNil(FPipeReceiver);
FreeAndNil(FObserverList);
end;
procedure TfmMain.on_ReceiveText(Sender: TObject; const AText: string);
begin
FObserverList.AsyncBroadcast('Code=Msg<rYu>' + AText);
end;
procedure TfmMain.rp_Msg(AValueList: TValueList);
begin
moMsg.Lines.Add(AValueList.Text);
end;
end.
| 22.064935 | 98 | 0.751619 |
47f7399413d631fa4b168c5d508fa32f066636b5 | 9,652 | pas | Pascal | ComponentsSource/FMX.RatingBar.pas | arvanus/FMXComponents | f04d62ccf452d085cb638b552bc758730dfd8518 | [
"MIT"
]
| 343 | 2017-01-19T06:56:01.000Z | 2022-03-30T16:01:15.000Z | ComponentsSource/FMX.RatingBar.pas | HemulGM/FMXComponents | ec4f6ab16d8e48c248ede799581b2d793504344a | [
"MIT"
]
| 21 | 2017-02-20T18:38:13.000Z | 2021-12-19T06:27:25.000Z | ComponentsSource/FMX.RatingBar.pas | HemulGM/FMXComponents | ec4f6ab16d8e48c248ede799581b2d793504344a | [
"MIT"
]
| 107 | 2017-02-07T12:31:37.000Z | 2022-03-03T00:53:11.000Z | // ***************************************************************************
//
// A Simple Firemonkey Rating Bar Component
//
// Copyright 2017 谢顿 (zhaoyipeng@hotmail.com)
//
// https://github.com/zhaoyipeng/FMXComponents
//
// ***************************************************************************
// version history
// 2017-01-20, v0.1.0.0 :
// first release
// 2017-09-22, v0.2.0.0 :
// merge Aone's version
// add Data(TPathData) property, support user define rating shape
// thanks Aone, QQ: 1467948783
// http://www.cnblogs.com/onechen
unit FMX.RatingBar;
interface
uses
System.Classes,
System.SysUtils,
System.Math,
System.Math.Vectors,
System.Types,
System.UITypes,
System.UIConsts,
FMX.Types,
FMX.Layouts,
FMX.Graphics,
FMX.Controls,
FMX.Objects,
FMX.ComponentsCommon;
type
[ComponentPlatformsAttribute(TFMXPlatforms)]
TFMXRatingBar = class(TShape, IPathObject)
private
FData: TPathData;
FCount: Integer;
FMaximum: Single;
FValue: Single;
FSpace: Single;
FActiveColor: TAlphaColor;
FInActiveColor: TAlphaColor;
FActiveBrush: TBrush;
FInActiveBrush: TBrush;
FMouseDown: Boolean;
FOnChanged: TNotifyEvent;
procedure SetPathData(const Value: TPathData);
procedure SetCount(const Value: Integer);
procedure SetMaximum(const Value: Single);
procedure SetValue(const Value: Single);
procedure SetSpace(const Value: Single);
procedure SetActiveColor(const Value: TAlphaColor);
procedure SetInActiveColor(const Value: TAlphaColor);
{ IPathObject }
function GetPath: TPathData;
procedure CreateBrush;
procedure FreeBrush;
procedure CalcValue(X: Single);
procedure SetOnChanged(const Value: TNotifyEvent);
procedure DoChanged;
protected
procedure Resize; override;
procedure Paint; override;
procedure DrawRating(ARect: TRectF; AValue: Single);
procedure FillChanged(Sender: TObject);
procedure StrokeChanged(Sender: TObject);
procedure PathDataChanged(Sender: TObject);
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override;
procedure MouseMove(Shift: TShiftState; X, Y: Single); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Single); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property Align;
property Anchors;
property ClipChildren default False;
property ClipParent default False;
property Cursor default crDefault;
property DragMode default TDragMode.dmManual;
property EnableDragHighlight default True;
property Enabled default True;
property Locked default False;
property Height;
property HitTest default True;
property Padding;
property Opacity;
property Margins;
property PopupMenu;
property Position;
property RotationAngle;
property RotationCenter;
property Scale;
property Size;
property Visible default True;
property Width;
{ Drag and Drop events }
property OnDragEnter;
property OnDragLeave;
property OnDragOver;
property OnDragDrop;
property OnDragEnd;
{ Mouse events }
property OnClick;
property OnDblClick;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseWheel;
property OnMouseEnter;
property OnMouseLeave;
property OnPainting;
property OnPaint;
property OnResize;
{$IF (RTLVersion >= 32)} // Tokyo
property OnResized;
{$ENDIF}
property Data: TPathData read FData write SetPathData;
property ActiveColor: TAlphaColor read FActiveColor write SetActiveColor;
property InActiveColor: TAlphaColor read FInActiveColor write SetInActiveColor;
property Stroke;
property Space: Single read FSpace write SetSpace;
property Count: Integer read FCount write SetCount default 5;
property Value: Single read FValue write SetValue;
property Maximum: Single read FMaximum write SetMaximum;
property OnChanged: TNotifyEvent read FOnChanged write SetOnChanged;
end;
implementation
{ THHRating }
constructor TFMXRatingBar.Create(AOwner: TComponent);
begin
inherited;
FMouseDown := False;
HitTest := True;
Width := 180;
Height := 30;
FData := TPathData.Create;
FData.Data := 'm 4677,2657 -1004,727 385,1179 -1002,-731 -1002,731 386,-1179 -1005,-727 1240,3 381,-1181 381,1181 z';
FData.OnChanged := PathDataChanged;
// 星 (瘦)
FCount := 5;
FMaximum := 5;
FValue := 0;
FSpace := 6;
FActiveColor := claRoyalblue;
FInActiveColor := $30000000;
Stroke.Color := claNull;
end;
destructor TFMXRatingBar.Destroy;
begin
FData.Free;
FreeBrush;
inherited;
end;
procedure TFMXRatingBar.DoChanged;
begin
if Assigned(FOnChanged) then
FOnChanged(Self);
end;
procedure TFMXRatingBar.CreateBrush;
begin
if not Assigned(FActiveBrush) then
FActiveBrush := TBrush.Create(TBrushKind.Solid, FActiveColor);
if not Assigned(FInActiveBrush) then
FInActiveBrush := TBrush.Create(TBrushKind.Solid, FInActiveColor);
end;
procedure TFMXRatingBar.FillChanged(Sender: TObject);
begin
if FUpdating = 0 then
Repaint;
end;
procedure TFMXRatingBar.FreeBrush;
begin
FreeAndNil(FActiveBrush);
FreeAndNil(FInActiveBrush);
end;
procedure TFMXRatingBar.Assign(Source: TPersistent);
var
src: TFMXRatingBar;
begin
if Source is TFMXRatingBar then
begin
src := TFMXRatingBar(Source);
Stroke := src.Stroke;
FData.Assign(src.FData);
FCount := src.FCount;
FMaximum := src.FMaximum;
FValue := src.FValue;
FSpace := src.FSpace;
FActiveColor := src.FActiveColor;
FInActiveColor := src.FInActiveColor;
FreeBrush;
Repaint;
end
else
inherited;
end;
procedure TFMXRatingBar.CalcValue(X: Single);
var
w: Single;
Idx: Integer;
Sum: Single;
NewValue: Single;
begin
w := (Width - FSpace * 4) / Count;
if X <= 0 then
Value := 0
else if X >= Width then
Value := Maximum
else
begin
Idx := 1;
Sum := w;
while (X > Sum) and (Idx < Count) do
begin
Inc(Idx);
Sum := Sum + w + FSpace;
end;
NewValue := Idx * Maximum / Count;
if NewValue <> Value then
begin
Value := NewValue;
DoChanged;
end;
end;
end;
procedure TFMXRatingBar.DrawRating(ARect: TRectF; AValue: Single);
var
State: TCanvasSaveState;
l: Single;
R: TRectF;
begin
FData.FitToRect(ARect);
Canvas.BeginScene;
if AValue = 0 then
begin
Canvas.FillPath(FData, Opacity, FInActiveBrush);
end
else if AValue = 1 then
begin
Canvas.FillPath(FData, Opacity, FActiveBrush);
end
else
begin
Canvas.FillPath(FData, Opacity, FInActiveBrush);
l := Min(ARect.Height, ARect.Width);
R := RectF(ARect.CenterPoint.X - l, ARect.Top, ARect.CenterPoint.X + l * (AValue - 0.5), ARect.Bottom);
State := Canvas.SaveState;
Canvas.IntersectClipRect(R);
Canvas.FillPath(FData, Opacity, FActiveBrush);
Canvas.RestoreState(State);
end;
// 顯示外框
Canvas.DrawPath(FData, Opacity);
Canvas.EndScene;
end;
procedure TFMXRatingBar.Paint;
var
l, w: Single;
I: Integer;
R: TRectF;
DV, V: Single;
begin
inherited;
CreateBrush;
w := (Width - FSpace * 4) / Count;
DV := (FValue / FMaximum) * Count;
for I := 0 to Count - 1 do
begin
l := (w + FSpace) * I;
R := RectF(l, 0, l + w, Height);
if DV - I >= 1 then
V := 1
else if DV <= I then
V := 0
else
V := DV - I;
DrawRating(R, V);
end;
end;
procedure TFMXRatingBar.PathDataChanged(Sender: TObject);
begin
if FUpdating = 0 then
Repaint;
end;
procedure TFMXRatingBar.Resize;
begin
inherited;
Repaint;
end;
function TFMXRatingBar.GetPath: TPathData;
begin
Result := FData;
end;
procedure TFMXRatingBar.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
begin
inherited;
if Button = TMouseButton.mbLeft then
begin
FMouseDown := True;
CalcValue(X);
end;
end;
procedure TFMXRatingBar.MouseMove(Shift: TShiftState; X, Y: Single);
begin
inherited;
if FMouseDown then
begin
CalcValue(X);
end;
end;
procedure TFMXRatingBar.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
Y: Single);
begin
inherited;
FMouseDown := False;
end;
procedure TFMXRatingBar.SetPathData(const Value: TPathData);
begin
FData.Assign(Value);
Repaint;
end;
procedure TFMXRatingBar.SetActiveColor(const Value: TAlphaColor);
begin
if FActiveColor <> Value then
begin
FActiveColor := Value;
FreeAndNil(FActiveBrush);
Repaint;
end;
end;
procedure TFMXRatingBar.SetCount(const Value: Integer);
begin
if FCount <> Value then
begin
FCount := Value;
Repaint;
end;
end;
procedure TFMXRatingBar.SetInActiveColor(const Value: TAlphaColor);
begin
if FInActiveColor <> Value then
begin
FInActiveColor := Value;
FreeAndNil(FInActiveBrush);
Repaint;
end;
end;
procedure TFMXRatingBar.SetMaximum(const Value: Single);
begin
if FMaximum <> Value then
begin
FMaximum := Value;
Repaint;
end;
end;
procedure TFMXRatingBar.SetOnChanged(const Value: TNotifyEvent);
begin
FOnChanged := Value;
end;
procedure TFMXRatingBar.SetSpace(const Value: Single);
begin
if FSpace <> Value then
begin
FSpace := Value;
Repaint;
end;
end;
procedure TFMXRatingBar.SetValue(const Value: Single);
begin
if FValue <> Value then
begin
FValue := Value;
Repaint;
end;
end;
procedure TFMXRatingBar.StrokeChanged(Sender: TObject);
begin
if FUpdating = 0 then
Repaint;
end;
end.
| 22.764151 | 119 | 0.691152 |
f1e7f3defe7ad2df9fe04a473270a296eac591ae | 24,145 | pas | Pascal | src/units/trdeboilerplater.pas | rsling/texrex | 80f2f31f2c78aab01f2963da225695ec735e9f21 | [
"BSD-2-Clause"
]
| 10 | 2017-12-07T14:37:36.000Z | 2021-12-09T14:44:34.000Z | src/units/trdeboilerplater.pas | rsling/texrex | 80f2f31f2c78aab01f2963da225695ec735e9f21 | [
"BSD-2-Clause"
]
| 3 | 2016-10-14T14:32:38.000Z | 2021-08-15T18:46:31.000Z | src/units/trdeboilerplater.pas | rsling/texrex | 80f2f31f2c78aab01f2963da225695ec735e9f21 | [
"BSD-2-Clause"
]
| 1 | 2016-10-24T08:09:02.000Z | 2016-10-24T08:09:02.000Z | {
This file is part of texrex.
Maintained by Roland Schäfer.
http://texrex.sourceforge.net/
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
unit TrDeboilerplater;
{$MODE OBJFPC}
{$H+}
{$M+}
interface
uses
SysUtils,
StrUtils,
Classes,
IniFiles,
IcuWrappers,
Math,
Fann,
TrDocumentProcessor,
TrData,
TrUtilities;
type
ETrDeboilerplater = class(Exception);
TTrDeboilerplater = class(TTrDocumentProcessor)
public
constructor Create(const AIni : TIniFile); override;
// The call which cleans exactly one paragraph. Strings are assumed
// to be UTF-8!
destructor Destroy; override;
procedure Process(const ADocument : TTrDocument); override;
class function Achieves : TTrPrerequisites; override;
class function Presupposes : TTrPrerequisites; override;
protected
FTrainingMode : Boolean;
// libfann data.
FFannFile : String; // The network file name.
FFann : PFann; // The network structure.
FThreshold : Real; // When is doc bad?
FMinDivsBelowThreshold : Integer;
FMinDivProportionBelowThreshold : Real;
FMinCharsBelowThreshold : Integer;
FMinCharProportionBelowThreshold : Real;
FCurrentDocument : TTrDocument;
FCurrentDocumentLength : Integer;
FCurrentDocumentMarkupRatio : Real;
// For counting diverse character classes. At some point, we might
// change this from ICU matching to something faster.
FPunctuationRegex : String;
FSentenceRegex : String;
FNumberRegex : String;
FUpcaseRegex : String;
FLowercaseRegex : String;
FEndsInPunctuationRegex : String;
FYearRegex : String;
FCustomRegex : String;
// Regexes which help us to count character classes. Settable.
FPunctuationIcu : TIcuRegex;
FSentenceIcu : TIcuRegex;
FNumberIcu : TIcuRegex;
FUpcaseIcu : TIcuRegex;
FLowercaseIcu : TIcuRegex;
FEndsInPunctuationIcu : TIcuRegex;
FYearIcu : TIcuRegex;
FCustomIcu : TIcuRegex;
// Not settable.
FWhitespaceIcu : TIcuRegex;
FCopyrightIcu : TIcuRegex;
// Where text/sentence length is clamped.
FTextClamp : Integer;
FSentenceClamp : Integer;
FSentenceLengthClamp : Integer;
FSkippedClamp : Integer;
// Prepare single-paragraph metrics.
procedure PrepareValues;
// Prepare values for which (all) others must be known.
procedure PrepareValuesSecondPass;
// Run the MLP.
procedure DecideMlp;
procedure DecideThreshs;
// Setters / getters.
procedure SetFannFile(const AFileName : String);
procedure SetPunctuationRegex(const ARegex : String);
procedure SetSentenceRegex(const ARegex : String);
procedure SetNumberRegex(const ARegex : String);
procedure SetUpcaseRegex(const ARegex : String);
procedure SetLowercaseRegex(const ARegex : String);
procedure SetEndsInPunctuationRegex(const ARegex : String);
procedure SetYearRegex(const ARegex : String);
procedure SetCustomRegex(const ARegex : String);
public
// These default to German/English-compatible settings, some need
// to be re-set for other languages.
property PunctuationRegex : String read FPunctuationRegex
write SetPunctuationRegex;
property SentenceRegex : String read FSentenceRegex
write SetSentenceRegex;
property NumberRegex : String read FNumberRegex
write SetNumberRegex;
property UpcaseRegex : String read FUpcaseRegex
write SetUpcaseRegex;
property LowercaseRegex : String read FLowercaseRegex
write SetLowercaseRegex;
property EndsInPunctuationRegex : String
read FEndsInPunctuationRegex write SetEndsInPunctuationRegex;
property YearRegex : String read FYearRegex write SetYearRegex;
property TextClamp : Integer read FTextClamp
write FTextClamp;
property SentenceClamp : Integer read FSentenceClamp
write FSentenceClamp;
property SentenceLengthClamp : Integer read FSentenceLengthClamp
write FSentenceLengthClamp;
property SkippedClamp : Integer read FSkippedClamp
write FSkippedClamp;
published
// Set this to keep feature extraction, but always make -1 decision.
property TrainingMode : Boolean read FTrainingMode
write FTrainingMode default false;
// Set the network file. Raises exception if file does not exist.
// If it is NOT set at all, we assume we are in training data mode.
property FannFile : String read FFannFile
write SetFannFile;
// The FANN-threshold above which a paragraph should not be used
// in further computations, and for output.
property Threshold : Real read FThreshold write FThreshold;
property MinDivsBelowThreshold : Integer
read FMinDivsBelowThreshold write FMinDivsBelowThreshold
default 1;
property MinDivProportionBelowThreshold : Real
read FMinDivProportionBelowThreshold
write FMinDivProportionBelowThreshold;
property MinCharsBelowThreshold : Integer
read FMinCharsBelowThreshold write FMinCharsBelowThreshold
default 500;
property MinCharProportionBelowThreshold : Real
read FMinCharProportionBelowThreshold
write FMinCharProportionBelowThreshold;
property CustomRegex : String read FCustomRegex
write SetCustomRegex;
end;
implementation
const
// Index into Metrics to value of markup proportion.
MarkIdx = 5;
constructor TTrDeboilerplater.Create(const AIni : TIniFile);
begin
FMinDivProportionBelowThreshold := 0.1;
FMinCharProportionBelowThreshold := 0.25;
FPunctuationIcu := nil;
FSentenceIcu := nil;
FNumberIcu := nil;
FUpcaseIcu := nil;
FLowercaseIcu := nil;
FEndsInPunctuationIcu := nil;
FYearIcu := nil;
FCustomIcu := nil;
NumberRegex := '\p{N}';
UpcaseRegex := '\p{Lu}';
LowercaseRegex := '\p{Ll}';
PunctuationRegex := '\p{P}';
SentenceRegex := '[.?!](?:\s|$)';
EndsInPunctuationRegex := '.*[.?!] *$';
YearRegex := '[^0-9](20[01][0-9])([^0-9]|$)';
FWhitespaceIcu := TIcuRegex.Create('\s');
FCopyrightIcu := TIcuRegex.Create('.*©.*');
FTextClamp := 1000;
FSentenceClamp := 10;
FSentenceLengthClamp := 100;
FSkippedClamp := 20;
inherited Create(AIni);
end;
destructor TTrDeboilerplater.Destroy;
begin
FreeAndNil(FPunctuationIcu);
FreeAndNil(FSentenceIcu);
FreeAndNil(FNumberIcu);
FreeAndNil(FUpcaseIcu);
FreeAndNil(FLowercaseIcu);
FreeAndNil(FEndsInPunctuationIcu);
FreeAndNil(FYearIcu);
FreeAndNil(FCustomIcu);
FreeAndNil(FWhitespaceIcu);
FreeAndNil(FCopyrightIcu);
inherited Destroy;
end;
procedure TTrDeboilerplater.Process(const ADocument : TTrDocument);
begin
inherited;
// Get total number of codepoints in text once (costly).
FCurrentDocument := ADocument;
FCurrentDocumentLength := ADocument.Utf8Size;
if (FCurrentDocument.RawSize > 1)
and (FCurrentDocumentLength > 1)
then FCurrentDocumentMarkupRatio :=
FCurrentDocumentLength / FCurrentDocument.RawSize
else begin
FCurrentDocument.Valid := false;
Exit;
end;
// Create values paragraph-internally.
PrepareValues;
// This passes through all paragraphs again to calculate/add window
// values and whole-document values.
PrepareValuesSecondPass;
if not FTrainingMode
then begin
// Call the network to get a decision. If we are in training mode,
// BoilerplateScore is set to -1 for all divs by default, and we skip.
DecideMlp;
// Now make decision to remove the document if overall boilerplateness
// is to high.
DecideThreshs;
end;
end;
procedure TTrDeboilerplater.DecideThreshs;
begin
with FCurrentDocument
do begin
// Filter if too frew non-boiler divs.
if (NonBoilerplateDivs < FMinDivsBelowThreshold)
then Valid := false;
// Filter if too frew non-boiler chars.
if (NonBoilerplateCharacters < FMinCharsBelowThreshold)
then Valid := false;
// 0-Check for NonBoilerplateCharacterProportion.
if (BoilerplateCharacters+NonBoilerplateCharacters) > 0
then begin
NonBoilerplateCharacterProportion := NonBoilerplateCharacters/
(BoilerplateCharacters+NonBoilerplateCharacters);
// Now filter.
if (NonBoilerplateCharacterProportion <
FMinCharProportionBelowThreshold)
then Valid := false;
end else begin
NonBoilerplateCharacterProportion := (-1);
Valid := false;
end;
// 0-Check for NonBoilerplateCharacterProportion.
if (BoilerplateDivs+NonBoilerplateDivs) > 0
then begin
NonBoilerplateDivProportion := NonBoilerplateDivs/
(BoilerplateDivs+NonBoilerplateDivs);
// Now filter.
if (NonBoilerplateDivProportion <
FMinDivProportionBelowThreshold)
then Valid := false;
end else begin
NonBoilerplateDivProportion := (-1);
Valid := false;
end;
end; // htiw
end;
procedure TTrDeboilerplater.PrepareValues;
var
TextMass : Integer = 0;
i : Integer;
k : TTrDoctype;
l : TTrContainerType;
LLengthRaw : Integer;
LLengthText : Integer;
LPercentile : Real;
LDivPercentile : Real;
LPunctuation : Integer;
LSentence : Integer;
LLetter : Integer;
LTrueTextLength : Integer;
LUppercase, LLowercase : Integer;
LNumber : Integer;
LYear : Integer;
begin
// Iterate over the paragraphs.
for i := 0 to FCurrentDocument.Number-1
do begin
// TEXT-MASS RELATED METRICS
// Calculate raw length from meta.
LLengthRaw := FCurrentDocument[i].LengthRaw;
if LLengthRaw < 1
then LLengthRaw := 1;
// Set text length meta. We want codepoints, not bytes.
LLengthText := FCurrentDocument[i].Utf8Size;
if LLengthText < 1
then LLengthText := 1;
// [0] Clamped text length.
if LLengthText > FTextClamp
then FCurrentDocument[i].AddMetric(1, 0)
else FCurrentDocument[i].AddMetric(LLengthText / FTextClamp, 0);
// Get whitespace count to subtract from "text" count.
LTrueTextLength := LLengthText -
FWhitespaceIcu.MatchCount(FCurrentDocument[i].Text, true);
// If we have nothing left, this paragraph is invalid.
if LTrueTextLength < 1
then begin
FCurrentDocument[i].Valid := false;
Continue;
end;
// [1] How much of the whole page is this paragraph.
if FCurrentDocumentLength > 0
then
FCurrentDocument[i].AddMetric(LLengthText/FCurrentDocumentLength, 1)
else FCurrentDocument[i].AddMetric(0, 1);
// [2] How far in the text mass is this div located in text mass?
if FCurrentDocumentLength > 0
then begin
// We take the middle point of this paraghraph as its "location".
LPercentile := (TextMass + (LLengthText / 2)) /
FCurrentDocumentLength;
// Since the middle is good, and the margins are bad, we
// recalculate as: "How far from the middle are we?"
if (LPercentile > 0.5)
then LPercentile := (LPercentile - 0.5)*2
else LPercentile := (0.5 - LPercentile)*2;
end else LPercentile := 1;
FCurrentDocument[i].AddMetric(LPercentile, 2);
Inc(TextMass, LLengthText);
// [3] How far is this div located in par count?
if FCurrentDocument.Number > 0
then begin
LDivPercentile := i / FCurrentDocument.Number;
// Since the middle is good, and the margins are bad, we
// recalculate as: "How far from the middle are we?"
if (LDivPercentile > 0.5)
then LDivPercentile := (LDivPercentile - 0.5)*2
else LDivPercentile := (0.5 - LDivPercentile)*2;
end else LDivPercentile := 1;
FCurrentDocument[i].AddMetric(LDivPercentile, 3);
// [4] We add this whole-document weighting value.
FCurrentDocument[i].AddMetric(FCurrentDocumentMarkupRatio, 4);
// CHARACTER-CLASS RELATED FEATURES
// Match regexes to get raw values.
LSentence := FSentenceIcu.MatchCount(FCurrentDocument[i].Text,
true);
LUppercase := FUpcaseIcu.MatchCount(FCurrentDocument[i].Text, true);
LLowercase := FLowercaseIcu.MatchCount(FCurrentDocument[i].Text,
true);
LLetter := LUppercase + LLowercase;
LNumber := FNumberIcu.MatchCount(FCurrentDocument[i].Text, true);
LPunctuation := FPunctuationIcu.MatchCount(FCurrentDocument[i].Text,
true);
LYear := FYearIcu.MatchCount(FCurrentDocument[i].Text, true);
// [5..14] Write metrics.
FCurrentDocument[i].AddMetric(
(LLengthRaw - LLengthText) / LLengthRaw, 5); // Markup proportion.
FCurrentDocument[i].AddMetric(LPunctuation / LLengthText, 6);
FCurrentDocument[i].AddMetric(LLetter / LTrueTextLength, 7);
FCurrentDocument[i].AddMetric(LNumber / LTrueTextLength, 8);
FCurrentDocument[i].AddMetric(
FCurrentDocument[i].CleansedTags / LTrueTextLength, 9);
FCurrentDocument[i].AddMetric(
FCurrentDocument[i].CleansedEmails / LTrueTextLength, 10);
FCurrentDocument[i].AddMetric(
FCurrentDocument[i].CleansedUris / LTrueTextLength, 11);
FCurrentDocument[i].AddMetric(
FCurrentDocument[i].CleansedHashtags / LTrueTextLength, 12);
FCurrentDocument[i].AddMetric(LYear / LTrueTextLength, 13);
FCurrentDocument[i].AddMetric(FCurrentDocument[i].Anchors /
LTrueTextLength, 14);
// [15] Ratio of upper vs. lowercase.
if (LUppercase + LLowercase > 0)
then FCurrentDocument[i].AddMetric(
LUppercase / (LUppercase + LLowercase), 15)
else FCurrentDocument[i].AddMetric(0, 15);
// [16] Is sentence length a guessed value (i.e., no punctuation)?
if LSentence > 0
then
FCurrentDocument[i].AddMetric(0, 16) // Ok sentence length.
else begin
LSentence := 1;
FCurrentDocument[i].AddMetric(1, 16); // Bogus sentence length.
end;
// [17] We clamp sentence count and length to make it fit into [0,1].
if (LLengthText div LSentence) > FSentenceLengthClamp
then FCurrentDocument[i].AddMetric(1, 17)
else FCurrentDocument[i].AddMetric(
(LLengthText div LSentence) / FSentenceLengthClamp, 17);
// [18] Sentence count.
if LSentence > FSentenceClamp
then FCurrentDocument[i].AddMetric(1, 18)
else FCurrentDocument[i].AddMetric(LSentence / FSentenceClamp, 18);
// BOOLEAN METRICS
// [19] Contains ©?
if FCopyrightIcu.Match(FCurrentDocument[i].Text, false, true)
then FCurrentDocument[i].AddMetric(1, 19)
else FCurrentDocument[i].AddMetric(0, 19);
// [20] Ends in punctuation?
if FEndsInPunctuationIcu.Match(FCurrentDocument[i].Text, false,
true)
then FCurrentDocument[i].AddMetric(1, 20)
else FCurrentDocument[i].AddMetric(0, 20);
// [21..23] We need three values to encode the doctype.
for k := tdtXhtml to tdtHtml5
do begin
if FCurrentDocument.Doctype = k
then FCurrentDocument[i].AddMetric(1, Integer(k)+20)
else FCurrentDocument[i].AddMetric(0, Integer(k)+20);
end;
// [24..31] We need 8 values to encode the enclosing block type.
for l := tctArticle to tctLi
do begin
if FCurrentDocument[i].Container = l
then FCurrentDocument[i].AddMetric(1, Integer(l)+23)
else FCurrentDocument[i].AddMetric(0, Integer(l)+23);
end;
// [32] Was the opening tag a closing tag with / (=potential rogue
// content not in proper container).
if FCurrentDocument[i].ContainerClosingStart
then FCurrentDocument[i].AddMetric(1, 32)
else FCurrentDocument[i].AddMetric(0, 32);
// [33] Ratio open/close tags.
with FCurrentDocument[i]
do begin
if (OpenTags + CloseTags) > 0
then AddMetric(OpenTags/(OpenTags + CloseTags), 33)
else AddMetric(0, 33);
end;
// [34] Skipped divs before this one.
if FCurrentDocument[i].SkippedDivs > FSkippedClamp
then FCurrentDocument[i].AddMetric(1, 34)
else FCurrentDocument[i].AddMetric(
FCurrentDocument[i].SkippedDivs / FSkippedClamp, 34);
end;
end;
procedure TTrDeboilerplater.PrepareValuesSecondPass;
var
i : Integer;
LRatio, LWindow2Ratio : Real;
begin
// Add the "smoothing" meta information by going through the
// paragraphs again.
for i := 0 to FCurrentDocument.Number-1
do begin
// If this par is invalid, do nothing.
if not FCurrentDocument[i].Valid
then Continue;
LRatio := FCurrentDocument[i].Metrics[MarkIdx];
// One to the left.
if i > 0
then begin
if FCurrentDocument[i-1].Valid
then LRatio += FCurrentDocument[i-1].Metrics[MarkIdx]
else LRatio += LRatio;
end else begin
if FCurrentDocument[0].Valid
then LRatio += FCurrentDocument[0].Metrics[MarkIdx]
else LRatio += LRatio;
end;
// One to the right.
if i < FCurrentDocument.Number-1
then begin
if FCurrentDocument[i+1].Valid
then LRatio += FCurrentDocument[i+1].Metrics[MarkIdx]
else LRatio += LRatio;
end else begin
if FCurrentDocument[FCurrentDocument.Number-1].Valid
then LRatio +=
FCurrentDocument[FCurrentDocument.Number-1].Metrics[MarkIdx]
else LRatio += LRatio;
end;
// [35] Add window +1 value;
FCurrentDocument[i].AddMetric(LRatio / 3, 35);
LWindow2Ratio := 0;
// Two to the left.
if i > 1
then begin
if FCurrentDocument[i-2].Valid
then LWindow2Ratio += FCurrentDocument[i-2].Metrics[MarkIdx]
else LWindow2Ratio += LRatio/2
end else begin
if FCurrentDocument[0].Valid
then LWindow2Ratio := FCurrentDocument[0].Metrics[MarkIdx]
else LWindow2Ratio += LRatio/2
end;
// Two to the right.
if i < FCurrentDocument.Number-2
then begin
if FCurrentDocument[i+2].Valid
then LWindow2Ratio += FCurrentDocument[i+2].Metrics[MarkIdx]
else LWindow2Ratio += LRatio/2;
end else begin
if FCurrentDocument[FCurrentDocument.Number-1].Valid
then LWindow2Ratio :=
FCurrentDocument[FCurrentDocument.Number-1].Metrics[MarkIdx]
else LWindow2Ratio += LRatio/2;
end;
// [36] Add window +2 value;
LRatio += LWindow2Ratio;
FCurrentDocument[i].AddMetric(LRatio / 5, 36);
end;
end;
procedure TTrDeboilerplater.DecideMlp;
var
i : Integer;
LFannOut : PFann_Type_Array;
begin
// We do not raise an exception, because using this without a valid
// network means we are in training data generation mode.
if FFann = nil
then Exit;
// Go through all paragraphs of document...
for i := 0 to FCurrentDocument.Number-1
do begin
// Only process valid divs.
if not FCurrentDocument[i].Valid
then Continue;
// Model-specific match = "[read more]" or "(...)" etc.
if Assigned(FCustomIcu)
and (FCustomIcu.Match(FCurrentDocument[i].Text, false, true))
then FCurrentDocument[i].Boilerplate := true
else FCurrentDocument[i].Boilerplate := false;
// Make decision.
LFannOut :=
fann_run(FFann, Pfann_type(FCurrentDocument[i].Metrics));
if LFannOut = nil
then raise ETrDeboilerplater.Create('FANN result was nil.');
FCurrentDocument[i].BoilerplateScore := LFannOut^[0];
// Now make decision and record statistics for whole-document
// boilerplate level detection.
if (FCurrentDocument[i].BoilerplateScore > FThreshold)
then begin
FCurrentDocument[i].Boilerplate := true;
// Add satistics for whole document.
FCurrentDocument.BoilerplateDivs :=
FCurrentDocument.BoilerplateDivs + 1;
FCurrentDocument.BoilerplateCharacters :=
FCurrentDocument.BoilerplateCharacters +
FCurrentDocument[i].Utf8Size;
end
else begin
FCurrentDocument.NonBoilerplateDivs :=
FCurrentDocument.NonBoilerplateDivs + 1;
FCurrentDocument.NonBoilerplateCharacters :=
FCurrentDocument.NonBoilerplateCharacters +
FCurrentDocument[i].Utf8Size;
end;
// Add to weighted averages of boilerplateness. This requires that
// at the end, we divide by the Utf8 length of the whole document,
// resp. the div count, which happens in DecideThreshs.
FCurrentDocument.AverageBoilerplateDiv :=
FCurrentDocument.AverageBoilerplateDiv +
FCurrentDocument[i].BoilerplateScore;
// The same for characters.
FCurrentDocument.AverageBoilerplateCharacter :=
FCurrentDocument.AverageBoilerplateCharacter +
FCurrentDocument[i].BoilerplateScore *
FCurrentDocument[i].Utf8Size;
end;
// Finally, fix the AverageBoilerplate~ variables by dividing by
// document totals.
with FCurrentDocument
do begin
AverageBoilerplateCharacter :=
AverageBoilerplateCharacter / ValidUtf8Size;
AverageBoilerplateDiv := AverageBoilerplateDiv / ValidNumber;
end;
end;
procedure TTrDeboilerplater.SetFannFile(const AFileName : String);
begin
FFannFile := AFileName;
TrAssert(TrFindFile(FFannFile), 'FANN file exists.');
FFann := fann_create_from_file(PChar(FFannFile));
end;
procedure TTrDeboilerplater.SetPunctuationRegex(
const ARegex : String);
begin
FPunctuationRegex := ARegex;
if Assigned(FPunctuationIcu)
then FreeAndNil(FPunctuationIcu);
FPunctuationIcu := TIcuRegex.Create(FPunctuationRegex);
end;
procedure TTrDeboilerplater.SetSentenceRegex(const ARegex : String);
begin
FSentenceRegex := ARegex;
if Assigned(FSentenceIcu)
then FreeAndNil(FSentenceIcu);
FSentenceIcu := TIcuRegex.Create(FSentenceRegex);
end;
procedure TTrDeboilerplater.SetNumberRegex(const ARegex : String);
begin
FNumberRegex := ARegex;
if Assigned(FNumberIcu)
then FreeAndNil(FNumberIcu);
FNumberIcu := TIcuRegex.Create(FNumberRegex);
end;
procedure TTrDeboilerplater.SetUpcaseRegex(const ARegex : String);
begin
FUpcaseRegex := ARegex;
if Assigned(FUpcaseIcu)
then FreeAndNil(FUpcaseIcu);
FUpcaseIcu := TIcuRegex.Create(FUpcaseRegex);
end;
procedure TTrDeboilerplater.SetLowercaseRegex(const ARegex : String);
begin
FLowercaseRegex := ARegex;
if Assigned(FLowercaseIcu)
then FreeAndNil(FLowercaseIcu);
FLowercaseIcu := TIcuRegex.Create(FLowercaseRegex);
end;
procedure TTrDeboilerplater.SetEndsInPunctuationRegex(
const ARegex : String);
begin
FEndsInPunctuationRegex := ARegex;
if Assigned(FEndsInPunctuationIcu)
then FreeAndNil(FEndsInPunctuationIcu);
FEndsInPunctuationIcu := TIcuRegex.Create(FEndsInPunctuationRegex);
end;
procedure TTrDeboilerplater.SetYearRegex(const ARegex : String);
begin
FYearRegex := ARegex;
if Assigned(FYearIcu)
then FreeAndNil(FYearIcu);
FYearIcu := TIcuRegex.Create(FYearRegex);
end;
procedure TTrDeboilerplater.SetCustomRegex(const ARegex : String);
begin
FCustomRegex := ARegex;
if Assigned(FCustomIcu)
then FreeAndNil(FCustomIcu);
FCustomIcu := TIcuRegex.Create(FCustomRegex);
end;
class function TTrDeboilerplater.Achieves : TTrPrerequisites;
begin
Result := [trpreDeboilerplated];
end;
class function TTrDeboilerplater.Presupposes : TTrPrerequisites;
begin
Result := [trpreStripped, trpreIsUtf8];
end;
end.
| 30.256892 | 80 | 0.711037 |
fc030358decf59c392091a095272f32c0015956d | 3,578 | pas | Pascal | examples/CLX/QStreams1.pas | ok7-eleven/tpabbrevia | e239ba811f536b90ad8dda2c5d43d9d80e22f592 | [
"BSD-3-Clause"
]
| null | null | null | examples/CLX/QStreams1.pas | ok7-eleven/tpabbrevia | e239ba811f536b90ad8dda2c5d43d9d80e22f592 | [
"BSD-3-Clause"
]
| null | null | null | examples/CLX/QStreams1.pas | ok7-eleven/tpabbrevia | e239ba811f536b90ad8dda2c5d43d9d80e22f592 | [
"BSD-3-Clause"
]
| null | null | null | (* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is TurboPower Abbrevia
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1997-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ABBREVIA: QSTREAMS1.PAS *}
{*********************************************************}
{* ABBREVIA Example program file *}
{*********************************************************}
unit QStreams1;
interface
uses
SysUtils, Classes, QGraphics, QForms, AbView, AbZView, AbArcTyp, AbZBrows,
AbUnzper, AbZipper, AbZipKit, AbBrowse, AbBase, QDialogs, QMenus, QTypes,
QControls, QStdCtrls, QGrids, AbQView, AbQZView;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
File1: TMenuItem;
Open1: TMenuItem;
Exit1: TMenuItem;
Action1: TMenuItem;
Extract1: TMenuItem;
AbZipView1: TAbZipView;
Memo1: TMemo;
OpenDialog1: TOpenDialog;
Close1: TMenuItem;
N1: TMenuItem;
Add1: TMenuItem;
AbZipKit1: TAbZipKit;
Clearmemo1: TMenuItem;
procedure Open1Click(Sender: TObject);
procedure Extract1Click(Sender: TObject);
procedure Close1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure AbZipView1DblClick(Sender: TObject);
procedure Clearmemo1Click(Sender: TObject);
procedure Add1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.xfm}
const
MainCaption = ' Compressed Memo';
procedure TForm1.Open1Click(Sender: TObject);
begin
OpenDialog1.Filename := '*.zip';
if OpenDialog1.Execute then
AbZipKit1.OpenArchive(OpenDialog1.Filename);
end;
procedure TForm1.Extract1Click(Sender: TObject);
var
ToStream : TMemoryStream;
Item : TAbArchiveItem;
begin
Memo1.Clear;
ToStream := TMemoryStream.Create;
try
Item := AbZipView1.Items[AbZipView1.ActiveRow];
Caption := Item.Filename;
AbZipKit1.ExtractToStream(Item.FileName, ToStream);
ToStream.Position := 0;
Memo1.Lines.LoadFromStream(ToStream);
finally
ToStream.Free;
end;
end;
procedure TForm1.Close1Click(Sender: TObject);
begin
AbZipKit1.CloseArchive;
Caption := MainCaption;
end;
procedure TForm1.Exit1Click(Sender: TObject);
begin
Close1Click(nil);
Close;
end;
procedure TForm1.AbZipView1DblClick(Sender: TObject);
begin
Extract1Click(nil);
end;
procedure TForm1.Clearmemo1Click(Sender: TObject);
begin
Memo1.Clear;
end;
procedure TForm1.Add1Click(Sender: TObject);
var
FromStream : TMemoryStream;
FN : string;
begin
FromStream := TMemoryStream.Create;
try
Memo1.Lines.SaveToStream(FromStream);
if InputQuery('Streams', 'Give it a filename', FN) then begin
Caption := FN;
AbZipKit1.AddFromStream(FN, FromStream);
end;
finally
FromStream.Free;
end;
end;
end.
| 24.675862 | 78 | 0.671884 |
fc0df75782847ca0a5236d5e069c97cf81b4bf82 | 21,273 | pas | Pascal | Lab8/12.pas | DariaMKrus/KarpovaLabs | e5b24948a6ee876af6b2e0b9d6a3d3a48d612850 | [
"Apache-2.0"
]
| null | null | null | Lab8/12.pas | DariaMKrus/KarpovaLabs | e5b24948a6ee876af6b2e0b9d6a3d3a48d612850 | [
"Apache-2.0"
]
| null | null | null | Lab8/12.pas | DariaMKrus/KarpovaLabs | e5b24948a6ee876af6b2e0b9d6a3d3a48d612850 | [
"Apache-2.0"
]
| null | null | null | Лабораторная работа N 8
Решение системы дифференциальных уравнений
методом Адамса-Мултона
Выполнила студентка 4 курса группы КАТМА Мукасеева Дарья
Шаг 0.003125
Стартовые значения решения системы
x = 0 y1= 0.7 y2= -0.5
x = 0.003125 y1= 0.702745900090002 y2= -0.498499567190577
x = 0.00625 y1= 0.705498674555452 y2= -0.49699468914607
x = 0.009375 y1= 0.708258270951771 y2= -0.495485381968976
Решение системы методом Адамса-Мултона четвертого порядка
x = 0.0125 y1= 0.711024636494736 y2= -0.493971661696998
x = 0.015625 y1= 0.713797718061572 y2= -0.492453544303252
x = 0.01875 y1= 0.716577462192258 y2= -0.490931045696506
x = 0.021875 y1= 0.719363815090712 y2= -0.489404181721396
x = 0.025 y1= 0.722156722626034 y2= -0.487872968158653
x = 0.028125 y1= 0.724956130333756 y2= -0.48633742072532
x = 0.03125 y1= 0.727761983417119 y2= -0.484797555074977
x = 0.034375 y1= 0.730574226748347 y2= -0.483253386797967
x = 0.0375 y1= 0.733392804869962 y2= -0.481704931421616
x = 0.040625 y1= 0.736217661996087 y2= -0.480152204410458
x = 0.04375 y1= 0.739048742013788 y2= -0.478595221166458
x = 0.046875 y1= 0.741885988484419 y2= -0.477033997029235
x = 0.05 y1= 0.744729344644983 y2= -0.475468547276286
x = 0.053125 y1= 0.747578753409514 y2= -0.473898887123209
x = 0.05625 y1= 0.750434157370472 y2= -0.472325031723928
x = 0.059375 y1= 0.753295498800147 y2= -0.470746996170915
x = 0.0625 y1= 0.756162719652093 y2= -0.469164795495413
x = 0.065625 y1= 0.759035761562561 y2= -0.467578444667662
x = 0.06875 y1= 0.761914565851959 y2= -0.465987958597118
x = 0.071875 y1= 0.764799073526321 y2= -0.464393352132683
x = 0.075 y1= 0.767689225278797 y2= -0.46279464006292
x = 0.078125 y1= 0.770584961491148 y2= -0.461191837116281
x = 0.08125 y1= 0.773486222235272 y2= -0.459584957961331
x = 0.084375 y1= 0.776392947274727 y2= -0.457974017206968
x = 0.0875 y1= 0.779305076066285 y2= -0.456359029402644
x = 0.090625 y1= 0.782222547761488 y2= -0.454740009038593
x = 0.09375 y1= 0.785145301208232 y2= -0.45311697054605
x = 0.096875 y1= 0.788073274952352 y2= -0.451489928297471
x = 0.1 y1= 0.791006407239236 y2= -0.449858896606759
x = 0.103125 y1= 0.79394463601544 y2= -0.448223889729485
x = 0.10625 y1= 0.796887898930331 y2= -0.446584921863105
x = 0.109375 y1= 0.799836133337733 y2= -0.444942007147187
x = 0.1125 y1= 0.802789276297597 y2= -0.44329515966363
x = 0.115625 y1= 0.805747264577683 y2= -0.441644393436883
x = 0.11875 y1= 0.80871003465525 y2= -0.439989722434167
x = 0.121875 y1= 0.811677522718773 y2= -0.438331160565695
x = 0.125 y1= 0.814649664669661 y2= -0.436668721684892
x = 0.128125 y1= 0.817626396124002 y2= -0.435002419588614
x = 0.13125 y1= 0.820607652414315 y2= -0.433332268017367
x = 0.134375 y1= 0.823593368591315 y2= -0.431658280655527
x = 0.1375 y1= 0.826583479425701 y2= -0.429980471131558
x = 0.140625 y1= 0.829577919409947 y2= -0.42829885301823
x = 0.14375 y1= 0.832576622760118 y2= -0.426613439832837
x = 0.146875 y1= 0.835579523417691 y2= -0.424924245037416
x = 0.15 y1= 0.838586555051398 y2= -0.42323128203896
x = 0.153125 y1= 0.841597651059075 y2= -0.421534564189639
x = 0.15625 y1= 0.844612744569535 y2= -0.419834104787016
x = 0.159375 y1= 0.847631768444443 y2= -0.418129917074261
x = 0.1625 y1= 0.850654655280216 y2= -0.416422014240366
x = 0.165625 y1= 0.853681337409931 y2= -0.414710409420363
x = 0.16875 y1= 0.856711746905247 y2= -0.412995115695538
x = 0.171875 y1= 0.859745815578341 y2= -0.411276146093643
x = 0.175 y1= 0.862783474983859 y2= -0.409553513589114
x = 0.178125 y1= 0.865824656420882 y2= -0.407827231103278
x = 0.18125 y1= 0.868869290934901 y2= -0.406097311504573
x = 0.184375 y1= 0.871917309319805 y2= -0.404363767608758
x = 0.1875 y1= 0.874968642119893 y2= -0.402626612179121
x = 0.190625 y1= 0.878023219631884 y2= -0.400885857926697
x = 0.19375 y1= 0.881080971906952 y2= -0.399141517510476
x = 0.196875 y1= 0.884141828752769 y2= -0.397393603537613
x = 0.2 y1= 0.887205719735564 y2= -0.395642128563638
x = 0.203125 y1= 0.890272574182189 y2= -0.39388710509267
x = 0.20625 y1= 0.893342321182207 y2= -0.392128545577618
x = 0.209375 y1= 0.896414889589986 y2= -0.390366462420399
x = 0.2125 y1= 0.899490208026809 y2= -0.388600867972138
x = 0.215625 y1= 0.902568204882994 y2= -0.386831774533381
x = 0.21875 y1= 0.905648808320034 y2= -0.385059194354299
x = 0.221875 y1= 0.908731946272738 y2= -0.383283139634897
x = 0.225 y1= 0.911817546451396 y2= -0.381503622525218
x = 0.228125 y1= 0.914905536343946 y2= -0.37972065512555
x = 0.23125 y1= 0.917995843218168 y2= -0.377934249486628
x = 0.234375 y1= 0.921088394123872 y2= -0.376144417609843
x = 0.2375 y1= 0.924183115895113 y2= -0.374351171447443
x = 0.240625 y1= 0.927279935152413 y2= -0.372554522902735
x = 0.24375 y1= 0.930378778304991 y2= -0.370754483830291
x = 0.246875 y1= 0.933479571553016 y2= -0.368951066036148
x = 0.25 y1= 0.936582240889858 y2= -0.367144281278011
x = 0.253125 y1= 0.939686712104363 y2= -0.365334141265452
x = 0.25625 y1= 0.942792910783135 y2= -0.363520657660112
x = 0.259375 y1= 0.945900762312825 y2= -0.361703842075901
x = 0.2625 y1= 0.949010191882444 y2= -0.359883706079197
x = 0.265625 y1= 0.952121124485672 y2= -0.358060261189043
x = 0.26875 y1= 0.955233484923194 y2= -0.356233518877348
x = 0.271875 y1= 0.958347197805036 y2= -0.354403490569084
x = 0.275 y1= 0.961462187552917 y2= -0.35257018764248
x = 0.278125 y1= 0.964578378402612 y2= -0.350733621429221
x = 0.28125 y1= 0.967695694406326 y2= -0.348893803214643
x = 0.284375 y1= 0.970814059435082 y2= -0.34705074423793
x = 0.2875 y1= 0.973933397181111 y2= -0.345204455692306
x = 0.290625 y1= 0.977053631160266 y2= -0.343354948725227
x = 0.29375 y1= 0.980174684714435 y2= -0.341502234438581
x = 0.296875 y1= 0.983296481013973 y2= -0.339646323888874
x = 0.299999999999999 y1= 0.986418943060141 y2= -0.337787228087427
x = 0.303124999999999 y1= 0.989541993687554 y2= -0.335924958000562
x = 0.306249999999999 y1= 0.992665555566643 y2= -0.3340595245498
x = 0.309374999999999 y1= 0.995789551206131 y2= -0.332190938612044
x = 0.312499999999999 y1= 0.998913902955505 y2= -0.330319211019773
x = 0.315624999999999 y1= 1.00203853300752 y2= -0.32844435256123
x = 0.318749999999999 y1= 1.00516336340068 y2= -0.326566373980611
x = 0.321874999999999 y1= 1.00828831602178 y2= -0.324685285978251
x = 0.324999999999999 y1= 1.01141331260841 y2= -0.322801099210811
x = 0.328124999999999 y1= 1.01453827475148 y2= -0.320913824291466
x = 0.331249999999999 y1= 1.01766312389778 y2= -0.319023471790093
x = 0.334374999999999 y1= 1.02078778135252 y2= -0.317130052233448
x = 0.337499999999999 y1= 1.0239121682819 y2= -0.315233576105362
x = 0.340624999999999 y1= 1.02703620571567 y2= -0.313334053846914
x = 0.343749999999999 y1= 1.03015981454971 y2= -0.311431495856621
x = 0.346874999999999 y1= 1.03328291554863 y2= -0.30952591249062
x = 0.349999999999999 y1= 1.03640542934839 y2= -0.307617314062846
x = 0.353124999999999 y1= 1.03952727645883 y2= -0.305705710845219
x = 0.356249999999999 y1= 1.04264837726638 y2= -0.30379111306782
x = 0.359374999999999 y1= 1.04576865203665 y2= -0.301873530919074
x = 0.362499999999999 y1= 1.04888802091702 y2= -0.299952974545927
x = 0.365624999999999 y1= 1.05200640393936 y2= -0.298029454054027
x = 0.368749999999999 y1= 1.05512372102265 y2= -0.296102979507901
x = 0.371874999999999 y1= 1.05823989197562 y2= -0.294173560931133
x = 0.374999999999999 y1= 1.06135483649944 y2= -0.292241208306541
x = 0.378124999999999 y1= 1.06446847419041 y2= -0.290305931576351
x = 0.381249999999999 y1= 1.06758072454263 y2= -0.288367740642377
x = 0.384374999999999 y1= 1.07069150695068 y2= -0.286426645366191
x = 0.387499999999999 y1= 1.07380074071237 y2= -0.2844826555693
x = 0.390624999999999 y1= 1.0769083450314 y2= -0.28253578103332
x = 0.393749999999999 y1= 1.08001423902011 y2= -0.280586031500148
x = 0.396874999999999 y1= 1.08311834170218 y2= -0.278633416672133
x = 0.399999999999999 y1= 1.08622057201541 y2= -0.27667794621225
x = 0.403124999999999 y1= 1.0893208488144 y2= -0.274719629744271
x = 0.406249999999999 y1= 1.09241909087337 y2= -0.272758476852933
x = 0.409374999999999 y1= 1.09551521688883 y2= -0.27079449708411
x = 0.412499999999999 y1= 1.09860914548245 y2= -0.268827699944982
x = 0.415624999999999 y1= 1.10170079520372 y2= -0.266858094904201
x = 0.418749999999999 y1= 1.10479008453281 y2= -0.264885691392063
x = 0.421874999999999 y1= 1.10787693188334 y2= -0.262910498800669
x = 0.424999999999999 y1= 1.11096125560512 y2= -0.260932526484099
x = 0.428124999999999 y1= 1.11404297398703 y2= -0.258951783758573
x = 0.431249999999999 y1= 1.11712200525976 y2= -0.256968279902616
x = 0.434374999999999 y1= 1.12019826759864 y2= -0.254982024157224
x = 0.437499999999999 y1= 1.1232716791265 y2= -0.252993025726029
x = 0.440624999999999 y1= 1.12634215791643 y2= -0.251001293775462
x = 0.443749999999999 y1= 1.12940962199464 y2= -0.249006837434911
x = 0.446874999999999 y1= 1.13247398934332 y2= -0.24700966579689
x = 0.449999999999999 y1= 1.13553517790344 y2= -0.245009787917196
x = 0.453124999999999 y1= 1.13859310557764 y2= -0.24300721281507
x = 0.456249999999999 y1= 1.14164769023306 y2= -0.24100194947336
x = 0.459374999999999 y1= 1.1446988497042 y2= -0.238994006838675
x = 0.462499999999999 y1= 1.14774650179581 y2= -0.236983393821551
x = 0.465624999999999 y1= 1.15079056428572 y2= -0.234970119296601
x = 0.468749999999999 y1= 1.15383095492778 y2= -0.23295419210268
x = 0.471874999999999 y1= 1.15686759145467 y2= -0.230935621043038
x = 0.474999999999999 y1= 1.15990039158084 y2= -0.228914414885476
x = 0.478124999999999 y1= 1.1629292730054 y2= -0.226890582362503
x = 0.481249999999999 y1= 1.16595415341498 y2= -0.224864132171491
x = 0.484374999999999 y1= 1.16897495048667 y2= -0.222835072974828
x = 0.487499999999999 y1= 1.17199158189091 y2= -0.220803413400073
x = 0.490624999999999 y1= 1.17500396529442 y2= -0.218769162040109
x = 0.493749999999999 y1= 1.17801201836306 y2= -0.216732327453295
x = 0.496874999999999 y1= 1.18101565876485 y2= -0.214692918163617
x = 0.499999999999999 y1= 1.18401480417281 y2= -0.212650942660843
x = 0.503124999999999 y1= 1.1870093722679 y2= -0.210606409400667
x = 0.506249999999999 y1= 1.189999280742 y2= -0.208559326804865
x = 0.509374999999999 y1= 1.19298444730081 y2= -0.206509703261443
x = 0.512499999999999 y1= 1.19596478966679 y2= -0.204457547124782
x = 0.515624999999999 y1= 1.19894022558212 y2= -0.202402866715792
x = 0.518749999999999 y1= 1.20191067281163 y2= -0.200345670322055
x = 0.521874999999999 y1= 1.20487604914578 y2= -0.198285966197972
x = 0.524999999999999 y1= 1.20783627240359 y2= -0.196223762564913
x = 0.528124999999999 y1= 1.2107912604356 y2= -0.194159067611358
x = 0.531249999999999 y1= 1.21374093112686 y2= -0.192091889493046
x = 0.534374999999999 y1= 1.21668520239983 y2= -0.190022236333116
x = 0.537499999999999 y1= 1.21962399221743 y2= -0.187950116222254
x = 0.540624999999999 y1= 1.22255721858595 y2= -0.185875537218834
x = 0.543749999999999 y1= 1.22548479955804 y2= -0.18379850734906
x = 0.546874999999999 y1= 1.2284066532357 y2= -0.18171903460711
x = 0.549999999999999 y1= 1.23132269777324 y2= -0.179637126955276
x = 0.553124999999999 y1= 1.23423285138024 y2= -0.177552792324108
x = 0.556249999999999 y1= 1.23713703232459 y2= -0.175466038612547
x = 0.559374999999999 y1= 1.24003515893544 y2= -0.173376873688073
x = 0.562499999999999 y1= 1.24292714960615 y2= -0.171285305386837
x = 0.565624999999999 y1= 1.24581292279735 y2= -0.169191341513804
x = 0.568749999999999 y1= 1.24869239703989 y2= -0.167094989842888
x = 0.571874999999999 y1= 1.25156549093781 y2= -0.164996258117093
x = 0.575 y1= 1.2544321231714 y2= -0.162895154048643
x = 0.578125 y1= 1.25729221250012 y2= -0.160791685319125
x = 0.58125 y1= 1.26014567776563 y2= -0.158685859579619
x = 0.584375 y1= 1.2629924378948 y2= -0.156577684450837
x = 0.5875 y1= 1.26583241190267 y2= -0.154467167523255
x = 0.590625 y1= 1.2686655188955 y2= -0.152354316357246
x = 0.59375 y1= 1.27149167807371 y2= -0.150239138483214
x = 0.596875 y1= 1.27431080873492 y2= -0.148121641401729
x = 0.6 y1= 1.27712283027695 y2= -0.146001832583653
x = 0.603125 y1= 1.27992766220078 y2= -0.143879719470278
x = 0.60625 y1= 1.28272522411361 y2= -0.141755309473452
x = 0.609375 y1= 1.28551543573182 y2= -0.13962860997571
x = 0.6125 y1= 1.28829821688397 y2= -0.137499628330406
x = 0.615625 y1= 1.29107348751384 y2= -0.135368371861841
x = 0.61875 y1= 1.29384116768338 y2= -0.133234847865388
x = 0.621875 y1= 1.29660117757575 y2= -0.131099063607625
x = 0.625 y1= 1.2993534374983 y2= -0.128961026326461
x = 0.628125 y1= 1.30209786788557 y2= -0.126820743231259
x = 0.63125 y1= 1.3048343893023 y2= -0.124678221502968
x = 0.634375 y1= 1.30756292244642 y2= -0.122533468294244
x = 0.6375 y1= 1.31028338815204 y2= -0.120386490729578
x = 0.640625 y1= 1.31299570739246 y2= -0.11823729590542
x = 0.64375 y1= 1.31569980128317 y2= -0.1160858908903
x = 0.646875000000001 y1= 1.31839559108482 y2= -0.113932282724958
x = 0.650000000000001 y1= 1.32108299820622 y2= -0.111776478422459
x = 0.653125000000001 y1= 1.32376194420734 y2= -0.109618484968321
x = 0.656250000000001 y1= 1.32643235080231 y2= -0.107458309320634
x = 0.659375000000001 y1= 1.32909413986237 y2= -0.105295958410185
x = 0.662500000000001 y1= 1.33174723341889 y2= -0.103131439140572
x = 0.665625000000001 y1= 1.33439155366634 y2= -0.100964758388331
x = 0.668750000000001 y1= 1.33702702296525 y2= -0.0987959230030516
x = 0.671875000000001 y1= 1.33965356384525 y2= -0.0966249398074979
x = 0.675000000000001 y1= 1.34227109900796 y2= -0.094451815597726
x = 0.678125000000001 y1= 1.34487955133006 y2= -0.0922765571432026
x = 0.681250000000001 y1= 1.34747884386616 y2= -0.0900991711869224
x = 0.684375000000001 y1= 1.35006889985187 y2= -0.087919664445525
x = 0.687500000000001 y1= 1.35264964270668 y2= -0.0857380436094115
x = 0.690625000000001 y1= 1.35522099603697 y2= -0.0835543153428602
x = 0.693750000000001 y1= 1.35778288363897 y2= -0.0813684862841422
x = 0.696875000000001 y1= 1.3603352295017 y2= -0.0791805630456362
x = 0.700000000000001 y1= 1.36287795780991 y2= -0.0769905522139427
x = 0.703125000000001 y1= 1.36541099294706 y2= -0.074798460349998
x = 0.706250000000001 y1= 1.36793425949827 y2= -0.0726042939891877
x = 0.709375000000001 y1= 1.37044768225322 y2= -0.0704080596414591
x = 0.712500000000001 y1= 1.37295118620913 y2= -0.0682097637914336
x = 0.715625000000002 y1= 1.37544469657366 y2= -0.0660094128985189
x = 0.718750000000002 y1= 1.37792813876789 y2= -0.0638070133970197
x = 0.721875000000002 y1= 1.38040143842919 y2= -0.0616025716962487
x = 0.725000000000002 y1= 1.38286452141416 y2= -0.0593960941806371
x = 0.728125000000002 y1= 1.38531731380159 y2= -0.057187587209844
x = 0.731250000000002 y1= 1.3877597418953 y2= -0.0549770571188658
x = 0.734375000000002 y1= 1.39019173222709 y2= -0.0527645102181451
x = 0.737500000000002 y1= 1.39261321155967 y2= -0.0505499527936786
x = 0.740625000000002 y1= 1.39502410688949 y2= -0.0483333911071255
x = 0.743750000000002 y1= 1.39742434544968 y2= -0.046114831395914
x = 0.746875000000002 y1= 1.39981385471293 y2= -0.0438942798733489
x = 0.750000000000002 y1= 1.40219256239438 y2= -0.041671742728717
x = 0.753125000000002 y1= 1.40456039645448 y2= -0.0394472261273938
x = 0.756250000000002 y1= 1.40691728510185 y2= -0.0372207362109483
x = 0.759375000000002 y1= 1.4092631567962 y2= -0.0349922790972479
x = 0.762500000000002 y1= 1.41159794025114 y2= -0.0327618608805629
x = 0.765625000000002 y1= 1.41392156443704 y2= -0.0305294876316705
x = 0.768750000000002 y1= 1.41623395858392 y2= -0.0282951653979577
x = 0.771875000000002 y1= 1.41853505218422 y2= -0.0260589002035248
x = 0.775000000000002 y1= 1.4208247749957 y2= -0.0238206980492876
x = 0.778125000000002 y1= 1.42310305704426 y2= -0.0215805649130793
x = 0.781250000000002 y1= 1.42536982862674 y2= -0.0193385067497522
x = 0.784375000000002 y1= 1.42762502031373 y2= -0.0170945294912788
x = 0.787500000000003 y1= 1.42986856295241 y2= -0.014848639046852
x = 0.790625000000003 y1= 1.43210038766935 y2= -0.0126008413029857
x = 0.793750000000003 y1= 1.43432042587328 y2= -0.0103511421236141
x = 0.796875000000003 y1= 1.43652860925791 y2= -0.00809954735019121
x = 0.800000000000003 y1= 1.43872486980468 y2= -0.00584606280178927
x = 0.803125000000003 y1= 1.44090913978556 y2= -0.00359069427519723
x = 0.806250000000003 y1= 1.44308135176581 y2= -0.00133344754501853
x = 0.809375000000003 y1= 1.44524143860673 y2= 0.000925671636231514
x = 0.812500000000003 y1= 1.44738933346843 y2= 0.0031866575380288
x = 0.815625000000003 y1= 1.44952496981255 y2= 0.00544950445174396
x = 0.818750000000003 y1= 1.45164828140502 y2= 0.00771420669054632
x = 0.821875000000003 y1= 1.45375920231877 y2= 0.00998075858930831
x = 0.825000000000003 y1= 1.45585766693646 y2= 0.0122491545045103
x = 0.828125000000003 y1= 1.45794360995318 y2= 0.0145193888141461
x = 0.831250000000003 y1= 1.46001696637918 y2= 0.0167914559176283
x = 0.834375000000003 y1= 1.46207767154252 y2= 0.0190653502356947
x = 0.837500000000003 y1= 1.46412566109182 y2= 0.0213410662103151
x = 0.840625000000003 y1= 1.46616087099886 y2= 0.023618598304598
x = 0.843750000000003 y1= 1.46818323756131 y2= 0.0258979410026982
x = 0.846875000000003 y1= 1.47019269740537 y2= 0.0281790888097248
x = 0.850000000000003 y1= 1.4721891874884 y2= 0.0304620362516494
x = 0.853125000000003 y1= 1.4741726451016 y2= 0.0327467778752149
x = 0.856250000000004 y1= 1.4761430078726 y2= 0.0350333082478447
x = 0.859375000000004 y1= 1.47810021376813 y2= 0.0373216219575525
x = 0.862500000000004 y1= 1.48004420109659 y2= 0.039611713612852
x = 0.865625000000004 y1= 1.48197490851068 y2= 0.0419035778426675
x = 0.868750000000004 y1= 1.48389227500996 y2= 0.0441972092962447
x = 0.871875000000004 y1= 1.4857962399435 y2= 0.0464926026430623
x = 0.875000000000004 y1= 1.48768674301238 y2= 0.0487897525727431
x = 0.878125000000004 y1= 1.48956372427229 y2= 0.0510886537949666
x = 0.881250000000004 y1= 1.49142712413609 y2= 0.0533893010393815
x = 0.884375000000004 y1= 1.49327688337633 y2= 0.0556916890555182
x = 0.887500000000004 y1= 1.49511294312782 y2= 0.0579958126127027
x = 0.890625000000004 y1= 1.49693524489008 y2= 0.0603016664999699
x = 0.893750000000004 y1= 1.49874373052996 y2= 0.0626092455259778
x = 0.896875000000004 y1= 1.50053834228403 y2= 0.0649185445189224
x = 0.900000000000004 y1= 1.50231902276114 y2= 0.0672295583264521
x = 0.903125000000004 y1= 1.50408571494489 y2= 0.0695422818155835
x = 0.906250000000004 y1= 1.50583836219606 y2= 0.0718567098726168
x = 0.909375000000004 y1= 1.50757690825513 y2= 0.074172837403052
x = 0.912500000000004 y1= 1.50930129724465 y2= 0.0764906593315057
x = 0.915625000000004 y1= 1.51101147367174 y2= 0.0788101706016277
x = 0.918750000000004 y1= 1.51270738243047 y2= 0.0811313661760183
x = 0.921875000000004 y1= 1.51438896880432 y2= 0.083454241036146
x = 0.925000000000004 y1= 1.5160561784685 y2= 0.0857787901822659
x = 0.928125000000005 y1= 1.51770895749241 y2= 0.0881050086333376
x = 0.931250000000005 y1= 1.51934725234198 y2= 0.0904328914269445
x = 0.934375000000005 y1= 1.52097100988206 y2= 0.0927624336192126
x = 0.937500000000005 y1= 1.52258017737873 y2= 0.0950936302847307
x = 0.940625000000005 y1= 1.52417470250168 y2= 0.0974264765164695
x = 0.943750000000005 y1= 1.52575453332651 y2= 0.0997609674257029
x = 0.946875000000005 y1= 1.52731961833705 y2= 0.102097098141928
x = 0.950000000000005 y1= 1.52886990642768 y2= 0.104434863812786
x = 0.953125000000005 y1= 1.5304053469056 y2= 0.106774259603985
x = 0.956250000000005 y1= 1.53192588949308 y2= 0.109115280699221
x = 0.959375000000005 y1= 1.5334314843298 y2= 0.111457922300098
x = 0.962500000000005 y1= 1.53492208197503 y2= 0.113802179626055
x = 0.965625000000005 y1= 1.53639763340988 y2= 0.116148047914285
x = 0.968750000000005 y1= 1.53785809003957 y2= 0.11849552241966
x = 0.971875000000005 y1= 1.53930340369556 y2= 0.120844598414655
x = 0.975000000000005 y1= 1.54073352663783 y2= 0.123195271189272
x = 0.978125000000005 y1= 1.54214841155701 y2= 0.125547536050961
x = 0.981250000000005 y1= 1.54354801157656 y2= 0.127901388324549
x = 0.984375000000005 y1= 1.54493228025497 y2= 0.130256823352166
x = 0.987500000000005 y1= 1.54630117158781 y2= 0.132613836493163
x = 0.990625000000005 y1= 1.54765464000997 y2= 0.134972423124046
x = 0.993750000000005 y1= 1.54899264039769 y2= 0.137332578638399
x = 0.996875000000006 y1= 1.5503151280707 y2= 0.139694298446808
x = 1.00000000000001 y1= 1.5516220587943 y2= 0.142057577976792
| 32.527523 | 69 | 0.743666 |
474edfc7b9b2458bd6776dbe29b4c1ec612e0a77 | 498 | dpr | Pascal | windows/src/ext/jedi/jcl/jcl/examples/windows/delphitools/resfix/ResFix.dpr | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 219 | 2017-06-21T03:37:03.000Z | 2022-03-27T12:09:28.000Z | windows/src/ext/jedi/jcl/jcl/examples/windows/delphitools/resfix/ResFix.dpr | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 4,451 | 2017-05-29T02:52:06.000Z | 2022-03-31T23:53:23.000Z | windows/src/ext/jedi/jcl/jcl/examples/windows/delphitools/resfix/ResFix.dpr | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 72 | 2017-05-26T04:08:37.000Z | 2022-03-03T10:26:20.000Z | program ResFix;
{$I jcl.inc}
uses
Forms,
ResFixMain in 'ResFixMain.pas' {MainForm},
About in '..\Common\About.pas' {AboutBox},
ToolsUtils in '..\Common\ToolsUtils.pas',
ExceptDlg in '..\..\..\..\experts\repository\ExceptionDialog\StandardDialogs\ExceptDlg.pas' {ExceptionDialog};
{$R *.RES}
{$R ..\..\..\..\source\windows\JclCommCtrlAsInvoker.res}
begin
Application.Initialize;
Application.Title := 'ResFix';
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.
| 23.714286 | 112 | 0.704819 |
472165753b529adcdc68bf7efaff11ec5d9ca0e7 | 8,805 | pas | Pascal | windows/src/ext/jedi/jvcl/tests/archive/jvcl132/source/JvCaretEdit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 219 | 2017-06-21T03:37:03.000Z | 2022-03-27T12:09:28.000Z | windows/src/ext/jedi/jvcl/tests/archive/jvcl132/source/JvCaretEdit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 4,451 | 2017-05-29T02:52:06.000Z | 2022-03-31T23:53:23.000Z | windows/src/ext/jedi/jvcl/tests/archive/jvcl132/source/JvCaretEdit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 72 | 2017-05-26T04:08:37.000Z | 2022-03-03T10:26:20.000Z | {-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvAlignListbox.PAS, released on 2000-11-22.
The Initial Developer of the Original Code is Peter Below <100113.1101@compuserve.com>
Portions created by Peter Below are Copyright (C) 2000 Peter Below.
All Rights Reserved.
Contributor(s): ______________________________________.
Last Modified: 2000-mm-dd
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net
Known Issues:
-----------------------------------------------------------------------------}
{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$I JEDI.INC}
{$IFDEF DELPHI6_UP}
{$WARN UNIT_PLATFORM OFF}
{$ENDIF}
{$IFDEF LINUX}
This unit is only supported on Windows!
{$ENDIF}
{== unit CaretEdit ====================================================}
{: Implements a TEdit and TMemo derivative that has a configurable caret.
@author Dr. Peter Below
@desc Version 1.0 created 20 Oktober 2000<BR>
Current revision 1.0<BR>
Last modified 20 Oktober 2000<P>
Install this unit via Component->Install component into a run-time package}
{======================================================================}
unit JvCaretEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, JVCLVer;
type
{ A caret can be specified either by giving a bitmap that defines its shape
or by defining the caret width and height. If a bitmap is specified the
other properties are set to 0, if width or height are specified the
bitmap is not used. A change to the caret at runtime will only have an
immediate effect if the control has focus. }
TJvCaret = class(TPersistent)
private
FCaretBitmap: TBitmap;
FCaretWidth: Integer;
FCaretHeight: Integer;
FGrayCaret: Boolean;
FCaretOwner: TCustomEdit;
FUpdatecount: Integer;
FChangedEvent: TNotifyEvent;
procedure SetCaretBitmap(const Value: TBitmap);
procedure SetCaretHeight(const Value: Integer);
procedure SetCaretWidth(const Value: Integer);
procedure SetGrayCaret(const Value: Boolean);
procedure ReadBitmap(Stream: TStream);
procedure WriteBitmap(Stream: TStream);
protected
procedure Changed; dynamic;
property CaretOwner: TCustomEdit read FCaretOwner;
property Updatecount: Integer read FUpdatecount;
public
constructor Create(owner: TCustomEdit);
destructor Destroy; override;
procedure DefineProperties(Filer: TFiler); override;
procedure CreateCaret;
procedure Assign(Source: TPersistent); override;
procedure BeginUpdate;
procedure EndUpdate;
property OnChanged: TNotifyEvent read FChangedEvent write FChangedEvent;
published
{ Note: streaming system does not deal properly with a published persistent
property on another nested persitent. We use a pseudoproperty to save the
bitmap. }
property Bitmap: TBitmap read FCaretBitmap write SetCaretBitmap stored false;
property Width: Integer read FCaretWidth write SetCaretWidth default 0;
property Height: Integer read FCaretHeight write SetCaretHeight default 0;
property Gray: Boolean read FGrayCaret write SetGrayCaret default false;
end;
TJvCaretEdit = class(TEdit)
private
{ Private declarations }
FCaret: TJvCaret;
procedure SetCaret(const Value: TJvCaret);
procedure CaretChanged(sender: TObject); dynamic;
procedure WMSetFocus(var msg: TMessage); message WM_SETFOCUS;
public
{ Public declarations }
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
property Caret: TJvCaret read FCaret write SetCaret;
end;
TJvCaretMemo = class(TMemo)
private
{ Private declarations }
FCaret: TJvCaret;
FAboutJVCL: TJVCLAboutInfo;
procedure CaretChanged(sender: TObject); dynamic;
procedure SetCaret(const Value: TJvCaret);
procedure WMSetFocus(var msg: TMessage); message WM_SETFOCUS;
public
{ Public declarations }
constructor Create(aOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
property Caret: TJvCaret read FCaret write SetCaret;
end;
implementation
uses
JvComponentFunctions;
{ TJvCaret }
procedure TJvCaret.Assign(Source: TPersistent);
begin
if source is TJvCaret then
begin
BeginUpdate;
try
FCaretWidth := TJvCaret(Source).Width;
FCaretHeight := TJvCaret(Source).Height;
FGrayCaret := TJvCaret(Source).Gray;
Bitmap := TJvCaret(Source).Bitmap;
finally
EndUpdate;
end;
end
else
inherited;
end;
procedure TJvCaret.BeginUpdate;
begin
Inc(FUpdateCount);
end;
procedure TJvCaret.Changed;
begin
if Assigned(OnChanged) and (FUpdatecount = 0) then
OnChanged(self);
end;
constructor TJvCaret.Create(owner: TCustomEdit);
begin
Assert(Assigned(owner));
inherited Create;
FCaretOwner := owner;
FCaretBitmap := TBitmap.Create;
end;
procedure TJvCaret.CreateCaret;
function UsingBitmap: Boolean;
begin
result := (Width = 0) and (Height = 0) and not Gray
and not Bitmap.Empty;
end;
function IsDefaultCaret: Boolean;
begin
Result := (Width = 0) and (Height = 0) and not Gray
and Bitmap.Empty;
end;
const
GrayHandles: array[Boolean] of THandle = (0, THandle(-1));
begin
if FCaretOwner.Focused
and not (csDesigning in FCaretOwner.ComponentState)
and not IsDefaultCaret then
begin
if UsingBitmap then
OSCheck(Windows.CreateCaret(FCaretOwner.handle, Bitmap.Handle, 0, 0))
else if not Windows.CreateCaret(FCaretOwner.handle, GrayHandles[Gray],
Width, Height) then
Windows.CreateCaret(FCaretOwner.handle, 0, Width, Height);
{ Gray carets seem to be unsupported on Win95 at least, so if the create
failed for the gray caret, try again with a standard black caret }
ShowCaret(FCaretOwner.handle);
end;
end;
procedure TJvCaret.ReadBitmap(Stream: TStream);
begin
FCaretBitmap.LoadFromStream(Stream);
end;
procedure TJvCaret.WriteBitmap(Stream: TStream);
begin
FCaretBitmap.SaveToStream(Stream);
end;
procedure TJvCaret.DefineProperties(Filer: TFiler);
begin
Filer.DefineBinaryProperty('CaretBitmap', ReadBitmap,
WriteBitmap, not FCaretBitmap.Empty);
end;
destructor TJvCaret.Destroy;
begin
FCaretBitmap.Free;
inherited;
end;
procedure TJvCaret.EndUpdate;
begin
Dec(FUpdatecount);
Changed;
end;
procedure TJvCaret.SetCaretBitmap(const Value: TBitmap);
begin
FCaretBitmap.Assign(value);
FCaretWidth := 0;
FCaretHeight := 0;
FGrayCaret := false;
Changed;
end;
procedure TJvCaret.SetCaretHeight(const Value: Integer);
begin
if FCaretHeight <> Value then
begin
FCaretHeight := Value;
Changed;
end;
end;
procedure TJvCaret.SetCaretWidth(const Value: Integer);
begin
if FCaretWidth <> Value then
begin
FCaretWidth := Value;
Changed;
end;
end;
procedure TJvCaret.SetGrayCaret(const Value: Boolean);
begin
if FGrayCaret <> Value then
begin
FGrayCaret := Value;
Changed;
end;
end;
{ TJvCaretEdit }
procedure TJvCaretEdit.CaretChanged(sender: TObject);
begin
FCaret.CreateCaret;
end;
constructor TJvCaretEdit.Create(aOwner: TComponent);
begin
inherited;
FCaret := TJvCaret.Create(self);
FCaret.OnChanged := CaretChanged;
end;
destructor TJvCaretEdit.Destroy;
begin
FCaret.Free;
inherited;
end;
procedure TJvCaretEdit.SetCaret(const Value: TJvCaret);
begin
FCaret.Assign(Value);
end;
procedure TJvCaretEdit.WMSetFocus(var msg: TMessage);
begin
inherited;
FCaret.CreateCaret;
end;
{ TJvCaretMemo }
procedure TJvCaretMemo.CaretChanged(sender: TObject);
begin
FCaret.CreateCaret;
end;
constructor TJvCaretMemo.Create(aOwner: TComponent);
begin
inherited;
FCaret := TJvCaret.Create(self);
FCaret.OnChanged := CaretChanged;
end;
destructor TJvCaretMemo.Destroy;
begin
FCaret.Free;
inherited;
end;
procedure TJvCaretMemo.SetCaret(const Value: TJvCaret);
begin
FCaret.Assign(Value);
end;
procedure TJvCaretMemo.WMSetFocus(var msg: TMessage);
begin
inherited;
FCaret.CreateCaret;
end;
end.
| 26.681818 | 86 | 0.718796 |
f137a776ac174e4329fefad3262b5e7fea7b1fd7 | 2,101 | dfm | Pascal | IMod/demo/SeuilG.dfm | delphi-pascal-archive/i-mod | 592bdcd9f776d1c9a79ea0b58ae592ce2febbdd6 | [
"Unlicense"
]
| null | null | null | IMod/demo/SeuilG.dfm | delphi-pascal-archive/i-mod | 592bdcd9f776d1c9a79ea0b58ae592ce2febbdd6 | [
"Unlicense"
]
| null | null | null | IMod/demo/SeuilG.dfm | delphi-pascal-archive/i-mod | 592bdcd9f776d1c9a79ea0b58ae592ce2febbdd6 | [
"Unlicense"
]
| null | null | null | object SeuilGForm: TSeuilGForm
Left = 198
Top = 114
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Seuil Vert'
ClientHeight = 85
ClientWidth = 177
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Icon.Data = {
0000010001001010100000000000280100001600000028000000100000002000
00000100040000000000C0000000000000000000000000000000000000000000
000000008000008000000080800080000000800080008080000080808000C0C0
C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000000
000000000000070000000000000008AAAAAAAAAAAA0008AAAAAAAAAAAA0008AA
AAAAAAAAAA0008AAAAAAAAAAAA0008AAAAAAAAAAAA0008AAAAAAAAAAAA0008AA
AAAAAAAAAA0008AAAAAAAAAAAA0008AAAAAAAAAAAA0008AAAAAAAAAAAA0008AA
AAAAAAAAAA0008AAAAAAAAAAAA0008888888888888700000000000000000FFFF
0000800100008001000080010000800100008001000080010000800100008001
0000800100008001000080010000800100008001000080010000FFFF0000}
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object MinLabel: TLabel
Left = 8
Top = 8
Width = 47
Height = 13
Caption = 'Minimum :'
end
object MaxLabel: TLabel
Left = 96
Top = 8
Width = 44
Height = 13
Caption = 'Maximum'
end
object ApplyBtn: TButton
Left = 8
Top = 56
Width = 75
Height = 25
Caption = 'Appliquer'
TabOrder = 0
OnClick = ApplyBtnClick
end
object CancelBtn: TButton
Left = 96
Top = 56
Width = 75
Height = 25
Caption = 'Annuler'
TabOrder = 1
OnClick = CancelBtnClick
end
object MinValue: TSpinEdit
Left = 8
Top = 27
Width = 73
Height = 22
MaxValue = 255
MinValue = 0
TabOrder = 2
Value = 1
end
object MaxValue: TSpinEdit
Left = 96
Top = 27
Width = 73
Height = 22
MaxValue = 255
MinValue = 0
TabOrder = 3
Value = 1
end
end
| 25.011905 | 69 | 0.687768 |
474d4c50e5802a1dc0c62191db22960f5eb18326 | 30,546 | pas | Pascal | Source/FMX.IconFontsImageList.pas | HemulGM/IconFontsImageList | 29a481b0a78424b7be58aed3f54b69703f8297f7 | [
"Apache-2.0"
]
| 2 | 2021-06-29T17:12:22.000Z | 2022-02-19T15:03:09.000Z | Source/FMX.IconFontsImageList.pas | HemulGM/IconFontsImageList | 29a481b0a78424b7be58aed3f54b69703f8297f7 | [
"Apache-2.0"
]
| null | null | null | Source/FMX.IconFontsImageList.pas | HemulGM/IconFontsImageList | 29a481b0a78424b7be58aed3f54b69703f8297f7 | [
"Apache-2.0"
]
| 1 | 2020-01-17T19:35:34.000Z | 2020-01-17T19:35:34.000Z | {******************************************************************************}
{ }
{ Icon Fonts ImageList fmx: An extended ImageList for Delphi/FireMonkey }
{ to simplify use of Icons (resize, colors and more...) }
{ }
{ Copyright (c) 2019-2021 (Ethea S.r.l.) }
{ Author: Carlo Barazzetta }
{ Contributors: }
{ Nicola Tambascia }
{ Luca Minuti }
{ }
{ https://github.com/EtheaDev/IconFontsImageList }
{ }
{******************************************************************************}
{ }
{ Licensed under the Apache License, Version 2.0 (the "License"); }
{ you may not use this file except in compliance with the License. }
{ You may obtain a copy of the License at }
{ }
{ http://www.apache.org/licenses/LICENSE-2.0 }
{ }
{ Unless required by applicable law or agreed to in writing, software }
{ distributed under the License is distributed on an "AS IS" BASIS, }
{ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }
{ See the License for the specific language governing permissions and }
{ limitations under the License. }
{ }
{******************************************************************************}
unit FMX.IconFontsImageList;
interface
{$INCLUDE IconFontsImageList.inc}
uses
System.Classes
, System.UITypes
, System.Rtti
, System.Messaging
, System.ImageList
, System.Types
, FMX.Controls
, FMX.ImgList
, FMX.MultiResBitmap
, FMX.Types
, FMX.Graphics
, FMX.Objects
;
resourcestring
ERR_ICONFONTSFMX_VALUE_NOT_ACCEPTED = 'Value %s not accepted!';
ERR_ICONFONTSFMX_FONT_NOT_INSTALLED = 'Font "%s" is not installed!';
const
IconFontsImageListVersion = '1.8.0';
DEFAULT_SIZE = 32;
ZOOM_DEFAULT = 100;
type
//TIconFontMissing = procedure (const AFontName: TFontName) of object;
TIconFontMultiResBitmap = class;
TIconFontsImageList = class;
TIconFontsSourceItem = class;
TIconFontBitmapItem = class(TCustomBitmapItem)
private
FWidth, FHeight, FZoom: Integer;
FOwnerMultiResBitmap: TIconFontMultiResBitmap;
procedure SetBitmap(const AValue: TBitmapOfItem);
function GetBitmap: TBitmapOfItem;
procedure SetSize(const AValue: Integer);
procedure DrawFontIcon;
function GetCharacter: String;
function GetFontName: TFontName;
function GetFontColor: TAlphaColor;
function GetOpacity: single;
function GetSize: Integer;
procedure SetIconSize(const AWidth, AHeight, AZoom: Integer);
function GetHeight: Integer;
function GetWidth: Integer;
procedure SetHeight(const AValue: Integer);
procedure SetWidth(const AValue: Integer);
function StoreWidth: Boolean;
function StoreHeight: Boolean;
function StoreSize: Boolean;
procedure SetZoom(const AValue: Integer);
protected
function BitmapStored: Boolean; override;
function GetDisplayName: string; override;
public
constructor Create(Collection: TCollection); override;
property Character: String read GetCharacter;
published
property Bitmap: TBitmapOfItem read GetBitmap write SetBitmap stored False;
property Scale;
property Size: Integer read GetSize write SetSize stored StoreSize default DEFAULT_SIZE;
property Width: Integer read GetWidth write SetWidth stored StoreWidth default DEFAULT_SIZE;
property Height: Integer read GetHeight write SetHeight stored StoreHeight default DEFAULT_SIZE;
property Zoom: Integer read FZoom write SetZoom default ZOOM_DEFAULT;
//Readonly properties from Source Item
property FontName: TFontName read GetFontName;
property FontColor: TAlphaColor read GetFontColor stored false;
property Opacity: single read GetOpacity stored false;
end;
TIconFontBitmapItemClass = class of TIconFontBitmapItem;
TIconFontMultiResBitmap = class(TMultiResBitmap)
private
FOwnerSourceItem: TIconFontsSourceItem;
procedure UpdateImageSize(const AWidth, AHeight, AZoom: Integer);
protected
constructor Create(AOwner: TPersistent; ItemClass: TIconFontBitmapItemClass); overload;
public
end;
{TIconFontsSourceItem}
TIconFontsSourceItem = class(TCustomSourceItem)
private
FOwnerImageList: TIconFontsImageList;
FFontIconDec: Integer;
FOpacity: single;
FFontName: TFontName;
FFontColor: TAlphaColor;
procedure UpdateAllItems;
function GetCharacter: String;
function GetFontName: TFontName;
function GetFontColor: TAlphaColor;
function GetFontIconDec: Integer;
function GetFontIconHex: string;
procedure SetFontColor(const AValue: TAlphaColor);
procedure SetFontIconDec(const AValue: Integer);
procedure SetFontIconHex(const AValue: string);
procedure SetFontName(const AValue: TFontName);
procedure SetOpacity(const AValue: single);
procedure AutoSizeBitmap(const AWidth, AHeight, AZoom: Integer);
function GetIconName: string;
procedure SetIconName(const Value: string);
function GetOpacity: single;
function GetDestinationItem: TCustomDestinationItem;
procedure UpdateIconAttributes(const AFontColor: TAlphaColor;
const AReplaceFontColor: Boolean = False; const AFontName: TFontName = '');
protected
function GetDisplayName: string; override;
function CreateMultiResBitmap: TMultiResBitmap; override;
function StoreFontName: Boolean; virtual;
function StoreFontColor: Boolean; virtual;
function StoreOpacity: Boolean; virtual;
public
constructor Create(Collection: TCollection); override;
procedure Assign(Source: TPersistent); override;
property Character: String read GetCharacter;
published
property MultiResBitmap;
property IconName: string read GetIconName write SetIconName;
property FontName: TFontName read GetFontName write SetFontName stored StoreFontName;
property FontIconDec: Integer read GetFontIconDec write SetFontIconDec stored true default 0;
property FontIconHex: string read GetFontIconHex write SetFontIconHex stored false;
property FontColor: TAlphaColor read GetFontColor write SetFontColor stored StoreFontColor;
property Opacity: single read GetOpacity write SetOpacity stored StoreOpacity;
end;
{TIconFontsImageList}
TIconFontsImageList = class(TCustomImageList)
private
FWidth, FHeight: Integer;
FAutoSizeBitmaps: Boolean;
FFontName: TFontName;
FFontColor: TAlphaColor;
FOpacity: single;
FZoom: Integer;
//FOnFontMissing: TIconFontMissing;
procedure SetAutoSizeBitmaps(const Value: Boolean);
procedure SetFontName(const Value: TFontName);
procedure UpdateSourceItems;
procedure UpdateDestination(ASize: TSize; const Index: Integer);
procedure SetFontColor(const Value: TAlphaColor);
procedure SetOpacity(const Value: single);
procedure SetIconSize(const AWidth, AHeight: Integer);
function GetSize: Integer;
procedure SetSize(const AValue: Integer);
function GetHeight: Integer;
function GetWidth: Integer;
procedure SetHeight(const AValue: Integer);
procedure SetWidth(const AValue: Integer);
procedure SetZoom(const AValue: Integer);
function StoreWidth: Boolean;
function StoreHeight: Boolean;
function StoreSize: Boolean;
protected
procedure Loaded; override;
function CreateSource: TSourceCollection; override;
function DoBitmap(Size: TSize; const Index: Integer): TBitmap; override;
function StoreOpacity: Boolean; virtual;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
procedure DeleteIcon(const AIndex: Integer);
function InsertIcon(const AIndex: Integer;
const AFontIconDec: Integer;
const AFontName: TFontName = '';
const AFontColor: TAlphaColor = TAlphaColors.Null): Integer;
//Multiple icons methods
function AddIcons(const AFromIconDec, AToIconDec: Integer;
const AFontName: TFontName = '';
const AFontColor: TAlphaColor = TAlphaColors.Null): Integer;
procedure ClearIcons; virtual;
procedure UpdateIconAttributes(const ASize: Integer; const AFontColor: TAlphaColor;
const AReplaceFontColor: Boolean = False; const AFontName: TFontName = ''); overload;
procedure UpdateIconAttributes(const AFontColor: TAlphaColor;
const AReplaceFontColor: Boolean = False; const AFontName: TFontName = ''); overload;
published
//Publishing properties of standard ImageList
property Source;
property Width: Integer read GetWidth write SetWidth stored StoreWidth default DEFAULT_SIZE;
property Height: Integer read GetHeight write SetHeight stored StoreHeight default DEFAULT_SIZE;
property Zoom: Integer read FZoom write SetZoom default ZOOM_DEFAULT;
property Destination;
property OnChange;
property OnChanged;
property Size: Integer read GetSize write SetSize stored StoreSize default DEFAULT_SIZE;
property AutoSizeBitmaps: Boolean read FAutoSizeBitmaps write SetAutoSizeBitmaps default True;
property FontName: TFontName read FFontName write SetFontName;
property FontColor: TAlphaColor read FFontColor write SetFontColor;
property Opacity: single read FOpacity write SetOpacity stored StoreOpacity;
//property OnFontMissing: TIconFontMissing read FOnFontMissing write FOnFontMissing;
end;
implementation
uses
System.Math
, System.RTLConsts
, System.SysUtils
, System.Character
, FMX.Forms
, FMX.Consts;
{ TIconFontBitmapItem }
function TIconFontBitmapItem.BitmapStored: Boolean;
begin
Result := False;
end;
constructor TIconFontBitmapItem.Create(Collection: TCollection);
begin
inherited;
FWidth := DEFAULT_SIZE;
FHeight := DEFAULT_SIZE;
FZoom := ZOOM_DEFAULT;
if Collection is TIconFontMultiResBitmap then
FOwnerMultiResBitmap := Collection as TIconFontMultiResBitmap;
end;
procedure TIconFontBitmapItem.DrawFontIcon;
var
LFont: TFont;
LBitmap: TBitmap;
LBitmapWidth, LBitmapHeight: Integer;
LRect: TRectF;
begin
LBitmap := inherited Bitmap;
LBitmapWidth := Round(FWidth * Scale);
LBitmapHeight := Round(FHeight * Scale);
LFont := TFont.Create;
try
LFont.Family := FontName;
LFont.Size := Min(FWidth, FHeight) * FZoom / 100;
LFont.Size := LFont.Size * FZoom / 100;
LBitmap.Width := LBitmapWidth;
LBitmap.Height := LBitmapHeight;
LBitmap.Canvas.BeginScene;
try
LBitmap.Canvas.Clear(TAlphaColors.Null);
LBitmap.Canvas.Fill.Color := FontColor;
LBitmap.Canvas.Font.Assign(LFont);
LRect.Create(0,0,FWidth,FHeight);
LBitmap.Canvas.FillText(LRect,
Character, False, Opacity,
[TFillTextFlag.RightToLeft],
TTextAlign.Center, TTextAlign.Center);
finally
LBitmap.Canvas.EndScene;
end;
finally
LFont.DisposeOf;
end;
end;
function TIconFontBitmapItem.GetBitmap: TBitmapOfItem;
begin
DrawFontIcon;
Result := inherited Bitmap;
end;
function TIconFontBitmapItem.GetCharacter: String;
begin
Result := FOwnerMultiResBitmap.FOwnerSourceItem.Character;
end;
function TIconFontBitmapItem.GetDisplayName: string;
begin
Result := Format('%s - %dx%d - Scale: %s',
[FOwnerMultiResBitmap.FOwnerSourceItem.Name,
Size, Size, FloatToStr(Scale)]);
end;
function TIconFontBitmapItem.GetFontColor: TAlphaColor;
begin
if FOwnerMultiResBitmap.FOwnerSourceItem.FontColor <> TAlphaColors.Null then
Result := FOwnerMultiResBitmap.FOwnerSourceItem.FontColor
else
Result := FOwnerMultiResBitmap.FOwnerSourceItem.FOwnerImageList.FontColor;
end;
function TIconFontBitmapItem.GetFontName: TFontName;
begin
Result := FOwnerMultiResBitmap.FOwnerSourceItem.FontName;
end;
function TIconFontBitmapItem.GetHeight: Integer;
begin
Result := inherited Height;
end;
function TIconFontBitmapItem.GetOpacity: single;
begin
Result := FOwnerMultiResBitmap.FOwnerSourceItem.Opacity;
end;
function TIconFontBitmapItem.GetSize: Integer;
begin
Result := Max(FWidth, FHeight);
if Result = 0 then
Result := DEFAULT_SIZE;
end;
function TIconFontBitmapItem.GetWidth: Integer;
begin
Result := inherited Width;
end;
procedure TIconFontBitmapItem.SetBitmap(const AValue: TBitmapOfItem);
begin
inherited Bitmap.Assign(AValue);
inherited Bitmap.BitmapScale := Scale;
end;
procedure TIconFontBitmapItem.SetHeight(const AValue: Integer);
begin
if AValue <> FHeight then
begin
FHeight := AValue;
DrawFontIcon;
end;
end;
procedure TIconFontBitmapItem.SetWidth(const AValue: Integer);
begin
if AValue <> FWidth then
begin
FWidth := AValue;
DrawFontIcon;
end;
end;
procedure TIconFontBitmapItem.SetZoom(const AValue: Integer);
begin
if (FZoom <> AValue) and (AValue <= 100) and (AValue >= 10) then
begin
FZoom := AValue;
DrawFontIcon;
end;
end;
procedure TIconFontBitmapItem.SetIconSize(const AWidth, AHeight, AZoom: Integer);
begin
if (AWidth <> 0) and (AHeight <> 0) and
((AWidth <> FWidth) or (AHeight <> FHeight) or (AZoom <> FZoom)) then
begin
FWidth := AWidth;
FHeight := AHeight;
FZoom := AZoom;
DrawFontIcon;
end;
end;
procedure TIconFontBitmapItem.SetSize(const AValue: Integer);
begin
if ((AValue <> FHeight) or (AValue <> FWidth)) then
SetIconSize(AValue, AValue, FZoom);
end;
function TIconFontBitmapItem.StoreHeight: Boolean;
begin
Result := (Width <> Height) and (Height <> DEFAULT_SIZE);
end;
function TIconFontBitmapItem.StoreSize: Boolean;
begin
Result := (Width = Height) and (Width <> DEFAULT_SIZE);
end;
function TIconFontBitmapItem.StoreWidth: Boolean;
begin
Result := (Width <> Height) and (Width <> DEFAULT_SIZE);
end;
{ TIconFontMultiResBitmap }
constructor TIconFontMultiResBitmap.Create(AOwner: TPersistent;
ItemClass: TIconFontBitmapItemClass);
begin
inherited Create(AOwner, ItemClass);
if (AOwner is TIconFontsSourceItem) then
FOwnerSourceItem := TIconFontsSourceItem(AOwner)
else
FOwnerSourceItem := nil;
end;
procedure TIconFontMultiResBitmap.UpdateImageSize(const AWidth, AHeight, AZoom: Integer);
var
I, J: Integer;
LItem: TIconFontBitmapItem;
begin
for I := 0 to ScaleList.Count - 1 do
begin
for J := 0 to Count - 1 do
begin
LItem := Items[J] as TIconFontBitmapItem;
if (LItem.FWidth <> AWidth) or (LItem.FHeight <> AHeight) then
begin
LItem.FWidth := AWidth;
LItem.FHeight := AHeight;
LItem.Zoom := AZoom;
LItem.DrawFontIcon;
end;
end;
end;
end;
{ TIconFontsSourceItem }
procedure TIconFontsSourceItem.Assign(Source: TPersistent);
begin
if Source is TIconFontsSourceItem then
begin
FFontName := TIconFontsSourceItem(Source).FFontName;
FFontIconDec := TIconFontsSourceItem(Source).FFontIconDec;
FFontColor := TIconFontsSourceItem(Source).FFontColor;
FOpacity := TIconFontsSourceItem(Source).FOpacity;
end;
inherited;
end;
procedure TIconFontsSourceItem.AutoSizeBitmap(const AWidth, AHeight, AZoom: Integer);
begin
//If present, delete multiple items
while MultiResBitmap.Count > 1 do
MultiResBitmap.Delete(MultiResBitmap.Count-1);
//Add only one item
if MultiResBitmap.Count = 0 then
MultiResBitmap.Add;
(MultiResBitmap as TIconFontMultiResBitmap).UpdateImageSize(AWidth, AHeight, AZoom);
end;
constructor TIconFontsSourceItem.Create(Collection: TCollection);
begin
inherited Create(Collection);
FFontIconDec := 0;
FOpacity := -1;
FFontName := '';
FFontColor := TAlphaColors.null;
UpdateAllItems;
end;
function TIconFontsSourceItem.CreateMultiResBitmap: TMultiResBitmap;
begin
Result := TIconFontMultiResBitmap.Create(self, TIconFontBitmapItem);
FOwnerImageList := Result.ImageList as TIconFontsImageList;
end;
function TIconFontsSourceItem.GetCharacter: String;
begin
{$WARN SYMBOL_DEPRECATED OFF}
if FFontIconDec <> 0 then
Result := ConvertFromUtf32(FFontIconDec)
else
Result := '';
end;
function TIconFontsSourceItem.GetDisplayName: string;
begin
if Name <> '' then
Result := Format('%s - Hex: %s - (%s)',
[FontName, FontIconHex, Name])
else
Result := Format('%s - Hex: %s',
[FontName, FontIconHex]);
end;
function TIconFontsSourceItem.GetFontColor: TAlphaColor;
begin
Result := FFontColor;
end;
function TIconFontsSourceItem.GetFontIconDec: Integer;
begin
Result := FFontIconDec;
end;
function TIconFontsSourceItem.GetFontIconHex: string;
begin
if FFontIconDec <> 0 then
Result := IntToHex(FFontIconDec, 1)
else
Result := '';
end;
function TIconFontsSourceItem.GetFontName: TFontName;
begin
if FFontName = '' then
Result := FOwnerImageList.FFontName
else
Result := FFontName;
end;
function TIconFontsSourceItem.GetIconName: string;
begin
Result := inherited Name;
end;
function TIconFontsSourceItem.GetOpacity: single;
begin
if FOpacity = -1 then
Result := FOwnerImageList.FOpacity
else
Result := FOpacity;
end;
procedure TIconFontsSourceItem.SetFontColor(const AValue: TAlphaColor);
begin
FFontColor := AValue;
UpdateAllItems;
end;
procedure TIconFontsSourceItem.SetFontIconDec(const AValue: Integer);
begin
if AValue <> FFontIconDec then
begin
FFontIconDec := AValue;
UpdateAllItems;
end;
end;
procedure TIconFontsSourceItem.SetFontIconHex(const AValue: string);
begin
try
if (Length(AValue) = 4) or (Length(AValue) = 5) then
FontIconDec := StrToInt('$' + AValue)
else if (Length(AValue) = 0) then
FFontIconDec := 0
else
raise Exception.CreateFmt(ERR_ICONFONTSFMX_VALUE_NOT_ACCEPTED,[AValue]);
except
On E: EConvertError do
raise Exception.CreateFmt(ERR_ICONFONTSFMX_VALUE_NOT_ACCEPTED,[AValue])
else
raise;
end;
end;
procedure TIconFontsSourceItem.SetFontName(const AValue: TFontName);
begin
if (FontName <> AValue) then
begin
if (AValue = FOwnerImageList.FontName) then
FFontName := AValue
else
begin
FFontName := AValue;
UpdateAllItems;
end;
end;
end;
function TIconFontsSourceItem.GetDestinationItem: TCustomDestinationItem;
var
LDest: TCustomDestinationItem;
begin
Result := nil;
if FOwnerImageList.Destination.Count > Index then
begin
LDest := FOwnerImageList.Destination.Items[Index];
if (LDest.LayersCount > 0) and
SameText(LDest.Layers[0].Name, IconName) then
Result := LDest;
end;
end;
procedure TIconFontsSourceItem.SetIconName(const Value: string);
var
LDest: TCustomDestinationItem;
begin
if Value <> Name then
begin
LDest := GetDestinationItem;
inherited Name := Value;
if Assigned(LDest) then
LDest.Layers[0].Name := Value;
end;
end;
procedure TIconFontsSourceItem.SetOpacity(const AValue: single);
begin
if Assigned(FOwnerImageList) and (AValue = FOwnerImageList.Opacity) then
begin
FOpacity := -1;
end
else
FOpacity := AValue;
UpdateAllItems;
end;
function TIconFontsSourceItem.StoreFontColor: Boolean;
begin
Result := ((FOwnerImageList = nil) or (FFontColor <> FOwnerImageList.FFontColor))
and (FFontColor <> TAlphaColors.Null);
end;
function TIconFontsSourceItem.StoreFontName: Boolean;
begin
Result := (FOwnerImageList = nil) or (FFontName <> FOwnerImageList.FFontName);
end;
function TIconFontsSourceItem.StoreOpacity: Boolean;
begin
Result := (FOwnerImageList = nil) or (FOpacity <> FOwnerImageList.FOpacity);
end;
procedure TIconFontsSourceItem.UpdateIconAttributes(const AFontColor: TAlphaColor;
const AReplaceFontColor: Boolean = False; const AFontName: TFontName = '');
begin
//If AReplaceFontColor is false then the color of single icon is preserved
if AReplaceFontColor and (FFontColor <> TAlphaColors.Null) then
FFontColor := AFontColor;
//Replace FontName only if passed and different for specific Font
if (AFontName <> '') and (FFontName <> '') and (AFontName <> FFontName) then
FFontName := AFontName
else
FFontName := '';
end;
procedure TIconFontsSourceItem.UpdateAllItems;
var
I: Integer;
LItem: TIconFontBitmapItem;
LSize: TSize;
begin
for I := 0 to MultiResBitmap.Count -1 do
begin
LItem := MultiResBitmap.Items[I] as TIconFontBitmapItem;
Litem.DrawFontIcon;
if (I=0) and (FOwnerImageList <> nil) then
begin
LItem.SetIconSize(FOwnerImageList.Width, FOwnerImageList.Height, FOwnerImageList.Zoom);
LSize.cx := LItem.Width;
LSize.cy := LItem.Height;
FOwnerImageList.UpdateDestination(LSize, Index);
end;
end;
end;
{ TIconFontsImageList }
function TIconFontsImageList.InsertIcon(
const AIndex: Integer;
const AFontIconDec: Integer;
const AFontName: TFontName = '';
const AFontColor: TAlphaColor = TAlphaColors.Null): Integer;
var
LItem: TIconFontsSourceItem;
LDest: TCustomDestinationItem;
begin
LItem := Self.Source.Insert(AIndex) as TIconFontsSourceItem;
Result := LItem.Index;
LItem.MultiResBitmap.Add;
if AFontName <> '' then
LItem.FontName := AFontName;
LItem.FontIconDec := AFontIconDec;
if AFontColor <> TAlphaColors.Null then
LItem.FontColor := AFontColor;
LDest := Self.Destination.Insert(AIndex);
with LDest.Layers.Add do
Name := LItem.Name;
end;
function TIconFontsImageList.AddIcons(const AFromIconDec, AToIconDec: Integer;
const AFontName: TFontName = '';
const AFontColor: TAlphaColor = TAlphaColors.Null): Integer;
var
LFontIconDec: Integer;
LIndex: Integer;
begin
LIndex := Count;
for LFontIconDec := AFromIconDec to AToIconDec do
LIndex := InsertIcon(LIndex, LFontIconDec, AFontName, AFontColor) + 1;
Result := AFromIconDec - AToIconDec + 1;
end;
procedure TIconFontsImageList.Assign(Source: TPersistent);
begin
if Source is TIconFontsImageList then
begin
FontName := TIconFontsImageList(Source).FontName;
FontColor := TIconFontsImageList(Source).FontColor;
Opacity := TIconFontsImageList(Source).Opacity;
FAutoSizeBitmaps := TIconFontsImageList(Source).FAutoSizeBitmaps;
Zoom := TIconFontsImageList(Source).FZoom;
SetIconSize(TIconFontsImageList(Source).FWidth,
TIconFontsImageList(Source).FHeight);
end;
inherited;
end;
procedure TIconFontsImageList.ClearIcons;
begin
Source.Clear;
Destination.Clear;
end;
constructor TIconFontsImageList.Create(AOwner: TComponent);
begin
inherited;
FAutoSizeBitmaps := True;
FFontColor := TAlphaColors.Black;
FOpacity := 1;
FWidth := DEFAULT_SIZE;
FHeight := DEFAULT_SIZE;
FZoom := ZOOM_DEFAULT;
end;
function TIconFontsImageList.CreateSource: TSourceCollection;
begin
Result := TSourceCollection.Create(self, TIconFontsSourceItem);
end;
procedure TIconFontsImageList.UpdateDestination(ASize: TSize;
const Index: Integer);
var
LDestItem: TDestinationItem;
LSourceItem: TIconFontsSourceItem;
LIndex: Integer;
LWidth, LHeight: Integer;
begin
while Index > Destination.Count-1 do
Destination.Add;
LDestItem := Destination.Items[Index] as TDestinationItem;
if LDestItem.Layers.Count > 0 then
begin
LIndex := Source.indexOf(LDestItem.Layers[0].Name);
if LIndex >= 0 then
begin
LSourceItem := Source.Items[LIndex] as TIconFontsSourceItem;
if Assigned(LSourceItem) then
begin
if FAutoSizeBitmaps then
begin
if FWidth = FHeight then
begin
LWidth := Min(ASize.cy, ASize.cx);
LHeight := LWidth;
end
else if FWidth > FHeight then
begin
LWidth := Min(ASize.cy, ASize.cx);
LHeight := Round((FHeight / FWidth) * ASize.cy);
end
else
begin
LHeight := ASize.cy;
LWidth := Round((FWidth / FHeight) * ASize.cx);
end;
LSourceItem.AutoSizeBitmap(LWidth, LHeight, FZoom);
end
else
begin
LWidth := LSourceItem.FOwnerImageList.FWidth;
LHeight := LSourceItem.FOwnerImageList.FHeight;
end;
LDestItem.Layers[0].SourceRect.Top := 0;
LDestItem.Layers[0].SourceRect.Left := 0;
LDestItem.Layers[0].SourceRect.Right := LWidth;
LDestItem.Layers[0].SourceRect.Bottom := LHeight;
end;
end;
end;
end;
procedure TIconFontsImageList.UpdateIconAttributes(
const AFontColor: TAlphaColor; const AReplaceFontColor: Boolean;
const AFontName: TFontName);
begin
UpdateIconAttributes(Self.Size, AFontColor, AReplaceFontColor, AFontName);
end;
procedure TIconFontsImageList.UpdateIconAttributes(const ASize: Integer;
const AFontColor: TAlphaColor; const AReplaceFontColor: Boolean;
const AFontName: TFontName);
var
I: Integer;
LIconFontItem: TIconFontsSourceItem;
begin
if (AFontColor <> TAlphaColors.null) then
begin
Self.Size := ASize;
FFontColor := AFontColor;
for I := 0 to Source.Count -1 do
begin
LIconFontItem := Source.Items[I] as TIconFontsSourceItem;
LIconFontItem.UpdateIconAttributes(FFontColor, AReplaceFontColor, AFontName);
end;
end;
end;
procedure TIconFontsImageList.DeleteIcon(const AIndex: Integer);
var
LDest: TCustomDestinationItem;
LSourceItem: TIconFontsSourceItem;
begin
LSourceItem := Source.Items[AIndex] as TIconFontsSourceItem;
if Assigned(LSourceItem) then
begin
LDest := LSourceItem.GetDestinationItem;
Source.Delete(AIndex);
if Assigned(LDest) then
Destination.Delete(AIndex);
end;
end;
function TIconFontsImageList.DoBitmap(Size: TSize;
const Index: Integer): TBitmap;
begin
UpdateDestination(Size, Index);
Result := inherited DoBitmap(Size, Index);
end;
function TIconFontsImageList.StoreSize: Boolean;
begin
Result := (Width = Height) and (Width <> DEFAULT_SIZE);
end;
function TIconFontsImageList.StoreWidth: Boolean;
begin
Result := (Width <> Height) and (Width <> DEFAULT_SIZE);
end;
function TIconFontsImageList.StoreHeight: Boolean;
begin
Result := (Width <> Height) and (Height <> DEFAULT_SIZE);
end;
function TIconFontsImageList.GetSize: Integer;
begin
Result := Max(FWidth, FHeight);
end;
function TIconFontsImageList.GetWidth: Integer;
begin
Result := FWidth;
end;
function TIconFontsImageList.GetHeight: Integer;
begin
Result := FHeight;
end;
procedure TIconFontsImageList.Loaded;
begin
inherited;
UpdateSourceItems;
end;
procedure TIconFontsImageList.SetAutoSizeBitmaps(const Value: Boolean);
begin
FAutoSizeBitmaps := Value;
if (Count > 0) then
UpdateSourceItems;
end;
procedure TIconFontsImageList.UpdateSourceItems;
var
I: Integer;
LSourceItem: TIconFontsSourceItem;
begin
for I := 0 to Source.Count -1 do
begin
LSourceItem := Source[I] as TIconFontsSourceItem;
if LSourceItem.FFontName = '' then
LSourceItem.FontName := FFontName;
if LSourceItem.FOpacity = -1 then
LSourceItem.Opacity := FOpacity;
LSourceItem.UpdateAllItems;
end;
end;
procedure TIconFontsImageList.SetFontColor(const Value: TAlphaColor);
begin
if FFontColor <> Value then
begin
FFontColor := Value;
UpdateSourceItems;
Change;
end;
end;
procedure TIconFontsImageList.SetFontName(const Value: TFontName);
begin
if FFontName <> Value then
begin
//TODO: check font exists (multi-platform)
FFontName := Value;
UpdateSourceItems;
end;
end;
procedure TIconFontsImageList.SetHeight(const AValue: Integer);
begin
if FHeight <> AValue then
begin
FHeight := AValue;
UpdateSourceItems;
end;
end;
procedure TIconFontsImageList.SetIconSize(const AWidth, AHeight: Integer);
begin
if (AWidth <> 0) and (AHeight <> 0) and
((AWidth <> FWidth) or (AHeight <> FHeight)) then
begin
FWidth := AWidth;
FHeight := AHeight;
UpdateSourceItems;
end;
end;
procedure TIconFontsImageList.SetOpacity(const Value: single);
begin
if FOpacity <> Value then
begin
FOpacity := Value;
UpdateSourceItems;
end;
end;
function TIconFontsImageList.StoreOpacity: Boolean;
begin
Result := FOpacity <> 1;
end;
procedure TIconFontsImageList.SetSize(const AValue: Integer);
begin
if ((AValue <> FHeight) or (AValue <> FWidth)) then
SetIconSize(AValue, AValue);
end;
procedure TIconFontsImageList.SetWidth(const AValue: Integer);
begin
if FWidth <> AValue then
begin
FWidth := AValue;
UpdateSourceItems;
end;
end;
procedure TIconFontsImageList.SetZoom(const AValue: Integer);
begin
if (FZoom <> AValue) and (AValue <= 100) and (AValue >= 10) then
begin
FZoom := AValue;
UpdateSourceItems;
end;
end;
initialization
RegisterFmxClasses([TIconFontsImageList]);
StartClassGroup(TFmxObject);
ActivateClassGroup(TFmxObject);
GroupDescendentsWith(FMX.IconFontsImageList.TIconFontsImageList, TFmxObject);
end.
| 30.699497 | 101 | 0.681366 |
85cf2e3d109830ef27d8357a07a75b6ecb039ca0 | 4,001 | pas | Pascal | cbd/02/cs10/ej02 - discografica/ejer02.pas | sergiocarp10/unlp-info-s5 | d9cb457f2b44278ae495bafe67cedda3c7f2c102 | [
"Apache-2.0"
]
| 4 | 2021-03-14T20:45:38.000Z | 2022-03-09T04:31:24.000Z | cbd/02/cs10/ej02 - discografica/ejer02.pas | sergiocarp10/unlp-info-s5 | d9cb457f2b44278ae495bafe67cedda3c7f2c102 | [
"Apache-2.0"
]
| 7 | 2021-03-21T01:08:38.000Z | 2021-05-30T10:47:20.000Z | cbd/02/cs10/ej02 - discografica/ejer02.pas | sergiocarp10/unlp-info-s5 | d9cb457f2b44278ae495bafe67cedda3c7f2c102 | [
"Apache-2.0"
]
| 1 | 2021-05-29T20:06:54.000Z | 2021-05-29T20:06:54.000Z | program ejer02;
uses sysutils;
const
VALOR_ALTO = 9999;
type
str30 = string[30];
cd = record
codAutor: Integer;
nombreAutor: str30;
nombreDisco: str30;
genero: str30;
cantVendida: Integer;
end;
// Archivo origen ordenado por codigo autor, genero y nombre disco.
origen = file of cd;
procedure leerCd(var archivo:origen; var reg:cd);
begin
if eof(archivo) then reg.codAutor:=VALOR_ALTO
else read(archivo, reg);
end;
// algoritmica de corte de control
// precondicion: archivos abiertos
procedure listar(var miArchivo:origen; var miListado:text);
var
miCd: cd;
// para corte de control
autorActual: Integer;
generoActual: str30;
// para totalizar
sumaGenero: Integer;
sumaAutor: Integer;
sumaTotal: Integer;
begin
// contador total
sumaTotal:= 0;
// leer primer cd
leerCd(miArchivo, miCd);
// mientras queden cds
while (miCd.codAutor <> VALOR_ALTO) do begin
// guardo autor actual
autorActual:= miCd.codAutor;
writeln('Autor: ', autorActual);
writeln(miListado, 'Autor: ', autorActual);
sumaAutor:= 0;
// mientras sea el mismo autor
while (miCd.codAutor = autorActual) do begin
// guardo genero actual
generoActual:= miCd.genero;
writeln('Genero: ', generoActual);
writeln(miListado, 'Genero: ', generoActual);
sumaGenero:= 0;
// mientras sea mismo genero y autor
while (miCd.codAutor = autorActual) and (miCd.genero = generoActual) do begin
// suposicion: no hay discos repetidos
with (miCd) do begin
writeln('Nombre Disco: ', nombreDisco, ' cantidad vendida: ', cantVendida);
writeln(miListado, 'Nombre Disco: ', nombreDisco, ' cantidad vendida: ', cantVendida);
end;
sumaGenero:= sumaGenero + miCd.cantVendida;
sumaAutor:= sumaAutor + miCd.cantVendida;
sumaTotal:= sumaTotal + miCd.cantVendida;
// avanzo al siguiente cd
leerCd(miArchivo, miCd);
end;
// totalizar genero
writeln('Total Genero: ', sumaGenero);
writeln(miListado, 'Total Genero: ', sumaGenero);
end;
// totalizar autor
writeln('Total Autor: ', sumaAutor);
writeln(miListado, 'Total Autor: ', sumaAutor);
end;
// totalizar discografica
writeln('Total Discografica: ', sumaTotal);
end;
// -------------------- GENERADOR DE CDS -------------------------
procedure generarCds(var miArchivo: origen);
var
miCd: cd;
begin
randomize;
// generar ordenado por codigo autor, genero y nombre disco
miCd.codAutor:= 1;
miCd.nombreAutor:= 'ZAYN';
miCd.genero:= 'dance pop';
miCd.nombreDisco:= 'Icarus Falls';
miCd.cantVendida:= random(2000);
write(miArchivo, miCd);
miCd.nombreDisco:= 'Mind of Mine';
miCd.cantVendida:= random(3000);
write(miArchivo, miCd);
miCd.genero:= 'pop';
miCd.nombreDisco:='Nobody is Listening';
miCd.cantVendida:= random(1000);
write(miArchivo, miCd);
miCd.codAutor:= 2;
miCd.nombreAutor:= 'Dua Lipa';
miCd.genero:= 'dance pop';
miCd.nombreDisco:= 'Dua Lipa (Complete Edition)';
miCd.cantVendida:= random(1000);
write(miArchivo, miCd);
miCd.nombreDisco:= 'Future Nostalgia';
miCd.cantVendida:= random(2000);
write(miArchivo, miCd);
miCd.codAutor:= 3;
miCd.nombreAutor:= 'The Weeknd';
miCd.genero:= 'rap';
miCd.nombreDisco:= 'After Hours';
miCd.cantVendida:= random(1500);
write(miArchivo, miCd);
end;
// --------------------- PROGRAMA PRINCIPAL -------------------------
var
miArchivo: origen;
miListado: text;
begin
assign(miListado, 'cds.txt');
assign(miArchivo, 'cds.dat');
// crear datos (no pedido)
rewrite(miArchivo);
generarCds(miArchivo);
close(miArchivo);
// abrir archivo origen
reset(miArchivo);
// crear archivo de listado
rewrite(miListado);
// listar
listar(miArchivo, miListado);
// cerrar archivos
close(miArchivo);
close(miListado);
// terminar
writeln('Fin del programa');
readln;
readln;
end.
| 22.862857 | 99 | 0.653087 |
85efc4c10a2054f494e19bef258c20f9d5d2810f | 11,521 | pas | Pascal | Source/dlgFindInFiles.pas | Cotton010/pyscripter | b1133dddaa71f7a6015a410f7fc174710872180f | [
"MIT"
]
| 1 | 2020-10-14T10:51:42.000Z | 2020-10-14T10:51:42.000Z | Source/dlgFindInFiles.pas | Cotton010/pyscripter | b1133dddaa71f7a6015a410f7fc174710872180f | [
"MIT"
]
| null | null | null | Source/dlgFindInFiles.pas | Cotton010/pyscripter | b1133dddaa71f7a6015a410f7fc174710872180f | [
"MIT"
]
| null | null | null | {-----------------------------------------------------------------------------
Unit Name: dlgFindInFiles
Author: Kiriakos Vlahos
Date: 20-May-2005
Purpose: Find in Files dialog
History: Based on code from GExperts and covered by its licence
GExperts License Agreement
GExperts is copyright 1996-2005 by GExperts, Inc, Erik Berry, and several other
authors who have submitted their code for inclusion. This license agreement only covers code written by GExperts, Inc and Erik Berry. You should contact the other authors concerning their respective copyrights and conditions.
The rules governing the use of GExperts and the GExperts source code are derived
from the official Open Source Definition, available at http://www.opensource.org.
The conditions and limitations are as follows:
* Usage of GExperts binary distributions is permitted for all developers.
You may not use the GExperts source code to develop proprietary or
commercial products including plugins or libraries for those products.
You may use the GExperts source code in an Open Source project, under the
terms listed below.
* You may not use the GExperts source code to create and distribute custom
versions of GExperts under the "GExperts" name. If you do modify and
distribute custom versions of GExperts, the binary distribution must be
named differently and clearly marked so users can tell they are not using
the official GExperts distribution. A visible and unmodified version of
this license must appear in any modified distribution of GExperts.
* Custom distributions of GExperts must include all of the custom changes
as a patch file that can be applied to the original source code. This
restriction is in place to protect the integrity of the original author's
source code. No support for modified versions of GExperts will be provided
by the original authors or on the GExperts mailing lists.
* All works derived from GExperts must be distributed under a license
compatible with this license and the official Open Source Definition,
which can be obtained from http://www.opensource.org/.
* Please note that GExperts, Inc. and the other contributing authors hereby
state that this package is provided "as is" and without any express or
implied warranties, including, but not without limitation, the implied
warranties of merchantability and fitness for a particular purpose. In
other words, we accept no liability for any damage that may result from
using GExperts or programs that use the GExperts source code.
-----------------------------------------------------------------------------}
unit dlgFindInFiles;
interface
uses
Classes, Controls, Graphics, Forms, StdCtrls,
cFindInFiles, dlgPyIDEBase, Vcl.ExtCtrls;
type
TFindInFilesDialog = class(TPyIDEDlgBase)
gbxOptions: TGroupBox;
gbxWhere: TGroupBox;
gbxDirectories: TGroupBox;
btnBrowse: TButton;
btnOK: TButton;
btnCancel: TButton;
btnHelp: TButton;
cbCaseSensitive: TCheckBox;
cbNoComments: TCheckBox;
cbWholeWord: TCheckBox;
cbRegEx: TCheckBox;
cbInclude: TCheckBox;
rbOpenFiles: TRadioButton;
rbProject: TRadioButton;
rbCurrentOnly: TRadioButton;
rbDirectories: TRadioButton;
cbMasks: TComboBox;
cbDirectory: TComboBox;
cbText: TComboBox;
lblFind: TLabel;
lblMasks: TLabel;
lblDirectory: TLabel;
Panel1: TPanel;
procedure btnBrowseClick(Sender: TObject);
procedure rbProjectClick(Sender: TObject);
procedure btnHelpClick(Sender: TObject);
procedure cbDirectoryDropDown(Sender: TObject);
procedure btnOKClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
FFindInFilesExpert: TFindInFilesExpert;
procedure EnableDirectoryControls(New: Boolean);
procedure LoadFormSettings;
procedure SaveFormSettings;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure RetrieveSettings(var Value: TGrepSettings);
property FindInFilesExpert: TFindInFilesExpert read FFindInFilesExpert;
end;
implementation
{$R *.dfm}
uses
System.UITypes, SysUtils, Windows, Messages, FileCtrl, Math,
uEditAppIntfs, frmFindResults,
Dialogs, JvGnugettext, StringResources,
cPyScripterSettings,
System.Types,
System.StrUtils, cParameters,
cPyControl;
function GetScrollbarWidth: Integer;
begin
Result := GetSystemMetrics(SM_CXVSCROLL);
end;
procedure TFindInFilesDialog.btnBrowseClick(Sender: TObject);
var
NewDir : string;
begin
NewDir := cbDirectory.Text;
if SelectDirectory(_('Directory To Search:'), '', NewDir) then
cbDirectory.Text := NewDir;
end;
procedure TFindInFilesDialog.EnableDirectoryControls(New: Boolean);
begin
cbDirectory.Enabled := New;
cbMasks.Enabled := New;
cbInclude.Enabled := New;
btnBrowse.Enabled := New;
end;
procedure TFindInFilesDialog.FormShow(Sender: TObject);
begin
PostMessage(cbMasks.Handle, CB_SETEDITSEL, 0, 0);
PostMessage(cbDirectory.Handle, CB_SETEDITSEL, 0, 0);
end;
procedure TFindInFilesDialog.rbProjectClick(Sender: TObject);
begin
EnableDirectoryControls(rbDirectories.Checked);
end;
procedure TFindInFilesDialog.btnHelpClick(Sender: TObject);
begin
Application.HelpContext(HelpContext);
end;
procedure TFindInFilesDialog.cbDirectoryDropDown(Sender: TObject);
var
i: Integer;
MaxWidth: Integer;
Bitmap: Graphics.TBitmap;
begin
MaxWidth := cbDirectory.Width;
Bitmap := Graphics.TBitmap.Create;
try
Bitmap.Canvas.Font.Assign(cbDirectory.Font);
for i := 0 to cbDirectory.Items.Count - 1 do
MaxWidth := Max(MaxWidth, Bitmap.Canvas.TextWidth(cbDirectory.Items[i]) + 10);
finally;
FreeAndNil(Bitmap);
end;
if cbDirectory.Items.Count > cbDirectory.DropDownCount then
Inc(MaxWidth, GetScrollbarWidth);
MaxWidth := Min(400, MaxWidth);
if MaxWidth > cbDirectory.Width then
SendMessage(cbDirectory.Handle, CB_SETDROPPEDWIDTH, MaxWidth, 0)
else
SendMessage(cbDirectory.Handle, CB_SETDROPPEDWIDTH, 0, 0)
end;
procedure TFindInFilesDialog.btnOKClick(Sender: TObject);
var
Dirs: TStringDynArray;
Dir, DirName : string;
begin
if rbDirectories.Checked then
begin
if Trim(cbDirectory.Text) = '' then
cbDirectory.Text := GetCurrentDir;
Dirs := SplitString(cbDirectory.Text, ';');
for Dir in Dirs do
begin
if Dir = '' then continue;
DirName := ExpandFileName(Parameters.ReplaceInText(Dir));
if not SysUtils.DirectoryExists(DirName) then begin
Dialogs.MessageDlg(Format(_(SSearchDirectoryDoesNotExist), [DirName]), mtError, [mbOK], 0);
Abort;
end;
end;
end;
ModalResult := mrOk;
end;
constructor TFindInFilesDialog.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
LoadFormSettings;
end;
destructor TFindInFilesDialog.Destroy;
begin
SaveFormSettings;
inherited Destroy;
end;
procedure TFindInFilesDialog.SaveFormSettings;
begin
AddMRUString(cbText.Text, FFindInFilesExpert.SearchList, False);
AddMRUString(cbDirectory.Text, FFindInFilesExpert.DirList, True);
AddMRUString(cbMasks.Text, FFindInFilesExpert.MaskList, False);
FFindInFilesExpert.GrepCaseSensitive := cbCaseSensitive.Checked;
FFindInFilesExpert.GrepNoComments := cbNoComments.Checked;
FFindInFilesExpert.GrepSub := cbInclude.Checked;
FFindInFilesExpert.GrepWholeWord := cbWholeWord.Checked;
FFindInFilesExpert.GrepRegEx := cbRegEx.Checked;
if rbCurrentOnly.Checked then
FFindInFilesExpert.GrepSearch := 0
else if rbOpenFiles.Checked then
FFindInFilesExpert.GrepSearch := 1
else if rbProject.Checked then
FFindInFilesExpert.GrepSearch := 2
else if rbDirectories.Checked then
FFindInFilesExpert.GrepSearch := 3;
end;
procedure TFindInFilesDialog.LoadFormSettings;
function RetrieveEditorBlockSelection: string;
var
Temp: string;
i: Integer;
begin
if Assigned(GI_ActiveEditor) then
Temp := GI_ActiveEditor.SynEdit.SelText
else
Temp := '';
// Only use the currently selected text if the length is between 1 and 80
if (Length(Trim(Temp)) >= 1) and (Length(Trim(Temp)) <= 80) then
begin
i := Min(Pos(#13, Temp), Pos(#10, Temp));
if i > 0 then
Temp := Copy(Temp, 1, i - 1);
Temp := Temp;
end else
Temp := '';
Result := Temp;
end;
procedure SetSearchPattern(Str: string);
begin
cbText.Text := Str;
cbText.SelectAll;
end;
procedure SetupPattern;
var
Selection: string;
begin
Selection := RetrieveEditorBlockSelection;
if (Trim(Selection) = '') and PyIDEOptions.SearchTextAtCaret then begin
if Assigned(GI_ActiveEditor) then with GI_ActiveEditor.SynEdit do
Selection := GetWordAtRowCol(CaretXY)
else
Selection := '';
end;
if (Selection = '') and (cbText.Items.Count > 0) then
Selection := cbText.Items[0];
SetSearchPattern(Selection);
end;
begin
FFindInFilesExpert := FindResultsWindow.FindInFilesExpert;
cbText.Items.Assign(FFindInFilesExpert.SearchList);
cbDirectory.Items.Assign(FFindInFilesExpert.DirList);
cbMasks.Items.Assign(FFindInFilesExpert.MaskList);
if PyControl.InternalPython.Loaded and
(cbDirectory.Items.IndexOf(PyControl.PythonVersion.InstallPath) < 0) then
cbDirectory.Items. Add(PyControl.PythonVersion.InstallPath);
if FFindInFilesExpert.GrepSave then
begin
cbCaseSensitive.Checked := FFindInFilesExpert.GrepCaseSensitive;
cbNoComments.Checked := FFindInFilesExpert.GrepNoComments;
cbInclude.Checked := FFindInFilesExpert.GrepSub;
cbWholeWord.Checked := FFindInFilesExpert.GrepWholeWord;
cbRegEx.Checked := FFindInFilesExpert.GrepRegEx;
case FFindInFilesExpert.GrepSearch of
0: rbCurrentOnly.Checked := True;
1: rbOpenFiles.Checked := True;
2: rbProject.Checked := True;
3: rbDirectories.Checked := True;
end;
if cbText.Items.Count > 0 then
cbText.Text := cbText.Items[0];
if cbDirectory.Items.Count > 0 then
cbDirectory.Text := cbDirectory.Items[0];
if cbMasks.Items.Count > 0 then
cbMasks.Text := cbMasks.Items[0];
end;
SetupPattern;
rbOpenFiles.Enabled := GI_EditorFactory.Count > 0;
rbCurrentOnly.Enabled := GI_EditorFactory.Count > 0;
EnableDirectoryControls(rbDirectories.Checked);
end;
procedure TFindInFilesDialog.RetrieveSettings(var Value: TGrepSettings);
begin
Value.NoComments := cbNoComments.Checked;
Value.CaseSensitive := cbCaseSensitive.Checked;
Value.WholeWord := cbWholeWord.Checked;
Value.RegEx := cbRegEx.Checked;
Value.Pattern := cbText.Text;
Value.IncludeSubdirs := cbInclude.Checked;
Value.Mask := '';
Value.Directories := '';
if rbCurrentOnly.Checked then
Value.FindInFilesAction := gaCurrentOnlyGrep
else if rbOpenFiles.Checked then
Value.FindInFilesAction := gaOpenFilesGrep
else if rbProject.Checked then
Value.FindInFilesAction := gaProjectGrep
else
begin
Value.FindInFilesAction := gaDirGrep;
Value.Mask := cbMasks.Text;
Value.Directories := cbDirectory.Text;
end;
end;
end.
| 33.885294 | 226 | 0.711397 |
f1a42e4fbf7963a82175de4d77521f6f43eb36fc | 5,072 | pas | Pascal | Source/TextEditor.Glyph.pas | edwinyzh/TTextEditor | d1844c5ff10fe302457b8d58348c7dbd015703e7 | [
"MIT"
]
| 74 | 2021-06-14T12:58:47.000Z | 2022-03-15T13:36:42.000Z | Source/TextEditor.Glyph.pas | edwinyzh/TTextEditor | d1844c5ff10fe302457b8d58348c7dbd015703e7 | [
"MIT"
]
| null | null | null | Source/TextEditor.Glyph.pas | edwinyzh/TTextEditor | d1844c5ff10fe302457b8d58348c7dbd015703e7 | [
"MIT"
]
| 20 | 2021-06-13T15:17:23.000Z | 2022-03-26T03:30:59.000Z | unit TextEditor.Glyph;
interface
uses
System.Classes, System.UITypes, Vcl.Graphics;
type
TTextEditorGlyph = class(TPersistent)
strict private
FBitmap: TBitmap;
FInternalGlyph: TBitmap;
FInternalMaskColor: TColor;
FLeft: Integer;
FMaskColor: TColor;
FOnChange: TNotifyEvent;
FVisible: Boolean;
function GetHeight: Integer;
function GetWidth: Integer;
procedure SetBitmap(const AValue: TBitmap);
procedure SetLeft(const AValue: Integer);
procedure SetMaskColor(const AValue: TColor);
procedure SetVisible(const AValue: Boolean);
public
constructor Create(const AModule: THandle = 0; const AName: string = ''; const AMaskColor: TColor = TColors.Fuchsia);
destructor Destroy; override;
procedure Assign(ASource: TPersistent); override;
procedure ChangeScale(const AMultiplier, ADivider: Integer);
procedure Draw(const ACanvas: TCanvas; const X, Y: Integer; const ALineHeight: Integer = 0);
property Bitmap: TBitmap read FBitmap write SetBitmap;
property Height: Integer read GetHeight;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property Width: Integer read GetWidth;
published
property Left: Integer read FLeft write SetLeft default 2;
property MaskColor: TColor read FMaskColor write SetMaskColor default TColors.SysNone;
property Visible: Boolean read FVisible write SetVisible default True;
end;
implementation
uses
Winapi.Windows, System.SysUtils, TextEditor.Utils;
constructor TTextEditorGlyph.Create(const AModule: THandle = 0; const AName: string = ''; const AMaskColor: TColor = TColors.Fuchsia);
begin
inherited Create;
if AName <> '' then
begin
FInternalGlyph := Vcl.Graphics.TBitmap.Create;
FInternalGlyph.Handle := LoadBitmap(AModule, PChar(AName));
FInternalMaskColor := AMaskColor;
end
else
FInternalMaskColor := TColors.SysNone;
FVisible := True;
FBitmap := Vcl.Graphics.TBitmap.Create;
FMaskColor := TColors.SysNone;
FLeft := 2;
end;
destructor TTextEditorGlyph.Destroy;
begin
if Assigned(FInternalGlyph) then
begin
FInternalGlyph.Free;
FInternalGlyph := nil;
end;
FBitmap.Free;
inherited Destroy;
end;
procedure TTextEditorGlyph.ChangeScale(const AMultiplier, ADivider: Integer);
var
LNumerator: Integer;
begin
LNumerator := (AMultiplier div ADivider) * ADivider;
if Assigned(FInternalGlyph) then
ResizeBitmap(FInternalGlyph, MulDiv(FInternalGlyph.Width, LNumerator, ADivider), MulDiv(FInternalGlyph.Height, LNumerator, ADivider));
ResizeBitmap(FBitmap, MulDiv(FBitmap.Width, LNumerator, ADivider), MulDiv(FBitmap.Height, LNumerator, ADivider));
end;
procedure TTextEditorGlyph.Assign(ASource: TPersistent);
begin
if Assigned(ASource) and (ASource is TTextEditorGlyph) then
with ASource as TTextEditorGlyph do
begin
if Assigned(FInternalGlyph) then
Self.FInternalGlyph.Assign(FInternalGlyph);
Self.FInternalMaskColor := FInternalMaskColor;
Self.FVisible := FVisible;
Self.FBitmap.Assign(FBitmap);
Self.FMaskColor := FMaskColor;
Self.FLeft := FLeft;
if Assigned(Self.FOnChange) then
Self.FOnChange(Self);
end
else
inherited Assign(ASource);
end;
procedure TTextEditorGlyph.Draw(const ACanvas: TCanvas; const X, Y: Integer; const ALineHeight: Integer = 0);
var
LGlyphBitmap: Vcl.Graphics.TBitmap;
LMaskColor: TColor;
LY: Integer;
begin
if not FBitmap.Empty then
begin
LGlyphBitmap := FBitmap;
LMaskColor := FMaskColor;
end
else
if Assigned(FInternalGlyph) then
begin
LGlyphBitmap := FInternalGlyph;
LMaskColor := FInternalMaskColor;
end
else
Exit;
LY := Y;
if ALineHeight <> 0 then
Inc(LY, Abs(LGlyphBitmap.Height - ALineHeight) div 2);
LGlyphBitmap.Transparent := True;
LGlyphBitmap.TransparentMode := tmFixed;
LGlyphBitmap.TransparentColor := LMaskColor;
ACanvas.Draw(X, LY, LGlyphBitmap);
end;
procedure TTextEditorGlyph.SetBitmap(const AValue: Vcl.Graphics.TBitmap);
begin
FBitmap.Assign(AValue);
end;
procedure TTextEditorGlyph.SetMaskColor(const AValue: TColor);
begin
if FMaskColor <> AValue then
begin
FMaskColor := AValue;
if Assigned(FOnChange) then
FOnChange(Self);
end;
end;
procedure TTextEditorGlyph.SetVisible(const AValue: Boolean);
begin
if FVisible <> AValue then
begin
FVisible := AValue;
if Assigned(FOnChange) then
FOnChange(Self);
end;
end;
procedure TTextEditorGlyph.SetLeft(const AValue: Integer);
begin
if FLeft <> AValue then
begin
FLeft := AValue;
if Assigned(FOnChange) then
FOnChange(Self);
end;
end;
function TTextEditorGlyph.GetWidth: Integer;
begin
if not FBitmap.Empty then
Result := FBitmap.Width
else
if Assigned(FInternalGlyph) then
Result := FInternalGlyph.Width
else
Result := 0;
end;
function TTextEditorGlyph.GetHeight: Integer;
begin
if not FBitmap.Empty then
Result := FBitmap.Height
else
if Assigned(FInternalGlyph) then
Result := FInternalGlyph.Height
else
Result := 0;
end;
end.
| 26.279793 | 138 | 0.737382 |
f1d8f3cad85a280124b822d674eb2f133e4fe64d | 2,930 | pas | Pascal | AiD_Scanner/AiD DataBase Creator/uMain.pas | delphi-pascal-archive/aid-scanner | 94bb449c7dff5630164e7b2cbd58a74de2b66177 | [
"Unlicense"
]
| null | null | null | AiD_Scanner/AiD DataBase Creator/uMain.pas | delphi-pascal-archive/aid-scanner | 94bb449c7dff5630164e7b2cbd58a74de2b66177 | [
"Unlicense"
]
| null | null | null | AiD_Scanner/AiD DataBase Creator/uMain.pas | delphi-pascal-archive/aid-scanner | 94bb449c7dff5630164e7b2cbd58a74de2b66177 | [
"Unlicense"
]
| null | null | null | unit uMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, Buttons, XPMan, avDataBase;
type
TMainForm = class(TForm)
TopPanel: TPanel;
LogoImage: TImage;
BackImage: TImage;
NameLabel1: TLabel;
NameLabel2: TLabel;
NameLabel3: TLabel;
CopyRightLabel: TLabel;
VersionLabel: TLabel;
Bevel: TBevel;
DBListView: TListView;
Panel1: TPanel;
Bevel1: TBevel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Bevel2: TBevel;
Bevel3: TBevel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
SpeedButton1: TSpeedButton;
XPManifest1: TXPManifest;
procedure BitBtn1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
uses uAddRec;
{$R *.dfm}
procedure AddRecToList(Rec: TDataRecord);
begin
with MainForm.DBListView.Items.Add, Rec do
begin
if rec.SignType = 0 then Caption := 'MD5';
if rec.SignType = 1 then Caption := 'HEX';
if rec.SignType = 2 then Caption := 'HEX2';
SubItems.Add(VirName);
SubItems.Add(Signature);
end;
end;
procedure OpenDBFile(const sFileName: String;var DBFile: TDBFile);
var
DBRec: TDataRecord;
begin
AssignFile(DBFile, sFileName);
Reset(DBFile);
while not EOF(DBFile) do
begin
Read(DBFile, DBRec);
AddRecToList(DBRec);
end;
end;
procedure TMainForm.BitBtn1Click(Sender: TObject);
begin
AddForm.showmodal;
end;
procedure TMainForm.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TMainForm.BitBtn2Click(Sender: TObject);
begin
DBListView.DeleteSelected;
end;
procedure TMainForm.Button2Click(Sender: TObject);
begin
if OpenDialog1.Execute then begin
OpenDBFile(OpenDialog1.FileName,DBFile);
end;
end;
procedure TMainForm.Button3Click(Sender: TObject);
var
i: integer;
Rec: TDataRecord;
begin
if SaveDialog1.Execute then begin
CreateDBFile(SaveDialog1.FileName,DBFile);
for i := 0 to DBListView.Items.Count-1 do begin
//
Rec.VirName := DBListView.Items.Item[i].SubItems[0];
Rec.Signature := DBListView.Items.Item[i].SubItems[1];
if DBListView.Items.Item[i].Caption = 'MD5' then
Rec.SignType := 0;
if DBListView.Items.Item[i].Caption = 'HEX' then
Rec.SignType := 1;
AddRecToDBFile(DBFile,Rec);
end;
end;
end;
procedure TMainForm.SpeedButton1Click(Sender: TObject);
begin
DBListView.Clear;
end;
end.
| 22.538462 | 77 | 0.680546 |
474d0b6063c1ed5c445b16a4d03f3037ce38202a | 3,204 | dfm | Pascal | Catalogos/PersonasDocumentosDM.dfm | alexismzt/SOFOM | 57ca73e9f7fbb51521149ea7c0fdc409c22cc6f7 | [
"Apache-2.0"
]
| null | null | null | Catalogos/PersonasDocumentosDM.dfm | alexismzt/SOFOM | 57ca73e9f7fbb51521149ea7c0fdc409c22cc6f7 | [
"Apache-2.0"
]
| 51 | 2018-07-25T15:39:25.000Z | 2021-04-21T17:40:57.000Z | Catalogos/PersonasDocumentosDM.dfm | alexismzt/SOFOM | 57ca73e9f7fbb51521149ea7c0fdc409c22cc6f7 | [
"Apache-2.0"
]
| 1 | 2021-02-23T17:27:06.000Z | 2021-02-23T17:27:06.000Z | inherited dmPersonasDocumentos: TdmPersonasDocumentos
OldCreateOrder = True
Height = 343
inherited adodsMaster: TADODataSet
CursorType = ctStatic
CommandText =
'SELECT IdPersonaDocumento, IdPersona, IdDocumento, IdPersonaDocu' +
'mentoTipo, Descripcion, FechaEmision, VigenciaMeses FROM Persona' +
'sDocumentos WHERE IdPersona = :IdPersona'
Parameters = <
item
Name = 'IdPersona'
Attributes = [paSigned]
DataType = ftInteger
Precision = 10
Size = 4
Value = Null
end>
Left = 32
Top = 24
object adodsMasterIdPersonaDocumento: TAutoIncField
FieldName = 'IdPersonaDocumento'
ReadOnly = True
Visible = False
end
object adodsMasterIdPersona: TIntegerField
FieldName = 'IdPersona'
Visible = False
end
object adodsMasterIdDocumento: TIntegerField
FieldName = 'IdDocumento'
Visible = False
end
object adodsMasterIdPersonaDocumentoTipo: TIntegerField
FieldName = 'IdPersonaDocumentoTipo'
Visible = False
end
object adodsMasterDocumento: TStringField
FieldKind = fkLookup
FieldName = 'Documento'
LookupDataSet = adodsDocumento
LookupKeyFields = 'IdDocumento'
LookupResultField = 'Descripcion'
KeyFields = 'IdDocumento'
Size = 200
Lookup = True
end
object adodsMasterTipo: TStringField
FieldKind = fkLookup
FieldName = 'Tipo'
LookupDataSet = adodsTipo
LookupKeyFields = 'IdPersonaDocumentoTipo'
LookupResultField = 'Descripcion'
KeyFields = 'IdPersonaDocumentoTipo'
Size = 50
Lookup = True
end
object adodsMasterDescripcion: TStringField
DisplayLabel = 'Descripci'#243'n'
FieldName = 'Descripcion'
Size = 50
end
object adodsMasterFechaEmision: TDateTimeField
DisplayLabel = 'Fecha de emisi'#243'n'
FieldName = 'FechaEmision'
end
object adodsMasterVigenciaMeses: TIntegerField
DisplayLabel = 'Vigencia (Meses)'
FieldName = 'VigenciaMeses'
end
end
inherited ActionList: TActionList
object actNuevoDocumento: TAction
Caption = 'actNuevoDocumento'
OnExecute = actNuevoDocumentoExecute
end
object actEditaDocumento: TAction
Caption = 'actEditaDocumento'
OnExecute = actEditaDocumentoExecute
end
object actUpdateFile: TAction
Caption = '...'
Hint = 'Asigna archivo'
OnExecute = actUpdateFileExecute
end
end
object adodsDocumento: TADODataSet
Connection = _dmConection.ADOConnection
CursorType = ctStatic
CommandText = 'SELECT IdDocumento, Descripcion FROM Documentos'
IndexFieldNames = 'IdDocumento'
MasterFields = 'IdDocumento'
Parameters = <>
Left = 40
Top = 96
end
object adodsTipo: TADODataSet
Connection = _dmConection.ADOConnection
CursorType = ctStatic
CommandText =
'select IdPersonaDocumentoTipo, Descripcion from PersonasDocument' +
'osTipos'
Parameters = <>
Left = 40
Top = 160
end
end
| 29.666667 | 75 | 0.655743 |
fc0816e138c51ef5bbdbc27ce389fb97f6878e42 | 12,157 | dfm | Pascal | mobaxterm/UnitManagePasswords.dfm | tangjie1992/MobaXterm | 1f1a5e3d3004934536bce4d87e648ea659488bd6 | [
"Apache-2.0"
]
| 1 | 2021-04-03T00:00:39.000Z | 2021-04-03T00:00:39.000Z | mobaxterm/UnitManagePasswords.dfm | tangjie1992/MobaXterm | 1f1a5e3d3004934536bce4d87e648ea659488bd6 | [
"Apache-2.0"
]
| null | null | null | mobaxterm/UnitManagePasswords.dfm | tangjie1992/MobaXterm | 1f1a5e3d3004934536bce4d87e648ea659488bd6 | [
"Apache-2.0"
]
| null | null | null | object FormManagePasswords: TFormManagePasswords
Left = 324
Top = 179
BorderStyle = bsDialog
Caption = 'MobaXterm passwords settings'
ClientHeight = 504
ClientWidth = 780
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
Scaled = False
ScreenSnap = True
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 14
object sSpeedButton1: TsSpeedButton
Left = 673
Top = 0
Width = 107
Height = 504
Enabled = False
Flat = True
Align = alRight
SkinData.SkinSection = 'TOOLBUTTON'
DisabledGlyphKind = []
DisabledKind = []
ImageIndex = 13
Images = Form1.Im64
Reflected = True
ShowCaption = False
DrawOverBorder = False
end
object sBitBtn1: TsBitBtn
Left = 312
Top = 450
Width = 86
Height = 31
Caption = 'OK'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 6
OnClick = sBitBtn1Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 235
Images = Form1.Im16
end
object sBitBtn3: TsBitBtn
Left = 159
Top = 262
Width = 130
Height = 28
Caption = 'Delete selected'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 2
OnClick = sBitBtn3Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 318
Images = Form1.Im16
end
object sBitBtn4: TsBitBtn
Left = 296
Top = 262
Width = 97
Height = 28
Caption = 'Delete all'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 3
OnClick = sBitBtn4Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 278
Images = Form1.Im16
end
object sPanel1: TsPanel
Left = 16
Top = 16
Width = 641
Height = 41
TabOrder = 0
SkinData.SkinSection = 'PANEL'
object sLabel9: TsLabel
Left = 12
Top = 13
Width = 147
Height = 14
Caption = 'Save sessions passwords'
ParentFont = False
Font.Charset = DEFAULT_CHARSET
Font.Color = 3091497
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
end
object sRadioButton1: TsRadioButton
Left = 176
Top = 11
Width = 58
Height = 20
Caption = 'Always'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
SkinData.SkinSection = 'RADIOBUTTON'
end
object sRadioButton2: TsRadioButton
Left = 250
Top = 11
Width = 49
Height = 20
Caption = 'Never'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
SkinData.SkinSection = 'RADIOBUTTON'
end
object sRadioButton3: TsRadioButton
Left = 318
Top = 11
Width = 39
Height = 20
Caption = 'Ask'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 2
TabStop = True
SkinData.SkinSection = 'RADIOBUTTON'
end
object sCheckBox3: TsCheckBox
Left = 421
Top = 10
Width = 200
Height = 20
Caption = 'Save SSH keys passphrases as well'
ParentShowHint = False
ShowHint = True
TabOrder = 3
SkinData.SkinSection = 'CHECKBOX'
ImgChecked = 0
ImgUnchecked = 0
end
end
object sPanel2: TsPanel
Left = 88
Top = 312
Width = 497
Height = 41
TabOrder = 5
SkinData.SkinSection = 'PANEL'
object sLabel1: TsLabel
Left = 12
Top = 14
Width = 191
Height = 14
Caption = 'Choose where to save passwords'
ParentFont = False
Font.Charset = DEFAULT_CHARSET
Font.Color = 3091497
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
end
object sRadioButton4: TsRadioButton
Left = 248
Top = 11
Width = 83
Height = 20
Caption = 'User registry'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
TabStop = True
OnClick = sRadioButton4Click
SkinData.SkinSection = 'RADIOBUTTON'
end
object sRadioButton5: TsRadioButton
Left = 360
Top = 11
Width = 101
Height = 20
Caption = 'Configuration file'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
OnClick = sRadioButton4Click
SkinData.SkinSection = 'RADIOBUTTON'
end
end
object sBitBtn2: TsBitBtn
Left = 16
Top = 262
Width = 137
Height = 28
Caption = 'Show passwords'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
OnClick = sBitBtn2Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 331
Images = Form1.Im16
end
object sBitBtn5: TsBitBtn
Left = 400
Top = 262
Width = 113
Height = 28
Caption = 'Export to file'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 4
OnClick = sBitBtn5Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 314
Images = Form1.Im16
end
object sBitBtn6: TsBitBtn
Left = 136
Top = 381
Width = 417
Height = 36
Hint =
'MobaXterm can save passwords that you use to access online serve' +
'rs. If you share a computer with anyone, it is recommended that ' +
'you use a master password. By setting a Master Password, anyone ' +
'using your profile will be prompted to enter the master password' +
' when access to your stored passwords is needed.'#13#10#13#10'Note: After ' +
'you'#39've set a master password, it needs to be entered at MobaXter' +
'm startup.'
Caption = 'Set a "Master Password" for strong passwords encryption'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 7
OnClick = sBitBtn6Click
SkinData.SkinSection = 'BUTTON'
ImageIndex = 330
Images = Form1.Im22
end
object PC1: TsPageControl
Left = 16
Top = 72
Width = 641
Height = 185
ActivePage = TabCredentials
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Arial'
Font.Style = []
Images = Form1.Im16
ParentFont = False
TabHeight = 36
TabOrder = 8
TabStop = False
OnChange = PC1Change
SkinData.SkinSection = 'PAGECONTROL'
TabPadding = 8
object TabPasswords: TsTabSheet
Tag = 1
Caption = 'Passwords'
ImageIndex = 29
SkinData.CustomColor = False
SkinData.CustomFont = False
object ListView1: TListView
Left = 0
Top = 0
Width = 633
Height = 139
Align = alClient
Columns = <
item
Caption = 'Protocol'
MaxWidth = 120
MinWidth = 60
Width = 68
end
item
Alignment = taCenter
Caption = 'Username'
MaxWidth = 360
MinWidth = 36
Width = 190
end
item
Alignment = taCenter
Caption = 'Servername'
MaxWidth = 360
MinWidth = 36
Width = 180
end
item
Alignment = taCenter
Caption = 'Password'
MaxWidth = 360
Width = 170
end>
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
HideSelection = False
MultiSelect = True
ReadOnly = True
RowSelect = True
ParentFont = False
SmallImages = Form1.Im16
SortType = stBoth
TabOrder = 0
ViewStyle = vsReport
OnSelectItem = ListView1SelectItem
end
end
object TabCredentials: TsTabSheet
Tag = 1
Caption = 'Credentials'
ImageIndex = 55
SkinData.CustomColor = False
SkinData.CustomFont = False
object ListView2: TListView
Left = 0
Top = 0
Width = 633
Height = 139
Align = alClient
Columns = <
item
Caption = 'Name'
MaxWidth = 360
MinWidth = 60
Width = 168
end
item
Alignment = taCenter
Caption = 'Username'
MaxWidth = 360
MinWidth = 36
Width = 230
end
item
Alignment = taCenter
Caption = 'Password'
MaxWidth = 360
Width = 210
end>
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
HideSelection = False
ReadOnly = True
RowSelect = True
ParentFont = False
SmallImages = Form1.Im16
SortType = stBoth
TabOrder = 0
ViewStyle = vsReport
OnSelectItem = ListView2SelectItem
end
end
end
object sBitBtn7: TsBitBtn
Left = 591
Top = 262
Width = 66
Height = 28
Caption = 'Edit'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 9
OnClick = sBitBtn7Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 327
Images = Form1.Im16
end
object sBitBtn8: TsBitBtn
Left = 519
Top = 262
Width = 66
Height = 28
Caption = 'New'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 10
OnClick = sBitBtn8Click
Spacing = 6
SkinData.SkinSection = 'BUTTON'
ImageIndex = 20
Images = Form1.Im16
end
object sSkinProvider1: TsSkinProvider
AddedTitle.Font.Charset = DEFAULT_CHARSET
AddedTitle.Font.Color = clNone
AddedTitle.Font.Height = -11
AddedTitle.Font.Name = 'Arial'
AddedTitle.Font.Style = []
SkinData.SkinSection = 'FORM'
MenuLineSkin = 'BARTITLE'
ScreenSnap = True
SnapBuffer = 16
ShowAppIcon = False
TitleButtons = <>
Left = 872
Top = 24
end
object sSaveDialog1: TsSaveDialog
DefaultExt = '.txt'
FileName = 'MobaXterm Stored Passwords.txt'
Filter = 'Text file|*.txt'
Left = 712
Top = 336
end
end
| 25.117769 | 85 | 0.561076 |
47e2a74c0b253eb2ddaea31d638bb07cd2c57c83 | 2,428 | pas | Pascal | library/r5/tests/FHIR.R5.Tests.Context.pas | 17-years-old/fhirserver | 9575a7358868619311a5d1169edde3ffe261e558 | [
"BSD-3-Clause"
]
| null | null | null | library/r5/tests/FHIR.R5.Tests.Context.pas | 17-years-old/fhirserver | 9575a7358868619311a5d1169edde3ffe261e558 | [
"BSD-3-Clause"
]
| null | null | null | library/r5/tests/FHIR.R5.Tests.Context.pas | 17-years-old/fhirserver | 9575a7358868619311a5d1169edde3ffe261e558 | [
"BSD-3-Clause"
]
| null | null | null | unit FHIR.R5.Tests.Context;
{
Copyright (c) 2011+, HL7 and Health Intersections Pty Ltd (http://www.healthintersections.com.au)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
}
interface
uses
SysUtils, Classes,
FHIR.Support.Utilities,
FHIR.Base.Objects, FHIR.Version.Parser,
FHIR.R5.Types, FHIR.R5.Resources, FHIR.R5.Constants, FHIR.R5.Context, FHIR.R5.PathEngine, FHIR.R5.Tests.Worker,
DUnitX.TestFramework;
Type
[TextFixture]
TFhirHTTPMetadataResourceManagerTests = class (TObject)
private
public
[SetupFixture] procedure setup;
[TearDownFixture] procedure teardown;
[Fixture] procedure testSingleNoVersion;
end;
implementation
{ TFhirHTTPMetadataResourceManagerTests }
procedure TFhirHTTPMetadataResourceManagerTests.setup;
begin
end;
procedure TFhirHTTPMetadataResourceManagerTests.teardown;
begin
end;
procedure TFhirHTTPMetadataResourceManagerTests.testSingleNoVersion;
begin
end;
initialization
TDUnitX.RegisterTestFixture(TFhirHTTPMetadataResourceManagerTests);
end.
| 32.373333 | 113 | 0.803542 |
f165c5e41b6291aad5e34b6a98848f983e3264f3 | 316 | pas | Pascal | Test/OverloadsPass/overload_class_method.pas | synapsea/DW-Script | b36c2e57f0285c217f8f0cae8e4e158d21127163 | [
"Condor-1.1"
]
| 1 | 2022-02-18T22:14:44.000Z | 2022-02-18T22:14:44.000Z | Test/OverloadsPass/overload_class_method.pas | synapsea/DW-Script | b36c2e57f0285c217f8f0cae8e4e158d21127163 | [
"Condor-1.1"
]
| null | null | null | Test/OverloadsPass/overload_class_method.pas | synapsea/DW-Script | b36c2e57f0285c217f8f0cae8e4e158d21127163 | [
"Condor-1.1"
]
| null | null | null | type tobj = class
function classname(a : Integer) : String; overload;
begin
Result:=IntToStr(a);
end;
class function classname(s : String) : String; overload;
begin
Result:=s+ClassName;
end;
end;
var o := TObj.Create;
println(o.classname);
println(o.classname(123));
println(o.classname('hello ')); | 16.631579 | 57 | 0.689873 |
83c8c25f85dd7b3542ca91bcbe6006d0f83a5243 | 3,596 | pas | Pascal | Components/ehlib/DEMOS/DEMO1/Unit2.pas | sabatex/Delphi | 0efbe6eb38bf8aa2bf269d1866741266e90b9cbf | [
"MIT"
]
| null | null | null | Components/ehlib/DEMOS/DEMO1/Unit2.pas | sabatex/Delphi | 0efbe6eb38bf8aa2bf269d1866741266e90b9cbf | [
"MIT"
]
| null | null | null | Components/ehlib/DEMOS/DEMO1/Unit2.pas | sabatex/Delphi | 0efbe6eb38bf8aa2bf269d1866741266e90b9cbf | [
"MIT"
]
| 1 | 2019-12-24T08:39:18.000Z | 2019-12-24T08:39:18.000Z | unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
{$IFDEF VER140} Variants, {$ENDIF}
{$IFDEF CIL}
Types, System.ComponentModel, Variants,
{$ELSE}
{$ENDIF}
Grids, DBGridEh, Buttons, Db, DBTables, ExtCtrls, ComCtrls;
type
TForm2 = class(TForm)
DataSource1: TDataSource;
Table1: TTable;
Panel2: TPanel;
DBGridEh1: TDBGridEh;
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure DBGridEh1DblClick(Sender: TObject);
procedure DBGridEh1ColWidthsChanged(Sender: TObject);
procedure FormShow(Sender: TObject);
private
procedure OnActivate(var msg: TWMActivate); message WM_ACTIVATE;
{ Private declarations }
public
function Execute(HostControl: TControl; var VendorNo: String; var VendorName: String):Boolean;
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
{ TForm2 }
procedure AdjustDropDownForm(AControl : TControl; HostControl: TControl);
var
WorkArea: TRect;
HostP, PDelpta: TPoint;
begin
{$IFDEF CIL}
SystemParametersInfo(SPI_GETWORKAREA,0,WorkArea,0);
{$ELSE}
SystemParametersInfo(SPI_GETWORKAREA,0,@WorkArea,0);
{$ENDIF}
HostP := HostControl.ClientToScreen(Point(0,0));
PDelpta := AControl.ClientToScreen(Point(0,0));
AControl.Left := HostP.x;
AControl.Top := HostP.y + HostControl.Height + 1;
if (AControl.Width > WorkArea.Right - WorkArea.Left) then
AControl.Width := WorkArea.Right - WorkArea.Left;
if (AControl.Left + AControl.Width > WorkArea.Right) then
AControl.Left := WorkArea.Right - AControl.Width;
if (AControl.Left < WorkArea.Left) then
AControl.Left := WorkArea.Left;
if (AControl.Top + AControl.Height > WorkArea.Bottom) then
begin
if (HostP.y - WorkArea.Top > WorkArea.Bottom - HostP.y - HostControl.Height) then
AControl.Top := HostP.y - AControl.Height;
end;
if (AControl.Top < WorkArea.Top) then
begin
AControl.Height := AControl.Height - (WorkArea.Top - AControl.Top);
AControl.Top := WorkArea.Top;
end;
if (AControl.Top + AControl.Height > WorkArea.Bottom) then
begin
AControl.Height := WorkArea.Bottom - AControl.Top;
end;
end;
function TForm2.Execute(HostControl: TControl; var VendorNo: String; var VendorName: String):Boolean;
var
VNo: Variant;
begin
VNo := VendorNo;
if VendorNo <> '' then
Table1.Locate('VendorNo',VNo,[]);
AdjustDropDownForm(Self,HostControl);
Visible := True;
ModalResult := mrCancel;
while (Visible) do Application.ProcessMessages;
Result := False;
if ModalResult = mrOk then
begin
VendorNo := Table1.FieldByName('VendorNo').AsString;
VendorName := Table1.FieldByName('VendorName').AsString;
Result := True;
end;
end;
procedure TForm2.SpeedButton1Click(Sender: TObject);
begin
ModalResult := mrOk;
Close;
end;
procedure TForm2.SpeedButton2Click(Sender: TObject);
begin
Close;
end;
procedure TForm2.DBGridEh1DblClick(Sender: TObject);
begin
SpeedButton1Click(Sender);
end;
procedure TForm2.OnActivate(var msg: TWMActivate);
begin
inherited;
if (msg.Active=WA_INACTIVE) then
Close;
end;
procedure TForm2.DBGridEh1ColWidthsChanged(Sender: TObject);
begin
ClientWidth := DBGridEh1.Columns[0].Width + DBGridEh1.Columns[1].Width +
(DBGridEh1.Width-DBGridEh1.ClientWidth) + Panel1.Width + 3;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
DBGridEh1ColWidthsChanged(Sender);
end;
end.
| 24.8 | 101 | 0.71941 |
478c053e650d723a9086eb0d36e9f6e03a4e3862 | 1,763 | pas | Pascal | Forms/Concepts.System.PublishedFields.Form.pas | juliomar/Concepts | ef75301c6cc10c4cf7806432a970b87bf88937e2 | [
"Apache-2.0"
]
| null | null | null | Forms/Concepts.System.PublishedFields.Form.pas | juliomar/Concepts | ef75301c6cc10c4cf7806432a970b87bf88937e2 | [
"Apache-2.0"
]
| null | null | null | Forms/Concepts.System.PublishedFields.Form.pas | juliomar/Concepts | ef75301c6cc10c4cf7806432a970b87bf88937e2 | [
"Apache-2.0"
]
| 1 | 2021-03-16T16:06:57.000Z | 2021-03-16T16:06:57.000Z | {
Copyright (C) 2013-2020 Tim Sinaeve tim.sinaeve@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
}
unit Concepts.System.PublishedFields.Form;
{ Designtime controls with no (automatically created) published field references
to them. }
interface
uses
Winapi.Windows, Winapi.Messages,
System.SysUtils, System.Variants, System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
{ When you add components to a form at designtime, Delphi automatically adds
published fields to the (implicit) published section of the class. These
fields are automatically assigned to the corresponding components when they
are streamed out from the DFM.
The streaming system uses the classname from the RTTI generated for the
published fields to create the components of the right class.
It is possible to get rid of these published fields if you just register the
corresponding classes. This is all that is needed to create the components
on your form at runtime. }
type
TfrmPublishedFields = class(TForm)
public
class constructor Create;
end;
implementation
{$R *.dfm}
class constructor TfrmPublishedFields.Create;
begin
RegisterClasses([TLabel, TButton, TEdit, TPanel]);
end;
end.
| 31.482143 | 81 | 0.768009 |
850c3c2832f16e79d0edb78e1373f34bcb3c051f | 462 | pas | Pascal | Sources/Interfaces/ITest.pas | remobjects/RemObjects.Elements.EUnit | 3aedbd0a453a3464f518ffe819341cc369607d48 | [
"BSD-2-Clause"
]
| null | null | null | Sources/Interfaces/ITest.pas | remobjects/RemObjects.Elements.EUnit | 3aedbd0a453a3464f518ffe819341cc369607d48 | [
"BSD-2-Clause"
]
| null | null | null | Sources/Interfaces/ITest.pas | remobjects/RemObjects.Elements.EUnit | 3aedbd0a453a3464f518ffe819341cc369607d48 | [
"BSD-2-Clause"
]
| null | null | null | namespace RemObjects.Elements.EUnit;
interface
uses
RemObjects.Elements.EUnit.Reflections;
type
ITest = public interface
property Id: String read;
property Name: String read;
property DisplayName: String read write;
property Kind: TestKind read;
property &Skip: Boolean read write;
property &Type: NativeType read;
property &Method: NativeMethod read;
property Children: sequence of ITest read;
end;
implementation
end. | 22 | 46 | 0.74026 |
47ff829a7779760b79fb7ee9943abd08cf25f74f | 13,591 | pas | Pascal | FTLGame_Cheat.pas | axpokl/FTLGame_Cheat | dc8dcfd22c2914d98c2ab7614cb85327a18e4dc6 | [
"MIT"
]
| null | null | null | FTLGame_Cheat.pas | axpokl/FTLGame_Cheat | dc8dcfd22c2914d98c2ab7614cb85327a18e4dc6 | [
"MIT"
]
| null | null | null | FTLGame_Cheat.pas | axpokl/FTLGame_Cheat | dc8dcfd22c2914d98c2ab7614cb85327a18e4dc6 | [
"MIT"
]
| null | null | null | //{$Apptype GUI}
{$R FTLGame_Cheat.res}
program FTLGame_Cheat;
uses JwaPsApi,windows,display;
var phnd:HANDLE;
var flthw:hwnd;
function EnumWindowsProc(hw:HWND;lp:LParam):LongBool;StdCall;
const fltclass='SILWindowClass';
var position:byte;
fltname:pchar;
begin
GetMem(fltname,256);
GetClassName(hw,fltname,256);
position:=pos(fltclass,fltname);
if position>0 then flthw:=hw;
//if position>0 then writeln(hw,#9,fltname);
EnumWindowsProc:=true;
end;
procedure getwin2();
begin
repeat
flthw:=0;
EnumWindows(@EnumWindowsProc,0);
sleep(1);
until (flthw>0) or not(IsWin());
//writeln(flthw);
end;
procedure getwin();
const fltclass='SILWindowClass';
var position:byte;
fltname:pchar;
begin
repeat
flthw:=GetForegroundWindow();
GetMem(fltname,256);
GetClassName(flthw,fltname,256);
position:=pos(fltclass,fltname);
sleep(1);
until (position>0) or not(IsWin());
//writeln(flthw);
end;
procedure getphnd();
var pid:DWORD=0;
begin
GetWindowThreadProcessId(flthw,@pid);
phnd:=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
if getlasterror=5 then
begin
msgbox('Access Denied while attaching FLTGame.exe, Please run FTLGame_Cheat.exe as Administrator');
halt;
end;
//writeln(phnd);
end;
//const maxbuf=$100;
//var buf:array[0..maxbuf]of char;
var hmods:array[0..$1000]of longword;
var cb:longword;
//var cbi:longword;
//var modinfo:TMODULEINFO;
function getbaseaddr():longword;
begin
{
GetProcessImageFileName(phnd,buf,length(buf));
writeln(buf);
EnumProcessModules(phnd,hmods,sizeof(hmods),cb);
for cbi:=0 to cb div 4 do
begin
write(cbi,#9);
write(i2hs(hmods[cbi]),#9);
GetModuleInformation(phnd,hmods[cbi],modinfo,sizeof(modinfo));
write(i2hs(longword(modinfo.lpBaseOfDll)),#9);
write(i2hs(longword(modinfo.sizeofimage)),#9);
write(i2hs(longword(modinfo.entrypoint)),#9);
GetModuleFileNameEx(phnd,hmods[cbi],buf,length(buf));
write(buf,#9);
writeln();
end;
}
{
GetModuleInformation(phnd,0,modinfo,sizeof(modinfo));
getbaseaddr:=longword(modinfo.lpBaseOfDll);
}
EnumProcessModules(phnd,@hmods[0],sizeof(hmods),cb);
getbaseaddr:=hmods[0];
end;
var addrnum:SIZE_T;
function getaddr0(base:longword;offset:array of longint;var addr0:longword):boolean;
var addri:shortint;
var addrl,addrp:longword;
begin
getaddr0:=ReadProcessMemory(phnd,pointer(base),@addrl,sizeof(addrl),addrnum);
if getaddr0=false then exit;
for addri:=0 to length(offset)-2 do
begin
{$Q-}addrp:=addrl+offset[addri];{$Q+}
getaddr0:=ReadProcessMemory(phnd,pointer(addrp),@addrl,sizeof(addrl),addrnum);
if getaddr0=false then exit;
end;
if length(offset)>0 then
begin
addri:=length(offset)-1;
{$Q-}addrp:=addrl+offset[addri];{$Q+}
end
else
addrp:=addrl;
addr0:=addrp;
end;
function getaddr(base:longword;offset:array of longint;var data:longword):boolean;
var addr0:longword;
begin
getaddr:=getaddr0(base,offset,addr0);
if getaddr=false then exit;
if length(offset)>0 then getaddr:=ReadProcessMemory(phnd,pointer(addr0),@data,sizeof(data),addrnum)
else data:=addr0;
end;
function setaddr(base:longword;offset:array of longint;data:longword):boolean;
var addr0:longword;
begin
setaddr:=getaddr0(base,offset,addr0);
if setaddr=false then exit;
if length(offset)>0 then setaddr:=WriteProcessMemory(phnd,pointer(addr0),@data,sizeof(data),addrnum);
end;
function setaddr(base:longword;offset:array of longint;data:longword;offset0:longint):boolean;
var addr0:longword;
begin
setaddr:=getaddr0(base,offset,addr0);
if setaddr=false then exit;
if length(offset)>0 then setaddr:=ReadProcessMemory(phnd,pointer(longword(addr0+offset0)),@data,sizeof(data),addrnum);
if setaddr=false then exit;
if length(offset)>0 then setaddr:=WriteProcessMemory(phnd,pointer(addr0),@data,sizeof(data),addrnum);
end;
const ihull=1;
ishld=2;
ijump=3;
irebl=4;
iengy=5;
iscrp=6;
ifuel=7;
imsle=8;
idron=9;
ipwer=10;
istat=11;
icldn=12;
iwpon=13;
iclon=14;
ihack=15;
ihide=16;
imind=17;
ibatt=18;
ittan=19;
ioxyg=20;
ihumn=21;
imove=22;
iskil=23;
const maxitem=23;
const itemc:array[0..maxitem]of ansistring=(
'ALL',
'HULL',
'SHIELD',
'JUMP',
'REBEL',
'REACTOR',
'SCRAP',
'FUEL',
'MISSILE',
'DRONE',
'POWER',
'STATUS',
'COOLDOWN',
'WEAPON',
'CLONE',
'HACKING',
'INVISIBLE',
'MIND',
'BATTERY',
'TITAN',
'OXYGEN',
'HUMAN',
'MOVE',
'SKILL');
var itemb:array[0..maxitem]of shortint;
var itemi:longword;
const szw=160;szh=32;
var mousedown:boolean;
var mousex,mousey:longint;
procedure getact();
var imouse:longword;
begin
mousex:=GetMousePosX();
mousey:=GetMousePosY();
while IsNextMsg() do
begin
If IsMsg(WM_LBUTTONDOWN) then mousedown:=true;
If IsMsg(WM_LBUTTONUP) then mousedown:=false;
If IsMsg(WM_LBUTTONUP) then
begin
if (mousex>szh) and (mousey div szh>=0) and (mousey div szh<=maxitem) then
if itemb[mousey div szh]=0 then itemb[mousey div szh]:=1;
if (mousex<=szh) and (mousey div szh>=0) and (mousey div szh<=maxitem) then
if itemb[mousey div szh]=2 then itemb[mousey div szh]:=0
else if itemb[mousey div szh]>=0 then itemb[mousey div szh]:=2;
if mousey div szh=0 then for imouse:=1 to maxitem do itemb[imouse]:=itemb[0];
end;
end;
end;
procedure drawall();
var idraw:longword;
var tcolor:longword;
begin
Clear();
for idraw:=0 to maxitem do
begin
if itemb[idraw]=-1 then tcolor:=$3F3F3F;
if itemb[idraw]=0 then tcolor:=$7F7F7F;
if itemb[idraw]=1 then tcolor:=$0000FF;
if itemb[idraw]=2 then tcolor:=$FFFFFF;
Bar(0+1,szh*idraw+1,szh-2,szh-2,tcolor,transparent);
if itemb[idraw]=2 then Circle(szh div 2,szh*idraw+1+szh div 2,szh div 6,tcolor);
// if itemb[idraw]=2 then Line(0+1,szh*idraw+1,szh-2,szh-2,tcolor);
// if itemb[idraw]=2 then Line(szh-1,szh*idraw+1,2-szh,szh-2,tcolor);
if itemb[idraw]=0 then
if (mousex>szh) and ((mousey div szh=idraw) or (mousey div szh=0)) then
begin if mousedown then tcolor:=$7FFF7F else tcolor:=$7F7FFF end;
DrawtextXY(itemc[idraw],szh,szh*idraw,tcolor);
end;
FreshWin();
end;
procedure draw();
var timeold:longword;
var frame:longword=0;
var frametime:longword=30;
begin
CreateWin(szh+szw,(maxitem+1)*szh,blue);
SetTitle('FTL Cheater by ax_pokl');
SetWindowPos(_hw,HWND_TOPMOST,getscrwidth()-szh-szw,0,0,0,SWP_NOSIZE);
SetFontName('Consolas');
SetFontHeight(szh);
timeold:=gettime();
repeat
getact();
if gettime-timeold>frame*frametime then
begin
while gettime-timeold>frame*frametime do frame:=frame+1;
drawall();
end;
sleep(1);
until not(IsWin());
end;
function f2l(f:single):longword;
var pf:^single;pl:^longword;l:longword;
begin
pf:=@f;
pl:=pointer(pf);
l:=pl^;
f2l:=l;
end;
function l2f(l:longword):single;
var pf:^single;pl:^longword;f:single;
begin
pl:=@l;
pf:=pointer(pl);
f:=pf^;
l2f:=f;
end;
var baseaddr:longword;
var data:longword;
var addri,addrj,addrm:longword;
var maxsys:longint;
var maxman:longword;
//var man1,man2:longword;
var oxgn1,oxgn2,oxgnn:longword;
{
const crew:array[1..9]of longword=(
$616D7568,
$69676E65,
$736F6867,
$72656E65,
$6B636F72,
$67756C73,
$746E616D,
$65616E61,
$73797263);
var crewi:shortint;
}
var crewb:boolean;
var sys,powerstat,powerstatmax,powerzelta:longword;
var wponmax:longword;
var wponcount:longint;
begin
for itemi:=0 to maxitem do itemb[itemi]:=-1;
newthread(@draw);
while not(isWin()) do sleep(1);
repeat
for itemi:=0 to maxitem do itemb[itemi]:=-1;
getwin2();
getphnd();
baseaddr:=getbaseaddr();
if getaddr(baseaddr+$0051348C,[],data) then for itemi:=0 to maxitem do itemb[itemi]:=0;
repeat
data:=1;getaddr(baseaddr+$00513020,[$10],data);
if data=0 then
begin
//for itemi:=0 to maxitem do if itemb[itemi]=0 then itemb[itemi]:=2;
maxsys:=-1;
repeat
data:=0;
maxsys:=maxsys+1;
getaddr(baseaddr+$0051348C,[$18,$4*maxsys,$1C],data);
until data<>f2l(150);
//getaddr(baseaddr+$0051348C,[$64],man1);
//getaddr(baseaddr+$0051348C,[$68],man2);
//maxman:=(man2-man1)div 4;
//getaddr(baseaddr+$00513020,[$C,$1288],maxman);
getaddr(baseaddr+$00514E40,[],maxman);
getaddr(baseaddr+$0051348C,[$24,$1C4],oxgn1);
getaddr(baseaddr+$0051348C,[$24,$1C8],oxgn2);
oxgnn:=(oxgn2-oxgn1)div 4;
wponcount:=-1;
repeat
wponcount:=wponcount+1;
data:=0;
getaddr(baseaddr+$0051348C,[$48,$1C8,$4*wponcount,0],data);
until (data and $FFFF)<>$C540;
wponmax:=0;
if wponcount>0 then for addri:=0 to wponcount-1 do
begin
data:=0;
getaddr(baseaddr+$0051348C,[$48,$1C8,$4*addri,$F8],data);
wponmax:=wponmax+data;
end;
for itemi:=1 to maxitem do
begin
if itemb[itemi]>=1 then
case itemi of
ihull:setaddr(baseaddr+$0051348C,[$CC],30);
ishld:begin
data:=0;
getaddr(baseaddr+$0051348C,[$44,$1E8],data);
if data>0 then setaddr(baseaddr+$0051348C,[$44,$1E8],f2l(2));
end;
ijump:setaddr(baseaddr+$0051348C,[$48C],f2l(85));
irebl:setaddr(baseaddr+$00513498,[$80],longword(-1000));
iengy:setaddr(baseaddr+$0051AB20,[$0],0);
iscrp:setaddr(baseaddr+$0051348C,[$4D4],99999);
ifuel:setaddr(baseaddr+$0051348C,[$494],999);
imsle:setaddr(baseaddr+$0051348C,[$48,$1E8],999);
idron:
begin
setaddr(baseaddr+$0051348C,[$800],999);
setaddr(baseaddr+$0051348C,[$4C,$1CC],999);
end;
ipwer:
for addri:=0 to maxsys-1 do
begin
data:=0;
setaddr(baseaddr+$0051348C,[$18,$4*addri,$11C],1000);
getaddr(baseaddr+$0051348C,[$18,$4*addri,$28],sys);
getaddr(baseaddr+$0051348C,[$18,$4*addri,$170],powerzelta);
getaddr(baseaddr+$0051348C,[$18,$4*addri,$100],powerstat);
getaddr(baseaddr+$0051348C,[$18,$4*addri,$104],powerstatmax);
if (sys=$70616577) then
setaddr(baseaddr+$0051348C,[$18,$4*addri,$54],powerstatmax-powerstat+wponmax)
else if (sys=$6E6F7264) then
setaddr(baseaddr+$0051348C,[$18,$4*addri,$54],powerstatmax*2-powerstat+4)
else
begin
setaddr(baseaddr+$0051348C,[$18,$4*addri,$54],powerstatmax*2-powerstat);
setaddr(baseaddr+$0051348C,[$18,$4*addri,$50],max(powerstatmax-powerzelta,0));
end;
end;
istat:for addri:=0 to maxsys-1 do setaddr(baseaddr+$0051348C,[$18,$4*addri,$100],0,4);
icldn:for addri:=0 to maxsys-1 do setaddr(baseaddr+$0051348C,[$18,$4*addri,$134],f2l(5));
iwpon:if wponcount>0 then for addri:=0 to wponcount-1 do setaddr(baseaddr+$0051348C,[$48,$1C8,$4*addri,$62C],1);
iclon:begin
data:=0;
getaddr(baseaddr+$0051348C,[$38,$1C0],data);
if l2f(data)>0 then setaddr(baseaddr+$0051348C,[$38,$1C0],0,8);
end;
ihack:setaddr(baseaddr+$0051348C,[$3C,$7B0],0);
ihide:setaddr(baseaddr+$0051348C,[$2C,$1CC],0);
imind:begin
data:=0;
getaddr(baseaddr+$0051348C,[$34,$1C0],data);
if l2f(data)<14 then setaddr(baseaddr+$0051348C,[$34,$1C0],0);
end;
ibatt:setaddr(baseaddr+$0051348C,[$30,$1CC],0);
ittan:begin
getaddr(baseaddr+$0051348C,[$58,$0,$1C0,$8+4],data);
setaddr(baseaddr+$0051348C,[$58,$0,$1C0,$8],longword(data-1));
end;
ioxyg:for addri:=0 to oxgnn do setaddr(baseaddr+$0051348C,[$24,$1C4,$4*addri],f2l(100));
ihumn..iskil:
begin
addri:=0;
addrm:=0;
repeat
crewb:=false;
data:=0;
// data:=3;
// getaddr(baseaddr+$0051348C,[$64,$4*addri,$9C,$38],data);
// getaddr(baseaddr+$00514E4C,[$4*addri,$1B8],data);
// getaddr(baseaddr+$00514E4C,[$4*addri,$9C,$38],data);
getaddr(baseaddr+$00514E4C,[$4*addri,$53C],data);
// for crewi:=1 to 9 do if data=crew[crewi] then crewb:=true;
crewb:=((data and $FFFF)=1);
data:=0;
getaddr(baseaddr+$00514E4C,[$4*addri,$4],data);
// getaddr(baseaddr+$00514E4C,[$4*addri,$0,$58],data);
if data<>0 then crewb:=false;
// if data<>$008D5630 then crewb:=false;
//writeln(addri,#9,addrm,#9,i2hs(data));
if crewb=true then
begin
addrm:=addrm+1;
case itemi of
ihumn:setaddr(baseaddr+$00514E4C,[$4*addri,$28],0,4);
// ihumn:setaddr(baseaddr+$0051348C,[$64,$4*addri,$28],0,4);
imove:begin setaddr(baseaddr+$00514E4C,[$4*addri,$8],0,$10);setaddr(baseaddr+$00514E4C,[$4*addri,$C],0,$10);end;
// imove:begin setaddr(baseaddr+$0051348C,[$64,$4*addri,$8],0,$10);setaddr(baseaddr+$0051348C,[$64,$4*addri,$C],0,$10);end;
iskil:for addrj:=0 to 5 do setaddr(baseaddr+$00514E4C,[$4*addri,$314,$8*addrj],0,4);
// iskil:for addrj:=0 to 5 do setaddr(baseaddr+$0051348C,[$64,$4*addri,$314,$8*addrj],0,4);
end;
end;
addri:=addri+1;
//readln();
until (addrm=maxman);
end;
end;
// writeln('@',itemi,itemb[itemi]);
end;
for itemi:=0 to maxitem do if itemb[itemi]=1 then itemb[itemi]:=0;
sleep(1);
end;
sleep(1);
until not(getaddr(baseaddr+$0051348C,[],data)) or (not(iswin()));
sleep(1);
until not(iswin());
{
//other status?
//other human?
//dron
}
end.
| 29.040598 | 135 | 0.641822 |
83098ed504581fdcefe8bee35b2bfc0424419b79 | 14,151 | pas | Pascal | Base/obspmaploaderlaz.pas | osman-turan/openbsp-legacy | 083c4dd18bd5f5a6cf3e50fff4fd84de38b64da7 | [
"MIT"
]
| 6 | 2018-12-09T01:58:52.000Z | 2022-03-20T03:31:21.000Z | Base/obspmaploaderlaz.pas | osman-turan/openbsp-legacy | 083c4dd18bd5f5a6cf3e50fff4fd84de38b64da7 | [
"MIT"
]
| 1 | 2018-08-13T12:09:56.000Z | 2018-08-15T14:33:40.000Z | Base/obspmaploaderlaz.pas | osman-turan/OpenBSP-Legacy | 083c4dd18bd5f5a6cf3e50fff4fd84de38b64da7 | [
"MIT"
]
| null | null | null | //
// Project : OpenBSP Map Compiler
// Unit : obspMapLoader.pas
// Description : Generic OpenBSP map loader for developers
// History :
// 05/08/04 - OT - Creation
//
unit obspMapLoaderLaz;
interface
uses SysUtils, Classes, obspFile, obspBaseTypes;
type
TOBSPMap = class
private
FMaterials: TStringList;
FPlanes: array of TOBSPPlane;
FNodes: array of TOBSPNode;
FLeafs: array of TOBSPLeaf;
FLBrushes: array of Cardinal;
FLSurfaces: array of Cardinal;
FBrushes: array of TOBSPBrush;
FBrushSides: array of TOBSPBrushSide;
FSurfaces: array of TOBSPSurface;
FElements: array of Cardinal;
FVertices: array of TOBSPVertex;
FLightmaps: array of Byte;
FLightmapHeight: Integer;
FLightmapWidth: Integer;
FLightmapCount: Integer;
function GetMaterial(Index: Integer): String;
function GetMaterialCount: Integer;
function GetNode(Index: Integer): TOBSPNode;
function GetNodeCount: Integer;
function GetPlane(Index: Integer): TOBSPPlane;
function GetPlaneCount: Integer;
function GetLeaf(Index: Integer): TOBSPLeaf;
function GetLeafCount: Integer;
function GetLeafBrush(Index: Integer): Integer;
function GetLeafBrushCount: Integer;
function GetLeafSurface(Index: Integer): Integer;
function GetLeafSurfaceCount: Integer;
function GetBrush(Index: Integer): TOBSPBrush;
function GetBrushCount: Integer;
function GetBrushSide(Index: Integer): TOBSPBrushSide;
function GetBrushSideCount: Integer;
function GetSurface(Index: Integer): TOBSPSurface;
function GetSurfaceCount: Integer;
function GetElement(Index: Integer): Integer;
function GetElementCount: Integer;
function GetVertex(Index: Integer): TOBSPVertex;
function GetVertexCount: Integer;
function GetLightmap(Index: Integer): PVector3bArray;
protected
procedure LoadEntities(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadMaterials(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadPlanes(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadNodes(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadLeafs(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadLeafBrushes(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadLeafSurfaces(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadBrushes(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadBrushSides(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadSurfaces(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadElements(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadVertices(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
procedure LoadLightmaps(Stream: TStream;
OffsetStart: Cardinal;
Header: TOBSPHeader);
public
constructor Create;
destructor Destroy; override;
function LoadFromFile(Filename: String): Boolean;
function LoadFromStream(Stream: TStream): Boolean;
procedure ClearMap;
property Materials[Index: Integer]: String read GetMaterial;
property MaterialCount: Integer read GetMaterialCount;
property Planes[Index: Integer]: TOBSPPlane read GetPlane;
property PlaneCount: Integer read GetPlaneCount;
property Nodes[Index: Integer]: TOBSPNode read GetNode;
property NodeCount: Integer read GetNodeCount;
property Leafs[Index: Integer]: TOBSPLeaf read GetLeaf;
property LeafCount: Integer read GetLeafCount;
property LeafBrushes[Index: Integer]: Integer read GetLeafBrush;
property LeafBrushCount: Integer read GetLeafBrushCount;
property LeafSurfaces[Index: Integer]: Integer read GetLeafSurface;
property LeafSurfaceCount: Integer read GetLeafSurfaceCount;
property Brushes[Index: Integer]: TOBSPBrush read GetBrush;
property BrushCount: Integer read GetBrushCount;
property BrushSides[Index: Integer]: TOBSPBrushSide read GetBrushSide;
property BrushSideCount: Integer read GetBrushSideCount;
property Surfaces[Index: Integer]: TOBSPSurface read GetSurface;
property SurfaceCount: Integer read GetSurfaceCount;
property Elements[Index: Integer]: Integer read GetElement;
property ElementCount: Integer read GetElementCount;
property Vertices[Index: Integer]: TOBSPVertex read GetVertex;
property VertexCount: Integer read GetVertexCount;
property Lightmaps[Index: Integer]: PVector3bArray read GetLightmap;
property LightmapCount: Integer read FLightmapCount;
property LightmapWidth: Integer read FLightmapWidth;
property LightmapHeight: Integer read FLightmapHeight;
end;
implementation
{ TOBSPMap }
procedure TOBSPMap.ClearMap;
begin
FMaterials.Clear;
FPlanes := nil;
FNodes := nil;
FLeafs := nil;
FLBrushes := nil;
FLSurfaces := nil;
FBrushes := nil;
FBrushSides := nil;
FSurfaces := nil;
FElements := nil;
FVertices := nil;
FLightmaps := nil;
FLightmapHeight := 256;
FLightmapWidth := 256;
FLightmapCount := 0;
end;
constructor TOBSPMap.Create;
begin
FMaterials := TStringList.Create;
ClearMap;
end;
destructor TOBSPMap.Destroy;
begin
FMaterials.Free;
inherited;
end;
function TOBSPMap.GetBrush(Index: Integer): TOBSPBrush;
begin
Result := FBrushes[Index];
end;
function TOBSPMap.GetBrushCount: Integer;
begin
Result := Length(FBrushes);
end;
function TOBSPMap.GetBrushSide(Index: Integer): TOBSPBrushSide;
begin
Result := FBrushSides[Index];
end;
function TOBSPMap.GetBrushSideCount: Integer;
begin
Result := Length(FBrushSides);
end;
function TOBSPMap.GetElement(Index: Integer): Integer;
begin
Result := FElements[Index];
end;
function TOBSPMap.GetElementCount: Integer;
begin
Result := Length(FElements);
end;
function TOBSPMap.GetLeaf(Index: Integer): TOBSPLeaf;
begin
Result := FLeafs[Index];
end;
function TOBSPMap.GetLeafBrush(Index: Integer): Integer;
begin
Result := FLBrushes[Index];
end;
function TOBSPMap.GetLeafBrushCount: Integer;
begin
Result := Length(FLBrushes);
end;
function TOBSPMap.GetLeafCount: Integer;
begin
Result := Length(FLeafs);
end;
function TOBSPMap.GetLeafSurface(Index: Integer): Integer;
begin
Result := FLSurfaces[Index];
end;
function TOBSPMap.GetLeafSurfaceCount: Integer;
begin
Result := Length(FLSurfaces);
end;
function TOBSPMap.GetLightmap(Index: Integer): PVector3bArray;
begin
Result := @FLightmaps[Index * FLightmapWidth * FLightmapHeight * 3];
end;
function TOBSPMap.GetMaterial(Index: Integer): String;
begin
Result := FMaterials.Strings[Index];
end;
function TOBSPMap.GetMaterialCount: Integer;
begin
Result := FMaterials.Count;
end;
function TOBSPMap.GetNode(Index: Integer): TOBSPNode;
begin
Result := FNodes[Index];
end;
function TOBSPMap.GetNodeCount: Integer;
begin
Result := Length(FNodes);
end;
function TOBSPMap.GetPlane(Index: Integer): TOBSPPlane;
begin
Result := FPlanes[Index];
end;
function TOBSPMap.GetPlaneCount: Integer;
begin
Result := Length(FPlanes);
end;
function TOBSPMap.GetSurface(Index: Integer): TOBSPSurface;
begin
Result := FSurfaces[Index];
end;
function TOBSPMap.GetSurfaceCount: Integer;
begin
Result := Length(FSurfaces);
end;
function TOBSPMap.GetVertex(Index: Integer): TOBSPVertex;
begin
Result := FVertices[Index];
end;
function TOBSPMap.GetVertexCount: Integer;
begin
Result := Length(FVertices);
end;
procedure TOBSPMap.LoadBrushes(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FBrushes, Header.Lumps[LUMP_BRUSHES].Length div SizeOf(TOBSPBrush));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_BRUSHES].Offset, soFromBeginning);
Stream.Read(FBrushes[0], Header.Lumps[LUMP_BRUSHES].Length);
end;
procedure TOBSPMap.LoadBrushSides(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FBrushSides, Header.Lumps[LUMP_BRUSHSIDES].Length div SizeOf(TOBSPBrushSide));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_BRUSHSIDES].Offset, soFromBeginning);
Stream.Read(FBrushSides[0], Header.Lumps[LUMP_BRUSHSIDES].Length);
end;
procedure TOBSPMap.LoadElements(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FElements, Header.Lumps[LUMP_ELEMENTS].Length div SizeOf(Cardinal));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_ELEMENTS].Offset, soFromBeginning);
Stream.Read(FElements[0], Header.Lumps[LUMP_ELEMENTS].Length);
end;
procedure TOBSPMap.LoadEntities(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
end;
function TOBSPMap.LoadFromFile(Filename: String): Boolean;
var f: TFileStream;
begin
Result := False;
f := TFileStream.Create(Filename, fmOpenRead or fmShareDenyWrite);
try
if LoadFromStream(f) then
Result := True;
finally
f.Free;
end;
end;
function TOBSPMap.LoadFromStream(Stream: TStream): Boolean;
var
header: TOBSPHeader;
offset: Integer;
begin
Result := False;
offset := Stream.Position;
Stream.Read(header, SizeOf(header));
if not ((header.Identity = OBSP_IDENTITY) and
(header.Version = OBSP_VERSION)) then
Exit;
ClearMap;
LoadEntities(Stream, offset, header);
LoadMaterials(Stream, offset, header);
LoadPlanes(Stream, offset, header);
LoadNodes(Stream, offset, header);
LoadLeafs(Stream, offset, header);
LoadLeafBrushes(Stream, offset, header);
LoadLeafSurfaces(Stream, offset, header);
LoadBrushes(Stream, offset, header);
LoadBrushSides(Stream, offset, header);
LoadSurfaces(Stream, offset, header);
LoadElements(Stream, offset, header);
LoadVertices(Stream, offset, header);
LoadLightmaps(Stream, offset, header);
Result := True;
end;
procedure TOBSPMap.LoadLeafBrushes(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FLBrushes, Header.Lumps[LUMP_LBRUSHES].Length div SizeOf(Cardinal));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_LBRUSHES].Offset, soFromBeginning);
Stream.Read(FLBrushes[0], Header.Lumps[LUMP_LBRUSHES].Length);
end;
procedure TOBSPMap.LoadLeafs(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FLeafs, Header.Lumps[LUMP_LEAFS].Length div SizeOf(TOBSPLeaf));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_LEAFS].Offset, soFromBeginning);
Stream.Read(FLeafs[0], Header.Lumps[LUMP_LEAFS].Length);
end;
procedure TOBSPMap.LoadLeafSurfaces(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FLSurfaces, Header.Lumps[LUMP_LSURFACES].Length div SizeOf(Cardinal));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_LSURFACES].Offset, soFromBeginning);
Stream.Read(FLSurfaces[0], Header.Lumps[LUMP_LSURFACES].Length);
end;
procedure TOBSPMap.LoadLightmaps(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FLightmaps, Header.Lumps[LUMP_LIGHTMAPS].Length);
Stream.Seek(OffsetStart + Header.Lumps[LUMP_LIGHTMAPS].Offset, soFromBeginning);
Stream.Read(FLightmaps[0], Header.Lumps[LUMP_LIGHTMAPS].Length);
FLightmapCount := Header.Lumps[LUMP_LIGHTMAPS].Length div (FLightmapWidth * FLightmapHeight * 3);
end;
procedure TOBSPMap.LoadMaterials(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
var
matstr, s: String;
i, len: Integer;
//matstr:string;
buffer:PChar;
begin
// strpcopy(buffer,matstr);
Stream.Seek(OffsetStart + Header.Lumps[LUMP_MATERIALS].Offset, soFromBeginning);
buffer:=stralloc(Header.Lumps[LUMP_MATERIALS].Length);
// SetLength(matstr, Header.Lumps[LUMP_MATERIALS].Length);
// buffer:=pchar(matstr);
//Stream.Read(PChar(matstr)^, Header.Lumps[LUMP_MATERIALS].Length);
Stream.Read(buffer, Header.Lumps[LUMP_MATERIALS].Length);
matstr:=strpas(buffer);
strdispose(buffer);
len := Length(matstr);
s := '';
i:=1;
while i <= len do
begin
if matstr[i] = #0 then
begin
FMaterials.Add(s);
s := '';
end
else
s := s + matstr[i];
Inc(i);
end;
end;
procedure TOBSPMap.LoadNodes(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FNodes, Header.Lumps[LUMP_NODES].Length div SizeOf(TOBSPNode));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_NODES].Offset, soFromBeginning);
Stream.Read(FNodes[0], Header.Lumps[LUMP_NODES].Length);
end;
procedure TOBSPMap.LoadPlanes(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FPlanes, Header.Lumps[LUMP_PLANES].Length div SizeOf(TOBSPPlane));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_PLANES].Offset, soFromBeginning);
Stream.Read(FPlanes[0], Header.Lumps[LUMP_PLANES].Length);
end;
procedure TOBSPMap.LoadSurfaces(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FSurfaces, Header.Lumps[LUMP_SURFACES].Length div SizeOf(TOBSPSurface));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_SURFACES].Offset, soFromBeginning);
Stream.Read(FSurfaces[0], Header.Lumps[LUMP_SURFACES].Length);
end;
procedure TOBSPMap.LoadVertices(Stream: TStream; OffsetStart: Cardinal;
Header: TOBSPHeader);
begin
SetLength(FVertices, Header.Lumps[LUMP_VERTICES].Length div SizeOf(TOBSPVertex));
Stream.Seek(OffsetStart + Header.Lumps[LUMP_VERTICES].Offset, soFromBeginning);
Stream.Read(FVertices[0], Header.Lumps[LUMP_VERTICES].Length);
end;
end.
| 29.917548 | 99 | 0.720585 |
47cf3f27cf06c93b9fc967420e918b9ca8a318b5 | 780 | pas | Pascal | Jogo_da_memoria/Unit6.pas | zScrolLock/delphi | aca88441287be854baeace613b61241e14b30cee | [
"MIT"
]
| null | null | null | Jogo_da_memoria/Unit6.pas | zScrolLock/delphi | aca88441287be854baeace613b61241e14b30cee | [
"MIT"
]
| null | null | null | Jogo_da_memoria/Unit6.pas | zScrolLock/delphi | aca88441287be854baeace613b61241e14b30cee | [
"MIT"
]
| null | null | null | unit Unit6;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.Mask,
Vcl.DBCtrls;
type
TForm_registro = class(TForm)
Panel1: TPanel;
Label1: TLabel;
DBEdit1: TDBEdit;
Label2: TLabel;
DBEdit2: TDBEdit;
Label3: TLabel;
DBNavigator1: TDBNavigator;
procedure DBEdit2Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form_registro: TForm_registro;
implementation
{$R *.dfm}
uses Unit5, Unit2;
procedure TForm_registro.DBEdit2Change(Sender: TObject);
begin
DBEdit2.Text:= Unit2.tempoA;
end;
end.
| 18.139535 | 99 | 0.678205 |
477c56f0e93bfea8607737d84d2100d00e75d704 | 276 | pas | Pascal | exercises/reverse-string/uReverseStringExample.pas | onionspider/delphi | c701be3b18ee9ec5bbdc757da6a8b4bf5ca9f922 | [
"MIT"
]
| null | null | null | exercises/reverse-string/uReverseStringExample.pas | onionspider/delphi | c701be3b18ee9ec5bbdc757da6a8b4bf5ca9f922 | [
"MIT"
]
| 2 | 2018-10-19T02:50:26.000Z | 2018-11-03T23:06:01.000Z | exercises/reverse-string/uReverseStringExample.pas | filiptoskovic/delphi | 3e0fdad99efb579ac319e708be326124ae3179e0 | [
"MIT"
]
| null | null | null | unit uReverseString;
interface
function reverse(aInString: string): string;
implementation
function reverse(aInString: string): string;
var
i: integer;
begin
result := '';
for i := Low(aInString) to High(aInString) do
result := aInString[i] + result;
end;
end.
| 14.526316 | 47 | 0.710145 |
83c09917ecd9471803f87ba5cb81771017ab5182 | 813 | dfm | Pascal | demos/Delphi_VCL/TabbedBrowser/uChildForm.dfm | e-files/WebView4Delphi | 01dade7a01a1d8b5c1b0ad131e237f18f8e650b5 | [
"MIT"
]
| 99 | 2021-12-03T22:21:56.000Z | 2022-03-26T20:19:23.000Z | demos/Delphi_VCL/TabbedBrowser/uChildForm.dfm | e-files/WebView4Delphi | 01dade7a01a1d8b5c1b0ad131e237f18f8e650b5 | [
"MIT"
]
| 20 | 2021-12-04T10:12:45.000Z | 2022-03-01T09:37:51.000Z | demos/Delphi_VCL/TabbedBrowser/uChildForm.dfm | e-files/WebView4Delphi | 01dade7a01a1d8b5c1b0ad131e237f18f8e650b5 | [
"MIT"
]
| 17 | 2021-12-04T09:32:31.000Z | 2022-03-24T15:15:44.000Z | object ChildForm: TChildForm
Left = 0
Top = 0
Caption = 'ChildForm'
ClientHeight = 441
ClientWidth = 624
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
OnClose = FormClose
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 15
object WVWindowParent1: TWVWindowParent
Left = 0
Top = 0
Width = 624
Height = 441
Align = alClient
TabOrder = 0
Browser = WVBrowser1
end
object WVBrowser1: TWVBrowser
TargetCompatibleBrowserVersion = '95.0.1020.44'
AllowSingleSignOnUsingOSPrimaryAccount = False
OnAfterCreated = WVBrowser1AfterCreated
OnWindowCloseRequested = WVBrowser1WindowCloseRequested
Left = 144
Top = 168
end
end
| 22.583333 | 59 | 0.703567 |
47f754d0abf91a96f4dc080d49e8ac66cd5a5ea5 | 1,702 | pas | Pascal | source/uRelForn.pas | roneysousa/infoimobiliaria | c15ea09fd7fe2f79a4d6b0f2affe29192f022c18 | [
"MIT"
]
| null | null | null | source/uRelForn.pas | roneysousa/infoimobiliaria | c15ea09fd7fe2f79a4d6b0f2affe29192f022c18 | [
"MIT"
]
| null | null | null | source/uRelForn.pas | roneysousa/infoimobiliaria | c15ea09fd7fe2f79a4d6b0f2affe29192f022c18 | [
"MIT"
]
| null | null | null | unit uRelForn;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, Qrctrls, QuickRpt, ExtCtrls;
type
TfrmRelForn = class(TForm)
qrForn: TQuickRep;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
PageFooterBand1: TQRBand;
QRSysData1: TQRSysData;
QRSysData2: TQRSysData;
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRShape1: TQRShape;
txtEmpresa: TQRLabel;
QRLabel8: TQRLabel;
txtUsuario: TQRLabel;
txtNMRELA: TQRLabel;
QRLabel7: TQRLabel;
QRLabel9: TQRLabel;
qryFornec: TQuery;
qryFornecFOR_CDFORN: TStringField;
qryFornecFOR_NMFORN: TStringField;
qryFornecFOR_RAFORN: TStringField;
qryFornecFOR_CGCFOR: TStringField;
qryFornecFOR_ENDERE: TStringField;
qryFornecFOR_BAIRRO: TStringField;
qryFornecFOR_NRFONE: TStringField;
qryFornecFOR_FAXFOR: TStringField;
qryFornecFOR_NRRAMA: TStringField;
qryFornecFOR_NRTELE: TStringField;
qryFornecFOR_CIDADE: TStringField;
qryFornecFOR_UFFORN: TStringField;
qryFornecFOR_CEPFOR: TStringField;
qryFornecFOR_INESTA: TStringField;
txtNMRELA1: TQRLabel;
SummaryBand1: TQRBand;
QRLabel10: TQRLabel;
QRSysData3: TQRSysData;
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmRelForn: TfrmRelForn;
implementation
{$R *.DFM}
end.
| 23.971831 | 75 | 0.726204 |
f1c7808b31fb19923bd54affa8b6d52197814703 | 251 | dpr | Pascal | demos/AppType/VCLDesktop/VCLDesktopDemo.dpr | atkins126/jachLogMgr | 5f8af44dd74df9a89864be7b5a7ffc58fd3cd022 | [
"MIT"
]
| null | null | null | demos/AppType/VCLDesktop/VCLDesktopDemo.dpr | atkins126/jachLogMgr | 5f8af44dd74df9a89864be7b5a7ffc58fd3cd022 | [
"MIT"
]
| null | null | null | demos/AppType/VCLDesktop/VCLDesktopDemo.dpr | atkins126/jachLogMgr | 5f8af44dd74df9a89864be7b5a7ffc58fd3cd022 | [
"MIT"
]
| null | null | null | program VCLDesktopDemo;
{$R *.dres}
uses
Vcl.Forms,
ufrmMain in 'ufrmMain.pas' {frmMain};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.
| 14.764706 | 44 | 0.721116 |
83ec6015dcfae63fd716f161c3751c3471436c92 | 10,536 | pas | Pascal | lib/sgDriverAudioSDL13Mixer.pas | jacobmilligan/deadfall-uni | 1bb9c7c8eb961b556bc0737783b840ebb0c5d6ab | [
"MIT",
"Unlicense"
]
| null | null | null | lib/sgDriverAudioSDL13Mixer.pas | jacobmilligan/deadfall-uni | 1bb9c7c8eb961b556bc0737783b840ebb0c5d6ab | [
"MIT",
"Unlicense"
]
| null | null | null | lib/sgDriverAudioSDL13Mixer.pas | jacobmilligan/deadfall-uni | 1bb9c7c8eb961b556bc0737783b840ebb0c5d6ab | [
"MIT",
"Unlicense"
]
| 1 | 2019-03-30T16:33:07.000Z | 2019-03-30T16:33:07.000Z | unit sgDriverAudioSDL13Mixer;
//=============================================================================
// sgDriverAudioSDLMixer.pas
//=============================================================================
//
// This is responsible for providing the interface between the AudioDriver and
// the underlaying driver, SDL_Mixer 1.2
//
// It includes specific calls to SDL and SDL_Mixer, it also requires
// sgAudioDriver so that it can access the driver to Load itself.
// TODO:
// - Write the rest of the procedures required in sgAudio
// - Make the procedures/functions more generic by returning pointers
//=============================================================================
interface
// Loads the AudioDriver with the procedures required to access SDL_Mixer
procedure LoadSDL13MixerAudioDriver();
implementation
uses sgDriverAudio, sgTypes, sgShared, SDL2, SDL13_Mixer, sysUtils;
var
// Contains the sound channels used to determine if a sound is currently
// playing and enables us to stop the sound, check if it is playing etc.
soundChannels: Array[0..31] of Pointer;
//=============================================================================
// These procedures and functions provide an interface with SDL 1.2
//=============================================================================
// GetChannel finds the audio channel that a sound effect is being played over
// and returns the channel number. It returns -1 if the sound could not be found
function GetChannel(effect : SoundEffect) : Integer;
var
i : Integer;
begin
result := -1;
for i := Low(soundChannels) to High(soundChannels) do
begin
if (soundChannels[i] = effect) and (Mix_Playing(i) = 1) then
begin
result := i;
break;
end;
end;
end;
// The OpenAudioProcedure is responsible for enabling audio to be used
// it returns Boolean true if it succeeded and false if it failed.
// SDL1.2 OpenAudio returns 0 for success and -1 for failure
function OpenAudioProcedure() : Boolean;
begin
result := Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 2048 ) >= 0;
if result then Mix_AllocateChannels(Length(soundChannels));
end;
procedure CloseAudioProcedure();
begin
Mix_CloseAudio();
end;
// GetErrorProcedure gets an audio error and returns the error as
// a pascal string
function GetErrorProcedure() : String;
begin
result := StrPas(MIX_GetError()); // Converts from PChar to Pascal String
end;
//=============================================================================
// Sound Effects
//=============================================================================
// LoadSoundEffectProcedure is responsible for loading a SwinGame SoundEffect
// and returning it, if it is unable to load the sound effect it raises an error
// and returns a null pointer.
function LoadSoundEffectProcedure(filename, name: String) : SoundEffect;
begin
{$IFDEF IOS}
if ExtractFileExt(filename) = '.ogg' then
begin
RaiseWarning('Did not attempt to load ogg as it is not supported on iOS.');
result:=nil;
exit;
end;
{$ENDIF}
New(result);
try
result^.effect := Mix_LoadWAV(PChar(filename));
if result^.effect = nil then RaiseException('Error loading sound effect');
except on e1: Exception do
begin
Dispose(result);
result := nil;
RaiseWarning('Error loading sound effect: ' + AudioDriver.GetError());
exit;
end;
end;
result^.filename := filename;
result^.name := name;
end;
procedure StopSoundEffectProcedure(effect : SoundEffect);
var
channel : Integer;
begin
channel := GetChannel(effect);
if channel >= 0 then
begin
Mix_HaltChannel(channel);
soundChannels[channel] := nil; // Sound effect is stopped and so remove it from the currently playing
end;
end;
// FreeSoundEffectProcedure frees the memory of the sound effect
procedure FreeSoundEffectProcedure(effect : SoundEffect);
begin
Mix_FreeChunk(effect^.effect);
end;
// PlaySoundEffectProcedure plays a sound effect a number of times
// it returns the channel that the sound effect will be played on
// returns Boolean false if there is an error and true if it suceeded
function PlaySoundEffectProcedure(effect : SoundEffect; loops : Integer; volume : Single) : Boolean;
var
channel : Integer;
begin
result := false;
channel := Mix_PlayChannel( -1, effect^.effect, loops);
if (channel >= 0) then
begin
Mix_Volume(channel, RoundInt(volume * 128));
soundChannels[channel] := effect; // record which channel is playing the effect
result := true;
end;
end;
// Gets the volume of a sound effect, returns a negative single if
// the effect isn't playing.
function GetSoundEffectVolumeProcedure(effect : SoundEffect) : Single;
var
channel : Integer;
begin
channel := GetChannel(effect);
if channel >= 0 then
result := Mix_Volume(channel, -1) / 128
else
result := -1.0
end;
procedure SetSoundEffectVolumeProcedure(effect : SoundEffect; newVolume : Single);
var
channel : Integer;
begin
channel := GetChannel(effect);
if channel >= 0 then
Mix_Volume(channel, RoundInt(newVolume * 128));
end;
// ChannelPlaying returns true if the channel is playing music and false if it is not
function SoundEffectPlayingProcedure(effect : SoundEffect) : Boolean;
var
channel : Integer;
begin
result := false;
channel := GetChannel(effect);
if channel >= 0 then
begin
result := Mix_Playing(channel) = 1; // Playing returns 1 if the channel is playing
end;
end;
//=============================================================================
// Music
//=============================================================================
// MusicPlaying returns true if music is currently being played
function MusicPlayingProcedure() : Boolean;
begin
result := Mix_PlayingMusic() = 1; // Playing music returns 1 if music is playing
end;
procedure PauseMusicProcedure();
begin
Mix_PauseMusic();
end;
procedure ResumeMusicProcedure();
begin
Mix_ResumeMusic();
end;
procedure StopMusicProcedure();
begin
Mix_HaltMusic();
end;
// LoadMusicEffectProocedure is responsible for loading a SwinGame Music
// and returning it, if it is unable to load the sound effect it raises an error
// and returns a null pointer.
function LoadMusicProcedure(filename, name: String) : Music;
begin
New(result);
result^.music := Mix_LoadMUS(PChar(filename));
if result^.music = nil then
begin
Dispose(result);
result := nil;
RaiseWarning('Error loading sound effect: ' + AudioDriver.GetError());
exit;
end;
result^.filename := filename;
result^.name := name;
end;
// FreeSoundEffectProcedure frees the memory of the sound effect
// and sets the SoundEffect passed in to null
procedure FreeMusicProcedure(music : Music);
begin
Mix_FreeMusic(music^.music);
Dispose(music);
music := nil;
end;
procedure SetMusicVolumeProcedure(newVolume : Single);
begin
// if the current computer playing the music is not windows
// the music can be played without checking type
{$IFDEF UNIX}
Mix_VolumeMusic(RoundInt(newVolume * 128));
{$ELSE}
// The music is being played on a Windows machine and so
// if the music is a midi type then it shouldn't be allowed
// to change volume.
if Mix_GetMusicType(nil) <> MUS_MID then
begin
Mix_VolumeMusic(RoundInt(newVolume * 128));
end;
{$ENDIF}
end;
// GetMusicVolume returns the single that describes the current volume
// of the music. Values between 0.0 and 1.0 are accepted.
function GetMusicVolumeProcedure() : Single;
begin
result := Mix_VolumeMusic(-1) / 128.0;
end;
// PlayMusicProcedure plays music a number of times,
// it returns a Boolean, true if it suceeded and false if it failed
function PlayMusicProcedure(music : Music; loops : Integer) : Boolean;
begin
result := Mix_PlayMusic(music^.music, loops) >= 0; //PlayMusic returns 0 on success -1 on fail
end;
function FadeMusicInProcedure(music : Music; loops, ms : Integer) : Boolean;
begin
result := Mix_FadeInMusic(music^.music, loops, ms) >= 0; // FadeInMusic returns 0 on success -1 on fail
end;
function FadeMusicOutProcedure(ms : Integer) : Boolean;
begin
result := Mix_FadeOutMusic(ms) > 0; // FadeOutMusic returns 1 on success 0 on fail
end;
//=============================================================================
// Loads the SDL 1.2 procedures and functions into the audio driver
//=============================================================================
procedure LoadSDL13MixerAudioDriver();
var
i : Integer;
begin
for i := Low(soundChannels) to High(soundChannels) do
begin
soundChannels[i] := nil;
end;
//WriteLn('Loading SDL_Mixer Audio Driver...');
AudioDriver.LoadSoundEffect := @LoadSoundEffectProcedure;
AudioDriver.OpenAudio := @OpenAudioProcedure;
AudioDriver.CloseAudio := @CloseAudioProcedure;
AudioDriver.SetMusicVolume := @SetMusicVolumeProcedure;
AudioDriver.GetMusicVolume := @GetMusicVolumeProcedure;
AudioDriver.GetError := @GetErrorProcedure;
AudioDriver.FreeSoundEffect := @FreeSoundEffectProcedure;
AudioDriver.LoadMusic := @LoadMusicProcedure;
AudioDriver.FreeMusic := @FreeMusicProcedure;
AudioDriver.PlaySoundEffect := @PlaySoundEffectProcedure;
AudioDriver.PlayMusic := @PlayMusicProcedure;
AudioDriver.FadeMusicIn := @FadeMusicInProcedure;
AudioDriver.FadeMusicOut := @FadeMusicOutProcedure;
AudioDriver.SetSoundEffectVolume := @SetSoundEffectVolumeProcedure;
AudioDriver.GetSoundEffectVolume := @GetSoundEffectVolumeProcedure;
AudioDriver.SoundEffectPlaying := @SoundEffectPlayingProcedure;
AudioDriver.MusicPlaying := @MusicPlayingProcedure;
AudioDriver.PauseMusic := @PauseMusicProcedure;
AudioDriver.ResumeMusic := @ResumeMusicProcedure;
AudioDriver.StopMusic := @StopMusicProcedure;
AudioDriver.StopSoundEffect := @StopSoundEffectProcedure;
end;
end. | 34.772277 | 108 | 0.634586 |
f1c9523884ddb687cdff31cdaca305b576423b6f | 6,314 | pas | Pascal | ArcIWRegionGridComponents.pas | aftabgardan2006/iwelite | a68fcc8d423e8837ae2e2cd351b84a98d90df33e | [
"MIT"
]
| 1 | 2018-01-09T12:32:40.000Z | 2018-01-09T12:32:40.000Z | ArcIWRegionGridComponents.pas | aftabgardan2006/iwelite | a68fcc8d423e8837ae2e2cd351b84a98d90df33e | [
"MIT"
]
| null | null | null | ArcIWRegionGridComponents.pas | aftabgardan2006/iwelite | a68fcc8d423e8837ae2e2cd351b84a98d90df33e | [
"MIT"
]
| 2 | 2019-05-13T11:28:16.000Z | 2020-03-10T17:47:48.000Z | ////////////////////////////////////////////////////////////////////////////////
//
// The MIT License
//
// Copyright (c) 2008 by Arcana Technologies Incorporated
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
////////////////////////////////////////////////////////////////////////////////
unit ArcIWRegionGridComponents;
{$I IntraWebVersion.inc}
{$I Eval.inc}
{$IFDEF INTRAWEB51}
ERROR: This unit is only valid for IW 7
{$ENDIF}
interface
uses
SysUtils, Classes, Controls, Graphics, IWHTMLTag, IWControl, IWColor, IWTypes,
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWRenderContext, IWApplication,
ArcIWGridCommon, ArcIWCustomGrid, IWRegion, DB, TypInfo, IWBaseRenderContext,
IWBaseInterfaces, IWBaseContainerLayout, IWLayoutMgrForm, IWVCLComponent,
IWMarkupLanguageTag, Forms, IWContainerLayout, IWBaseHTMLInterfaces,
ArcIWRegionGrid, IWCompButton, IWHTMLControls
{$IFDEF INTRAWEB120}, IWRenderStream, IWCompExtCtrls, {$ELSE}, IWStreams, IWExtCtrls, {$ENDIF} ArcCommon;
type
TArcIWRGLink = class(TIWLink, IIWSubmitInvisible)
private
Region : TIWGridRegion;
Grid : TArcIWRegionGrid;
FMoveDataset: boolean;
protected
procedure DoClick; override;
public
constructor Create(AOwner: TComponent); override;
published
property MoveDataset : boolean read FMoveDataset write FMoveDataset;
end;
TArcIWRGImage = class(TIWImage, IIWSubmitInvisible)
private
Region : TIWGridRegion;
Grid : TArcIWRegionGrid;
FMoveDataset: boolean;
protected
procedure DoClick; override;
public
constructor Create(AOwner: TComponent); override;
published
property MoveDataset : boolean read FMoveDataset write FMoveDataset;
end;
TArcIWRGImageFile = class(TIWImageFile, IIWSubmitInvisible)
private
Region : TIWGridRegion;
Grid : TArcIWRegionGrid;
FMoveDataset: boolean;
protected
procedure DoClick; override;
public
constructor Create(AOwner: TComponent); override;
published
property MoveDataset : boolean read FMoveDataset write FMoveDataset;
end;
TArcIWRGButton = class(TIWButton, IIWSubmitInvisible)
private
Region : TIWGridRegion;
Grid : TArcIWRegionGrid;
FMoveDataset: boolean;
protected
procedure DoClick; override;
public
constructor Create(AOwner: TComponent); override;
published
property MoveDataset : boolean read FMoveDataset write FMoveDataset;
end;
implementation
{ TArcIWRGButton }
constructor TArcIWRGButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);// This is dangerous I know but needs to happen to fix "Cannot find submit component"...
if (not (csDesigning in ComponentState)) and
(AOwner is TIWGridRegion) then
begin
Region := TIWGridRegion(AOwner);
Grid := Region.Grid;
end else
begin
Region := nil;
Grid := nil;
end;
end;
procedure TArcIWRGButton.DoClick;
begin
if Region <> nil then
begin
if FMoveDataset and (Grid.DataSource.DataSet.Bookmark <> Region.Bookmark) then
Grid.DataSource.DataSet.Bookmark := Region.Bookmark;
end;
inherited;
end;
{ TArcIWRGLink }
constructor TArcIWRGLink.Create(AOwner: TComponent);
begin
inherited Create(AOwner);// This is dangerous I know but needs to happen to fix "Cannot find submit component"...
if (not (csDesigning in ComponentState)) and
(AOwner is TIWGridRegion) then
begin
Region := TIWGridRegion(AOwner);
Grid := Region.Grid;
end else
begin
Region := nil;
Grid := nil;
end;
end;
procedure TArcIWRGLink.DoClick;
begin
if Region <> nil then
begin
if FMoveDataset and (Grid.DataSource.DataSet.Bookmark <> Region.Bookmark) then
Grid.DataSource.DataSet.Bookmark := Region.Bookmark;
end;
inherited;
end;
{ TArcIWRGImage }
constructor TArcIWRGImage.Create(AOwner: TComponent);
begin
inherited Create(AOwner);// This is dangerous I know but needs to happen to fix "Cannot find submit component"...
if (not (csDesigning in ComponentState)) and
(AOwner is TIWGridRegion) then
begin
Region := TIWGridRegion(AOwner);
Grid := Region.Grid;
end else
begin
Region := nil;
Grid := nil;
end;
end;
procedure TArcIWRGImage.DoClick;
begin
if Region <> nil then
begin
if FMoveDataset and (Grid.DataSource.DataSet.Bookmark <> Region.Bookmark) then
Grid.DataSource.DataSet.Bookmark := Region.Bookmark;
end;
inherited;
end;
{ TArcIWRGImageFile }
constructor TArcIWRGImageFile.Create(AOwner: TComponent);
begin
inherited Create(AOwner);// This is dangerous I know but needs to happen to fix "Cannot find submit component"...
if (not (csDesigning in ComponentState)) and
(AOwner is TIWGridRegion) then
begin
Region := TIWGridRegion(AOwner);
Grid := Region.Grid;
end else
begin
Region := nil;
Grid := nil;
end;
end;
procedure TArcIWRGImageFile.DoClick;
begin
if Region <> nil then
begin
if FMoveDataset and (Grid.DataSource.DataSet.Bookmark <> Region.Bookmark) then
Grid.DataSource.DataSet.Bookmark := Region.Bookmark;
end;
inherited;
end;
end.
| 29.924171 | 116 | 0.696389 |
4712bf2fedbda3d6c5d33201631702d620368685 | 5,264 | pas | Pascal | data/pascal/f34f0227cd5d1cfbf3242b84d9204ce8_DATableEditor.pas | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
]
| 5 | 2018-01-03T06:43:07.000Z | 2020-07-30T13:15:29.000Z | data/pascal/f34f0227cd5d1cfbf3242b84d9204ce8_DATableEditor.pas | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
]
| null | null | null | data/pascal/f34f0227cd5d1cfbf3242b84d9204ce8_DATableEditor.pas | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
]
| 2 | 2019-11-04T02:54:49.000Z | 2020-04-24T17:50:46.000Z |
//////////////////////////////////////////////////
// Data Access Components
// Copyright 1998-2005 Core Lab. All right reserved.
// Table Editor
//////////////////////////////////////////////////
{$IFNDEF CLR}
{$I Dac.inc}
unit DATableEditor;
{$ENDIF}
interface
uses
{$IFDEF MSWINDOWS}
Windows, Messages, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, ExtCtrls, Buttons,
{$ENDIF}
{$IFDEF LINUX}
Types, QGraphics, QControls, QForms, QDialogs, QStdCtrls,
QExtCtrls, QComCtrls, QButtons,
{$ENDIF}
SysUtils, DB, Classes,
DBAccess, MemUtils, CREditor;
type
TDATableEditorForm = class(TCREditorForm)
Label2: TLabel;
Label4: TLabel;
Label1: TLabel;
edFilter: TEdit;
meSQL: TMemo;
cbTableName: TComboBox;
edOrderFields: TEdit;
Panel1: TPanel;
btnDataEditor: TBitBtn;
procedure cbTableNameDropDown(Sender: TObject);
procedure cbTableNameExit(Sender: TObject);
procedure edOrderFieldsExit(Sender: TObject);
procedure edFilterExit(Sender: TObject);
procedure btnDataEditorClick(Sender: TObject);
protected
FListGot: boolean;
FLocalTable, FTable: TCustomDADataSet;
procedure DoInit; override;
procedure DoFinish; override;
procedure DoSave; override;
procedure InitSQL;
function GetComponent: TComponent; override;
procedure SetComponent(Value: TComponent); override;
function GetLocalComponent: TComponent; override;
procedure GetTableNames(Connection: TCustomDAConnection; Items: TStrings); virtual;
public
property Table: TCustomDADataSet read FTable write FTable;
end;
implementation
uses
DADesignUtils, DADataEditor;
{$IFDEF IDE}
{$R *.dfm}
{$ENDIF}
{$IFDEF MSWINDOWS}
{$R DATableEditor.dfm}
{$ENDIF}
{$IFDEF LINUX}
{$R *.xfm}
{$ENDIF}
procedure TDATableEditorForm.DoInit;
begin
inherited;
FLocalTable := TComponentClass(Table.ClassType).Create(nil) as TCustomDADataSet;
FLocalTable.Assign(Table);
TDBAccessUtils.SetDesignCreate(FLocalTable, True);
InitSQL;
FListGot := False;
{$IFDEF LINUX}
cbTableName.Items.Text := ' '; // bug in TComboBox
meSQL.Height := meSQL.Parent.ClientHeight - meSQL.Top - cbTableName.Top;
{$ENDIF}
cbTableName.Text := FDADesignUtilsClass.GetTableName(FLocalTable);
edFilter.Text := FLocalTable.FilterSQL;
edOrderFields.Text := FDADesignUtilsClass.GetOrderFields(FLocalTable);
end;
procedure TDATableEditorForm.DoFinish;
begin
FLocalTable.Free;
FLocalTable := nil;
inherited;
end;
procedure TDATableEditorForm.DoSave;
var
OldActive: boolean;
OldDebug: boolean;
begin
OldActive := Table.Active;
OldDebug := Table.Debug;
try
Table.Assign(FLocalTable);
inherited;
Table.Debug := False;
try
Table.Active := OldActive;
except
end;
finally
Table.Debug := OldDebug;
end;
end;
procedure TDATableEditorForm.InitSQL;
begin
meSQL.Lines.Text := '';
try
if FDADesignUtilsClass.GetTableName(FLocalTable) <> '' then begin
FDADesignUtilsClass.PrepareSQL(FLocalTable);
meSQL.Lines.Text := FLocalTable.FinalSQL;
end;
except
on E: Exception do
if not (E is EOutOfResources) then
raise; // TMemo bug (see TMemoStrings.Insert)
end;
end;
procedure TDATableEditorForm.GetTableNames(Connection: TCustomDAConnection;
Items: TStrings);
begin
Connection.GetTableNames(Items);
end;
procedure TDATableEditorForm.cbTableNameDropDown(Sender: TObject);
var
UsedConnection: TCustomDAConnection;
begin
UsedConnection := TDBAccessUtils.UsedConnection(Table);
if TDBAccessUtils.UsedConnection(Table) = nil then
Exit;
try
if not FListGot then begin
GetTableNames(UsedConnection, cbTableName.Items);
FListGot := True;
end;
except
Application.HandleException(Self);
end;
end;
procedure TDATableEditorForm.cbTableNameExit(Sender: TObject);
var
s: string;
begin
try
s := TDBAccessUtils.UnQuoteName(FLocalTable, Trim(cbTableName.Text));
if s <> FDADesignUtilsClass.GetTableName(FLocalTable) then begin
FDADesignUtilsClass.SetTableName(FLocalTable, cbTableName.Text);
InitSQL;
Modified:= True;
end;
except
cbTableName.SetFocus;
raise;
end;
end;
procedure TDATableEditorForm.edOrderFieldsExit(Sender: TObject);
begin
if edOrderFields.Text <> FDADesignUtilsClass.GetOrderFields(FLocalTable) then begin
FDADesignUtilsClass.SetOrderFields(FLocalTable, edOrderFields.Text);
InitSQL;
Modified:= True;
end;
end;
procedure TDATableEditorForm.edFilterExit(Sender: TObject);
begin
if edFilter.Text <> FLocalTable.FilterSQL then begin
FLocalTable.FilterSQL:= edFilter.Text;
InitSQL;
Modified:= True;
end;
end;
function TDATableEditorForm.GetComponent: TComponent;
begin
Result := Table;
end;
procedure TDATableEditorForm.SetComponent(Value: TComponent);
begin
Table := Value as TCustomDADataSet;
end;
function TDATableEditorForm.GetLocalComponent: TComponent;
begin
Result := FLocalTable;
end;
procedure TDATableEditorForm.btnDataEditorClick(Sender: TObject);
begin
inherited;
SaveControlData;
DoSave;
with TDADataEditorForm.Create(nil, FDADesignUtilsClass) do
try
Component := Self.FLocalTable;
ShowModal;
finally
Free;
end;
end;
end.
| 22.689655 | 87 | 0.721125 |
4752de5a534a8a14d7346070d580972b43963c9e | 1,035 | dpr | Pascal | JCompare.dpr | sunhyung/JCompare | db5094d47eef1ddfa41c6953af0bcfecd88e1157 | [
"MIT"
]
| 1 | 2020-06-30T07:02:29.000Z | 2020-06-30T07:02:29.000Z | JCompare.dpr | sunhyung/JCompare | db5094d47eef1ddfa41c6953af0bcfecd88e1157 | [
"MIT"
]
| null | null | null | JCompare.dpr | sunhyung/JCompare | db5094d47eef1ddfa41c6953af0bcfecd88e1157 | [
"MIT"
]
| null | null | null | program JCompare;
uses
Forms,
Controls,
UMain in 'UMain.pas' {frmMain},
UFileCompare in 'UFileCompare.pas',
UCRC32 in 'UCRC32.pas',
UFindText in 'UFindText.pas' {frmFindText},
UFileOpen in 'UFileOpen.pas' {frmFileOpen},
UTextFile in 'UTextFile.pas',
DiffEdit in 'EditControl\DiffEdit.pas',
UProcessDlg in 'UProcessDlg.pas' {frmProcess};
{$R *.res}
var
fileName1, fileName2 : string;
isIgnoreCase, isIgnoreWhiteSpace : Boolean;
begin
Application.Initialize;
frmFileOpen := TfrmFileOpen.Create(Application);
if frmFileOpen.ShowModal = mrCancel then
begin
exit;
end;
fileName1 := frmFileOpen.GetFileName1;
fileName2 := frmFileOpen.GetFileName2;
isIgnoreCase := frmFileOpen.IsIgnoreCase;
isIgnoreWhiteSpace := frmFileOpen.IsIgnoreWhiteSpace;
frmFileOpen.Free;
Application.Title := 'JCompare';
Application.CreateForm(TfrmMain, frmMain);
frmMain.StartCompareFile(fileName1, fileName2, isIgnoreCase, isIgnoreWhiteSpace);
Application.Run;
end.
| 26.538462 | 84 | 0.723671 |
f15d2aba79b0a4012d535ca73335129c53504530 | 2,104 | pas | Pascal | source/ALZLibEx.pas | juliomar/alcinoe | 4e59270f6a9258beed02676c698829e83e636b51 | [
"Apache-2.0"
]
| 851 | 2018-02-05T09:54:56.000Z | 2022-03-24T23:13:10.000Z | source/ALZLibEx.pas | jonahzheng/alcinoe | be21f1d6b9e22aa3d75faed4027097c1f444ee6f | [
"Apache-2.0"
]
| 200 | 2018-02-06T18:52:39.000Z | 2022-03-24T19:59:14.000Z | source/ALZLibEx.pas | jonahzheng/alcinoe | be21f1d6b9e22aa3d75faed4027097c1f444ee6f | [
"Apache-2.0"
]
| 197 | 2018-03-20T20:49:55.000Z | 2022-03-21T17:38:14.000Z | unit ALZLibEx;
interface
uses
system.classes,
ZLibEx;
Function ALZInflate4Browser(const s: AnsiString): AnsiString;
Function ALZDeflate4Browser(const s: AnsiString): AnsiString;
function ALZCompressStr(const s: AnsiString; level: TZCompressionLevel = zcDefault): AnsiString; inline;
function ALZDecompressStr(const s: AnsiString): AnsiString; inline;
procedure ALZCompressStream(inStream, outStream: TStream; level: TZCompressionLevel = zcDefault); inline;
procedure ALZDecompressStream(inStream, outStream: TStream); inline;
implementation
{************************************************************}
Function ALZDeflate4Browser(const s: AnsiString): AnsiString;
var buffer: Pointer;
size : Integer;
begin
ZCompress2(PAnsiChar(s),Length(s),buffer,size,zcFastest,-15,9,zsDefault);
SetLength(result,size);
Move(buffer^,result[1],size);
FreeMem(buffer);
end;
{************************************************************}
Function ALZInflate4Browser(const s: AnsiString): AnsiString;
var buffer: Pointer;
size : Integer;
begin
ZDecompress2(PAnsiChar(s),Length(s),buffer,size,-15);
SetLength(result,size);
Move(buffer^,result[1],size);
FreeMem(buffer);
end;
{**********************************************************************************************}
function ALZCompressStr(const s: AnsiString; level: TZCompressionLevel = zcDefault): AnsiString;
Begin
Result := ZCompressStr(s,level);
end;
{*********************************************************}
function ALZDecompressStr(const s: AnsiString): AnsiString;
begin
Result := ZDecompressStr(s);
end;
{***********************************************************************************************}
procedure ALZCompressStream(inStream, outStream: TStream; level: TZCompressionLevel = zcDefault);
begin
ZCompressStream(inStream, outStream, level);
end;
{**********************************************************}
procedure ALZDecompressStream(inStream, outStream: TStream);
begin
ZDecompressStream(inStream, outStream);
end;
end.
| 32.369231 | 106 | 0.591255 |
fc0aa552015fc013c580213b4286329a14e6d337 | 3,513 | pas | Pascal | Unit2.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | Unit2.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | Unit2.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm2 = class(TForm)
T1: TLabel;
Shape14: TShape;
PSV1: TLabel;
PSV2: TLabel;
T2: TLabel;
T3: TLabel;
T4: TLabel;
T5: TLabel;
T6: TLabel;
T12: TLabel;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
SFuse2: TShape;
SFuse3: TShape;
SFuse4: TShape;
SFuse5: TShape;
SFuse1: TShape;
SFuse6: TShape;
SFuse7: TShape;
SFuse8: TShape;
SFuse9: TShape;
Label222: TLabel;
MswProgress: TLabel;
MswStatus: TLabel;
MswCtrl: TLabel;
T7: TLabel;
T8: TLabel;
H8Label: TLabel;
H7Label: TLabel;
HCurrent1: TLabel;
Label41: TLabel;
H1Label: TLabel;
H2Label: TLabel;
H3Label: TLabel;
H4Label: TLabel;
H5Label: TLabel;
H6Label: TLabel;
MswCtrlLabel: TLabel;
MswStatusLabel: TLabel;
MswProgressLabel: TLabel;
Label7: TLabel;
R1SetLabel: TLabel;
P8: TLabel;
P9Label: TLabel;
P8Label: TLabel;
P9: TLabel;
P12Label: TLabel;
P12: TLabel;
P13Label: TLabel;
P13: TLabel;
R1Get: TLabel;
R1GetLabel: TLabel;
P10Label: TLabel;
P10: TLabel;
P11Label: TLabel;
P11: TLabel;
MFC1Label: TLabel;
MFC1: TLabel;
Label51: TLabel;
MFC1SetLabel: TLabel;
MFC1P: TLabel;
MFC1T: TLabel;
MFC1SP: TLabel;
MFC1GasCode: TLabel;
MFC2Label: TLabel;
MFC2: TLabel;
MFC2SetLabel: TLabel;
MFC2P: TLabel;
MFC2T: TLabel;
MFC2SP: TLabel;
MFC2GasCode: TLabel;
MFC3Label: TLabel;
MFC3: TLabel;
MFC3SetLabel: TLabel;
MFC3P: TLabel;
MFC3T: TLabel;
MFC3SP: TLabel;
MFC3GasCode: TLabel;
MFC4Label: TLabel;
MFC4: TLabel;
MFC4SetLabel: TLabel;
MFC4P: TLabel;
MFC4T: TLabel;
MFC4SP: TLabel;
MFC4GasCode: TLabel;
MFC5Label: TLabel;
MFC5: TLabel;
MFC5SetLabel: TLabel;
MFC5P: TLabel;
MFC5T: TLabel;
MFC5SP: TLabel;
MFC5GasCode: TLabel;
MFC6Label: TLabel;
MFC6: TLabel;
MFC6SetLabel: TLabel;
MFC6P: TLabel;
MFC6T: TLabel;
MFC6SP: TLabel;
MFC6GasCode: TLabel;
H1Pwm: TLabel;
H2Pwm: TLabel;
H3Pwm: TLabel;
H4Pwm: TLabel;
H5Pwm: TLabel;
H6Pwm: TLabel;
H7Pwm: TLabel;
H8Pwm: TLabel;
T14: TLabel;
T16: TLabel;
T17: TLabel;
HCurrent2: TLabel;
HCurrent3: TLabel;
PSV3: TLabel;
SFuse11: TShape;
SFuse12: TShape;
SFuse13: TShape;
SFuse14: TShape;
SFuse10: TShape;
SFuse15: TShape;
SFuse16: TShape;
SFuse17: TShape;
SFuse18: TShape;
TSSR: TLabel;
TCJC: TLabel;
SFuse19: TShape;
T9: TLabel;
T10: TLabel;
T11: TLabel;
T21: TLabel;
H9Label: TLabel;
H10Label: TLabel;
H11Label: TLabel;
H9Pwm: TLabel;
H10Pwm: TLabel;
H11Pwm: TLabel;
T23: TLabel;
T26: TLabel;
T13: TLabel;
T15: TLabel;
T18: TLabel;
T19: TLabel;
T20: TLabel;
T22: TLabel;
T25: TLabel;
T24: TLabel;
W1SetLabel: TLabel;
W1RPM: TLabel;
MixCoolSetLabel: TLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.
| 20.074286 | 77 | 0.582124 |
6aa5cb6c0e819dbac7002f5c7e8e738bbd14154a | 2,769 | pas | Pascal | src/Core/Core.JWT.Signature.pas | luisnt/horse-jwt | ea6ab0649f9a85ad3a5517744bc21eff41230ea3 | [
"MIT"
]
| null | null | null | src/Core/Core.JWT.Signature.pas | luisnt/horse-jwt | ea6ab0649f9a85ad3a5517744bc21eff41230ea3 | [
"MIT"
]
| 1 | 2021-02-15T19:12:36.000Z | 2021-02-17T20:02:19.000Z | src/Core/Core.JWT.Signature.pas | luisnt/horse-jwt | ea6ab0649f9a85ad3a5517744bc21eff41230ea3 | [
"MIT"
]
| null | null | null | unit Core.JWT.Signature;
interface
uses
System.Classes, System.TypInfo, System.NetEncoding, System.Hash, System.SysUtils
, Core.JWT.Utils
, Core.JWT.Interfaces
, Core.JWT.Signature.Interfaces
;
type
TSignature = class(TInterfacedObject, iSignature)
class function New(const aJWT: iJWT): iSignature;
constructor Create(const aJWT: iJWT);
destructor Destroy; override;
strict private
FJWT: iJWT;
procedure loadAlgorithm(const aHeader: string);
function Sign(const aData: string): string; overload;
private
public
function Sign: string; overload;
function Verify: boolean;
end;
implementation
{ TSignature }
class function TSignature.New(const aJWT: iJWT): iSignature;
begin
Result := Self.Create(aJWT);
end;
constructor TSignature.Create(const aJWT: iJWT);
begin
FJWT := aJWT;
end;
destructor TSignature.Destroy;
begin
FJWT := nil;
inherited;
end;
function TSignature.Sign(const aData: string): string;
begin
if FJWT.PasswordEncoded then
Exit((TNetEncoding.Base64.EncodeBytesToString(THashSHA2.GetHMACAsBytes(
TEncoding.UTF8.GetBytes(aData),
TNetEncoding.Base64.DecodeStringToBytes(FJWT.Password),
FJWT.Header.AsAlgorithm
))).ClearLineBreak.FixBase64);
Result := (TNetEncoding.Base64.EncodeBytesToString(THashSHA2.GetHMACAsBytes(
TEncoding.UTF8.GetBytes(aData),
FJWT.Password,
FJWT.Header.AsAlgorithm)
)).ClearLineBreak.FixBase64;
end;
procedure TSignature.loadAlgorithm(const aHeader: string);
begin
if SameStr(aHeader, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9') then
begin
FJWT.Header.Algorithm(TJwtAlgorithm.HS256);
Exit;
end;
if SameStr(aHeader, 'eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9') then
begin
FJWT.Header.Algorithm(TJwtAlgorithm.HS384);
Exit;
end;
if SameStr(aHeader, 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9') then
begin
FJWT.Header.Algorithm(TJwtAlgorithm.HS512);
Exit;
end;
FJWT.Header.Algorithm(TJwtAlgorithm.HS256);
end;
{ Signature - Verify }
function TSignature.Verify: boolean;
const
INDEX_HEADER = 0;
INDEX_PAYLOAD = 1;
INDEX_SIGNATURE = 2;
begin
try
with TStringList.Create do
try
Clear;
Delimiter := DotSep[1];
StrictDelimiter := true;
DelimitedText := FJWT.Token;
loadAlgorithm(Strings[INDEX_HEADER]);
Exit(SameStr(Strings[INDEX_SIGNATURE], Sign(Strings[INDEX_HEADER] + DotSep + Strings[INDEX_PAYLOAD])));
finally
Free;
end;
except
on E: Exception do
end;
Result := false;
end;
{ Signature - Sign }
function TSignature.Sign: string;
begin
Result := FJWT.Header.AsJson(true) + DotSep + FJWT.Payload.AsJson(true);
Result := Result + DotSep + Sign(Result);
end;
end.
| 22.696721 | 111 | 0.713254 |
47f5c5fd35ed68aeb967b1e7b01f8fc8db7e8eef | 808 | pas | Pascal | contrib/gnu/gdb/dist/gdb/testsuite/gdb.pascal/stub-method.pas | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
]
| 3 | 2021-05-04T17:09:06.000Z | 2021-10-04T07:19:26.000Z | contrib/gnu/gdb/dist/gdb/testsuite/gdb.pascal/stub-method.pas | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
]
| null | null | null | contrib/gnu/gdb/dist/gdb/testsuite/gdb.pascal/stub-method.pas | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
]
| null | null | null | {
Copyright 2015-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
}
type
tobj = object
constructor create;
end;
constructor tobj.create;
begin
end;
var
t : tobj;
begin
t.create;
end.
| 23.764706 | 70 | 0.759901 |
6a06ff66081aec6c174e0015bc328493f119e665 | 12,346 | pas | Pascal | dirs/0040.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 11 | 2015-12-12T05:13:15.000Z | 2020-10-14T13:32:08.000Z | dirs/0040.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| null | null | null | dirs/0040.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 8 | 2017-05-05T05:24:01.000Z | 2021-07-03T20:30:09.000Z |
Program DIRSEL;
Uses
Crt,Dos; { ** needed for DIRSELECT functions ** }
{ ** The following Type & Var declarations are for the main program only ** }
{ ** However, the string length of the returned parameter from DIRSELECT ** }
{ ** must be a least 12 characters. ** }
Type
strtype = String[12];
Var
spec,fname : strtype;
{ ************************************************************************** }
{ ** List of Procedures/Functions needed for DIRSELECT** }
{ ** Procedure CURSOR - turns cursor on or off** }
{ ** Procedure FRAME - draws single or double frame ** }
{ ** Function ISCOLOR - returns the current video mode** }
{ ** Procedure SAVESCR- saves current video screen** }
{ ** Procedure RESTORESCR - restores old video screen ** }
{ ** Procedure SCRGET - get character/attribute ** }
{ ** Procedure SCRPUT - put character/attribute ** }
{ ** Procedure FNAMEPOS - finds proper screen position ** }
{ ** Procedure HILITE - highlights proper name** }
{ ** Function DIRSELECT - directory selector** }
{ ************************************************************************** }
Procedure CURSOR( attrib : Boolean );
Var
regs : Registers;
Begin
If NOT attrib Then { turn cursor off }
Begin
regs.ah := 1;
regs.cl := 7;
regs.ch := 32;
Intr($10,regs)
End
Else { turn cursor on }
Begin
Intr($11,regs);
regs.cx := $0607;
If regs.al AND $10 <> 0 Then regs.cx := $0B0C;
regs.ah := 1;
Intr($10,regs)
End
End;
Procedure FRAME(t,l,b,r,ftype : Integer);
Var
i : Integer;
Begin
GoToXY(l,t);
If ftype = 2 Then
Write(Chr(201))
Else
Write(Chr(218));
GoToXY(r,t);
If ftype = 2 Then
Write(Chr(187))
Else
Write(Chr(191));
GoToXY(l+1,t);
For i := 1 To (r - (l + 1)) Do
If ftype = 2 Then
Write(Chr(205))
Else
Write(Chr(196));
GoToXY(l+1,b);
For i := 1 To (r - (l + 1)) Do
If ftype = 2 Then
Write(Chr(205))
Else
Write(Chr(196));
GoToXY(l,b);
If ftype = 2 Then
Write(Chr(200))
Else
Write(Chr(192));
GoToXY(r,b);
If ftype = 2 Then
Write(Chr(188))
Else
Write(Chr(217));
For i := (t+1) To (b-1) Do
Begin
GoToXY(l,i);
If ftype = 2 Then
Write(Chr(186))
Else
Write(Chr(179))
End;
For i := (t+1) To (b-1) Do
Begin
GoToXY(r,i);
If ftype = 2 Then
Write(Chr(186))
Else
Write(Chr(179))
End
End;
Function ISCOLOR : Boolean; { returns FALSE for MONO or TRUE for COLOR }
Var
regs : Registers;
video_mode : Integer;
equ_lo : Byte;
Begin
Intr($11,regs);
video_mode := regs.al and $30;
video_mode := video_mode shr 4;
Case video_mode of
1 : ISCOLOR := FALSE; { Monochrome }
2 : ISCOLOR := TRUE{ Color }
End
End;
Procedure SAVESCR( Var screen );
Var
vidc : Byte Absolute $B800:0000;
vidm : Byte Absolute $B000:0000;
Begin
If NOT ISCOLOR Then { if MONO }
Move(vidm,screen,4000)
Else { else COLOR }
Move(vidc,screen,4000)
End;
Procedure RESTORESCR( Var screen );
Var
vidc : Byte Absolute $B800:0000;
vidm : Byte Absolute $B000:0000;
Begin
If NOT ISCOLOR Then { if MONO }
Move(screen,vidm,4000)
Else { else COLOR }
Move(screen,vidc,4000)
End;
Procedure SCRGET( Var ch,attr : Byte );
Var
regs : Registers;
Begin
regs.bh := 0;
regs.ah := 8;
Intr($10,regs);
ch := regs.al;
attr := regs.ah
End;
Procedure SCRPUT( ch,attr : Byte );
Var
regs : Registers;
Begin
regs.al := ch;
regs.bl := attr;
regs.ch := 0;
regs.cl := 1;
regs.bh := 0;
regs.ah := 9;
Intr($10,regs);
End;
Procedure FNAMEPOS(Var arypos,x,y : Integer);
{ determine position on screen of filename }
Const
FPOS1 = 2;
FPOS2 = 15;
FPOS3 = 28;
FPOS4 = 41;
FPOS5 = 54;
FPOS6 = 67;
Begin
Case arypos of
1: Begin x := FPOS1; y := 2 End;
2: Begin x := FPOS2; y := 2 End;
3: Begin x := FPOS3; y := 2 End;
4: Begin x := FPOS4; y := 2 End;
5: Begin x := FPOS5; y := 2 End;
6: Begin x := FPOS6; y := 2 End;
7: Begin x := FPOS1; y := 3 End;
8: Begin x := FPOS2; y := 3 End;
9: Begin x := FPOS3; y := 3 End;
10: Begin x := FPOS4; y := 3 End;
11: Begin x := FPOS5; y := 3 End;
12: Begin x := FPOS6; y := 3 End;
13: Begin x := FPOS1; y := 4 End;
14: Begin x := FPOS2; y := 4 End;
15: Begin x := FPOS3; y := 4 End;
16: Begin x := FPOS4; y := 4 End;
17: Begin x := FPOS5; y := 4 End;
18: Begin x := FPOS6; y := 4 End;
19: Begin x := FPOS1; y := 5 End;
20: Begin x := FPOS2; y := 5 End;
21: Begin x := FPOS3; y := 5 End;
22: Begin x := FPOS4; y := 5 End;
23: Begin x := FPOS5; y := 5 End;
24: Begin x := FPOS6; y := 5 End;
25: Begin x := FPOS1; y := 6 End;
26: Begin x := FPOS2; y := 6 End;
27: Begin x := FPOS3; y := 6 End;
28: Begin x := FPOS4; y := 6 End;
29: Begin x := FPOS5; y := 6 End;
30: Begin x := FPOS6; y := 6 End;
31: Begin x := FPOS1; y := 7 End;
32: Begin x := FPOS2; y := 7 End;
33: Begin x := FPOS3; y := 7 End;
34: Begin x := FPOS4; y := 7 End;
35: Begin x := FPOS5; y := 7 End;
36: Begin x := FPOS6; y := 7 End;
37: Begin x := FPOS1; y := 8 End;
38: Begin x := FPOS2; y := 8 End;
39: Begin x := FPOS3; y := 8 End;
40: Begin x := FPOS4; y := 8 End;
41: Begin x := FPOS5; y := 8 End;
42: Begin x := FPOS6; y := 8 End;
43: Begin x := FPOS1; y := 9 End;
44: Begin x := FPOS2; y := 9 End;
45: Begin x := FPOS3; y := 9 End;
46: Begin x := FPOS4; y := 9 End;
47: Begin x := FPOS5; y := 9 End;
48: Begin x := FPOS6; y := 9 End;
49: Begin x := FPOS1; y := 10 End;
50: Begin x := FPOS2; y := 10 End;
51: Begin x := FPOS3; y := 10 End;
52: Begin x := FPOS4; y := 10 End;
53: Begin x := FPOS5; y := 10 End;
54: Begin x := FPOS6; y := 10 End;
55: Begin x := FPOS1; y := 11 End;
56: Begin x := FPOS2; y := 11 End;
57: Begin x := FPOS3; y := 11 End;
58: Begin x := FPOS4; y := 11 End;
59: Begin x := FPOS5; y := 11 End;
60: Begin x := FPOS6; y := 11 End;
61: Begin x := FPOS1; y := 12 End;
62: Begin x := FPOS2; y := 12 End;
63: Begin x := FPOS3; y := 12 End;
64: Begin x := FPOS4; y := 12 End;
65: Begin x := FPOS5; y := 12 End;
66: Begin x := FPOS6; y := 12 End;
67: Begin x := FPOS1; y := 13 End;
68: Begin x := FPOS2; y := 13 End;
69: Begin x := FPOS3; y := 13 End;
70: Begin x := FPOS4; y := 13 End;
71: Begin x := FPOS5; y := 13 End;
72: Begin x := FPOS6; y := 13 End;
73: Begin x := FPOS1; y := 14 End;
74: Begin x := FPOS2; y := 14 End;
75: Begin x := FPOS3; y := 14 End;
76: Begin x := FPOS4; y := 14 End;
77: Begin x := FPOS5; y := 14 End;
78: Begin x := FPOS6; y := 14 End;
79: Begin x := FPOS1; y := 15 End;
80: Begin x := FPOS2; y := 15 End;
81: Begin x := FPOS3; y := 15 End;
82: Begin x := FPOS4; y := 15 End;
83: Begin x := FPOS5; y := 15 End;
84: Begin x := FPOS6; y := 15 End;
85: Begin x := FPOS1; y := 16 End;
86: Begin x := FPOS2; y := 16 End;
87: Begin x := FPOS3; y := 16 End;
88: Begin x := FPOS4; y := 16 End;
89: Begin x := FPOS5; y := 16 End;
90: Begin x := FPOS6; y := 16 End;
91: Begin x := FPOS1; y := 17 End;
92: Begin x := FPOS2; y := 17 End;
93: Begin x := FPOS3; y := 17 End;
94: Begin x := FPOS4; y := 17 End;
95: Begin x := FPOS5; y := 17 End;
96: Begin x := FPOS6; y := 17 End;
97: Begin x := FPOS1; y := 18 End;
98: Begin x := FPOS2; y := 18 End;
99: Begin x := FPOS3; y := 18 End;
100: Begin x := FPOS4; y := 18 End;
101: Begin x := FPOS5; y := 18 End;
102: Begin x := FPOS6; y := 18 End;
103: Begin x := FPOS1; y := 19 End;
104: Begin x := FPOS2; y := 19 End;
105: Begin x := FPOS3; y := 19 End;
106: Begin x := FPOS4; y := 19 End;
107: Begin x := FPOS5; y := 19 End;
108: Begin x := FPOS6; y := 19 End;
109: Begin x := FPOS1; y := 20 End;
110: Begin x := FPOS2; y := 20 End;
111: Begin x := FPOS3; y := 20 End;
112: Begin x := FPOS4; y := 20 End;
113: Begin x := FPOS5; y := 20 End;
114: Begin x := FPOS6; y := 20 End;
115: Begin x := FPOS1; y := 21 End;
116: Begin x := FPOS2; y := 21 End;
117: Begin x := FPOS3; y := 21 End;
118: Begin x := FPOS4; y := 21 End;
119: Begin x := FPOS5; y := 21 End;
120: Begin x := FPOS6; y := 21 End
Else
Begin
x := 0;
y := 0;
End
End
End;
Procedure HILITE(old,new : Integer); { highlight a filename on the screen }
Var
i,oldx,oldy,newx,newy : Integer;
ccolor,locolor,hicolor,cchar : Byte;
Begin
FNAMEPOS(old,oldx,oldy); { get position in the array of the filename }
FNAMEPOS(new,newx,newy); { get position in the array of the filename }
For i := 0 To 11 Do
Begin
If old < 121 Then { if valid position, reverse video, old selection }
Begin
GoToXY((oldx + i),oldy);
SCRGET(cchar,ccolor);
locolor := ccolor AND $0F;
locolor := locolor shl 4;
hicolor := ccolor AND $F0;
hicolor := hicolor shr 4;
ccolor := locolor + hicolor;
SCRPUT(cchar,ccolor)
End;
GoToXY((newx + i),newy); { reverse video, new selection }
SCRGET(cchar,ccolor);
locolor := ccolor AND $0F;
locolor := locolor shl 4;
hicolor := ccolor AND $F0;
hicolor := hicolor shr 4;
ccolor := locolor + hicolor;
SCRPUT(cchar,ccolor)
End
End;
Function DIRSELECT(mask : strtype; attr : Integer) : strtype;
Const
OFF = FALSE;
ON= TRUE;
Var
i,oldcurx,oldcury,
newcurx,newcury,
oldpos,newpos,
scrrows,fncnt: Integer;
ch : Char;
dos_dir : Array[1..120] of String[12];
fileinfo : SearchRec;
screen : Array[1..4000] of Byte;
Begin
fncnt := 0;
FindFirst(mask,attr,fileinfo);
If DosError <> 0 Then { if not found, return NULL }
Begin
DIRSELECT := '';
Exit
End;
While (DosError = 0) AND (fncnt <> 120) Do { else, collect filenames }
Begin
Inc(fncnt);
dos_dir[fncnt] := fileinfo.Name;
FindNext(fileinfo)
End;
oldcurx := WhereX; { store old CURSOR position }
oldcury := WhereY;
SAVESCR(screen);
CURSOR(OFF);
scrrows := (fncnt DIV 6) + 3;
Window(1,1,80,scrrows + 1);
ClrScr;
GoToXY(1,1);
i := 1;
While (i <= fncnt) AND (i <= 120) Do { display all filenames }
Begin
FNAMEPOS(i,newcurx,newcury);
GoToXY(newcurx,newcury);
Write(dos_dir[i]);
Inc(i)
End;
FRAME(1,1,scrrows,80,1); { draw the frame }
HILITE(255,1);{ highlight the first filename }
oldpos := 1;
newpos := 1;
While TRUE Do { get keypress and do appropriate action }
Begin
ch := ReadKey;
Case ch of
#27: { Esc }
Begin
Window(1,1,80,25);
RESTORESCR(screen);
GoToXY(oldcurx,oldcury);
CURSOR(ON);
DIRSELECT := '';
Exit { return NULL }
End;
#71: { Home }{ goto first filename }
Begin
oldpos := newpos;
newpos := 1;
HILITE(oldpos,newpos)
End;
#79: { End }{ goto last filename }
Begin
oldpos := newpos;
newpos := fncnt;
HILITE(oldpos,newpos)
End;
#72: { Up }{ move up one filename }
Begin
i := newpos;
i := i - 6;
If i >= 1 Then
Begin
oldpos := newpos;
newpos := i;
HILITE(oldpos,newpos)
End
End;
#80: { Down }{ move down one filename }
Begin
i := newpos;
i := i + 6;
If i <= fncnt Then
Begin
oldpos := newpos;
newpos := i;
HILITE(oldpos,newpos)
End
End;
#75: { Left }{ move left one filename }
Begin
i := newpos;
Dec(i);
If i >= 1 Then
Begin
oldpos := newpos;
newpos := i;
HILITE(oldpos,newpos)
End
End;
#77: { Right } { move right one filename }
Begin
i := newpos;
Inc(i);
If i <= fncnt Then
Begin
oldpos := newpos;
newpos := i;
HILITE(oldpos,newpos)
End
End;
#13: { CR }
Begin
Window(1,1,80,25);
RESTORESCR(screen);
GoToXY(oldcurx,oldcury);{ return old CURSOR position }
CURSOR(ON);
DIRSELECT := dos_dir[newpos];
Exit{ return with filename }
End
End
End
End;
{ ************************************************************************** }
{ ** Main Program : NOTE that the following is a demo program only. ** }
{ **It is not needed to use the DIRSELECT function. ** }
{ ************************************************************************** }
Begin
While TRUE Do
Begin
Writeln;
Write('Enter a filespec => ');
Readln(spec);
fname := DIRSELECT(spec,0);
If Length(fname) = 0 Then
Begin
Writeln('Filespec not found.');
Halt
End;
Writeln('The file you have chosen is ',fname,'.')
End
End.
| 25.508264 | 79 | 0.55597 |
fc280f7b82907d25085d7e5f81b9051613c5c779 | 3,922 | dfm | Pascal | Production7/Bundles/clean/Bundles.dfm | kadavris/ok-sklad | f9cd84be7bf984104d9af93d83c0719f2d5668c5 | [
"MIT"
]
| 1 | 2016-04-04T18:11:56.000Z | 2016-04-04T18:11:56.000Z | Production7/Bundles/clean/Bundles.dfm | kadavris/ok-sklad | f9cd84be7bf984104d9af93d83c0719f2d5668c5 | [
"MIT"
]
| null | null | null | Production7/Bundles/clean/Bundles.dfm | kadavris/ok-sklad | f9cd84be7bf984104d9af93d83c0719f2d5668c5 | [
"MIT"
]
| 5 | 2016-02-15T02:08:05.000Z | 2021-04-05T08:57:58.000Z | inherited fmBundles: TfmBundles
Width = 677
Height = 418
inherited Splitter1: TSplitter
Width = 677
end
inherited panClient: TPanel
Width = 677
inherited ssBevel9: TssBevel
Width = 677
end
inherited ssBevel8: TssBevel
Left = 676
end
inherited ssBevel12: TssBevel
Width = 677
end
inherited pcMainList: TcxPageControl
Width = 675
inherited tsMainList: TcxTabSheet
inherited bvlMainListTop: TssBevel
Width = 675
end
inherited grdMain: TssDBGrid
Width = 675
Hint = ''
Filter.Criteria = {00000000}
end
inherited panFooter: TPanel
Width = 675
inherited ssBevel1: TssBevel
Width = 675
end
end
end
end
inherited panFilter: TPanel
Width = 677
inherited bvlTop: TssBevel
Width = 677
end
inherited bvlRight: TssBevel
Left = 676
end
inherited lStatus: TLabel
Left = 1
end
inherited btnKagent: TssSpeedButton
Left = 1
end
inherited cbChecked: TcxImageComboBox
Left = 1
end
inherited lcbKAgent: TssDBLookupCombo
Properties.Items.Strings = (
'<>')
end
end
end
inherited pcMain: TcxPageControl
Width = 677
Height = 254
inherited tsPositions: TcxTabSheet
inherited ssBevel14: TssBevel
Height = 198
end
inherited ssBevel15: TssBevel
Width = 677
end
inherited ssBevel16: TssBevel
Top = 199
Width = 677
end
inherited ssBevel17: TssBevel
Left = 676
Height = 198
end
inherited grdDet: TssDBGrid
Width = 675
Height = 198
Hint = 'WHNAME'
Filter.Criteria = {00000000}
end
inherited PanDetFooter: TPanel
Top = 200
Width = 677
inherited ssBevel4: TssBevel
Width = 677
end
end
end
inherited tsInfo: TcxTabSheet
inherited ssBevel10: TssBevel
Height = 228
end
inherited ssBevel19: TssBevel
Width = 677
end
inherited ssBevel21: TssBevel
Top = 229
Width = 677
end
inherited ssBevel22: TssBevel
Left = 676
Height = 228
end
inherited inspMain: TdxInspector
Width = 675
Height = 228
DividerPos = 237
Data = {
1A0100000700000008000000000000000500000069724E756D08000000060000
000800000069724B4167656E7408000000000000000C00000069724B4146756C
6C4E616D6508000000000000000A00000069724B414164726573730800000000
0000000900000069724B4150686F6E6508000000000000000500000069724661
780800000000000000070000006972456D61696C080000000000000005000000
6972575757080000000000000006000000697243757272080000000000000008
0000006972526561736F6E0800000000000000080000006972506572736F6E08
0000000000000008000000697253746174757308000000000000000700000069
724E6F7465730100000008000000ECEF24060800000069724B4167656E74}
end
end
inherited tsDocRel: TcxTabSheet
inherited grdDocRel: TssDBGrid
Filter.Criteria = {00000000}
end
end
end
inherited cdsMain: TssClientDataSet
ProviderName = 'pWaybill_List'
end
inherited cdsDetailFetch: TssClientDataSet
Aggregates = <
item
Active = True
Expression = 'min(msrname)'
Visible = False
end
item
Active = True
Expression = 'max(msrname)'
Visible = False
end
item
Active = True
Expression = 'sum(amount)'
Visible = False
end>
end
end
| 25.97351 | 75 | 0.59383 |
47ad8c4e2ef92003156e7056459f06020e631d50 | 462 | pas | Pascal | tests/test9.pas | nicoleajoy/Pascal-with-Haskell | 91ca222d33e0d5c19995999ccdf48f7b371189fa | [
"MIT"
]
| null | null | null | tests/test9.pas | nicoleajoy/Pascal-with-Haskell | 91ca222d33e0d5c19995999ccdf48f7b371189fa | [
"MIT"
]
| null | null | null | tests/test9.pas | nicoleajoy/Pascal-with-Haskell | 91ca222d33e0d5c19995999ccdf48f7b371189fa | [
"MIT"
]
| null | null | null | (* Output:
Enter two floats:
1.5
2.75
A: 1.5
B: 2.75
Addition (A+B): 4.25
Subtraction (A-B): -1.25
Multiplying (A*B): 4.125
Dividing (A/B): 0.5454545454545454
*)
program Test9;
var
a, b: real;
begin
writeln('Enter two floats:');
readln(a, b);
writeln('A: ', a);
writeln('B: ', b);
writeln('Addition (A+B): ', (a+b));
writeln('Subtraction (A-B): ', (a-b));
writeln('Multiplying (A*B): ', (a*b));
writeln('Dividing (A/B): ', (a/b));
end. | 17.111111 | 41 | 0.569264 |
47b54c84f4fa9342edfe6b26a2163b7fada12a16 | 1,617 | dpr | Pascal | ProjetoTeste.dpr | FranlleyGomes/TesteUnitario | d413bb709a4b746c687ae44711e05ea2f6de8cdd | [
"MIT"
]
| null | null | null | ProjetoTeste.dpr | FranlleyGomes/TesteUnitario | d413bb709a4b746c687ae44711e05ea2f6de8cdd | [
"MIT"
]
| null | null | null | ProjetoTeste.dpr | FranlleyGomes/TesteUnitario | d413bb709a4b746c687ae44711e05ea2f6de8cdd | [
"MIT"
]
| null | null | null | program ProjetoTeste;
{$IFNDEF TESTINSIGHT}
{$APPTYPE CONSOLE}
{$ENDIF}{$STRONGLINKTYPES ON}
uses
System.SysUtils,
{$IFDEF TESTINSIGHT}
TestInsight.DUnitX,
{$ENDIF }
DUnitX.Loggers.Console,
DUnitX.Loggers.Xml.NUnit,
DUnitX.TestFramework,
ProjetoTeste.Principal in 'ProjetoTeste.Principal.pas';
var
runner : ITestRunner;
results : IRunResults;
logger : ITestLogger;
nunitLogger : ITestLogger;
begin
{$IFDEF TESTINSIGHT}
TestInsight.DUnitX.RunRegisteredTests;
exit;
{$ENDIF}
try
//Check command line options, will exit if invalid
TDUnitX.CheckCommandLine;
//Create the test runner
runner := TDUnitX.CreateRunner;
//Tell the runner to use RTTI to find Fixtures
runner.UseRTTI := True;
//tell the runner how we will log things
//Log to the console window
logger := TDUnitXConsoleLogger.Create(true);
runner.AddLogger(logger);
//Generate an NUnit compatible XML File
nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
runner.AddLogger(nunitLogger);
runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
//Run tests
results := runner.Execute;
if not results.AllPassed then
System.ExitCode := EXIT_ERRORS;
{$IFNDEF CI}
//We don't want this happening when running under CI.
if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
begin
System.Write('Done.. press <Enter> key to quit.');
System.Readln;
end;
{$ENDIF}
except
on E: Exception do
System.Writeln(E.ClassName, ': ', E.Message);
end;
end.
| 26.95 | 88 | 0.705628 |
f126f48018346c9e201078960f272abf457334df | 4,257 | pas | Pascal | Sources/uRectangleParticle.pas | VincentGsell/APE | c1cc07b05a008ead95b6ee4d45c83825c1cc77d0 | [
"MIT"
]
| 14 | 2018-05-25T17:41:00.000Z | 2021-11-01T05:04:39.000Z | Sources/uRectangleParticle.pas | VincentGsell/APE | c1cc07b05a008ead95b6ee4d45c83825c1cc77d0 | [
"MIT"
]
| null | null | null | Sources/uRectangleParticle.pas | VincentGsell/APE | c1cc07b05a008ead95b6ee4d45c83825c1cc77d0 | [
"MIT"
]
| 3 | 2018-06-28T22:44:28.000Z | 2021-10-31T18:04:55.000Z | {
APE (Actionscript Physics Engine) is an AS3 open source 2D physics engine
Copyright 2006, Alec Cove
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Contact: ape@cove.org
2009.03.01 - Converted to ObjectPascal by Vincent Gsell [https://github.com/VincentGsell]
}
unit uRectangleParticle;
interface
uses uAbstractParticle, uMathUtil, uVector, uInterval, uRenderer, sysUtils;
Type
TRctTypeDouble = Array[0..1] of Double;
TRctTypeVector = Array[0..1] of TVector;
TRectangleParticle = Class(TAbstractParticle)
Private
Fextents : TRctTypeDouble;
Faxes : TRctTypeVector;
Fradian : Double;
function GetAngle: Double;
function GetHEight: Double;
function GetRadian: Double;
function GetWidth: Double;
procedure SetAngle(const Value: Double);
procedure SetAxes(const Value: Double);
procedure SetHeight(const Value: Double);
procedure SetRadian(const Value: Double);
procedure SetWidth(const Value: Double);
Public
Constructor Create(x,y,awidth,aheight, rotation : double; isFixed : Boolean; aMass : Double = 1; aElasticity : Double = 0.3; aFriction: Double = 0); reintroduce;
Procedure Init; Override;
Procedure Paint(WithRender : TAbstractRenderer); Override;
Function GetProjection(AnAxis : TVector) : TInterval;
Property Radian : Double read GetRadian Write SetRadian;
Property Angle : Double read GetAngle Write SetAngle;
Property Width : Double read GetWidth Write SetWidth;
Property Height : Double read GetHEight Write SetHeight;
Property Axes : TRctTypeVector read Faxes write FAxes;
Property Extents : TRctTypeDouble read FExtents Write FExtents;
end;
implementation
uses uAbstractItem;
{ TRectangleParticle }
constructor TRectangleParticle.Create(x, y, awidth, aheight,
rotation: double; isFixed: Boolean; aMass : Double = 1; aElasticity : Double = 0.3; aFriction: Double = 0);
begin
inherited Create(x,y,amass,aelasticity,afriction,isfixed);
FExtents[0]:=awidth/2;
FExtents[1]:=aheight/2;
Faxes[0]:=Vector(0,0);
Faxes[1]:=Vector(0,0);
Radian:=Rotation;
end;
function TRectangleParticle.GetAngle: Double;
begin
Result :=Radian * ONE_EIGHTY_OVER_PI;
end;
function TRectangleParticle.GetHEight: Double;
begin
result:= FExtents[1] * 2;
end;
function TRectangleParticle.GetProjection(AnAxis: TVector): TInterval;
var radius : Double;
c : Double;
begin
Radius := extents[0] * Abs(Dot(AnAxis, axes[0]))+
extents[1] * Abs(Dot(AnAxis, axes[1]));
c := Dot(Samp^, AnAxis);
Interval.min:=c-Radius;
Interval.max:=c+Radius;
Result:=Interval;
end;
function TRectangleParticle.GetRadian: Double;
begin
result :=FRadian;
end;
function TRectangleParticle.GetWidth: Double;
begin
Result:= Fextents[0] * 2;
end;
procedure TRectangleParticle.Init;
begin
//CleanUp;
//Paint;
end;
procedure TRectangleParticle.Paint(WithRender : TAbstractRenderer);
begin
WithRender.Rectangle(px,py,Width,Height,Angle);
end;
procedure TRectangleParticle.SetAngle(const Value: Double);
begin
Radian := Value * PI_OVER_ONE_EIGHTY;
end;
procedure TRectangleParticle.SetAxes(const Value: Double);
var s : Double;
c : Double;
begin
s:= Sin(Value);
c:= Cos(Value);
Faxes[0].x:=c;
Faxes[0].y:=s;
Faxes[1].x:=-s;
Faxes[1].y:=c;
end;
procedure TRectangleParticle.SetHeight(const Value: Double);
begin
FExtents[1] := Value /2;
end;
procedure TRectangleParticle.SetRadian(const Value: Double);
begin
FRadian := Value;
SetAxes(Value);
end;
procedure TRectangleParticle.SetWidth(const Value: Double);
begin
FExtents[0] := Value /2;
end;
end.
| 26.943038 | 165 | 0.741837 |
fc034d22c2e2688111bdc74e9409056cc2b52b0c | 5,481 | dfm | Pascal | ufrmEncryptor3Main.dfm | corneliusdavid/encryptor3 | 346bdbac1fa86ef5dada183581ce809f3c40e60e | [
"MIT"
]
| 1 | 2019-04-25T00:56:47.000Z | 2019-04-25T00:56:47.000Z | ufrmEncryptor3Main.dfm | corneliusdavid/encryptor3 | 346bdbac1fa86ef5dada183581ce809f3c40e60e | [
"MIT"
]
| null | null | null | ufrmEncryptor3Main.dfm | corneliusdavid/encryptor3 | 346bdbac1fa86ef5dada183581ce809f3c40e60e | [
"MIT"
]
| 2 | 2019-04-25T00:56:49.000Z | 2021-06-17T11:44:00.000Z | object frmEncryptor3: TfrmEncryptor3
Left = 307
Top = 245
Caption = 'The Encryptor3!'
ClientHeight = 424
ClientWidth = 519
Color = clBtnFace
Constraints.MinHeight = 350
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
Scaled = False
OnCreate = FormCreate
DesignSize = (
519
424)
PixelsPerInch = 96
TextHeight = 13
object Label4: TLabel
Left = 32
Top = 344
Width = 40
Height = 13
Anchors = [akLeft, akRight, akBottom]
Caption = '&Result:'
FocusControl = edtResultStr
end
object Label8: TLabel
Left = 32
Top = 184
Width = 39
Height = 13
Caption = '&String:'
FocusControl = edtSourceStr
end
object Label2: TLabel
Left = 32
Top = 8
Width = 456
Height = 78
Anchors = [akLeft, akTop, akRight]
AutoSize = False
Caption =
'These use TurboPack LockBox3 components found on GitHub to encry' +
'pt and decrypt strings. They are written using the simplest app' +
'roach and are intended to generate obfuscated strings of data yo' +
'u can hide in an application and decrypt at run-time.'
Font.Charset = DEFAULT_CHARSET
Font.Color = clGrayText
Font.Height = -13
Font.Name = 'Verdana'
Font.Style = []
ParentFont = False
WordWrap = True
end
object lblKey: TLabel
Left = 32
Top = 229
Width = 27
Height = 13
Caption = '&Key:'
FocusControl = edtPassphrase
end
object lblKeyLen: TLabel
Left = 32
Top = 275
Width = 69
Height = 13
Caption = 'Key Length:'
end
object edtSourceStr: TEdit
Left = 32
Top = 200
Width = 444
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 3
end
object btnDecrypt: TButton
Left = 315
Top = 296
Width = 117
Height = 35
Anchors = [akLeft, akRight, akBottom]
Caption = '&Decrypt'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 5
OnClick = btnDecryptClick
ExplicitTop = 285
end
object edtResultStr: TEdit
Left = 32
Top = 360
Width = 444
Height = 21
TabStop = False
Anchors = [akLeft, akRight, akBottom]
Color = clBtnFace
ReadOnly = True
TabOrder = 6
end
object btnCopyLBSymmetricResult: TButton
Left = 359
Top = 384
Width = 117
Height = 27
Anchors = [akLeft, akRight, akBottom]
Caption = '&Copy to Clipboard'
TabOrder = 7
OnClick = btnCopyLBSymmetricResultClick
ExplicitTop = 373
end
object btnEncrypt: TButton
Left = 93
Top = 296
Width = 117
Height = 35
Anchors = [akLeft, akRight, akBottom]
Caption = '&Encrypt'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 4
OnClick = btnEncryptClick
ExplicitTop = 285
end
object radAlgorithm: TRadioGroup
Left = 32
Top = 78
Width = 129
Height = 100
Caption = 'Encryption &Type'
ItemIndex = 3
Items.Strings = (
'DES'
'Blowfish'
'Twofish'
'Rijndael (AES)')
TabOrder = 0
OnClick = radAlgorithmClick
end
object radCipherMode: TRadioGroup
Left = 264
Top = 78
Width = 211
Height = 116
Caption = 'Chain &Mode'
ItemIndex = 0
Items.Strings = (
'CBC - Cipher Block Chaining'
'CFB - Cipher Feedback'
'CTR - Counter Mode'
'ECB - Electronic Code Book')
TabOrder = 1
end
object radAESKeySize: TRadioGroup
Left = 167
Top = 78
Width = 91
Height = 83
Caption = 'AES Key Size'
ItemIndex = 2
Items.Strings = (
'128'
'192'
'256')
TabOrder = 2
end
object btnAbout: TButton
Left = 32
Top = 386
Width = 83
Height = 27
Anchors = [akLeft, akRight, akBottom]
Caption = '&About ...'
TabOrder = 8
OnClick = btnAboutClick
end
object edtPassphrase: TEdit
Left = 32
Top = 248
Width = 266
Height = 21
TabOrder = 9
OnChange = edtPassphraseChange
end
object dlgAbout: TTaskDialog
Buttons = <>
Caption = 'About this Program'
ExpandButtonCaption = 'GitHub'
ExpandedText =
'https://github.com/corneliusdavid/encryptor https://github.com/c' +
'orneliusdavid/encryptor3 https://github.com/TurboPack/LockBox3'
RadioButtons = <>
Text =
'This program originally started as "Encryptor" and used Turbo Po' +
'wer'#39's Lockbox 2.x. Encryptor3 now uses LockBox 3.x. The first ve' +
'rsion tested is Delphi 10.1 Berlin but could quite easily be com' +
'piled in earlier versions.'
Left = 392
Top = 208
end
object lbCodec: TCodec
AsymetricKeySizeInBits = 0
AdvancedOptions2 = []
CryptoLibrary = CryptoLib
Left = 216
Top = 192
StreamCipherId = 'native.StreamToBlock'
BlockCipherId = 'native.AES-128'
ChainId = 'native.CBC'
end
object CryptoLib: TCryptographicLibrary
Left = 256
Top = 208
end
object dlgAESKeySizeErr: TTaskDialog
Buttons = <>
Caption = 'Invalid AES Key Size'
RadioButtons = <>
Text = 'For AES, the length of the key string must be:'
Left = 440
Top = 224
end
end
| 23.029412 | 78 | 0.622697 |
4746da63e0be19367f8423c8fb713b42ac97d35b | 51 | pas | Pascal | src/crt.pas | Dennis1000/VACS | 1897d88e205117a08d36e13766e1d89bd3426894 | [
"MIT"
]
| 1 | 2021-04-07T13:48:06.000Z | 2021-04-07T13:48:06.000Z | src/crt.pas | Dennis1000/VACS | 1897d88e205117a08d36e13766e1d89bd3426894 | [
"MIT"
]
| null | null | null | src/crt.pas | Dennis1000/VACS | 1897d88e205117a08d36e13766e1d89bd3426894 | [
"MIT"
]
| 1 | 2021-12-01T08:34:35.000Z | 2021-12-01T08:34:35.000Z | unit crt;
interface
implementation
begin
end.
| 4.636364 | 14 | 0.745098 |
47e595925f972985d7741685e5e25569f3bbbbd6 | 4,500 | pas | Pascal | MVConversion.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | MVConversion.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | MVConversion.pas | mickyvac/fc-measure | 0b6db36af01f25479a956138cfceddd02a88d14d | [
"MIT"
]
| null | null | null | {
MVconversion.pas
Copyright 2016 Michal Vaclavu <michal.vaclavu@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
}
unit MVconversion;
interface
uses Classes, DateUtils, SysUtils, MyUtils;
function MyStrToFloatDef(s: string; def: double): double; //accepts both decimal . and , !!!! not dependent on system locale settings
function MyStrToFloat(s: string): double;
function MyXStrToInt( val: string): longint;
function MVIntToStr(i: longint): string;
function MVIntToBool(i: longint): boolean;
function MVStrToInt(s: string): longint;
function MVStrToFloat(s: string): double;
function MVStrToBool(s: string): boolean;
function MVFloatToInt(d: double): longint;
function MVFloatToStr(d: double): string;
function MVFloatToBool(d: double): boolean;
function MVBoolToInt(b: boolean): longint;
function MVBoolToStr(b: boolean): string;
Var
_DefaultFormatSettings, _fsDot, _fsComma : TFormatSettings;
_FloatToBoolEpsilon: double = 1e-6;
_DefStrToIntVal: longint = 0; //High(longint);
implementation
Uses Math, StrUtils;
function MyStrToFloatDef(s: string; def: double): double; //accepts both decimal . and , !!!! not dependent on system locale settings
Var
f1, f2, f3: Extended;
b1, b2, b3: boolean;
begin
//first try convert with locale set to ".", if fails, then try convert with ","
Result := def;//Result := NAN;
b1 := false;
b2 := false;
b3 := false;
//try
//texttofloat should not thorw any exception!!!!
b1 := TextToFloat(PChar(s), f1, fvExtended, _DefaultFormatSettings);
if not b1 then
begin
b2 := TextToFloat(PChar(s), f2, fvExtended, _fsDot);
if not b2 then b3 := TextToFloat(PChar(s), f3, fvExtended, _fsComma);
end;
//
if b1 then Result := f1
else if b2 then Result := f2
else if b3 then Result := f3
else Result := def;
//except on E: Exception do begin end;
//end;
end;
function MyStrToFloat(s: string): double; //accepts both decimal . and , !!!! not dependent on system locale settings
begin
Result := MyStrToFloatDef(s, NAN);
end;
function MyXStrToInt( val: string): longint;
begin
try
Result := StrToIntDef(val, _DefStrToIntVal);
except
on E: Exception do
begin
Result := _DefStrToIntVal;
end;
end;
end;
//-----------------------
function MVIntToStr(i: longint): string;
begin
Result:= IntToStr(i);
end;
function MVIntToBool(i: longint): boolean;
begin
Result := i<>0;
end;
function MVStrToInt(s: string): longint;
begin
Result:= MyXStrToInt(s);
end;
function MVStrToFloat(s: string): double;
begin
Result:= MyStrToFloatDef(s, NAN);
end;
function MVStrToBool(s: string): boolean;
Var ss: string;
begin
Result := true;
ss := Lowercase(Trim(s));
if (ss='0') or (ss='false') or (ss='null') then Result := false;
end;
function MVFloatToInt(d: double): longint;
begin
Result:= Trunc( d );
end;
function MVFloatToStr(d: double): string;
begin
Result:= FloatToStr( d );
end;
function MVFloatToBool(d: double): boolean;
begin
Result := CompareEpsilonAequalB( d, 0.0, _FloatToBoolEpsilon );
end;
function MVBoolToInt(b: boolean): longint;
begin
Result := ifthen( b, 1, 0);
end;
function MVBoolToStr(b: boolean): string;
begin
Result := IfThen( b, '1', '0');
end;
Initialization
GetLocaleFormatSettings(0, _DefaultFormatSettings);
_fsDot := _DefaultFormatSettings;
_fsDot.DecimalSeparator := '.';
_fsDot.ThousandSeparator := ',';
_fsComma := _DefaultFormatSettings;
_fsComma.DecimalSeparator := ',';
_fsComma.ThousandSeparator := '.';
END.
| 22.84264 | 134 | 0.660667 |
83fe5479d6c9be052ce05b2feee7b0f8e686f0bc | 17,285 | pas | Pascal | ZenGL/ZenGL_DX8/src/zgl_main.pas | farisss/penuhi-gizi | 9c1032aff4799dd91e7b68b0d476d1f889da6877 | [
"MIT"
]
| null | null | null | ZenGL/ZenGL_DX8/src/zgl_main.pas | farisss/penuhi-gizi | 9c1032aff4799dd91e7b68b0d476d1f889da6877 | [
"MIT"
]
| 1 | 2018-06-24T06:38:48.000Z | 2018-06-24T06:38:48.000Z | ZenGL/ZenGL_DX9/src/zgl_main.pas | farisss/penuhi-gizi | 9c1032aff4799dd91e7b68b0d476d1f889da6877 | [
"MIT"
]
| null | null | null | {
* Copyright (c) 2012 Andrey Kemka
*
* This software is provided 'as-is', without any express or
* implied warranty. In no event will the authors be held
* liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute
* it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented;
* you must not claim that you wrote the original software.
* If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but
* is not required.
*
* 2. Altered source versions must be plainly marked as such,
* and must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any
* source distribution.
}
unit zgl_main;
{$I zgl_config.cfg}
interface
uses
Windows,
zgl_types;
const
cs_ZenGL = 'ZenGL 0.3.12';
cs_Date = '2013.08.12';
cv_major = 0;
cv_minor = 3;
cv_revision = 12;
// zgl_Reg
SYS_APP_INIT = $000001;
SYS_APP_LOOP = $000002;
SYS_LOAD = $000003;
SYS_DRAW = $000004;
SYS_UPDATE = $000005;
SYS_EXIT = $000006;
SYS_ACTIVATE = $000007;
SYS_CLOSE_QUERY = $000008;
INPUT_MOUSE_MOVE = $000020;
INPUT_MOUSE_PRESS = $000021;
INPUT_MOUSE_RELEASE = $000022;
INPUT_MOUSE_WHEEL = $000023;
INPUT_KEY_PRESS = $000030;
INPUT_KEY_RELEASE = $000031;
INPUT_KEY_CHAR = $000032;
TEX_FORMAT_EXTENSION = $000100;
TEX_FORMAT_FILE_LOADER = $000101;
TEX_FORMAT_MEM_LOADER = $000102;
TEX_CURRENT_EFFECT = $000103;
SND_FORMAT_EXTENSION = $000110;
SND_FORMAT_FILE_LOADER = $000111;
SND_FORMAT_MEM_LOADER = $000112;
SND_FORMAT_DECODER = $000113;
VIDEO_FORMAT_DECODER = $000130;
// zgl_Get
ZENGL_VERSION = 1;
ZENGL_VERSION_STRING = 2;
ZENGL_VERSION_DATE = 3;
DIRECTORY_APPLICATION = 101;
DIRECTORY_HOME = 102;
LOG_FILENAME = 203;
DESKTOP_WIDTH = 300;
DESKTOP_HEIGHT = 301;
RESOLUTION_LIST = 302;
WINDOW_HANDLE = 400;
WINDOW_X = 401;
WINDOW_Y = 402;
WINDOW_WIDTH = 403;
WINDOW_HEIGHT = 404;
GAPI_DEVICE = 500;
GAPI_MAX_TEXTURE_SIZE = 501;
GAPI_MAX_TEXTURE_UNITS = 502;
GAPI_MAX_ANISOTROPY = 503;
GAPI_CAN_BLEND_SEPARATE = 504;
GAPI_CAN_AUTOGEN_MIPMAP = 505;
VIEWPORT_WIDTH = 600;
VIEWPORT_HEIGHT = 601;
VIEWPORT_OFFSET_X = 602;
VIEWPORT_OFFSET_Y = 603;
RENDER_FPS = 700;
RENDER_BATCHES_2D = 701;
RENDER_CURRENT_MODE = 702;
RENDER_CURRENT_TARGET = 703;
RENDER_VRAM_USED = 704;
MANAGER_TIMER = 800;
MANAGER_TEXTURE = 801;
MANAGER_FONT = 802;
MANAGER_RTARGET = 803;
MANAGER_SOUND = 804;
MANAGER_EMITTER2D = 805;
// zgl_Enable/zgl_Disable
COLOR_BUFFER_CLEAR = $000001;
DEPTH_BUFFER = $000002;
DEPTH_BUFFER_CLEAR = $000004;
DEPTH_MASK = $000008;
STENCIL_BUFFER_CLEAR = $000010;
CORRECT_RESOLUTION = $000020;
CORRECT_WIDTH = $000040;
CORRECT_HEIGHT = $000080;
APP_USE_AUTOPAUSE = $000100;
APP_USE_LOG = $000200;
APP_USE_ENGLISH_INPUT = $000400;
APP_USE_DT_CORRECTION = $000800;
WND_USE_AUTOCENTER = $001000;
SND_CAN_PLAY = $002000;
SND_CAN_PLAY_FILE = $004000;
CLIP_INVISIBLE = $008000;
procedure zgl_Init( FSAA : Byte = 0; StencilBits : Byte = 0 );
procedure zgl_InitToHandle( Handle : Ptr; FSAA : Byte = 0; StencilBits : Byte = 0 );
procedure zgl_Destroy;
procedure zgl_Exit;
procedure zgl_Reg( What : LongWord; UserData : Pointer );
function zgl_Get( What : LongWord ) : Ptr;
procedure zgl_GetSysDir;
procedure zgl_GetMem( out Mem : Pointer; Size : LongWord );
procedure zgl_FreeMem( var Mem : Pointer );
procedure zgl_FreeStrList( var List : zglTStringList );
procedure zgl_Enable( What : LongWord );
procedure zgl_Disable( What : LongWord );
implementation
uses
zgl_application,
zgl_screen,
zgl_window,
zgl_direct3d,
zgl_direct3d_all,
zgl_file,
zgl_timers,
zgl_log,
zgl_mouse,
zgl_keyboard,
zgl_render,
zgl_render_2d,
zgl_resources,
zgl_textures,
zgl_render_target,
zgl_font,
{$IFDEF USE_SENGINE}
zgl_sengine_2d,
{$ENDIF}
{$IFDEF USE_PARTICLES}
zgl_particles_2d,
{$ENDIF}
{$IFDEF USE_SOUND}
zgl_sound,
{$IFDEF USE_OGG}
zgl_lib_ogg,
{$ENDIF}
{$ENDIF}
{$IFDEF USE_VIDEO}
zgl_video,
{$IFDEF USE_THEORA}
zgl_lib_theora,
{$ENDIF}
{$ENDIF}
zgl_utils;
procedure InitSoundVideo;
begin
{$IFDEF USE_OGG}
if not InitVorbis() Then
{$IFNDEF USE_OGG_STATIC}
log_Add( 'Ogg: Error while loading libraries: ' + libogg + ', ' + libvorbis + ', ' + libvorbisfile )
{$ENDIF}
else
log_Add( 'Ogg: Initialized' );
{$ENDIF}
{$IFDEF USE_THEORA}
if not InitTheora() Then
{$IFNDEF USE_THEORA_STATIC}
log_Add( 'Theora: Error while loading library: ' + libtheoradec )
{$ENDIF}
else
log_Add( 'Theora: Initialized' );
{$ENDIF}
end;
procedure zgl_Init( FSAA : Byte = 0; StencilBits : Byte = 0 );
begin
oglFSAA := FSAA;
oglStencil := StencilBits;
zgl_GetSysDir();
log_Init();
if not scr_Create() Then exit;
appInitialized := TRUE;
if wndHeight >= zgl_Get( DESKTOP_HEIGHT ) Then
wndFullScreen := TRUE;
if not wnd_Create( wndWidth, wndHeight ) Then exit;
if not d3d_Create() Then exit;
InitSoundVideo();
wnd_ShowCursor( appShowCursor );
wnd_SetCaption( wndCaption );
appWork := TRUE;
d3d_BeginScene();
app_PInit();
app_PLoop();
d3d_EndScene();
zgl_Destroy();
end;
procedure zgl_InitToHandle( Handle : Ptr; FSAA : Byte = 0; StencilBits : Byte = 0 );
begin
zgl_GetSysDir();
log_Init();
oglFSAA := FSAA;
oglStencil := StencilBits;
if not scr_Create() Then exit;
appInitedToHandle := TRUE;
wndHandle := Handle;
//wndDC := GetDC( wnd_Handle );
if not d3d_Create() Then exit;
InitSoundVideo();
wnd_ShowCursor( appShowCursor );
wnd_SetCaption( wndCaption );
appWork := TRUE;
d3d_BeginScene();
app_PInit();
app_PLoop();
d3d_EndScene();
zgl_Destroy();
end;
procedure zgl_Destroy;
var
i : Integer;
p : Pointer;
begin
if appWorkTime <> 0 Then
log_Add( 'Average FPS: ' + u_IntToStr( Round( appFPSAll / appWorkTime ) ) );
if Assigned( app_PExit ) Then
app_PExit();
res_Free();
if managerTimer.Count <> 0 Then
log_Add( 'Timers to free: ' + u_IntToStr( managerTimer.Count ) );
while managerTimer.Count > 0 do
begin
p := managerTimer.First.next;
timer_Del( zglPTimer( p ) );
end;
if managerFont.Count <> 0 Then
log_Add( 'Fonts to free: ' + u_IntToStr( managerFont.Count ) );
while managerFont.Count > 0 do
begin
p := managerFont.First.next;
font_Del( zglPFont( p ) );
end;
if managerRTarget.Count <> 0 Then
log_Add( 'Render Targets to free: ' + u_IntToStr( managerRTarget.Count ) );
while managerRTarget.Count > 0 do
begin
p := managerRTarget.First.next;
rtarget_Del( zglPRenderTarget( p ) );
end;
managerZeroTexture := nil;
if managerTexture.Count.Items <> 0 Then
log_Add( 'Textures to free: ' + u_IntToStr( managerTexture.Count.Items ) );
while managerTexture.Count.Items > 0 do
begin
p := managerTexture.First.next;
tex_Del( zglPTexture( p ) );
end;
{$IFDEF USE_SENGINE}
sengine2d_Set( nil );
sengine2d_ClearAll();
{$ENDIF}
{$IFDEF USE_PARTICLES}
if managerEmitter2D.Count <> 0 Then
log_Add( 'Emitters2D to free: ' + u_IntToStr( managerEmitter2D.Count ) );
for i := 0 to managerEmitter2D.Count - 1 do
emitter2d_Free( managerEmitter2D.List[ i ] );
SetLength( managerEmitter2D.List, 0 );
pengine2d_Set( nil );
pengine2d_ClearAll();
{$ENDIF}
{$IFDEF USE_SOUND}
snd_Free();
{$ENDIF}
{$IFDEF USE_VIDEO}
if managerVideo.Count.Items <> 0 Then
log_Add( 'Videos to free: ' + u_IntToStr( managerVideo.Count.Items ) );
while managerVideo.Count.Items > 0 do
begin
p := managerVideo.First.next;
video_Del( zglPVideoStream( p ) );
end;
{$ENDIF}
scr_Destroy();
wnd_Destroy();
d3d_Destroy();
{$IFDEF USE_OGG}
FreeVorbis();
{$ENDIF}
{$IFDEF USE_THEORA}
FreeTheora();
{$ENDIF}
appInitialized := FALSE;
log_Add( 'End' );
log_Close();
end;
procedure zgl_Exit;
begin
appWork := FALSE;
end;
procedure zgl_Reg( What : LongWord; UserData : Pointer );
var
i : Integer;
begin
case What of
// Callback
SYS_APP_INIT:
begin
app_PInit := UserData;
if not Assigned( UserData ) Then app_PInit := @app_Init;
end;
SYS_APP_LOOP:
begin
app_PLoop := UserData;
if not Assigned( UserData ) Then app_PLoop := @app_MainLoop;
end;
SYS_LOAD:
begin
app_PLoad := UserData;
end;
SYS_DRAW:
begin
app_PDraw := UserData;
end;
SYS_UPDATE:
begin
app_PUpdate := UserData;
end;
SYS_EXIT:
begin
app_PExit := UserData;
end;
SYS_ACTIVATE:
begin
app_PActivate := UserData;
end;
SYS_CLOSE_QUERY:
begin
app_PCloseQuery := UserData;
if not Assigned( app_PCloseQuery ) Then app_PCloseQuery := @app_CloseQuery;
end;
// Input events
INPUT_MOUSE_MOVE:
begin
mouse_PMove := UserData;
end;
INPUT_MOUSE_PRESS:
begin
mouse_PPress := UserData;
end;
INPUT_MOUSE_RELEASE:
begin
mouse_PRelease := UserData;
end;
INPUT_MOUSE_WHEEL:
begin
mouse_PWheel := UserData;
end;
INPUT_KEY_PRESS:
begin
key_PPress := UserData;
end;
INPUT_KEY_RELEASE:
begin
key_PRelease := UserData;
end;
INPUT_KEY_CHAR:
begin
key_PInputChar := UserData;
end;
// Textures
TEX_FORMAT_EXTENSION:
begin
SetLength( managerTexture.Formats, managerTexture.Count.Formats + 1 );
managerTexture.Formats[ managerTexture.Count.Formats ].Extension := u_StrUp( PAnsiChar( UserData ) );
end;
TEX_FORMAT_FILE_LOADER:
begin
managerTexture.Formats[ managerTexture.Count.Formats ].FileLoader := UserData;
end;
TEX_FORMAT_MEM_LOADER:
begin
managerTexture.Formats[ managerTexture.Count.Formats ].MemLoader := UserData;
INC( managerTexture.Count.Formats );
end;
TEX_CURRENT_EFFECT:
begin
tex_CalcCustomEffect := UserData;
end;
// Sound
{$IFDEF USE_SOUND}
SND_FORMAT_EXTENSION:
begin
SetLength( managerSound.Formats, managerSound.Count.Formats + 1 );
managerSound.Formats[ managerSound.Count.Formats ].Extension := u_StrUp( PAnsiChar( UserData ) );
managerSound.Formats[ managerSound.Count.Formats ].Decoder := nil;
end;
SND_FORMAT_FILE_LOADER:
begin
managerSound.Formats[ managerSound.Count.Formats ].FileLoader := UserData;
end;
SND_FORMAT_MEM_LOADER:
begin
managerSound.Formats[ managerSound.Count.Formats ].MemLoader := UserData;
INC( managerSound.Count.Formats );
end;
SND_FORMAT_DECODER:
begin
for i := 0 to managerSound.Count.Formats - 1 do
if managerSound.Formats[ i ].Extension = zglPSoundDecoder( UserData ).Ext Then
managerSound.Formats[ i ].Decoder := UserData;
end;
{$ENDIF}
// Video
{$IFDEF USE_VIDEO}
VIDEO_FORMAT_DECODER:
begin
SetLength( managerVideo.Decoders, managerVideo.Count.Decoders + 1 );
managerVideo.Decoders[ managerVideo.Count.Decoders ] := UserData;
INC( managerVideo.Count.Decoders );
end;
{$ENDIF}
end;
end;
function zgl_Get( What : LongWord ) : Ptr;
begin
Result := 0;
if ( not appGotSysDirs ) and ( ( What = DIRECTORY_APPLICATION ) or ( What = DIRECTORY_HOME ) ) Then
zgl_GetSysDir();
if ( not scrInitialized ) and ( ( What = DESKTOP_WIDTH ) or ( What = DESKTOP_HEIGHT ) or ( What = RESOLUTION_LIST ) ) Then
scr_Init();
case What of
ZENGL_VERSION: Result := cv_major shl 16 + cv_minor shl 8 + cv_revision;
ZENGL_VERSION_STRING: Result := Ptr( PAnsiChar( cs_ZenGL ) );
ZENGL_VERSION_DATE: Result := Ptr( PAnsiChar( cs_Date ) );
DIRECTORY_APPLICATION: Result := Ptr( PAnsiChar( appWorkDir ) );
DIRECTORY_HOME: Result := Ptr( PAnsiChar( appHomeDir ) );
LOG_FILENAME:
if not appWork Then
Result := Ptr( @logfile );
DESKTOP_WIDTH:
Result := scrDesktop.dmPelsWidth;
DESKTOP_HEIGHT:
Result := scrDesktop.dmPelsHeight;
RESOLUTION_LIST: Result := Ptr( @scrResList );
WINDOW_HANDLE: Result := Ptr( wndHandle );
WINDOW_X: Result := Ptr( wndX );
WINDOW_Y: Result := Ptr( wndY );
WINDOW_WIDTH: Result := Ptr( wndWidth );
WINDOW_HEIGHT: Result := Ptr( wndHeight );
GAPI_DEVICE: Result := Ptr( d3dDevice );
GAPI_MAX_TEXTURE_SIZE: Result := oglMaxTexSize;
GAPI_MAX_TEXTURE_UNITS: Result := oglMaxTexUnits;
GAPI_MAX_ANISOTROPY: Result := oglMaxAnisotropy;
GAPI_CAN_BLEND_SEPARATE: Result := Ptr( oglSeparate );
GAPI_CAN_AUTOGEN_MIPMAP: Result := Ptr( oglCanAutoMipMap );
RENDER_FPS: Result := appFPS;
RENDER_BATCHES_2D: Result := b2dBatches + 1;
RENDER_CURRENT_MODE: Result := oglMode;
RENDER_CURRENT_TARGET: Result := oglTarget;
RENDER_VRAM_USED: Result := oglVRAMUsed;
VIEWPORT_WIDTH: Result := oglWidth - scrSubCX;
VIEWPORT_HEIGHT: Result := oglHeight - scrSubCY;
VIEWPORT_OFFSET_X: Result := scrAddCX;
VIEWPORT_OFFSET_Y: Result := scrAddCY;
// Managers
MANAGER_TIMER: Result := Ptr( @managerTimer );
MANAGER_TEXTURE: Result := Ptr( @managerTexture );
MANAGER_FONT: Result := Ptr( @managerFont );
MANAGER_RTARGET: Result := Ptr( @managerRTarget );
{$IFDEF USE_SOUND}
MANAGER_SOUND: Result := Ptr( @managerSound );
{$ENDIF}
{$IFDEF USE_PARTICLES}
MANAGER_EMITTER2D: Result := Ptr( @managerEmitter2D );
{$ENDIF}
end;
end;
procedure zgl_GetSysDir;
const
APPDATA : PWideChar = 'APPDATA'; // workaround for Delphi 7
var
fn : PWideChar;
len : Integer;
begin
wndINST := GetModuleHandle( nil );
GetMem( fn, 32768 * 2 );
GetModuleFileNameW( wndINST, fn, 32768 );
len := WideCharToMultiByte( CP_UTF8, 0, fn, 32768, nil, 0, nil, nil );
SetLength( appWorkDir, len );
WideCharToMultiByte( CP_UTF8, 0, fn, 32768, @appWorkDir[ 1 ], len, nil, nil );
appWorkDir := file_GetDirectory( appWorkDir );
FreeMem( fn );
GetMem( fn, 32768 * 2 );
len := GetEnvironmentVariableW( APPDATA, fn, 32768 );
len := WideCharToMultiByte( CP_UTF8, 0, fn, len, nil, 0, nil, nil );
SetLength( appHomeDir, len + 1 );
WideCharToMultiByte( CP_UTF8, 0, fn, 32768, @appHomeDir[ 1 ], len, nil, nil );
appHomeDir[ len + 1 ] := '\';
FreeMem( fn );
end;
procedure zgl_GetMem( out Mem : Pointer; Size : LongWord );
begin
if Size > 0 Then
begin
GetMem( Mem, Size );
FillChar( Mem^, Size, 0 );
end else
Mem := nil;
end;
procedure zgl_FreeMem( var Mem : Pointer );
begin
FreeMem( Mem );
Mem := nil;
end;
procedure zgl_FreeStrList( var List : zglTStringList );
var
i : Integer;
begin
for i := 0 to List.Count - 1 do
List.Items[ i ] := '';
List.Count := 0;
SetLength( List.Items, 0 );
end;
procedure zgl_Enable( What : LongWord );
begin
appFlags := appFlags or What;
if What and DEPTH_BUFFER > 0 Then
glEnable( GL_DEPTH_TEST );
if What and DEPTH_MASK > 0 Then
glDepthMask( GL_TRUE );
if What and CORRECT_RESOLUTION > 0 Then
appFlags := appFlags or CORRECT_WIDTH or CORRECT_HEIGHT;
if What and APP_USE_AUTOPAUSE > 0 Then
appAutoPause := TRUE;
if What and APP_USE_LOG > 0 Then
appLog := TRUE;
{$IFDEF USE_SOUND}
if What and SND_CAN_PLAY > 0 Then
sndCanPlay := TRUE;
if What and SND_CAN_PLAY_FILE > 0 Then
sndCanPlayFile := TRUE;
{$ENDIF}
if What and CLIP_INVISIBLE > 0 Then
render2dClip := TRUE;
end;
procedure zgl_Disable( What : LongWord );
begin
if appFlags and What > 0 Then
appFlags := appFlags xor What;
if What and DEPTH_BUFFER > 0 Then
glDisable( GL_DEPTH_TEST );
if What and DEPTH_MASK > 0 Then
glDepthMask( GL_FALSE );
if What and CORRECT_RESOLUTION > 0 Then
begin
scrResCX := 1;
scrResCY := 1;
scrAddCX := 0;
scrAddCY := 0;
scrSubCX := 0;
scrSubCY := 0;
end;
if What and APP_USE_AUTOPAUSE > 0 Then
appAutoPause := FALSE;
if What and APP_USE_LOG > 0 Then
appLog := FALSE;
{$IFDEF USE_SOUND}
if What and SND_CAN_PLAY > 0 Then
sndCanPlay := FALSE;
if What and SND_CAN_PLAY_FILE > 0 Then
sndCanPlayFile := FALSE;
{$ENDIF}
if What and CLIP_INVISIBLE > 0 Then
render2dClip := FALSE;
end;
end.
| 25.875749 | 124 | 0.645415 |
f114aeebdadf2b833a58ff3b6441877a36bec5be | 19,445 | pas | Pascal | mp/ParseManager.pas | shaoziyang/LittleInterpretors | f0eb011dd3a0e9b82886465033fd1757bfa96f81 | [
"CC0-1.0"
]
| 1 | 2022-03-18T19:18:37.000Z | 2022-03-18T19:18:37.000Z | mp/ParseManager.pas | shaoziyang/LittleInterpreters | f0eb011dd3a0e9b82886465033fd1757bfa96f81 | [
"CC0-1.0"
]
| null | null | null | mp/ParseManager.pas | shaoziyang/LittleInterpreters | f0eb011dd3a0e9b82886465033fd1757bfa96f81 | [
"CC0-1.0"
]
| null | null | null | { *********************************************************************** }
{ }
{ ParseManager }
{ }
{ Copyright (c) 2007 Pisarev Yuriy (post@pisarev.net) }
{ }
{ *********************************************************************** }
unit ParseManager;
{$B-}
{$I Directives.inc}
interface
uses
{$IFDEF DELPHI_XE7}WinApi.Windows, {$ELSE}Windows, {$ENDIF}SysUtils, Classes, Connector,
Notifier, ParseCommon, ParseConsts, Parser, ParseTypes, TextConsts, ValueTypes;
const
DefaultEnabled = True;
DefaultMaxCount = 0;
DefaultOptimization = True;
DefaultRaiseError = True;
type
EParseManagerError = class(Exception);
TItemFlag = (ifExecuteOK, ifOptimizeOK, ifPermanentExecute, ifLock);
TItemFlags = set of TItemFlag;
PItem = ^TItem;
TItem = record
Item: TCommonItem;
Flags: TItemFlags;
end;
TStateType = (stNecessaryExecute, stPermanentExecute, stPossibleSimplify);
TParseManager = class(TPlugin)
private
FRaiseError: Boolean;
FEnabled: Boolean;
FOptimization: Boolean;
FDefaultValue: TValue;
FMaxCount: Integer;
FErrorValue: PValue;
FLock: PRTLCriticalSection;
FIndex: Integer;
FList: TStrings;
function GetConnector: TCustomConnector;
function GetCount: Integer;
function GetItem(Index: Integer): PItem;
function GetParser: TParser;
function GetState(const AItem: PItem; const StateType: TStateType): Boolean;
procedure SetConnector(const Value: TCustomConnector);
procedure SetList(const Value: TStrings);
procedure SetParser(const Value: TParser);
protected
procedure Notification(Component: TComponent; Operation: TOperation); override;
function Error(const Message: string): Exception; overload; virtual;
function Error(const Message: string; const Arguments: array of const): Exception; overload; virtual;
procedure Delete(const AItem: PItem); overload; virtual;
procedure InternalDelete(Count: Integer); virtual;
function Next: Integer; virtual;
property State[const AItem: PItem; const StateType: TStateType]: Boolean read GetState;
property Index: Integer read FIndex write FIndex;
property Lock: PRTLCriticalSection read FLock write FLock;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AssignTo(Target: TPersistent); override;
procedure AppendTo(Target: TParseManager); virtual;
procedure Notify(const NotifyType: TNotifyType; const Sender: TComponent); override;
function AssignValue(const Text, Value: string): Integer; overload; virtual;
function AssignValue(const Text: string; Value: TValue): Integer; overload; virtual;
function FindItem(const Text: string; ItemName: PString = nil): PItem; virtual;
function Compile(const Index: Integer): PItem; virtual;
function AsValue(const Text: string): TValue; overload; virtual;
function AsValue(const Index: Integer): TValue; overload; virtual;
function AsByte(const Text: string): Byte; overload; virtual;
function AsByte(const Index: Integer): Byte; overload; virtual;
function AsShortint(const Text: string): Shortint; overload; virtual;
function AsShortint(const Index: Integer): Shortint; overload; virtual;
function AsWord(const Text: string): Word; overload; virtual;
function AsWord(const Index: Integer): Word; overload; virtual;
function AsSmallint(const Text: string): Smallint; overload; virtual;
function AsSmallint(const Index: Integer): Smallint; overload; virtual;
function AsLongword(const Text: string): Longword; overload; virtual;
function AsLongword(const Index: Integer): Longword; overload; virtual;
function AsInteger(const Text: string): Integer; overload; virtual;
function AsInteger(const Index: Integer): Integer; overload; virtual;
function AsInt64(const Text: string): Int64; overload; virtual;
function AsInt64(const Index: Integer): Int64; overload; virtual;
function AsSingle(const Text: string): Single; overload; virtual;
function AsSingle(const Index: Integer): Single; overload; virtual;
function AsDouble(const Text: string): Double; overload; virtual;
function AsDouble(const Index: Integer): Double; overload; virtual;
function AsExtended(const Text: string): Extended; overload; virtual;
function AsExtended(const Index: Integer): Extended; overload; virtual;
function AsBoolean(const Text: string): Boolean; overload; virtual;
function AsBoolean(const Index: Integer): Boolean; overload; virtual;
function AsPointer(const Text: string): Pointer; overload; virtual;
function AsPointer(const Index: Integer): Pointer; overload; virtual;
function AsString(const Text: string): string; overload; virtual;
function AsString(const Index: Integer): string; overload; virtual;
procedure Optimize(const Index: Integer); overload; virtual;
procedure Optimize; overload; virtual;
procedure Clear; virtual;
procedure Delete(Count: Integer); overload; virtual;
function LoadFromFile(const FileName: string): Boolean; virtual;
procedure SaveToFile(const FileName: string); virtual;
property Parser: TParser read GetParser write SetParser;
property ErrorValue: PValue read FErrorValue write FErrorValue;
property List: TStrings read FList write SetList;
property Item[Index: Integer]: PItem read GetItem;
property Count: Integer read GetCount;
published
property Enabled: Boolean read FEnabled write FEnabled default DefaultEnabled;
property DefaultValue: TValue read FDefaultValue write FDefaultValue;
property RaiseError: Boolean read FRaiseError write FRaiseError default DefaultRaiseError;
property MaxCount: Integer read FMaxCount write FMaxCount default DefaultMaxCount;
property Optimization: Boolean read FOptimization write FOptimization default DefaultOptimization;
property Connector: TCustomConnector read GetConnector write SetConnector;
end;
procedure Register;
implementation
uses
FastList, FileUtils, IniFiles, Math, NumberConsts, ParseUtils, StrUtils, TextUtils,
ThreadUtils, Types, ValueConsts, ValueUtils;
procedure Register;
begin
RegisterComponents('Samples', [TParseManager]);
end;
{ TParseManager }
procedure TParseManager.AppendTo(Target: TParseManager);
var
I: Integer;
Item: PItem;
begin
for I := 0 to FList.Count - 1 do
if Target.FList.IndexOf(FList[I]) < 0 then
begin
if Assigned(FList.Objects[I]) then
begin
New(Item);
Item^ := PItem(FList.Objects[I])^;
end
else Item := nil;
Target.FList.AddObject(FList[I], Pointer(Item));
end;
end;
function TParseManager.AsBoolean(const Text: string): Boolean;
begin
Result := Boolean(AsByte(Text));
end;
function TParseManager.AsBoolean(const Index: Integer): Boolean;
begin
Result := Boolean(AsByte(Index));
end;
function TParseManager.AsByte(const Text: string): Byte;
begin
Result := Convert(AsValue(Text), vtByte).Unsigned8;
end;
function TParseManager.AsByte(const Index: Integer): Byte;
begin
Result := Convert(AsValue(Index), vtByte).Unsigned8;
end;
function TParseManager.AsDouble(const Text: string): Double;
begin
Result := Convert(AsValue(Text), vtDouble).Float64;
end;
function TParseManager.AsDouble(const Index: Integer): Double;
begin
Result := Convert(AsValue(Index), vtDouble).Float64;
end;
function TParseManager.AsExtended(const Text: string): Extended;
begin
Result := Convert(AsValue(Text), vtExtended).Float80;
end;
function TParseManager.AsExtended(const Index: Integer): Extended;
begin
Result := Convert(AsValue(Index), vtExtended).Float80;
end;
function TParseManager.AsInt64(const Text: string): Int64;
begin
Result := Convert(AsValue(Text), vtInt64).Signed64;
end;
function TParseManager.AsInt64(const Index: Integer): Int64;
begin
Result := Convert(AsValue(Index), vtInt64).Signed64;
end;
function TParseManager.AsInteger(const Text: string): Integer;
begin
Result := Convert(AsValue(Text), vtInteger).Signed32;
end;
function TParseManager.AsInteger(const Index: Integer): Integer;
begin
Result := Convert(AsValue(Index), vtInteger).Signed32;
end;
function TParseManager.AsLongword(const Text: string): Longword;
begin
Result := Convert(AsValue(Text), vtLongword).Unsigned32;
end;
function TParseManager.AsLongword(const Index: Integer): Longword;
begin
Result := Convert(AsValue(Index), vtLongword).Unsigned32;
end;
function TParseManager.AsPointer(const Text: string): Pointer;
begin
Result := Pointer(AsInteger(Text));
end;
function TParseManager.AsPointer(const Index: Integer): Pointer;
begin
Result := Pointer(AsInteger(Index));
end;
function TParseManager.AsShortint(const Text: string): Shortint;
begin
Result := Convert(AsValue(Text), vtShortint).Signed8;
end;
function TParseManager.AsShortint(const Index: Integer): Shortint;
begin
Result := Convert(AsValue(Index), vtShortint).Signed8;
end;
function TParseManager.AssignValue(const Text, Value: string): Integer;
var
AItem: PItem;
begin
Result := ParseCommon.IndexOf(FList, Text, False);
if Result < 0 then
Result := FList.Add(Value)
else
FList[Result] := Value;
AItem := Compile(Result);
if Assigned(AItem) then Exclude(AItem.Flags, ifExecuteOK);
end;
procedure TParseManager.AssignTo(Target: TPersistent);
var
ATarget: TParseManager absolute Target;
begin
if Target is TParseManager then
begin
ATarget.Clear;
AppendTo(ATarget);
end
else inherited;
end;
function TParseManager.AssignValue(const Text: string; Value: TValue): Integer;
var
ItemName: string;
AItem: PItem;
begin
Result := ParseCommon.IndexOf(FList, Text, False, @ItemName);
if Result < 0 then
begin
New(AItem);
Result := FList.AddObject(ItemName, Pointer(AItem));
ZeroMemory(AItem, SizeOf(TItem));
end
else AItem := Pointer(FList.Objects[Result]);
ParseCommon.AssignValue(AItem.Item, Value);
end;
function TParseManager.AsSingle(const Text: string): Single;
begin
Result := Convert(AsValue(Text), vtSingle).Float32;
end;
function TParseManager.AsSingle(const Index: Integer): Single;
begin
Result := Convert(AsValue(Index), vtSingle).Float32;
end;
function TParseManager.AsSmallint(const Text: string): Smallint;
begin
Result := Convert(AsValue(Text), vtSmallint).Signed16;
end;
function TParseManager.AsSmallint(const Index: Integer): Smallint;
begin
Result := Convert(AsValue(Index), vtSmallint).Signed16;
end;
function TParseManager.AsString(const Text: string): string;
begin
Result := ValueToText(AsValue(Text));
end;
function TParseManager.AsString(const Index: Integer): string;
begin
Result := ValueToText(AsValue(Index));
end;
function TParseManager.AsValue(const Text: string): TValue;
var
I: Integer;
Script: TScript;
begin
if FindParser then
if FEnabled and (FMaxCount > 0) then
begin
Enter(FLock^);
try
I := ParseCommon.IndexOf(FList, Text, False);
if I < 0 then
begin
if FList.Count < FMaxCount then I := FList.Add(Text)
else begin
I := Next;
FList[I] := Text;
end;
Compile(I);
end;
Result := AsValue(I);
finally
Leave(FLock^);
end;
end
else begin
Parser.StringToScript(Text, Script);
try
Result := Parser.Execute(Script)^;
finally
Script := nil;
end;
end
else Result := EmptyValue;
end;
function TParseManager.AsValue(const Index: Integer): TValue;
var
AItem: PItem;
begin
if FEnabled and FindParser then
begin
AItem := Pointer(FList.Objects[Index]);
if not Assigned(AItem) then AItem := Compile(Index);
if Assigned(AItem) then
case AItem.Item.ItemType of
itNumber: Result := AItem.Item.Value;
itScript:
begin
if State[AItem, stPermanentExecute] then Include(AItem.Flags, ifPermanentExecute);
if State[AItem, stNecessaryExecute] then
Result := Parser.Execute(AItem.Item.Script)^
else
Result := PScriptHeader(AItem.Item.Script).Value;
Include(AItem.Flags, ifExecuteOK);
end;
else
if Assigned(AItem.Item.Script) then
begin
AItem.Item.ItemType := itScript;
Result := Parser.Execute(AItem.Item.Script)^;
end
else begin
AItem.Item.ItemType := itNumber;
Result := AItem.Item.Value;
end;
end
else Result := EmptyValue;
end
else Result := AsValue(FList[Index]);
end;
function TParseManager.AsWord(const Text: string): Word;
begin
Result := Convert(AsValue(Text), vtWord).Unsigned16;
end;
function TParseManager.AsWord(const Index: Integer): Word;
begin
Result := Convert(AsValue(Index), vtWord).Unsigned16;
end;
procedure TParseManager.Clear;
begin
InternalDelete(FList.Count);
FList.Clear;
end;
function TParseManager.Compile(const Index: Integer): PItem;
var
ItemName: string;
begin
if FindParser then
begin
Delete(PItem(FList.Objects[Index]));
New(Result);
FList.Objects[Index] := Pointer(Result);
ZeroMemory(Result, SizeOf(TItem));
try
ItemName := Trim(FList[Index]);
if TrimText(ItemName, ParseCommon.Lock) then
begin
FList[Index] := ItemName;
Include(Result.Flags, ifLock);
end;
Parser.StringToScript(FList[Index], Result.Item.Script);
if FOptimization then Optimize(Index);
except
if Assigned(FErrorValue) then ParseCommon.AssignValue(Result.Item, FErrorValue^)
else begin
Delete(PItem(FList.Objects[Index]));
FList.Objects[Index] := nil;
end;
if FRaiseError then raise;
end;
end
else Result := nil;
end;
constructor TParseManager.Create(AOwner: TComponent);
begin
inherited;
New(FLock);
InitializeCriticalSection(FLock^);
FList := TFastList.Create;
TFastList(FList).IndexTypes := [ttNameValue, ttName];
FMaxCount := DefaultMaxCount;
FEnabled := DefaultEnabled;
FDefaultValue := EmptyValue;
FOptimization := DefaultOptimization;
FRaiseError := DefaultRaiseError;
end;
procedure TParseManager.Delete(Count: Integer);
var
I: Integer;
begin
if Count > FList.Count then Count := FList.Count;
InternalDelete(Count);
for I := Count - 1 downto 0 do FList.Delete(I);
end;
procedure TParseManager.Delete(const AItem: PItem);
begin
if Assigned(AItem) then
begin
AItem.Item.Script := nil;
Dispose(AItem);
end;
end;
destructor TParseManager.Destroy;
begin
Disconnect;
Clear;
FList.Free;
DeleteCriticalSection(FLock^);
Dispose(FLock);
inherited;
end;
function TParseManager.Error(const Message: string): Exception;
begin
Result := Error(Message, []);
end;
function TParseManager.Error(const Message: string; const Arguments: array of const): Exception;
begin
Result := EParseManagerError.CreateFmt(Message, Arguments);
end;
function TParseManager.FindItem(const Text: string; ItemName: PString): PItem;
var
I: Integer;
begin
I := ParseCommon.IndexOf(FList, Text, False, ItemName);
if I < 0 then
Result := nil
else
Result := Pointer(FList.Objects[I]);
end;
function TParseManager.GetConnector: TCustomConnector;
begin
Result := TCustomConnector(inherited Connector);
end;
function TParseManager.GetCount: Integer;
begin
Result := FList.Count;
end;
function TParseManager.GetItem(Index: Integer): PItem;
begin
Result := Pointer(FList.Objects[Index]);
end;
function TParseManager.GetParser: TParser;
begin
Result := TParser(inherited Parser);
end;
function TParseManager.GetState(const AItem: PItem; const StateType: TStateType): Boolean;
begin
Result := Assigned(AItem);
if Result then
case StateType of
stNecessaryExecute:
Result := not (ifExecuteOK in AItem.Flags) or (ifPermanentExecute in AItem.Flags) or (ifLock in AItem.Flags);
stPermanentExecute:
Result := FindParser and not (ifExecuteOK in AItem.Flags) and not (ifLock in AItem.Flags) and not Helper.Optimizable(AItem.Item.Script, Parser.FData);
stPossibleSimplify:
Result := not (ifLock in AItem.Flags) and Optimal(AItem.Item.Script, stScript);
end;
end;
procedure TParseManager.InternalDelete(Count: Integer);
var
I: Integer;
begin
if Count > FList.Count then Count := FList.Count;
for I := 0 to Count - 1 do
begin
Delete(PItem(FList.Objects[I]));
FList.Objects[I] := nil;
end;
end;
function TParseManager.LoadFromFile(const FileName: string): Boolean;
var
FileIndex: Integer;
S, AItem, BItem: string;
Value: TValue;
begin
Clear;
Result := FileExists(FileName);
if Result then
begin
FileIndex := CreateFile;
try
Result := OpenFile(FileName, otOpen);
if Result then
begin
Reset(Files[FileIndex]^);
while not Eof(Files[FileIndex]^) do
begin
ReadLn(Files[FileIndex]^, S);
AItem := Trim(SubText(S, Equal, AIndex, False));
BItem := Trim(SubText(S, Equal, BIndex, False));
if TryTextToValue(BItem, Value) then AssignValue(AItem, Value)
else AssignValue(AItem, BItem)
end;
end;
finally
DisposeFile(FileIndex);
end;
end;
end;
function TParseManager.Next: Integer;
begin
if FIndex >= FList.Count then FIndex := 0;
Inc(FIndex);
Result := FIndex - 1;
end;
procedure TParseManager.Notification(Component: TComponent; Operation: TOperation);
begin
inherited;
if (Component = Connector) and (Operation = opRemove) then
begin
Disconnect;
Connector := nil;
end;
end;
procedure TParseManager.Notify(const NotifyType: TNotifyType; const Sender: TComponent);
begin
inherited;
case NotifyType of
ntCompile: InternalDelete(FList.Count);
ntDisconnect: Disconnect;
end;
end;
procedure TParseManager.Optimize(const Index: Integer);
var
AItem: PItem;
begin
if FindParser then
begin
AItem := Pointer(FList.Objects[Index]);
if not Assigned(AItem) then AItem := Compile(Index);
if not (ifOptimizeOK in AItem.Flags) then
begin
Parser.Optimize(AItem.Item.Script);
if State[AItem, stPossibleSimplify] then
ParseCommon.AssignValue(AItem.Item, Parser.Execute(AItem.Item.Script)^)
else
AItem.Item.ItemType := itScript;
Include(AItem.Flags, ifOptimizeOK);
end;
end;
end;
procedure TParseManager.Optimize;
var
I: Integer;
begin
for I := 0 to FList.Count - 1 do Optimize(I);
end;
procedure TParseManager.SaveToFile(const FileName: string);
var
I: Integer;
begin
FileIndex := CreateFile;
try
if OpenFile(FileName, otRewrite) then
try
for I := 0 to FList.Count - 1 do
FileUtils.Write(FList[I] + Space + Equal + Space + ValueToText(AsValue(I)));
finally
SaveFile;
end;
finally
DisposeFile(FileIndex);
end;
end;
procedure TParseManager.SetConnector(const Value: TCustomConnector);
begin
inherited Connector := Value;
end;
procedure TParseManager.SetList(const Value: TStrings);
begin
FList.Assign(Value);
end;
procedure TParseManager.SetParser(const Value: TParser);
begin
inherited Parser := Value;
end;
end.
| 29.152924 | 158 | 0.700489 |
47ea0bb201ab030342724a1488ac49c48b2a444d | 2,843 | pas | Pascal | Codigos/untLocClientes.pas | MDsolucoesTI/AutoPerfumaria | 09519197b0efd1ccb0d63d1e8ccf2c76b9b0994c | [
"MIT"
]
| null | null | null | Codigos/untLocClientes.pas | MDsolucoesTI/AutoPerfumaria | 09519197b0efd1ccb0d63d1e8ccf2c76b9b0994c | [
"MIT"
]
| null | null | null | Codigos/untLocClientes.pas | MDsolucoesTI/AutoPerfumaria | 09519197b0efd1ccb0d63d1e8ccf2c76b9b0994c | [
"MIT"
]
| null | null | null | //////////////////////////////////////////////////////////////////////////
// Criacao...........: 10/1998
// Sistema...........: Sistema de Automação de Perfumaria
// Analistas.........: Denny Paulista Azevedo Filho
// Desenvolvedores...: Denny Paulista Azevedo Filho
// Copyright.........: Denny Paulista Azevedo Filho
//////////////////////////////////////////////////////////////////////////
unit untLocClientes;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, Grids, DBGrids;
type
TfrmLocClientes = class(TForm)
edtProcurar: TEdit;
DBGrid1: TDBGrid;
lblProcurar: TLabel;
btnOk: TBitBtn;
btnCancelar: TBitBtn;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure edtProcurarChange(Sender: TObject);
procedure btnOkClick(Sender: TObject);
procedure btnCancelarClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmLocClientes: TfrmLocClientes;
implementation
uses untDMInloco, untCadClientes, untPrincipal, untVendas;
{$R *.DFM}
procedure TfrmLocClientes.FormShow(Sender: TObject);
begin
DMInloco.tblClientes.IndexName:='Descr_Cliente';
reg:=DMInloco.tblClientes.GetBookmark;
edtProcurar.SetFocus;
end;
procedure TfrmLocClientes.FormClose(Sender: TObject;var Action: TCloseAction);
begin
if not venda then
Case frmCadClientes.rdgClassClientes.ItemIndex of
0: DMInloco.tblClientes.IndexName := '';
2: DMInloco.tblClientes.IndexName := '';
{ Fazer classificacao por profisao}
end;
DMInloco.tblClientes.FreeBookmark(reg);
Action:=caFree;
end;
procedure TfrmLocClientes.edtProcurarChange(Sender: TObject);
begin
DMInloco.tblClientes.FindNearest([edtProcurar.Text]);
end;
procedure TfrmLocClientes.btnOkClick(Sender: TObject);
var
reg:TBookMark;
begin
if Venda then
begin
reg:=DMInloco.tblCtaReceber.GetBookmark;
DMInloco.tblCtaReceber.First;
While not DMInloco.tblCtaReceber.EOF do
begin
DMInloco.tblCtaReceber.Edit;
DMInloco.tblCtaReceberCod_Cliente.Value:=
DMInloco.tblClientesCod_Cliente.Value;
DMInloco.tblCtaReceber.Post;
DMInloco.tblCtaReceber.Next;
end;
DMInloco.tblCtaReceber.GotoBookmark(reg);
DMInloco.tblCtaReceber.FreeBookmark(reg);
DMInloco.tblCtaReceber.Edit;
end
else
begin
frmCadClientes.btnPrimeiro.Enabled:=True;
frmCadClientes.btnAnterior.Enabled:=True;
frmCadClientes.btnProximo.Enabled:=True;
frmCadClientes.btnUltimo.Enabled:=True;
end;
end;
procedure TfrmLocClientes.btnCancelarClick(Sender: TObject);
begin
DMInloco.tblClientes.GotoBookmark(reg);
Close;
end;
end.
| 27.336538 | 79 | 0.682026 |
47b083d3c8477d294e872c71dbe1abcd971d16a6 | 4,273 | pas | Pascal | Engine/OS/Linux/TERRA_Gamepad.pas | maciej-izak-tests/TERRA-Engine | 7ef17e6b67968a40212fbb678135af0000246097 | [
"Apache-2.0"
]
| 1 | 2021-04-03T13:33:08.000Z | 2021-04-03T13:33:08.000Z | Engine/OS/Linux/TERRA_Gamepad.pas | maciej-izak-tests/TERRA-Engine | 7ef17e6b67968a40212fbb678135af0000246097 | [
"Apache-2.0"
]
| null | null | null | Engine/OS/Linux/TERRA_Gamepad.pas | maciej-izak-tests/TERRA-Engine | 7ef17e6b67968a40212fbb678135af0000246097 | [
"Apache-2.0"
]
| null | null | null | {***********************************************************************************************************************
*
* TERRA Game Engine
* ==========================================
*
* Copyright (C) 2003, 2014 by Sérgio Flores (relfos@gmail.com)
*
***********************************************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***********************************************************************************************************************
}
Unit TERRA_Gamepad;
//https://www.kernel.org/doc/Documentation/input/joystick-api.txt
{$I terra.inc}
Interface
Uses TERRA_Object, TERRA_InputManager;
Const
JS_EVENT_BUTTON = $01; // button pressed/released
JS_EVENT_AXIS = $02; // joystick moved
JS_EVENT_INIT = $80; // initial state of device
Type
JSEvent = Packed Record
time:Cardinal; // event timestamp in milliseconds
value:Word; //value
kind:Byte; // event type
number:Byte; // axis/button number
End;
LinuxGamepad = Class(Gamepad)
Protected
_Input:Integer;
_LastConnect:Integer;
Public
Procedure Update(Keys:InputState); Override;
Procedure Release; Override;
End;
Implementation
Uses TERRA_Utils, TERRA_OS, baseunix;
{ LinuxGamepad }
Procedure LinuxGamepad.Release;
Begin
Inherited;
If (_Input>0) Then
Begin
FpClose(_Input);
_Input := 0;
End;
End;
Procedure LinuxGamepad.Update(Keys: InputState);
Var
Event:JSEvent;
ErrorCode:Integer;
IsConnected:Boolean;
Begin
If (_Input <= 0) Then
Begin
If (_LastConnect=0) Or (Application.GetTime()-_LastConnect>=1000) Then
Begin
_Input := FpOpen('/dev/input/js'+IntegerProperty.Stringify(_DeviceID), O_RDONLY Or O_NONBLOCK);
_LastConnect := Application.GetTime();
End;
End;
IsConnected := (_Input>0);
If (Not IsConnected) Then
Begin
Self.Disconnnect();
Exit;
End;
Self.Connnect();
ErrorCode := FpRead(_Input, Event, SizeOf(Event));
If ErrorCode<=0 Then
Begin
{FpClose(_Input);
_Input := 0;}
Exit;
End;
If ((Event.Kind And JS_EVENT_INIT)<>0) Then
Begin
Event.Kind := Event.Kind Xor JS_EVENT_INIT;
End;
Case Event.Kind Of
JS_EVENT_BUTTON:
Begin
Keys.SetState(GetGamePadKeyValue(LocalID, Event.Number), (Event.Value > 0));
End;
End;
(*Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadUp_Offset), (XState.Buttons And XINPUT_GAMEPAD_DPAD_UP)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadDown_Offset), (XState.Buttons And XINPUT_GAMEPAD_DPAD_DOWN)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadLeft_Offset), (XState.Buttons And XINPUT_GAMEPAD_DPAD_LEFT)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadRight_Offset), (XState.Buttons And XINPUT_GAMEPAD_DPAD_RIGHT)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadMenu_Offset), (XState.Buttons And XINPUT_GAMEPAD_START)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadA_Offset), (XState.Buttons And XINPUT_GAMEPAD_A)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadB_Offset), (XState.Buttons And XINPUT_GAMEPAD_B)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadX_Offset), (XState.Buttons And XINPUT_GAMEPAD_X)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadY_Offset), (XState.Buttons And XINPUT_GAMEPAD_Y)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadL_Offset), (XState.Buttons And XINPUT_GAMEPAD_LEFT_SHOULDER)<>0);
Keys.SetState(GetGamePadKeyValue(LocalID, keyGamePadR_Offset), (XState.Buttons And XINPUT_GAMEPAD_RIGHT_SHOULDER)<>0);*)
End;
End.
| 32.371212 | 122 | 0.648959 |
f1a64c5eba1a4788ada3c80ee933cb76e7ed12d9 | 2,125 | pas | Pascal | TextureGen/Layer2.pas | delphi-pascal-archive/texture_gen | 10e69b80dd3b41eface20b699f03e8ad30ccf1e3 | [
"Unlicense"
]
| 1 | 2021-11-06T23:52:02.000Z | 2021-11-06T23:52:02.000Z | TextureGen/Layer2.pas | delphi-pascal-archive/texture_gen | 10e69b80dd3b41eface20b699f03e8ad30ccf1e3 | [
"Unlicense"
]
| null | null | null | TextureGen/Layer2.pas | delphi-pascal-archive/texture_gen | 10e69b80dd3b41eface20b699f03e8ad30ccf1e3 | [
"Unlicense"
]
| 1 | 2021-11-06T23:52:04.000Z | 2021-11-06T23:52:04.000Z | unit Layer2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Tex;
type
TLayer2Form = class(TForm)
procedure FormPaint(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
bitmap : TBitmap;
active : boolean;
init_dirty_flag : boolean;
procedure ReLoad;
end;
var
Layer2Form: TLayer2Form;
implementation
uses MainU;
{$R *.DFM}
procedure TLayer2Form.ReLoad; //ReSize/Draw Window
Var x,y : longint;
offset : cardinal;
p : pcardarray;
begin
if active then begin
Caption:='Layer 2 (Active Layer)';
Color:=clActiveCaption;
BringToFront;
end else begin
Caption:='Layer 2';
Color:=clInactiveCaption;
end;
bitmap.HandleType:=bmDIB; //device independent
bitmap.PixelFormat:=pf32bit; //32Bit
bitmap.width:=layer_sizex; //new BMP/Window-Dimensions
bitmap.height:=layer_sizey;
for y:=0 to layer_sizey-1 do begin
p:=bitmap.Scanline[y];
offset:=y*layer_sizex;
for x:=0 to layer_sizex-1 do
p^[x]:=layers[2][x+offset].b + layers[2][x+offset].g shl 8 + layers[2][x+offset].r shl 16;
end;
height := layer_sizey + GetSystemMetrics(SM_CYDLGFRAME) + GetSystemMetrics(SM_CYCAPTION) +9;
width := layer_sizex + GetSystemMetrics(SM_CXDLGFRAME) +9;
FormPaint(nil);
end;
procedure TLayer2Form.FormPaint(Sender: TObject);
begin
Canvas.Draw(3,3,bitmap)
end;
procedure TLayer2Form.FormCreate(Sender: TObject);
begin
bitmap := TBitmap.Create;
init_dirty_flag:=false;
end;
procedure TLayer2Form.FormClick(Sender: TObject);
begin
Main.ActiveLayerDD.ItemIndex:=2;
Main.ActiveLayerDDChange(nil);
end;
procedure TLayer2Form.FormActivate(Sender: TObject);
begin
if init_dirty_flag then begin
Main.ActiveLayerDD.ItemIndex:=2;
Main.ActiveLayerDDChange(nil);
end else init_dirty_flag:=true;
end;
end.
| 23.611111 | 97 | 0.68 |
859bffe6abd6318c8f1c220383bbb6a8c60ce6d3 | 2,481 | pas | Pascal | Version7/Source/PCElements/PCClass.pas | dss-extensions/electricdss-src | fab07b5584090556b003ef037feb25ec2de3b7c9 | [
"BSD-3-Clause"
]
| 1 | 2022-01-23T14:43:30.000Z | 2022-01-23T14:43:30.000Z | Version7/Source/PCElements/PCClass.pas | PMeira/electricdss-src | fab07b5584090556b003ef037feb25ec2de3b7c9 | [
"BSD-3-Clause"
]
| 7 | 2018-08-15T04:00:26.000Z | 2018-10-25T10:15:59.000Z | Version7/Source/PCElements/PCClass.pas | PMeira/electricdss-src | fab07b5584090556b003ef037feb25ec2de3b7c9 | [
"BSD-3-Clause"
]
| null | null | null | unit PCClass;
{$M+}
{
----------------------------------------------------------
Copyright (c) 2008-2015, Electric Power Research Institute, Inc.
All rights reserved.
----------------------------------------------------------
}
interface
uses
CktElementClass;
type
TPCClass = class(TCktElementClass)
PRIVATE
PROTECTED
function ClassEdit(const ActivePCObj: Pointer; const ParamPointer: Integer): Integer;
procedure ClassMakeLike(const OtherObj: Pointer);
procedure CountProperties; // Add no. of intrinsic properties
procedure DefineProperties; // Add Properties of this class to propName
PUBLIC
NumPCClassProps: Integer;
constructor Create;
destructor Destroy; OVERRIDE;
PUBLISHED
end;
implementation
uses
PCElement,
ParserDel,
DSSClassDefs,
DSSGlobals,
Utilities;
constructor TPCClass.Create;
begin
inherited Create;
NumPCClassProps := 1;
DSSClassType := PC_ELEMENT;
end;
destructor TPCClass.Destroy;
begin
inherited Destroy;
end;
procedure TPCClass.CountProperties;
begin
NumProperties := NumProperties + NumPCClassProps;
inherited CountProperties;
end;
procedure TPCClass.DefineProperties;
// Define the properties for the base power delivery element class
begin
PropertyName^[ActiveProperty + 1] := 'spectrum';
PropertyHelp^[ActiveProperty + 1] := 'Name of harmonic spectrum for this device.';
ActiveProperty := ActiveProperty + NumPCClassProps;
inherited DefineProperties;
end;
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function TPCClass.ClassEdit(const ActivePCObj: Pointer; const ParamPointer: Integer): Integer;
begin
Result := 0;
// continue parsing with contents of Parser
if ParamPointer > 0 then
with TPCElement(ActivePCObj) do
begin
case ParamPointer of
1:
Spectrum := Parser.StrValue;
else
inherited ClassEdit(ActivePCObj, ParamPointer - NumPCClassProps)
end;
end;
end;
procedure TPCClass.ClassMakeLike(const OtherObj: Pointer);
var
OtherPCObj: TPCElement;
begin
OtherPCObj := TPCElement(OtherObj);
with TPCElement(ActiveDSSObject) do
begin
Spectrum := OtherPCObj.Spectrum;
SpectrumObj := OtherPCObj.SpectrumObj;
end;
inherited ClassMakeLike(OtherObj);
end;
end.
| 20.504132 | 94 | 0.62636 |
fc00ff5ae95e8fd236c68897811e3b24e08a56b5 | 66,232 | pas | Pascal | Projekty/YearPlan/yearplanner.pas | jarowlod/OTIS-2 | 194b470b9d0106cd6350f10cf73f0610f7b74705 | [
"MIT"
]
| 1 | 2020-09-01T14:03:10.000Z | 2020-09-01T14:03:10.000Z | Projekty/YearPlan/yearplanner.pas | jarowlod/OTIS-2 | 194b470b9d0106cd6350f10cf73f0610f7b74705 | [
"MIT"
]
| null | null | null | Projekty/YearPlan/yearplanner.pas | jarowlod/OTIS-2 | 194b470b9d0106cd6350f10cf73f0610f7b74705 | [
"MIT"
]
| null | null | null | unit YearPlanner;
{$mode objfpc}{$H+}
{ Year Planner component written by Jonathan Hosking, May 2002.
Zmodyfikowany do Lazarusa przez Wlodarczyk Jaroslaw luty 2017
}
interface
uses
LazUTF8, Windows, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Printers, Messages, LCLIntf;
type
{ Header and footer class }
TPrintTitle = class(TPersistent)
private
fAlignment: TAlignment;
fCaption: string;
fFont: TFont;
fOnChange: TNotifyEvent;
procedure SetAlignment(Val: TAlignment);
procedure SetCaption(Val: String);
procedure SetFont(Val: TFont);
public
constructor Create(UpdateEvent: TNotifyEvent);
destructor Destroy; override;
procedure UpdateControl;
published
property Alignment: TAlignment read fAlignment write SetAlignment default taLeftJustify;
property Caption: string read fCaption write SetCaption;
property Font: TFont read fFont write SetFont;
property OnChange: TNotifyEvent read fOnChange write fOnChange;
end;
{ Printer options class }
TPrintOptions = class(TPersistent)
private
fPrinterOrientation: TPrinterOrientation;
fPrintReductionSize: Integer;
fPrinterLeftMargin, fPrinterRightMargin: Integer;
fPrinterBottomMargin, fPrinterTopMargin: Integer;
fPrintHeader: TPrintTitle;
fPrintFooter: TPrintTitle;
fPreserveAspect: Boolean;
public
constructor Create(UpdateEvent: TNotifyEvent);
destructor Destroy; override;
published
property LeftMargin: Integer read fPrinterLeftMargin write fPrinterLeftMargin default 0;
property TopMargin: Integer read fPrinterTopMargin write fPrinterTopMargin default 0;
property RightMargin: Integer read fPrinterRightMargin write fPrinterRightMargin default 0;
property BottomMargin: Integer read fPrinterBottomMargin write fPrinterBottomMargin default 0;
property Orientation: TPrinterOrientation read fPrinterOrientation write fPrinterOrientation default poLandscape;
property ReductionSize: integer read fPrintReductionSize write fPrintReductionSize default 100;
property PrintHeader: TPrintTitle read fPrintHeader write fPrintHeader;
property PrintFooter: TPrintTitle read fPrintFooter write fPrintFooter;
property PreserveAspect: Boolean read fPreserveAspect write fPreserveAspect default True;
end;
{ YearPlannner component class }
TypDOW = (ypMonday,ypTuesday,ypWednesday,ypThursday,ypFriday,ypSaturday,ypSunday);
TypSel = (ypNotSelecting,ypSelecting,ypSelected);
TypSelSty = (ypNormal,ypRectangle);
TYearEvent = procedure(StDays,EnDays,StMonth,EnMonth:integer; StartDate,EndDate: TDateTime) of object;
{ Compiling under Delphi 1 limits us to a 64KB data limit, so the record
cannot be too long. Under later versions there are bigger data limits }
TCellData = record
CellHint: String;
CellColor: TColor;
CellFont: TFont;
CustomColor: Boolean;
CustomFont: Boolean;
CellDate: TDateTime;
Selected: Boolean;
CellImage: Integer;
Tag: Longint;
end;
TCurrentDate = record
Day,Month: Byte;
end;
TDrawCalendarCell = procedure(Sender: TCustomControl; TheCanvas: TCanvas; Rect: TRect; CellData: TCellData; CellText: String) of object; // by Jaro
{ TYearPlanner }
TYearPlanner = class(TCustomControl)
private
{ Private declarations }
Cells: Array[0..37,0..12] of string[15];
fTextAlignment: TAlignment; // by Jaro
fTextLayout: TTextLayout; // by Jaro
fTodayFont: TFont;
fWeekendFont: TFont;
Heights: Array[0..12] of Integer;
Widths: Array[0..37] of Integer;
cX,cY,OldX,OldY: Integer;
InDay,InMonth: Integer;
FirstTickCount: Cardinal;
hPrinting,hUpdating,hWaiting,hWaitingToDestroy: Boolean;
hSelecting: TypSel;
HintDate: TDateTime;
HintWin: THintWindow;
PrinterPageHeight, PrinterPageWidth: Integer;
PrinterLeftMargin, PrinterTopMargin: Integer;
PrinterRightMargin, PrinterBottomMargin: Integer;
fStartDate: TDateTime;
fEndDate: TDateTime;
fAllowSelections: Boolean;
fControl: TBitmap;
fDayColor: TColor;
fDayFont: TFont;
fEndEllipsis: Boolean;
fFlatCells: Boolean;
fGridLines: Boolean;
fGridPen: TPen;
fHeadingColor: TColor;
fHintColor: TColor;
fHintFont: TFont;
fHintDelay: Integer;
fImages: TImageList;
fLongHint: Boolean;
fMonthButtons: Boolean;
fMonthColor: TColor;
fMonthFont: TFont;
fNoDayColor: TColor;
fNoDayPriority: Boolean;
fOnSelectionEnd: TNotifyEvent;
fOnYearChange: TNotifyEvent;
fOnYearChanged: TNotifyEvent;
fOnYearDblClick: TYearEvent;
fOnYearRightClick: TYearEvent;
FOnDrawCell: TDrawCalendarCell; // by Jaro
fPrintOptions: TPrintOptions;
fSelectionColor: TColor;
fSelectionFont: TFont;
fSelectionStyle: TypSelSty;
fSeperator: Boolean;
fSoftBorder: Boolean;
fShowDefaultHint: Boolean;
fShowToday: Boolean;
fStartDayOfWeek: TypDOW;
fStretchImages: Boolean;
fStringList: TStringList;
fTodayCircleColour: TColor;
fTodayCircleFilled: Boolean;
fUseBitmap: Boolean;
fUseFreeSpace: Boolean;
fWeekendColor: TColor;
fWeekendHeadingColor: TColor;
fYear: Word;
fYearColor: TColor;
fYearFont: TFont;
fYearNavigators: Boolean;
fYearNavLeft: TRect;
fYearNavRight: TRect;
function FindFirstWeek(aYear: Word): TDateTime;
function IsLeapYear(Year: Word): Boolean;
procedure ProcessSelection;
procedure CalculateCalendar;
procedure CalculateData;
procedure CalculateNavigators;
procedure CalculateSizes;
procedure CircleToday(CCanvas: TCanvas; CircleRect: TRect; const TodayText: String; InnerColor: TColor);
procedure OnGridPenChange(Sender:TObject);
procedure SetTextAlignment(AValue: TAlignment);
procedure SetTextLayout(AValue: TTextLayout);
procedure SetTodayFont(AValue: TFont);
procedure SetupHeadings;
procedure SetAllowSelections(Val: Boolean);
procedure SetDayColor(Val: TColor);
procedure SetDayFont(Val: TFont);
procedure SetEndEllipsis(Val: Boolean);
procedure SetFlatCells(Val: Boolean);
procedure SetGridLines(Val: Boolean);
procedure SetGridPen(Val: TPen);
procedure SetHeadingColor(Val: TColor);
procedure SetHintColor(Val: TColor);
procedure SetHintFont(Val: TFont);
procedure SetHintDelay(Val: Integer);
procedure SetLongHint(Val: Boolean);
procedure SetMonthButtons(Val: Boolean);
procedure SetMonthColor(Val: TColor);
procedure SetMonthFont(Val: TFont);
procedure SetNoDayColor(Val: TColor);
procedure SetNoDayPriority(Val: Boolean);
procedure SetSelectionColor(Val: TColor);
procedure SetSelectionFont(Val: TFont);
procedure SetSelectionStyle(Val: TypSelSty);
procedure SetSeperator(Val: Boolean);
procedure SetSoftBorder(Val: Boolean);
procedure SetShowDefaultHint(Val: Boolean);
procedure SetShowToday(Val: Boolean);
procedure SetStartDayOfWeek(Val: TypDOW);
procedure SetStretchImages(Val: Boolean);
procedure SetTodayCircleColour(Val: TColor);
procedure SetTodayCircleFilled(Val: Boolean);
procedure SetUseFreeSpace(Val: Boolean);
procedure SetWeekendColor(Val: TColor);
procedure SetWeekendFont(AValue: TFont);
procedure SetWeekendHeadingColor(Val: TColor);
procedure SetYear(Val: Word);
procedure SetYearColor(Val: TColor);
procedure SetYearFont(Val:TFont);
procedure SetYearNavigators(Val: Boolean);
procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message wm_EraseBkgnd;
procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message wm_LButtonDblClk;
procedure WMLButtonDown(var Message: TWMLButtonDown); message wm_LButtonDown;
procedure WMLButtonUp(var Message: TWMLButtonUp); message wm_LButtonUp;
procedure WMRButtonDown(var Message: TWMRButtonDown); message wm_RButtonDown;
procedure WMMouseMove(var Message: TWMMouseMove); message wm_MouseMove;
procedure WMSize(var Message:TWMSize); message wm_Size;
protected
{ Protected declarations }
procedure Paint; override;
public
{ Public declarations }
CellData: Array[1..12,1..31] of TCellData;
CurrentDate: TCurrentDate;
EnDay: Integer;
EnMonth: Integer;
StDay: Integer;
StMonth: Integer;
StartDate: TDateTime;
EndDate: TDateTime;
procedure XYToCell(X,Y: Integer;var CellX,CellY: Integer);
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure LoadFromFile(var fFile: File);
procedure LoadFromStream(var fStream:TStream);
procedure SaveToFile(var fFile: File);
procedure SaveToStream(var fStream:TStream);
procedure SetColorAtDate(dt: TDateTime; cellColor: TColor; UpdateControl: Boolean);
procedure SetFontAtDate(dt: TDateTime; cellFont: TFont; UpdateControl: Boolean);
procedure SetHintAtDate(dt: TDateTime; cellHint: String; UpdateControl: Boolean);
procedure SetImageAtDate(dt: TDateTime; cellImage: Integer; UpdateControl: Boolean);
function GetCellData(dt: TDateTime): TCellData;
procedure Print;
function GetStartDate: TDateTime;
function GetEndDate: TDateTime;
function IsSelected(date: TDateTime): Boolean;
procedure ClearSelection;
procedure SelectCells(sDate, eDate: TDateTime);
procedure SelectWeek(aWeek: Integer);
procedure ClearCells;
function WeekNumber(aDate: TDateTime): Integer;
published
{ Published declarations }
property Align;
property AllowSelections: Boolean read fAllowSelections write SetAllowSelections default True;
property Color;
property DayColor: TColor read fDayColor write SetDayColor default clWhite;
property DayFont:TFont read fDayFont write SetDayFont;
property DragCursor;
property DragMode;
property DrawOffScreen: Boolean read fUseBitmap write fUseBitmap default True;
property Enabled;
property EndEllipsis: Boolean read fEndEllipsis write SetEndEllipsis default False;
property FlatCells: Boolean read fFlatCells write SetFlatCells default True;
property Font;
property GridLines: Boolean read fGridLines write SetGridLines default True;
property GridPen:TPen read fGridPen write SetGridPen;
property HeadingColor: TColor read fHeadingColor write SetHeadingColor default clGray;
property HintColor: TColor read fHintColor write SetHintColor default clYellow;
property HintFont: TFont read fHintFont write SetHintFont;
property HintDelay: Integer read fHintDelay write SetHintDelay default 0;
property Images: TImageList read fImages write fImages;
property LongHint: Boolean read fLongHint write SetLongHint default True;
property MonthButtons: Boolean read fMonthButtons write SetMonthButtons default false;
property MonthColor: TColor read fMonthColor write SetMonthColor default clGray;
property MonthFont:TFont read fMonthFont write SetMonthFont;
property NoDayColor: TColor read fNoDayColor write SetNoDayColor default clSilver;
property NoDayPriority: Boolean read fNoDayPriority write SetNoDayPriority default False;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property PrintOptions : TPrintOptions read fPrintOptions write fPrintOptions;
property SelectionColor: TColor read fSelectionColor write SetSelectionColor default clBlue;
property SelectionFont: TFont read fSelectionFont write SetSelectionFont;
property SelectionStyle: TypSelSty read fSelectionStyle write SetSelectionStyle default ypNormal;
property Seperator: Boolean read fSeperator write SetSeperator default True;
property SoftBorder: Boolean read fSoftBorder write SetSoftBorder default False;
property ShowDefaultHint: Boolean read fShowDefaultHint write SetShowDefaultHint default True;
property ShowHint;
property ShowToday: Boolean read fShowToday write SetShowToday;
property StartDayOfWeek: TypDOW read fStartDayOfWeek write SetStartDayOfWeek default ypMonday;
property StretchImages: Boolean read fStretchImages write SetStretchImages default False;
property TextLayout: TTextLayout read fTextLayout write SetTextLayout default tlCenter; // by Jaro
property TextAlignment: TAlignment read fTextAlignment write SetTextAlignment default taLeftJustify; // by Jaro
property TodayCircleColour: TColor read fTodayCircleColour write SetTodayCircleColour;
property TodayCircleFilled: Boolean read fTodayCircleFilled write SetTodayCircleFilled default False;
property TodayFont: TFont read fTodayFont write SetTodayFont; // by Jaro
property UseFreeSpace: Boolean read fUseFreeSpace write SetUseFreeSpace default True;
property Visible;
property WeekendColor: TColor read fWeekendColor write SetWeekendColor default clGray;
property WeekendHeadingColor: TColor read fWeekendHeadingColor write SetWeekendHeadingColor default clSilver;
property WeekendFont: TFont read fWeekendFont write SetWeekendFont; // by Jaro
property Year: Word read fYear write SetYear;
property YearColor: TColor read fYearColor write SetYearColor default clGray;
property YearFont:TFont read fYearFont write SetYearFont;
property YearNavigators: Boolean read fYearNavigators write SetYearNavigators default True;
property OnClick;
property OnDblClick: TYearEvent read fOnYearDblClick write fOnYearDblClick;
property OnDrawCell: TDrawCalendarCell read FOnDrawCell write FOnDrawCell; // by Jaro
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseRightClick: TYearEvent read fOnYearRightClick write fOnYearRightClick;
property OnSelectionEnd: TNotifyEvent read fOnSelectionEnd write fOnSelectionEnd;
property OnYearChange: TNotifyEvent read fOnYearChange write fOnYearChange;
property OnYearChanged: TNotifyEvent read fOnYearChanged write fOnYearChanged;
end;
procedure Register;
implementation
{ TYearPlanner }
const
MonthDays: array[1..12] of Integer = (31,28,31,30,31,30,31,31,30,31,30,31);
{ Thanks to Paul Bailey for this procedure }
constructor TPrintOptions.Create(UpdateEvent : TNotifyEvent);
begin
inherited Create;
fPreserveAspect:= True;
fPrinterOrientation := poLandscape;
fPrintReductionSize := 100;
fPrinterLeftMargin := 0;
fPrinterTopMargin := 0;
fPrinterRightMargin := 0;
fPrinterBottomMargin := 0;
fPrintHeader := TPrintTitle.Create(nil);
fPrintFooter := TPrintTitle.Create(nil);
end;
{ Thanks to Paul Bailey for this procedure }
destructor TPrintOptions.Destroy;
begin
fPrintFooter.Free;
fPrintHeader.Free;
inherited Destroy;
end;
{ Thanks to Paul Bailey for this procedure }
procedure TPrintTitle.SetAlignment(Val: TAlignment);
begin
if fAlignment <> Val then
begin
fAlignment := Val;
UpdateControl;
end;
end;
{ Thanks to Paul Bailey for this procedure }
procedure TPrintTitle.SetCaption(Val: String);
begin
if fCaption <> Val then
begin
fCaption := Val;
UpdateControl;
end;
end;
{ Thanks to Paul Bailey and Wolf Garber for this procedure }
procedure TPrintTitle.SetFont(Val: TFont);
begin
if fFont <> Val then
begin
fFont.Assign(Val);
UpdateControl;
end;
end;
{ Thanks to Paul Bailey for this procedure }
constructor TPrintTitle.Create(UpdateEvent: TNotifyEvent);
begin
inherited Create;
fFont := TFont.Create;
fCaption := '';
fAlignment := taLeftJustify;
end;
{ Thanks to Paul Bailey for this procedure }
destructor TPrintTitle.Destroy;
begin
fFont.Free;
inherited Destroy;
end;
{ Thanks to Paul Bailey for this procedure }
procedure TPrintTitle.UpdateControl;
begin
if Assigned(fOnChange) then fOnChange(Self);
end;
{ Gives you the date of the start of the first whole week in a specified
year. The start day is determined by the StartDayOfWeek value }
function TYearPlanner.FindFirstWeek(aYear: Word): TDateTime;
var
sDay, tDay: Integer;
sDate: TDateTime;
dateOk: Boolean;
begin
{ We have to find the first whole week, but this depends on the day when
a week starts }
dateOk := False;
sDay := 1;
while not dateOk do
begin
{ Find out what day of the week this date is }
sDate := EncodeDate(aYear, 1, sDay);
{ Convert Delphi day of week to my day of week array }
tDay := (DayOfWeek(sDate) + 5) mod 7;
{ Is this the start day ? }
if tDay = ord(fStartDayOfWeek) then dateOk := True;
{ Try the next day }
inc(sDay);
end;
Result := sDate;
end;
{ Procedure to test for a leap year - This is the routine used in Delphi 5,
but I have used it here as Delphi 1 did not have such a procedure }
function TYearPlanner.IsLeapYear(Year: Word): Boolean;
begin
Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));
end;
{ Converts mouse coordinates to cell coordinates }
procedure TYearPlanner.XYToCell(X,Y: Integer;var CellX,CellY: Integer);
begin
{ Work out the column }
if X < Widths[0] then CellX := 0 else
begin
CellX := ((X - Widths[0]) div Widths[1]) + 1;
if CellX > 37 then CellX := 37;
end;
{ Work out the row }
if Y < Heights[0] then CellY := 0 else
begin
CellY := ((Y - Heights[0]) div Heights[1]) + 1;
if CellY > 12 then CellY := 12;
end;
end;
{ Processes a selection area }
procedure TYearPlanner.ProcessSelection;
var
sD, eD, sM, eM: Integer;
begin
{ Get the start date from the selected area }
sD := StDay;
sM := StMonth;
eD := EnDay;
eM := EnMonth;
if StDay = 0 then Inc(sD);
if StMonth = 0 then Inc(sM);
if (StDay > 7) then
while Cells[sD,sM] = '' do Dec(sD)
else
while Cells[sD,sM] = '' do Inc(sD);
fStartDate := EncodeDate(fYear, sM, StrToInt(Cells[sD,sM]));
{ Get the end date from the selected area }
if EnDay = 0 then Inc(eD);
if EnMonth = 0 then Inc(eM);
if (EnDay > 7) then
while Cells[eD,eM] = '' do Dec(eD)
else
while Cells[eD,eM] = '' do Inc(eD);
fEndDate := EncodeDate(fYear, eM, StrToInt(Cells[eD,eM]));
end;
{ Reads in the cell data from an open file - Thanks to Jeurgen Jakob and
Roberto Chieregato for improving this procedure }
procedure TYearPlanner.LoadFromFile(var fFile: File);
var
fLength, numRead, X, Y: Integer;
begin
{ Read the calender data }
for X := 1 to 12 do
for Y := 1 to 31 do
with CellData[X, Y] do
begin
{ Read in the cell data }
BlockRead(fFile, fLength, SizeOf(fLength), numRead);
if fLength > 0 then
begin
SetLength(CellHint, fLength);
BlockRead(fFile, CellHint[1], fLength, numRead);
end;
BlockRead(fFile, CellColor, SizeOf(CellColor), numRead);
BlockRead(fFile, CellFont, SizeOf(CellFont), numRead);
BlockRead(fFile, CustomColor, SizeOf(CustomColor), numRead);
BlockRead(fFile, CustomFont, SizeOf(CustomFont), numRead);
BlockRead(fFile, CellDate, SizeOf(CellDate), numRead);
BlockRead(fFile, Selected, SizeOf(Selected), numRead);
BlockRead(fFile, CellImage, SizeOf(CellImage), numRead);
BlockRead(fFile, Tag, SizeOf(Tag), numRead);
end;
end;
{ Reads in the cell data from an open stream - Thanks to Roberto Chieregato for
improving this procedure }
procedure TYearPlanner.LoadFromStream(var fStream:TStream);
var
fLength, X, Y: Integer;
begin
{ Read the calender data }
for X := 1 to 12 do
for Y := 1 to 31 do
with fStream, CellData[X, Y] do
begin
{ Read in the cell data }
ReadBuffer(fLength, SizeOf(fLength));
if fLength > 0 then
begin
SetLength(CellHint, fLength);
ReadBuffer(CellHint[1], fLength);
end;
ReadBuffer(CellColor, SizeOf(CellColor));
ReadBuffer(CellFont, SizeOf(CellFont));
ReadBuffer(CustomColor, SizeOf(CustomColor));
ReadBuffer(CustomFont, SizeOf(CustomFont));
ReadBuffer(CellDate, SizeOf(CellDate));
ReadBuffer(Selected, SizeOf(Selected));
ReadBuffer(CellImage, SizeOf(CellImage));
ReadBuffer(Tag, SizeOf(Tag));
end;
end;
{ Saves the cell data to an open file - Thanks to Jeurgen Jakob and Roberto
Chieregato for improving this procedure }
procedure TYearPlanner.SaveToFile(var fFile: File);
var
fLength, numWritten, X, Y: Integer;
begin
{ Save the calender data }
for X := 1 to 12 do
for Y := 1 to 31 do
with CellData[X, Y] do
begin
{ Save the cell data }
fLength := Length(CellHint);
BlockWrite(fFile, fLength, SizeOf(fLength), numWritten);
if fLength > 0 then
BlockWrite(fFile, CellHint[1], fLength, numWritten);
BlockWrite(fFile, CellColor, SizeOf(CellColor), numWritten);
BlockWrite(fFile, CellFont, SizeOf(CellFont), numWritten);
BlockWrite(fFile, CustomColor, SizeOf(CustomColor), numWritten);
BlockWrite(fFile, CustomFont, SizeOf(CustomFont), numWritten);
BlockWrite(fFile, CellDate, SizeOf(CellDate), numWritten);
BlockWrite(fFile, Selected, SizeOf(Selected), numWritten);
BlockWrite(fFile, CellImage, SizeOf(CellImage));
BlockWrite(fFile, Tag, SizeOf(Tag), numWritten);
end;
end;
{ Saves the cell data to an open stream - Thanks to Roberto Chieregato for
improving this procedure }
procedure TYearPlanner.SaveToStream(var fStream:TStream);
var
fLength, X, Y: Integer;
begin
{ Save the calender data }
for X := 1 to 12 do
for Y := 1 to 31 do
with fStream, CellData[X, Y] do
begin
{ Save the cell data }
fLength := Length(CellHint);
WriteBuffer(fLength, SizeOf(fLength));
if fLength > 0 then
WriteBuffer(CellHint[1], fLength);
WriteBuffer(CellColor, SizeOf(CellColor));
WriteBuffer(CellFont, SizeOf(CellFont));
WriteBuffer(CustomColor, SizeOf(CustomColor));
WriteBuffer(CustomFont, SizeOf(CustomFont));
WriteBuffer(CellDate, SizeOf(CellDate));
WriteBuffer(Selected, SizeOf(Selected));
WriteBuffer(CellImage, SizeOf(CellImage));
WriteBuffer(Tag, SizeOf(Tag));
end;
end;
{ Thanks to Robert Gesswein for improving this procedure }
procedure TYearPlanner.CalculateCalendar;
var
I,J: Byte;
DaysInMonth,StartDay: Integer;
begin
{ Set the Year cell }
Cells[0, 0] := IntToStr(Self.Year);
{ Clear the cell contents }
for I := 1 to 37 do
for J := 1 to 12 do
Cells[I,J] := '';
{ Setup the cells }
for I := 1 to 12 do
begin
StartDay := DayOfWeek(EncodeDate(Year,I,1));
StartDay := (StartDay+7-Ord(fStartDayOfWeek)-2) mod 7;
DaysInMonth := MonthDays[I] + byte(IsLeapYear(Year) and (I = 2));
for J := 1 to DaysInMonth do Cells[J + StartDay,I] := IntToStr(J);
end;
end;
{ Thanks to Paul Fisher, Wolfgang Kleinrath and Roberto Chieregato for
improving this procedure }
procedure TYearPlanner.CalculateData;
var
I,J: Byte;
DaysInMonth: Integer;
begin
{ Setup the hints }
for I := 1 to 12 do
begin
DaysInMonth := MonthDays[I] + byte(IsLeapYear(Year) and (I = 2));
for J := 1 to DaysInMonth do
begin
with CellData[I,J] do
begin
CellColor := $00000000;
CellFont := fDayFont;
CustomColor := False;
CustomFont := False;
CellDate := EncodeDate(Year,I,J);
CellHint := '';
TextLayout := fTextLayout;
CellImage := -1;
Tag := -1;
Selected := False;
end;
end;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.CalculateNavigators;
var
sWidth,sHeight,y: Integer;
begin
sWidth := GetSystemMetrics(SM_CXHSCROLL);
sHeight := GetSystemMetrics(SM_CYHSCROLL);
y := (Heights[0] - sHeight) div 2;
fYearNavLeft := Rect(0 + 1,y,1 + sWidth,y + sHeight);
fYearNavRight := Rect(Widths[0] - (sWidth + 1),y,Widths[0] - 1,y + sHeight);
end;
{ Thanks to Max Evans, Nacho Urenda and Paul Fisher for helping with this
procedure }
procedure TYearPlanner.CalculateSizes;
var
I: Byte;
begin
{ Calculate the cell sizes based on whether or not we are printing or
using the free space }
if fUseFreeSpace then
begin
Heights[0] := Height - ((Height div 13) * 12);
Widths[0] := Width - ((Width div 41) * 37);
end
else
begin
Heights[0] := (Height div 13);
Widths[0] := (Width div 41) * 4;
end;
for I := 1 to 37 do Widths[I] := (Width div 41);
for I := 1 to 12 do Heights[I] := (Height div 13);
{ Calculate the navigation button sizes }
CalculateNavigators;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.CircleToday(CCanvas: TCanvas; CircleRect: TRect; const TodayText: String; InnerColor: TColor);
var SaveRect: TRect;
begin
SaveRect:= CircleRect;
CCanvas.Brush.Style:= bsClear;
CCanvas.Pen.Color := TodayCircleColour;
CCanvas.Pen.Width := 1;
case fTextLayout of
tlTop : ;
tlCenter: CircleRect.Top:= CircleRect.Top + (CircleRect.Height - CCanvas.TextHeight('0')) shr 1;
tlBottom: CircleRect.Top:= CircleRect.Bottom - CCanvas.TextHeight('0');
end;
CircleRect.Bottom:= CircleRect.Top + CCanvas.TextHeight('0');
if CircleRect.Bottom > SaveRect.Bottom then CircleRect.Bottom:= SaveRect.Bottom;
if CircleRect.Top < SaveRect.Top then CircleRect.Top:= SaveRect.Top;
CCanvas.Brush.Color := InnerColor;
if TodayCircleFilled then
CCanvas.FillRect(CircleRect)
else
CCanvas.Rectangle(CircleRect);
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.OnGridPenChange(Sender:TObject);
begin
Invalidate;
end;
procedure TYearPlanner.SetTextAlignment(AValue: TAlignment);
begin
if fTextAlignment=AValue then Exit;
fTextAlignment:=AValue;
Invalidate;
end;
procedure TYearPlanner.SetTextLayout(AValue: TTextLayout);
begin
if fTextLayout=AValue then Exit;
fTextLayout:=AValue;
Invalidate;
end;
procedure TYearPlanner.SetTodayFont(AValue: TFont);
begin
if fTodayFont=AValue then Exit;
fTodayFont.Assign(AValue);
Invalidate;
end;
{ Thanks to Paolo Prandini, Richard Haven and Robert Gesswein for this
improved procedure }
procedure TYearPlanner.SetupHeadings;
var
I,J: Byte;
begin
for I := 1 to 37 do
begin
J := (((I - 1) + (Ord(fStartDayOfWeek))) mod 7) + 2;
if J = 8 then J := 1;
Cells[I,0] := DefaultFormatSettings.ShortDayNames[J];
end;
for I := 1 to 12 do Cells[0,I] := DefaultFormatSettings.LongMonthNames[I];
end;
procedure TYearPlanner.SetAllowSelections(Val: Boolean);
begin
if fAllowSelections <> Val then
begin
fAllowSelections := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetDayColor(Val: TColor);
begin
if fDayColor <> Val then
begin
fDayColor := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetDayFont(Val: TFont);
begin
if fDayFont <> Val then
begin
fDayFont.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetEndEllipsis(Val: Boolean);
begin
if fEndEllipsis <> Val then
begin
fEndEllipsis := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetFlatCells(Val: Boolean);
begin
if fFlatCells <> Val then
begin
fFlatCells := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetGridLines(Val: Boolean);
begin
if fGridLines <> Val then
begin
fGridLines := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetGridPen(Val: TPen);
begin
if fGridPen <> Val then
begin
fGridPen.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetHeadingColor(Val: TColor);
begin
if fHeadingColor <> Val then
begin
fHeadingColor := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetHintColor(Val: TColor);
begin
if fHintColor <> Val then
begin
fHintColor := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetHintDelay(Val: Integer);
begin
if fHintDelay <> Val then
begin
fHintDelay := Val;
if fHintDelay < 0 then fHintDelay := 0;
Invalidate;
end;
end;
procedure TYearPlanner.SetHintFont(Val: TFont);
begin
if fHintFont <> Val then
begin
fHintFont.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetLongHint(Val: Boolean);
begin
if fLongHint <> Val then
begin
fLongHint := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetMonthButtons(Val: Boolean);
begin
if fMonthButtons <> Val then
begin
fMonthButtons := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetMonthColor(Val: TColor);
begin
if fMonthColor <> Val then
begin
fMonthColor := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetMonthFont(Val: TFont);
begin
if fMonthFont <> Val then
begin
fMonthFont.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetNoDayColor(Val: TColor);
begin
if fNoDayColor <> Val then
begin
fNoDayColor := Val;
Invalidate;
end;
end;
{ Thanks to Robert Gesswein contributing this procedure }
procedure TYearPlanner.SetNoDayPriority(Val: Boolean);
begin
if fNoDayPriority <> Val then
begin
fNoDayPriority := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetSelectionColor(Val: TColor);
begin
if fSelectionColor <> Val then
begin
fSelectionColor := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetSelectionFont(Val: TFont);
begin
if fSelectionFont <> Val then
begin
fSelectionFont.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetSelectionStyle(Val: TypSelSty);
begin
if fSelectionStyle <> Val then
begin
fSelectionStyle := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetSeperator(Val: Boolean);
begin
if fSeperator <> Val then
begin
fSeperator := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetSoftBorder(Val: Boolean);
begin
if fSoftBorder <> Val then
begin
fSoftBorder := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetShowDefaultHint(Val: Boolean);
begin
if fShowDefaultHint <> Val then
begin
fShowDefaultHint := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetShowToday(Val: Boolean);
begin
if fShowToday <> Val then
begin
fShowToday := Val;
Invalidate;
end;
end;
{ Thanks to Robert Gesswein for contributing this procedure }
procedure TYearPlanner.SetStartDayOfWeek(Val: TypDOW);
begin
if fStartDayOfWeek <> Val then
begin
fStartDayOfWeek := Val;
SetupHeadings;
CalculateCalendar;
CalculateData;
Invalidate;
end;
end;
procedure TYearPlanner.SetStretchImages(Val: Boolean);
begin
if fStretchImages <> Val then
begin
fStretchImages := Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetTodayCircleColour(Val: TColor);
begin
if fTodayCircleColour <> Val then
begin
fTodayCircleColour := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetTodayCircleFilled(Val: Boolean);
begin
if fTodayCircleFilled <> Val then
begin
fTodayCircleFilled := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetUseFreeSpace(Val: Boolean);
begin
if fUseFreeSpace <> Val then
begin
fUseFreeSpace := Val;
CalculateSizes;
Invalidate;
end;
end;
procedure TYearPlanner.SetWeekendColor(Val: TColor);
begin
if fWeekendColor <> Val then
begin
fWeekendColor := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetWeekendFont(AValue: TFont);
begin
if fWeekendFont=AValue then Exit;
fWeekendFont.Assign(AValue);
Invalidate;
end;
procedure TYearPlanner.SetWeekendHeadingColor(Val: TColor);
begin
if fWeekendHeadingColor <> Val then
begin
fWeekendHeadingColor := Val;
Invalidate;
end;
end;
procedure TYearPlanner.SetYear(Val: Word);
begin
if fYear <> Val then
begin
{ Handle the OnYearChange event, if there is one }
if Assigned(fOnYearChange) then fOnYearChange(Self);
{ Change the year }
fYear := Val;
{ Setup the calender }
CalculateCalendar;
CalculateData;
{ Clear the selection }
ClearSelection;
{ Handle the OnYearChanged event, if there is one }
if Assigned(fOnYearChanged) then fOnYearChanged(Self);
{ Update the control }
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetYearColor(Val: TColor);
begin
if fYearColor <> Val then
begin
fYearColor:= Val;
Invalidate;
end;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.SetYearFont(Val: TFont);
begin
if fYearFont <> Val then
begin
fYearFont.Assign(Val);
Invalidate;
end;
end;
procedure TYearPlanner.SetYearNavigators(Val: Boolean);
begin
if fYearNavigators <> Val then
begin
fYearNavigators := Val;
Invalidate;
end;
end;
procedure TYearPlanner.WMEraseBkgnd(var Message: TWMEraseBkgnd);
begin
Message.Result := 1;
end;
{ Thanks to Kaj Ekman, Max Evans, Paul Fisher, Rob Schoenaker and Roberto
Chieregato for improving this routine }
procedure TYearPlanner.Paint;
var
I,J: Byte;
T,tH,X,Y: Integer;
fBorderRect, fSepRect, GridCellRect: TRect;
fTodayDay, fTodayMonth, fTodayYear: Word;
GridCol, OldColor: TColor;
CurrWidth, CurrHeight : Integer;
CellText: string;
CellTextLen: Integer;
TheCanvas: TCanvas;
DrawDC: HDC;
nXStart, nYStart, tXStart, tYStart: Integer;
BitmapRect, TempDRect, TempSRect: TRect;
ImageH, ImageIndex, ImageW: Integer;
ImageBmp: TPicture;
{ This function determines if a cell is selected - Thanks to Roberto Chieregato
for improving it }
function CellSelected: Boolean;
var
crDate: TDateTime;
begin
{ By default we assume that the cell is not selected }
Result := False;
{ We cannot select cells if selections are not allowed }
if not fAllowSelections then Exit;
{ Is the cell selected ? }
if SelectionStyle = ypNormal then
begin
{ With normal selections we check the date range }
crDate := EncodeDate(Year,J,StrToInt(Cells[I,J]));
if (crDate >= fStartDate) and (crDate <= fEndDate) then Result := True;
end
else
{ With rectangular selections we check the selection coordinates }
if (I >= StDay) and (I <= EnDay) and (J >= StMonth) and (J <= EnMonth)
then Result := True;
end;
{ This function determines the font to use for a day cell }
function CellFont: TFont;
var
Dy,Mn: Byte;
begin
Result := fDayFont;
if Cells[I,J] = '' then Exit;
{ It's a calender day, so check for a custom font }
Dy := StrToInt(Cells[I,J]);
Mn := J;
if CellData[Mn,Dy].CustomFont then
begin
Result := CellData[Mn,Dy].CellFont;
Exit;
end;
{ Jesli jest weekend to zmien kolor }
if ( Byte(I+Ord(fStartDayOfWeek)) in [6,7,13,14,20,21,27,28,34,35,41,42]) then
Result := fWeekendFont;
{ Jesli jest dzien bierzacy to zmien kolor czcionki }
if (fShowToday) and (Dy = fTodayDay) and (J = fTodayMonth) and (fYear = fTodayYear) then Result:= fTodayFont; // by Jaro
{ Check for a selection font }
if CellSelected then Result := fSelectionFont;
end;
{ This procedure works out the color of a cell - Thanks to Christian Hackbart,
Max Evans, Paolo Prandini and Robert Gesswein for improving it }
function GridColor: TColor;
var
Dy,Mn: Byte;
begin
if I = 0 then
begin
if J = 0 then Result:= fYearColor else
Result := fMonthColor;
Exit;
end;
if (J > 0) and (J < 13) then
if (Cells[I,J] <> '') then
begin
{ It's a calender day, so check for a color }
Dy := StrToInt(Cells[I,J]);
Mn := J;
CellData[Mn,Dy].Selected := CellSelected;
if CellData[Mn,Dy].Selected then
begin
{ It's a selected cell }
Result := fSelectionColor;
Exit;
end;
if CellData[Mn,Dy].CustomColor then
begin
{ Use the custom color }
Result := CellData[Mn,Dy].CellColor;
CellData[Mn,Dy].Selected := False;
Exit;
end;
end;
if J = 13 then Result := fNoDayColor else
begin
if ((( Byte(I+Ord(fStartDayOfWeek)) in [0,6,7,13,14,20,21,27,28,34,35,41,42]) or (J = 0))
and ((not fNoDayPriority) or (Cells[I,J] <> ''))) then
begin
{ Weekend day or heading }
Result := fWeekendColor;
if J = 0 then
if ( Byte(I+Ord(fStartDayOfWeek)) in [6,7,13,14,20,21,27,28,34,35,41,42]) then
Result := fWeekendHeadingColor else
Result := fHeadingColor;
end
else
begin
{ Normal day }
if Cells[I,J] = '' then Result := fNoDayColor
else Result := fDayColor;
end;
end;
end;
{ Thanks to Roberto Chieregato for this new routine }
function GridImage: Integer;
var
Dy,Mn: Byte;
begin
Result := -1;
if (Images <> nil) and (J > 0) and (J < 13) and (I > 0) then
if (Cells[I,J] <> '') then
begin
Dy := StrToInt(Cells[I,J]);
Mn := J;
Result := CellData[Mn,Dy].CellImage;
end;
end;
{ Thanks to Max Evans, Paolo Prandini and Rob Schoenaker for helping with
this routine }
procedure DrawGridLines;
var
L: Integer;
// LineHeight: Integer;
begin
{
with TheCanvas do
begin
// Draw the grid
Pen.Assign(fGridPen);
DrawDC := TheCanvas.Handle;
X := Widths[0] ; // bylo -1
Y := Heights[0] ; // bylo -1
LineHeight := Heights[1] shl 2 + Heights[1] shl 3 ; // bylo +1 // przesuniecie o wysokosc naglowka
for L := 1 to 38 do
begin
Windows.MoveToEx(DrawDC, X, Y, nil);
Windows.LineTo(DrawDC, X, Y + LineHeight);
if L < 38 then Inc(X, Widths[L]);
end;
for L := 1 to 13 do
begin
Windows.MoveToEx(DrawDC, Widths[0], Y, nil);
Windows.LineTo(DrawDC, X, Y);
if L < 13 then Inc(Y, Heights[L]);
end;
end;
}
with TheCanvas do // by Jaro
begin
{ Draw the grid }
Pen.Assign(fGridPen);
DrawDC := TheCanvas.Handle;
X := Widths[0] ;
Y := Heights[0] ;
for L := 1 to 38 do
begin
Windows.MoveToEx(DrawDC, X, 0, nil);
Windows.LineTo(DrawDC, X, Height);
if L < 38 then Inc(X, Widths[L]);
end;
for L := 1 to 13 do
begin
Windows.MoveToEx(DrawDC, 0, Y, nil);
Windows.LineTo(DrawDC, Width, Y);
if L < 13 then Inc(Y, Heights[L]);
end;
end;
end;
begin
{ Setup the offscreen bitmap }
CalculateSizes;
if (fUseBitmap) and not (csDesigning in ComponentState) then
begin
fControl.Width := Width;
fControl.Height := Height;
TheCanvas := fControl.Canvas;
end
else
TheCanvas := Canvas;
{ Get today's date }
DecodeDate(Date, fTodayYear, fTodayMonth, fTodayDay);
with TheCanvas do
begin
{ Draw the calender cells and text }
Brush.Style := bsSolid;
Font := Self.Font;
DrawDC := TheCanvas.Handle;
SetBKMode(DrawDC, TRANSPARENT);
X := 0;
for I := 0 to 37 do
begin
J := 0;
Y := 0;
CurrWidth := Widths[I];
OldColor := GridColor;
repeat
T := Y;
repeat
Inc(Y,Heights[J]);
Inc(J);
GridCol := GridColor;
until (GridCol <> OldColor) or (J = 13);
GridCellRect := Rect(X, T, X + CurrWidth, Y);
Brush.Color := OldColor;
OldColor := GridCol;
Windows.FillRect(DrawDC, GridCellRect, Brush.Reference.Handle);
until J = 13;
Y := 0;
for J := 0 to 12 do
begin
CurrHeight := Heights[J];
//GridCellRect := Rect(X,Y + 1,X + CurrWidth - 1,Y + CurrHeight - 1);
GridCellRect := Rect(X,Y,X + CurrWidth ,Y + CurrHeight );
if (I = 0) then
begin
fSepRect:= GridCellRect;
InFlateRect(fSepRect,-10,0);
if fSeperator then DrawEdge(DrawDC, fSepRect, EDGE_RAISED, BF_BOTTOM);
end;
{ Draw the month buttons and flat cells }
if (fMonthButtons) and (I = 0) and (J > 0) then
DrawEdge(DrawDC, GridCellRect, EDGE_RAISED, BF_RECT OR BF_SOFT)
else
if not fFlatCells then
DrawEdge(DrawDC, GridCellRect, BDR_RAISEDINNER, BF_RECT);
{ Draw the cell images }
ImageIndex := GridImage;
If ImageIndex > -1 then
begin
ImageBmp := TPicture.Create;
{ Do we want to draw a stretched image ? }
if fStretchImages then
begin
{ Stretch the image to fill the cell }
BitmapRect := Rect(X, Y, X + CurrWidth, Y + CurrHeight);
Images.GetBitmap(ImageIndex, ImageBmp.Bitmap);
TheCanvas.StretchDraw(BitmapRect, ImageBmp.Bitmap);
end
else
begin
{ Center the image in the cell }
Images.GetBitmap(ImageIndex, ImageBmp.Bitmap);
ImageW := ImageBmp.Bitmap.Width;
ImageH := ImageBmp.Bitmap.Height;
{ Crop the image so that it is not drawn over other cells }
if ImageBmp.Width > CurrWidth then
begin
{ Crop the image width }
tXStart := (ImageW - CurrWidth) div 2;
TempSRect := Rect(tXStart, 0, tXStart + CurrWidth, ImageH);
TempDRect := Rect(0, 0, CurrWidth, ImageH);
with ImageBmp.Bitmap do Canvas.CopyRect(TempDRect,Canvas,TempSRect);
ImageBmp.Bitmap.Width := CurrWidth;
ImageW := ImageBmp.Bitmap.Width;
end;
if ImageBmp.Height > CurrHeight then
begin
{ Crop the image height }
tYStart := (ImageH - CurrHeight) div 2;
TempSRect := Rect(0, tYStart, CurrWidth, tYStart + CurrHeight);
TempDRect := Rect(0, 0, ImageW, CurrHeight);
with ImageBmp.Bitmap do Canvas.CopyRect(TempDRect,Canvas,TempSRect);
ImageBmp.Bitmap.Height := CurrHeight;
ImageH := ImageBmp.Bitmap.Height;
end;
{ Work out the top left coordinates of the image }
nXStart := (X + (CurrWidth div 2)) - (ImageW div 2);
nYStart := (Y + (CurrHeight div 2)) - (ImageH div 2);
{ Draw the image }
TheCanvas.Draw(nXStart, nYStart, ImageBmp.Bitmap);
end;
ImageBmp.Free;
end;
// else
begin
CellText := Cells[I,J];
CellTextLen := Length(CellText);
{ Select the font to use }
if CellTextLen <> 0 then
begin
if (I = 0) and (J > 0) then
begin
{ Month Cell }
Font := fMonthFont;
DrawDC := TheCanvas.Handle;
SetBKMode(DrawDC, TRANSPARENT);
end;
if (J = 0) and (I > 0) then
begin
{ Day Cell }
{ Weekend day or heading }
if ( Byte(I+Ord(fStartDayOfWeek)) in [6,7,13,14,20,21,27,28,34,35,41,42]) then
Font := fWeekendFont
else
Font := fDayFont;
DrawDC := TheCanvas.Handle;
SetBKMode(DrawDC, TRANSPARENT);
end;
if (J = 0) and (I = 0) then
begin
{ Year Cell }
Font := fYearFont;
DrawDC := TheCanvas.Handle;
SetBKMode(DrawDC, TRANSPARENT);
if fYearNavigators then
begin
{ Draw the year navigation buttons }
CalculateNavigators;
if fMonthButtons then
begin
DrawFrameControl(DrawDC, fYearNavLeft, DFC_SCROLL, DFCS_SCROLLLEFT);
DrawFrameControl(DrawDC, fYearNavRight, DFC_SCROLL, DFCS_SCROLLRIGHT);
end
else
begin
DrawFrameControl(DrawDC, fYearNavLeft, DFC_SCROLL, DFCS_SCROLLLEFT or DFCS_FLAT);
DrawFrameControl(DrawDC, fYearNavRight, DFC_SCROLL, DFCS_SCROLLRIGHT or DFCS_FLAT);
end;
end;
end;
{ dzisiejszy dzien wyrozniamy}
if (fShowToday) and (Cells[I, J] = IntToStr(fTodayDay)) and (J = fTodayMonth) and (fYear = fTodayYear) then
begin
Font := CellFont;
if fTodayCircleFilled then
CircleToday(TheCanvas, GridCellRect, IntToStr(fTodayDay), fTodayCircleColour)
else
CircleToday(TheCanvas, GridCellRect, IntToStr(fTodayDay), GridColor);
end;
if (J > 0) and (I > 0) then
begin
{ Normal Cells }
Font := CellFont;
DrawDC := TheCanvas.Handle;
SetBKMode(DrawDC, TRANSPARENT);
case fTextLayout of
tlTop : th := DT_TOP;
tlCenter: th := DT_VCENTER; //(CurrHeight - SizeRec.cy) shr 1;
tlBottom: th := DT_BOTTOM; // (CurrHeight - SizeRec.cy);
end;
case fTextAlignment of
taLeftJustify : th:= th OR DT_LEFT;
taCenter : th:= th OR DT_CENTER;
taRightJustify : th:= th OR DT_RIGHT;
end;
fSepRect.Top := GridCellRect.Top;
fSepRect.Bottom:= GridCellRect.Bottom+2;
fSepRect.Left := GridCellRect.Left+2;
fSepRect.Right := GridCellRect.Right-2;
DrawText(DrawDC, PChar( CellText), -1, fSepRect, th OR DT_SINGLELINE);
end else
{ Draw the text in the center of the cell }
{ Draw text naglowek i miesiace }
begin
if fEndEllipsis then
begin
DrawText(DrawDC, PChar( CellText), -1, GridCellRect, DT_VCENTER OR DT_CENTER OR DT_SINGLELINE OR DT_END_ELLIPSIS);
end
else
begin
//GetTextExtentPoint32(DrawDC, PChar(CellText), Length(CellText), SizeRec);
//tW := (CurrWidth - SizeRec.cx) shr 1; // ustawiamy srodek tekstu
//tH := (CurrHeight - SizeRec.cy) shr 1;
//TextOut(X + tW, Y + tH, CellText);
DrawText(DrawDC, PChar( CellText), -1, GridCellRect, DT_VCENTER OR DT_CENTER OR DT_SINGLELINE);
end;
end;
end;
end;
//========================== nadpisanie celi z numerami dni wlasnym OnDrawCell
if (J > 0) and (I > 0) and (CellTextLen <> 0) then
if Assigned(FOnDrawCell) then
FOnDrawCell(self, TheCanvas, GridCellRect, CellData[J,StrToInt(Cells[I,J])] , Cells[I,J] );
//==========================================
Inc(Y,CurrHeight);
end;
Inc(X,CurrWidth);
end;
if fGridlines then DrawGridLines;
if fSoftBorder then
begin
SetBKMode(DrawDC, OPAQUE);
fBorderRect:= Rect(0,0,Width,Height);
DrawEdge(DrawDC,fBorderRect,EDGE_ETCHED,BF_RECT);
end;
end;
{ Now copy the bitmap to the screen }
if fUseBitmap then
BitBlt(Canvas.Handle, 0, 0, Width, Height, DrawDC, 0, 0, SRCCOPY);
{ If we are printing, copy the canvas and stretch it to the page }
if hPrinting then
StretchBlt(Printer.Canvas.Handle, PrinterLeftMargin, PrinterTopMargin,
PrinterPageWidth, PrinterPageHeight, Canvas.Handle, 0, 0,
Width, Height, SRCCOPY);
end;
{ Thanks to Max Evans for improving this routine }
constructor TYearPlanner.Create(AOwner: TComponent);
var
Dy,Mn,Yr: Word;
begin
{ Setup the control }
Inherited Create(AOwner);
HintWin := THintWindow.Create(Self);
fStringList := TStringList.Create;
fPrintOptions := TPrintOptions.Create(nil);
fGridPen := TPen.Create;
fGridPen.OnChange:= @OnGridPenChange;
{ Create the fonts }
fDayFont := TFont.Create;
fHintFont := TFont.Create;
fMonthFont := TFont.Create;
fSelectionFont := TFont.Create;
fTodayFont := TFont.Create;
fYearFont := TFont.Create;
fWeekendFont:= TFont.Create;
Width := 615;
Height := 300;
Color := clDefault;
DecodeDate(Date, Yr, Mn, Dy);
fAllowSelections := True;
fDayColor := clWhite;
fDayFont.Color:= $00333333;
fDayFont.Name:= 'Arial';
fDayFont.Size:= 8;
fTextAlignment:= taLeftJustify;
fTextLayout:= tlTop;
fHeadingColor := clWhite;
fHintColor := clYellow;
fHintDelay := 0;
fLongHint := True;
fMonthColor := clWhite;
fMonthButtons := false;
fMonthFont.Color:= $00333333;
fMonthFont.Name:= 'Arial';
fMonthFont.Size:= 8;
fNoDayColor := $00F1F1F1;
fSelectionColor := $00FF9933;
fSelectionStyle := ypNormal;
fSelectionFont.Color:= $00333333;
fSelectionFont.Name:= 'Arial';
fSelectionFont.Size:= 8;
fSeperator := false;
fSoftBorder := false;
fFlatCells := true;
fGridLines := true;
fGridPen.Color:= $00C8C8C8;
fShowDefaultHint := True;
fShowToday:= True;
fTodayCircleColour := $00D59D31;
fTodayCircleFilled := True;
fTodayFont.Name:= 'Arial';
fTodayFont.Color:= clWhite;
fTodayFont.Size:= 8;
fStartDayOfWeek := ypMonday;
fStretchImages := False;
fUseBitmap := True;
fUseFreeSpace := True;
fWeekendColor := $00DFDFDF;
fWeekendHeadingColor := $00DFDFDF;
fWeekendFont.Name:= 'Arial';
fWeekendFont.Color:= clRed;
fWeekendFont.Size:= 8;
fYear := Yr;
fYearColor:= $00DFDFDF;
fYearFont.Color:= $00333333;
fYearFont.Name:= 'Arial';
fYearFont.Size:= 8;
fYearNavigators := True;
fStartDate := Now;
fEndDate := Now;
hUpdating := False;
hWaiting := False;
hWaitingToDestroy := False;
CurrentDate.Day := 0;
CurrentDate.Month := 0;
OldX := -1;
OldY := -1;
hPrinting := False;
hSelecting := ypNotSelecting;
{ Create the off screen bitmap }
fControl := TBitmap.Create;
{ Setup the calender }
DoubleBuffered:= true;
SetupHeadings;
CalculateCalendar;
CalculateData;
CalculateSizes;
end;
{ Thanks to Max Evans for improving this routine }
destructor TYearPlanner.Destroy;
begin
{ Kill the control }
fPrintOptions.Free;
fStringList.Free;
{ Inform the hint window that the control is destroying }
hWaitingToDestroy := True;
{ If a hint is being displayed, we release the hint window }
if hUpdating then HintWin.ReleaseHandle;
{ Free the hint window }
HintWin.Free;
{ Free used bitmap }
fControl.Free;
{ Free the fonts }
fGridPen.OnChange:= nil;
fGridPen.Free;
fYearFont.Free;
fSelectionFont.Free;
fMonthFont.Free;
fHintFont.Free;
fDayFont.Free;
fTodayFont.Free;
fWeekendFont.Free;
{ Here the control is destroyed. If a hint was being displayed, the hint
procedure will safely exit by picking up the csDestroying flag in the
ComponentState property }
Inherited Destroy;
end;
procedure TYearPlanner.WMLButtonDblClk(var Message: TWMLButtonDblClk);
begin
{ If a selection has been made, and a double click procedure has been set,
execute it }
if (hSelecting = ypSelected) and (Assigned(fOnYearDblClick)) then
fOnYearDblClick(StDay,EnDay,EnMonth,StMonth,fStartDate,fEndDate);
end;
{ Thanks to Martin Roberts, Max Evans, Paul Fisher and Wolf Garber for
helping with this routine }
procedure TYearPlanner.WMLButtonDown(var Message: TWMLButtonDown);
var
Pt,Temp: TPoint;
tX,tY: Integer;
fOnClick: TNotifyEvent;
begin
Inherited;
if fYearNavigators then
begin
{ Check the navigation buttons }
GetCursorPos(Pt);
Pt := ScreenToClient(Pt);
if PtInRect(fYearNavLeft,Pt) then
begin
{ User clicked the previous year button }
Year := Year - 1;
Invalidate;
Exit;
end;
if PtInRect(fYearNavRight,Pt) then
begin
{ User clicked the next year button }
Year := Year + 1;
Invalidate;
Exit;
end;
end;
{ Check to see if the mouse is over a cell }
Temp := ClientToScreen(Point(Message.XPos,Message.YPos));
if not (FindDragTarget(Temp, True) = Self) then Exit;
XYToCell(Message.XPos,Message.YPos,tX,tY);
{ If we are selecting in date range style, we must select a cell with a date }
if ((tx = 0) or (ty = 0) or (cells[tx,ty] = '')) and (fSelectionStyle = ypNormal) then
begin
ClearSelection;
Exit;
end;
{ If the user has assigned an OnClick event, we cannot use selections }
fOnClick := OnClick;
if not Assigned(fOnClick) then hSelecting := ypSelecting;
{ Set the initial and start coordinates }
InDay := tX;
InMonth := tY;
StDay := InDay;
StMonth := InMonth;
EnDay := InDay;
EnMonth := InMonth;
{ Set the date range, if we are using date range selection style }
if fSelectionStyle = ypNormal then
begin
fStartDate := EncodeDate(fYear, ty, StrToInt(Cells[tx,ty]));
fEndDate := fStartDate;
end;
{ Update the control }
Invalidate;
end;
{ Thanks to Paul Fisher, Goldschmidt Jean-Jacques and Istvan Mesaros for
helping with this routine }
procedure TYearPlanner.WMLButtonUp(var Message: TWMLButtonUp);
var
CountX,CountY: Integer;
begin
{ We cannot allow the user to select a range of cells which do not
contain dates }
hSelecting := ypNotSelecting;
for CountX := StDay to EnDay do
for CountY := StMonth to EnMonth do
if Cells[CountX,CountY] <> '' then
hSelecting := ypSelected;
{ Process the selection coordinates }
ProcessSelection;
{ Update the start and end date variables }
StartDate := fStartDate;
EndDate := fEndDate;
{ Handle an OnSelectionEnd event if one exists }
if Assigned(fOnSelectionEnd) then fOnSelectionEnd(Self);
Inherited;
end;
{ Thanks to Paul Fisher for helping with this routine }
procedure TYearPlanner.WMRButtonDown(var Message: TWMRButtonDown);
begin
Inherited;
{ If a selection has been made, and a right click procedure has been set,
execute it }
if (hSelecting = ypSelected) and (Assigned(fOnYearRightClick)) then
fOnYearRightClick(StDay,EnDay,EnMonth,StMonth,fStartDate, fEndDate);
end;
procedure TYearPlanner.WMMouseMove(var Message: TWMMouseMove);
var
Temp: TPoint;
HintText, TmpHint, TmpText: String;
HintRect: TRect;
HDelay : Cardinal;
HintH, HintLines, HintSH, HintW: Integer;
Dy,Mn: Byte;
swapTmp:integer;
pomStartDate, pomEndDate: TDateTime; //by Jaro
begin
{ If the control is destroying we cannot continue }
if hWaitingToDestroy then Exit;
Inherited;
{ Check to see if the mouse is over a cell }
Temp := ClientToScreen(Point(Message.XPos,Message.YPos));
if not (FindDragTarget(Temp, True) = Self) then Exit;
XYToCell(Message.XPos,Message.YPos,cX,cY);
{ We do not use hints when selecting cells }
if hSelecting = ypSelecting then
begin
{ Update the selection coordinates }
StDay := InDay;
StMonth := InMonth;
EnDay := cX;
EnMonth := cY;
{ Do we need to change the selection coordinates ? }
if fSelectionStyle = ypNormal then
begin
if (StMonth > EnMonth) or ((StMonth = EnMonth) and (StDay > EnDay)) then
begin
{ With normal selections we reverse the date range }
swapTmp := StDay;
StDay := EnDay;
EnDay := swapTmp;
swapTmp := StMonth;
StMonth := EnMonth;
EnMonth := swapTmp;
end;
end
else
begin
{ With rectangular selections, we simply switch the coordinates }
if StDay > EnDay then
begin
swapTmp := StDay;
StDay := EnDay;
EnDay := swapTmp;
end;
if StMonth > EnMonth then
begin
swapTmp := StMonth;
StMonth := EnMonth;
EnMonth := swapTmp;
end;
end;
{ Process the selection coordinates }
pomStartDate:= fStartDate; // by Jaro
pomEndDate:= fEndDate; // by Jaro
ProcessSelection;
{ Repaint the control }
if (fStartDate<>pomStartDate)or(fEndDate<>pomEndDate) then // by Jaro
Invalidate;
Exit;
end;
{ Is this cell a calender day? }
if ((OldX = cX) and (OldY = cY)) or (cX = 0) or (cY = 0) or
(Cells[cX,cY] = '') then Exit;
{ Update the current date }
CurrentDate.Day := StrToInt(Cells[cX,cY]);
CurrentDate.Month := cY;
{ Now check to see if we can use hints }
if not (Application.ShowHint and (ShowHint or ParentShowHint)) then Exit;
{ Do we show this hint? }
if (CellData[cY,CurrentDate.Day].CellHint = '') and (not fShowDefaultHint) then Exit;
{ If a hint is being displayed, we mark a hint status flag to say that
another hint is waiting }
if hUpdating then
begin
hWaiting := True;
Exit;
end;
{ Now we setup the hint }
OldX := cX;
OldY := cY;
Dy := CurrentDate.Day;
Mn := CurrentDate.Month;
HintText := CellData[Mn,Dy].CellHint;
if HintText = '' then
begin
{ Now we determine whether we display a long or short date }
if fLongHint then
HintText := FormatDateTime( DefaultFormatSettings.LongDateFormat, EncodeDate(Year, Mn, Dy))
else
HintText := FormatDateTime( DefaultFormatSettings.ShortDateFormat, EncodeDate(Year, Mn, Dy));
end;
HintDate := CellData[Mn,Dy].CellDate;
{ Set the hint status flags }
hUpdating := True;
hWaiting := False;
{ Set the hint width }
TmpHint := HintText;
if TmpHint[Length(TmpHint)] <> #13 then
TmpHint := TmpHint + #13;
HintLines := 0;
HintW := 0;
repeat
Inc(HintLines);
TmpText := Copy(TmpHint,1,Pos(#13,TmpHint)-1);
if HintWin.Canvas.TextWidth(TmpText) + 5 > HintW then
HintW := HintWin.Canvas.TextWidth(TmpText) + 15;
Delete(TmpHint,1,Pos(#13,TmpHint));
until Pos(#13,TmpHint) = 0;
{ Set the hint height }
HintH := (HintWin.Canvas.TextHeight('0') * HintLines) + 3;
HintSH := HintWin.Canvas.TextHeight('0') + 3;
{ Set the delay length }
if fHintDelay = 0 then HDelay := Application.HintPause else
HDelay := fHintDelay;
{ Display the hint }
HintRect := Rect(Temp.X, Temp.Y + HintSH, Temp.X + HintW, Temp.Y + HintH + HintSH + 8 );
HintWin.Color := fHintColor;
HintWin.Canvas.Font.Assign(fHintFont);
HintWin.ActivateHint(HintRect, HintText);
{ Display the hint window for some time }
FirstTickCount := GetTickCount64;
repeat
{ If another hint is waiting, get rid of this hint }
Application.ProcessMessages;
{ If the control has been destroyed, this code will safely exit the
procedure without causing an access violation }
if csDestroying in ComponentState then Exit;
{ If the parent control has been hidden or the application has terminated
the hint shouldn't be shown }
if (not Parent.Showing) or (Application.Terminated) then Break;
{ Otherwise, we deal with the hint in the normal way }
if (hSelecting = ypSelecting) or (hWaiting) or (hWaitingToDestroy) then Break;
until (GetTickCount64 - FirstTickCount > HDelay);
{ Destroy the hint window }
HintWin.ReleaseHandle;
hUpdating := False;
end;
{ Thanks to Max Evans for this routine }
procedure TYearPlanner.WMSize(var Message:TWMSize);
begin
CalculateNavigators;
end;
{ Thanks to Robert Gesswein for helping with this procedure }
procedure TYearPlanner.SetColorAtDate(dt: TDateTime; cellColor: TColor; UpdateControl: Boolean);
var
mm,dd,yy: word;
begin
DecodeDate(dt, yy, mm, dd);
CellData[mm, dd].CellColor := cellColor;
CellData[mm, dd].CustomColor := True;
if UpdateControl then Invalidate;
end;
procedure TYearPlanner.SetFontAtDate(dt: TDateTime; cellFont: TFont; UpdateControl: Boolean);
var
mm,dd,yy: word;
begin
DecodeDate(dt, yy, mm, dd);
CellData[mm, dd].CellFont := cellFont;
CellData[mm, dd].CustomFont := True;
if UpdateControl then Invalidate;
end;
procedure TYearPlanner.SetHintAtDate(dt: TDateTime; cellHint: String; UpdateControl: Boolean);
var
mm,dd,yy: word;
begin
DecodeDate(dt, yy, mm, dd);
CellData[mm, dd].CellHint := cellHint;
if UpdateControl then Invalidate;
end;
procedure TYearPlanner.SetImageAtDate(dt: TDateTime; cellImage: Integer; UpdateControl: Boolean);
var
mm,dd,yy: word;
begin
DecodeDate(dt, yy, mm, dd);
CellData[mm, dd].CellImage := cellImage;
if UpdateControl then Invalidate;
end;
function TYearPlanner.GetCellData(dt: TDateTime): TCellData;
var
mm,dd,yy: word;
begin
DecodeDate(dt, yy, mm, dd);
Result := CellData[mm, dd];
end;
{ Thanks to Paul Bailey, Paul Fisher and Wolf Garber for this routine }
procedure TYearPlanner.Print;
var
TempCap: array[0..255] of char;
pHeight, pWidth: Integer;
DrawFlags: Longint;
TheRect: TRect;
Ratio: Extended;
begin
hPrinting := True;
{ Work out the page size and margins }
with fPrintOptions do
begin
Printer.Orientation := fPrinterOrientation;
{ The page width and height exclude the margins }
pWidth := Printer.PageWidth - fPrinterLeftMargin - fPrinterRightMargin;
pHeight := Printer.PageHeight - fPrinterTopMargin - fPrinterBottomMargin;
{ Resize the page size based on the reduction ratio }
PrinterPageWidth := round(pWidth * (fPrintReductionSize / 100));
PrinterPageHeight := round(pHeight * (fPrintReductionSize / 100));
{Preserve Aspect Ratio}
if PreserveAspect then
begin
Ratio := Height/Width;
PrinterPageHeight := round(Ratio * PrinterPageWidth);
if PrinterPageHeight > pHeight then
begin
PrinterPageWidth:= round(PrinterPageWidth*(pHeight/PrinterPageHeight));
PrinterPageHeight:= round(pHeight);
end;
end;
{ Set the margins }
PrinterLeftMargin := fPrinterLeftMargin;
PrinterTopMargin := fPrinterTopMargin;
PrinterRightMargin := fPrinterRightMargin;
PrinterBottomMargin := fPrinterBottomMargin;
end;
try
Printer.BeginDoc;
{ Paint the YearPlanner }
self.Paint;
{ Draw the headers and footers }
with fPrintOptions, Printer.Canvas do
begin
{ Draw the header }
if PrintHeader.Caption <> '' then
begin
{ Setup the header }
StrPCopy(TempCap, PrintHeader.Caption);
Font := PrintHeader.Font;
TheRect := Rect(PrinterLeftMargin, 0, PrinterLeftMargin + pWidth,
PrinterTopMargin);
{ The text is vetically centered in the top margin }
DrawFlags := DT_VCENTER or DT_SINGLELINE;
{ Do the alignment }
case PrintHeader.Alignment of
taLeftJustify: DrawFlags := DrawFlags or DT_LEFT;
taCenter: DrawFlags := DrawFlags or DT_CENTER;
taRightJustify: DrawFlags := DrawFlags or DT_RIGHT;
end;
{ Draw the text }
DrawText(Handle, TempCap, StrLen(TempCap), TheRect, DrawFlags);
end;
{ Draw the footer }
if PrintFooter.Caption <> '' then
begin
{ Setup the footer }
StrPCopy(TempCap, PrintFooter.Caption);
Font := PrintFooter.Font;
TheRect := Rect(PrinterLeftMargin, PrinterTopMargin + pHeight,
PrinterLeftMargin + pWidth, PrinterTopMargin + pHeight + PrinterBottomMargin);
{ The text is vetically centered in the bottom margin }
DrawFlags := DT_VCENTER or DT_SINGLELINE;
{ Do the alignment }
case PrintFooter.Alignment of
taLeftJustify: DrawFlags := DrawFlags or DT_LEFT;
taCenter: DrawFlags := DrawFlags or DT_CENTER;
taRightJustify: DrawFlags := DrawFlags or DT_RIGHT;
end;
{ Draw the text }
DrawText(Handle, TempCap, StrLen(TempCap), TheRect, DrawFlags);
end;
end;
finally
Printer.EndDoc;
hPrinting := False;
end;
end;
{ Thanks to Goldschmidt Jean-Jacques for this routine }
function TYearPlanner.GetStartDate: TDateTime;
begin
GetStartDate := fStartDate;
end;
{ Thanks to Goldschmidt Jean-Jacques for this routine }
function TYearPlanner.GetEndDate: TDateTime;
begin
GetEndDate := fEndDate;
end;
{ Thanks to Goldschmidt Jean-Jacques for this routine }
function TYearPlanner.IsSelected(date: TDateTime): Boolean;
var
mm,dd,yy: word;
begin
DecodeDate(date, yy, mm, dd);
IsSelected := CellData[mm, dd].Selected;
end;
{ Clear the selection }
procedure TYearPlanner.ClearSelection;
begin
StDay := 0;
StMonth := 0;
EnDay := 0;
EnMonth := 0;
fStartDate := Now;
fEndDate := Now;
Invalidate;
end;
{ Manually select a single cell }
procedure TYearPlanner.SelectCells(sDate, eDate: TDateTime);
var
eD, eM, eY, sD, sM, sY: word;
CountX: Integer;
tmpDate: TDateTime;
begin
{ We may need to reverse the cell dates }
if sDate > eDate then
begin
tmpDate := sDate;
sDate := eDate;
eDate := tmpDate;
end;
{ Get the start and end cell dates }
DecodeDate(sDate, sY, sM, sD);
DecodeDate(eDate, eY, eM, eD);
{ Find the start date cell }
for CountX := 1 to 37 do
if StrToIntDef(Cells[CountX, sM],0) = sD then
begin
{ Select the cell }
StDay := CountX;
StMonth := sM;
fStartDate := sDate;
end;
{ Find the end date cell }
for CountX := 1 to 37 do
if StrToIntDef(Cells[CountX, eM],0) = eD then
begin
{ Select the cell }
EnDay := CountX;
EnMonth := eM;
fEndDate := eDate;
end;
{ Repaint the control }
Invalidate;
Exit;
end;
{ Selects a given week }
procedure TYearPlanner.SelectWeek(aWeek: Integer);
var
eDate, sDate: TDateTime;
begin
{ Set the dates }
sDate := FindFirstWeek(Year) + ((aWeek - 1) * 7);
eDate := sDate + 6;
{ Select the cells }
SelectCells(sDate, eDate);
end;
{ Thanks to Trev for this routine }
procedure TYearPlanner.ClearCells;
var
mm, dd: Integer;
begin
for mm := 1 to 12 do
for dd := 1 to 31 do
with CellData[mm, dd] do
begin
CellColor := $00000000;
CellFont := fDayFont;
CellHint := '';
CustomColor := False;
CustomFont := False;
CellImage := -1;
Tag := -1;
end;
Invalidate;
end;
{ Gives you the week number of a specified date. }
function TYearPlanner.WeekNumber(aDate: TDateTime): Integer;
var
sDay, sMonth, sYear: Word;
begin
{ Extract the current year }
DecodeDate(aDate, sYear, sMonth, sDay);
{ We now have the start date of the first week, so find out the difference }
Result := Trunc((StrToInt(FloatToStr(aDate - FindFirstWeek(sYear))) / 7) + 1);
end;
procedure Register;
begin
{$I yearplanner_icon.ctrs}
RegisterComponents('Jaro', [TYearPlanner]);
end;
end.
| 30.037188 | 149 | 0.674795 |
fc1b606d25085656c787d784c56baf86bc152a7d | 1,311 | pas | Pascal | source/Vcls/single/cndes.pas | fenglinyushu/dewebsdk | 6f45b6bef96e4b431ad6a0071320e5f613be778b | [
"BSD-2-Clause"
]
| 2 | 2021-05-12T00:33:07.000Z | 2021-09-01T06:54:17.000Z | source/demos/_public/cndes.pas | fenglinyushu/dewebsdk | 6f45b6bef96e4b431ad6a0071320e5f613be778b | [
"BSD-2-Clause"
]
| null | null | null | source/demos/_public/cndes.pas | fenglinyushu/dewebsdk | 6f45b6bef96e4b431ad6a0071320e5f613be778b | [
"BSD-2-Clause"
]
| null | null | null | unit CnDES;
interface
uses
SysUtils;
function EncryptStr(const S :WideString; Key: Word): String;
function DecryptStr(const S: String; Key: Word): String;
implementation
const CKEY1 = 53761;
CKEY2 = 32618;
function EncryptStr(const S :WideString; Key: Word): String;
var i :Integer;
RStr :RawByteString;
RStrB :TBytes Absolute RStr;
begin
Result:= '';
RStr:= UTF8Encode(S);
for i := 0 to Length(RStr)-1 do begin
RStrB[i] := RStrB[i] xor (Key shr 8);
Key := (RStrB[i] + Key) * CKEY1 + CKEY2;
end;
for i := 0 to Length(RStr)-1 do begin
Result:= Result + IntToHex(RStrB[i], 2);
end;
end;
function DecryptStr(const S: String; Key: Word): String;
var i, tmpKey :Integer;
RStr :RawByteString;
RStrB :TBytes Absolute RStr;
tmpStr :string;
begin
tmpStr:= UpperCase(S);
SetLength(RStr, Length(tmpStr) div 2);
i:= 1;
try
while (i < Length(tmpStr)) do begin
RStrB[i div 2]:= StrToInt('$' + tmpStr[i] + tmpStr[i+1]);
Inc(i, 2);
end;//delphitop.com
except
Result:= '';
Exit;
end;
for i := 0 to Length(RStr)-1 do begin
tmpKey:= RStrB[i];
RStrB[i] := RStrB[i] xor (Key shr 8);
Key := (tmpKey + Key) * CKEY1 + CKEY2;
end;
Result:= UTF8Decode(RStr);
end;
end.
| 21.491803 | 63 | 0.600305 |
47008eebf8279e163b0f684503896568fc077040 | 1,801 | dpr | Pascal | Sempare.Async.Tester.dpr | sempare/sempare-async | 8b9ec7a3bd7453e2ecced2ad51d6a09e9ab204cb | [
"Apache-2.0"
]
| 4 | 2020-08-13T07:22:04.000Z | 2020-10-28T12:25:42.000Z | Sempare.Async.Tester.dpr | sempare/sempare-delphi-async | 8b9ec7a3bd7453e2ecced2ad51d6a09e9ab204cb | [
"Apache-2.0"
]
| null | null | null | Sempare.Async.Tester.dpr | sempare/sempare-delphi-async | 8b9ec7a3bd7453e2ecced2ad51d6a09e9ab204cb | [
"Apache-2.0"
]
| 2 | 2021-03-23T01:52:26.000Z | 2021-07-17T05:51:27.000Z | program Sempare.Async.Tester;
{$IFNDEF TESTINSIGHT}
{$APPTYPE CONSOLE}
{$ENDIF}
{$STRONGLINKTYPES ON}
uses
System.SysUtils,
{$IFDEF TESTINSIGHT}
TestInsight.DUnitX,
{$ELSE}
DUnitX.Loggers.Console,
DUnitX.Loggers.Xml.NUnit,
{$ENDIF }
DUnitX.TestFramework,
Sempare.Async.Channel.Test in 'src\Sempare.Async.Channel.Test.pas',
Sempare.Async.Promise.Test in 'src\Sempare.Async.Promise.Test.pas',
Sempare.Async.WaitGroup.Test in 'src\Sempare.Async.WaitGroup.Test.pas';
{$IFNDEF TESTINSIGHT}
var
runner: ITestRunner;
results: IRunResults;
logger: ITestLogger;
nunitLogger : ITestLogger;
{$ENDIF}
begin
try
//Check command line options, will exit if invalid
TDUnitX.CheckCommandLine;
//Create the test runner
runner := TDUnitX.CreateRunner;
//Tell the runner to use RTTI to find Fixtures
runner.UseRTTI := True;
//tell the runner how we will log things
//Log to the console window
logger := TDUnitXConsoleLogger.Create(true);
runner.AddLogger(logger);
//Generate an NUnit compatible XML File
nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
runner.AddLogger(nunitLogger);
runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
//Run tests
results := runner.Execute;
if not results.AllPassed then
System.ExitCode := EXIT_ERRORS;
{$IFNDEF CI}
//We don't want this happening when running under CI.
if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
begin
System.Write('Done.. press <Enter> key to quit.');
System.Readln;
end;
{$ENDIF}
except
on E: Exception do
System.Writeln(E.ClassName, ': ', E.Message);
end;
end.
| 29.048387 | 89 | 0.684064 |
fc13fe04f8681cf2c9fdf85adfbe2f859e2549b7 | 4,064 | pas | Pascal | zengl_fork/zgl_camera_2d.pas | stiratel/zengl_fork | 4ab6c9f85d7beeaabe2cf535d4ef88761d0b49b6 | [
"Zlib"
]
| null | null | null | zengl_fork/zgl_camera_2d.pas | stiratel/zengl_fork | 4ab6c9f85d7beeaabe2cf535d4ef88761d0b49b6 | [
"Zlib"
]
| 1 | 2018-06-24T06:38:48.000Z | 2018-06-24T06:38:48.000Z | ZenGL/ZenGL_OGL/src/zgl_camera_2d.pas | farisss/penuhi-gizi | 9c1032aff4799dd91e7b68b0d476d1f889da6877 | [
"MIT"
]
| null | null | null | {
* Copyright (c) 2012 Andrey Kemka
*
* This software is provided 'as-is', without any express or
* implied warranty. In no event will the authors be held
* liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute
* it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented;
* you must not claim that you wrote the original software.
* If you use this software in a product, an acknowledgment
* in the product documentation would be appreciated but
* is not required.
*
* 2. Altered source versions must be plainly marked as such,
* and must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any
* source distribution.
}
unit zgl_camera_2d;
{$I zgl_config.cfg}
interface
uses
zgl_math_2d;
type
zglPCamera2D = ^zglTCamera2D;
zglTCamera2D = record
X, Y : Single;
Angle : Single;
Zoom : zglTPoint2D;
Center : zglTPoint2D;
end;
type
zglPCameraSystem = ^zglTCameraSystem;
zglTCameraSystem = record
Global : zglPCamera2D;
Apply : Boolean;
OnlyXY : Boolean;
CX : Single;
CY : Single;
ZoomX : Single;
ZoomY : Single;
end;
procedure cam2d_Init( out Camera : zglTCamera2D );
procedure cam2d_Set( Camera : zglPCamera2D );
function cam2d_Get : zglPCamera2D;
var
constCamera2D : zglTCamera2D = ( X: 0; Y: 0; Angle: 0; Zoom: ( X: 1; Y: 1 ); Center: ( X: 0; Y: 0 ) );
cam2d : zglPCameraSystem;
cam2dTarget : array[ 1..2 ] of zglTCameraSystem;
implementation
uses
zgl_screen,
{$IFNDEF USE_GLES}
zgl_opengl,
zgl_opengl_all,
{$ELSE}
zgl_opengles,
zgl_opengles_all,
{$ENDIF}
zgl_render_2d;
procedure cam2d_Init( out Camera : zglTCamera2D );
begin
Camera.X := 0;
Camera.Y := 0;
Camera.Angle := 0;
Camera.Zoom.X := 1;
Camera.Zoom.Y := 1;
Camera.Center.X := ( oglWidth - scrSubCX ) / 2;
Camera.Center.Y := ( oglHeight - scrSubCY ) / 2;
end;
procedure cam2d_Set( Camera : zglPCamera2D );
begin
batch2d_Flush();
if cam2d.Apply Then
glPopMatrix();
if Assigned( Camera ) Then
begin
cam2d.Global := Camera;
cam2d.Apply := TRUE;
cam2d.OnlyXY := ( cam2d.Global.Angle = 0 ) and ( cam2d.Global.Zoom.X = 1 ) and ( cam2d.Global.Zoom.Y = 1 );
if ( cam2d.ZoomX <> cam2d.Global.Zoom.X ) or ( cam2d.ZoomY <> cam2d.Global.Zoom.Y ) Then
render2dClipR := Round( sqrt( sqr( ( oglWidth - scrSubCX ) / cam2d.Global.Zoom.X ) + sqr( ( oglHeight - scrSubCY ) / cam2d.Global.Zoom.Y ) ) / 1.5 );
cam2d.CX := cam2d.Global.X + Camera.Center.X;
cam2d.CY := cam2d.Global.Y + Camera.Center.Y;
cam2d.ZoomX := cam2d.Global.Zoom.X;
cam2d.ZoomY := cam2d.Global.Zoom.Y;
glPushMatrix();
if not cam2d.OnlyXY Then
begin
glTranslatef( Camera.Center.X, Camera.Center.Y, 0 );
if ( Camera.Zoom.X <> 1 ) or ( Camera.Zoom.Y <> 1 ) Then
glScalef( Camera.Zoom.X, Camera.Zoom.Y, 1 );
if Camera.Angle <> 0 Then
glRotatef( Camera.Angle, 0, 0, 1 );
glTranslatef( -Camera.Center.X, -Camera.Center.Y, 0 );
end;
if ( Camera.X <> 0 ) or ( Camera.Y <> 0 ) Then
glTranslatef( -Camera.X, -Camera.Y, 0 );
sprite2d_InScreen := sprite2d_InScreenCamera;
end else
begin
cam2d.Global := @constCamera2D;
cam2d.Apply := FALSE;
sprite2d_InScreen := sprite2d_InScreenSimple;
end;
end;
function cam2d_Get : zglPCamera2D;
begin
Result := cam2d.Global;
end;
initialization
cam2d := @cam2dTarget[ TARGET_SCREEN ];
with cam2dTarget[ TARGET_SCREEN ] do
begin
Global := @constCamera2D;
OnlyXY := TRUE;
end;
with cam2dTarget[ TARGET_TEXTURE ] do
begin
Global := @constCamera2D;
OnlyXY := TRUE;
end;
end.
| 28.027586 | 157 | 0.637303 |
f1a419114038dff0f8223525f410888095133f3c | 5,695 | pas | Pascal | zint_reedsol.pas | jonahzheng/Zint-Barcode-Generator-for-Delphi | 2597216d2c2d25c405efebef9c1426ce71dcc555 | [
"Apache-2.0"
]
| 68 | 2018-03-25T12:18:30.000Z | 2022-03-27T16:08:22.000Z | zint_reedsol.pas | jonahzheng/Zint-Barcode-Generator-for-Delphi | 2597216d2c2d25c405efebef9c1426ce71dcc555 | [
"Apache-2.0"
]
| 14 | 2018-04-12T21:46:44.000Z | 2022-03-05T18:39:30.000Z | zint_reedsol.pas | jonahzheng/Zint-Barcode-Generator-for-Delphi | 2597216d2c2d25c405efebef9c1426ce71dcc555 | [
"Apache-2.0"
]
| 24 | 2018-04-03T10:29:26.000Z | 2022-02-27T11:33:57.000Z | unit zint_reedsol;
{
Based on Zint (done by Robin Stuart and the Zint team)
http://github.com/zint/zint
Translation by TheUnknownOnes
http://theunknownones.net
License: Apache License 2.0
Status:
3432bc9aff311f2aea40f0e9883abfe6564c080b complete
}
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
zint, zint_common;
type
TRSGlobals = record
gfpoly : Integer;
symsize : Integer; // in bits
logmod : Integer; // 2**Globals.symsize - 1
rlen : Integer;
logt, alog, rspoly : TArrayOfInteger;
end;
procedure rs_init_gf(poly : Integer; var Globals : TRSGlobals);
procedure rs_init_code(nsym : Integer; index : Integer; var Globals : TRSGlobals);
procedure rs_encode(len : Integer; const data : TArrayOfByte; var res : TArrayOfByte; var Globals : TRSGlobals);
procedure rs_encode_long(len : Integer; data : TArrayOfCardinal; var res : TArrayOfCardinal; var Globals : TRSGlobals);
procedure rs_free(var Globals : TRSGlobals);
implementation
// It is not written with high efficiency in mind, so is probably
// not suitable for real-time encoding. The aim was to keep it
// simple, general and clear.
//
// <Some notes on the theory and implementation need to be added here>
// Usage:
// First call rs_init_gf(poly) to set up the Galois Field parameters.
// Then call rs_init_code(size, index) to set the encoding size
// Then call rs_encode(datasize, data, out) to encode the data.
//
// These can be called repeatedly as required - but note that
// rs_init_code must be called following any rs_init_gf call.
//
// If the parameters are fixed, some of the statics below can be
// replaced with constants in the obvious way, and additionally
// malloc/free can be avoided by using static arrays of a suitable
// size.
// rs_init_gf(poly) initialises the parameters for the Galois Field.
// The symbol size is determined from the highest bit set in poly
// This implementation will support sizes up to 30 bits (though that
// will result in very large log/antilog tables) - bit sizes of
// 8 or 4 are typical
//
// The poly is the bit pattern representing the GF characteristic
// polynomial. e.g. for ECC200 (8-bit symbols) the polynomial is
// a**8 + a**5 + a**3 + a**2 + 1, which translates to 0x12d.
procedure rs_init_gf(poly : Integer; var Globals : TRSGlobals);
var
m, b, p, v : Integer;
begin
// Find the top bit, and hence the symbol size
b := 1;
m := 0;
while (b <= poly) do
begin
Inc(m);
b := b shl 1;
end;
b := b shr 1;
Dec(m);
Globals.gfpoly := poly;
Globals.symsize := m;
// Calculate the log/Globals.alog tables
Globals.logmod := (1 shl m) - 1;
SetLength(Globals.logt, Globals.logmod + 1);
SetLength(Globals.alog, Globals.logmod);
p := 1;
v := 0;
while (v < Globals.logmod) do
begin
Globals.alog[v] := p;
Globals.logt[p] := v;
p := p shl 1;
if (p and b) <> 0 then
p := p xor poly;
Inc(v);
end;
end;
// rs_init_code(nsym, index) initialises the Reed-Solomon encoder
// nsym is the number of symbols to be generated (to be appended
// to the input data). index is usually 1 - it is the index of
// the constant in the first term (i) of the RS generator polynomial:
// (x + 2**i)*(x + 2**(i+1))*... [nsym terms]
// For ECC200, index is 1.
procedure rs_init_code(nsym : Integer; index : Integer; var Globals : TRSGlobals);
var
i, k : Integer;
begin
SetLength(Globals.rspoly, nsym + 1);
Globals.rlen := nsym;
Globals.rspoly[0] := 1;
for i := 1 to nsym do
begin
Globals.rspoly[i] := 1;
for k := i - 1 downto 1 do
begin
if (Globals.rspoly[k] <> 0) then
Globals.rspoly[k] := Globals.alog[(Globals.logt[Globals.rspoly[k]] + index) mod Globals.logmod];
Globals.rspoly[k] := Globals.rspoly[k] xor Globals.rspoly[k - 1];
end;
Globals.rspoly[0] := Globals.alog[(Globals.logt[Globals.rspoly[0]] + index) mod Globals.logmod];
Inc(index);
end;
end;
procedure rs_encode(len : Integer; const data : TArrayOfByte; var res : TArrayOfByte; var Globals : TRSGlobals);
var
i, k, m : Integer;
begin
for i := 0 to Globals.rlen - 1 do
res[i] := 0;
for i := 0 to len - 1 do
begin
m := res[Globals.rlen - 1] xor data[i];
for k := Globals.rlen - 1 downto 1 do
begin
if (m <> 0) and (Globals.rspoly[k] <> 0) then
res[k] := res[k - 1] xor Globals.alog[(Globals.logt[m] + Globals.logt[Globals.rspoly[k]]) mod Globals.logmod]
else
res[k] := res[k - 1];
end;
if (m <> 0) and (Globals.rspoly[0] <> 0) then
res[0] := Globals.alog[(Globals.logt[m] + Globals.logt[Globals.rspoly[0]]) mod Globals.logmod]
else
res[0] := 0;
end;
end;
procedure rs_encode_long(len : Integer; data : TArrayOfCardinal; var res : TArrayOfCardinal; var Globals : TRSGlobals);
{ The same as above but for larger bitlengths - Aztec code compatible }
var
i, k, m : Integer;
begin
for i := 0 to Globals.rlen - 1 do
res[i] := 0;
for i := 0 to len - 1 do
begin
m := res[Globals.rlen - 1] xor data[i];
for k := Globals.rlen - 1 downto 1 do
begin
if (m <> 0) and (Globals.rspoly[k] <> 0) then
res[k] := res[k - 1] xor Cardinal(Globals.alog[(Globals.logt[m] + Globals.logt[Globals.rspoly[k]]) mod Globals.logmod])
else
res[k] := res[k - 1];
end;
if (m <> 0) and (Globals.rspoly[0] <> 0) then
res[0] := Globals.alog[(Globals.logt[m] + Globals.logt[Globals.rspoly[0]]) mod Globals.logmod]
else
res[0] := 0;
end;
end;
procedure rs_free(var Globals : TRSGlobals);
begin { Free memory }
SetLength(Globals.logt, 0);
SetLength(Globals.alog, 0);
SetLength(Globals.rspoly, 0);
end;
end.
| 29.205128 | 127 | 0.658121 |
83902b38afc872a676e1043e87130e0eafa7dddb | 6,090 | pas | Pascal | synaser/synadbg.pas | Moehre2/fpcupdeluxe | a427ed6e3b503b8ba295f8a818ca909c5a5bb34f | [
"zlib-acknowledgement"
]
| 198 | 2018-12-12T04:32:15.000Z | 2022-03-10T03:37:09.000Z | synaser/synadbg.pas | Moehre2/fpcupdeluxe | a427ed6e3b503b8ba295f8a818ca909c5a5bb34f | [
"zlib-acknowledgement"
]
| 425 | 2018-11-13T12:53:45.000Z | 2022-03-29T14:39:59.000Z | synaser/synadbg.pas | Moehre2/fpcupdeluxe | a427ed6e3b503b8ba295f8a818ca909c5a5bb34f | [
"zlib-acknowledgement"
]
| 55 | 2018-11-20T12:03:11.000Z | 2022-03-28T06:34:08.000Z | {==============================================================================|
| Project : Ararat Synapse | 001.001.002 |
|==============================================================================|
| Content: Socket debug tools |
|==============================================================================|
| Copyright (c)2008-2011, Lukas Gebauer |
| All rights reserved. |
| |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions are met: |
| |
| Redistributions of source code must retain the above copyright notice, this |
| list of conditions and the following disclaimer. |
| |
| Redistributions in binary form must reproduce the above copyright notice, |
| this list of conditions and the following disclaimer in the documentation |
| and/or other materials provided with the distribution. |
| |
| Neither the name of Lukas Gebauer nor the names of its contributors may |
| be used to endorse or promote products derived from this software without |
| specific prior written permission. |
| |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR |
| ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
| DAMAGE. |
|==============================================================================|
| The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).|
| Portions created by Lukas Gebauer are Copyright (c)2008-2011. |
| All Rights Reserved. |
|==============================================================================|
| Contributor(s): |
|==============================================================================|
| History: see HISTORY.HTM from distribution package |
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{:@abstract(Socket debug tools)
Routines for help with debugging of events on the Sockets.
}
{$IFDEF UNICODE}
{$WARN IMPLICIT_STRING_CAST OFF}
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}
{$ENDIF}
unit synadbg;
interface
uses
blcksock, synsock, synautil, classes, SysUtils, synafpc;
type
TSynaDebug = class(TObject)
class procedure HookStatus(Sender: TObject; Reason: THookSocketReason; const Value: string);
class procedure HookMonitor(Sender: TObject; Writing: Boolean; const Buffer: TMemory; Len: Integer);
end;
procedure AppendToLog(const value: Ansistring);
var
LogFile: string;
implementation
procedure AppendToLog(const value: Ansistring);
var
st: TFileStream;
s: string;
h, m, ss, ms: word;
dt: Tdatetime;
begin
if fileexists(LogFile) then
st := TFileStream.Create(LogFile, fmOpenReadWrite or fmShareDenyWrite)
else
st := TFileStream.Create(LogFile, fmCreate or fmShareDenyWrite);
try
st.Position := st.Size;
dt := now;
decodetime(dt, h, m, ss, ms);
s := formatdatetime('yyyymmdd-hhnnss', dt) + format('.%.3d', [ms]) + ' ' + value;
WriteStrToStream(st, s);
finally
st.free;
end;
end;
class procedure TSynaDebug.HookStatus(Sender: TObject; Reason: THookSocketReason; const Value: string);
var
s: string;
begin
case Reason of
HR_ResolvingBegin:
s := 'HR_ResolvingBegin';
HR_ResolvingEnd:
s := 'HR_ResolvingEnd';
HR_SocketCreate:
s := 'HR_SocketCreate';
HR_SocketClose:
s := 'HR_SocketClose';
HR_Bind:
s := 'HR_Bind';
HR_Connect:
s := 'HR_Connect';
HR_CanRead:
s := 'HR_CanRead';
HR_CanWrite:
s := 'HR_CanWrite';
HR_Listen:
s := 'HR_Listen';
HR_Accept:
s := 'HR_Accept';
HR_ReadCount:
s := 'HR_ReadCount';
HR_WriteCount:
s := 'HR_WriteCount';
HR_Wait:
s := 'HR_Wait';
HR_Error:
s := 'HR_Error';
else
s := '-unknown-';
end;
s := inttohex(PtrInt(Sender), 8) + s + ': ' + value + CRLF;
AppendToLog(s);
end;
class procedure TSynaDebug.HookMonitor(Sender: TObject; Writing: Boolean; const Buffer: TMemory; Len: Integer);
var
s, d: Ansistring;
begin
setlength(s, len);
move(Buffer^, pointer(s)^, len);
if writing then
d := '-> '
else
d := '<- ';
s :=inttohex(PtrInt(Sender), 8) + d + s + CRLF;
AppendToLog(s);
end;
initialization
begin
Logfile := changefileext(paramstr(0), '.slog');
end;
end.
| 38.789809 | 112 | 0.502627 |
47d31bc6fd3815e095f5693e31cdb6e388b6a2f2 | 338 | dpr | Pascal | D7/DelphiVersions_D7.dpr | atkins126/DelphiVersions-1 | 25c4a9233318823dafc72acb8ec4965b783d88e5 | [
"MIT"
]
| 5 | 2018-10-30T02:36:20.000Z | 2022-03-17T02:15:34.000Z | D7/DelphiVersions_D7.dpr | atkins126/DelphiVersions-1 | 25c4a9233318823dafc72acb8ec4965b783d88e5 | [
"MIT"
]
| null | null | null | D7/DelphiVersions_D7.dpr | atkins126/DelphiVersions-1 | 25c4a9233318823dafc72acb8ec4965b783d88e5 | [
"MIT"
]
| 3 | 2018-03-16T14:48:00.000Z | 2021-03-05T09:06:30.000Z | program DelphiVersions;
uses
Forms,
ufrmDelphiVersions in '..\ufrmDelphiVersions.pas' {frmDelphiVersions},
uConditionalList in '..\uConditionalList.pas';
{.$R *.res}
begin
Application.Initialize;
Application.Title := 'Delphi Versions';
Application.CreateForm(TfrmDelphiVersions, frmDelphiVersions);
Application.Run;
end.
| 21.125 | 72 | 0.763314 |
f14da1df601a65c7232164631a68e9f3bafe2762 | 11,486 | pas | Pascal | Base/Apus.Translation.pas | Gofrettin/ApusGameEngine | b56072b797664cf53a189747b17dbf03f17075a1 | [
"BSD-3-Clause"
]
| null | null | null | Base/Apus.Translation.pas | Gofrettin/ApusGameEngine | b56072b797664cf53a189747b17dbf03f17075a1 | [
"BSD-3-Clause"
]
| null | null | null | Base/Apus.Translation.pas | Gofrettin/ApusGameEngine | b56072b797664cf53a189747b17dbf03f17075a1 | [
"BSD-3-Clause"
]
| null | null | null | // Realtime text translation routines
// Author Ivan Polyacov (ivan@apus-software.com)
// This file is licensed under the terms of BSD-3 license (see license.txt)
// This file is a part of the Apus Base Library (http://apus-software.com/engine/#base)
// Dictionary file format (utf-8):
// -----
// LanguageID: ru
// ; comment
// [N] set of rules (0..99)
// Source %* string 1
// Translated %1 string 1
// (separator - empty string or comment)
// Source string 2
// Translated string 2
// -----
// Принцип работы перевода
// К исходной строке применяются последовательно все правила по порядку.
// %* матчит любые символы, поэтому имеет смысл только в середине выражения.
// %w матчит любые символы, кроме неотображаемых (пробел и т.п)
// %d матчит только цифры
// Т.о. порядок правил в словаре имеет значение.
// По умолчанию подстроки %n при переносе не переводятся, но если нужно перевести -
// нужно использовать формат %n{s}, где s - номер набора правил (0..9), которым следует перевести подстроку
// В самом конце удаляются подстроки вида `d (метки контекста, содержащие 1 цифру)
// Если в начале исходной строки стоит цифра с двоеточием и пробелом - то это цифра
// обозначает номер набора для конкретно этого правила
unit Apus.Translation;
interface
uses Apus.MyServis;
type
{$IFNDEF UNICODE}
MyString=WideString;
{$ELSE}
MyString=UnicodeString;
{$ENDIF}
var
languageID:string;
defaultEncoding:TTextEncoding=teUTF8;
// for statistics
trRuleFault:cardinal=0;
trRuleSuccess:cardinal=0;
// Load dictionary file
procedure LoadDictionary(filename:string);
// Add translation rule (ruleset=0..99)
procedure AddTranslationRule(sour,dest:MyString;ruleset:integer);
// Translate string using given set of rules (teUnknown = use default encoding)
function Translate8(st:string;ruleset:integer=0;encoding:TTextEncoding=teUnknown):string;
function Translate(st:MyString;ruleset:integer=0):MyString;
implementation
uses SysUtils,StrUtils;
type
// single rule
// Special characters: E1FA-E1FF - in sour (типы спецсимволов подстрок, %*, %w, %d ...)
// E1E0-E1E9,E1F0-E1F9 - in dest (X or XY, where X is substr index, Y - translation rule)
TRule=record
sour,dest:MyString;
sPos:array[0..9] of smallint;
sCnt:integer; // кол-во спецсимволов в sour
mask1,mask2:cardinal;
end;
TCache=record
sour,dest:array[0..31] of MyString;
first,last:integer; // первый занятый элемент, первый свободный
end;
TRulesSet=class
rules:array of TRule;
rCount:integer;
cache:TCache;
constructor Create;
destructor Destroy;
procedure AddRule(sour,dest:MyString);
function Translate(st:MyString):MyString;
end;
var
sets:array[0..99] of TRulesSet;
procedure AddTranslationRule(sour,dest:MyString;ruleset:integer);
begin
if sets[ruleset]=nil then
sets[ruleset]:=TRulesSet.Create;
sets[ruleset].AddRule(sour,dest);
end;
procedure LoadDictionary(filename:string);
var
f:text;
st8:string;
st,sour:MyString;
i,curSet,localSet:integer;
utf8:boolean;
begin
assign(f,filename);
try
reset(f);
curSet:=0;
localSet:=-1;
sour:='';
utf8:=false;
// Parse file
while not eof(f) do begin
readln(f,st8);
// convert 8-bit string to unicode
if not utf8 and IsUTF8(st8) then begin
utf8:=true;
delete(st8,1,3);
end;
if utf8 then st:=DecodeUTF8(st8)
else st:=UnicodeFrom(st8,teWin1251);
if length(st)=0 then begin // empty string
sour:=''; continue;
end;
if st[1]=';' then begin // comment
sour:=''; continue;
end;
if pos('LanguageID: ',st)=1 then begin
LanguageID:=copy(st,13,100);
continue;
end;
if (st[1]='[') and (length(st)>2) and (st[2] in ['0'..'9']) then begin // set
curSet:=StrToInt(st[2]);
if st[3] in ['0'..'9'] then curSet:=curSet*10+StrToInt(st[3]);
sour:=''; continue;
end;
if (length(st)>3) and (st[1] in ['0'..'9']) and (st[2]=':') and (st[3]=' ') then begin
localSet:=StrToInt(st[1]);
delete(st,1,3);
end;
// Rule
if sour<>'' then begin
if localSet>=0 then
AddTranslationRule(sour,st,localSet)
else
AddTranslationRule(sour,st,curSet);
localSet:=-1;
end else
sour:=st;
end;
close(f);
except
on e:exception do raise EError.Create('Error in LoadDictionary '+filename+': '+e.message);
end;
end;
function Translate8(st:string;ruleset:integer=0;encoding:TTextEncoding=teUnknown):string;
var
wst:MyString;
begin
if sets[ruleset]=nil then begin
result:=st; exit;
end;
if encoding=teUnknown then encoding:=defaultEncoding;
wst:=UnicodeFrom(st,encoding);
wst:=Translate(wst,ruleset);
result:=UnicodeTo(wst,encoding);
end;
function Translate(st:MyString;ruleset:integer=0):MyString;
begin
result:=sets[ruleset].Translate(st);
end;
procedure CalcBitmask(st:MyString;var m1,m2:cardinal); // inline;
var
i,h:integer;
w,wPrv:word;
begin
m1:=0; m2:=0;
if length(st)<2 then exit;
wPrv:=word(st[1]);
for i:=2 to length(st) do begin
w:=word(st[i]);
if ((w<$E1FA) or (w>$E1FF)) and
((wPrv<$E1FA) or (wPrv>$E1FF)) then begin // pair of non-special characters
h:=(w xor wPrv) and 63;
if h>=32 then m2:=m2 or (cardinal(1) shl (h-32))
else m1:=m1 or (cardinal(1) shl h);
end;
wPrv:=w;
end;
end;
{ TRulesSet }
procedure TRulesSet.AddRule(sour, dest: MyString);
var
b:byte;
i,c,l:integer;
m1,m2:cardinal;
w,wPrv:word;
begin
if rCount>=length(rules) then begin
SetLength(rules,length(rules)*2+10);
end;
// Заменить %* в sour
i:=1; c:=0;
while i<length(sour) do begin
if (sour[i]='%') and (sour[i+1] in ['*','d','w','+']) then begin
if sour[i+1]='*' then sour[i]:=WideChar($E1FA);
if sour[i+1]='d' then sour[i]:=WideChar($E1FB);
if sour[i+1]='w' then sour[i]:=WideChar($E1FC);
if sour[i+1]='+' then sour[i]:=WideChar($E1FD);
inc(c);
delete(sour,i+1,1);
end;
inc(i);
end;
// Заменить %d{n} в dest
i:=1;
while i<length(dest) do begin
if (dest[i]='%') and (dest[i+1] in ['1'..'9']) then begin
dest[i]:=WideChar($E1E0+word(dest[i+1])-ord('0'));
if (dest[i+2]='{') and (dest[i+3] in ['1'..'9']) and (dest[i+4]='}') then begin
dest[i+1]:=WideChar($E1F0+word(dest[i+3])-ord('0'));
delete(dest,i+2,3);
end else begin
delete(dest,i+1,1);
end;
end;
inc(i);
end;
// Добавить префикс и суффикс если необходимо
w:=word(sour[1]);
if w<$E1FA then begin
sour:=WideChar($E1FA)+sour; // %* в начало
dest:=WideChar($E1E0)+dest; // %0 в начало
end;
w:=word(sour[length(sour)]);
if w<>$E1FA then begin
sour:=sour+WideChar($E1FA); // %* в конец
dest:=dest+WideChar($E1E0+c+1); // %n в конец
end;
// запомнить позиции спецсимволов
c:=0;
for i:=1 to length(sour) do begin
w:=word(sour[i]);
if (w>=$E1FA) and (w<=$E1FF) then begin
rules[rCount].sPos[c]:=i;
inc(c);
end;
end;
rules[rCount].sCnt:=c;
// вычислить битмаску
CalcBitmask(sour,rules[rCount].mask1,rules[rCount].mask2);
// rule data
rules[rcount].sour:=sour;
rules[rcount].dest:=dest;
// Check for dupe
for i:=0 to rcount-1 do
if rules[i].sour=sour then begin
if rules[i].dest=dest then
LogMessage('Duplicated translation rule ignored for: '+sour)
else
LogMessage('WARNING! Translation rule conflict for: '+sour+' only 1-st rule will be used');
dec(rCount);
break;
end;
inc(rCount);
cache.first:=0;
cache.last:=0;
end;
constructor TRulesSet.Create;
var
i:integer;
begin
rCount:=0;
setLength(rules,10);
cache.first:=0;
cache.last:=0;
end;
destructor TRulesSet.Destroy;
begin
setLength(rules,0);
end;
// Locate substr in str starting from index, returns index of substr or 0 if not found
function WStrPos(substr,str:MyString;index:integer):integer; inline;
var
c,m,l:integer;
begin
result:=0;
l:=length(substr);
m:=length(str)-l+1;
while index<=m do begin
c:=0;
while c<l do begin
if str[index+c]<>substr[c+1] then break;
inc(c);
end;
if c=l then begin
result:=index; exit;
end;
inc(index);
end;
end;
// Забагованная процедура!
function TRulesSet.Translate(st: MyString): MyString;
var
i,j,k,r,p1,p2:integer;
m1,m2:cardinal;
mPos,mEnd:array[0..10] of integer;
mCnt:integer;
w,w2:word;
tmp:MyString;
begin
result:=st;
if self=nil then exit;
if rcount=0 then exit;
// поиск в кэше
with cache do begin
if first<>last then begin
i:=last;
j:=length(st);
while i<>first do begin
i:=(i-1) and 31;
if sour[i]=st then begin
result:=dest[i];
exit;
end;
end;
end;
sour[last]:=st;
end;
CalcBitmask(st,m1,m2);
for i:=0 to rCount-1 do with rules[i] do begin
// если в масках правила есть хоть один бит, которого нет в маске строки - значит правило к строке не подходит
if ((mask1 and not m1)>0) or
((mask2 and not m2)>0) then continue;
// попробуем применить правило
// нужно а) найти все подстроки из правила в правильном порядке б) произвести замены
mcnt:=0; // сколько подстрок найдено
k:=1; // точка начала поиска
p1:=sPos[0];
for j:=1 to sCnt-1 do begin
p2:=sPos[j];
r:=WStrPos(copy(sour,p1+1,p2-p1-1),st,k);
if r=0 then break;
inc(mcnt);
mPos[mcnt]:=r; // индекс начала найденной цепочки в st
mEnd[mcnt]:=r+p2-p1-2;
k:=(p2-p1-1)+r; // тут еще нужна валидация очередного спецсимвола, если он необычный
p1:=p2;
end;
if mcnt<sCnt-1 then begin
inc(trRuleFault);
continue; // правило не подходит
end;
// если дошли сюда - значит правило подходит и нужно его применить
inc(trRuleSuccess);
// здесь используется ручной код вместо стандартных ф-ций т.к. это НАМНОГО увеличивает скорость
setLength(result,length(dest)+length(st)); // заведомо достаточная длина
k:=0; // кол-во добавленных в result символов
mEnd[0]:=0;
mPos[mcnt+1]:=length(st)+1;
for j:=1 to length(dest) do begin
w:=word(dest[j]);
if (w>=$E1F0) and (w<=$E1F9) then continue;
if (w>=$E1E0) and (w<=$E1E9) then begin
w:=w-$E1E0;
if j<length(dest) then w2:=word(dest[j+1])
else w2:=0;
if (w2>=$E1F0) and (w2<=$E1F9) then begin
// translate substring
w2:=w2-$E1F0;
r:=mEnd[w]+1;
tmp:=sets[w2].Translate(copy(st,r,mPos[w+1]-r));
r:=1;
while r<=length(tmp) do begin
inc(k);
result[k]:=tmp[r];
inc(r);
end;
end else begin
// just copy substring from st
r:=mEnd[w]+1;
while r<mPos[w+1] do begin
inc(k);
result[k]:=st[r];
inc(r);
end;
end;
continue;
end;
inc(k);
result[k]:=WideChar(w);
end;
setLength(result,k);
st:=result;
CalcBitmask(st,m1,m2);
end;
// Add to cache
with cache do begin
dest[last]:=result;
last:=(last+1) and 31;
if last=first then first:=(first+1) and 31;
end;
end;
end.
| 27.610577 | 114 | 0.613094 |
f151dad961471a9b77a40a27ea412b9350711e12 | 8,470 | pas | Pascal | w/wham.pas | ssg/wolverine | eb300e09ed062127d08703b6f9a2b47473e930cd | [
"BSD-3-Clause"
]
| 23 | 2015-02-16T17:42:19.000Z | 2022-03-28T18:20:01.000Z | w/wham.pas | ssg/wolverine | eb300e09ed062127d08703b6f9a2b47473e930cd | [
"BSD-3-Clause"
]
| null | null | null | w/wham.pas | ssg/wolverine | eb300e09ed062127d08703b6f9a2b47473e930cd | [
"BSD-3-Clause"
]
| 2 | 2015-11-04T11:19:57.000Z | 2020-02-03T23:28:10.000Z | {
Wham Packet implementation
updates:
--------
7th Aug 96 - 23:52 - almost ok...
12th Aug 96 - 12:17 - seems like finished...
4th Sep 96 - 02:32 - Some fixes...
}
unit Wham;
interface
uses
Objects,WTypes;
const
WHAMSign = $4D414857; { wham signature }
wptNormal = 0; { normal mail packet }
wptReply = 1; { reply packet }
wptArchive = 2; { archive packet }
wpfEncrypted = 1; { packet has been encrypted - n/a yet }
type
TWHAMInfo = record
Sign : longint; { wham signature }
Version : byte; { packet version }
PakType : byte; { packet type }
Flags : word; { packet flags }
Netflags : word; { allowed netmail flags }
System : string[39]; { system name which packet has been created on }
SysOp : string[39]; { sysop of system }
Addr : TAddr; { netmail addr of system }
Owner : string[39]; { name of the packet owner }
Alias : string[39]; { alias of packet owner }
ProgName : string[39]; { program which created the packet }
Pad : array[1..294] of byte; {512 bytes}
end;
TWHAMArea = record
Name : string[49];
Number : word;
AreaType : byte;
UserStat : byte;
Flags : word;
Total : word;
Pers : word;
Null : array[1..66] of byte; {padding }
end;
TWHAMIndex = record
From : string[39];
Too : string[39];
Subj : string[79];
Area : word;
Date : longint;
Origin : TAddr;
Dest : TAddr;
Flags : word;
mFlags : byte;
mMarks : byte;
Size : longint;
Where : longint;
Filename : string[12];
Null : array[1..49] of byte; {padding}
end;
PWHAMPacket = ^TWHAMPacket;
TWHAMPacket = object(TMsgPacket)
function Load:boolean;virtual;
function ReadMsgText(amsg:PMsg):PMsgText;virtual;
function GetType:TPakType;virtual;
procedure PostMsg(amsg:PMsg; afile:FnameStr);virtual;
procedure OLC(aarealist:PAreaColl);virtual;
procedure UpdateMsgFlags(amsg:PMsg);virtual;
procedure WriteMsgHeader(amsg:Pmsg; anew:boolean);virtual;
procedure MsgToFile(amsg:Pmsg; afile:FnameStr);virtual;
procedure FileToMsg(afile:FnameStr; amsg:PMsg);virtual;
procedure DeleteMsg(amsg:Pmsg);virtual;
end;
implementation
uses XIO,WProcs,XBuf,XStr,XDebug;
const
infoFile : string[12] = 'Info.W';
indexFile : string[12] = 'Index.W';
textFile : string[12] = 'Text.W';
procedure WHAM2Msg(var wm:TWHAMIndex; var msg:TMsg);
begin
ClearBuf(msg,SizeOf(msg));
with wm do begin
Msg.From := From;
Msg.Too := Too;
Msg.Subj := Subj;
Msg.Addr := Origin;
Msg.Date := Date;
Msg.WHere := Where;
Msg.Length := Size;
Msg.Flags := mFlags;
Msg.Marks := mMarks;
end;
end;
{- TWHAMPacket -}
function TWHAMPacket.Load;
var
T:TDosStream;
rec:TWHAMInfo;
areaRec:TWHAMArea;
msgrec:TWHAMIndex;
Pm:PMsg;
Pa:PArea;
curfti:word;
realPacket:boolean;
function mytest(Ph:PArea):boolean;far;
begin
mytest := Ph^.Number = msgrec.Area;
end;
begin
Load := false;
Config := mpcInfo;
T.Init(Where+infoFile,stOpenRead);
if T.Status <> stOK then begin
Debug('info open error');
T.Done;
exit;
end;
T.Read(rec,SizeOf(rec));
if T.Status <> stOK then begin
Debug('info read error');
T.Done;
exit;
end;
case rec.PakType of
wptReply : Config := Config or mpcCanPost or mpcCanDelete or mpcCanOLC;
wptArchive : Config := Config or mpcCanPost or mpcCanDelete;
end; {case}
if rec.Sign <> WHAMSign then begin
Debug('signature mismatch');
T.Done;
exit;
end;
if rec.Flags and wpfEncrypted > 0 then begin
Debug('encrypted packet - cannot handle this');
T.Done;
exit;
end;
with user do begin
Name := rec.Owner;
Alias := rec.Alias;
SysOp := rec.SysOp;
BBS := rec.System;
Netflags := rec.Netflags;
end;
Debug(user.BBS+' loading');
while T.GetPos < T.GetSize do begin
T.Read(areaRec,SizeOf(areaRec));
if T.Status <> stOK then begin
Debug('area broken');
T.Done;
exit;
end;
New(Pa);
ClearBuf(Pa^,SizeOf(TArea));
with Pa^ do begin
Number := areaRec.Number;
Name := areaRec.Name;
Total := areaRec.Total;
Pers := areaRec.Pers;
Flags := areaRec.Flags;
UserStat := areaRec.UserStat;
AreaType := areaRec.areaType;
EchoTag := 'shit';
end;
arealist^.Insert(Pa);
end;
T.Done;
T.Init(Where+indexFile,stOpenRead);
realPacket := T.Status = stOK;
if realPacket then begin
curfti := 0;
while T.GetPos < T.getSize do begin
T.Read(msgrec,SizeOf(msgrec));
if msgrec.Flags and wmfDeleted = 0 then begin
New(Pm);
WHAM2Msg(msgrec,Pm^);
Pm^.Area := arealist^.FirstThat(@mytest);
if Pm^.Area = NIL then Debug('orphaned message!');
Pm^.FTINum := curfti;
inc(curfti);
msglist^.Insert(Pm);
end else Debug('deleted message encountered');
end;
end;
T.Done;
Load := true;
end;
function TWHAMPacket.ReadMsgText(amsg:PMsg):PMsgText;
var
T:TDosStream;
begin
T.Init(Where+textFile,stOpenRead);
T.Seek(amsg^.Where);
ReadMsgText := stream2Text(T,amsg^.Length);
T.Done;
end;
procedure TWHAMPacket.PostMsg;
var
I,O:TDosStream;
fn:FnameStr;
begin
if Config and mpcCanPost = 0 then exit;
I.Init(afile,stOpenRead);
fn := XGetUniqueName(Where,'.WM');
O.Init(Where+fn,stCreate);
CopyStream(I,O,I.getSize);
I.Done;
O.Done;
amsg^.Filename := fn;
WriteMsgHeader(amsg,true);
end;
procedure GetWHAMInfo(var rec:TWHAMInfo);
begin
ClearBuf(rec,SizeOf(rec));
with rec do begin
Sign := WHAMSign;
Flags := 0;
Netflags := 0;
System := user.BBS;
SysOp := user.SysOp;
Owner := user.Name;
Alias := user.Alias;
ProgName := appName+' '+rVersion;
end;
end;
procedure Reply2WHAM(var rr:TMsg; var wm:TWHAMIndex);
begin
end;
procedure TWHAMPacket.WriteMsgHeader;
var
T:TDosStream;
rec:TWHAMIndex;
h:TWHAMInfo;
begin
if Config and mpcCanPost = 0 then exit;
if not XFileExists(Where+infoFile) then begin
if not anew then Abort('TWHAMPacket.WriteReplyHeader','Inconsistency!');
Debug('creating new infoFile');
GetWHAMInfo(h);
T.Init(Where+infoFile,stCreate);
T.Write(h,SizeOf(h));
T.Done;
T.Init(Where+indexFile,stCreate);
end else T.Init(Where+indexFile,stOpen);
if anew then T.Seek(T.GetSize) else begin
while T.GetPos < T.GetSize do begin
T.Read(rec,SizeOf(rec));
if rec.Filename = amsg^.Filename then begin
T.Seek(T.GetPos-SizeOf(rec));
break;
end;
end;
end;
Reply2WHAM(amsg^,rec);
T.Write(rec,SizeOf(rec));
T.Done;
end;
procedure TWHAMPacket.MsgToFile;
begin
CopyFile(Where+amsg^.Filename,afile);
end;
procedure TWHAMPacket.FileToMsg;
begin
CopyFile(afile,Where+amsg^.Filename);
end;
procedure TWHAMPacket.DeleteMsg;
begin
end;
procedure TWHAMPacket.UpdateMsgFlags;
var
T:TDosStream;
apos:longint;
rec:TWHAMIndex;
begin
T.Init(Where+indexFile,stOpen);
apos := amsg^.FTINum*SizeOf(TWHAMIndex);
T.Seek(apos);
T.Read(rec,SizeOf(rec));
rec.mFlags := amsg^.Flags;
rec.mMarks := amsg^.Marks;
T.Seek(apos);
T.Write(rec,SizeOf(rec));
T.Done;
end;
function TWHAMPacket.GetType;
begin
GetType := pakWHAM;
end;
procedure GetReplyHeader(var hdr:TWHAMInfo);
begin
ClearBuf(hdr,SizeOf(hdr));
with hdr do begin
Sign := WHAMSign;
PakType := wptReply;
Owner := user.Name;
Alias := user.Alias;
ProgName := appName+' v'+rVersion;
end;
end;
procedure Area2WHAM(var a:TArea; var w:TWHAMArea);
begin
ClearBuf(w,SizeOf(w));
with w do begin
Name := a.Name;
Number := a.Number;
AreaType := a.AreaType;
UserStat := a.UserStat;
Flags := a.Flags;
end;
end;
procedure TWHAMPacket.OLC;
var
T:TDosStream;
h:TWHAMInfo;
rec:TWHAMArea;
n:integer;
P:PArea;
begin
T.Init(Where+infoFile,stOpen);
if T.Status <> stOK then begin
T.Init(Where+infoFile,stCreate);
GetReplyHeader(h);
T.Write(h,SizeOf(h));
end else T.Seek(SizeOf(h));
for n:=0 to areaList^.Count-1 do begin
P := areaList^.At(n);
if (P^.AreaType <> watInfo) and (P^.UserStat <> wusNone) then begin
Area2WHAM(P^,rec);
T.Write(rec,SizeOf(rec));
end;
end;
T.Done;
end;
end. | 22.95393 | 77 | 0.629398 |
472066b13b3a00a8a53071627995a6590f61387a | 2,910 | dfm | Pascal | hutton.dfm | GirkovArpa/hutton-exe | d48adea067da3351fbd7157a88a9ef09e19f01d2 | [
"MIT"
]
| null | null | null | hutton.dfm | GirkovArpa/hutton-exe | d48adea067da3351fbd7157a88a9ef09e19f01d2 | [
"MIT"
]
| null | null | null | hutton.dfm | GirkovArpa/hutton-exe | d48adea067da3351fbd7157a88a9ef09e19f01d2 | [
"MIT"
]
| null | null | null | object Form1: TForm1
Left = 0
Top = 0
BorderStyle = bsSingle
Caption = 'Hutton Cipher'
ClientHeight = 339
ClientWidth = 710
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object inputPlaintext: TLabeledEdit
Left = 8
Top = 32
Width = 684
Height = 22
EditLabel.Width = 46
EditLabel.Height = 13
EditLabel.Caption = 'Plaintext:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
TabOrder = 0
Text = 'MEETMEATTHEGREENMANATTHREE'
OnChange = inputPlaintextChange
end
object inputCiphertext: TLabeledEdit
Left = 8
Top = 80
Width = 684
Height = 22
EditLabel.Width = 55
EditLabel.Height = 13
EditLabel.Caption = 'Ciphertext:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
TabOrder = 1
OnChange = inputCiphertextChange
end
object inputAlphabetKey: TLabeledEdit
Left = 8
Top = 176
Width = 684
Height = 22
EditLabel.Width = 68
EditLabel.Height = 13
EditLabel.Caption = 'Alphabet Key:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
TabOrder = 2
Text = 'JUPITER'
OnChange = inputAlphabetKeyChange
end
object inputPassword: TLabeledEdit
Left = 8
Top = 128
Width = 684
Height = 22
EditLabel.Width = 50
EditLabel.Height = 13
EditLabel.Caption = 'Password:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
TabOrder = 3
Text = 'FEDORA'
OnChange = inputPasswordChange
end
object inputAlphabetKeyed: TLabeledEdit
Left = 8
Top = 224
Width = 684
Height = 22
EditLabel.Width = 80
EditLabel.Height = 13
EditLabel.Caption = 'Keyed Alphabet:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Courier New'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 4
end
object buttonEncrypt: TButton
Left = 8
Top = 264
Width = 684
Height = 25
Caption = 'Encrypt'
TabOrder = 5
OnClick = buttonEncryptClick
end
object buttonDecrypt: TButton
Left = 8
Top = 304
Width = 684
Height = 25
Caption = 'Decrypt'
TabOrder = 6
OnClick = buttonDecryptClick
end
end
| 23.467742 | 42 | 0.612715 |
f1d2090a51a5ffe69e30cee26300b9588a2227ba | 4,772 | pas | Pascal | Units/FormatAssociation.pas | gzwplato/DiagramDesigner | ded557d632490bf8fc1c440c1276fe4356a8f9fa | [
"MIT"
]
| 79 | 2019-11-02T15:07:36.000Z | 2022-03-11T14:04:54.000Z | Units/FormatAssociation.pas | bravesoftdz/DiagramDesigner | d2ad6860b653a2133b18110a03c29e5f727f60ad | [
"MIT"
]
| 5 | 2019-11-02T16:06:10.000Z | 2021-01-11T09:36:53.000Z | Units/FormatAssociation.pas | bravesoftdz/DiagramDesigner | d2ad6860b653a2133b18110a03c29e5f727f60ad | [
"MIT"
]
| 34 | 2019-11-11T02:49:37.000Z | 2022-03-11T14:04:43.000Z | unit FormatAssociation;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, StyleForm, Types, Math;
type
TFormatAssociateForm = class(TStyleForm)
AssociateButton: TButton;
CancelButton: TButton;
NoneButton: TButton;
Panel: TPanel;
ScrollBox: TScrollBox;
DescriptionBox: TCheckBox;
AllButton: TButton;
NoteLabel: TLabel;
OpenActionButton: TRadioButton;
EditActionButton: TRadioButton;
procedure SelectButtonClick(Sender: TObject);
procedure AssociateButtonClick(Sender: TObject);
procedure ScrollBoxMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
class procedure Execute(Formats: string; const IconIndex: array of Integer; SelectAll: Boolean=False; SkipButton: Boolean=False; EditAction: Boolean=False);
end;
implementation
uses FileUtils;
{$R *.DFM}
resourcestring
rsSkip = 'Skip';
class procedure TFormatAssociateForm.Execute(Formats: string; const IconIndex: array of Integer; SelectAll,SkipButton,EditAction: Boolean);
var
Y, P, ExtensionCount, FormatIndex : Integer;
Str, Description, Ext : string;
Form : TFormatAssociateForm;
begin
Form:=Create(nil,GetActiveFormHandle);
with Form do
try
Caption:=Caption+' '+Application.Title;
if SkipButton then CancelButton.Caption:=rsSkip;
if (Application.MainForm=nil) or (Application.MainForm.Width=0) then Position:=poScreenCenter;
ResetControlAnchors(Form);
if EditAction then EditActionButton.Checked:=True
else
begin
OpenActionButton.Visible:=False;
EditActionButton.Visible:=False;
end;
Y:=4;
ExtensionCount:=0;
FormatIndex:=0;
while Formats<>'' do
begin
P:=Pos('|',Formats);
if P=0 then P:=Length(Formats)+1;
Str:=Copy(Formats,1,P-1);
Delete(Formats,1,P);
P:=Pos('*.',Str);
Description:=Copy(Str,1,P-2);
while P<>0 do
begin
Delete(Str,1,P);
P:=2;
while (P<Length(Str)) and not (Str[P] in [',',';',' ',')']) do Inc(P);
with TCheckBox.Create(ScrollBox) do
begin
Ext:=Copy(Str,1,P-1);
Tag:=IconIndex[Min(High(IconIndex),FormatIndex)];
Caption:=Description+'(*'+Ext+')';
{$IFOPT D+}
Caption:=Caption+' ['+IntToStr(Tag)+']';
{$ENDIF}
Left:=6;
Top:=Y;
Width:=ScrollBox.ClientWidth;
Checked:=SelectAll or IsFormatRegistered(Ext,Application.Title);
Inc(Y,Height+6);
Parent:=ScrollBox;
Inc(ExtensionCount);
end;
P:=Pos('*.',Str);
end;
Delete(Formats,1,Pos('|',Formats));
Inc(FormatIndex);
end;
if ExtensionCount=1 then
begin
AllButton.Visible:=False;
NoneButton.Visible:=False;
end;
if ExtensionCount>0 then ShowModal;
finally
Free;
end;
end;
procedure TFormatAssociateForm.FormCreate(Sender: TObject);
begin
Font.Color:=clWindowText;
NoteLabel.Font.Style:=[fsBold];
end;
procedure TFormatAssociateForm.SelectButtonClick(Sender: TObject);
var
I : Integer;
begin
for I:=0 to ScrollBox.ControlCount-1 do TCheckBox(ScrollBox.Controls[I]).Checked:=(Sender=AllButton);
end;
procedure TFormatAssociateForm.AssociateButtonClick(Sender: TObject);
var
I, P : Integer;
Str, Description : string;
begin
Screen.Cursor:=crHourGlass;
try
Description:='';
for I:=0 to ScrollBox.ControlCount-1 do
begin
with TCheckBox(ScrollBox.Controls[I]) do if Checked then
begin
Str:=Caption;
P:=Pos('*.',Str);
if DescriptionBox.Checked then Description:=Copy(Str,1,P-3);
Delete(Str,1,P);
P:=2;
while (P<Length(Str)) and not (Str[P] in [',',';',' ',')']) do Inc(P);
RegisterFileFormat(Copy(Str,1,P-1),Application.Title,Description,'',Tag,EditActionButton.Checked);
end
else // Unassociate
begin
Str:=Caption;
P:=Pos('*.',Str);
Delete(Str,1,P);
P:=2;
while (P<Length(Str)) and not (Str[P] in [',',';',' ',')']) do Inc(P);
Str:=Copy(Str,1,P-1);
if IsFormatRegistered(Str,Application.Title) then
RegisterFileFormat(Str,'');
end;
end;
finally
Screen.Cursor:=crDefault;
end;
ModalResult:=mrOk;
end;
procedure TFormatAssociateForm.ScrollBoxMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
ScrollBox.VertScrollBar.Position:=ScrollBox.VertScrollBar.Position-WheelDelta div 2;
Handled:=True;
end;
end.
| 28.236686 | 160 | 0.653395 |
476a4af985aba1ac1e33eace9398c436a356e3a1 | 3,783 | pas | Pascal | software/ch341mw.pas | systemcrash/UsbAsp-flash | e326006ae42d0eae6f64f7eb658ba873b9ed6ca1 | [
"MIT"
]
| 1 | 2021-04-29T18:58:04.000Z | 2021-04-29T18:58:04.000Z | software/ch341mw.pas | systemcrash/UsbAsp-flash | e326006ae42d0eae6f64f7eb658ba873b9ed6ca1 | [
"MIT"
]
| null | null | null | software/ch341mw.pas | systemcrash/UsbAsp-flash | e326006ae42d0eae6f64f7eb658ba873b9ed6ca1 | [
"MIT"
]
| 1 | 2020-09-08T10:18:34.000Z | 2020-09-08T10:18:34.000Z | unit ch341mw;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, CH341DLL, utilfunc, dialogs;
function ch341mw_busy(): boolean;
function ch341mw_sendop(opcode: byte; AddrBitLen: byte): boolean;
function ch341mw_read(AddrBitLen: byte; Addr: word; var buffer: array of byte; bufflen: integer): integer;
function ch341mw_write(AddrBitLen: byte; Addr: word; var buffer: array of byte; bufflen: integer): integer;
implementation
function ch341mw_busy(): boolean;
var
port: byte;
begin
CH341Set_D5_D0(0, %00101001, 0);
CH341Set_D5_D0(0, %00101001, 1); //cs hi
CH341GetStatus(0, @port);
result := not IsBitSet(port, 7);
CH341Set_D5_D0(0, %00101001, 0);
end;
function ch341mw_sendop(opcode: byte; AddrBitLen: byte): boolean;
var
buff: array[0..15] of byte;
begin
result := true;
CH341Set_D5_D0(0, %00101001, 0);
CH341Set_D5_D0(0, %00101001, 1); //cs hi
FillByte(buff, sizeOf(buff), 1); //cs hi
BitSet(1, buff[0], 5); //стартовый бит
BitSet(0, buff[1], 5);
BitSet(0, buff[2], 5);
//Опкод
if IsBitSet(opcode, 1) then
BitSet(1, buff[3], 5)
else
BitSet(0, buff[3], 5);
if IsBitSet(opcode, 0) then
BitSet(1, buff[4], 5)
else
BitSet(0, buff[4], 5);
if not CH341BitStreamSPI(0, AddrBitLen+3, @buff) then result := false;
CH341Set_D5_D0(0, %00101001, 0);
end;
function ch341mw_read(AddrBitLen: byte; Addr: word; var buffer: array of byte; bufflen: integer): integer;
var
buff: array[0..15] of byte;
bit_buffer: array of byte;
i,j: integer;
begin
result := bufflen;
CH341Set_D5_D0(0, %00101001, 0);
FillByte(buff, SizeOf(buff), 1); //cs hi
BitSet(1, buff[0], 5); //стартовый бит
//Опкод 10b
BitSet(1, buff[1], 5);
BitSet(0, buff[2], 5);
//адрес
for i:=0 to AddrBitLen-1 do
begin
if IsBitSet(Addr, AddrBitLen-1-i) then //устанавливаем биты от старшего к младшему
BitSet(1, buff[i+3], 5)
else
BitSet(0, buff[i+3], 5);
end;
//Засылаем адрес
if not CH341BitStreamSPI(0, AddrBitLen+3, @buff) then result :=0; //стартовый бит + 2 бита опкод
SetLength(bit_buffer, Bufflen*8);
FillByte(bit_buffer[0], Bufflen*8, 1); //cs hi
if not CH341BitStreamSPI(0, Bufflen*8, @bit_buffer[0]) then result :=0; //читаем биты
for i:=0 to bufflen-1 do
begin
for j:=0 to 7 do
begin
if IsBitSet(bit_buffer[(i*8)+j], 7) then //читаем DIN
BitSet(1, buffer[i], 7-j) //устанавливаем биты от старшего к младшему
else
BitSet(0, buffer[i], 7-j);
end;
end;
CH341Set_D5_D0(0, %00101001, 0); //кончаем
end;
function ch341mw_write(AddrBitLen: byte; Addr: word; var buffer: array of byte; bufflen: integer): integer;
var
buff: array[0..15] of byte;
bit_buffer: array of byte;
i,j: integer;
begin
result := bufflen;
CH341Set_D5_D0(0, %00101001, 0);
FillByte(buff, 16, 1); //cs hi
BitSet(1, buff[0], 5); //стартовый бит
//Опкод 01b
BitSet(0, buff[1], 5);
BitSet(1, buff[2], 5);
//адрес
for i:=0 to AddrBitLen-1 do
begin
if IsBitSet(Addr, AddrBitLen-1-i) then //устанавливаем биты от старшего к младшему
BitSet(1, buff[i+3], 5)
else
BitSet(0, buff[i+3], 5);
end;
//Засылаем адрес
if not CH341BitStreamSPI(0, AddrBitLen+3, @buff) then result :=0; //стартовый бит + 2 бита опкод
SetLength(bit_buffer, Bufflen*8);
FillByte(bit_buffer[0], Bufflen*8, 1); //cs hi
for i:=0 to bufflen-1 do
begin
for j:=0 to 7 do
begin
if IsBitSet(buffer[i], 7-j) then //читаем буфер
BitSet(1, bit_buffer[(i*8)+j], 5) //устанавливаем биты от старшего к младшему
else
BitSet(0, bit_buffer[(i*8)+j], 5);
end;
end;
if not CH341BitStreamSPI(0, Bufflen*8, @bit_buffer[0]) then result :=0; //записываем биты
CH341Set_D5_D0(0, %00101001, 0); //кончаем
end;
end.
| 25.05298 | 107 | 0.655564 |
fc3c4cf3c2702b495a68e01c6fdeba80e943a36b | 4,175 | dfm | Pascal | Src/Graphics32/Examples/Drawing/MeshGradients/MainUnit.dfm | ryujt/ryulib-delphi | a59d308d6535de6a2fdb1ac49ded981849031c60 | [
"MIT"
]
| 12 | 2019-11-09T11:44:47.000Z | 2022-03-01T23:38:30.000Z | Src/Graphics32/Examples/Drawing/MeshGradients/MainUnit.dfm | ryujt/ryulib-delphi | a59d308d6535de6a2fdb1ac49ded981849031c60 | [
"MIT"
]
| 1 | 2019-11-08T08:27:34.000Z | 2019-11-08T08:43:51.000Z | Src/Graphics32/Examples/Drawing/MeshGradients/MainUnit.dfm | ryujt/ryulib-delphi | a59d308d6535de6a2fdb1ac49ded981849031c60 | [
"MIT"
]
| 15 | 2019-10-15T12:34:29.000Z | 2021-02-23T08:25:48.000Z | object FrmMeshGradients: TFrmMeshGradients
Left = 0
Top = 0
Caption = 'Mesh Gradient Demo'
ClientHeight = 481
ClientWidth = 688
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
DesignSize = (
688
481)
PixelsPerInch = 96
TextHeight = 13
object PnlSettings: TPanel
Left = 511
Top = 0
Width = 177
Height = 481
Align = alRight
TabOrder = 0
DesignSize = (
177
481)
object LblBackgroundSampler: TLabel
Left = 8
Top = 23
Width = 101
Height = 13
Caption = 'Background Sampler:'
end
object LblVertexColor: TLabel
Left = 8
Top = 236
Width = 29
Height = 13
Caption = 'Color:'
Visible = False
end
object VertexColorShape: TShape
Left = 43
Top = 234
Width = 16
Height = 16
Visible = False
OnMouseDown = VertexColorShapeMouseDown
end
object LblPower: TLabel
Left = 8
Top = 68
Width = 34
Height = 13
Caption = 'Power:'
end
object PnlSampler: TPanel
Left = 1
Top = 1
Width = 175
Height = 16
Align = alTop
BevelOuter = bvNone
Caption = 'Sampler'
Color = clBtnShadow
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindow
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
end
object CmbBackgroundSampler: TComboBox
Left = 8
Top = 39
Width = 161
Height = 21
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
ItemIndex = 0
TabOrder = 1
Text = 'None'
OnChange = CmbBackgroundSamplerChange
Items.Strings = (
'None'
'Voronoi'
'Voronoi (HQ)'
'Shepards'
'Custom IDW')
end
object PnlVertex: TPanel
Left = 1
Top = 206
Width = 175
Height = 16
BevelOuter = bvNone
Caption = 'Vertex'
Color = clBtnShadow
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindow
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 2
end
object GbrPower: TGaugeBar
Left = 48
Top = 66
Width = 121
Height = 17
Anchors = [akLeft, akTop, akRight]
Backgnd = bgPattern
Max = 10000
Min = 1
ShowHandleGrip = True
Style = rbsMac
Position = 10000
OnChange = GbrPowerChange
end
object BtnStore: TButton
Left = 14
Top = 417
Width = 147
Height = 25
Caption = '&Store Vertices'
TabOrder = 4
OnClick = BtnStoreClick
end
object BtnRecall: TButton
Left = 14
Top = 448
Width = 147
Height = 25
Caption = '&Recall Vertices'
Enabled = False
TabOrder = 5
OnClick = BtnRecallClick
end
object PnlDelaunayTriangulation: TPanel
Left = 1
Top = 107
Width = 175
Height = 16
BevelOuter = bvNone
Caption = 'Delaunay Triangulation'
Color = clBtnShadow
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindow
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 6
end
object CbxColoredPolygons: TCheckBox
Left = 16
Top = 129
Width = 129
Height = 17
Caption = 'Show Colored Polygon'
Checked = True
State = cbChecked
TabOrder = 7
OnClick = CbxColoredPolygonsClick
end
end
object PaintBox32: TPaintBox32
Left = 8
Top = 8
Width = 497
Height = 465
Anchors = [akLeft, akTop, akRight, akBottom]
TabOrder = 1
OnDblClick = SelectVertexColorClick
OnMouseDown = PaintBox32MouseDown
OnMouseMove = PaintBox32MouseMove
OnMouseUp = PaintBox32MouseUp
OnPaintBuffer = PaintBox32PaintBuffer
end
object ColorDialog: TColorDialog
Options = [cdFullOpen, cdAnyColor]
Left = 336
Top = 240
end
end
| 21.858639 | 48 | 0.578204 |
cddd3ba7936b9bc4fe546c2483b4656b32ac7ccd | 936 | pas | Pascal | Part5/SmartPointer/uLifeMgr.pas | dalijap/code-delphi-mm | 675cec04f5828ea4b32668fbb36fae49cacc0ab3 | [
"MIT"
]
| 5 | 2020-06-03T07:10:39.000Z | 2021-01-22T13:58:14.000Z | Part5/SmartPointer/uLifeMgr.pas | dalijap/code-delphi-mm | 675cec04f5828ea4b32668fbb36fae49cacc0ab3 | [
"MIT"
]
| null | null | null | Part5/SmartPointer/uLifeMgr.pas | dalijap/code-delphi-mm | 675cec04f5828ea4b32668fbb36fae49cacc0ab3 | [
"MIT"
]
| 4 | 2021-01-12T19:37:00.000Z | 2021-07-09T10:01:27.000Z | unit uLifeMgr;
interface
// SmartPointer implementation with regular interface
// for disctinction named LifetimeManager
type
ILifetimeManager<T> = interface
function Value: T;
end;
TLifetimeManager<T: class, constructor> = class(TInterfacedObject, ILifetimeManager<T>)
private
FValue: T;
function Value: T;
public
constructor Create; overload;
constructor Create(AValue: T); overload;
destructor Destroy; override;
end;
implementation
constructor TLifetimeManager<T>.Create;
begin
inherited Create;
FValue := T.Create;
end;
constructor TLifetimeManager<T>.Create(AValue: T);
begin
inherited Create;
FValue := AValue;
end;
destructor TLifetimeManager<T>.Destroy;
begin
writeln('Lifetime Manager Free ' + FValue.ClassName);
FValue.Free;
inherited;
end;
function TLifetimeManager<T>.Value: T;
begin
Result := FValue;
end;
end.
| 18.72 | 90 | 0.700855 |
f176444af18b95a5b87a3a113b471bc57a6cc2f4 | 122,018 | pas | Pascal | Source/JvDockVSNetStyle.pas | atkins126/pyscripter | 285faf37ebcc1c0c82751206ea9827785e226876 | [
"MIT"
]
| 769 | 2015-08-26T03:24:37.000Z | 2022-03-31T15:58:00.000Z | Source/JvDockVSNetStyle.pas | atkins126/pyscripter | 285faf37ebcc1c0c82751206ea9827785e226876 | [
"MIT"
]
| 392 | 2015-08-31T05:36:28.000Z | 2022-03-24T10:05:21.000Z | Source/JvDockVSNetStyle.pas | atkins126/pyscripter | 285faf37ebcc1c0c82751206ea9827785e226876 | [
"MIT"
]
| 311 | 2015-08-26T17:42:06.000Z | 2022-03-22T16:32:17.000Z | {-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvDockVSNetStyle.pas, released on 2003-12-31.
The Initial Developer of the Original Code is luxiaoban.
Portions created by luxiaoban are Copyright (C) 2002,2003 luxiaoban.
All Rights Reserved.
Contributor(s):
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.delphi-jedi.org
Known Issues:
-----------------------------------------------------------------------------}
// $Id$
unit JvDockVSNetStyle;
{$I jvcl.inc}
interface
uses
{$IFDEF UNITVERSIONING}
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
Windows, Messages, Classes, Graphics, Controls, Forms, ExtCtrls,
JvDockControlForm, JvDockSupportControl, JvDockTree, JvDockVIDStyle,
JvDockGlobals, Contnrs;
type
TJvDockVSNETConjoinServerOption = class(TJvDockVIDConjoinServerOption)
protected
procedure UpdateDefaultSystemCaptionInfo; override;
public
constructor Create(ADockStyle: TJvDockObservableStyle); override;
end;
TJvDockVSNETTabServerOption = class(TJvDockVIDTabServerOption)
public
constructor Create(ADockStyle: TJvDockObservableStyle); override;
published
property InactiveSheetColor default VSNETPageInactiveSheetColor;
property ShowTabImages default True;
end;
TJvDockVSNETChannelOption = class(TJvDockBasicServerOption)
private
FActivePaneSize: Integer;
FShowImage: Boolean;
FMouseleaveHide: Boolean;
FHideHoldTime: Integer;
FTabColor: TColor;
procedure SetActivePaneSize(Value: Integer);
procedure SetShowImage(const Value: Boolean);
procedure SetHideHoldTime(const Value: Integer);
procedure SetMouseleaveHide(const Value: Boolean);
procedure SetTabColor(const Value: TColor);
public
constructor Create(ADockStyle: TJvDockObservableStyle); override;
procedure Assign(Source: TPersistent); override;
published
property ActivePaneSize: Integer read FActivePaneSize write SetActivePaneSize default 100;
{ ShowImage is not used }
property ShowImage: Boolean read FShowImage write SetShowImage default True;
property MouseleaveHide: Boolean read FMouseleaveHide write SetMouseleaveHide default True;
property HideHoldTime: Integer read FHideHoldTime write SetHideHoldTime default 1000;
property TabColor: TColor read FTabColor write SetTabColor default clBtnFace;
end;
TJvDockVSNETChannelOptionClass = class of TJvDockVSNETChannelOption;
TJvDockVSBlock = class;
TJvDockVSChannel = class;
TJvDockVSNETPanel = class;
TJvDockVSPopupPanel = class;
TJvDockVSPopupPanelSplitter = class;
TJvDockVSPane = class(TObject)
private
FBlock: TJvDockVSBlock;
FDockForm: TCustomForm;
FIndex: Integer;
FWidth: Integer;
FVisible: Boolean;
function GetActive: Boolean;
public
constructor Create(ABlock: TJvDockVSBlock; AForm: TCustomForm; AWidth: Integer; AIndex: Integer); virtual;
destructor Destroy; override;
// KV added
property PopUpPanelWidth: Integer read FWidth write FWidth;
property Active: Boolean read GetActive;
property Visible: Boolean read FVisible;
property DockForm: TCustomForm read FDockForm;
end;
TJvDockBlockType = (btConjoinBlock, btTabBlock);
TJvDockVSBlock = class(TObject)
private
FVSChannel: TJvDockVSChannel;
FVSPanes: TObjectList;
FActiveBlockWidth: Integer;
FInactiveBlockWidth: Integer;
FBlockType: TJvDockBlockType;
FImageList: TImageList;
FBlockStartPos: Integer;
FActivePane: TJvDockVSPane;
function GetVSPane(Index: Integer): TJvDockVSPane;
function GetVSPaneCount: Integer;
function GetActiveDockControl: TWinControl;
procedure SetActivePane(APane: TJvDockVSPane);
function GetActiveBlockWidth: Integer;
function GetInactiveBlockWidth: Integer;
protected
procedure ResetActiveBlockWidth;
function AddPane(AControl: TControl; const AWidth: Integer): TJvDockVSPane;
procedure DeletePane(Index: Integer);
procedure UpdateActivePane(StartIndex: Integer);
function PPIScale(Value: Integer): Integer;
{ Following names should be ActivePaneWidth, InactivePaneWidth }
{ ActivePane has size ActiveBlockWidth.. }
property ActiveBlockWidth: Integer read GetActiveBlockWidth write FActiveBlockWidth;
{ ..other panes have size InactiveBlockWidth }
property InactiveBlockWidth: Integer read GetInactiveBlockWidth write FInactiveBlockWidth;
{ The popup dock form of ActivePane }
property ActiveDockControl: TWinControl read GetActiveDockControl;
{ Pane that last displayed its popup dock form. A block always has an
ActivePane. If no Pane has shown its popup dock form, then the last
added pane is the ActivePane }
property ActivePane: TJvDockVSPane read FActivePane write SetActivePane;
property BlockType: TJvDockBlockType read FBlockType;
{ Owner }
property VSChannel: TJvDockVSChannel read FVSChannel;
public
constructor Create(AOwner: TJvDockVSChannel); virtual;
destructor Destroy; override;
procedure AddDockControl(Control: TWinControl);
procedure RemoveDockControl(Control: TWinControl);
function FindDockControl(Control: TWinControl; var PaneIndex: Integer): Boolean;
function GetTotalWidth: Integer;
property VSPaneCount: Integer read GetVSPaneCount;
property VSPane[Index: Integer]: TJvDockVSPane read GetVSPane;
// KV properties added
property ImageList: TImageList read FImageList;
end;
TJvDockChannelState = (csShow, csHide);
{
TJvDockServer
|
|----- TJvDockVSNETPanel (4x per server)
|
|----- TJvDockVSChannel
|
|---- TJvDockVSPopupPanel
|
|---- TJvDockVSPopupPanelSplitter
-------- = maintains/creates
}
TJvDockVSChannel = class(TCustomControl)
private
FAnimationDelayTimer: TTimer;
FPopupPane: TJvDockVSPane;
FVSNETDockPanel: TJvDockVSNETPanel; { Owner }
FCurrentPos: Integer;
FBlocks: TObjectList;
FChannelWidth: Integer;
FBlockStartOffset: Integer;
FBlockUpOffset: Integer;
FBlockInterval: Integer;
FVSPopupPanel: TJvDockVSPopupPanel;
FVSPopupPanelSplitter: TJvDockVSPopupPanelSplitter;
FActivePaneSize: Integer;
FDelayPane: TJvDockVSPane;
FStyleLink: TJvDockStyleLink;
FTabColor: TColor;
function GetBlockCount: Integer;
function GetBlock(Index: Integer): TJvDockVSBlock;
function PaneAtPos(MousePos: TPoint): TJvDockVSPane;
procedure SetBlockStartOffset(const Value: Integer);
procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
procedure FreeBlockList;
procedure SetActivePaneSize(const Value: Integer);
procedure DoAnimationDelay(Sender: TObject);
procedure DockStyleChanged(Sender: TObject);
procedure SetTabColor(const Value: TColor);
function GetDockServer: TJvDockServer;
function GetDockStyle: TJvDockObservableStyle;
function GetActiveDockForm: TCustomForm;
function GetChannelWidth: Integer;
function GetBlockStartOffset: Integer;
function GetBlockUpOffset: Integer;
function GetBlockInterval: Integer;
function GetActivePaneSize: Integer;
protected
// KV move GetBlockRect to protected and added FBlockImageListSize, FInactiveBlockWidth
FBlockImageListSize: Integer;
FInactiveBlockWidth: Integer;
procedure GetBlockRect(Block: TJvDockVSBlock; Index: Integer; var ARect: TRect);
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure InternalInsertControl(AWinControl: TWinControl);
procedure InternalRemoveControl(AWinControl: TWinControl);
procedure SetPopupPane(APane: TJvDockVSPane);
procedure PopupPaneChanged; virtual;
procedure ResetFontAngle; virtual;
procedure ResetBlock; virtual;
procedure Paint; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure SetVSPopupPanelSplitterPosition;
procedure SyncWithStyle; virtual;
procedure ChangeScale(M, D: Integer; isDpiChange: Boolean); override;
property ChannelWidth: Integer read GetChannelWidth write FChannelWidth;
property BlockStartOffset: Integer read GetBlockStartOffset write SetBlockStartOffset;
property BlockUpOffset: Integer read GetBlockUpOffset;
property BlockInterval: Integer read GetBlockInterval;
property DockServer: TJvDockServer read GetDockServer;
// KV property added
property CurrentPos: Integer read FCurrentPos write FCurrentPos;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AfterConstruction; override;
{ Same as FindPane? }
function PPIScale(Value: Integer): Integer;
function GetPaneWithControl(AControl: TControl): TJvDockVSPane;
procedure CreateVSPopupPanel;
procedure DestroyVSPopupPanel;
procedure ResetPosition;
procedure AddDockControl(Control: TWinControl);
procedure RemoveDockControl(Control: TWinControl);
function FindDockControl(Control: TWinControl; var BlockIndex: Integer;
var PaneIndex: Integer): Boolean;
function FindPane(Control: TWinControl): TJvDockVSPane;
procedure AutoFocusActiveDockForm;
{ Slides the window into view }
procedure PopupDockForm(Pane: TJvDockVSPane); overload;
procedure PopupDockForm(Control: TWinControl); overload;
{ Disables auto-hide }
procedure ShowPopupPanel(Pane: TJvDockVSPane); overload;
procedure ShowPopupPanel(Control: TWinControl); overload;
{ Hides the window by sliding it to the edge of the form }
procedure HidePopupPanel(Pane: TJvDockVSPane); overload;
procedure HidePopupPanel(Control: TWinControl); overload;
procedure HidePopupPanelWithAnimate;
procedure ResetActivePaneWidth;
procedure ResetPopupPanelHeight;
procedure RemoveAllBlock;
procedure DeleteBlock(Index: Integer);
property BlockCount: Integer read GetBlockCount;
property Block[Index: Integer]: TJvDockVSBlock read GetBlock;
property VSPopupPanel: TJvDockVSPopupPanel read FVSPopupPanel;
property VSPopupPanelSplitter: TJvDockVSPopupPanelSplitter read FVSPopupPanelSplitter;
{ Popup dock form that is visible; nil if no popup form is visible }
property ActiveDockForm: TCustomForm read GetActiveDockForm;
{ Maximum size of a block's active pane }
property ActivePaneSize: Integer read GetActivePaneSize write SetActivePaneSize;
{ Pane that has a visible popup dock form; nil if no popup dock form is visible }
property PopupPane: TJvDockVSPane read FPopupPane;
property TabColor: TColor read FTabColor write SetTabColor;
property DockStyle: TJvDockObservableStyle read GetDockStyle;
end;
TJvDockVSChannelClass = class of TJvDockVSChannel;
{$IFDEF RTL230_UP}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF RTL230_UP}
TJvDockVSNetStyle = class(TJvDockVIDStyle)
private
FTimer: TTimer;
FDockServers: TList;
FCurrentTimer: Integer;
FChannelOption: TJvDockVSNETChannelOption;
FChannelOptionClass: TJvDockVSNETChannelOptionClass;
procedure Timer(Sender: TObject);
function GetChannelOption: TJvDockVSNETChannelOption;
procedure SetChannelOption(const Value: TJvDockVSNETChannelOption);
protected
function DockServerWindowProc(DockServer: TJvDockServer; var Msg: TMessage): Boolean; override;
function DockClientWindowProc(DockClient: TJvDockClient; var Msg: TMessage): Boolean; override;
procedure AddDockBaseControl(ADockBaseControl: TJvDockBaseControl); override;
procedure RemoveDockBaseControl(ADockBaseControl: TJvDockBaseControl); override;
procedure CreateServerOption; override; { AfterConstruction }
procedure FreeServerOption; override; { Destroy }
procedure BeginPopup(AChannel: TJvDockVSChannel);
procedure EndPopup(AChannel: TJvDockVSChannel);
{ construction/destruction of timer is a bit rigid }
procedure CreateTimer;
procedure DestroyTimer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure DoUnAutoHideDockForm(DockWindow: TWinControl); virtual;
procedure DoShowDockForm(DockWindow: TWinControl); override;
procedure DoHideDockForm(DockWindow: TWinControl); override;
procedure SetDockFormVisible(ADockClient: TJvDockClient; AVisible: Boolean);
procedure ShowDockForm(ADockClient: TJvDockClient); override;
procedure HideDockForm(ADockClient: TJvDockClient); override;
function GetDockFormVisible(ADockClient: TJvDockClient): Boolean; override;
procedure RestoreClient(DockClient: TJvDockClient); override;
class procedure SetAnimationInterval(const Value: Integer);
class function GetAnimationInterval: Integer;
class function GetAnimationStartInterval: Integer;
class procedure SetAnimationMoveWidth(const Value: Integer);
class function GetAnimationMoveWidth: Integer;
published
property ChannelOption: TJvDockVSNETChannelOption read GetChannelOption write SetChannelOption;
end;
TJvDockVSNETSplitter = class(TJvDockVIDSplitter);
{ A 'pure' TJvDockVSNETPanel maintains a TJvDockVSChannel (A TJvDockVSPopupPanel
component that is a TJvDockVSNETPanel descendant does NOT, see
TJvDockVSNETPanel.AddDockServer)
}
TJvDockVSNETPanel = class(TJvDockVIDPanel)
private
FVSChannelClass: TJvDockVSChannelClass;
FVSChannel: TJvDockVSChannel;
protected
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure AddDockServer(ADockServer: TJvDockServer); override;
procedure RemoveDockServer(ADockServer: TJvDockServer); override;
procedure CustomDockDrop(Source: TJvDockDragDockObject; X, Y: Integer); override;
procedure Resize; override;
//KV
property VSChannelClass: TJvDockVSChannelClass
read FVSChannelClass write FVSChannelClass;
public
constructor Create(AOwner: TComponent); override;
procedure CreateVSChannel;
procedure DestroyVSChannel;
procedure DoAutoHideControl(Control: TWinControl);
procedure DoHideControl(Control: TWinControl);
procedure DoShowControl(Control: TWinControl);
property VSChannel: TJvDockVSChannel read FVSChannel;
end;
TJvDockVSPopupPanel = class(TJvDockVSNETPanel)
private
FVSNETDockPanel: TJvDockVSNETPanel;
{procedure SetVSNETDockPanel(const Value: TJvDockVSNETPanel);}
function GetVSChannel: TJvDockVSChannel;
protected
function CreateDockManager: IDockManager; override;
procedure SetParent(AParent: TWinControl); override;
public
// Can't put 'override' this one because signature is different!
// But it MUST have DockStyle in the constructor now! -Wpostma!
constructor Create(AOwner: TComponent; APanel: TJvDockVSNETPanel); reintroduce; virtual;
procedure ShowDockPanel(MakeVisible: Boolean; Client: TControl;
PanelSizeFrom: TJvDockSetDockPanelSizeFrom); override;
{ Dirty override; solve with virtual method? }
property VSChannel: TJvDockVSChannel read GetVSChannel;
{ Owner }
property VSNETDockPanel: TJvDockVSNETPanel read FVSNETDockPanel {write SetVSNETDockPanel};
end;
TJvDockVSNETConjoinPanel = class(TJvDockVIDConjoinPanel);
TJvDockBtnState = (bsUp, bsNormal, bsDown);
TJvDockVSNETZone = class(TJvDockVIDZone)
private
FAutoHideBtnDown: Boolean;
FAutoHideBtnState: TJvDockBtnState;
FCloseBtnState: TJvDockBtnState;
FVSPaneVisible: Boolean;
procedure SetAutoHideBtnState(const Value: TJvDockBtnState);
procedure SetCloseBtnState(const Value: TJvDockBtnState);
procedure SetAutoHideBtnDown(const Value: Boolean);
procedure SetVSPaneVisible(const Value: Boolean);
protected
procedure DoCustomSetControlName; override;
procedure SetChildControlVisible(Client: TControl; AVisible: Boolean); override;
property AutoHideBtnDown: Boolean read FAutoHideBtnDown write SetAutoHideBtnDown;
property AutoHideBtnState: TJvDockBtnState read FAutoHideBtnState write SetAutoHideBtnState;
property CloseBtnState: TJvDockBtnState read FCloseBtnState write SetCloseBtnState;
property VSPaneVisible: Boolean read FVSPaneVisible write SetVSPaneVisible;
public
constructor Create(Tree: TJvDockTree); override;
end;
TJvDockVSNETTree = class(TJvDockVIDTree)
private
FAutoHideZone: TJvDockVSNETZone;
protected
procedure IgnoreZoneInfor(Stream: TMemoryStream); override;
procedure BeginDrag(Control: TControl;
Immediate: Boolean; Threshold: Integer = -1); override;
function DoLButtonDown(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer): Boolean; override;
procedure DoLButtonUp(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer); override;
procedure DoLButtonDbClk(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer); override;
procedure DoMouseMove(var Msg: TWMMouse;
var AZone: TJvDockZone; out HTFlag: Integer); override;
procedure DoHideZoneChild(AZone: TJvDockZone); override;
function GetTopGrabbersHTFlag(const MousePos: TPoint;
out HTFlag: Integer; Zone: TJvDockZone): TJvDockZone; override;
procedure DrawDockGrabber(Control: TWinControl; const ARect: TRect); override;
procedure PaintDockGrabberRect(Canvas: TCanvas; Control: TWinControl;
const ARect: TRect; PaintAlways: Boolean = False); override;
procedure DrawCloseButton(Canvas: TCanvas; Zone: TJvDockZone;
Left, Top: Integer); override;
procedure DrawAutoHideButton(Zone: TJvDockZone;
Left, Top: Integer); virtual;
procedure GetCaptionRect(var Rect: TRect); override;
procedure DoOtherHint(Zone: TJvDockZone;
HTFlag: Integer; var HintStr: string); override;
procedure CustomSaveZone(Stream: TStream;
Zone: TJvDockZone); override;
procedure CustomLoadZone(Stream: TStream;
var Zone: TJvDockZone); override;
property AutoHideZone: TJvDockVSNETZone read FAutoHideZone
write FAutoHideZone;
public
constructor Create(DockSite: TWinControl; DockZoneClass: TJvDockZoneClass;
ADockStyle: TJvDockObservableStyle); override;
end;
TJvDockVSNETTabSheet = class(TJvDockVIDTabSheet)
private
FOldVisible: Boolean;
procedure SetOldVisible(const Value: Boolean);
public
constructor Create(AOwner: TComponent); override;
property OldVisible: Boolean read FOldVisible write SetOldVisible;
end;
TJvDockVSNETTabPanel = class(TJvDockTabPanel)
public
constructor Create(AOwner: TComponent); override;
end;
TJvDockVSNETTabPageControl = class(TJvDockVIDTabPageControl)
protected
procedure ShowControl(AControl: TControl); override;
public
constructor Create(AOwner: TComponent); override;
end;
TJvDockVSNETDragDockObject = class(TJvDockVIDDragDockObject);
TJvDockVSPopupPanelSplitter = class(TCustomControl)
private
FVSPopupPanel: TJvDockVSPopupPanel;
FSplitWidth: Integer;
FActiveControl: TWinControl;
FAutoSnap: Boolean;
FBeveled: Boolean;
FBrush: TBrush;
FControl: TControl;
FDownPos: TPoint;
FLineDC: HDC;
FLineVisible: Boolean;
FMinSize: NaturalNumber;
FMaxSize: Integer;
FNewSize: Integer;
FOldKeyDown: TKeyEvent;
FOldSize: Integer;
FPrevBrush: HBRUSH;
FResizeStyle: TResizeStyle;
FSplit: Integer;
FOnCanResize: TCanResizeEvent;
FOnMoved: TNotifyEvent;
FOnPaint: TNotifyEvent;
procedure AllocateLineDC;
procedure CalcSplitSize(X, Y: Integer; var NewSize, Split: Integer);
procedure DrawLine;
function FindControl: TControl;
procedure FocusKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure ReleaseLineDC;
procedure SetBeveled(Value: Boolean);
procedure UpdateControlSize;
procedure UpdateSize(X, Y: Integer);
procedure SetVSPopupPanel(Value: TJvDockVSPopupPanel);
function GetVSChannelAlign: TAlign;
procedure SetSplitWidth(const Value: Integer);
function GetMinSize: NaturalNumber;
function GetSplitWidth: Integer;
protected
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
function CanResize(var NewSize: Integer): Boolean; reintroduce; virtual;
function DoCanResize(var NewSize: Integer): Boolean; virtual;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure Paint; override;
procedure RequestAlign; override;
procedure StopSizing; dynamic;
function PPIScale(Value: Integer): Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property Canvas;
{ Owner of the Owner }
property VSPopupPanel: TJvDockVSPopupPanel read FVSPopupPanel write SetVSPopupPanel;
property SplitWidth: Integer read GetSplitWidth write SetSplitWidth;
published
property Align default alLeft;
property VSChannelAlign: TAlign read GetVSChannelAlign;
property AutoSnap: Boolean read FAutoSnap write FAutoSnap default True;
property Beveled: Boolean read FBeveled write SetBeveled default False;
property Color;
property Constraints;
property MinSize: NaturalNumber read GetMinSize write FMinSize default 30;
property ParentColor;
property ResizeStyle: TResizeStyle read FResizeStyle write FResizeStyle default rsPattern;
property Visible;
property OnCanResize: TCanResizeEvent read FOnCanResize write FOnCanResize;
property OnMoved: TNotifyEvent read FOnMoved write FOnMoved;
property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
end;
procedure HideAllPopupPanel(ExcludeChannel: TJvDockVSChannel);
{ Disables auto-hide for ADockWindow. If ADockWindow is not auto-hidden then
the procedures works the same as JvDockControlForm.ShowDockForm }
procedure UnAutoHideDockForm(ADockWindow: TWinControl);
function RetrieveChannel(HostDockSite: TWinControl): TJvDockVSChannel;
var
DefaultVSChannelClass: TJvDockVSChannelClass = nil;
{$IFDEF UNITVERSIONING}
const
UnitVersioning: TUnitVersionInfo = (
RCSfile: '$URL$';
Revision: '$Revision$';
Date: '$Date$';
LogPath: 'JVCL\run'
);
{$ENDIF UNITVERSIONING}
implementation
uses
Types, SysUtils, Math, ImgList, {AppEvnts,} JvJVCLUtils,
JvDockSupportProc;
type
TAnimateState = (asPopup, asHide);
TCustomFormAccess = class(TCustomForm);
TWinControlAccessProtected = class(TWinControl);
TCustomControlAccessProtected = class(TCustomControl);
{ Enumerates the channels of a dock server; Ensure MoveNext returns true
before reading Current }
TChannelEnumerator = class
private
FIndex: Integer;
FDockServer: TJvDockServer;
function GetCurrent: TJvDockVSChannel;
public
constructor Create(ADockServer: TJvDockServer);
function MoveNext: Boolean;
property Current: TJvDockVSChannel read GetCurrent;
end;
TPopupPanelAnimate = class(TTimer)
private
FMaxWidth: Integer;
FCurrentWidth: Integer;
FActiveChannel: TJvDockVSChannel;
FState: TAnimateState;
protected
procedure Timer; override;
procedure OnCustomTimer(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
{ Animates the popup of the form }
procedure PopupForm(AChannel: TJvDockVSChannel; MaxWidth: Integer); virtual;
{ Animates the hiding of the form }
procedure HideForm(AChannel: TJvDockVSChannel; MaxWidth: Integer); virtual;
end;
var
GlobalPopupPanelAnimate: TPopupPanelAnimate = nil;
GlobalPopupPanelAnimateInterval: Integer = 20;
GlobalPopupPanelAnimateMoveWidth: Integer = 20;
GlobalPopupPanelStartAnimateInterval: Integer = 400;
//=== Local procedures =======================================================
function PopupPanelAnimate: TPopupPanelAnimate;
begin
if GlobalPopupPanelAnimate = nil then
GlobalPopupPanelAnimate := TPopupPanelAnimate.Create(nil);
Result := GlobalPopupPanelAnimate;
end;
procedure ResetChannelBlockStartOffset(Channel: TJvDockVSChannel);
var
LeftChannel: TJvDockVSChannel;
OldOffset: Integer;
LeftAlignArea: Integer;
begin
LeftChannel := TJvDockVSNETPanel(Channel.DockServer.LeftDockPanel).VSChannel;
if LeftChannel <> nil then
begin
LeftAlignArea := GetClientAlignControlArea(LeftChannel.Parent, alLeft);
with TChannelEnumerator.Create(Channel.DockServer) do
try
while MoveNext do
if Current.Align in [alTop, alBottom] then
begin
OldOffset := Current.BlockStartOffset;
Current.BlockStartOffset := Channel.PPIScale(2) + LeftAlignArea;
if OldOffset <> Current.BlockStartOffset then
Current.Invalidate;
end;
finally
Free;
end;
end;
end;
procedure SetControlBringToFront(Control: TWinControl; Align: TAlign);
var
I: Integer;
begin
for I := Control.ControlCount - 1 downto 0 do
if Control.Controls[I].Visible and (Control.Controls[I].Align = Align) and
not (Control.Controls[I] is TJvDockVSChannel) and
not (Control.Controls[I] is TJvDockPanel) and
not (Control.Controls[I] is TJvDockSplitter) then
Control.Controls[I].BringToFront;
end;
function ControlIsOnPopup(AControl: TControl): Boolean;
begin
Result := False;
while Assigned(AControl) do
begin
if (AControl is TJvDockVSPopupPanel) or
(AControl is TJvDockVSPopupPanelSplitter) or
(AControl is TJvDockVSChannel) then
begin
Result := True;
Exit;
end;
AControl := AControl.Parent;
end;
end;
//=== Global procedures ======================================================
procedure HideAllPopupPanel(ExcludeChannel: TJvDockVSChannel);
var
I: Integer;
DockServer: TJvDockServer;
begin
for I := 0 to JvGlobalDockManager.DockServerCount - 1 do
begin
DockServer := JvGlobalDockManager.DockServer[I];
if Assigned(DockServer) then
with TChannelEnumerator.Create(DockServer) do
try
while MoveNext do
if Current <> ExcludeChannel then
Current.HidePopupPanel(Current.PopupPane);
finally
Free;
end;
end;
end;
{ Returns the channel of a form that is docked onto a popup panel }
function RetrieveChannel(HostDockSite: TWinControl): TJvDockVSChannel;
begin
Result := nil;
if HostDockSite is TJvDockVSPopupPanel then
// normal docked forms
Result := TJvDockVSPopupPanel(HostDockSite).VSChannel
else
if Assigned(HostDockSite) and Assigned(HostDockSite.Parent) then
begin
HostDockSite := HostDockSite.Parent.HostDockSite;
if HostDockSite is TJvDockVSPopupPanel then
// tab docked forms
Result := TJvDockVSPopupPanel(HostDockSite).VSChannel
end;
end;
procedure UnAutoHideDockForm(ADockWindow: TWinControl);
var
ADockClient: TJvDockClient;
begin
// delegate to style
ADockClient := FindDockClient(ADockWindow);
if Assigned(ADockClient) and (ADockClient.DockStyle is TJvDockVSNetStyle) then
TJvDockVSNetStyle(ADockClient.DockStyle).DoUnAutoHideDockForm(ADockWindow);
end;
//=== { TChannelEnumerator } =================================================
constructor TChannelEnumerator.Create(ADockServer: TJvDockServer);
begin
inherited Create;
FIndex := -1;
FDockServer := ADockServer;
end;
function TChannelEnumerator.GetCurrent: TJvDockVSChannel;
begin
Result := TJvDockVSNETPanel(FDockServer.DockPanelWithAlign[TAlign(FIndex)]).VSChannel;
end;
function TChannelEnumerator.MoveNext: Boolean;
var
I: Integer;
Panel: TJvDockPanel;
begin
I := FIndex + 1;
while I <= Ord(High(TAlign)) do
begin
Panel := FDockServer.DockPanelWithAlign[TAlign(I)];
if (Panel is TJvDockVSNETPanel) and Assigned(TJvDockVSNETPanel(Panel).VSChannel) then
Break;
Inc(I);
end;
Result := I <= Ord(High(TAlign));
if Result then
FIndex := I;
end;
//=== { TJvDockVSBlock } =====================================================
constructor TJvDockVSBlock.Create(AOwner: TJvDockVSChannel);
var
ImageListSize: Integer;
begin
inherited Create;
FVSChannel := AOwner;
FVSPanes := TObjectList.Create;
ImageListSize := PPIScale(FVSChannel.FBlockImageListSize);
FImageList := TImageList.CreateSize(ImageListSize, ImageListSize);
{$IFDEF RTL200_UP}
FImageList.ColorDepth := cd32Bit;
{$ENDIF RTL200_UP}
FInactiveBlockWidth := FVSChannel.FInactiveBlockWidth;
FActiveBlockWidth := 24;
end;
destructor TJvDockVSBlock.Destroy;
begin
FImageList.Free;
FVSPanes.Free;
inherited Destroy;
end;
function TJvDockVSBlock.PPIScale(Value: Integer): Integer;
begin
Result := VSChannel.PPIScale(Value);
end;
procedure TJvDockVSBlock.AddDockControl(Control: TWinControl);
var
I, PaneWidth, FirstIndex: Integer;
function GetPaneWidth: Integer;
begin
Result := PPIScale(100);
if Control = nil then
Exit;
case VSChannel.Align of
alLeft, alRight:
Result := Control.Width;
alTop, alBottom:
Result := Control.Height;
end;
end;
var
NewPane: TJvDockVSPane;
Form: TCustomForm;
APageControl: TJvDockTabPageControl;
begin
PaneWidth := GetPaneWidth;
if Control is TJvDockTabHostForm then
begin
FBlockType := btTabBlock;
APageControl := TJvDockTabHostForm(Control).PageControl;
FirstIndex := VSPaneCount;
{ Mantis 3989: (Kiriakos) PageControl.DockClients does NOT have to be in the
same order as PageControl.Pages; for example, if we reorder the pages. }
for I := 0 to APageControl.Count - 1 do
begin
Form := APageControl.DockForm[I];
if Assigned(Form) then
begin
NewPane := AddPane(Form, PaneWidth);
TJvDockVSNETTabSheet(APageControl.Pages[I]).OldVisible := Form.Visible;
if APageControl.Pages[I] <> APageControl.ActivePage then
Form.Visible := False
else if Assigned(NewPane) then
ActivePane := NewPane;
end;
end;
if not Assigned(ActivePane) then
UpdateActivePane(FirstIndex);
end
else
begin
FBlockType := btConjoinBlock;
NewPane := AddPane(Control, PaneWidth);
if Assigned(NewPane) then
ActivePane := NewPane;
end;
ResetActiveBlockWidth;
end;
function TJvDockVSBlock.AddPane(AControl: TControl; const AWidth: Integer): TJvDockVSPane;
const
ANDbits: array[0..2*16-1] of Byte = ($FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF,
$FF,$FF);
XORbits: array[0..2*16-1] of Byte = ($00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00,
$00,$00);
var
Icon: TIcon;
ADockClient: TJvDockClient;
begin
if not (AControl is TCustomForm) then
begin
Result := nil;
Exit;
end;
Result := TJvDockVSPane.Create(Self, TCustomForm(AControl), AWidth, VSPaneCount);
FVSPanes.Add(Result);
if not JvGlobalDockIsLoading then
begin
ADockClient := FindDockClient(AControl);
if ADockClient <> nil then
ADockClient.VSPaneWidth := AWidth;
end;
{ Add the form icon }
if not Assigned(TCustomFormAccess(AControl).Icon) or not TCustomFormAccess(AControl).Icon.HandleAllocated then
begin
Icon := TIcon.Create;
try
Icon.Width := PPIScale(16);
Icon.Height := PPIScale(16);
//2. Adding an Icon without real bitmap does nothing,
//so transparent icon needed
Icon.Handle := CreateIcon(hInstance,16,16,1,1,@ANDbits,@XORbits);
FImageList.AddIcon(Icon);
finally
Icon.Free;
end;
end
else
FImageList.AddIcon(TCustomFormAccess(AControl).Icon);
end;
procedure TJvDockVSBlock.DeletePane(Index: Integer);
var
I: Integer;
ActivePaneRemoved: Boolean;
begin
for I := Index to VSPaneCount - 2 do
VSPane[I + 1].FIndex := VSPane[I].FIndex;
ActivePaneRemoved := VSPane[Index] = Self.ActivePane;
FVSPanes.Delete(Index);
{ Remove the form icon }
if Index < FImageList.Count then
FImageList.Delete(Index);
if ActivePaneRemoved then
UpdateActivePane(Index);
end;
function TJvDockVSBlock.FindDockControl(Control: TWinControl;
var PaneIndex: Integer): Boolean;
var
I: Integer;
begin
Result := False;
PaneIndex := -1;
if Control = nil then
Exit;
for I := 0 to VSPaneCount - 1 do
if VSPane[I].FDockForm = Control then
begin
PaneIndex := I;
Result := True;
Exit;
end;
if FBlockType = btTabBlock then
begin
if (VSPaneCount > 0) and (VSPane[0].FDockForm.HostDockSite.Parent = Control) then
begin
PaneIndex := 0;
Result := True;
Exit;
end;
end;
end;
function TJvDockVSBlock.GetActiveBlockWidth: Integer;
begin
Result := PPIScale(FActiveBlockWidth);
end;
function TJvDockVSBlock.GetActiveDockControl: TWinControl;
begin
if Assigned(ActivePane) then
Result := ActivePane.DockForm
else
Result := nil;
end;
function TJvDockVSBlock.GetInactiveBlockWidth: Integer;
begin
Result := PPIScale(FInactiveBlockWidth);
end;
function TJvDockVSBlock.GetTotalWidth: Integer;
begin
// 1 pane is active, the rest is inactive
Result := (VSPaneCount - 1) * InactiveBlockWidth + ActiveBlockWidth;
end;
function TJvDockVSBlock.GetVSPane(Index: Integer): TJvDockVSPane;
begin
Result := TJvDockVSPane(FVSPanes[Index]);
end;
function TJvDockVSBlock.GetVSPaneCount: Integer;
begin
Result := FVSPanes.Count;
end;
procedure TJvDockVSBlock.RemoveDockControl(Control: TWinControl);
begin
ResetActiveBlockWidth;
end;
procedure TJvDockVSBlock.ResetActiveBlockWidth;
{
FActiveBlockWidth stores the unscaled value
Here it is calculating with the CurrentPPI settings and
needs to be unscaled.
}
function PPIUnScale(Value: Integer): Integer;
begin
Result := MulDiv(Value, FInactiveBlockWidth, InactiveBlockWidth);
end;
var
I: Integer;
TextWidth: Integer;
Canvas: TCanvas;
begin
FActiveBlockWidth := 0;
if VSPaneCount > 0 then
begin
if VSChannel.Parent is TCustomControl then
Canvas := TCustomControlAccessProtected(VSChannel.Parent).Canvas
else if VSChannel.Parent is TCustomForm then
Canvas := TForm(VSChannel.Parent).Canvas
else
Canvas := nil;
if Canvas <> nil then
begin
for I := 0 to VSPaneCount - 1 do
begin
TextWidth := Canvas.TextWidth(VSPane[I].FDockForm.Caption) +
InactiveBlockWidth + PPIScale(18);
if TextWidth >= VSChannel.ActivePaneSize then
begin
FActiveBlockWidth := VSChannel.FActivePaneSize; //unscaled!
Exit;
end;
FActiveBlockWidth := Max(FActiveBlockWidth, TextWidth);
end;
end;
end;
if FActiveBlockWidth = 0 then
FActiveBlockWidth := VSChannel.ActivePaneSize;
FActiveBlockWidth := PPIUnScale(FActiveBlockWidth); //unscale
end;
procedure TJvDockVSBlock.SetActivePane(APane: TJvDockVSPane);
begin
if FActivePane <> APane then
begin
FActivePane := APane;
VSChannel.Invalidate;
end;
end;
procedure TJvDockVSBlock.UpdateActivePane(StartIndex: Integer);
var
I: Integer;
begin
{ Start looking at position StartIndex for a visible pane }
for I := 0 to VSPaneCount - 1 do
if VSPane[(I + StartIndex) mod VSPaneCount].FVisible then
begin
ActivePane := VSPane[(I + StartIndex) mod VSPaneCount];
Break;
end;
end;
//=== { TJvDockVSChannel } ===================================================
constructor TJvDockVSChannel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FStyleLink := TJvDockStyleLink.Create;
FBlocks := TObjectList.Create;
FActivePaneSize := MaxActivePaneWidth;
FTabColor := clBtnFace;
FChannelWidth := 22;
FBlockStartOffset := 2;
FBlockUpOffset := 2;
FBlockInterval := 13;
FBlockImageListSize := 16;
FInactiveBlockWidth := 24;
if AOwner is TJvDockVSNETPanel then
begin
FVSNETDockPanel := TJvDockVSNETPanel(AOwner);
{ First set DockStyle then OnStyleChanged so no OnStyleChanged is fired;
we do it ourself in AfterContruction }
FStyleLink.DockStyle := DockServer.DockStyle;
end;
FStyleLink.OnStyleChanged := DockStyleChanged;
Color := VSNETPageInactiveSheetColor;
ParentFont := True;
end;
destructor TJvDockVSChannel.Destroy;
begin
if Assigned(GlobalPopupPanelAnimate) and (GlobalPopupPanelAnimate.FActiveChannel = Self) then
begin
GlobalPopupPanelAnimate.Free;
GlobalPopupPanelAnimate := nil;
end;
FreeBlockList;
FAnimationDelayTimer.Free;
FStyleLink.Free;
inherited Destroy;
end;
procedure TJvDockVSChannel.AddDockControl(Control: TWinControl);
var
ABlock: TJvDockVSBlock;
begin
if Control is TJvDockTabHostForm then
begin
ABlock := TJvDockVSBlock.Create(Self);
ABlock.AddDockControl(Control);
FBlocks.Add(ABlock);
end
else
begin
if (BlockCount >= 1) and (Block[0].BlockType = btConjoinBlock) then
Block[0].AddDockControl(Control)
else
begin
ABlock := TJvDockVSBlock.Create(Self);
ABlock.AddDockControl(Control);
FBlocks.Insert(0, ABlock);
end;
end;
HideAllPopupPanel(Self);
ResetPosition;
Invalidate;
end;
procedure TJvDockVSChannel.AfterConstruction;
begin
inherited AfterConstruction;
FStyleLink.StyleChanged;
end;
procedure TJvDockVSChannel.AutoFocusActiveDockForm;
begin
if DockServer.AutoFocusDockedForm and Assigned(ActiveDockForm) and ActiveDockForm.CanFocus then
begin
ActiveDockForm.SetFocus;
{$IFNDEF COMPILER9_UP}
InvalidateDockHostSiteOfControl(ActiveDockForm, False);
{$ENDIF !COMPILER9_UP}
end;
end;
procedure TJvDockVSChannel.ChangeScale(M, D: Integer; isDpiChange: Boolean);
Var
I, J : integer;
begin
inherited;
for I := 0 to FBlocks.Count - 1 do
begin
JvScaleImageList(Block[I].FImageList, M, D);
for J := 0 to Block[I].VSPaneCount - 1 do
Block[I].VSPane[J].PopUpPanelWidth := MulDiv(Block[I].VSPane[J].PopUpPanelWidth, M, D);
end;
ResetPosition;
Invalidate;
end;
procedure TJvDockVSChannel.CMMouseLeave(var Msg: TMessage);
begin
inherited;
end;
procedure TJvDockVSChannel.CreateVSPopupPanel;
begin
FVSPopupPanel := TJvDockVSPopupPanel.Create(Parent, FVSNETDockPanel);
{ Channel is maintainer/Creator }
FVSPopupPanel.Name := FVSNETDockPanel.Name + '_PopupPanel';
FVSPopupPanel.Visible := False;
if Parent is TCustomForm then
begin
FVSPopupPanel.Parent := Parent;
FVSPopupPanel.Align := alNone;
FVSPopupPanel.BringToFront;
end;
FVSPopupPanel.FreeNotification(Self);
FVSPopupPanelSplitter := TJvDockVSPopupPanelSplitter.Create(Parent);
{ Channel is maintainer/Creator }
FVSPopupPanelSplitter.FreeNotification(Self);
if Parent is TCustomForm then
begin
FVSPopupPanelSplitter.Parent := Parent;
FVSPopupPanelSplitter.Align := alNone;
FVSPopupPanelSplitter.VSPopupPanel := VSPopupPanel;
FVSPopupPanelSplitter.Color := clBtnFace;
FVSPopupPanelSplitter.Visible := False;
end;
end;
procedure TJvDockVSChannel.DeleteBlock(Index: Integer);
begin
FBlocks.Delete(Index);
end;
procedure TJvDockVSChannel.DestroyVSPopupPanel;
begin
FreeAndNil(FVSPopupPanel);
FreeAndNil(FVSPopupPanelSplitter);
end;
procedure TJvDockVSChannel.DoAnimationDelay(Sender: TObject);
var
P: TPoint;
begin
try
// Show the form only if the cursor is still above the same pane
GetCursorPos(P);
if PaneAtPos(ScreenToClient(P)) = FDelayPane then
PopupDockForm(FDelayPane);
finally
// dangerous to free in handler?
FAnimationDelayTimer.Free;
FAnimationDelayTimer := nil;
end;
end;
procedure TJvDockVSChannel.DockStyleChanged(Sender: TObject);
begin
SyncWithStyle;
end;
function TJvDockVSChannel.PPIScale(Value: Integer): Integer;
begin
if FVSNETDockPanel <> nil then
Result := FVSNETDockPanel.PPIScale(Value)
else
Result := MulDiv(Value, FCurrentPPI, 96);
end;
function TJvDockVSChannel.FindDockControl(Control: TWinControl;
var BlockIndex: Integer; var PaneIndex: Integer): Boolean;
var
I: Integer;
begin
Result := False;
BlockIndex := -1;
PaneIndex := -1;
if Control = nil then
Exit;
for I := 0 to BlockCount - 1 do
if Block[I].FindDockControl(Control, PaneIndex) then
begin
BlockIndex := I;
Result := True;
Exit;
end;
end;
function TJvDockVSChannel.FindPane(Control: TWinControl): TJvDockVSPane;
var
I, J: Integer;
begin
Result := nil;
if FindDockControl(Control, I, J) then
Result := Block[I].VSPane[J];
end;
procedure TJvDockVSChannel.FreeBlockList;
begin
FreeAndNil(FBlocks);
end;
function TJvDockVSChannel.GetActiveDockForm: TCustomForm;
begin
if PopupPane <> nil then
Result := PopupPane.DockForm
else
Result := nil;
end;
function TJvDockVSChannel.GetActivePaneSize: Integer;
begin
Result := PPIScale(FActivePaneSize);
end;
function TJvDockVSChannel.GetBlock(Index: Integer): TJvDockVSBlock;
begin
Result := TJvDockVSBlock(FBlocks[Index]);
end;
function TJvDockVSChannel.GetBlockCount: Integer;
begin
Result := FBlocks.Count;
end;
function TJvDockVSChannel.GetBlockInterval: Integer;
begin
Result := PPIScale(FBlockInterval);
end;
procedure TJvDockVSChannel.GetBlockRect(Block: TJvDockVSBlock; Index: Integer;
var ARect: TRect);
var
BlockWidth: Integer;
begin
if Block.VSPane[Index] <> Block.ActivePane then
BlockWidth := Block.InactiveBlockWidth
else
BlockWidth := Block.ActiveBlockWidth;
case Align of
alLeft:
begin
ARect.Left := 0 {-PPIScale(1)};
ARect.Top := FCurrentPos;
ARect.Right := Width - BlockUpOffset;
ARect.Bottom := ARect.Top + BlockWidth;
end;
alRight:
begin
ARect.Left := BlockUpOffset;
ARect.Top := FCurrentPos;
ARect.Right := Width {+ PPIScale(1)};
ARect.Bottom := ARect.Top + BlockWidth;
end;
alTop:
begin
ARect.Left := FCurrentPos;
ARect.Top := 0 {-PPIScale(1)};
ARect.Right := ARect.Left + BlockWidth;
ARect.Bottom := Height - BlockUpOffset;
end;
alBottom:
begin
ARect.Left := FCurrentPos;
ARect.Top := BlockUpOffset;
ARect.Right := ARect.Left + BlockWidth;
ARect.Bottom := Height{ + PPIScale(1)};
end;
end;
Inc(FCurrentPos, BlockWidth {- PPIScale(1)});
end;
function TJvDockVSChannel.GetBlockStartOffset: Integer;
begin
Result := PPIScale(FBlockStartOffset);
end;
function TJvDockVSChannel.GetBlockUpOffset: Integer;
begin
Result := PPIScale(FBlockUpOffset)
end;
function TJvDockVSChannel.GetChannelWidth: Integer;
begin
Result := PPIScale(FChannelWidth);
end;
function TJvDockVSChannel.GetDockServer: TJvDockServer;
begin
if Assigned(FVSNETDockPanel) then
Result := FVSNETDockPanel.DockServer
else
Result := nil;
end;
function TJvDockVSChannel.GetDockStyle: TJvDockObservableStyle;
begin
Result := FStyleLink.DockStyle;
end;
function TJvDockVSChannel.GetPaneWithControl(AControl: TControl): TJvDockVSPane;
var
I, J: Integer;
begin
Result := nil;
for I := 0 to BlockCount - 1 do
for J := 0 to Block[I].VSPaneCount - 1 do
if AControl = Block[I].VSPane[J].FDockForm then
begin
Result := Block[I].VSPane[J];
Exit;
end;
end;
procedure TJvDockVSChannel.HidePopupPanel(Pane: TJvDockVSPane);
begin
if Pane <> nil then
begin
if Align in [alLeft, alRight] then
begin
VSPopupPanel.Width := 0;
VSPopupPanelSplitter.Width := 0;
end
else
if Align in [alTop, alBottom] then
begin
VSPopupPanel.Height := 0;
VSPopupPanelSplitter.Height := 0;
end;
SetPopupPane(nil);
end;
VSPopupPanel.Visible := False;
VSPopupPanelSplitter.Visible := False;
SetPopupPane(nil);
end;
procedure TJvDockVSChannel.HidePopupPanel(Control: TWinControl);
var
Pane: TJvDockVSPane;
begin
Pane := FindPane(Control);
if Assigned(Pane) then
HidePopupPanel(Pane);
end;
procedure TJvDockVSChannel.HidePopupPanelWithAnimate;
begin
if PopupPane <> nil then
PopupPanelAnimate.HideForm(Self, PopupPane.FWidth);
end;
procedure TJvDockVSChannel.InternalInsertControl(AWinControl: TWinControl);
begin
if Assigned(AWinControl) then
begin
if Assigned(VSPopupPanel) and VSPopupPanel.UseDockManager and (VSPopupPanel.JvDockManager <> nil) then
VSPopupPanel.JvDockManager.InsertControl(AWinControl, alNone, nil);
AWinControl.FreeNotification(Self);
end;
end;
procedure TJvDockVSChannel.InternalRemoveControl(AWinControl: TWinControl);
begin
if Assigned(AWinControl) then
begin
AWinControl.RemoveFreeNotification(Self);
if Assigned(VSPopupPanel) and VSPopupPanel.UseDockManager and (VSPopupPanel.JvDockManager <> nil) then
VSPopupPanel.JvDockManager.RemoveControl(AWinControl);
end;
end;
procedure TJvDockVSChannel.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
var
Pane: TJvDockVSPane;
begin
inherited MouseDown(Button, Shift, X, Y);
Pane := PaneAtPos(Point(X, Y));
if Assigned(Pane) then
begin
if PopupPane = Pane then
begin
if Pane.DockForm.CanFocus then
Pane.DockForm.SetFocus;
end
else
PopupDockForm(Pane);
end;
end;
procedure TJvDockVSChannel.MouseMove(Shift: TShiftState; X, Y: Integer);
var
NewDelayPane: TJvDockVSPane;
begin
inherited MouseMove(Shift, X, Y);
NewDelayPane := PaneAtPos(Point(X, Y));
if Assigned(NewDelayPane) and (NewDelayPane <> PopupPane) and IsForegroundTask then
begin
// Create the timer object if not existing
if FAnimationDelayTimer = nil then
begin
FAnimationDelayTimer := TTimer.Create(nil);
FAnimationDelayTimer.OnTimer := DoAnimationDelay;
FAnimationDelayTimer.Interval := TJvDockVSNetStyle.GetAnimationStartInterval;
FAnimationDelayTimer.Enabled := True;
end
// Restart the timer only, if mouse is above another pane now
else
if NewDelayPane <> FDelayPane then
begin
FAnimationDelayTimer.Enabled := False;
FAnimationDelayTimer.Enabled := True;
end;
end
else
FreeAndNil(FAnimationDelayTimer);
FDelayPane := NewDelayPane;
end;
procedure TJvDockVSChannel.MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
inherited MouseUp(Button, Shift, X, Y);
end;
procedure TJvDockVSChannel.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if Operation = opRemove then
begin
if AComponent = FVSPopupPanel then
begin
FVSPopupPanel := nil;
DestroyVSPopupPanel;
end
else
if AComponent = FVSPopupPanelSplitter then
begin
FVSPopupPanelSplitter := nil;
DestroyVSPopupPanel;
end
else
if AComponent is TWinControl then
InternalRemoveControl(TWinControl(AComponent));
end;
end;
procedure TJvDockVSChannel.Paint;
var
I: Integer;
procedure DrawSingleBlock(Block: TJvDockVSBlock);
var
DrawRect: TRect;
I: Integer;
OldGraphicsMode: Integer;
VisiblePaneCount: Integer;
procedure AdjustImagePos;
begin
if Align = alLeft then
begin
Inc(DrawRect.Left, PPIScale(3));
Inc(DrawRect.Top, PPIScale(4));
end
else
if Align = alTop then
begin
Inc(DrawRect.Left, PPIScale(4));
Inc(DrawRect.Top, PPIScale(2));
end
else
if Align = alRight then
begin
Inc(DrawRect.Left, PPIScale(4));
Inc(DrawRect.Top, PPIScale(4));
end
else
if Align = alBottom then
begin
Inc(DrawRect.Left, PPIScale(4));
Inc(DrawRect.Top, PPIScale(3));
end;
end;
begin
VisiblePaneCount := 0;
for I := 0 to Block.VSPaneCount - 1 do
begin
if not Block.VSPane[I].FVisible then
Continue;
GetBlockRect(Block, I, DrawRect);
Canvas.Brush.Color := TabColor;
Canvas.FillRect(DrawRect);
Canvas.Brush.Color := clGray;
Canvas.FrameRect(DrawRect);
AdjustImagePos;
Block.FImageList.Draw(Canvas, DrawRect.Left, DrawRect.Top, I, dsTransparent, itImage);
if Block.ActivePane = Block.VSPane[I] then
begin
if Align in [alTop, alBottom] then
Inc(DrawRect.Left, Block.InactiveBlockWidth)
else
if Align in [alLeft, alRight] then
begin
Inc(DrawRect.Top, Block.InactiveBlockWidth);
if Align = alLeft then
DrawRect.Left := PPIScale(15)
else
DrawRect.Left := PPIScale(20);
DrawRect.Right := DrawRect.Left + (DrawRect.Bottom - DrawRect.Top);
end;
Canvas.Brush.Color := TabColor;
Canvas.Pen.Color := clBlack;
Dec(DrawRect.Right, PPIScale(3));
OldGraphicsMode := SetGraphicsMode(Canvas.Handle, GM_ADVANCED);
Canvas.Brush.Style := bsClear;
// Scale Font
Canvas.Font.Height := MulDiv(Canvas.Font.Height, FCurrentPPI, Canvas.Font.PixelsPerInch);
DrawText(Canvas.Handle, PChar(Block.VSPane[I].FDockForm.Caption), -1, DrawRect, DT_END_ELLIPSIS or DT_NOCLIP);
SetGraphicsMode(Canvas.Handle, OldGraphicsMode);
end;
Inc(VisiblePaneCount);
end;
if VisiblePaneCount > 0 then
Inc(FCurrentPos, BlockInterval);
end;
begin
inherited Paint;
FCurrentPos := BlockStartOffset;
for I := 0 to BlockCount - 1 do
DrawSingleBlock(Block[I]);
end;
function TJvDockVSChannel.PaneAtPos(MousePos: TPoint): TJvDockVSPane;
var
I, J: Integer;
ARect: TRect;
begin
Result := nil;
FCurrentPos := BlockStartOffset;
for I := 0 to BlockCount - 1 do
begin
for J := 0 to Block[I].VSPaneCount - 1 do
begin
if not Block[I].VSPane[J].FVisible then
Continue;
GetBlockRect(Block[I], J, ARect);
if PtInRect(ARect, MousePos) then
begin
Result := Block[I].VSPane[J];
Exit;
end;
end;
Inc(FCurrentPos, BlockInterval);
end;
end;
procedure TJvDockVSChannel.PopupDockForm(Pane: TJvDockVSPane);
procedure SetSingleDockFormVisible(HostDockSite: TWinControl; AForm: TCustomForm);
var
I: Integer;
begin
AForm.Visible := True;
for I := 0 to HostDockSite.DockClientCount - 1 do
if AForm <> HostDockSite.DockClients[I] then
HostDockSite.DockClients[I].Visible := False;
end;
begin
if (Pane = nil) or (PopupPane = Pane) then
Exit;
HidePopupPanel(PopupPane);
{ !! Setting visible to true here is too early and causes Align problems.
Visibility is anyway set by FVSPopupPanel.JvDockManager.ShowSingleControl
call.
}
// Pane.FDockForm.Visible := True;
PopupPanelAnimate.PopupForm(Self, Pane.FWidth);
if (Pane.FDockForm <> nil) and (Pane.FDockForm.HostDockSite.Parent is TJvDockTabHostForm) then
begin
// Popup is shown, but the dockform is on a pagecontrol with multiple
// tabs. We hide the other tabs.
SetSingleDockFormVisible(Pane.FDockForm.HostDockSite, Pane.FDockForm);
TJvDockTabHostForm(Pane.FDockForm.HostDockSite.Parent).Caption := Pane.FDockForm.Caption;
// Make the pagecontrol the only visible control.
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm.HostDockSite.Parent);
end
else
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm);
SetPopupPane(Pane);
FVSPopupPanel.JvDockManager.ResetBounds(True);
end;
procedure TJvDockVSChannel.PopupDockForm(Control: TWinControl);
var
Pane: TJvDockVSPane;
begin
Pane := FindPane(Control);
if Assigned(Pane) then
PopupDockForm(Pane);
end;
procedure TJvDockVSChannel.PopupPaneChanged;
begin
{ Notification }
end;
procedure TJvDockVSChannel.RemoveAllBlock;
var
I: Integer;
begin
for I := BlockCount - 1 downto 0 do
DeleteBlock(I);
end;
procedure TJvDockVSChannel.RemoveDockControl(Control: TWinControl);
var
BlockIndex, PaneIndex: Integer;
begin
VSPopupPanel.Visible := False;
if FindDockControl(Control, BlockIndex, PaneIndex) then
begin
Block[BlockIndex].DeletePane(PaneIndex);
if (Block[BlockIndex].VSPaneCount <= 0) or (Block[BlockIndex].FBlockType = btTabBlock) then
DeleteBlock(BlockIndex);
end;
ResetPosition;
Invalidate;
end;
procedure TJvDockVSChannel.ResetActivePaneWidth;
var
DockClient: TJvDockClient;
begin
if PopupPane = nil then
Exit;
DockClient := FindDockClient(PopupPane.DockForm);
if Align in [alLeft, alRight] then
PopupPane.FWidth := VSPopupPanel.Width
else
if Align in [alTop, alBottom] then
PopupPane.FWidth := VSPopupPanel.Height + VSPopupPanel.JvDockManager.GrabberSize;
if DockClient <> nil then
DockClient.VSPaneWidth := PopupPane.FWidth;
end;
procedure TJvDockVSChannel.ResetBlock;
var
I: Integer;
begin
if BlockCount > 0 then
begin
Block[0].FBlockStartPos := BlockStartOffset;
for I := 1 to BlockCount - 1 do
Block[I].FBlockStartPos := Block[I - 1].FBlockStartPos + Block[I - 1].GetTotalWidth + BlockInterval;
end;
end;
procedure TJvDockVSChannel.ResetFontAngle;
var
LogFont: TLogFont;
begin
if Align in [alLeft, alRight] then
if GetObject(Canvas.Font.Handle, SizeOf(LogFont), @LogFont) <> 0 then
begin
LogFont.lfEscapement := 2700;
LogFont.lfOrientation := 2700;
Canvas.Font.Handle := CreateFontIndirect(LogFont);
end;
end;
procedure TJvDockVSChannel.ResetPopupPanelHeight;
begin
if Align in [alLeft, alRight] then
begin
VSPopupPanel.Top := Top;
VSPopupPanel.Height := Height;
VSPopupPanelSplitter.Top := Top;
VSPopupPanelSplitter.Height := Height;
end;
end;
procedure TJvDockVSChannel.ResetPosition;
var
I, J: Integer;
PaneCount: Integer;
begin
PaneCount := 0;
for I := 0 to BlockCount - 1 do
for J := 0 to Block[I].VSPaneCount - 1 do
if Block[I].VSPane[J].FVisible then
Inc(PaneCount);
Visible := PaneCount > 0;
case Align of
alLeft:
begin
Width := ChannelWidth;
Left := GetClientAlignControlArea(Parent, Align, Self);
end;
alRight:
begin
Width := ChannelWidth;
Left := Parent.ClientWidth - GetClientAlignControlArea(Parent, Align, Self) - ChannelWidth + PPIScale(1);
end;
alTop:
begin
Height := ChannelWidth;
Top := GetClientAlignControlArea(Parent, Align, Self);
end;
alBottom:
begin
Height := ChannelWidth;
Top := Parent.ClientHeight - GetClientAlignControlArea(Parent, Align, Self) - ChannelWidth + PPIScale(1);
end;
end;
end;
procedure TJvDockVSChannel.SetActivePaneSize(const Value: Integer);
begin
if FActivePaneSize <> Value then
begin
FActivePaneSize := Value;
Invalidate;
end;
end;
procedure TJvDockVSChannel.SetBlockStartOffset(const Value: Integer);
begin
FBlockStartOffset := Value;
end;
procedure TJvDockVSChannel.SetPopupPane(APane: TJvDockVSPane);
begin
if APane <> FPopupPane then
begin
FPopupPane := APane;
{ If a pane has a visible popup dock form, then it becomes the active pane of
the block }
if Assigned(FPopupPane) then
FPopupPane.FBlock.ActivePane := FPopupPane;
PopupPaneChanged;
end;
end;
procedure TJvDockVSChannel.SetTabColor(const Value: TColor);
begin
if FTabColor <> Value then
begin
FTabColor := Value;
Invalidate;
end;
end;
procedure TJvDockVSChannel.SetVSPopupPanelSplitterPosition;
begin
case Align of
alLeft:
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left + VSPopupPanel.Width,
VSPopupPanel.Top,
VSPopupPanelSplitter.SplitWidth,
VSPopupPanel.Height);
alRight:
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left - VSPopupPanelSplitter.SplitWidth,
VSPopupPanel.Top,
VSPopupPanelSplitter.SplitWidth,
VSPopupPanel.Height);
alTop:
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left,
VSPopupPanel.Top + VSPopupPanel.Height,
VSPopupPanel.Width,
VSPopupPanelSplitter.SplitWidth);
alBottom:
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left,
VSPopupPanel.Top - VSPopupPanelSplitter.SplitWidth,
VSPopupPanel.Width,
VSPopupPanelSplitter.SplitWidth);
end;
VSPopupPanelSplitter.Visible := True;
VSPopupPanelSplitter.BringToFront;
end;
procedure TJvDockVSChannel.ShowPopupPanel(Pane: TJvDockVSPane);
procedure SetSingleDockFormVisible(HostDockSite: TWinControl; AForm: TCustomForm);
var
I: Integer;
begin
for I := 0 to HostDockSite.DockClientCount - 1 do
HostDockSite.DockClients[I].Visible := AForm = HostDockSite.DockClients[I];
end;
var
LShowControl: TWinControl;
begin
if Pane = nil then
Exit;
JvDockLockWindow(nil);
Parent.DisableAlign;
try
{ Auto-hide all popups of this pane }
HidePopupPanel(PopupPane);
Pane.FDockForm.Visible := True;
if (Pane.FDockForm <> nil) and (Pane.FDockForm.HostDockSite.Parent is TJvDockTabHostForm) then
begin
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm.HostDockSite.Parent);
SetSingleDockFormVisible(Pane.FDockForm.HostDockSite, Pane.FDockForm);
TJvDockTabHostForm(Pane.FDockForm.HostDockSite.Parent).Caption := Pane.FDockForm.Caption;
end
else
FVSPopupPanel.JvDockManager.ShowSingleControl(Pane.FDockForm);
SetPopupPane(Pane);
FVSPopupPanel.JvDockManager.ResetBounds(True);
VSPopupPanel.BringToFront;
VSPopupPanelSplitter.BringToFront;
SetControlBringToFront(Parent, Align);
BringToFront;
case Align of
alLeft:
begin
VSPopupPanel.SetBounds(Left + Width,
Top,
Pane.FWidth,
Height);
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left + VSPopupPanel.Width,
Top,
VSPopupPanelSplitter.SplitWidth,
Height);
end;
alRight:
begin
VSPopupPanel.SetBounds(Left - Pane.FWidth,
Top,
Pane.FWidth,
Height);
VSPopupPanelSplitter.SetBounds(VSPopupPanel.Left - VSPopupPanelSplitter.SplitWidth,
Top,
VSPopupPanelSplitter.SplitWidth,
Height);
end;
alTop:
begin
VSPopupPanel.SetBounds(Left,
Top + Height,
Width,
Pane.FWidth);
VSPopupPanelSplitter.SetBounds(Left,
VSPopupPanel.Top + VSPopupPanel.Height,
Width,
VSPopupPanelSplitter.SplitWidth);
end;
alBottom:
begin
VSPopupPanel.SetBounds(Left,
Top - Pane.FWidth,
Width,
Pane.FWidth);
VSPopupPanelSplitter.SetBounds(Left,
VSPopupPanel.Top - VSPopupPanelSplitter.SplitWidth,
Width,
VSPopupPanelSplitter.SplitWidth);
end;
end;
VSPopupPanel.Visible := True;
VSPopupPanelSplitter.Visible := True;
{ If the form is on a tab, then show the parent of the pagecontrol
(a TJvDockTabHostForm), otherwise show the form.
}
LShowControl := nil;
case Pane.FBlock.BlockType of
btTabBlock:
if Pane.FDockForm.Parent is TJvDockTabSheet then
begin
LShowControl := TJvDockTabSheet(Pane.FDockForm.Parent).PageControl;
if Assigned(LShowControl) then
LShowControl := LShowControl.Parent;
end;
btConjoinBlock: LShowControl := Pane.FDockForm;
end;
if Assigned(LShowControl) then
FVSPopupPanel.DoShowControl(LShowControl);
AutoFocusActiveDockForm;
finally
Parent.EnableAlign;
JvDockUnLockWindow;
end;
end;
procedure TJvDockVSChannel.ShowPopupPanel(Control: TWinControl);
var
Pane: TJvDockVSPane;
begin
Pane := FindPane(Control);
if Assigned(Pane) then
ShowPopupPanel(Pane);
end;
procedure TJvDockVSChannel.SyncWithStyle;
begin
if DockStyle is TJvDockVSNetStyle then
begin
ActivePaneSize := TJvDockVSNetStyle(DockStyle).ChannelOption.ActivePaneSize;
TabColor := TJvDockVSNetStyle(DockStyle).ChannelOption.TabColor;
end;
end;
//=== { TJvDockVSNETChannelOption } ==========================================
constructor TJvDockVSNETChannelOption.Create(ADockStyle: TJvDockObservableStyle);
begin
inherited Create(ADockStyle);
FActivePaneSize := 100;
FShowImage := True;
FMouseleaveHide := True;
FHideHoldTime := 1000;
FTabColor := clBtnFace;
end;
procedure TJvDockVSNETChannelOption.Assign(Source: TPersistent);
var
Src: TJvDockVSNETChannelOption;
begin
if Source is TJvDockVSNETChannelOption then
begin
BeginUpdate;
try
Src := TJvDockVSNETChannelOption(Source);
ActivePaneSize := Src.ActivePaneSize;
ShowImage := Src.ShowImage;
MouseleaveHide := Src.MouseleaveHide;
HideHoldTime := Src.HideHoldTime;
TabColor := Src.TabColor;
inherited Assign(Source);
finally
EndUpdate;
end;
end
else
inherited Assign(Source);
end;
procedure TJvDockVSNETChannelOption.SetActivePaneSize(Value: Integer);
begin
if FActivePaneSize <> Value then
begin
FActivePaneSize := Value;
Changed;
end;
end;
procedure TJvDockVSNETChannelOption.SetHideHoldTime(const Value: Integer);
begin
if FHideHoldTime <> Value then
if Value < 100 then
begin
{ (rom) disabled
if csDesigning in DockStyle.ComponentState then
ShowMessage('HideHoldTime cannot be less than 100');
}
FHideHoldTime := 100;
end
else
FHideHoldTime := Value;
end;
procedure TJvDockVSNETChannelOption.SetMouseleaveHide(const Value: Boolean);
begin
if FMouseleaveHide <> Value then
begin
FMouseleaveHide := Value;
{ Notify TJvDockVSNetStyle for enabling/disabling timer? }
end;
end;
procedure TJvDockVSNETChannelOption.SetShowImage(const Value: Boolean);
begin
FShowImage := Value;
end;
procedure TJvDockVSNETChannelOption.SetTabColor(const Value: TColor);
begin
if FTabColor <> Value then
begin
FTabColor := Value;
Changed;
end;
end;
//=== { TJvDockVSNETConjoinServerOption } ====================================
constructor TJvDockVSNETConjoinServerOption.Create(ADockStyle: TJvDockObservableStyle);
begin
inherited Create(ADockStyle);
SystemInfo := True;
end;
procedure TJvDockVSNETConjoinServerOption.UpdateDefaultSystemCaptionInfo;
begin
inherited UpdateDefaultSystemCaptionInfo;
ActiveFont.Color := clWhite;
ActiveFont.Style := [];
InactiveFont.Color := clBlack;
InactiveFont.Style := [];
ActiveTitleEndColor := ActiveTitleStartColor;
InactiveTitleStartColor := clBtnFace;
InactiveTitleEndColor := clBtnFace;
end;
//=== { TJvDockVSNETPanel } ==================================================
constructor TJvDockVSNETPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FVSChannelClass := TJvDockVSChannel;
end;
procedure TJvDockVSNETPanel.AddDockServer(ADockServer: TJvDockServer);
begin
{ Dirty; resolve with new class? }
if not (Self is TJvDockVSPopupPanel) and Assigned(ADockServer) then
begin
CreateVSChannel;
end;
end;
procedure TJvDockVSNETPanel.CreateVSChannel;
begin
if (FVSChannelClass <> nil) and
(FVSChannelClass <> TJvDockVSChannelClass(ClassType)) then
begin
FVSChannel := FVSChannelClass.Create(Self);
FVSChannel.Parent := Parent;
FVSChannel.Align := Align;
FVSChannel.ResetFontAngle;
FVSChannel.ResetPosition;
FVSChannel.Visible := False;
FVSChannel.Name := Name + '_VSChannel';
FVSChannel.CreateVSPopupPanel;
FVSChannel.FreeNotification(Self);
end;
end;
procedure TJvDockVSNETPanel.CustomDockDrop(Source: TJvDockDragDockObject;
X, Y: Integer);
begin
inherited CustomDockDrop(Source, X, Y);
VSChannel.ActiveDockForm.Perform(CM_EXIT, 0, 0);
end;
procedure TJvDockVSNETPanel.DestroyVSChannel;
begin
FVSChannel.Free;
FVSChannel := nil;
end;
procedure TJvDockVSNETPanel.DoAutoHideControl(Control: TWinControl);
begin
if Align = alNone then
DoShowControl(Control)
else
DoHideControl(Control);
end;
procedure TJvDockVSNETPanel.DoHideControl(Control: TWinControl);
begin
JvDockLockWindow(nil);
DisableAlign;
try
VSChannel.AddDockControl(Control);
if LRDockWidth = 0 then
LRDockWidth := Control.LRDockWidth;
if TBDockHeight = 0 then
TBDockHeight := Control.TBDockHeight;
ShowDockPanel(VisibleDockClientCount > 1, Control, sdfDockPanel);
{ using a null-rect as parameter for Dock causes align problems }
Control.Dock(VSChannel.VSPopupPanel, Control.BoundsRect);
// Control.Dock(VSChannel.VSPopupPanel, Rect(0, 0, 0, 0));
{ (rb) For every call to InsertControl there must be a call to RemoveControl.
That is not guaranteed now, so JvDockManager may be filled with dangling
references }
// VSChannel.VSPopupPanel.JvDockManager.InsertControl(Control, alNone, nil);
VSChannel.InternalInsertControl(Control);
VSChannel.VSPopupPanel.JvDockManager.ShowSingleControl(Control);
JvDockManager.HideControl(Control);
ResetChannelBlockStartOffset(VSChannel);
finally
EnableAlign;
JvDockUnLockWindow;
end;
end;
procedure TJvDockVSNETPanel.DoShowControl(Control: TWinControl);
var
Panel: TJvDockVSNETPanel;
procedure ResetDockFormVisible;
var
I: Integer;
begin
if Control is TJvDockTabHostForm then
with TJvDockTabHostForm(Control) do
for I := 0 to PageControl.Count - 1 do
begin
PageControl.Pages[I].Visible := TJvDockVSNETTabSheet(PageControl.Pages[I]).OldVisible;
PageControl.Pages[I].Controls[0].Visible := PageControl.Pages[I].Visible;
if PageControl.ActivePage = PageControl.Pages[I] then
PageControl.Pages[I].BringToFront;
end;
end;
begin
{ Dirty; solve with virtual method? }
if Self is TJvDockVSPopupPanel then
begin
Panel := TJvDockVSPopupPanel(Self).FVSNETDockPanel;
JvDockLockWindow(nil);
Panel.DisableAlign;
try
{ using a null-rect as parameter for Dock causes align problems }
Control.Dock(Panel, Control.BoundsRect);
// Control.Dock(Panel, Rect(0, 0, 0, 0));
Panel.JvDockManager.ShowControl(Control);
// JvDockManager.RemoveControl(Control);
Panel.VSChannel.InternalRemoveControl(Control);
Panel.VSChannel.RemoveDockControl(Control);
if Panel.LRDockWidth = 0 then
Panel.LRDockWidth := Control.LRDockWidth;
if Panel.TBDockHeight = 0 then
Panel.TBDockHeight := Control.TBDockHeight;
Panel.ShowDockPanel(Panel.VisibleDockClientCount > 0, Control, sdfDockPanel);
Panel.VSChannel.AutoFocusActiveDockForm;
Panel.VSChannel.HidePopupPanel(Panel.VSChannel.PopupPane);
ResetDockFormVisible;
ResetChannelBlockStartOffset(Panel.VSChannel);
finally
Panel.EnableAlign;
JvDockUnLockWindow;
end;
end;
end;
procedure TJvDockVSNETPanel.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (AComponent = VSChannel) and (Operation = opRemove) then
FVSChannel := nil;
end;
procedure TJvDockVSNETPanel.RemoveDockServer(ADockServer: TJvDockServer);
begin
DestroyVSChannel;
end;
procedure TJvDockVSNETPanel.Resize;
begin
inherited Resize;
if (Align in [alTop, alBottom]) and Assigned(DockServer) then
begin
if Assigned(DockServer.DockPanelWithAlign[alLeft]) then
TJvDockVSNETPanel(DockServer.DockPanelWithAlign[alLeft]).VSChannel.ResetPopupPanelHeight;
if Assigned(DockServer.DockPanelWithAlign[alRight]) then
TJvDockVSNETPanel(DockServer.DockPanelWithAlign[alRight]).VSChannel.ResetPopupPanelHeight;
end;
end;
//=== { TJvDockVSNetStyle } ==================================================
constructor TJvDockVSNetStyle.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
DockPanelClass := TJvDockVSNETPanel;
DockSplitterClass := TJvDockVSNETSplitter;
ConjoinPanelClass := TJvDockVSNETConjoinPanel;
TabDockClass := TJvDockVSNETTabPageControl;
DockPanelTreeClass := TJvDockVSNETTree;
DockPanelZoneClass := TJvDockVSNETZone;
ConjoinPanelTreeClass := TJvDockVSNETTree;
ConjoinPanelZoneClass := TJvDockVSNETZone;
ConjoinServerOptionClass := TJvDockVSNETConjoinServerOption;
TabServerOptionClass := TJvDockVSNETTabServerOption;
FChannelOptionClass := TJvDockVSNETChannelOption;
FDockServers := TList.Create;
end;
destructor TJvDockVSNetStyle.Destroy;
begin
{ Note that RemoveDockBaseControl can be called in the inherited Destroy call.
So we set FTimer to nil, and destroy FDockServers after the inherited call.
}
DestroyTimer;
inherited Destroy;
FDockServers.Free;
end;
procedure TJvDockVSNetStyle.AddDockBaseControl(ADockBaseControl: TJvDockBaseControl);
begin
inherited AddDockBaseControl(ADockBaseControl);
if ADockBaseControl is TJvDockServer then
FDockServers.Add(ADockBaseControl);
end;
procedure TJvDockVSNetStyle.BeginPopup(AChannel: TJvDockVSChannel);
begin
CreateTimer;
end;
procedure TJvDockVSNetStyle.CreateServerOption;
begin
inherited CreateServerOption;
if (FChannelOption = nil) and (FChannelOptionClass <> nil) then
FChannelOption := FChannelOptionClass.Create(Self);
end;
procedure TJvDockVSNetStyle.CreateTimer;
begin
if not ChannelOption.MouseleaveHide then
Exit;
if csDesigning in ComponentState then
Exit;
if not Assigned(FTimer) then
begin
FTimer := TTimer.Create(Self);
FTimer.Interval := 100; // !! high interval
FTimer.OnTimer := Self.Timer;
FTimer.Enabled := True;
FCurrentTimer := ChannelOption.HideHoldTime;
end;
end;
procedure TJvDockVSNetStyle.DestroyTimer;
begin
FTimer.Free;
FTimer := nil;
end;
function TJvDockVSNetStyle.DockClientWindowProc(DockClient: TJvDockClient;
var Msg: TMessage): Boolean;
var
Channel: TJvDockVSChannel;
begin
Result := inherited DockClientWindowProc(DockClient, Msg);
case Msg.Msg of
CM_ENTER, CM_EXIT:
begin
Channel := RetrieveChannel(DockClient.ParentForm.HostDockSite);
if Msg.Msg = CM_EXIT then
begin
if Assigned(Channel) and (Channel.ActiveDockForm = DockClient.ParentForm) then
Channel.HidePopupPanelWithAnimate;
end
else
if Msg.Msg = CM_ENTER then
HideAllPopupPanel(Channel);
end;
end;
end;
function TJvDockVSNetStyle.DockServerWindowProc(DockServer: TJvDockServer;
var Msg: TMessage): Boolean;
begin
Result := inherited DockServerWindowProc(DockServer, Msg);
if Msg.Msg = WM_SIZE then
with TChannelEnumerator.Create(DockServer) do
try
while MoveNext do
Current.HidePopupPanel(Current.PopupPane);
finally
Free;
end;
end;
procedure TJvDockVSNetStyle.DoHideDockForm(DockWindow: TWinControl);
var
TmpDockWindow: TWinControl;
procedure HideDockChild(DockWindow: TWinControl);
var
I: Integer;
DockClient: TJvDockClient;
begin
if DockWindow = nil then
Exit;
if (DockWindow is TJvDockableForm) and (DockWindow.Visible) then
with TJvDockableForm(DockWindow).DockableControl do
for I := 0 to DockClientCount - 1 do
HideDockChild(TWinControl(DockClients[I]));
DockClient := FindDockClient(DockWindow);
if (DockWindow is TForm) and (TForm(DockWindow).FormStyle <> fsMDIChild) and
(DockClient.DockStyle <> nil) then
DockClient.DockStyle.HideDockForm(DockClient);
end;
procedure HideDockParent(DockWindow: TWinControl);
var
Host: TWinControl;
DockClient: TJvDockClient;
begin
if (DockWindow <> nil) and (DockWindow.HostDockSite <> nil) then
begin
// work-around
if Assigned(RetrieveChannel(DockWindow.HostDockSite)) then
Exit;
Host := DockWindow.HostDockSite;
if Host.VisibleDockClientCount = 0 then
if Host is TJvDockPanel then
TJvDockPanel(Host).ShowDockPanel(False, nil)
else
begin
if Host.Parent <> nil then
begin
DockClient := FindDockClient(Host.Parent);
if (DockClient <> nil) and (DockClient.DockStyle <> nil) then
DockClient.DockStyle.HideDockForm(DockClient);
HideDockParent(Host.Parent);
end;
end;
end;
end;
procedure HidePopupPanel(Client: TWinControl);
var
Channel: TJvDockVSChannel;
begin
Channel := RetrieveChannel(Client.HostDockSite);
if Assigned(Channel) then
Channel.HidePopupPanel(Client);
end;
begin
TmpDockWindow := DockWindow;
HideDockChild(DockWindow);
HideDockParent(DockWindow);
if (DockWindow.HostDockSite is TJvDockCustomControl) then
TJvDockCustomControl(DockWindow.HostDockSite).UpdateCaption(DockWindow);
HidePopupPanel(TmpDockWindow);
end;
procedure TJvDockVSNetStyle.DoShowDockForm(DockWindow: TWinControl);
procedure PopupAutoHiddenForm(Client: TWinControl);
var
Channel: TJvDockVSChannel;
begin
Channel := RetrieveChannel(Client.HostDockSite);
if Assigned(Channel) then
Channel.PopupDockForm(Client);
end;
begin
inherited DoShowDockForm(DockWindow);
PopupAutoHiddenForm(DockWindow);
end;
procedure TJvDockVSNetStyle.DoUnAutoHideDockForm(DockWindow: TWinControl);
procedure ShowAutoHiddenForm(Client: TWinControl);
var
Channel: TJvDockVSChannel;
begin
Channel := RetrieveChannel(Client.HostDockSite);
if Assigned(Channel) then
Channel.ShowPopupPanel(Client);
end;
begin
inherited DoShowDockForm(DockWindow);
ShowAutoHiddenForm(DockWindow);
end;
procedure TJvDockVSNetStyle.EndPopup(AChannel: TJvDockVSChannel);
begin
DestroyTimer;
end;
procedure TJvDockVSNetStyle.FreeServerOption;
begin
inherited FreeServerOption;
FChannelOption.Free;
FChannelOption := nil;
end;
class function TJvDockVSNetStyle.GetAnimationInterval: Integer;
begin
Result := GlobalPopupPanelAnimateInterval;
end;
class function TJvDockVSNetStyle.GetAnimationMoveWidth: Integer;
begin
Result := GlobalPopupPanelAnimateMoveWidth;
end;
class function TJvDockVSNetStyle.GetAnimationStartInterval: Integer;
begin
Result := GlobalPopupPanelStartAnimateInterval;
end;
function TJvDockVSNetStyle.GetChannelOption: TJvDockVSNETChannelOption;
begin
Result := FChannelOption;
end;
function TJvDockVSNetStyle.GetDockFormVisible(ADockClient: TJvDockClient): Boolean;
var
Channel: TJvDockVSChannel;
Pane: TJvDockVSPane;
begin
Result := True;
if Assigned(ADockClient) then
begin
Channel := RetrieveChannel(ADockClient.ParentForm.HostDockSite);
if Assigned(Channel) then
begin
Pane := Channel.FindPane(ADockClient.ParentForm);
if Assigned(Pane) then
Result := Pane.FVisible;
end
else
Result := inherited GetDockFormVisible(ADockClient);
end;
end;
procedure TJvDockVSNetStyle.HideDockForm(ADockClient: TJvDockClient);
begin
inherited HideDockForm(ADockClient);
SetDockFormVisible(ADockClient, False);
end;
procedure TJvDockVSNetStyle.RemoveDockBaseControl(
ADockBaseControl: TJvDockBaseControl);
begin
inherited RemoveDockBaseControl(ADockBaseControl);
if ADockBaseControl is TJvDockServer then
begin
FDockServers.Remove(ADockBaseControl);
if FDockServers.Count = 0 then
DestroyTimer;
end;
end;
procedure TJvDockVSNetStyle.RestoreClient(DockClient: TJvDockClient);
begin
{ Skip if the form is autohidden on a channel }
if Assigned(RetrieveChannel(DockClient.ParentForm.HostDockSite)) then
Exit;
inherited RestoreClient(DockClient);
end;
class procedure TJvDockVSNetStyle.SetAnimationInterval(const Value: Integer);
begin
if GlobalPopupPanelAnimateInterval <> Value then
begin
GlobalPopupPanelAnimateInterval := Value;
FreeAndNil(GlobalPopupPanelAnimate);
end;
end;
class procedure TJvDockVSNetStyle.SetAnimationMoveWidth(const Value: Integer);
begin
if GlobalPopupPanelAnimateMoveWidth <> Value then
begin
GlobalPopupPanelAnimateMoveWidth := Value;
FreeAndNil(GlobalPopupPanelAnimate);
end;
end;
procedure TJvDockVSNetStyle.SetChannelOption(const Value: TJvDockVSNETChannelOption);
begin
{ !! May be nil }
FChannelOption.Assign(Value);
end;
procedure TJvDockVSNetStyle.SetDockFormVisible(ADockClient: TJvDockClient;
AVisible: Boolean);
var
Channel: TJvDockVSChannel;
Pane: TJvDockVSPane;
procedure ResetActivePane;
var
I: Integer;
begin
if AVisible then
Pane.FBlock.ActivePane := Pane
else
begin
for I := Pane.FIndex downto 0 do
if Pane.FBlock.VSPane[I].FVisible then
begin
Pane.FBlock.ActivePane := Pane.FBlock.VSPane[I];
Exit;
end;
for I := Pane.FIndex + 1 to Pane.FBlock.VSPaneCount - 1 do
if Pane.FBlock.VSPane[I].FVisible then
begin
Pane.FBlock.ActivePane := Pane.FBlock.VSPane[I];
Exit;
end;
end;
end;
begin
if not Assigned(ADockClient) then
Exit;
Channel := RetrieveChannel(ADockClient.ParentForm.HostDockSite);
if not Assigned(Channel) then
begin
// Mantis 3752
if ADockClient.ParentForm.Parent is TJvDockVSNETTabSheet then
(ADockClient.ParentForm.Parent as TJvDockVSNETTabSheet).OldVisible := AVisible;
Exit;
end;
Pane := Channel.FindPane(ADockClient.ParentForm);
if Assigned(Pane) and (Pane.FDockForm = ADockClient.ParentForm) then
begin
Pane.FVisible := AVisible;
ResetActivePane;
if ADockClient.ParentForm.Parent is TJvDockVSNETTabSheet then
TJvDockVSNETTabSheet(ADockClient.ParentForm.Parent).OldVisible := AVisible;
Channel.ResetPosition;
Channel.Invalidate;
end;
end;
procedure TJvDockVSNetStyle.ShowDockForm(ADockClient: TJvDockClient);
begin
inherited ShowDockForm(ADockClient);
SetDockFormVisible(ADockClient, True);
end;
procedure TJvDockVSNetStyle.Timer(Sender: TObject);
function IsPopupWindow(Handle: HWND): Boolean;
var
OwningProcess: DWORD;
LStyle: Cardinal;
begin
Result := False;
if (Handle <> 0) and (GetWindowThreadProcessID(Handle, @OwningProcess) <> 0) and
(OwningProcess = GetCurrentProcessId) then
begin
LStyle := GetWindowLong(Handle, GWL_STYLE);
Result := WS_POPUP and LSTYLE <> 0;
end;
end;
function PointIsOnPopup(P: TPoint; GlobalCheck: Boolean): Boolean;
const
GW_ENABLEDPOPUP = 6;
var
Control: TWinControl;
Handle: HWND;
// Rect: TRect;
ActivePopupWindow: Boolean;
begin
Control := FindVCLWindow(P);
Result := ControlIsOnPopup(Control);
if not Result then
begin
// Check whether a popup window is currently displayed (hint, popup menu)
Handle := WindowFromPoint(P);
ActivePopupWindow := IsPopupWindow(Handle);
if not ActivePopupWindow and GlobalCheck then
begin
Handle := GetWindow(Application.Handle, GW_ENABLEDPOPUP);
ActivePopupWindow := IsPopupWindow(Handle);
if not ActivePopupWindow then
begin
Handle := GetTopWindow(GetDesktopWindow);
ActivePopupWindow := IsPopupWindow(Handle);
end;
end;
Result := ActivePopupWindow;
// if ActivePopupWindow then
// begin
// GetWindowRect(Handle, Rect);
// // Search for a control one pixel to the left;
// Dec(Rect.Left);
// Result := PointIsOnPopup(Rect.TopLeft, False);
// if not Result then
// begin
// // Search for a control one pixel to the Right;
// Inc(Rect.Right);
// Result := PointIsOnPopup(Point(Rect.Right, Rect.Top), False);
// end;
// end;
end;
end;
var
P: TPoint;
I: Integer;
ADockServer: TJvDockServer;
begin
if (csDesigning in ComponentState) or not ChannelOption.MouseleaveHide or
((GetAsyncKeyState(VK_LBUTTON) and $8000) <> 0) then
Exit;
GetCursorPos(P);
if PointIsOnPopup(P, True) then
begin
{ Reset timer }
FCurrentTimer := ChannelOption.HideHoldTime;
Exit;
end;
Dec(FCurrentTimer, 100);
if FCurrentTimer > 0 then
Exit;
DestroyTimer;
for I := 0 to FDockServers.Count - 1 do
begin
ADockServer := TJvDockServer(FDockServers[I]);
with TChannelEnumerator.Create(ADockServer) do
try
while MoveNext do
Current.HidePopupPanelWithAnimate;
finally
Free;
end;
end;
end;
//=== { TJvDockVSNETTabPageControl } =========================================
constructor TJvDockVSNETTabPageControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
TabSheetClass := TJvDockVSNETTabSheet;
TabPanelClass := TJvDockVSNETTabPanel;
end;
procedure TJvDockVSNETTabPageControl.ShowControl(AControl: TControl);
begin
inherited ShowControl(AControl);
end;
//=== { TJvDockVSNETTabPanel } ===============================================
constructor TJvDockVSNETTabPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
TabHeight := 25;
CaptionTopOffset := 1;
end;
//=== { TJvDockVSNETTabServerOption } ========================================
constructor TJvDockVSNETTabServerOption.Create(ADockStyle: TJvDockObservableStyle);
begin
inherited Create(ADockStyle);
InactiveFont.Color := VSNETPageInactiveFontColor;
InactiveSheetColor := VSNETPageInactiveSheetColor;
ShowTabImages := True;
end;
//=== { TJvDockVSNETTabSheet } ===============================================
constructor TJvDockVSNETTabSheet.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FOldVisible := True;
end;
procedure TJvDockVSNETTabSheet.SetOldVisible(const Value: Boolean);
begin
FOldVisible := Value;
end;
//=== { TJvDockVSNETTree } ===================================================
constructor TJvDockVSNETTree.Create(DockSite: TWinControl;
DockZoneClass: TJvDockZoneClass; ADockStyle: TJvDockObservableStyle);
begin
inherited Create(DockSite, DockZoneClass, ADockStyle);
ButtonHeight := 12;
ButtonWidth := 16;
LeftOffset := 2;
RightOffset := 3;
TopOffset := 4;
BottomOffset := 3;
ButtonSplitter := 2;
CaptionLeftOffset := 5;
CaptionRightOffset := 5;
end;
procedure TJvDockVSNETTree.BeginDrag(Control: TControl; Immediate: Boolean;
Threshold: Integer);
begin
if not (DockSite is TJvDockVSPopupPanel) then
inherited BeginDrag(Control, Immediate, Threshold);
end;
procedure TJvDockVSNETTree.CustomLoadZone(Stream: TStream;
var Zone: TJvDockZone);
var
Pane: TJvDockVSPane;
I: Integer;
Sheet: TJvDockVSNETTabSheet;
procedure SetPaneVisible(ChildControl: TControl; VSPaneVisible: Boolean);
var
ADockClient: TJvDockClient;
begin
if Pane <> nil then
begin
Pane.FVisible := VSPaneVisible;
ADockClient := FindDockClient(Pane.FDockForm);
if ADockClient <> nil then
if Pane.FVisible then
begin
ADockClient.ParentVisible := False;
ADockClient.ParentForm.Visible := True;
ADockClient.MakeShowEvent;
end
else
ADockClient.MakeHideEvent;
end;
end;
begin
inherited CustomLoadZone(Stream, Zone);
if Zone = nil then
Exit;
Stream.Read(TJvDockVSNETZone(Zone).FVSPaneVisible, SizeOf(TJvDockVSNETZone(Zone).VSPaneVisible));
if DockSite is TJvDockVSPopupPanel then
begin
with TJvDockVSPopupPanel(DockSite).VSChannel, TJvDockVSNETZone(Zone) do
begin
if ChildControl is TJvDockTabHostForm then
begin
for I := 0 to TJvDockTabHostForm(ChildControl).PageControl.Count - 1 do
begin
Sheet := TJvDockVSNETTabSheet(TJvDockTabHostForm(ChildControl).PageControl.Pages[I]);
Pane := FindPane(TWinControl(Sheet.Controls[0]));
SetPaneVisible(ChildControl, Sheet.OldVisible);
end;
end
else
begin
Pane := FindPane(ChildControl);
SetPaneVisible(ChildControl, VSPaneVisible);
end;
ResetPosition;
end;
end;
end;
procedure TJvDockVSNETTree.CustomSaveZone(Stream: TStream;
Zone: TJvDockZone);
var
Pane: TJvDockVSPane;
begin
inherited CustomSaveZone(Stream, Zone);
if DockSite is TJvDockVSPopupPanel then
with TJvDockVSPopupPanel(DockSite).VSChannel, TJvDockVSNETZone(Zone) do
begin
Pane := FindPane(ChildControl);
if Pane <> nil then
VSPaneVisible := Pane.FVisible;
end;
Stream.Write(TJvDockVSNETZone(Zone).VSPaneVisible, SizeOf(TJvDockVSNETZone(Zone).VSPaneVisible));
end;
procedure TJvDockVSNETTree.DoHideZoneChild(AZone: TJvDockZone);
var
Form: TCustomForm;
ADockClient: TJvDockClient;
begin
if (AZone <> nil) and (AZone.ChildControl <> nil) then
begin
if AZone.ChildControl is TJvDockTabHostForm then
begin
Form := TJvDockTabHostForm(AZone.ChildControl).PageControl.ActiveDockForm;
if Form <> nil then
begin
ADockClient := FindDockClient(Form);
if (ADockClient <> nil) and not ADockClient.EnableCloseButton then
Exit
else
Form.Close;
end;
end
else
inherited DoHideZoneChild(AZone);
end;
end;
procedure TJvDockVSNETTree.DoLButtonDbClk(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer);
begin
if not (DockSite is TJvDockVSPopupPanel) then
inherited DoLButtonDbClk(Msg, Zone, HTFlag);
end;
function TJvDockVSNETTree.DoLButtonDown(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer): Boolean;
begin
Result := inherited DoLButtonDown(Msg, Zone, HTFlag);
if Zone <> nil then
begin
if HTFlag = HTCLOSE then
TJvDockVSNETZone(Zone).CloseBtnState := bsDown
else
if HTFlag = HTAUTOHIDE then
begin
AutoHideZone := TJvDockVSNETZone(Zone);
AutoHideZone.AutoHideBtnDown := True;
AutoHideZone.AutoHideBtnState := bsDown;
end;
end;
end;
procedure TJvDockVSNETTree.DoLButtonUp(var Msg: TWMMouse;
var Zone: TJvDockZone; out HTFlag: Integer);
begin
if CloseButtonZone <> nil then
TJvDockVSNETZone(CloseButtonZone).CloseBtnState := bsNormal;
inherited DoLButtonUp(Msg, Zone, HTFlag);
if AutoHideZone <> nil then
begin
AutoHideZone.AutoHideBtnDown := False;
AutoHideZone.AutoHideBtnState := bsNormal;
if HTFlag = HTAUTOHIDE then
if DockSite is TJvDockVSNETPanel then
TJvDockVSNETPanel(DockSite).DoAutoHideControl(AutoHideZone.ChildControl);
AutoHideZone := nil;
end;
end;
procedure TJvDockVSNETTree.DoMouseMove(var Msg: TWMMouse;
var AZone: TJvDockZone; out HTFlag: Integer);
var
Zone: TJvDockVSNETZone;
begin
inherited DoMouseMove(Msg, AZone, HTFlag);
if AZone <> nil then
begin
Zone := TJvDockVSNETZone(AZone);
if Zone.AutoHideBtnDown then
begin
if HTFlag = HTAUTOHIDE then
Zone.AutoHideBtnState := bsDown
else
Zone.AutoHideBtnState := bsUp;
end
else
if (HTFlag = HTAUTOHIDE) and not Zone.CloseBtnDown then
Zone.AutoHideBtnState := bsUp
else
Zone.AutoHideBtnState := bsNormal;
if Zone.CloseBtnDown then
begin
if HTFlag = HTCLOSE then
Zone.CloseBtnState := bsDown
else
Zone.CloseBtnState := bsUp;
end
else
if (HTFlag = HTCLOSE) and not Zone.AutoHideBtnDown then
Zone.CloseBtnState := bsUp
else
Zone.CloseBtnState := bsNormal;
end;
end;
procedure TJvDockVSNETTree.DoOtherHint(Zone: TJvDockZone; HTFlag: Integer;
var HintStr: string);
begin
inherited DoOtherHint(Zone, HTFlag, HintStr);
if HTFlag = HTAUTOHIDE then
HintStr := RsDockVSNETDockTreeAutoHideBtnHint;
end;
procedure TJvDockVSNETTree.DrawAutoHideButton(Zone: TJvDockZone; Left, Top: Integer);
var
AZone: TJvDockVSNETZone;
ColorArr: array [1..2] of TColor;
ADockClient: TJvDockClient;
IsActive: Boolean;
begin
if Zone <> nil then
begin
ADockClient := FindDockClient(Zone.ChildControl);
if (ADockClient <> nil) and not ADockClient.EnableCloseButton then
Left := Left + ButtonWidth; // move the auto hide button to the Close Button's location
AZone := TJvDockVSNETZone(Zone);
IsActive := Assigned(Screen.ActiveControl) and Screen.ActiveControl.Focused and
AZone.ChildControl.ContainsControl(Screen.ActiveControl);
if AZone.AutoHideBtnState <> bsNormal then
begin
if AZone.AutoHideBtnState = bsUp then
begin
ColorArr[1] := clBlack;
if IsActive then
ColorArr[2] := clBtnFace
else
ColorArr[2] := clWhite;
end
else
if AZone.AutoHideBtnState = bsDown then
begin
ColorArr[1] := clBtnFace;
ColorArr[2] := clBlack;
end;
Canvas.Pen.Color := ColorArr[1];
Canvas.MoveTo(Left, Top + ButtonHeight);
Canvas.LineTo(Left + ButtonWidth, Top + ButtonHeight);
Canvas.LineTo(Left + ButtonWidth, Top);
Canvas.Pen.Color := ColorArr[2];
Canvas.LineTo(Left, Top);
Canvas.LineTo(Left, Top + ButtonHeight);
end;
if AZone.AutoHideBtnState = bsDown then
begin
Inc(Left, PPIScale(1));
Inc(Top, PPIScale(1));
end;
if IsActive then
Canvas.Pen.Color := clWhite
else
Canvas.Pen.Color := clBlack;
if DockSite.Align in [alLeft, alRight, alTop, alBottom] then
begin
Canvas.MoveTo(Left + PPIScale(9), Top + PPIScale(10));
Canvas.LineTo(Left + PPIScale(9), Top + PPIScale(7));
Canvas.MoveTo(Left + PPIScale(6), Top + PPIScale(7));
Canvas.LineTo(Left + PPIScale(13), Top + PPIScale(7));
Canvas.MoveTo(Left + PPIScale(7), Top + PPIScale(6));
Canvas.LineTo(Left + PPIScale(7), Top + PPIScale(2));
Canvas.LineTo(Left + PPIScale(10), Top + PPIScale(2));
Canvas.LineTo(Left + PPIScale(10), Top + PPIScale(6));
Canvas.LineTo(Left + PPIScale(11), Top + PPIScale(6));
Canvas.LineTo(Left + PPIScale(11), Top + PPIScale(1));
end
else
if DockSite.Align in [alNone] then
begin
Canvas.MoveTo(Left + PPIScale(5), Top + PPIScale(6));
Canvas.LineTo(Left + PPIScale(8), Top + PPIScale(6));
Canvas.MoveTo(Left + PPIScale(8), Top + PPIScale(3));
Canvas.LineTo(Left + PPIScale(8), Top + PPIScale(10));
Canvas.MoveTo(Left + PPIScale(9), Top + PPIScale(4));
Canvas.LineTo(Left + PPIScale(12), Top + PPIScale(4));
Canvas.LineTo(Left + PPIScale(12), Top + PPIScale(7));
Canvas.LineTo(Left + PPIScale(9), Top + PPIScale(7));
Canvas.LineTo(Left + PPIScale(9), Top + PPIScale(8));
Canvas.LineTo(Left + PPIScale(13), Top + PPIScale(8));
end;
end;
end;
procedure TJvDockVSNETTree.DrawCloseButton(Canvas: TCanvas;
Zone: TJvDockZone; Left, Top: Integer);
var
DrawRect: TRect;
AZone: TJvDockVSNETZone;
ColorArr: array [1..2] of TColor;
ADockClient: TJvDockClient;
AForm: TCustomForm;
IsActive: Boolean;
OrgPenWidth: Integer;
begin
if Zone <> nil then
begin
ADockClient := FindDockClient(Zone.ChildControl);
if (ADockClient <> nil) and not ADockClient.EnableCloseButton then
Exit;
if Zone.ChildControl is TJvDockTabHostForm then
begin
AForm := TJvDockTabHostForm(Zone.ChildControl).PageControl.ActiveDockForm;
if AForm <> nil then
begin
ADockClient := FindDockClient(AForm);
if (ADockClient <> nil) and not ADockClient.EnableCloseButton then
Exit;
end;
end;
AZone := TJvDockVSNETZone(Zone);
IsActive := Assigned(Screen.ActiveControl) and Screen.ActiveControl.Focused and
AZone.ChildControl.ContainsControl(Screen.ActiveControl);
DrawRect.Left := Left + PPIScale(6);
DrawRect.Right := DrawRect.Left + PPIScale(7);
DrawRect.Top := Top + PPIScale(3);
DrawRect.Bottom := DrawRect.Top + PPIScale(7);
if AZone.CloseBtnState <> bsNormal then
begin
if AZone.CloseBtnState = bsUp then
begin
ColorArr[1] := clBlack;
if IsActive then
ColorArr[2] := clBtnFace
else
ColorArr[2] := clWhite;
end
else
if AZone.CloseBtnState = bsDown then
begin
ColorArr[1] := clBtnFace;
ColorArr[2] := clBlack;
end;
Canvas.Pen.Color := ColorArr[1];
Canvas.MoveTo(Left, Top + ButtonHeight);
Canvas.LineTo(Left + ButtonWidth, Top + ButtonHeight);
Canvas.LineTo(Left + ButtonWidth, Top);
Canvas.Pen.Color := ColorArr[2];
Canvas.LineTo(Left, Top);
Canvas.LineTo(Left, Top + ButtonHeight);
end;
if AZone.CloseBtnState = bsDown then
OffsetRect(DrawRect, PPIScale(1), PPIScale(1));
if IsActive then
Canvas.Pen.Color := clWhite
else
Canvas.Pen.Color := clBlack;
OrgPenWidth := Canvas.Pen.Width;
try
Canvas.Pen.Width := PPIScale(2);
Dec(DrawRect.Left);
Dec(DrawRect.Right);
Canvas.MoveTo(DrawRect.Left, DrawRect.Top);
Canvas.LineTo(DrawRect.Right, DrawRect.Bottom);
Canvas.MoveTo(DrawRect.Right, DrawRect.Top);
Canvas.LineTo(DrawRect.Left, DrawRect.Bottom);
finally
Canvas.Pen.Width := OrgPenWidth;
end;
end;
end;
procedure TJvDockVSNETTree.DrawDockGrabber(Control: TWinControl; const ARect: TRect);
begin
inherited DrawDockGrabber(Control, ARect);
if DockSite.Align <> alClient then
begin
DrawAutoHideButton(FindControlZone(Control),
ARect.Right - RightOffset - 2 * ButtonWidth - ButtonSplitter,
ARect.Top + TopOffset)
end;
end;
procedure TJvDockVSNETTree.GetCaptionRect(var Rect: TRect);
var
ADockClient: TJvDockClient;
begin
if DockSite.Align = alClient then
inherited GetCaptionRect(Rect)
else
begin
Inc(Rect.Left, PPIScale(2) + CaptionLeftOffset);
ADockClient := FindDockClient(DockSite);
Inc(Rect.Top, PPIScale(1));
if (ADockClient = nil) or ADockClient.EnableCloseButton then
Dec(Rect.Right, 2 * ButtonWidth + ButtonSplitter + CaptionRightOffset - PPIScale(1))
else
Dec(Rect.Right, 1 * ButtonWidth + ButtonSplitter + CaptionRightOffset - PPIScale(1));
Dec(Rect.Bottom, PPIScale(2));
end;
end;
function TJvDockVSNETTree.GetTopGrabbersHTFlag(const MousePos: TPoint;
out HTFlag: Integer; Zone: TJvDockZone): TJvDockZone;
var
ADockClient: TJvDockClient;
begin
Result := inherited GetTopGrabbersHTFlag(MousePos, HTFlag, Zone);
if Zone <> nil then
begin
ADockClient := FindDockClient(Zone.ChildControl);
if (ADockClient <> nil) and not ADockClient.EnableCloseButton then
begin
if HTFlag = HTCLOSE then
HTFLAG := HTAUTOHIDE;
Exit;
end;
end;
if (Zone <> nil) and (DockSite.Align <> alClient) and (HTFlag <> HTCLOSE) then
begin
with Zone.ChildControl do
if PtInRect(Rect(
Left + Width - 2 * ButtonWidth - RightOffset - ButtonSplitter,
Top - GrabberSize + TopOffset,
Left + Width - 1 * ButtonWidth - RightOffset - ButtonSplitter,
Top - GrabberSize + TopOffset + ButtonHeight), MousePos) then
HTFlag := HTAUTOHIDE;
end;
end;
procedure TJvDockVSNETTree.IgnoreZoneInfor(Stream: TMemoryStream);
begin
inherited IgnoreZoneInfor(Stream);
Stream.Position := Stream.Position + 1;
end;
procedure TJvDockVSNETTree.PaintDockGrabberRect(Canvas: TCanvas;
Control: TWinControl; const ARect: TRect; PaintAlways: Boolean = False);
var
DrawRect: TRect;
IsActive: Boolean;
begin
inherited PaintDockGrabberRect(Canvas, Control, ARect);
IsActive := Assigned(Screen.ActiveControl) and Screen.ActiveControl.Focused and
Control.ContainsControl(Screen.ActiveControl);
if not IsActive or PaintAlways then
begin
Canvas.Pen.Color := clGray;
DrawRect := ARect;
Inc(DrawRect.Left, PPIScale(1));
Canvas.RoundRect(DrawRect.Left, DrawRect.Top, DrawRect.Right, DrawRect.Bottom, PPIScale(2), PPIScale(2));
end;
end;
//=== { TJvDockVSNETZone } ===================================================
constructor TJvDockVSNETZone.Create(Tree: TJvDockTree);
begin
inherited Create(Tree);
FAutoHideBtnState := bsNormal;
FCloseBtnState := bsNormal;
FVSPaneVisible := True;
end;
procedure TJvDockVSNETZone.DoCustomSetControlName;
var
I: Integer;
Pane: TJvDockVSPane;
ADockClient: TJvDockClient;
begin
inherited DoCustomSetControlName;
if Tree.DockSite is TJvDockVSPopupPanel then
begin
with TJvDockVSPopupPanel(Tree.DockSite).VSChannel do
begin
AddDockControl(ChildControl);
if ChildControl is TJvDockTabHostForm then
begin
with TJvDockTabHostForm(ChildControl).PageControl do
for I := 0 to DockClientCount - 1 do
begin
Pane := FindPane(TWinControl(DockClients[I]));
ADockClient := FindDockClient(DockClients[I]);
if (Pane <> nil) and (ADockClient <> nil) then
Pane.FWidth := ADockClient.VSPaneWidth;
end;
end
else
begin
Pane := FindPane(ChildControl);
ADockClient := FindDockClient(ChildControl);
if (Pane <> nil) and (ADockClient <> nil) then
Pane.FWidth := ADockClient.VSPaneWidth;
end;
end;
end;
end;
procedure TJvDockVSNETZone.SetAutoHideBtnDown(const Value: Boolean);
begin
FAutoHideBtnDown := Value;
end;
procedure TJvDockVSNETZone.SetAutoHideBtnState(const Value: TJvDockBtnState);
begin
if FAutoHideBtnState <> Value then
begin
FAutoHideBtnState := Value;
Tree.DockSite.Invalidate;
end;
end;
procedure TJvDockVSNETZone.SetChildControlVisible(Client: TControl;
AVisible: Boolean);
begin
inherited SetChildControlVisible(Client, AVisible);
end;
procedure TJvDockVSNETZone.SetCloseBtnState(const Value: TJvDockBtnState);
begin
if FCloseBtnState <> Value then
begin
FCloseBtnState := Value;
Tree.DockSite.Invalidate;
end;
end;
procedure TJvDockVSNETZone.SetVSPaneVisible(const Value: Boolean);
begin
FVSPaneVisible := Value;
end;
//=== { TJvDockVSPane } ======================================================
constructor TJvDockVSPane.Create(ABlock: TJvDockVSBlock; AForm: TCustomForm;
AWidth: Integer; AIndex: Integer);
begin
inherited Create;
FBlock := ABlock;
FDockForm := AForm;
FWidth := AWidth;
FIndex := AIndex;
FVisible := AForm.Visible;
end;
destructor TJvDockVSPane.Destroy;
begin
if FBlock.ActivePane = Self then
FBlock.FActivePane := nil;
if FBlock.VSChannel.PopupPane = Self then
FBlock.VSChannel.SetPopupPane(nil);
inherited Destroy;
end;
function TJvDockVSPane.GetActive: Boolean;
begin
Result := FBlock.VSChannel.PopupPane = Self;
end;
//=== { TJvDockVSPopupPanel } ================================================
constructor TJvDockVSPopupPanel.Create(AOwner: TComponent; APanel: TJvDockVSNETPanel);
begin
inherited Create(AOwner);
FVSNETDockPanel := APanel;
FVSChannel := APanel.VSChannel;
DockServer := APanel.DockServer;
DockSite := True; {calls CreateDockManager when you do this!}
Anchors := [akLeft, akRight, akTop, akBottom];
BoundsRect := Rect(0, 0, 0, 0);
end;
function TJvDockVSPopupPanel.CreateDockManager: IDockManager;
var
ADockStyle: TJvDockBasicStyle;
TreeClass: TJvDockTreeClass;
begin
Result := nil;
if (DockManager = nil) and DockSite and UseDockManager then
begin
if Assigned(DockServer) then
begin
ADockStyle := DockServer.DockStyle;
if Assigned(ADockStyle) then
begin
TreeClass := ADockStyle.DockPanelTreeClass;
if Assigned(TreeClass) and (TreeClass <> TJvDockTree) then
Result := TreeClass.Create(Self, ADockStyle.DockPanelZoneClass, ADockStyle) as IJvDockManager;
end;
end;
end;
if Result = nil then
Result := DockManager;
{ (rb) Why not? }
// DoubleBuffered := DoubleBuffered or (Result <> nil);
end;
function TJvDockVSPopupPanel.GetVSChannel: TJvDockVSChannel;
begin
if FVSNETDockPanel <> nil then
Result := FVSNETDockPanel.VSChannel
else
Result := nil;
end;
procedure TJvDockVSPopupPanel.SetParent(AParent: TWinControl);
begin
// (rom) this is suspicious
inherited SetParent(AParent);
if AParent = nil then
Exit;
end;
procedure TJvDockVSPopupPanel.ShowDockPanel(MakeVisible: Boolean;
Client: TControl; PanelSizeFrom: TJvDockSetDockPanelSizeFrom);
begin
{ (rb) Meaning? }
if Align <> alNone then
inherited ShowDockPanel(MakeVisible, Client, PanelSizeFrom);
end;
//=== { TJvDockVSPopupPanelSplitter } ========================================
constructor TJvDockVSPopupPanelSplitter.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FAutoSnap := False;
Align := alNone;
Height := 0;
Width := 0;
FMinSize := 30;
FResizeStyle := rsPattern;
FOldSize := -1;
FSplitWidth := 4;
Anchors := [akLeft, akRight, akTop, akBottom];
end;
destructor TJvDockVSPopupPanelSplitter.Destroy;
begin
FBrush.Free;
inherited Destroy;
end;
procedure TJvDockVSPopupPanelSplitter.AllocateLineDC;
begin
FLineDC := GetDCEx(Parent.Handle, 0,
DCX_CACHE or DCX_CLIPSIBLINGS or DCX_LOCKWINDOWUPDATE);
if ResizeStyle = rsPattern then
begin
if FBrush = nil then
begin
FBrush := TBrush.Create;
FBrush.Bitmap := AllocPatternBitmap(clBlack, clWhite);
end;
FPrevBrush := SelectObject(FLineDC, FBrush.Handle);
end;
end;
procedure TJvDockVSPopupPanelSplitter.CalcSplitSize(X, Y: Integer; var NewSize, Split: Integer);
var
S: Integer;
begin
if VSChannelAlign in [alLeft, alRight] then
Split := X - FDownPos.X
else
Split := Y - FDownPos.Y;
S := 0;
case VSChannelAlign of
alLeft:
S := FControl.Width + Split;
alRight:
S := FControl.Width - Split;
alTop:
S := FControl.Height + Split;
alBottom:
S := FControl.Height - Split;
end;
NewSize := S;
if S < MinSize then
NewSize := MinSize
else
if S > FMaxSize then
NewSize := FMaxSize;
if S <> NewSize then
begin
if VSChannelAlign in [alRight, alBottom] then
S := S - NewSize
else
S := NewSize - S;
Inc(Split, S);
end;
end;
function TJvDockVSPopupPanelSplitter.CanResize(var NewSize: Integer): Boolean;
begin
Result := True;
if Assigned(FOnCanResize) then
FOnCanResize(Self, NewSize, Result);
end;
function TJvDockVSPopupPanelSplitter.DoCanResize(var NewSize: Integer): Boolean;
begin
Result := CanResize(NewSize);
if Result and (NewSize <= MinSize) and FAutoSnap then
NewSize := 0;
end;
procedure TJvDockVSPopupPanelSplitter.DrawLine;
var
X, Y: Integer;
begin
FLineVisible := not FLineVisible;
X := Left;
Y := Top;
if VSChannelAlign in [alLeft, alRight] then
X := Left + FSplit
else
Y := Top + FSplit;
PatBlt(FLineDC, X, Y, Width, Height, PATINVERT);
end;
function TJvDockVSPopupPanelSplitter.FindControl: TControl;
begin
Result := FVSPopupPanel;
end;
procedure TJvDockVSPopupPanelSplitter.FocusKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_ESCAPE then
StopSizing
else
if Assigned(FOldKeyDown) then
FOldKeyDown(Sender, Key, Shift);
end;
function TJvDockVSPopupPanelSplitter.GetMinSize: NaturalNumber;
begin
Result := PPIScale(FMinSize);
end;
function TJvDockVSPopupPanelSplitter.GetSplitWidth: Integer;
begin
Result := PPIScale(FSplitWidth);
end;
function TJvDockVSPopupPanelSplitter.GetVSChannelAlign: TAlign;
begin
Result := alNone;
if (VSPopupPanel <> nil) and (VSPopupPanel.FVSNETDockPanel <> nil) then
Result := VSPopupPanel.FVSNETDockPanel.Align;
end;
procedure TJvDockVSPopupPanelSplitter.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
var
I: Integer;
begin
inherited MouseDown(Button, Shift, X, Y);
if Button = mbLeft then
begin
FControl := FindControl;
FDownPos := Point(X, Y);
if Assigned(FControl) then
begin
if VSChannelAlign in [alLeft, alRight] then
begin
FMaxSize := Parent.ClientWidth - MinSize;
for I := 0 to Parent.ControlCount - 1 do
with Parent.Controls[I] do
if Align in [alLeft, alRight] then
Dec(FMaxSize, Width);
Inc(FMaxSize, FControl.Width);
end
else
begin
FMaxSize := Parent.ClientHeight - MinSize;
for I := 0 to Parent.ControlCount - 1 do
with Parent.Controls[I] do
if Align in [alTop, alBottom] then
Dec(FMaxSize, Height);
Inc(FMaxSize, FControl.Height);
end;
UpdateSize(X, Y);
AllocateLineDC;
with ValidParentForm(Self) do
if ActiveControl <> nil then
begin
FActiveControl := ActiveControl;
{ !! Dirty }
FOldKeyDown := TWinControlAccessProtected(FActiveControl).OnKeyDown;
TWinControlAccessProtected(FActiveControl).OnKeyDown := FocusKeyDown;
end;
if ResizeStyle in [rsLine, rsPattern] then
DrawLine;
end;
end;
end;
procedure TJvDockVSPopupPanelSplitter.MouseMove(Shift: TShiftState; X, Y: Integer);
var
NewSize, Split: Integer;
begin
inherited MouseMove(Shift, X, Y);
if (ssLeft in Shift) and Assigned(FControl) then
begin
CalcSplitSize(X, Y, NewSize, Split);
if DoCanResize(NewSize) then
begin
if ResizeStyle in [rsLine, rsPattern] then
DrawLine;
FNewSize := NewSize;
FSplit := Split;
if ResizeStyle = rsUpdate then
UpdateControlSize;
if ResizeStyle in [rsLine, rsPattern] then
DrawLine;
end;
end;
end;
procedure TJvDockVSPopupPanelSplitter.MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
begin
inherited MouseUp(Button, Shift, X, Y);
if Assigned(FControl) then
begin
if ResizeStyle in [rsLine, rsPattern] then
DrawLine;
UpdateControlSize;
StopSizing;
end;
end;
procedure TJvDockVSPopupPanelSplitter.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if (Operation = opRemove) and (AComponent = VSPopupPanel) then
FVSPopupPanel := nil;
end;
procedure TJvDockVSPopupPanelSplitter.Paint;
var
FrameBrush: HBRUSH;
R: TRect;
begin
R := ClientRect;
Canvas.Brush.Color := Color;
InflateRect(R, PPIScale(2), PPIScale(2));
case VSChannelAlign of
alLeft:
Dec(R.Right, PPIScale(2));
alRight:
Inc(R.Left, PPIScale(3));
alTop:
Dec(R.Bottom, PPIScale(2));
alBottom:
Inc(R.Top, PPIScale(3));
end;
DrawFrameControl(Canvas.Handle, R, DFC_BUTTON, DFCS_BUTTONPUSH or DFCS_ADJUSTRECT);
R := ClientRect;
if Beveled then
begin
if VSChannelAlign in [alLeft, alRight] then
InflateRect(R, -PPIScale(1), PPIScale(2))
else
InflateRect(R, PPIScale(2), -PPIScale(1));
OffsetRect(R, 1, 1);
FrameBrush := CreateSolidBrush(ColorToRGB(clBtnHighlight));
FrameRect(Canvas.Handle, R, FrameBrush);
DeleteObject(FrameBrush);
OffsetRect(R, -PPIScale(2), -PPIScale(2));
FrameBrush := CreateSolidBrush(ColorToRGB(clBtnShadow));
FrameRect(Canvas.Handle, R, FrameBrush);
DeleteObject(FrameBrush);
end;
if csDesigning in ComponentState then
with Canvas do
begin
Pen.Style := psDot;
Pen.Mode := pmXor;
Pen.Color := JvDockXorColor;
Brush.Style := bsClear;
Rectangle(0, 0, ClientWidth, ClientHeight);
end;
if Assigned(FOnPaint) then
FOnPaint(Self);
end;
function TJvDockVSPopupPanelSplitter.PPIScale(Value: Integer): Integer;
begin
Result := MulDiv(Value, FCurrentPPI, 96);
end;
procedure TJvDockVSPopupPanelSplitter.ReleaseLineDC;
begin
if FPrevBrush <> 0 then
SelectObject(FLineDC, FPrevBrush);
ReleaseDC(Parent.Handle, FLineDC);
if FBrush <> nil then
begin
FBrush.Free;
FBrush := nil;
end;
end;
procedure TJvDockVSPopupPanelSplitter.RequestAlign;
begin
inherited RequestAlign;
if VSChannelAlign in [alBottom, alTop] then
Cursor := crVSplit
else
Cursor := crHSplit;
end;
procedure TJvDockVSPopupPanelSplitter.SetBeveled(Value: Boolean);
begin
FBeveled := Value;
Repaint;
end;
procedure TJvDockVSPopupPanelSplitter.SetSplitWidth(const Value: Integer);
begin
FSplitWidth := Value;
end;
procedure TJvDockVSPopupPanelSplitter.SetVSPopupPanel(Value: TJvDockVSPopupPanel);
begin
{ Dirty }
Assert((Value <> nil) and (Value is TJvDockVSPopupPanel));
FVSPopupPanel := Value;
end;
procedure TJvDockVSPopupPanelSplitter.StopSizing;
begin
if Assigned(FControl) then
begin
if FLineVisible then
DrawLine;
FControl := nil;
ReleaseLineDC;
if Assigned(FActiveControl) then
begin
{ !! Dirty }
TWinControlAccessProtected(FActiveControl).OnKeyDown := FOldKeyDown;
FActiveControl := nil;
end;
end;
if Assigned(FOnMoved) then
FOnMoved(Self);
end;
procedure TJvDockVSPopupPanelSplitter.UpdateControlSize;
begin
if FNewSize <> FOldSize then
begin
case VSChannelAlign of
alLeft:
begin
FControl.Width := FNewSize;
Left := FControl.Left + FNewSize;
end;
alTop:
begin
FControl.Height := FNewSize;
Top := FControl.Top + FNewSize;
end;
alRight:
begin
Parent.DisableAlign;
try
FControl.Left := FControl.Left + (FControl.Width - FNewSize);
FControl.Width := FNewSize;
Left := FControl.Left - Width;
finally
Parent.EnableAlign;
end;
end;
alBottom:
begin
Parent.DisableAlign;
try
FControl.Top := FControl.Top + (FControl.Height - FNewSize);
FControl.Height := FNewSize;
Top := FControl.Top - Height;
finally
Parent.EnableAlign;
end;
end;
end;
FVSPopupPanel.VSChannel.ResetActivePaneWidth;
Update;
if Assigned(FOnMoved) then
FOnMoved(Self);
FOldSize := FNewSize;
end;
end;
procedure TJvDockVSPopupPanelSplitter.UpdateSize(X, Y: Integer);
begin
CalcSplitSize(X, Y, FNewSize, FSplit);
end;
//=== { TPopupPanelAnimate } =================================================
constructor TPopupPanelAnimate.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Interval := TJvDockVSNetStyle.GetAnimationInterval;
Enabled := False;
FMaxWidth := 0;
FCurrentWidth := 0;
OnTimer := OnCustomTimer;
FState := asPopup;
end;
procedure TPopupPanelAnimate.HideForm(AChannel: TJvDockVSChannel; MaxWidth: Integer);
begin
if FActiveChannel <> nil then
Exit;
FActiveChannel := AChannel;
Enabled := (FActiveChannel <> nil) and (FActiveChannel.ActiveDockForm <> nil);
if FActiveChannel <> nil then
begin
FMaxWidth := MaxWidth;
FCurrentWidth := 0;
FState := asHide;
end;
end;
procedure TPopupPanelAnimate.OnCustomTimer(Sender: TObject);
begin
// ??? no handler?
end;
procedure TPopupPanelAnimate.PopupForm(AChannel: TJvDockVSChannel; MaxWidth: Integer);
begin
{ Currently busy with animating? }
if (FCurrentWidth > 0) and (FActiveChannel <> nil) then
{ Dangerous, not in try..finally }
FActiveChannel.Parent.EnableAlign;
FActiveChannel := AChannel;
Enabled := FActiveChannel <> nil;
if FActiveChannel <> nil then
begin
FMaxWidth := MaxWidth;
FCurrentWidth := 0;
FState := asPopup;
end;
end;
procedure TPopupPanelAnimate.Timer;
var
SuitableWidth: Integer;
procedure SetControlBringToFront(Control: TWinControl; Align: TAlign);
var
I: Integer;
begin
for I := Control.ControlCount - 1 downto 0 do
if Control.Controls[I].Visible and (Control.Controls[I].Align = Align) and
not (Control.Controls[I] is TJvDockVSChannel) and
not (Control.Controls[I] is TJvDockPanel) and
not (Control.Controls[I] is TJvDockSplitter) then
Control.Controls[I].BringToFront;
end;
begin
inherited Timer;
if FActiveChannel = nil then
Exit;
SuitableWidth := Min(FCurrentWidth, FMaxWidth);
with FActiveChannel do
begin
if FCurrentWidth = 0 then
begin
{ Dangerous, not in try..finally }
Parent.DisableAlign;
VSPopupPanel.BringToFront;
VSPopupPanelSplitter.BringToFront;
SetControlBringToFront(Parent, Align);
BringToFront;
end;
case Align of
alLeft:
begin
if FState = asPopup then
begin
if FCurrentWidth = 0 then
begin
VSPopupPanel.Width := FMaxWidth;
VSPopupPanel.Top := Top;
VSPopupPanel.Height := Height;
VSPopupPanelSplitter.Top := Top;
VSPopupPanelSplitter.Height := Height;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
end;
VSPopupPanel.Left := Left + Width + SuitableWidth - VSPopupPanel.Width;
end
else
if FState = asHide then
VSPopupPanel.Left := Left - FCurrentWidth;
VSPopupPanelSplitter.Left := VSPopupPanel.Left + VSPopupPanel.Width;
end;
alRight:
begin
if FState = asPopup then
begin
if FCurrentWidth = 0 then
begin
VSPopupPanel.Width := FMaxWidth;
VSPopupPanel.Top := Top;
VSPopupPanel.Height := Height;
VSPopupPanelSplitter.Top := Top;
VSPopupPanelSplitter.Height := Height;
VSPopupPanelSplitter.Width := VSPopupPanelSplitter.SplitWidth;
end;
VSPopupPanel.Left := Left - SuitableWidth;
end
else
if FState = asHide then
VSPopupPanel.Left := Left - VSPopupPanel.Width + FCurrentWidth;
VSPopupPanelSplitter.Left := VSPopupPanel.Left - VSPopupPanelSplitter.SplitWidth;
end;
alTop:
begin
if FState = asPopup then
begin
if FCurrentWidth = 0 then
begin
VSPopupPanel.Left := Left;
VSPopupPanel.Height := FMaxWidth;
VSPopupPanel.Width := Width;
VSPopupPanelSplitter.Left := Left;
VSPopupPanelSplitter.Width := Width;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
end;
VSPopupPanel.Top := Top + Height + SuitableWidth - VSPopupPanel.Height;
end
else
if FState = asHide then
VSPopupPanel.Top := Top - FCurrentWidth;
VSPopupPanelSplitter.Top := VSPopupPanel.Top + VSPopupPanel.Height;
end;
alBottom:
begin
if FState = asPopup then
begin
if FCurrentWidth = 0 then
begin
VSPopupPanel.Left := Left;
VSPopupPanel.Width := Width;
VSPopupPanel.Height := FMaxWidth;
VSPopupPanelSplitter.Left := Left;
VSPopupPanelSplitter.Width := Width;
VSPopupPanelSplitter.Height := VSPopupPanelSplitter.SplitWidth;
end;
VSPopupPanel.Top := Top - SuitableWidth;
end
else
if FState = asHide then
VSPopupPanel.Top := Top - VSPopupPanel.Height + FCurrentWidth;
VSPopupPanelSplitter.Top := VSPopupPanel.Top - VSPopupPanelSplitter.SplitWidth;
end;
end;
VSPopupPanel.Visible := True;
VSPopupPanelSplitter.Visible := True;
end;
if FCurrentWidth >= FMaxWidth then
begin
{ Dangerous, not in try..finally }
FActiveChannel.Parent.EnableAlign;
Self.Enabled := False;
if FState = asHide then
begin
if FActiveChannel.DockServer.DockStyle is TJvDockVSNetStyle then
TJvDockVSNetStyle(FActiveChannel.DockServer.DockStyle).EndPopup(FActiveChannel);
FActiveChannel.HidePopupPanel(FActiveChannel.PopupPane);
end
else
begin
if FActiveChannel.DockServer.DockStyle is TJvDockVSNetStyle then
TJvDockVSNetStyle(FActiveChannel.DockServer.DockStyle).BeginPopup(FActiveChannel);
FActiveChannel.AutoFocusActiveDockForm;
HideAllPopupPanel(FActiveChannel);
end;
FActiveChannel := nil;
FCurrentWidth := 0;
FMaxWidth := 0;
end
else
Inc(FCurrentWidth, FActiveChannel.PPIScale(TJvDockVSNetStyle.GetAnimationMoveWidth));
end;
initialization
{$IFDEF UNITVERSIONING}
RegisterUnitVersion(HInstance, UnitVersioning);
{$ENDIF UNITVERSIONING}
finalization
GlobalPopupPanelAnimate.Free;
GlobalPopupPanelAnimate := nil;
{$IFDEF UNITVERSIONING}
UnregisterUnitVersion(HInstance);
{$ENDIF UNITVERSIONING}
end.
| 30.550325 | 119 | 0.678482 |
47b693f098dce2458b914cd7b1a9963b53722bc9 | 18,208 | pas | Pascal | sys/ui/videodev.pas | Laksen/jpaskernel2 | 4d6aca54406d506d520c3897881bd299188ec609 | [
"MIT"
]
| null | null | null | sys/ui/videodev.pas | Laksen/jpaskernel2 | 4d6aca54406d506d520c3897881bd299188ec609 | [
"MIT"
]
| null | null | null | sys/ui/videodev.pas | Laksen/jpaskernel2 | 4d6aca54406d506d520c3897881bd299188ec609 | [
"MIT"
]
| null | null | null | unit videodev;
interface
uses cclasses, hal, devicetypes;
type
TVideoAcceleration = class
private
fIntf: TVideoAccelerationInterface;
public
function GetScreenSurface: TSurfaceHandle; virtual;
function AllocateSurface(Width, Height, Format, Flags: PtrInt): TSurfaceHandle; virtual;
function DeallocateSurface(Handle: TSurfaceHandle): PtrInt; virtual;
function LockSurface(Surf: TSurfaceHandle): Pointer; virtual;
procedure UnlockSurface(Surf: TSurfaceHandle); virtual;
procedure FillRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte); virtual;
procedure DrawRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte); virtual;
procedure DrawLine(Surf: TSurfaceHandle; X0, Y0, X1, Y1: PtrInt; R, G, B: byte); virtual;
procedure BlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect); virtual;
procedure AlphaBlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect; Alpha: byte); virtual;
constructor CreateReal(Intf: PVideoAccelerationInterface);
end;
TEmulatedVideoAcceleration = class(TVideoAcceleration)
private
fFB: Pointer;
fFBSize: PtrInt;
fMode: TModeInfo;
fSurfaceCounter: longint;
fSurfaces: TDictionary;
protected
function GetColor(R, G, B: byte): longword;
procedure UpdateMode(FB: Pointer; FBSize: PtrInt; const ModeInfo: TModeInfo);
public
function GetScreenSurface: TSurfaceHandle; override;
function AllocateSurface(Width, Height, Format, Flags: PtrInt): TSurfaceHandle; override;
function DeallocateSurface(Handle: TSurfaceHandle): PtrInt; override;
function LockSurface(Surf: TSurfaceHandle): Pointer; override;
procedure UnlockSurface(Surf: TSurfaceHandle); override;
procedure FillRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte); override;
procedure DrawRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte); override;
procedure DrawLine(Surf: TSurfaceHandle; X0, Y0, X1, Y1: PtrInt; R, G, B: byte); override;
procedure BlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect); override;
procedure AlphaBlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect; Alpha: byte); override;
constructor Create;
end;
TVideoDevice = class(TDevice)
private
fDevData: TVideoDevDescriptor;
fAccel: TVideoAcceleration;
fEmulated: boolean;
public
function GetModeCount: PtrInt;
function GetModes(var Buffer: TModeInfo; Count: PtrInt): PtrInt;
function GetCurrentMode(var Buffer: TModeInfo): PtrInt;
function SetMode(ModeDesc: PtrInt): boolean;
function GetFrameBuffer(var Size: PtrInt): Pointer;
constructor Create(DevData: PVideoDevDescriptor);
property AccelIntf: TVideoAcceleration read fAccel;
end;
implementation
uses emualpha;
function TVideoAcceleration.GetScreenSurface: TSurfaceHandle;
begin
Result := fIntf.GetScreenSurface();
end;
function TVideoAcceleration.AllocateSurface(Width, Height, Format, Flags: PtrInt): TSurfaceHandle;
begin
Result := fIntf.AllocateSurface(Width, Height, Format, Flags);
end;
function TVideoAcceleration.DeallocateSurface(Handle: TSurfaceHandle): PtrInt;
begin
Result := fIntf.DeallocateSurface(Handle);
end;
function TVideoAcceleration.LockSurface(Surf: TSurfaceHandle): Pointer;
begin
Result := fIntf.LockSurface(Surf);
end;
procedure TVideoAcceleration.UnlockSurface(Surf: TSurfaceHandle);
begin
fIntf.UnlockSurface(Surf);
end;
procedure TVideoAcceleration.FillRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte);
begin
end;
procedure TVideoAcceleration.DrawRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte);
begin
end;
procedure TVideoAcceleration.DrawLine(Surf: TSurfaceHandle; X0, Y0, X1, Y1: PtrInt; R, G, B: byte);
begin
end;
procedure TVideoAcceleration.BlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect);
begin
fIntf.BlitSurface(Src, Dest, SrcRect, DestRect);
end;
procedure TVideoAcceleration.AlphaBlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect; Alpha: byte);
begin
end;
constructor TVideoAcceleration.CreateReal(Intf: PVideoAccelerationInterface);
begin
inherited Create;
FillChar(fIntf, SizeOf(fIntf), 0);
end;
type
TEmuSurface = class
private
fSurface: Pointer;
fOwn: boolean;
fW, fH, fFormat: PtrInt;
fRect: TSurfaceRect;
public
procedure UpdateScreen(FB: Pointer; W, H, Format: PtrInt);
function GetPixelPos(X, Y: PtrInt): PByte;
function GetPixelWidth: PtrInt;
constructor Create(W, H, Format, Flags: PtrInt);
constructor CreateScreen(FB: Pointer; W, H, Format: PtrInt);
destructor Destroy; override;
property Data: Pointer read fSurface;
property Rect: TSurfaceRect read fRect;
property Width: PtrInt read fW;
property Height: PtrInt read fH;
property Format: PtrInt read fFormat;
end;
function TEmuSurface.GetPixelPos(X, Y: PtrInt): PByte;
begin
Result := Pointer(PtrUInt(fSurface) + PtrUInt((x + y * fW) * 4));
end;
function TEmuSurface.GetPixelWidth: PtrInt;
begin
Result := 4 * fW;
end;
constructor TEmuSurface.Create(W, H, Format, Flags: PtrInt);
begin
inherited Create;
fSurface := GetMem(W * H * 4);
fOwn := True;
fW := W;
fH := H;
fFormat := Format;
fRect.X := 0;
fRect.Y := 0;
fRect.W := W;
fRect.H := H;
end;
procedure TEmuSurface.UpdateScreen(FB: Pointer; W, H, Format: PtrInt);
begin
fSurface := FB;
fOwn := False;
fW := W;
fH := H;
fFormat := Format;
fRect.X := 0;
fRect.Y := 0;
fRect.W := W;
fRect.H := H;
end;
constructor TEmuSurface.CreateScreen(FB: Pointer; W, H, Format: PtrInt);
begin
inherited Create;
fSurface := FB;
fOwn := False;
fW := W;
fH := H;
fFormat := Format;
fRect.X := 0;
fRect.Y := 0;
fRect.W := W;
fRect.H := H;
end;
destructor TEmuSurface.Destroy;
begin
if fOwn then
FreeMem(fSurface);
inherited Destroy;
end;
function Rect(X, Y, W, H: PtrInt): TSurfaceRect;
begin
Result.X := x;
Result.y := y;
Result.w := w;
Result.h := h;
end;
procedure Swap(var a, b: PtrInt);
var
t: PtrInt;
begin
t := a;
a := b;
b := t;
end;
function Abs(i: longint): longint;
begin
Result := i;
if i < 0 then
Result := -i;
end;
function Max(a, b: PtrInt): PtrInt;
begin
if a > b then
Result := a
else
Result := b;
end;
function Min(a, b: PtrInt): PtrInt;
begin
if a < b then
Result := a
else
Result := b;
end;
function RectP(X, Y, X1, Y1: PtrInt): TSurfaceRect;
begin
if x > x1 then
swap(x, x1);
if y > y1 then
swap(y, y1);
Result.X := x;
Result.y := y;
Result.w := x1 - x;
Result.h := y1 - y;
end;
function RectIntersection(const a, b: TSurfaceRect): TSurfaceRect;
begin
Result := RectP(max(a.x, b.x), max(a.y, b.y), min(a.x + a.w, b.x + b.w), min(a.y + a.h, b.y + b.h));
end;
function RectClip(const a, clip: TSurfaceRect; var Src: TSurfaceRect): TSurfaceRect;
var
d: PtrInt;
begin
Result := rect(a.x, a.y, min(src.w, a.w), min(src.h, a.h));
Result := RectIntersection(a, clip);
if Result.x < clip.x then
begin
d := clip.x - Result.x;
Inc(src.x, d);
Dec(src.w, d);
Result.x := clip.x;
end;
if Result.y < clip.y then
begin
d := clip.y - Result.y;
Inc(src.y, d);
Dec(src.h, d);
Result.y := clip.y;
end;
end;
function ClipLine(const r: TSurfaceRect; var X0, Y0, X1, Y1: PtrInt): boolean;
type
edge = (LEFT, RIGHT, BOTTOM, TOP);
outcode = set of edge;
var
accept, done: boolean;
outcode0, outcode1, outcodeOut: outcode;
{Outcodes for P0,P1, and whichever point lies outside the clip rectangle}
x, y, xmin, xmax, ymin, ymax: PtrInt;
procedure CompOutCode(x, y: PtrInt; var code: outcode);
begin
code := [];
if y > ymax then
code := [TOP]
else if y < ymin then
code := [BOTTOM];
if x > xmax then
code := code + [RIGHT]
else if x < xmin then
code := code + [LEFT];
end;
begin
xmin := r.x;
ymin := r.y;
xmax := r.x + r.w - 1;
ymax := r.y + r.h - 1;
accept := False;
done := False;
CompOutCode(x0, y0, outcode0);
CompOutCode(x1, y1, outcode1);
repeat
if (outcode0 = []) and (outcode1 = []) then {Trivial accept and exit}
begin
accept := True;
done := True;
end
else if (outcode0 * outcode1) <> [] then
done := True {Logical intersection is true, so trivial reject and exit.}
else
{Failed both tests, so calculate the line segment to clip;
from an outside point to an intersection with clip edge.}
begin
{At least one endpoint is outside the clip rectangle; pick it.}
if outcode0 <> [] then
outcodeOut := outcode0
else
outcodeOut := outcode1;
{Now find intersection point;
use formulas y=y0+slope*(x-x0),x=x0+(1/slope)*(y-y0).}
if TOP in outcodeOut then
begin {Divide line at top of clip rectangle}
x := x0 + (x1 - x0) * (ymax - y0) div (y1 - y0);
y := ymax;
end
else if BOTTOM in outcodeOut then
begin {Divide line at bottom of clip rectangle}
x := x0 + (x1 - x0) * (ymin - y0) div (y1 - y0);
y := ymax;
end
else if RIGHT in outcodeOut then
begin {Divide line at right edge of clip rectangle}
y := y0 + (y1 - y0) * (xmax - x0) div (x1 - x0);
x := xmax;
end
else if LEFT in outcodeOut then
begin {Divide line at left edge of clip rectangle}
y := y0 + (y1 - y0) * (xmin - x0) div (x1 - x0);
x := xmin;
end;
{Now we move outside point to intersection point to clip,
and get ready for next pass.}
if (outcodeOut = outcode0) then
begin
x0 := x;
y0 := y;
CompOutCode(x0, y0, outcode0);
end
else
begin
x1 := x;
y1 := y;
CompOutCode(x1, y1, outcode1);
end;
end;
until done;
Result := accept;
//if accept then MidpointLineReal(x0,y0,x1,y1,value)
end;
function TEmulatedVideoAcceleration.GetScreenSurface: TSurfaceHandle;
begin
Result := 0;
end;
function TEmulatedVideoAcceleration.AllocateSurface(Width, Height, Format, Flags: PtrInt): TSurfaceHandle;
begin
Result := InterlockedIncrement(fSurfaceCounter);
fSurfaces.Add(Result, TEmuSurface.Create(Width, Height, Format, Flags));
end;
function TEmulatedVideoAcceleration.DeallocateSurface(Handle: TSurfaceHandle): PtrInt;
var
s: TEmuSurface;
begin
Result := 0;
s := TEmuSurface(fSurfaces[handle]);
if assigned(s) then
begin
fSurfaces.Delete(handle);
s.Free;
Result := 1;
end;
end;
function TEmulatedVideoAcceleration.GetColor(R, G, B: byte): longword;
begin
Result := ((r shl fMode.RShift) and fMode.RMask) or ((g shl fMode.GShift) and fMode.GMask) or ((b shl fMode.BShift) and fMode.BMask);
end;
procedure TEmulatedVideoAcceleration.FillRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte);
var
s: TEmuSurface;
sr: TSurfaceRect;
sd: PByte;
c: longword;
cnt, sw, y: longint;
begin
s := TEmuSurface(fSurfaces[Surf]);
if not assigned(s) then
exit;
c := GetColor(r, g, b);
if Rect = nil then
begin
cnt := s.Width * s.Height;
FillDWord(pbyte(s.Data)^, cnt, c);
end
else
begin
sr := RectIntersection(Rect^, s.Rect);
sd := s.GetPixelPos(sr.x, sr.y);
cnt := sr.w;
sw := s.GetPixelWidth;
for y := 0 to sr.h - 1 do
begin
FillDWord(sd^, cnt, c);
Inc(sd, sw);
end;
end;
end;
procedure TEmulatedVideoAcceleration.DrawRect(Surf: TSurfaceHandle; Rect: PSurfaceRect; R, G, B: byte);
var
s: TEmuSurface;
begin
if not assigned(rect) then
exit;
s := TEmuSurface(fSurfaces[Surf]);
if not assigned(s) then
exit;
DrawLine(surf, rect^.x, rect^.y, rect^.x + rect^.w, rect^.y, r, g, b);
DrawLine(surf, rect^.x, rect^.y + rect^.h, rect^.x + rect^.w, rect^.y + rect^.h, r, g, b);
DrawLine(surf, rect^.x, rect^.y, rect^.x, rect^.y + rect^.h, r, g, b);
DrawLine(surf, rect^.x + rect^.w, rect^.y, rect^.x + rect^.w, rect^.y + rect^.h, r, g, b);
end;
procedure TEmulatedVideoAcceleration.DrawLine(Surf: TSurfaceHandle; X0, Y0, X1, Y1: PtrInt; R, G, B: byte);
var
s: TEmuSurface;
Data: PByte;
c, sw: longword;
steep: boolean;
deltax, deltay, error, ystep, y, x: longint;
procedure Plot(x, y: longint); inline;
begin
plongword(@(Data[y * sw]))[x] := c;
end;
begin
s := TEmuSurface(fSurfaces[Surf]);
if not assigned(s) then
exit;
c := GetColor(r, g, b);
Data := s.Data;
sw := s.GetPixelWidth;
if ClipLine(S.Rect, X0, Y0, X1, Y1) then
begin
steep := abs(y1 - y0) > abs(x1 - x0);
if steep then
begin
swap(x0, y0);
swap(x1, y1);
end;
if x0 > x1 then
begin
swap(x0, x1);
swap(y0, y1);
end;
deltax := x1 - x0;
deltay := abs(y1 - y0);
error := deltax div 2;
y := y0;
if y0 < y1 then
ystep := 1
else
ystep := -1;
for x := x0 to x1 do
begin
if steep then
plot(y, x)
else
plot(x, y);
error := error - deltay;
if error < 0 then
begin
y := y + ystep;
error := error + deltax;
end;
end;
end;
end;
function TEmulatedVideoAcceleration.LockSurface(Surf: TSurfaceHandle): Pointer;
var
s: TEmuSurface;
begin
Result := nil;
s := TEmuSurface(fSurfaces[Surf]);
if assigned(s) then
Result := s.Data;
end;
procedure TEmulatedVideoAcceleration.UnlockSurface(Surf: TSurfaceHandle);
begin
end;
procedure TEmulatedVideoAcceleration.BlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect);
var
s, d: TEmuSurface;
sr, dr: TSurfaceRect;
ps, pd: PByte;
sw, dw, copywidth, i: PtrInt;
begin
s := TEmuSurface(fSurfaces[Src]);
d := TEmuSurface(fSurfaces[dest]);
if assigned(s) and assigned(d) then
begin
if srcrect = nil then
sr := s.Rect
else
sr := SrcRect^;
if destrect = nil then
dr := sr
else
dr := destrect^;
dr := RectClip(dr, d.rect, sr);
ps := s.GetPixelPos(sr.x, sr.y);
pd := d.GetPixelPos(dr.x, dr.y);
copywidth := dr.w * 4;
sw := s.GetPixelWidth;
dw := d.GetPixelWidth;
for i := 0 to dr.h - 1 do
begin
Move(ps^, pd^, copywidth);
Inc(ps, sw);
Inc(pd, dw);
end;
end;
end;
procedure TEmulatedVideoAcceleration.AlphaBlitSurface(Src, Dest: TSurfaceHandle; SrcRect, DestRect: PSurfaceRect; Alpha: byte);
var
s, d: TEmuSurface;
sr, dr: TSurfaceRect;
ps, pd: PByte;
sw, dw: PtrInt;
begin
s := TEmuSurface(fSurfaces[Src]);
d := TEmuSurface(fSurfaces[dest]);
if assigned(s) and assigned(d) then
begin
if srcrect = nil then
sr := s.Rect
else
sr := SrcRect^;
if destrect = nil then
dr := sr
else
dr := DestRect^;
dr := RectClip(dr, d.rect, sr);
ps := s.GetPixelPos(sr.x, sr.y);
pd := d.GetPixelPos(dr.x, dr.y);
sw := s.GetPixelWidth;
dw := d.GetPixelWidth;
EmulatedAlphaBlendFixed(ps, pd, dr.w, dr.h, sw, dw, alpha);
end;
end;
procedure TEmulatedVideoAcceleration.UpdateMode(FB: Pointer; FBSize: PtrInt; const ModeInfo: TModeInfo);
begin
fFB := FB;
fFBSize := fbsize;
fMode := ModeInfo;
TEmuSurface(fSurfaces[0]).UpdateScreen(fb, fMode.Width, fMode.Height, 0);
end;
constructor TEmulatedVideoAcceleration.Create;
begin
inherited Create;
fFB := nil;
fFBSize := 0;
fSurfaceCounter := 0;
fSurfaces := TDictionary.Create(nil);
fSurfaces.Add(0, TEmuSurface.CreateScreen(nil, 0, 0, 0));
end;
function TVideoDevice.GetModeCount: PtrInt;
begin
Result := fDevData.GetModeCount();
end;
function TVideoDevice.GetModes(var Buffer: TModeInfo; Count: PtrInt): PtrInt;
begin
Result := fDevData.GetModes(@Buffer, Count);
end;
function TVideoDevice.SetMode(ModeDesc: PtrInt): boolean;
var
info: TModeInfo;
fb: pointer;
sz: ptrint;
begin
Result := fDevData.SetMode(ModeDesc);
if fEmulated and Result then
begin
getCurrentMode(info);
fb := GetFrameBuffer(sz);
TEmulatedVideoAcceleration(fAccel).UpdateMode(fb, sz, info);
end;
end;
function TVideoDevice.GetCurrentMode(var Buffer: TModeInfo): PtrInt;
begin
Result := fDevData.GetCurrentMode(@buffer);
end;
function TVideoDevice.GetFrameBuffer(var Size: PtrInt): Pointer;
begin
Result := fDevData.GetFrameBuffer(@size);
end;
constructor TVideoDevice.Create(DevData: PVideoDevDescriptor);
begin
inherited Create(PDeviceDescriptor(DevData));
fDevData := DevData^;
fEmulated := not (((fDevData.Info.DeviceFlags and DF_Video_Acceleration) = DF_Video_Acceleration) and assigned(fDevData.AccelerationIntf));
if not fEmulated then
fAccel := TVideoAcceleration.CreateReal(fDevData.AccelerationIntf)
else
fAccel := TEmulatedVideoAcceleration.Create;
end;
end.
| 25.183956 | 143 | 0.610062 |
47eef670039b077993ca5cbc9aae57c8a0b6660e | 4,898 | pas | Pascal | Section 4/CODE/Video08/Client/MainDMU.pas | PacktPublishing/Delphi-Solutions---Part-2 | 8b9674aa8b4d0d3566d040568c5a0e5161848532 | [
"MIT"
]
| 4 | 2019-07-14T03:56:44.000Z | 2021-10-02T03:20:03.000Z | Section 4/CODE/Video08/Client/MainDMU.pas | PacktPublishing/Delphi-Solutions---Part-2 | 8b9674aa8b4d0d3566d040568c5a0e5161848532 | [
"MIT"
]
| 1 | 2019-10-28T16:51:11.000Z | 2019-10-28T16:51:11.000Z | Section 4/CODE/Video08/Client/MainDMU.pas | PacktPublishing/Delphi-Solutions---Part-2 | 8b9674aa8b4d0d3566d040568c5a0e5161848532 | [
"MIT"
]
| 2 | 2020-01-28T09:02:21.000Z | 2020-06-27T15:30:43.000Z | unit MainDMU;
interface
uses
System.SysUtils, System.Classes, IPPeerClient, Data.Bind.Components,
Data.Bind.ObjectScope, REST.Client, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf,
FireDAC.DApt.Intf, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client;
const
SERVERBASEURL = 'http://192.168.1.108:8080';
type
TdmMain = class(TDataModule)
RESTClient: TRESTClient;
RESTRequest: TRESTRequest;
dsPeople: TFDMemTable;
dsPeopleID: TStringField;
dsPeopleFIRST_NAME: TStringField;
dsPeopleLAST_NAME: TStringField;
dsPeopleWORK_PHONE_NUMBER: TStringField;
dsPeopleMOBILE_PHONE_NUMBER: TStringField;
dsPeopleEMAIL: TStringField;
dsPeopleFULL_NAME: TStringField;
procedure dsPeopleCalcFields(DataSet: TDataSet);
procedure DataModuleCreate(Sender: TObject);
public
procedure SavePerson(AOnSuccess: TProc; AOnError: TProc<Integer, String> = nil);
procedure DeletePerson(AOnSuccess: TProc; AOnError: TProc<Integer, String> = nil);
procedure LoadAll(AOnSuccess: TProc; AOnError: TProc<Integer, String> = nil);
function CanSave: Boolean;
end;
var
dmMain: TdmMain;
implementation
uses
ObjectsMappers, REST.Types;
{ %CLASSGROUP 'FMX.Controls.TControl' }
{$R *.dfm}
{ TdmMain }
function TdmMain.CanSave: Boolean;
begin
Result := dsPeople.State in [dsInsert, dsEdit];
end;
procedure TdmMain.DataModuleCreate(Sender: TObject);
begin
RESTClient.BaseURL := SERVERBASEURL;
end;
procedure TdmMain.DeletePerson(AOnSuccess: TProc; AOnError: TProc<Integer, String> = nil);
begin
RESTRequest.ClearBody;
RESTRequest.Resource := 'people/{id}';
RESTRequest.Method := TRESTRequestMethod.rmDELETE;
RESTRequest.AddParameter('id', dsPeopleID.AsString, TRESTRequestParameterKind.pkURLSEGMENT);
RESTRequest.ExecuteAsync(
procedure
begin
if RESTRequest.Response.StatusCode = 204 then
begin
dsPeople.Delete;
if Assigned(AOnSuccess) then
AOnSuccess();
end
else if Assigned(AOnError) then
AOnError(RESTRequest.Response.StatusCode, RESTRequest.Response.StatusText);
end);
end;
procedure TdmMain.dsPeopleCalcFields(DataSet: TDataSet);
begin
DataSet.FieldByName('FULL_NAME').AsString := DataSet.FieldByName('FIRST_NAME').AsString + ' ' +
DataSet.FieldByName('LAST_NAME').AsString;
end;
procedure TdmMain.LoadAll(AOnSuccess: TProc; AOnError: TProc<Integer, String>);
begin
if dsPeople.State in [dsInsert, dsEdit] then
dsPeople.Cancel;
dsPeople.Close;
RESTRequest.ClearBody;
RESTRequest.Resource := 'people';
RESTRequest.Method := TRESTRequestMethod.rmGET;
RESTRequest.ExecuteAsync(
procedure
begin
if RESTRequest.Response.StatusCode = 200 then
begin
dsPeople.Active := True;
dsPeople.AppendFromJSONArrayString(RESTRequest.Response.JSONValue.ToString);
dsPeople.First;
if Assigned(AOnSuccess) then
AOnSuccess();
end
else if Assigned(AOnError) then
AOnError(RESTRequest.Response.StatusCode, RESTRequest.Response.StatusText);
end);
// TThread.CreateAnonymousThread(
// procedure
// begin
// try
// RESTRequest.Execute;
// TThread.Synchronize(nil,
// procedure
// begin
// if RESTRequest.Response.StatusCode = 200 then
// begin
// dsPeople.Active := True;
// dsPeople.AppendFromJSONArrayString(RESTRequest.Response.JSONValue.ToString);
// if Assigned(AOnSuccess) then
// AOnSuccess();
// end
// else
// AOnError(RESTRequest.Response.StatusCode, RESTRequest.Response.StatusText);
// end);
// except
// on E: Exception do
// begin
// if Assigned(AOnError) then
// begin
// ErrMsg := E.Message;
// TThread.Synchronize(nil,
// procedure
// begin
// AOnError(0, ErrMsg);
// end);
// end
// end;
// end;
// end).Start;
end;
procedure TdmMain.SavePerson(AOnSuccess: TProc; AOnError: TProc<Integer, String>);
begin
RESTRequest.ClearBody;
case dsPeople.State of
dsInsert:
begin
RESTRequest.Resource := 'people';
RESTRequest.Method := TRESTRequestMethod.rmPOST;
end;
dsEdit:
begin
RESTRequest.Resource := 'people/{id}';
RESTRequest.Method := TRESTRequestMethod.rmPUT;
RESTRequest.AddParameter('id', dsPeopleID.AsString, TRESTRequestParameterKind.pkURLSEGMENT);
end
else
raise Exception.Create('Invalid State');
end;
RESTRequest.AddBody(dsPeople.asJSONObjectString, ctAPPLICATION_JSON);
RESTRequest.ExecuteAsync(
procedure
begin
if RESTRequest.Response.StatusCode in [200, 201] then
begin
dsPeople.Post;
if Assigned(AOnSuccess) then
AOnSuccess();
end
else if Assigned(AOnError) then
AOnError(RESTRequest.Response.StatusCode, RESTRequest.Response.StatusText);
end);
end;
end.
| 27.516854 | 100 | 0.710086 |
f1e007e823814e86c4713ee0179c35b6c2bf215b | 10,085 | pas | Pascal | PseElfFile.pas | fobricia/pesp | 9f9eb31f21766243440a13d7d74d34fe5e74ff40 | [
"BSD-3-Clause"
]
| 8 | 2022-01-27T17:19:47.000Z | 2022-01-31T15:21:21.000Z | PseElfFile.pas | fobricia/pesp | 9f9eb31f21766243440a13d7d74d34fe5e74ff40 | [
"BSD-3-Clause"
]
| null | null | null | PseElfFile.pas | fobricia/pesp | 9f9eb31f21766243440a13d7d74d34fe5e74ff40 | [
"BSD-3-Clause"
]
| 3 | 2022-01-27T14:46:53.000Z | 2022-01-30T04:48:38.000Z | {
Pascal Executable Parser
by sa, 2014,2015
}
unit PseElfFile;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
interface
uses
SysUtils, Classes, PseFile, PseElf, PseSection, PseCmn;
type
{
ELF files, used on UNIXOIDE.
References
TIS Committee. Tool Interface Standard (TIS) Executable and Linking
Format (ELF) Specification. TIS Committee, 1995.
}
TPseElfFile = class(TPseFile)
private
FFileHeader32: TElf32Header;
FFileHeader64: TElf64Header;
FProgramHeader32: array of TElf32ProgramHeader;
FProgramHeader64: array of TElf64ProgramHeader;
FSizeOfImage: Cardinal;
function GetMachine: Elf32_Half;
procedure ReadExports;
procedure ReadImports;
procedure ReadSections;
procedure ReadProgramHeaders;
function ReadSectionString(const Index: integer): string;
procedure UpdateSectionNames;
protected
public
constructor Create; override;
destructor Destroy; override;
function LoadFromStream(Stream: TStream): boolean; override;
procedure SaveSectionToStream(const ASection: integer; Stream: TStream); override;
function GetArch: TPseArch; override;
function GetMode: TPseMode; override;
function GetFirstAddr: UInt64; override;
function GetEntryPoint: UInt64; override;
function GetImageBase: UInt64;
function GetSizeOfImage: Cardinal;
function GetFriendlyName: string; override;
property FileHeader32: TElf32Header read FFileHeader32;
property FileHeader64: TElf64Header read FFileHeader64;
end;
implementation
uses
Math;
constructor TPseElfFile.Create;
begin
inherited;
end;
destructor TPseElfFile.Destroy;
begin
inherited;
end;
function TPseElfFile.LoadFromStream(Stream: TStream): boolean;
begin
Result := inherited;
if Result then begin
FStream.Position := 0;
FStream.Read(FFileHeader32, SizeOf(TElf32Header));
// Check for ELF format
if FFileHeader32.e_ident[EI_MAG0] <> $7f then
Exit(false);
if FFileHeader32.e_ident[EI_MAG1] <> Ord('E') then
Exit(false);
if FFileHeader32.e_ident[EI_MAG2] <> Ord('L') then
Exit(false);
if FFileHeader32.e_ident[EI_MAG3] <> Ord('F') then
Exit(false);
// 32 or 64 Bit
if FFileHeader32.e_ident[EI_CLASS] = ELFCLASS64 then
FBitness := pseb64
else
FBitness := pseb32;
if Is64 then begin
// Read 64 bit header, differs in size
FStream.Position := 0;
FStream.Read(FFileHeader64, SizeOf(TElf64Header));
end;
ReadProgramHeaders;
ReadSections;
ReadImports;
ReadExports;
end;
end;
function TPseElfFile.GetFirstAddr: UInt64;
var
i: integer;
sec: TPseSection;
ep: UInt64;
begin
// In contrast to PE files, ELF files do not define an image base, so
// find the section with the entry point and return its target address
ep := GetEntryPoint;
for i := 0 to FSections.Count - 1 do begin
sec := FSections[i];
if (saCode in sec.Attribs) or ((saExecuteable in sec.Attribs)) then begin
// Section must be executeable
if (ep >= sec.Address) and (ep <= (sec.Address + sec.Size)) then begin
// Entrypoint is inside the section
Result := sec.Address;
Exit;
end;
end;
end;
Result := 0;
end;
function TPseElfFile.GetEntryPoint: UInt64;
begin
if IS64 then
Result := FFileHeader64.e_entry
else
Result := FFileHeader32.e_entry;
end;
procedure TPseElfFile.UpdateSectionNames;
var
i: integer;
sec: TPseSection;
begin
for i := 0 to FSections.Count - 1 do begin
sec := FSections[i];
sec.Name := ReadSectionString(sec.NameIndex);
end;
end;
procedure TPseElfFile.ReadExports;
begin
end;
procedure TPseElfFile.ReadImports;
begin
end;
function TPseElfFile.ReadSectionString(const Index: integer): string;
var
cur_pos: Int64;
name: array[0..255] of AnsiChar;
strtab: TPseSection;
begin
Result := '(Unknown)';
if Index = 0 then
Exit;
if IS64 then begin
if FFileHeader64.e_shstrndx = SHN_UNDEF then
Exit;
strtab := FSections[FFileHeader64.e_shstrndx];
FStream.Seek(strtab.FileOffset + Index, soFromBeginning);
end else begin
if FFileHeader32.e_shstrndx = SHN_UNDEF then
Exit;
strtab := FSections[FFileHeader32.e_shstrndx];
FStream.Seek(strtab.FileOffset + Index, soFromBeginning);
end;
cur_pos := FStream.Position;
FStream.Read(name, 256);
FStream.Position := cur_pos;
Result := string(StrPas(PAnsiChar(@name)));
end;
procedure TPseElfFile.ReadSections;
var
n, i: integer;
sec32: TElf32SectionHeader;
sec64: TElf64SectionHeader;
sec: TPseSection;
attribs: TSectionAttribs;
begin
FSections.Clear;
FSizeOfImage := 0;
if IS64 then begin
FStream.Seek(FFileHeader64.e_shoff, soFromBeginning);
n := FFileHeader64.e_shnum;
for i := 0 to n - 1 do begin
attribs := [];
FStream.Read(sec64, SizeOf(TElf64SectionHeader));
sec := FSections.New;
sec.FileOffset := sec64.sh_offset;
sec.NameIndex := sec64.sh_name;
sec.Address := sec64.sh_addr;
sec.Size := sec64.sh_size;
sec.OrigAttribs := sec64.sh_flags;
sec.ElfType := sec64.sh_type;
if sec64.sh_type = SHT_PROGBITS then
Include(attribs, saCode)
else if sec64.sh_type = SHT_STRTAB then
Include(attribs, saStringTable)
else if sec64.sh_type = SHT_SYMTAB then
Include(attribs, saSymbolTable)
else if sec64.sh_type = SHT_NULL then
// Don't show in sections tree
Include(attribs, saNull);
if (sec64.sh_flags and SHF_EXECINSTR) = SHF_EXECINSTR then
Include(attribs, saExecuteable);
if (sec64.sh_flags and SHF_ALLOC) = SHF_ALLOC then
Include(attribs, saReadable);
if (sec64.sh_flags and SHF_WRITE) = SHF_WRITE then
Include(attribs, saWriteable);
sec.Attribs := attribs;
if sec64.sh_addr <> 0 then
Inc(FSizeOfImage, sec64.sh_size);
end;
end else begin
FStream.Seek(FFileHeader32.e_shoff, soFromBeginning);
n := FFileHeader32.e_shnum;
for i := 0 to n - 1 do begin
attribs := [];
FStream.Read(sec32, SizeOf(TElf32SectionHeader));
sec := FSections.New;
sec.FileOffset := sec32.sh_offset;
sec.NameIndex := sec32.sh_name;
sec.Address := sec32.sh_addr;
sec.Size := sec32.sh_size;
sec.OrigAttribs := sec32.sh_flags;
sec.ElfType := sec32.sh_type;
if sec32.sh_type = SHT_PROGBITS then
Include(attribs, saCode)
else if sec32.sh_type = SHT_STRTAB then
Include(attribs, saStringTable)
else if sec32.sh_type = SHT_SYMTAB then
Include(attribs, saSymbolTable)
else if sec32.sh_type = SHT_NULL then
Include(attribs, saNull);
if (sec32.sh_flags and SHF_EXECINSTR) = SHF_EXECINSTR then
Include(attribs, saExecuteable);
sec.Attribs := attribs;
if sec32.sh_addr <> 0 then
Inc(FSizeOfImage, sec32.sh_size);
end;
end;
// Now update section names, string table secion should be loaded
UpdateSectionNames;
end;
procedure TPseElfFile.ReadProgramHeaders;
var
i, n: integer;
begin
if IS64 then begin
FStream.Seek(FFileHeader64.e_phoff, soFromBeginning);
n := FFileHeader64.e_phnum;
SetLength(FProgramHeader64, n);
for i := 0 to n - 1 do begin
FStream.Read(FProgramHeader64[i], FFileHeader64.e_phentsize);
end;
end else begin
FStream.Seek(FFileHeader32.e_phoff, soFromBeginning);
n := FFileHeader32.e_phnum;
SetLength(FProgramHeader32, n);
for i := 0 to n - 1 do begin
FStream.Read(FProgramHeader32[i], FFileHeader32.e_phentsize);
end;
end;
end;
procedure TPseElfFile.SaveSectionToStream(const ASection: integer; Stream: TStream);
var
sec: TPseSection;
o, s: Int64;
begin
sec := FSections[ASection];
o := sec.FileOffset;
FStream.Seek(o, soFromBeginning);
s := Min(Int64(sec.Size), Int64(FStream.Size - o));
Stream.CopyFrom(FStream, s);
end;
function TPseElfFile.GetImageBase: UInt64;
var
i: integer;
begin
Result := $FFFFFFFFFFFFFF;
if Is64 then begin
for i := Low(FProgramHeader64) to High(FProgramHeader64) do begin
if (FProgramHeader64[i].p_type = PT_LOAD) and (Result > FProgramHeader64[i].p_vaddr) then
Result := FProgramHeader64[i].p_vaddr;
end;
end else begin
for i := Low(FProgramHeader32) to High(FProgramHeader32) do begin
if (FProgramHeader32[i].p_type = PT_LOAD) and (Result > FProgramHeader32[i].p_vaddr) then
Result := FProgramHeader32[i].p_vaddr;
end;
end;
end;
function TPseElfFile.GetSizeOfImage: Cardinal;
begin
Result := FSizeOfImage;
end;
function TPseElfFile.GetMachine: Elf32_Half;
begin
if IS64 then
Result := FFileHeader64.e_machine
else
Result := FFileHeader32.e_machine;
end;
function TPseElfFile.GetArch: TPseArch;
begin
case GetMachine of
EM_386,
EM_X86_64:
begin
Result := pseaX86;
end;
EM_MIPS:
begin
Result := pseaMIPS;
end;
EM_PPC:
begin
Result := pseaPPC;
end;
EM_ARM:
begin
Result := pseaARM;
end;
EM_AARCH64:
begin
Result := pseaARM64;
end;
else
Result := pseaUnknown;
end;
end;
function TPseElfFile.GetMode: TPseMode;
begin
Result := [];
case GetMachine of
EM_ARM, EM_AARCH64:
Include(Result, psemARM);
EM_386:
Include(Result, psem32);
EM_X86_64:
Include(Result, psem64);
EM_PPC:
begin
if Is64 then
Include(Result, psem64);
end;
end;
if IS64 then begin
if FFileHeader64.e_ident[EI_DATA] = ELFDATA2LSB then
Include(Result, psemLittleEndian)
else
Include(Result, psemBigEndian);
end else begin
if FFileHeader32.e_ident[EI_DATA] = ELFDATA2LSB then
Include(Result, psemLittleEndian)
else
Include(Result, psemBigEndian);
end;
end;
function TPseElfFile.GetFriendlyName: string;
begin
Result := 'ELF';
if Is64 then
Result := Result + '64'
else
Result := Result + '32';
end;
initialization
end.
| 24.962871 | 96 | 0.681706 |
836f6d96d7a95515bf36120b356527fef79ac524 | 12,449 | pas | Pascal | windows/src/ext/jedi/jvcl/tests/RxLib/Source/JvGradedit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 219 | 2017-06-21T03:37:03.000Z | 2022-03-27T12:09:28.000Z | windows/src/ext/jedi/jvcl/tests/RxLib/Source/JvGradedit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 4,451 | 2017-05-29T02:52:06.000Z | 2022-03-31T23:53:23.000Z | windows/src/ext/jedi/jvcl/tests/RxLib/Source/JvGradedit.pas | bravogeorge/keyman | c0797e36292de903d7313214d1f765e3d9a2bf4d | [
"MIT"
]
| 72 | 2017-05-26T04:08:37.000Z | 2022-03-03T10:26:20.000Z | {-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvGradEdit.PAS, released on 2002-07-04.
The Initial Developers of the Original Code are: Fedor Koshevnikov, Igor Pavluk and Serge Korolev
Copyright (c) 1997, 1998 Fedor Koshevnikov, Igor Pavluk and Serge Korolev
Copyright (c) 2001,2002 SGB Software
All Rights Reserved.
Last Modified: 2002-07-04
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net
Known Issues:
-----------------------------------------------------------------------------}
{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$I JEDI.INC}
unit JvGradEdit;
interface
uses
Windows, SysUtils, Messages, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, JvToolEdit, JvGrdCpt,
{$IFDEF Delphi6_Up}
RTLConsts, DesignIntf, DesignEditors, VCLEditors,
{$ELSE}
LibIntf, DsgnIntf,
{$ENDIF}
JvxCtrls, JvPlacemnt;
{$IFNDEF Delphi4_Up}
type
IDesigner = TDesigner;
{$ENDIF}
type
TGradCaptionsEditor = class(TForm)
ApplyButton: TButton;
CancelButton: TButton;
OkButton: TButton;
GroupBox2: TGroupBox;
Label1: TLabel;
Label3: TLabel;
CaptionText: TEdit;
CaptionInactiveColor: TComboBox;
GroupBox1: TGroupBox;
CaptionList: TJvTextListBox;
NewButton: TButton;
DeleteButton: TButton;
CaptionParentFont: TCheckBox;
CaptionGlueNext: TCheckBox;
CaptionVisible: TCheckBox;
Label2: TLabel;
CaptionFont: TJvComboEdit;
GradientCaption: TJvxGradientCaption;
FontDialog: TFontDialog;
ColorDialog: TColorDialog;
FormStorage: TJvFormStorage;
procedure FormCreate(Sender: TObject);
procedure CaptionListClick(Sender: TObject);
procedure CaptionListDragDrop(Sender, Source: TObject; X, Y: Integer);
procedure CaptionListDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure NewButtonClick(Sender: TObject);
procedure DeleteButtonClick(Sender: TObject);
procedure OkButtonClick(Sender: TObject);
procedure ApplyButtonClick(Sender: TObject);
procedure CaptionInactiveColorDblClick(Sender: TObject);
procedure ControlExit(Sender: TObject);
procedure CaptionTextChange(Sender: TObject);
procedure CaptionFontButtonClick(Sender: TObject);
procedure CheckBoxClick(Sender: TObject);
private
{ Private declarations }
FComponent: TJvxGradientCaption;
FDesigner: IDesigner;
FUpdating: Boolean;
procedure AddColorItem(const ColorName: string);
procedure EnableControls(Enable: Boolean);
procedure UpdateCaptionList(Index: Integer);
procedure ReadControls;
procedure UpdateControls;
procedure ClearControls;
function GetActiveCaption: TJvCaption;
procedure ApplyChanges;
public
{ Public declarations }
procedure SetGradientCaption(Component: TJvxGradientCaption;
Designer: IDesigner);
property ActiveCaption: TJvCaption read GetActiveCaption;
end;
{ TGradientCaptionEditor }
TGradientCaptionEditor = class(TComponentEditor)
procedure Edit; override;
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
{$IFNDEF Delphi3_Up}
{ TGradientCaptionsProperty }
TGradientCaptionsProperty = class(TClassProperty)
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
end;
{$ENDIF}
function EditGradientCaption(Component: TJvxGradientCaption;
Designer: IDesigner): Boolean;
implementation
uses JvVCLUtils, JvBoxProcs, JvConst, JvLConst;
{$R *.DFM}
function EditGradientCaption(Component: TJvxGradientCaption; Designer: IDesigner): Boolean;
var gce : TGradCaptionsEditor;
begin
gce := TGradCaptionsEditor.Create(Application);
try
gce.SetGradientCaption(Component, Designer);
Result := gce.ShowModal = mrOk;
finally
gce.Free;
end;
end;
{ TGradientCaptionEditor }
procedure TGradientCaptionEditor.Edit;
begin
EditGradientCaption(TJvxGradientCaption(Component), Designer);
end;
procedure TGradientCaptionEditor.ExecuteVerb(Index: Integer);
begin
if Index = 0 then Edit;
end;
function TGradientCaptionEditor.GetVerb(Index: Integer): string;
begin
if Index = 0 then Result := LoadStr(srCaptionDesigner)
else Result := '';
end;
function TGradientCaptionEditor.GetVerbCount: Integer;
begin
Result := 1;
end;
{$IFNDEF Delphi3_Up}
{ TGradientCaptionsProperty }
function TGradientCaptionsProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog, paReadOnly];
end;
procedure TGradientCaptionsProperty.Edit;
begin
if EditGradientCaption(TJvxGradientCaption(GetComponent(0)), Designer) then
Modified;
end;
{$ENDIF Delphi3_Up}
{ TGradCaptionsEditor }
procedure TGradCaptionsEditor.UpdateCaptionList(Index: Integer);
var
I, Save: Integer;
begin
if Index >= 0 then Save := Index
else Save := CaptionList.ItemIndex;
CaptionList.Items.BeginUpdate;
try
CaptionList.Items.Clear;
for I := 0 to GradientCaption.Captions.Count - 1 do
CaptionList.Items.Add(Format('%s[%d]', [LoadStr(srGradientCaptions), I]));
if Save < 0 then Save := 0;
if Save >= CaptionList.Items.Count then
Save := CaptionList.Items.Count - 1;
finally
CaptionList.Items.EndUpdate;
CaptionList.ItemIndex := Save;
end;
end;
function TGradCaptionsEditor.GetActiveCaption: TJvCaption;
var
I: Integer;
begin
Result := nil;
I := CaptionList.ItemIndex;
if (I >= 0) and (I < GradientCaption.Captions.Count) then
Result := GradientCaption.Captions[I];
end;
procedure TGradCaptionsEditor.SetGradientCaption(Component: TJvxGradientCaption;
Designer: IDesigner);
begin
FComponent := Component;
FDesigner := Designer;
if Component <> nil then begin
with GradientCaption do begin
Active := False;
Font := Component.Font;
DefaultFont := Component.DefaultFont;
FontInactiveColor := Component.FontInactiveColor;
GradientActive := Component.GradientActive;
GradientInactive := Component.GradientInactive;
StartColor := Component.StartColor;
HideDirection := Component.HideDirection;
GradientSteps := Component.GradientSteps;
Captions := Component.Captions;
if Component.Name <> '' then
FormCaption := Format('%s.%s', [Component.Name,
LoadStr(srGradientCaptions)])
else
FormCaption := Format('%s.%s', [Component.ClassName,
LoadStr(srGradientCaptions)]);
Active := True;
end;
end;
UpdateCaptionList(-1);
UpdateControls;
end;
procedure TGradCaptionsEditor.ApplyChanges;
begin
ReadControls;
if Assigned(FComponent) then begin
FComponent.Captions := GradientCaption.Captions;
if Assigned(FDesigner) then FDesigner.Modified;
end;
end;
procedure TGradCaptionsEditor.AddColorItem(const ColorName: string);
begin
CaptionInactiveColor.Items.Add(ColorName);
end;
procedure TGradCaptionsEditor.UpdateControls;
begin
if ActiveCaption = nil then begin
ClearControls;
EnableControls(False);
end else
with ActiveCaption do begin
FUpdating := True;
try
FontDialog.Font := Font;
CaptionText.Text := Caption;
CaptionInactiveColor.ItemIndex := -1;
CaptionInactiveColor.Text := ColorToString(InactiveColor);
CaptionFont.Text := Font.Name;
CaptionParentFont.Checked := ParentFont;
CaptionGlueNext.Checked := GlueNext;
CaptionVisible.Checked := Visible;
EnableControls(True);
finally
FUpdating := False;
end;
end;
end;
procedure TGradCaptionsEditor.EnableControls(Enable: Boolean);
begin
CaptionText.Enabled := Enable;
CaptionInactiveColor.Enabled := Enable;
CaptionFont.Enabled := Enable;
CaptionParentFont.Enabled := Enable;
CaptionGlueNext.Enabled := Enable;
CaptionVisible.Enabled := Enable;
DeleteButton.Enabled := Enable;
end;
procedure TGradCaptionsEditor.ClearControls;
begin
FUpdating := True;
try
CaptionText.Text := '';
CaptionInactiveColor.ItemIndex := -1;
CaptionInactiveColor.Text := '';
CaptionFont.Text := '';
CaptionParentFont.Checked := False;
CaptionGlueNext.Checked := False;
CaptionVisible.Checked := False;
finally
FUpdating := False;
end;
end;
procedure TGradCaptionsEditor.ReadControls;
begin
if not FUpdating and (ActiveCaption <> nil) then begin
GradientCaption.Captions.BeginUpdate;
FUpdating := True;
try
with ActiveCaption do begin
Caption := CaptionText.Text;
InactiveColor := StringToColor(CaptionInactiveColor.Text);
ParentFont := CaptionParentFont.Checked;
GlueNext := CaptionGlueNext.Checked;
Visible := CaptionVisible.Checked;
end;
finally
GradientCaption.Captions.EndUpdate;
FUpdating := False;
end;
end;
end;
procedure TGradCaptionsEditor.FormCreate(Sender: TObject);
begin
FormStorage.IniFileName := SDelphiKey;
CaptionInactiveColor.Items.BeginUpdate;
try
GetColorValues(AddColorItem);
finally
CaptionInactiveColor.Items.EndUpdate;
end;
end;
procedure TGradCaptionsEditor.CaptionListClick(Sender: TObject);
begin
if not FUpdating then UpdateControls;
end;
procedure TGradCaptionsEditor.CaptionListDragDrop(Sender, Source: TObject; X,
Y: Integer);
var
I: Integer;
begin
I := CaptionList.ItemAtPos(Point(X, Y), True);
if (I >= 0) and (I < CaptionList.Items.Count) and
(I <> CaptionList.ItemIndex) then
begin
GradientCaption.MoveCaption(CaptionList.ItemIndex, I);
CaptionList.ItemIndex := I;
if not FUpdating then UpdateControls;
end;
end;
procedure TGradCaptionsEditor.CaptionListDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
begin
BoxDragOver(CaptionList, Source, X, Y, State, Accept, CaptionList.Sorted);
end;
procedure TGradCaptionsEditor.NewButtonClick(Sender: TObject);
begin
if GradientCaption.Captions.Add <> nil then begin
UpdateCaptionList(GradientCaption.Captions.Count - 1);
UpdateControls;
if CaptionText.CanFocus then ActiveControl := CaptionText;
end;
end;
procedure TGradCaptionsEditor.DeleteButtonClick(Sender: TObject);
begin
if ActiveCaption <> nil then begin
ActiveCaption.Free;
UpdateCaptionList(-1);
UpdateControls;
end;
end;
procedure TGradCaptionsEditor.OkButtonClick(Sender: TObject);
begin
ApplyChanges;
ModalResult := mrOk;
end;
procedure TGradCaptionsEditor.ApplyButtonClick(Sender: TObject);
begin
ApplyChanges;
end;
procedure TGradCaptionsEditor.CaptionInactiveColorDblClick(
Sender: TObject);
begin
with ColorDialog do begin
Color := StringToColor(CaptionInactiveColor.Text);
if Execute then begin
CaptionInactiveColor.Text := ColorToString(Color);
if not FUpdating and (ActiveCaption <> nil) then
ActiveCaption.InactiveColor := Color;
end;
end;
end;
procedure TGradCaptionsEditor.ControlExit(Sender: TObject);
begin
if not FUpdating then ReadControls;
end;
procedure TGradCaptionsEditor.CaptionTextChange(Sender: TObject);
begin
if not FUpdating and (ActiveCaption <> nil) then
ActiveCaption.Caption := CaptionText.Text;
end;
procedure TGradCaptionsEditor.CaptionFontButtonClick(Sender: TObject);
begin
if ActiveCaption <> nil then begin
with FontDialog do begin
Font := ActiveCaption.Font;
Font.Color := ColorToRGB(ActiveCaption.Font.Color);
if Execute then begin
FUpdating := True;
try
CaptionFont.Text := Font.Name;
ActiveCaption.Font := Font;
CaptionParentFont.Checked := ActiveCaption.ParentFont;
finally
FUpdating := False;
end;
end;
end;
end
else Beep;
end;
procedure TGradCaptionsEditor.CheckBoxClick(Sender: TObject);
begin
if not FUpdating then ReadControls;
end;
end.
| 27.603104 | 97 | 0.725199 |
47a05b41ea6084729032716a3df535886a88673d | 561 | pas | Pascal | src/jisuan/jisuan.pas | EULIR/OI-practicce-code | a7b982d279599d68a2ff51ebd50858f832314971 | [
"Apache-2.0"
]
| 2 | 2019-03-16T15:27:31.000Z | 2019-03-17T06:50:15.000Z | src/jisuan/jisuan.pas | EULIR/OI-practicce-code | a7b982d279599d68a2ff51ebd50858f832314971 | [
"Apache-2.0"
]
| null | null | null | src/jisuan/jisuan.pas | EULIR/OI-practicce-code | a7b982d279599d68a2ff51ebd50858f832314971 | [
"Apache-2.0"
]
| null | null | null | var
s,s1,s2,s3:ansistring;
i,j,temp,code,t1,ans,p,p1,l,l1,t:longint;
begin
read(s);
s:=s+'+';
t1:=1; i:=1;
while i<length(s) do
begin
j:=i+1;
while (s[j]>='0')and(s[j]<='9')and(j<length(s)) do
inc(j);
s1:=copy(s,i,j-i);
val(s1,temp,code);
temp:=temp mod 10000;
//writeln(temp);
if s[j]='*'
then t1:=t1*temp mod 10000;
if s[j]='+'
then begin
ans:=(ans+temp*t1) mod 10000;
t1:=1;
end;
i:=j+1;
end;
write(ans);
end.
| 18.096774 | 56 | 0.445633 |
f1e43fcabb9c0dfec09e73b18822ffee8c049e00 | 3,986 | pas | Pascal | tests/altium_crap/Tutorials/NB3000 Discovery Series/Discovery Session 3/Controller.pas | hanun2999/Altium-Schematic-Parser | a9bd5b1a865f92f2e3f749433fb29107af528498 | [
"MIT"
]
| 1 | 2020-06-08T11:17:46.000Z | 2020-06-08T11:17:46.000Z | tests/altium_crap/Tutorials/NB3000 Discovery Series/Discovery Session 3/Controller.pas | hanun2999/Altium-Schematic-Parser | a9bd5b1a865f92f2e3f749433fb29107af528498 | [
"MIT"
]
| null | null | null | tests/altium_crap/Tutorials/NB3000 Discovery Series/Discovery Session 3/Controller.pas | hanun2999/Altium-Schematic-Parser | a9bd5b1a865f92f2e3f749433fb29107af528498 | [
"MIT"
]
| null | null | null | var HSVUpdate, RGBUpdate : Boolean;
procedure TxMainForm.xClearButtonClick(Sender: TObject);
begin
RED_O.Value := 0;
GREEN_O.Value := 0;
BLUE_O.Value := 0;
end;
function Module (X, Y, Z : Real) : Real;
begin
Result := Sqrt(x * x + y * y + z * z);
end;
function Arg(xa, ya : Real) : Real;
begin
Result := 0;
if (xa = 0) and (ya = 0) then
begin
Result := 0;
Exit;
end;
if (xa = 0) and (ya >= 0) then
begin
Result := Pi / 2;
Exit;
end;
if (ya = 0) and (xa < 0) then
begin
Result := Pi;
Exit;
end;
if (xa = 0) and (ya < 0) then
begin
Result := -Pi / 2;
Exit;
end;
if (xa > 0) then
begin
Result := ArcTan(ya / xa);
Exit;
end;
if (xa < 0) and (ya >= 0) then Result := Pi - ArcTan(-ya / xa);
if (xa < 0) and (ya < 0) then Result := -Pi + ArcTan(-ya / -xa);
end;
procedure RGBtoHSV();
var Temp, xa, ya, Hue, Saturation, Value : Real;
begin
Temp := (xRedSlider.Value + xGreenSlider.Value + xBlueSlider.Value) / 3;
xa := (xGreenSlider.Value - xRedSlider.Value) / sqrt(2);
ya := (2 * xBlueSlider.Value - xRedSlider.Value - xGreenSlider.Value) / sqrt(6);
Hue := Arg(xa, ya) * 180 / Pi + 150;
Saturation := Arg(Temp, Module(xRedSlider.Value - Temp, xGreenSlider.Value - Temp, xBlueSlider.Value - Temp)) * 100 / ArcTan(Sqrt(6));
Value := Temp / 2.55;
if (Saturation = 0) or (Value = 0) then Hue := 0;
if (Hue < 0) then Hue := Hue + 360;
if (Hue >= 360) then Hue := Hue - 360;
xHueSlider.Value := Hue;
xSaturationSlider.Value := Saturation;
xValueSlider.Value := Value;
end;
procedure HSVtoRGB();
var Angle, Ur, Radius, Vr, Wr : Real;
Red, Green Blue : Real;
Rdim : Real;
begin
Angle := (xHueSlider.Value - 150) * Pi / 180;
Ur := xValueSlider.Value * 2.55;
Radius := Ur * Tan(xSaturationSlider.Value * ArcTan(Sqrt(6)/100));
Vr := Radius * Cos(Angle) / Sqrt(2);
Wr := Radius * Sin(Angle) / Sqrt(6);
Red := Ur - Vr - Wr;
Green := Ur + Vr - Wr;
Blue := Ur + Wr + Wr;
if Red < 0 then
begin
Rdim := Ur / (Vr + Wr);
Red := 0;
Green := Ur + (Vr - Wr) * Rdim;
Blue := Ur + 2 * Wr * Rdim;
end;
if Green < 0 then
begin
Rdim := -Ur / (Vr - Wr);
Red := Ur - (Vr + Wr) * Rdim;
Green := 0;
Blue := Ur + 2 * Wr * Rdim;
end;
if Blue < 0 then
begin
Rdim := -Ur / (Wr + Wr);
Red := Ur - (Vr + Wr) * Rdim;
Green := Ur + (Vr - Wr) * Rdim;
Blue := 0;
end;
if Red > 255 then
begin
Rdim := (Ur - 255) / (Vr + Wr);
Red := 255;
Green := Ur + (Vr - Wr) * Rdim;
Blue := Ur + 2 * Wr * Rdim;
end;
if Green > 255 then
begin
Rdim := (255 - Ur) / (Vr - Wr);
Red := Ur - (Vr + Wr) * Rdim;
Green := 255;
Blue := Ur + 2 * Wr * Rdim;
end;
if Blue > 255 then
begin
Rdim := (255 - Ur) / (Wr + Wr);
Red := Ur - (Vr + Wr) * Rdim;
Green := Ur + (Vr - Wr) * Rdim;
Blue := 255;
end;
xRedSlider.Value := Red;
xGreenSlider.Value := Green;
xBlueSlider.Value := Blue;
end;
procedure TxMainForm.RGBChange(Sender: TObject);
begin
//Don't do anything if in the middle of an HSV change
if HSVUpdate = True then Exit;
RGBUpdate := True;
RGBtoHSV();
RGBUpdate := False;
end;
procedure TxMainForm.HSVChange(Sender: TObject);
begin
//Don't do anything if in the middle of an RGB change
if RGBUpdate = True then Exit;
HSVUpdate := True;
HSVtoRGB();
HSVUpdate := False;
end;
procedure TxMainForm.FormEnter(Sender: TObject);
begin
HSVUpdate := False;
RGBUpdate := False;
end;
| 23.585799 | 139 | 0.498746 |
fc31ebd1d676ad008c071db57a3c78d38193d3f3 | 4,961 | pas | Pascal | src/common/peimage/PE.MemoryStream.pas | vdisasm/vdisasm | 5827a579782d247e51e281533362517318dc47b4 | [
"MIT"
]
| 34 | 2015-05-04T03:55:42.000Z | 2021-08-22T09:57:44.000Z | src/common/peimage/PE.MemoryStream.pas | vdisasm/vdisasm | 5827a579782d247e51e281533362517318dc47b4 | [
"MIT"
]
| null | null | null | src/common/peimage/PE.MemoryStream.pas | vdisasm/vdisasm | 5827a579782d247e51e281533362517318dc47b4 | [
"MIT"
]
| 11 | 2016-08-11T10:00:15.000Z | 2020-11-27T06:00:09.000Z | {
Memory Stream based on already mapped PE image in current process.
Basically it's TMemoryStream with Memory pointing to ImageBase and Size equal
to SizeOfImage.
}
unit PE.MemoryStream;
interface
uses
System.Classes,
System.SysUtils;
type
TPECustomMemoryStream = class(TStream)
protected
FMemory: Pointer;
FSize, FPosition: NativeInt;
public
constructor CreateFromPointer(Ptr: Pointer; Size: integer);
procedure SetPointer(Ptr: Pointer; const Size: NativeInt);
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
function Read(var Buffer; Count: Longint): Longint; override;
function Write(const Buffer; Count: integer): integer; override;
procedure SaveToStream(Stream: TStream); virtual;
procedure SaveToFile(const FileName: string);
property Memory: Pointer read FMemory;
end;
TPEMemoryStream = class(TPECustomMemoryStream)
private
FModuleToUnload: HMODULE; // needed if module loading is forced.
FModuleFileName: string;
FModuleSize: uint32;
private
procedure CreateFromModulePtr(ModulePtr: Pointer);
public
// Create stream from module in current process.
// If module is not found exception raised.
// To force loading module set ForceLoadingModule to True.
constructor Create(const ModuleName: string; ForceLoadingModule: boolean = False); overload;
// Create from module by known base address.
constructor Create(ModuleBase: NativeUInt); overload;
destructor Destroy; override;
// Simply read SizeOfImage from memory.
class function GetModuleImageSize(ModulePtr: PByte): uint32; static;
end;
implementation
uses
WinApi.Windows,
PE.Types.DosHeader,
PE.Types.NTHeaders;
{ TPECustomMemoryStream }
procedure TPECustomMemoryStream.SetPointer(Ptr: Pointer; const Size: NativeInt);
begin
FMemory := Ptr;
FSize := Size;
FPosition := 0;
end;
constructor TPECustomMemoryStream.CreateFromPointer(Ptr: Pointer; Size: integer);
begin
inherited Create;
SetPointer(Ptr, Size);
end;
procedure TPECustomMemoryStream.SaveToFile(const FileName: string);
var
Stream: TStream;
begin
Stream := TFileStream.Create(FileName, fmCreate);
try
SaveToStream(Stream);
finally
Stream.Free;
end;
end;
procedure TPECustomMemoryStream.SaveToStream(Stream: TStream);
begin
if FSize <> 0 then
Stream.WriteBuffer(FMemory^, FSize);
end;
function TPECustomMemoryStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64;
begin
case Origin of
soBeginning:
FPosition := Offset;
soCurrent:
Inc(FPosition, Offset);
soEnd:
FPosition := FSize + Offset;
end;
Result := FPosition;
end;
function TPECustomMemoryStream.Read(var Buffer; Count: integer): Longint;
begin
if Count = 0 then
Exit(0);
Result := FSize - FPosition;
if Result > 0 then
begin
if Result > Count then
Result := Count;
Move(PByte(FMemory)[FPosition], Buffer, Result);
Inc(FPosition, Result);
end;
end;
function TPECustomMemoryStream.Write(const Buffer; Count: integer): integer;
begin
if Count = 0 then
Exit(0);
Result := FSize - FPosition;
if Result > 0 then
begin
if Result > Count then
Result := Count;
Move(Buffer, PByte(FMemory)[FPosition], Result);
Inc(FPosition, Result);
end;
end;
{ TPEMemoryStream }
procedure TPEMemoryStream.CreateFromModulePtr(ModulePtr: Pointer);
begin
if ModulePtr = nil then
raise Exception.CreateFmt('Module "%s" not found in address space',
[FModuleFileName]);
FModuleSize := TPEMemoryStream.GetModuleImageSize(ModulePtr);
SetPointer(ModulePtr, FModuleSize);
end;
constructor TPEMemoryStream.Create(const ModuleName: string;
ForceLoadingModule: boolean);
var
FModulePtr: Pointer;
begin
inherited Create;
FModuleFileName := ModuleName;
FModulePtr := Pointer(GetModuleHandle(PChar(ModuleName)));
FModuleToUnload := 0;
if (FModulePtr = nil) and (ForceLoadingModule) then
begin
FModuleToUnload := LoadLibrary(PChar(ModuleName));
FModulePtr := Pointer(FModuleToUnload);
end;
CreateFromModulePtr(FModulePtr);
end;
constructor TPEMemoryStream.Create(ModuleBase: NativeUInt);
begin
inherited Create;
FModuleFileName := GetModuleName(ModuleBase);
FModuleToUnload := 0; // we didn't load it and won't free it
CreateFromModulePtr(Pointer(ModuleBase));
end;
destructor TPEMemoryStream.Destroy;
begin
if FModuleToUnload <> 0 then
FreeLibrary(FModuleToUnload);
inherited;
end;
class function TPEMemoryStream.GetModuleImageSize(ModulePtr: PByte): uint32;
var
dos: PImageDOSHeader;
nt: PImageNTHeaders;
begin
dos := PImageDOSHeader(ModulePtr);
if dos.e_magic <> MZ_SIGNATURE then
raise Exception.Create('Not PE image');
nt := PImageNTHeaders(ModulePtr + dos^.e_lfanew);
if nt.Signature <> PE00_SIGNATURE then
raise Exception.Create('Not PE image');
Result := nt^.OptionalHeader.pe32.SizeOfImage;
end;
end.
| 23.850962 | 96 | 0.733521 |
f1f587c4923b5af9c242bb12e7ee25d6c9df0554 | 278,821 | dfm | Pascal | HWScontrol/source/umdl_statgalery.dfm | RonaldoSurdi/Sistema-gerenciamento-websites-delphi | 8cc7eec2d05312dc41f514bbd5f828f9be9c579e | [
"MIT"
]
| 1 | 2022-02-28T11:28:18.000Z | 2022-02-28T11:28:18.000Z | HWScontrol/source/umdl_statgalery.dfm | RonaldoSurdi/Sistema-gerenciamento-websites-delphi | 8cc7eec2d05312dc41f514bbd5f828f9be9c579e | [
"MIT"
]
| null | null | null | HWScontrol/source/umdl_statgalery.dfm | RonaldoSurdi/Sistema-gerenciamento-websites-delphi | 8cc7eec2d05312dc41f514bbd5f828f9be9c579e | [
"MIT"
]
| null | null | null | object mdl_statgalery: Tmdl_statgalery
Left = 667
Top = 292
Width = 840
Height = 500
Color = 16119285
DefaultMonitor = dmDesktop
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
FormStyle = fsMDIForm
KeyPreview = True
OldCreateOrder = False
Position = poDesktopCenter
WindowState = wsMaximized
OnActivate = FormActivate
OnClose = FormClose
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnResize = FormResize
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 829
Height = 428
Align = alClient
BevelInner = bvRaised
BevelOuter = bvLowered
BorderStyle = bsSingle
Color = 16119285
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
ParentFont = False
TabOrder = 0
object PageControl1: TPageControl
Left = 2
Top = 2
Width = 821
Height = 420
ActivePage = TabSheet1
Align = alClient
Style = tsFlatButtons
TabOrder = 0
OnChange = PageControl1Change
object TabSheet1: TTabSheet
Caption = 'Lista de registros'
object Paneltop: TPanel
Left = 0
Top = 0
Width = 813
Height = 22
Align = alTop
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object ToolBar_lng2: TToolBar
Left = 0
Top = 4
Width = 241
Height = 14
Align = alNone
AutoSize = True
ButtonHeight = 12
EdgeBorders = []
TabOrder = 0
object Label13: TLabel
Left = 0
Top = 2
Width = 88
Height = 12
AutoSize = False
Caption = 'Traduzir textos?'
end
object RadioButton1: TRadioButton
Left = 88
Top = 2
Width = 44
Height = 12
Caption = 'Sim'
TabOrder = 0
end
object RadioButton2: TRadioButton
Left = 132
Top = 2
Width = 43
Height = 12
Caption = 'N'#227'o'
Checked = True
TabOrder = 1
TabStop = True
end
object RadioButton3: TRadioButton
Left = 175
Top = 2
Width = 66
Height = 12
Caption = 'Solicitar'
TabOrder = 2
end
end
object ToolBar_web: TToolBar
Left = 249
Top = 0
Width = 226
Height = 22
Align = alNone
AutoSize = True
ButtonHeight = 20
EdgeBorders = []
TabOrder = 1
object Label7: TLabel
Left = 0
Top = 2
Width = 50
Height = 20
Alignment = taRightJustify
AutoSize = False
Caption = 'Website:'
Layout = tlCenter
end
object ComboBox_web: TComboBox
Left = 50
Top = 2
Width = 176
Height = 20
Style = csDropDownList
ItemHeight = 12
TabOrder = 0
OnChange = ComboBox_webChange
end
end
object ToolBar_ent: TToolBar
Left = 480
Top = 0
Width = 233
Height = 22
Align = alNone
AutoSize = True
ButtonHeight = 20
EdgeBorders = []
TabOrder = 2
Visible = False
object Label16: TLabel
Left = 0
Top = 2
Width = 50
Height = 20
Alignment = taRightJustify
AutoSize = False
Caption = 'Entidade:'
Layout = tlCenter
end
object ComboBox_ent: TComboBox
Left = 50
Top = 2
Width = 183
Height = 20
Style = csDropDownList
ItemHeight = 12
TabOrder = 0
OnChange = ComboBox_entChange
end
end
end
object PageControlab: TPageControl
Left = 0
Top = 22
Width = 813
Height = 368
ActivePage = TabSheet3
Align = alClient
Style = tsFlatButtons
TabOrder = 1
OnChange = PageControlabChange
object TabSheet3: TTabSheet
Caption = 'Estados'
ImageIndex = 2
object Splitter6: TSplitter
Left = 245
Top = 0
Height = 338
OnMoved = Splitter1Moved
end
object Panel22: TPanel
Left = 0
Top = 0
Width = 245
Height = 338
Align = alLeft
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object Lb_countreg3: TLabel
Left = 0
Top = 326
Width = 245
Height = 12
Align = alBottom
Alignment = taRightJustify
Caption = '0'
Transparent = True
end
object DBGrid3: TDBGrid
Left = 0
Top = 0
Width = 245
Height = 326
Align = alClient
Color = clWhite
FixedColor = 15066597
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
ParentFont = False
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clBlack
TitleFont.Height = -9
TitleFont.Name = 'Verdana'
TitleFont.Style = []
OnCellClick = DBGrid3CellClick
OnKeyDown = DBGrid3KeyDown
OnKeyUp = DBGrid3KeyUp
OnMouseDown = DBGrid3MouseDown
OnTitleClick = DBGrid3TitleClick
end
end
object Panel25: TPanel
Left = 248
Top = 0
Width = 557
Height = 338
Align = alClient
Color = 16119285
TabOrder = 1
object Splitter4: TSplitter
Left = 1
Top = 153
Width = 555
Height = 3
Cursor = crVSplit
Align = alTop
end
object Panel26: TPanel
Left = 1
Top = 156
Width = 555
Height = 154
Align = alClient
BevelOuter = bvNone
Color = 16119285
TabOrder = 0
object Panel27: TPanel
Left = 0
Top = 0
Width = 555
Height = 154
Align = alClient
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 0
object GroupBox2: TGroupBox
Left = 2
Top = 2
Width = 551
Height = 150
Align = alClient
Caption = 'Detalhes:'
TabOrder = 0
object re_editor3: TRxRichEdit
Left = 2
Top = 14
Width = 547
Height = 134
Align = alClient
Lines.Strings = (
'accessing...')
PopupMenu = PopupMenu_editor
TabOrder = 0
OnKeyDown = re_editorKeyDown
OnSelectionChange = SelectionChange
end
end
end
end
object Panel29: TPanel
Left = 1
Top = 310
Width = 555
Height = 27
Align = alBottom
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 1
object ToolBar25: TToolBar
Left = 325
Top = 2
Width = 228
Height = 23
Align = alRight
AutoSize = True
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
object bt_new3: TSpeedButton
Left = 0
Top = 2
Width = 75
Height = 22
Hint = 'Adicionar novo item'
Caption = 'Novo'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B00004000000000000000835C36005A85
AD0000FF0000F2D4B100E1C9AB004E7BA60000CCFF009966660082FEFE009999
9900EDF1F100CCFFFF008A633D00AE885E008DA6BD003253760033CCFF00FDF1
DD00E1C7A300FBE9C400FEFCF100C6A584009E794D00B0B6B500FEF8EF00FDF0
D700E4D1BC00956E4700FEF6E600A5835F00FFFFFF00B8956A00FCEED00042D5
FE00E9D8C300E2D3B900FFF7DE00FEFAF600E4D3B900816039008B664000B18A
63008CAAC500537CA50095744D008F6B4300FEFCF700F4D3B200E9D8BD00FFFF
FF00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000313131313131
3131313131313131313131310000313131313131090909090909090909093131
00003131313131161B1B2D282828272700093131000031313131311D11111120
2013131300093131000031313131311D1C111111202020130009313100003131
3131310D1C1C1C111120202000093131000031313131312918181C1C11111120
0009313100003131313131291818181C1C111111000931310000313131313107
252518181C222204000931310000310605311E072E0E0B182315152C00093131
0000310A062B0807010B2E2E2614141200093131000031310B06100F081E1E2E
1A252F00093131310000312B2B101E100101012A1A0300093131313100001E1E
101E1E1E10080B1E1F1F173131313131000031312B101E100605313131313131
313131310000312B0831212B08062B3131313131313131310000310A31311E2B
310A063131313131313131310000313131311E31313131313131313131313131
0000}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_new3Click
end
object bt_del3: TSpeedButton
Left = 75
Top = 2
Width = 75
Height = 22
Hint = 'Excluir item selecionado'
Caption = 'Excluir'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B0000400000000000000012148A0000FF
0000999999003130E4002E2CC5008485F3005B5BEF004240ED002326DF009495
F7006865F1003C3CCE005354F80017128B003B3BE7007976FB007372F7006668
F6003C3CEE00151587003333CC009B9DF5008588F100494AEE006869F7001115
8B003A42E6005D5FF3003F3ECA008D8FF50017158C002826DE003131C3009599
F8004447EF006866F5009999FF00FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000252525252525
2525252525252525252525250000252525252525252525252525252525252525
00002525252502132525252525250200252525250000252525021E101F252525
250213180425252500002525021910081F032525020D230E0920252500002525
250213061F0303021311120920252525000025252525021306030E0011120920
252525250000252525252502131B0E0E071D2025252525250000252525252525
02001112072025252525252500002525252525021E11120A2222142525252525
000025252525021E110E05141017170B2525252500002525250200110E052002
00100C0C0B252525000025250219100E1604252502130F0C210B252500002525
25021E1520252525250213211C252525000025252525021E2525252525250219
2525252500002525252525252525252525252525252525250000252525252525
2525252525252525252525250000252525252525252525252525252525252525
0000}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_del3Click
end
object bt_save3: TSpeedButton
Left = 150
Top = 2
Width = 78
Height = 22
Hint = 'Gravar dados'
Caption = 'Gravar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
1E020000424D1E02000000000000B60000002800000014000000120000000100
08000000000068010000120B0000120B00002000000000000000FFFFFF00FFF9
EC00EDEDED00F7ECD800F2E7D300F0E4D000EBD8B600D9C8AB00C7B49200C2AF
8D00BFAC8A00BAA78500B7A48200B4A17F0099999900AF9C7A00A18E6C008673
5100A06C4800806D4B006D5A38006E502F005C4927004E392100140D0000FFFF
FF00000000000000000000000000000000000000000000000000191919191919
1919191919191919191919191919191919191919190E0E0E0E0E0E0E0E0E0E0E
0E191919191919191217171515151515151717170E19191919191919120B0F00
0202020202160C170E19191919191919120B0F00130A000202160C170E191919
190E0E0E120A0D001413000202160C170E1919191217171512090D0000000000
00160C170E191919120B0F001208080C0C0C0C0C0C0C0C170E191919120B0F00
120801030303030405110C170E191919120A0D00120801030303030405110717
0E19191912090D001208010303030304051810170E1919191208080C12060101
0101010101140B170E1919191208010312121212121212121212121219191919
1208010303030304051107170E19191919191919120801030303030405181017
0E19191919191919120601010101010101140B170E1919191919191912121212
1212121212121212191919191919191919191919191919191919191919191919
1919}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_save3Click
end
end
end
object Panel11: TPanel
Left = 1
Top = 1
Width = 555
Height = 152
Align = alTop
BevelOuter = bvNone
ParentColor = True
TabOrder = 2
object Panel28: TPanel
Left = 0
Top = 0
Width = 328
Height = 152
Align = alLeft
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object Label29: TLabel
Left = 20
Top = 29
Width = 39
Height = 12
Alignment = taRightJustify
Caption = 'Estado:'
end
object Label30: TLabel
Left = 18
Top = 8
Width = 39
Height = 12
Alignment = taRightJustify
Caption = 'C'#243'digo:'
end
object cl_cod: TLabel
Left = 62
Top = 8
Width = 6
Height = 12
Caption = '0'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object cl_titulo: TEdit
Left = 62
Top = 27
Width = 250
Height = 20
TabOrder = 0
end
object cl_default: TCheckBox
Left = 250
Top = 7
Width = 71
Height = 18
Hint = 'Publicar'
Caption = 'Publicar'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 1
end
object CoolBar3: TCoolBar
Left = 0
Top = 97
Width = 328
Height = 55
Align = alBottom
AutoSize = True
Bands = <
item
Control = ToolBar20
ImageIndex = -1
MinHeight = 26
Width = 230
end
item
Break = False
Control = ToolBar24
ImageIndex = -1
Width = 96
end
item
Control = ToolBar21
ImageIndex = -1
Width = 92
end
item
Break = False
Control = ToolBar22
ImageIndex = -1
Width = 136
end
item
Break = False
Control = ToolBar23
ImageIndex = -1
Width = 96
end>
EdgeBorders = [ebTop]
object ToolBar20: TToolBar
Left = 9
Top = 0
Width = 217
Height = 26
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
Transparent = True
Wrapable = False
object FontName3: TComboBox
Left = 4
Top = 1
Width = 156
Height = 20
Hint = 'Selecione a fonte'
Ctl3D = False
DropDownCount = 10
ItemHeight = 12
ItemIndex = 0
ParentCtl3D = False
TabOrder = 0
Text = 'Arial'
OnChange = FontNameChange
Items.Strings = (
'Arial'
'Arial Narrow'
'Arial Black'
'Comic Scans MS'
'Courier'
'System'
'Times New Roman'
'Verdana'
'Wingdings')
end
object ToolButton4: TToolButton
Left = 160
Top = 0
Width = 8
ImageIndex = 8
Style = tbsSeparator
end
object FontSize3: TEdit
Left = 168
Top = 0
Width = 30
Height = 22
Hint = 'Selecione o tamanho da fonte'
TabOrder = 1
Text = '12'
OnChange = FontSizeChange
end
object UpDown3: TUpDown
Left = 198
Top = 0
Width = 16
Height = 22
Associate = FontSize3
Max = 150
Increment = 5
Position = 12
TabOrder = 2
end
end
object ToolBar21: TToolBar
Left = 9
Top = 28
Width = 79
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
Transparent = True
Wrapable = False
object BoldButton3: TToolButton
Left = 4
Top = 0
Caption = 'Negrito'
ImageIndex = 13
MenuItem = Negrito1
Style = tbsCheck
end
object ItalicButton3: TToolButton
Left = 27
Top = 0
Caption = 'It'#225'lico'
ImageIndex = 15
MenuItem = Italico1
Style = tbsCheck
end
object UnderlineButton3: TToolButton
Left = 50
Top = 0
Caption = 'Sublinhado'
ImageIndex = 16
MenuItem = Sublinhado1
Style = tbsCheck
end
end
object ToolBar22: TToolBar
Left = 103
Top = 28
Width = 123
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 2
Transparent = True
Wrapable = False
object LeftAlign3: TToolButton
Left = 4
Top = 0
Caption = 'esquerdo'
Grouped = True
ImageIndex = 17
Style = tbsCheck
OnClick = AlignButtonClick
end
object CenterAlign3: TToolButton
Tag = 2
Left = 27
Top = 0
Caption = 'centro'
Grouped = True
ImageIndex = 18
Style = tbsCheck
OnClick = AlignButtonClick
end
object RightAlign3: TToolButton
Tag = 1
Left = 50
Top = 0
Caption = 'direita'
Grouped = True
ImageIndex = 19
Style = tbsCheck
OnClick = AlignButtonClick
end
object JustifyAlign3: TToolButton
Tag = 3
Left = 73
Top = 0
Caption = 'justificado'
Grouped = True
ImageIndex = 20
Style = tbsCheck
OnClick = AlignButtonClick
end
object BulletsButton3: TToolButton
Left = 96
Top = 0
Caption = 'Marcador'
ImageIndex = 21
MenuItem = Marcador1
Style = tbsCheck
end
end
object ToolBar23: TToolBar
Left = 241
Top = 28
Width = 83
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 3
Transparent = True
Wrapable = False
object ToolButton22: TToolButton
Left = 4
Top = 0
Caption = 'Recortar'
ImageIndex = 6
MenuItem = Recortar1
end
object ToolButton23: TToolButton
Left = 27
Top = 0
Caption = 'Copiar'
ImageIndex = 7
MenuItem = Copiar1
end
object ToolButton24: TToolButton
Left = 50
Top = 0
Caption = 'Colar'
ImageIndex = 8
MenuItem = Colar1
end
end
object ToolBar24: TToolBar
Left = 241
Top = 0
Width = 83
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 4
Transparent = True
Wrapable = False
object fontColor3: TToolButton
Left = 4
Top = 0
Caption = 'Cor'
ImageIndex = 10
MenuItem = Cor1
end
object eddesfazer3: TToolButton
Left = 27
Top = 0
Caption = 'Desfazer'
ImageIndex = 4
MenuItem = Desfazer1
end
object colorfnd3: TToolButton
Left = 50
Top = 0
Caption = 'Cor de fundo'
ImageIndex = 12
MenuItem = Cordefundo1
end
end
end
end
object Panel38: TPanel
Left = 328
Top = 0
Width = 227
Height = 152
Align = alClient
BevelInner = bvLowered
BevelOuter = bvSpace
BorderStyle = bsSingle
Color = 16119285
TabOrder = 1
object Panel39: TPanel
Left = 2
Top = 14
Width = 157
Height = 116
Align = alClient
AutoSize = True
BevelInner = bvLowered
BevelOuter = bvLowered
Color = clWhite
TabOrder = 0
object swf_logo3: TShockwaveFlash
Left = 2
Top = 40
Width = 153
Height = 74
Cursor = crHandPoint
Hint = 'Icone do '#225'lbum'
TabStop = False
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
ControlData = {
6755665500090000D00F0000A607000008000200000000000800000000000800
0000000008000E000000570069006E0064006F00770000000800060000002D00
310000000800060000002D003100000008000A00000048006900670068000000
08000200000000000800060000002D0031000000080000000000080002000000
0000080010000000530068006F00770041006C006C0000000800040000003000
0000080004000000300000000800020000000000080000000000080002000000
00000D0000000000000000000000000000000000080004000000310000000800
0400000030000000080000000000080004000000300000000800080000006100
6C006C00000008000C000000660061006C00730065000000}
end
object ToolBar19: TToolBar
Left = 2
Top = 2
Width = 153
Height = 38
AutoSize = True
ButtonHeight = 36
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
object bt_open3: TSpeedButton
Left = 0
Top = 2
Width = 55
Height = 36
Hint = 'Importar imagem'
Caption = 'Importar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6030000424DE603000000000000360200002800000017000000120000000100
080000000000B0010000120B0000120B00008000000000000000FFFFFF00D0FA
FF00CEFBFE00CEFAFE00B7FCFF00CDFAFD0092FAFF0091FAFF0092F9FF0091F9
FF0096F8FF0091F9FE0094F9FE0090F8FD00A9F1FF008AF2FE00A6F0FF0086F2
FE0088F2FD0087F0FE0088F0FF0087EFFE0085EEFF0088EEFF0087EEFF0086EC
FF0083EAFF0085E9FF007CE7FE007BE7FE007DE7FF007FE7FF00A1E6F5007EE7
FD007DE7FE007DE6FD00FFE8CB007AE6FE0078E7FC007BE6FF007DE6FF007DE6
FE007BE6FE0080E5FF007DE5FE007CE5FE007CE4FE007EE5FE007CE5FF0074DD
FE0072DDFF0075DDFE0073DDFE0076DCFF0073DCFF0074DCFE00BDD8E40075DA
EC00FFD9A90065CBE00064C9E1005EC4E00052BBE40067B7DD0083B4C800B7B5
B200B4B0AD0066C582005DACD40000D16E0049ACCC0042A8CC003199CE00319A
CB003399CE003399CD003597CD0066B066002D92C6002C92C30000AF42002287
BB002187B8002187BB002489B400288F8D00009F2F00009E2C001275A7006D6D
6C006767670065666A0003649300646667006567670068666600666765006467
6500646666006665670065646600007C000002466700114053000B2D62000000
0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000006A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A006A6A6A6A6A6A4242424242424242
4242424242426A6A6A006A6A6A6A6A405B5B5B5B5B5B5B5B5B5B5B595C426A6A
6A006A6A6A6A6A5C3C1A2121212121212121093958426A6A6A006A6A6A6A4054
08080808080808080808084658426A6A6A006A6A6A6A5C3B0F0F0F0F0F0F0F0F
0F1818585C426A6A6A006A6A6A4054132A2A2A2A2A2A2A2A2A16476766426A6A
6A006A6A6A5C3D2F33333333333333333333583869426A6A6A006A6A40540404
0404040404040404043E55000069416A6A006A6A5C5353535353535353535353
535856000000696A6A006A6A6A6A6A53196900003A4550506857004300696A6A
6A006A6A6A6A6A4E1919690024564550574D000069426A6A6A006A6A6A6A6A4B
201B1B6900245665574D00695C426A6A6A006A6A6A6A6A4810031E1E6900243A
24006952526A6A6A6A006A6A6A6A6A443F0E05050569002400696A6A6A6A6A6A
6A006A6A6A6A6A6A44494C4C4F6A6900696A6A6A6A6A6A6A6A006A6A6A6A6A6A
6A6A6A6A6A6A6A696A6A6A6A6A6A6A6A6A006A6A6A6A6A6A6A6A6A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_open3Click
end
object bt_exp3: TSpeedButton
Left = 55
Top = 2
Width = 55
Height = 36
Hint = 'Exportar para disco'
Caption = 'Exportar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6000000424DE6000000000000007600000028000000100000000E0000000100
04000000000070000000120B0000120B00001000000000000000FFFFFF00CC99
FF00FFFFCC00FFCCCC00CCCCCC00FFCC9900FF99990099999900000099006666
66003333330000000000FFFFFF0000000000000000000000000000079BBBBB70
00000079642544770000075200225AAAAAA00A2002253A0777A00A3000825A00
00A00A2088881A0A77A00A3800825A0000A00A2002253A07AAA00A3000225A00
A700095026666AAAA00009566325246570000762323255569000007763255699
00000000779977000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_exp3Click
end
object bt_limpar3: TSpeedButton
Left = 110
Top = 2
Width = 55
Height = 36
Hint = 'Limpar imagem'
Caption = 'Limpar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
56010000424D5601000000000000560000002800000010000000100000000100
08000000000000010000120B0000120B00000800000000000000FFFFFF0000FF
FF000000FF000000990000000000FFFFFF000000000000000000000000000000
0000000000000000000000020004040404040404040404040202000202040100
0100010001000102020000000202000100010001000102030000000000030200
0100010001020204000000000004020200010001020201040000000000040102
0200010202010004000000000004000102020202010001040000000000040100
0102020200010004000000000004000100020202020001040000000000040100
0202010002020004000000000004000202010001040202040000000000040202
0100010004010203000000000003020100010001040404020200000002020404
0404040404040000020200020200000000000000000000000002}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_limpar3Click
end
end
end
object Panel40: TPanel
Left = 2
Top = 2
Width = 219
Height = 12
Align = alTop
BevelOuter = bvNone
Caption = 'B a n d e i r a'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Verdana'
Font.Style = []
ParentColor = True
ParentFont = False
TabOrder = 1
end
object Panel41: TPanel
Left = 2
Top = 130
Width = 219
Height = 16
Align = alBottom
BevelOuter = bvNone
ParentColor = True
TabOrder = 2
object Label_size3: TLabel
Left = 198
Top = 0
Width = 21
Height = 16
Align = alRight
Alignment = taRightJustify
Caption = '0 kb'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object chk_view3: TCheckBox
Left = 5
Top = 2
Width = 104
Height = 13
Hint = 'Atualizar icone automaticamente'#13#10'na navega'#231#227'o dos registros'
Caption = 'Auto visualizar'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 0
OnClick = chk_view3Click
end
end
object Panelbtview3: TPanel
Left = 159
Top = 14
Width = 62
Height = 116
Align = alRight
BevelOuter = bvLowered
Color = clWhite
TabOrder = 3
OnResize = Panelbtview3Resize
object bt_view3: TSpeedButton
Left = 1
Top = 48
Width = 60
Height = 68
Hint = 'Ampliar imagem'
Caption = 'Ampliar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2030000424DB203000000000000360200002800000013000000130000000100
0800000000007C010000120B0000120B00008000000000000000FFFFFF00FFFF
F100F7FCFB00E4F7FA00DCF5EB00FFE7FF00FFE8BE00EAE4C100FCE1BF0084EB
C5008FE4C800A2DDCF00AEDACD0071E4B900FFD8B20078E0BF00FAD6AE00DFD7
B20078DBC700FED6AC00FDD7A70075DFBA00FFCFBB00BAD6B8006ADDB600EDCE
B900A1CFC90066DAB500FFCDA500E8C9BA00E2CFA900FFCC9900F6CC97005CCE
C000E6CB9900F0CA9400F5C994003DD69F00D6CA940032D59E0000D6AD00D6C8
930079CE9A00DEC68C0088CE8800CFC3930073C5910000CC9900C4C1770060C4
8800A5BA890080B8850060B791002EC4710058BB83003AB98C00B0AE850043B5
8D0080B47F0090B07A006BB37F0000BD8000AAB35D0081AF7B00999999008F92
B80050AB740000AF80008DAA5B009898880086B1380029A67E0043B14B007396
9200CC99660001A5750000A764003CA064006484A7005D995C00628A88002AA3
3B00009966000A976C0003925B00038D630000974200058574004C758E005672
9100646F8F001B7887003C7F5F00008B3E001C75720006863400008B24000289
2700078D130000795B003E6D65000A89150008871A002E5E920009821400006C
550099663300087B14000A7A16000F771800017A12000F751D00087312001048
8300006212002E4751003333330000333300FFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000767640404040404040404040404040404040
7600766A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A407600764A0000000000000000
0000000000006A407600764A00626C65686D666F656B627048006A407600764A
005252524C5B5E71574C4C5437006A407600764A0018150F0D2173581209181B
0A006A407600764A00000204055975410C1A000000006A407600764A00033947
4E5C515A67502C0B00006A407600764A000731696317464F6449615F01006A40
7600764A00292E38342535555672604406006A407600764A00263B36272F285D
603E301613006A407600764A001F324B2F2F2F3D6E4D1E1F0E006A407600764A
001C193A3C2A2F4354531D2411006A407600764A00242223233F3342452D202B
10006A407600764A00141313131313131313131308006A407600764A00000000
000000000000000000006A407600764A4A4A4A4A4A4A4A4A4A4A4A4A4A4A6A76
76007676767676767676767676767676767676767600}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_view3Click
end
object Panel43: TPanel
Left = 2
Top = 2
Width = 60
Height = 36
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object bt_imgRotateh3: TSpeedButton
Left = 1
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido hor'#225'rio'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B00000001000030000000FFFFFF00CCFF
FF0099FFFF00CCCCFF0099CCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCC
CC0099CCCC00CC99CC009999CC00FFCC9900CCCC990099CC990066CC990033CC
990000CC9900CC9999009999990066999900996699006666990033669900CCCC
660099CC660033CC6600CC99660099996600669966003399660000996600CC66
6600996666006666660033666600006666006633660066993300339933000099
3300996633006666330033663300006633006633330066660000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000009
090909090909090909030000000000000000092A221D1C221C1D211D1C220500
0000000000000922060F140F0F0F0F0F0F0D0300000000000000091C0A292929
2525292D1B090500000000000000091D0802070A181F0206040D080000000000
0000092200060A171E240C1000090500000000000000080108012D1F1F1A1F1F
060D0300000000000000090E140E27282012110F0E0905000000000000001413
14090F2D1212121D050D0800000000000000132322090E1E1B15190E0D090500
000000000000232B2309080508050809092B0900000000000000222E2B090D09
0B1E2B2F2E2C0E000000000000002B232E090508050E23262B261D0000000000
0000142B2B14000000000F2E2B2E230500000000000013232B2313090914222B
23162B09000000000000001D262B2B2B262B2B2B220009000000000000000009
1D232E2B2B262B1D0900000000000000000000000013142B231D140000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotateh3Click
end
object bt_imgRotatea3: TSpeedButton
Left = 31
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido anti-hor'#225'rio'
BiDiMode = bdLeftToRight
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B0000000100002F000000FFFFFF00CCFF
FF0099FFFF00CCCCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCCCC0099CC
CC0066CCCC00CC99CC00FFCC9900CCCC990099CC990066CC990033CC990000CC
9900CC999900999999006699990033999900996699006666990033669900CCCC
660099CC6600CC99660099996600669966003399660000996600CC6666009966
6600666666003366660000666600663366009999330033993300009933009966
3300666633003366330000663300663333006666000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000008
0808080808080808080300000000000000071C211B211B1C201C201C29080000
00000000000412060E0E0E0E0E0E0E081C080000000000000007071E2828242C
1F2828081C0800000000000000040D01090218170A0609011B08000000000000
00030C000A131E22140905002108000000000000000408051E1E0E2723280107
010700000000000000080C081A10111F28260D130D080000000000000004070C
0F1511112C0E0813121300000000000000070D070D190F1E1D0D082122120000
0000000000082A0808040707040708222A22000000000000000D2B2D2E2A1D0B
0C08082A2D21000000000000001C252A25220D040704082D222A000000000000
04222D2A2D0E00000000132A2A13000000000000082A16222A2113080812222A
2212000000000000000800212A2A2A252A2A2A251C0000000000000000000008
1C2A252A2A2D221C08000000000000000000000000131C222A13120000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ParentBiDiMode = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotatea3Click
end
object Label26: TLabel
Left = 19
Top = 23
Width = 25
Height = 12
Alignment = taCenter
Caption = 'Girar'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
ParentFont = False
Transparent = True
end
end
end
end
end
end
end
object TabSheet_grp: TTabSheet
Caption = 'Regi'#245'es/Cidades'
object Splitter1: TSplitter
Left = 241
Top = 0
Height = 338
OnMoved = Splitter1Moved
end
object Panel2: TPanel
Left = 244
Top = 0
Width = 561
Height = 338
Align = alClient
Color = 16119285
TabOrder = 0
object Panel4: TPanel
Left = 1
Top = 1
Width = 559
Height = 309
Align = alClient
BevelOuter = bvNone
Color = 16119285
TabOrder = 0
object Panelgrp: TPanel
Left = 0
Top = 0
Width = 559
Height = 309
Align = alClient
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 0
object Splitter3: TSplitter
Left = 2
Top = 154
Width = 555
Height = 3
Cursor = crVSplit
Align = alTop
end
object GroupBox9: TGroupBox
Left = 2
Top = 157
Width = 555
Height = 150
Align = alClient
Caption = 'Detalhes:'
TabOrder = 0
object re_editor1: TRxRichEdit
Left = 2
Top = 14
Width = 551
Height = 134
Align = alClient
Lines.Strings = (
'accessing...')
PopupMenu = PopupMenu_editor
TabOrder = 0
OnKeyDown = re_editorKeyDown
OnSelectionChange = SelectionChange
end
end
object Panel23: TPanel
Left = 2
Top = 2
Width = 555
Height = 152
Align = alTop
BevelOuter = bvNone
ParentColor = True
TabOrder = 1
object Panel19: TPanel
Left = 0
Top = 0
Width = 328
Height = 152
Align = alLeft
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object Label5: TLabel
Left = 35
Top = 77
Width = 40
Height = 12
Alignment = taRightJustify
Caption = 'Modelo:'
end
object Label3: TLabel
Left = 13
Top = 29
Width = 62
Height = 12
Alignment = taRightJustify
Caption = 'Regi'#227'o/Cid.:'
end
object Label2: TLabel
Left = 18
Top = 8
Width = 39
Height = 12
Alignment = taRightJustify
Caption = 'C'#243'digo:'
end
object ab_cod: TLabel
Left = 62
Top = 8
Width = 6
Height = 12
Caption = '0'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object Label23: TLabel
Left = 36
Top = 53
Width = 39
Height = 12
Alignment = taRightJustify
Caption = 'Estado:'
end
object ComboBox_model: TComboBox
Left = 76
Top = 74
Width = 247
Height = 20
Style = csDropDownList
ItemHeight = 12
TabOrder = 0
OnKeyDown = EVsaveKeyDown
end
object ab_titulo: TEdit
Left = 76
Top = 27
Width = 246
Height = 20
TabOrder = 1
OnKeyDown = EVsaveKeyDown
end
object ab_default: TCheckBox
Left = 250
Top = 7
Width = 71
Height = 18
Hint = 'Publicar '#225'lbum na galeria de fotos'
Caption = 'Publicar'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 2
end
object ComboBox_class2: TComboBox
Left = 77
Top = 50
Width = 247
Height = 20
ItemHeight = 12
TabOrder = 3
OnKeyDown = EVsaveKeyDown
end
object CoolBar2: TCoolBar
Left = 0
Top = 97
Width = 328
Height = 55
Align = alBottom
AutoSize = True
Bands = <
item
Control = ToolBar12
ImageIndex = -1
MinHeight = 26
Width = 237
end
item
Break = False
Control = ToolBar16
ImageIndex = -1
Width = 89
end
item
Control = ToolBar13
ImageIndex = -1
Width = 98
end
item
Break = False
Control = ToolBar14
ImageIndex = -1
Width = 136
end
item
Break = False
Control = ToolBar15
ImageIndex = -1
Width = 90
end>
EdgeBorders = [ebTop]
object ToolBar12: TToolBar
Left = 9
Top = 0
Width = 224
Height = 26
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
Transparent = True
Wrapable = False
object FontName1: TComboBox
Left = 4
Top = 1
Width = 157
Height = 20
Hint = 'Selecione a fonte'
Ctl3D = False
DropDownCount = 10
ItemHeight = 12
ParentCtl3D = False
TabOrder = 0
OnChange = FontNameChange
end
object ToolButton16: TToolButton
Left = 161
Top = 0
Width = 8
ImageIndex = 8
Style = tbsSeparator
end
object FontSize1: TEdit
Left = 169
Top = 0
Width = 36
Height = 22
Hint = 'Selecione o tamanho da fonte'
TabOrder = 1
Text = '12'
OnChange = FontSizeChange
end
object UpDown1: TUpDown
Left = 205
Top = 0
Width = 16
Height = 22
Associate = FontSize1
Max = 150
Increment = 5
Position = 12
TabOrder = 2
end
end
object ToolBar13: TToolBar
Left = 9
Top = 28
Width = 85
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
Transparent = True
Wrapable = False
object BoldButton1: TToolButton
Left = 4
Top = 0
Caption = 'Negrito'
ImageIndex = 13
MenuItem = Negrito1
Style = tbsCheck
end
object ItalicButton1: TToolButton
Left = 27
Top = 0
Caption = 'It'#225'lico'
ImageIndex = 15
MenuItem = Italico1
Style = tbsCheck
end
object UnderlineButton1: TToolButton
Left = 50
Top = 0
Caption = 'Sublinhado'
ImageIndex = 16
MenuItem = Sublinhado1
Style = tbsCheck
end
end
object ToolBar14: TToolBar
Left = 109
Top = 28
Width = 123
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 2
Transparent = True
Wrapable = False
object LeftAlign1: TToolButton
Left = 4
Top = 0
Caption = 'esquerdo'
Grouped = True
ImageIndex = 17
Style = tbsCheck
OnClick = AlignButtonClick
end
object CenterAlign1: TToolButton
Tag = 2
Left = 27
Top = 0
Caption = 'centro'
Grouped = True
ImageIndex = 18
Style = tbsCheck
OnClick = AlignButtonClick
end
object RightAlign1: TToolButton
Tag = 1
Left = 50
Top = 0
Caption = 'direita'
Grouped = True
ImageIndex = 19
Style = tbsCheck
OnClick = AlignButtonClick
end
object JustifyAlign1: TToolButton
Tag = 3
Left = 73
Top = 0
Caption = 'justificado'
Grouped = True
ImageIndex = 20
Style = tbsCheck
OnClick = AlignButtonClick
end
object BulletsButton1: TToolButton
Left = 96
Top = 0
Caption = 'Marcador'
ImageIndex = 21
MenuItem = Marcador1
Style = tbsCheck
end
end
object ToolBar15: TToolBar
Left = 247
Top = 28
Width = 77
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 3
Transparent = True
Wrapable = False
object ToolButton17: TToolButton
Left = 4
Top = 0
Caption = 'Recortar'
ImageIndex = 6
MenuItem = Recortar1
end
object ToolButton18: TToolButton
Left = 27
Top = 0
Caption = 'Copiar'
ImageIndex = 7
MenuItem = Copiar1
end
object ToolButton19: TToolButton
Left = 50
Top = 0
Caption = 'Colar'
ImageIndex = 8
MenuItem = Colar1
end
end
object ToolBar16: TToolBar
Left = 248
Top = 0
Width = 76
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 4
Transparent = True
Wrapable = False
object fontColor1: TToolButton
Left = 4
Top = 0
Caption = 'Cor'
ImageIndex = 10
MenuItem = Cor1
end
object eddesfazer1: TToolButton
Left = 27
Top = 0
Caption = 'Desfazer'
ImageIndex = 4
MenuItem = Desfazer1
end
object colorfnd1: TToolButton
Left = 50
Top = 0
Caption = 'Cor de fundo'
ImageIndex = 12
MenuItem = Cordefundo1
end
end
end
end
object Panel5: TPanel
Left = 328
Top = 0
Width = 227
Height = 152
Align = alClient
BevelInner = bvLowered
BevelOuter = bvSpace
BorderStyle = bsSingle
Color = 16119285
TabOrder = 1
object Panel8: TPanel
Left = 2
Top = 14
Width = 157
Height = 116
Align = alClient
AutoSize = True
BevelInner = bvLowered
BevelOuter = bvLowered
Color = clWhite
TabOrder = 0
object swf_logo1: TShockwaveFlash
Left = 2
Top = 40
Width = 153
Height = 74
Cursor = crHandPoint
Hint = 'Icone do '#225'lbum'
TabStop = False
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
ControlData = {
6755665500090000D00F0000A607000008000200000000000800000000000800
0000000008000E000000570069006E0064006F00770000000800060000002D00
310000000800060000002D003100000008000A00000048006900670068000000
08000200000000000800060000002D0031000000080000000000080002000000
0000080010000000530068006F00770041006C006C0000000800040000003000
0000080004000000300000000800020000000000080000000000080002000000
00000D0000000000000000000000000000000000080004000000310000000800
0400000030000000080000000000080004000000300000000800080000006100
6C006C00000008000C000000660061006C00730065000000}
end
object ToolBar3: TToolBar
Left = 2
Top = 2
Width = 153
Height = 38
AutoSize = True
ButtonHeight = 36
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
object bt_open1: TSpeedButton
Left = 0
Top = 2
Width = 55
Height = 36
Hint = 'Importar imagem'
Caption = 'Importar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6030000424DE603000000000000360200002800000017000000120000000100
080000000000B0010000120B0000120B00008000000000000000FFFFFF00D0FA
FF00CEFBFE00CEFAFE00B7FCFF00CDFAFD0092FAFF0091FAFF0092F9FF0091F9
FF0096F8FF0091F9FE0094F9FE0090F8FD00A9F1FF008AF2FE00A6F0FF0086F2
FE0088F2FD0087F0FE0088F0FF0087EFFE0085EEFF0088EEFF0087EEFF0086EC
FF0083EAFF0085E9FF007CE7FE007BE7FE007DE7FF007FE7FF00A1E6F5007EE7
FD007DE7FE007DE6FD00FFE8CB007AE6FE0078E7FC007BE6FF007DE6FF007DE6
FE007BE6FE0080E5FF007DE5FE007CE5FE007CE4FE007EE5FE007CE5FF0074DD
FE0072DDFF0075DDFE0073DDFE0076DCFF0073DCFF0074DCFE00BDD8E40075DA
EC00FFD9A90065CBE00064C9E1005EC4E00052BBE40067B7DD0083B4C800B7B5
B200B4B0AD0066C582005DACD40000D16E0049ACCC0042A8CC003199CE00319A
CB003399CE003399CD003597CD0066B066002D92C6002C92C30000AF42002287
BB002187B8002187BB002489B400288F8D00009F2F00009E2C001275A7006D6D
6C006767670065666A0003649300646667006567670068666600666765006467
6500646666006665670065646600007C000002466700114053000B2D62000000
0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000006A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A006A6A6A6A6A6A4242424242424242
4242424242426A6A6A006A6A6A6A6A405B5B5B5B5B5B5B5B5B5B5B595C426A6A
6A006A6A6A6A6A5C3C1A2121212121212121093958426A6A6A006A6A6A6A4054
08080808080808080808084658426A6A6A006A6A6A6A5C3B0F0F0F0F0F0F0F0F
0F1818585C426A6A6A006A6A6A4054132A2A2A2A2A2A2A2A2A16476766426A6A
6A006A6A6A5C3D2F33333333333333333333583869426A6A6A006A6A40540404
0404040404040404043E55000069416A6A006A6A5C5353535353535353535353
535856000000696A6A006A6A6A6A6A53196900003A4550506857004300696A6A
6A006A6A6A6A6A4E1919690024564550574D000069426A6A6A006A6A6A6A6A4B
201B1B6900245665574D00695C426A6A6A006A6A6A6A6A4810031E1E6900243A
24006952526A6A6A6A006A6A6A6A6A443F0E05050569002400696A6A6A6A6A6A
6A006A6A6A6A6A6A44494C4C4F6A6900696A6A6A6A6A6A6A6A006A6A6A6A6A6A
6A6A6A6A6A6A6A696A6A6A6A6A6A6A6A6A006A6A6A6A6A6A6A6A6A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_open1Click
end
object bt_exp1: TSpeedButton
Left = 55
Top = 2
Width = 55
Height = 36
Hint = 'Exportar para disco'
Caption = 'Exportar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6000000424DE6000000000000007600000028000000100000000E0000000100
04000000000070000000120B0000120B00001000000000000000FFFFFF00CC99
FF00FFFFCC00FFCCCC00CCCCCC00FFCC9900FF99990099999900000099006666
66003333330000000000FFFFFF0000000000000000000000000000079BBBBB70
00000079642544770000075200225AAAAAA00A2002253A0777A00A3000825A00
00A00A2088881A0A77A00A3800825A0000A00A2002253A07AAA00A3000225A00
A700095026666AAAA00009566325246570000762323255569000007763255699
00000000779977000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_exp1Click
end
object bt_limpar1: TSpeedButton
Left = 110
Top = 2
Width = 55
Height = 36
Hint = 'Limpar imagem'
Caption = 'Limpar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
56010000424D5601000000000000560000002800000010000000100000000100
08000000000000010000120B0000120B00000800000000000000FFFFFF0000FF
FF000000FF000000990000000000FFFFFF000000000000000000000000000000
0000000000000000000000020004040404040404040404040202000202040100
0100010001000102020000000202000100010001000102030000000000030200
0100010001020204000000000004020200010001020201040000000000040102
0200010202010004000000000004000102020202010001040000000000040100
0102020200010004000000000004000100020202020001040000000000040100
0202010002020004000000000004000202010001040202040000000000040202
0100010004010203000000000003020100010001040404020200000002020404
0404040404040000020200020200000000000000000000000002}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_limpar1Click
end
end
end
object Panel13: TPanel
Left = 2
Top = 2
Width = 219
Height = 12
Align = alTop
BevelOuter = bvNone
Caption = 'I m a g e m'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Verdana'
Font.Style = []
ParentColor = True
ParentFont = False
TabOrder = 1
end
object Panel21: TPanel
Left = 2
Top = 130
Width = 219
Height = 16
Align = alBottom
BevelOuter = bvNone
ParentColor = True
TabOrder = 2
object Label_size1: TLabel
Left = 198
Top = 0
Width = 21
Height = 16
Align = alRight
Alignment = taRightJustify
Caption = '0 kb'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object chk_view1: TCheckBox
Left = 5
Top = 2
Width = 104
Height = 13
Hint = 'Atualizar icone automaticamente'#13#10'na navega'#231#227'o dos registros'
Caption = 'Auto visualizar'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 0
OnClick = chk_view1Click
end
end
object Panelbtview: TPanel
Left = 159
Top = 14
Width = 62
Height = 116
Align = alRight
BevelOuter = bvLowered
Color = clWhite
TabOrder = 3
OnResize = PanelbtviewResize
object bt_view1: TSpeedButton
Left = 1
Top = 48
Width = 60
Height = 68
Hint = 'Ampliar imagem'
Caption = 'Ampliar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2030000424DB203000000000000360200002800000013000000130000000100
0800000000007C010000120B0000120B00008000000000000000FFFFFF00FFFF
F100F7FCFB00E4F7FA00DCF5EB00FFE7FF00FFE8BE00EAE4C100FCE1BF0084EB
C5008FE4C800A2DDCF00AEDACD0071E4B900FFD8B20078E0BF00FAD6AE00DFD7
B20078DBC700FED6AC00FDD7A70075DFBA00FFCFBB00BAD6B8006ADDB600EDCE
B900A1CFC90066DAB500FFCDA500E8C9BA00E2CFA900FFCC9900F6CC97005CCE
C000E6CB9900F0CA9400F5C994003DD69F00D6CA940032D59E0000D6AD00D6C8
930079CE9A00DEC68C0088CE8800CFC3930073C5910000CC9900C4C1770060C4
8800A5BA890080B8850060B791002EC4710058BB83003AB98C00B0AE850043B5
8D0080B47F0090B07A006BB37F0000BD8000AAB35D0081AF7B00999999008F92
B80050AB740000AF80008DAA5B009898880086B1380029A67E0043B14B007396
9200CC99660001A5750000A764003CA064006484A7005D995C00628A88002AA3
3B00009966000A976C0003925B00038D630000974200058574004C758E005672
9100646F8F001B7887003C7F5F00008B3E001C75720006863400008B24000289
2700078D130000795B003E6D65000A89150008871A002E5E920009821400006C
550099663300087B14000A7A16000F771800017A12000F751D00087312001048
8300006212002E4751003333330000333300FFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000767640404040404040404040404040404040
7600766A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A407600764A0000000000000000
0000000000006A407600764A00626C65686D666F656B627048006A407600764A
005252524C5B5E71574C4C5437006A407600764A0018150F0D2173581209181B
0A006A407600764A00000204055975410C1A000000006A407600764A00033947
4E5C515A67502C0B00006A407600764A000731696317464F6449615F01006A40
7600764A00292E38342535555672604406006A407600764A00263B36272F285D
603E301613006A407600764A001F324B2F2F2F3D6E4D1E1F0E006A407600764A
001C193A3C2A2F4354531D2411006A407600764A00242223233F3342452D202B
10006A407600764A00141313131313131313131308006A407600764A00000000
000000000000000000006A407600764A4A4A4A4A4A4A4A4A4A4A4A4A4A4A6A76
76007676767676767676767676767676767676767600}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_view1Click
end
object Panel30: TPanel
Left = 2
Top = 2
Width = 60
Height = 36
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object bt_imgRotateh1: TSpeedButton
Left = 1
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido hor'#225'rio'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B00000001000030000000FFFFFF00CCFF
FF0099FFFF00CCCCFF0099CCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCC
CC0099CCCC00CC99CC009999CC00FFCC9900CCCC990099CC990066CC990033CC
990000CC9900CC9999009999990066999900996699006666990033669900CCCC
660099CC660033CC6600CC99660099996600669966003399660000996600CC66
6600996666006666660033666600006666006633660066993300339933000099
3300996633006666330033663300006633006633330066660000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000009
090909090909090909030000000000000000092A221D1C221C1D211D1C220500
0000000000000922060F140F0F0F0F0F0F0D0300000000000000091C0A292929
2525292D1B090500000000000000091D0802070A181F0206040D080000000000
0000092200060A171E240C1000090500000000000000080108012D1F1F1A1F1F
060D0300000000000000090E140E27282012110F0E0905000000000000001413
14090F2D1212121D050D0800000000000000132322090E1E1B15190E0D090500
000000000000232B2309080508050809092B0900000000000000222E2B090D09
0B1E2B2F2E2C0E000000000000002B232E090508050E23262B261D0000000000
0000142B2B14000000000F2E2B2E230500000000000013232B2313090914222B
23162B09000000000000001D262B2B2B262B2B2B220009000000000000000009
1D232E2B2B262B1D0900000000000000000000000013142B231D140000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotateh1Click
end
object bt_imgRotatea1: TSpeedButton
Left = 31
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido anti-hor'#225'rio'
BiDiMode = bdLeftToRight
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B0000000100002F000000FFFFFF00CCFF
FF0099FFFF00CCCCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCCCC0099CC
CC0066CCCC00CC99CC00FFCC9900CCCC990099CC990066CC990033CC990000CC
9900CC999900999999006699990033999900996699006666990033669900CCCC
660099CC6600CC99660099996600669966003399660000996600CC6666009966
6600666666003366660000666600663366009999330033993300009933009966
3300666633003366330000663300663333006666000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000008
0808080808080808080300000000000000071C211B211B1C201C201C29080000
00000000000412060E0E0E0E0E0E0E081C080000000000000007071E2828242C
1F2828081C0800000000000000040D01090218170A0609011B08000000000000
00030C000A131E22140905002108000000000000000408051E1E0E2723280107
010700000000000000080C081A10111F28260D130D080000000000000004070C
0F1511112C0E0813121300000000000000070D070D190F1E1D0D082122120000
0000000000082A0808040707040708222A22000000000000000D2B2D2E2A1D0B
0C08082A2D21000000000000001C252A25220D040704082D222A000000000000
04222D2A2D0E00000000132A2A13000000000000082A16222A2113080812222A
2212000000000000000800212A2A2A252A2A2A251C0000000000000000000008
1C2A252A2A2D221C08000000000000000000000000131C222A13120000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ParentBiDiMode = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotatea1Click
end
object Label10: TLabel
Left = 19
Top = 23
Width = 25
Height = 12
Alignment = taCenter
Caption = 'Girar'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
ParentFont = False
Transparent = True
end
end
end
end
end
end
end
object Panel3: TPanel
Left = 1
Top = 310
Width = 559
Height = 27
Align = alBottom
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 1
object ToolBar2: TToolBar
Left = 329
Top = 2
Width = 228
Height = 23
Align = alRight
AutoSize = True
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
object bt_new1: TSpeedButton
Left = 0
Top = 2
Width = 75
Height = 22
Hint = 'Adicionar nova Regi'#227'o'
Caption = 'Novo'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B00004000000000000000835C36005A85
AD0000FF0000F2D4B100E1C9AB004E7BA60000CCFF009966660082FEFE009999
9900EDF1F100CCFFFF008A633D00AE885E008DA6BD003253760033CCFF00FDF1
DD00E1C7A300FBE9C400FEFCF100C6A584009E794D00B0B6B500FEF8EF00FDF0
D700E4D1BC00956E4700FEF6E600A5835F00FFFFFF00B8956A00FCEED00042D5
FE00E9D8C300E2D3B900FFF7DE00FEFAF600E4D3B900816039008B664000B18A
63008CAAC500537CA50095744D008F6B4300FEFCF700F4D3B200E9D8BD00FFFF
FF00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000313131313131
3131313131313131313131310000313131313131090909090909090909093131
00003131313131161B1B2D282828272700093131000031313131311D11111120
2013131300093131000031313131311D1C111111202020130009313100003131
3131310D1C1C1C111120202000093131000031313131312918181C1C11111120
0009313100003131313131291818181C1C111111000931310000313131313107
252518181C222204000931310000310605311E072E0E0B182315152C00093131
0000310A062B0807010B2E2E2614141200093131000031310B06100F081E1E2E
1A252F00093131310000312B2B101E100101012A1A0300093131313100001E1E
101E1E1E10080B1E1F1F173131313131000031312B101E100605313131313131
313131310000312B0831212B08062B3131313131313131310000310A31311E2B
310A063131313131313131310000313131311E31313131313131313131313131
0000}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_new1Click
end
object bt_del1: TSpeedButton
Left = 75
Top = 2
Width = 75
Height = 22
Hint = 'Excluir Regi'#227'o selecionada'
Caption = 'Excluir'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B0000400000000000000012148A0000FF
0000999999003130E4002E2CC5008485F3005B5BEF004240ED002326DF009495
F7006865F1003C3CCE005354F80017128B003B3BE7007976FB007372F7006668
F6003C3CEE00151587003333CC009B9DF5008588F100494AEE006869F7001115
8B003A42E6005D5FF3003F3ECA008D8FF50017158C002826DE003131C3009599
F8004447EF006866F5009999FF00FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000252525252525
2525252525252525252525250000252525252525252525252525252525252525
00002525252502132525252525250200252525250000252525021E101F252525
250213180425252500002525021910081F032525020D230E0920252500002525
250213061F0303021311120920252525000025252525021306030E0011120920
252525250000252525252502131B0E0E071D2025252525250000252525252525
02001112072025252525252500002525252525021E11120A2222142525252525
000025252525021E110E05141017170B2525252500002525250200110E052002
00100C0C0B252525000025250219100E1604252502130F0C210B252500002525
25021E1520252525250213211C252525000025252525021E2525252525250219
2525252500002525252525252525252525252525252525250000252525252525
2525252525252525252525250000252525252525252525252525252525252525
0000}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_del1Click
end
object bt_save1: TSpeedButton
Left = 150
Top = 2
Width = 78
Height = 22
Hint = 'Gravar dados'
Caption = 'Gravar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
1E020000424D1E02000000000000B60000002800000014000000120000000100
08000000000068010000120B0000120B00002000000000000000FFFFFF00FFF9
EC00EDEDED00F7ECD800F2E7D300F0E4D000EBD8B600D9C8AB00C7B49200C2AF
8D00BFAC8A00BAA78500B7A48200B4A17F0099999900AF9C7A00A18E6C008673
5100A06C4800806D4B006D5A38006E502F005C4927004E392100140D0000FFFF
FF00000000000000000000000000000000000000000000000000191919191919
1919191919191919191919191919191919191919190E0E0E0E0E0E0E0E0E0E0E
0E191919191919191217171515151515151717170E19191919191919120B0F00
0202020202160C170E19191919191919120B0F00130A000202160C170E191919
190E0E0E120A0D001413000202160C170E1919191217171512090D0000000000
00160C170E191919120B0F001208080C0C0C0C0C0C0C0C170E191919120B0F00
120801030303030405110C170E191919120A0D00120801030303030405110717
0E19191912090D001208010303030304051810170E1919191208080C12060101
0101010101140B170E1919191208010312121212121212121212121219191919
1208010303030304051107170E19191919191919120801030303030405181017
0E19191919191919120601010101010101140B170E1919191919191912121212
1212121212121212191919191919191919191919191919191919191919191919
1919}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_save1Click
end
end
end
end
object Panel12: TPanel
Left = 0
Top = 0
Width = 241
Height = 338
Align = alLeft
BevelOuter = bvNone
ParentColor = True
TabOrder = 1
object Lb_countreg1: TLabel
Left = 0
Top = 326
Width = 241
Height = 12
Align = alBottom
Alignment = taRightJustify
Caption = '0'
Transparent = True
end
object DBGrid1: TDBGrid
Left = 0
Top = 43
Width = 241
Height = 283
Align = alClient
Color = clWhite
FixedColor = 15066597
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
ParentFont = False
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clBlack
TitleFont.Height = -9
TitleFont.Name = 'Verdana'
TitleFont.Style = []
OnCellClick = DBGrid1CellClick
OnKeyDown = DBGrid1KeyDown
OnKeyUp = DBGrid1KeyUp
OnMouseDown = DBGrid1MouseDown
OnTitleClick = DBGrid1TitleClick
end
object Panelclass: TPanel
Left = 0
Top = 0
Width = 241
Height = 43
Align = alTop
BevelOuter = bvLowered
ParentColor = True
TabOrder = 1
OnResize = PanelclassResize
object Label9: TLabel
Left = 8
Top = 4
Width = 39
Height = 12
Caption = 'Estado:'
end
object ComboBox_class: TComboBox
Left = 6
Top = 19
Width = 226
Height = 20
ItemHeight = 12
TabOrder = 0
OnClick = ComboBox_classClick
OnKeyPress = ComboBox_classKeyPress
end
end
end
end
object TabSheet_itens: TTabSheet
Caption = 'Representantes'
ImageIndex = 1
object Splitter2: TSplitter
Left = 253
Top = 0
Height = 338
end
object Panel6: TPanel
Left = 256
Top = 0
Width = 549
Height = 338
Align = alClient
Color = 16119285
TabOrder = 0
object Panel7: TPanel
Left = 1
Top = 310
Width = 547
Height = 27
Align = alBottom
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 0
object ToolBar4: TToolBar
Left = 321
Top = 2
Width = 224
Height = 23
Align = alRight
AutoSize = True
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
object bt_new2: TSpeedButton
Left = 0
Top = 2
Width = 64
Height = 22
Hint = 'Adicionar novo Representante'
Caption = 'Nova'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B00004000000000000000835C36005A85
AD0000FF0000F2D4B100E1C9AB004E7BA60000CCFF009966660082FEFE009999
9900EDF1F100CCFFFF008A633D00AE885E008DA6BD003253760033CCFF00FDF1
DD00E1C7A300FBE9C400FEFCF100C6A584009E794D00B0B6B500FEF8EF00FDF0
D700E4D1BC00956E4700FEF6E600A5835F00FFFFFF00B8956A00FCEED00042D5
FE00E9D8C300E2D3B900FFF7DE00FEFAF600E4D3B900816039008B664000B18A
63008CAAC500537CA50095744D008F6B4300FEFCF700F4D3B200E9D8BD00FFFF
FF00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000313131313131
3131313131313131313131310000313131313131090909090909090909093131
00003131313131161B1B2D282828272700093131000031313131311D11111120
2013131300093131000031313131311D1C111111202020130009313100003131
3131310D1C1C1C111120202000093131000031313131312918181C1C11111120
0009313100003131313131291818181C1C111111000931310000313131313107
252518181C222204000931310000310605311E072E0E0B182315152C00093131
0000310A062B0807010B2E2E2614141200093131000031310B06100F081E1E2E
1A252F00093131310000312B2B101E100101012A1A0300093131313100001E1E
101E1E1E10080B1E1F1F173131313131000031312B101E100605313131313131
313131310000312B0831212B08062B3131313131313131310000310A31311E2B
310A063131313131313131310000313131311E31313131313131313131313131
0000}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_new2Click
end
object bt_del2: TComboSpeedButton
Left = 64
Top = 2
Width = 82
Height = 22
Hint = 'Excluir representante selecionado'
PopupMenu = PopupMenu2
Caption = 'Excluir'
Flat = True
Glyph.Data = {
9E020000424D9E02000000000000360100002800000012000000120000000100
08000000000068010000120B0000120B0000400000000000000012148A0000FF
0000999999003130E4002E2CC5008485F3005B5BEF004240ED002326DF009495
F7006865F1003C3CCE005354F80017128B003B3BE7007976FB007372F7006668
F6003C3CEE00151587003333CC009B9DF5008588F100494AEE006869F7001115
8B003A42E6005D5FF3003F3ECA008D8FF50017158C002826DE003131C3009599
F8004447EF006866F5009999FF00FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000252525252525
2525252525252525252525250000252525252525252525252525252525252525
00002525252502132525252525250200252525250000252525021E101F252525
250213180425252500002525021910081F032525020D230E0920252500002525
250213061F0303021311120920252525000025252525021306030E0011120920
252525250000252525252502131B0E0E071D2025252525250000252525252525
02001112072025252525252500002525252525021E11120A2222142525252525
000025252525021E110E05141017170B2525252500002525250200110E052002
00100C0C0B252525000025250219100E1604252502130F0C210B252500002525
25021E1520252525250213211C252525000025252525021E2525252525250219
2525252500002525252525252525252525252525252525250000252525252525
2525252525252525252525250000252525252525252525252525252525252525
0000}
OnClick = bt_del2Click
end
object bt_save2: TSpeedButton
Left = 146
Top = 2
Width = 78
Height = 22
Hint = 'Gravar dados'
Caption = 'Gravar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
1E020000424D1E02000000000000B60000002800000014000000120000000100
08000000000068010000120B0000120B00002000000000000000FFFFFF00FFF9
EC00EDEDED00F7ECD800F2E7D300F0E4D000EBD8B600D9C8AB00C7B49200C2AF
8D00BFAC8A00BAA78500B7A48200B4A17F0099999900AF9C7A00A18E6C008673
5100A06C4800806D4B006D5A38006E502F005C4927004E392100140D0000FFFF
FF00000000000000000000000000000000000000000000000000191919191919
1919191919191919191919191919191919191919190E0E0E0E0E0E0E0E0E0E0E
0E191919191919191217171515151515151717170E19191919191919120B0F00
0202020202160C170E19191919191919120B0F00130A000202160C170E191919
190E0E0E120A0D001413000202160C170E1919191217171512090D0000000000
00160C170E191919120B0F001208080C0C0C0C0C0C0C0C170E191919120B0F00
120801030303030405110C170E191919120A0D00120801030303030405110717
0E19191912090D001208010303030304051810170E1919191208080C12060101
0101010101140B170E1919191208010312121212121212121212121219191919
1208010303030304051107170E19191919191919120801030303030405181017
0E19191919191919120601010101010101140B170E1919191919191912121212
1212121212121212191919191919191919191919191919191919191919191919
1919}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_save2Click
end
end
end
object Panel9: TPanel
Left = 1
Top = 1
Width = 547
Height = 309
Align = alClient
BevelOuter = bvNone
Color = 16119285
TabOrder = 1
object Panelitens: TPanel
Left = 0
Top = 0
Width = 547
Height = 309
Align = alClient
BevelInner = bvRaised
BevelOuter = bvLowered
Color = 16119285
TabOrder = 0
object Splitter5: TSplitter
Left = 2
Top = 154
Width = 543
Height = 3
Cursor = crVSplit
Align = alTop
end
object GroupBox1: TGroupBox
Left = 2
Top = 157
Width = 543
Height = 150
Align = alClient
Caption = 'Detalhes:'
TabOrder = 0
object re_editor2: TRxRichEdit
Left = 2
Top = 14
Width = 539
Height = 134
Align = alClient
Lines.Strings = (
'accessing...')
PopupMenu = PopupMenu_editor
TabOrder = 0
OnKeyDown = re_editorKeyDown
OnSelectionChange = SelectionChange
end
end
object Panel24: TPanel
Left = 2
Top = 2
Width = 543
Height = 152
Align = alTop
BevelOuter = bvNone
ParentColor = True
TabOrder = 1
object Panel18: TPanel
Left = 0
Top = 0
Width = 313
Height = 152
Align = alLeft
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object Label8: TLabel
Left = 15
Top = 38
Width = 115
Height = 12
Alignment = taRightJustify
Caption = 'Raz'#227'o Social/Fantasia:'
end
object Label6: TLabel
Left = 17
Top = 8
Width = 39
Height = 12
Alignment = taRightJustify
Caption = 'C'#243'digo:'
end
object ms_cod: TLabel
Left = 59
Top = 8
Width = 6
Height = 12
Caption = '0'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object ms_titulo: TEdit
Left = 16
Top = 52
Width = 289
Height = 20
TabOrder = 0
OnKeyDown = EVsave2KeyDown
end
object CoolBar1: TCoolBar
Left = 0
Top = 98
Width = 313
Height = 54
Align = alBottom
AutoSize = True
Bands = <
item
Control = ToolBar6
ImageIndex = -1
Width = 220
end
item
Break = False
Control = ToolBar11
ImageIndex = -1
Width = 91
end
item
Control = ToolBar8
ImageIndex = -1
Width = 86
end
item
Break = False
Control = ToolBar9
ImageIndex = -1
Width = 132
end
item
Break = False
Control = ToolBar10
ImageIndex = -1
Width = 91
end>
EdgeBorders = [ebTop]
object ToolBar6: TToolBar
Left = 9
Top = 0
Width = 207
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
Transparent = True
Wrapable = False
object FontName2: TComboBox
Left = 4
Top = 1
Width = 146
Height = 20
Hint = 'Selecione a fonte'
Ctl3D = False
DropDownCount = 10
ItemHeight = 12
ItemIndex = 0
ParentCtl3D = False
TabOrder = 0
Text = 'Arial'
OnChange = FontNameChange
Items.Strings = (
'Arial'
'Arial Narrow'
'Arial Black'
'Comic Scans MS'
'Courier'
'System'
'Times New Roman'
'Verdana'
'Wingdings')
end
object ToolButton1: TToolButton
Left = 150
Top = 0
Width = 8
ImageIndex = 8
Style = tbsSeparator
end
object FontSize2: TEdit
Left = 158
Top = 0
Width = 30
Height = 22
Hint = 'Selecione o tamanho da fonte'
TabOrder = 1
Text = '12'
OnChange = FontSizeChange
end
object UpDown2: TUpDown
Left = 188
Top = 0
Width = 16
Height = 22
Associate = FontSize2
Max = 150
Increment = 5
Position = 12
TabOrder = 2
end
end
object ToolBar8: TToolBar
Left = 9
Top = 27
Width = 73
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 1
Transparent = True
Wrapable = False
object BoldButton2: TToolButton
Left = 4
Top = 0
Caption = 'Negrito'
ImageIndex = 13
MenuItem = Negrito1
Style = tbsCheck
end
object ItalicButton2: TToolButton
Left = 27
Top = 0
Caption = 'It'#225'lico'
ImageIndex = 15
MenuItem = Italico1
Style = tbsCheck
end
object UnderlineButton2: TToolButton
Left = 50
Top = 0
Caption = 'Sublinhado'
ImageIndex = 16
MenuItem = Sublinhado1
Style = tbsCheck
end
end
object ToolBar9: TToolBar
Left = 97
Top = 27
Width = 119
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 2
Transparent = True
Wrapable = False
object LeftAlign2: TToolButton
Left = 4
Top = 0
Caption = 'esquerdo'
Grouped = True
ImageIndex = 17
Style = tbsCheck
OnClick = AlignButtonClick
end
object CenterAlign2: TToolButton
Tag = 2
Left = 27
Top = 0
Caption = 'centro'
Grouped = True
ImageIndex = 18
Style = tbsCheck
OnClick = AlignButtonClick
end
object RightAlign2: TToolButton
Tag = 1
Left = 50
Top = 0
Caption = 'direita'
Grouped = True
ImageIndex = 19
Style = tbsCheck
OnClick = AlignButtonClick
end
object JustifyAlign2: TToolButton
Tag = 3
Left = 73
Top = 0
Caption = 'justificado'
Grouped = True
ImageIndex = 20
Style = tbsCheck
OnClick = AlignButtonClick
end
object BulletsButton2: TToolButton
Left = 96
Top = 0
Caption = 'Marcador'
ImageIndex = 21
MenuItem = Marcador1
Style = tbsCheck
end
end
object ToolBar10: TToolBar
Left = 231
Top = 27
Width = 78
Height = 25
Align = alClient
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 3
Transparent = True
Wrapable = False
object ToolButton10: TToolButton
Left = 4
Top = 0
Caption = 'Recortar'
ImageIndex = 6
MenuItem = Recortar1
end
object ToolButton11: TToolButton
Left = 27
Top = 0
Caption = 'Copiar'
ImageIndex = 7
MenuItem = Copiar1
end
object ToolButton12: TToolButton
Left = 50
Top = 0
Caption = 'Colar'
ImageIndex = 8
MenuItem = Colar1
end
end
object ToolBar11: TToolBar
Left = 231
Top = 0
Width = 78
Height = 25
Align = alClient
AutoSize = True
Color = 16119285
EdgeBorders = []
Flat = True
Images = ToolbarImages
Indent = 4
ParentColor = False
ParentShowHint = False
ShowHint = True
TabOrder = 4
Transparent = True
Wrapable = False
object fontColor2: TToolButton
Left = 4
Top = 0
Caption = 'Cor'
ImageIndex = 10
MenuItem = Cor1
end
object eddesfazer2: TToolButton
Left = 27
Top = 0
Caption = 'Desfazer'
ImageIndex = 4
MenuItem = Desfazer1
end
object colorfnd2: TToolButton
Left = 50
Top = 0
Caption = 'Cor de fundo'
ImageIndex = 12
MenuItem = Cordefundo1
end
end
end
end
object Panel10: TPanel
Left = 313
Top = 0
Width = 230
Height = 152
Align = alClient
BevelInner = bvLowered
BevelOuter = bvSpace
BorderStyle = bsSingle
Color = 16119285
TabOrder = 1
object Panel14: TPanel
Left = 2
Top = 131
Width = 222
Height = 15
Align = alBottom
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object Label_size2: TLabel
Left = 201
Top = 0
Width = 21
Height = 15
Align = alRight
Caption = '0 kb'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
end
object chk_view2: TCheckBox
Left = 5
Top = 2
Width = 104
Height = 13
Hint = 'Atualizar icone automaticamente'#13#10'na navega'#231#227'o dos registros'
Caption = 'Auto visualizar'
Checked = True
ParentShowHint = False
ShowHint = True
State = cbChecked
TabOrder = 0
OnClick = chk_view2Click
end
end
object Panel31: TPanel
Left = 2
Top = 14
Width = 160
Height = 117
Align = alClient
AutoSize = True
BevelInner = bvLowered
BevelOuter = bvLowered
Color = clWhite
TabOrder = 1
object swf_logo2: TShockwaveFlash
Left = 2
Top = 40
Width = 156
Height = 75
Cursor = crHandPoint
Hint = 'Icone da imagem'
TabStop = False
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
Visible = False
ControlData = {
675566550009000020100000C007000008000200000000000800000000000800
0000000008000E000000570069006E0064006F00770000000800060000002D00
310000000800060000002D003100000008000A00000048006900670068000000
08000200000000000800060000002D0031000000080000000000080002000000
0000080010000000530068006F00770041006C006C0000000800040000003000
0000080004000000300000000800020000000000080000000000080002000000
00000D0000000000000000000000000000000000080004000000310000000800
0400000030000000080000000000080004000000300000000800080000006100
6C006C00000008000C000000660061006C00730065000000}
end
object ToolBar1: TToolBar
Left = 2
Top = 2
Width = 156
Height = 38
AutoSize = True
ButtonHeight = 36
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
object bt_open2: TSpeedButton
Left = 0
Top = 2
Width = 55
Height = 36
Hint = 'Importar imagem'
Caption = 'Importar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6030000424DE603000000000000360200002800000017000000120000000100
080000000000B0010000120B0000120B00008000000000000000FFFFFF00D0FA
FF00CEFBFE00CEFAFE00B7FCFF00CDFAFD0092FAFF0091FAFF0092F9FF0091F9
FF0096F8FF0091F9FE0094F9FE0090F8FD00A9F1FF008AF2FE00A6F0FF0086F2
FE0088F2FD0087F0FE0088F0FF0087EFFE0085EEFF0088EEFF0087EEFF0086EC
FF0083EAFF0085E9FF007CE7FE007BE7FE007DE7FF007FE7FF00A1E6F5007EE7
FD007DE7FE007DE6FD00FFE8CB007AE6FE0078E7FC007BE6FF007DE6FF007DE6
FE007BE6FE0080E5FF007DE5FE007CE5FE007CE4FE007EE5FE007CE5FF0074DD
FE0072DDFF0075DDFE0073DDFE0076DCFF0073DCFF0074DCFE00BDD8E40075DA
EC00FFD9A90065CBE00064C9E1005EC4E00052BBE40067B7DD0083B4C800B7B5
B200B4B0AD0066C582005DACD40000D16E0049ACCC0042A8CC003199CE00319A
CB003399CE003399CD003597CD0066B066002D92C6002C92C30000AF42002287
BB002187B8002187BB002489B400288F8D00009F2F00009E2C001275A7006D6D
6C006767670065666A0003649300646667006567670068666600666765006467
6500646666006665670065646600007C000002466700114053000B2D62000000
0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000006A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A006A6A6A6A6A6A4242424242424242
4242424242426A6A6A006A6A6A6A6A405B5B5B5B5B5B5B5B5B5B5B595C426A6A
6A006A6A6A6A6A5C3C1A2121212121212121093958426A6A6A006A6A6A6A4054
08080808080808080808084658426A6A6A006A6A6A6A5C3B0F0F0F0F0F0F0F0F
0F1818585C426A6A6A006A6A6A4054132A2A2A2A2A2A2A2A2A16476766426A6A
6A006A6A6A5C3D2F33333333333333333333583869426A6A6A006A6A40540404
0404040404040404043E55000069416A6A006A6A5C5353535353535353535353
535856000000696A6A006A6A6A6A6A53196900003A4550506857004300696A6A
6A006A6A6A6A6A4E1919690024564550574D000069426A6A6A006A6A6A6A6A4B
201B1B6900245665574D00695C426A6A6A006A6A6A6A6A4810031E1E6900243A
24006952526A6A6A6A006A6A6A6A6A443F0E05050569002400696A6A6A6A6A6A
6A006A6A6A6A6A6A44494C4C4F6A6900696A6A6A6A6A6A6A6A006A6A6A6A6A6A
6A6A6A6A6A6A6A696A6A6A6A6A6A6A6A6A006A6A6A6A6A6A6A6A6A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_open2Click
end
object bt_exp2: TSpeedButton
Left = 55
Top = 2
Width = 55
Height = 36
Hint = 'Exportar para disco'
Caption = 'Exportar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6000000424DE6000000000000007600000028000000100000000E0000000100
04000000000070000000120B0000120B00001000000000000000FFFFFF00CC99
FF00FFFFCC00FFCCCC00CCCCCC00FFCC9900FF99990099999900000099006666
66003333330000000000FFFFFF0000000000000000000000000000079BBBBB70
00000079642544770000075200225AAAAAA00A2002253A0777A00A3000825A00
00A00A2088881A0A77A00A3800825A0000A00A2002253A07AAA00A3000225A00
A700095026666AAAA00009566325246570000762323255569000007763255699
00000000779977000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_exp2Click
end
object bt_limpar2: TSpeedButton
Left = 110
Top = 2
Width = 55
Height = 36
Hint = 'Limpar imagem'
Caption = 'Limpar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
56010000424D5601000000000000560000002800000010000000100000000100
08000000000000010000120B0000120B00000800000000000000FFFFFF0000FF
FF000000FF000000990000000000FFFFFF000000000000000000000000000000
0000000000000000000000020004040404040404040404040202000202040100
0100010001000102020000000202000100010001000102030000000000030200
0100010001020204000000000004020200010001020201040000000000040102
0200010202010004000000000004000102020202010001040000000000040100
0102020200010004000000000004000100020202020001040000000000040100
0202010002020004000000000004000202010001040202040000000000040202
0100010004010203000000000003020100010001040404020200000002020404
0404040404040000020200020200000000000000000000000002}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_limpar2Click
end
end
end
object Panel32: TPanel
Left = 2
Top = 2
Width = 222
Height = 12
Align = alTop
BevelOuter = bvNone
Caption = 'L o g o m a r c a'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Verdana'
Font.Style = []
ParentColor = True
ParentFont = False
TabOrder = 2
end
object Panelbtview2: TPanel
Left = 162
Top = 14
Width = 62
Height = 117
Align = alRight
BevelOuter = bvLowered
Color = clWhite
TabOrder = 3
OnResize = Panelbtview2Resize
object bt_view2: TSpeedButton
Left = 1
Top = 48
Width = 60
Height = 67
Hint = 'Ampliar imagem'
Caption = 'Ampliar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2030000424DB203000000000000360200002800000013000000130000000100
0800000000007C010000120B0000120B00008000000000000000FFFFFF00FFFF
F100F7FCFB00E4F7FA00DCF5EB00FFE7FF00FFE8BE00EAE4C100FCE1BF0084EB
C5008FE4C800A2DDCF00AEDACD0071E4B900FFD8B20078E0BF00FAD6AE00DFD7
B20078DBC700FED6AC00FDD7A70075DFBA00FFCFBB00BAD6B8006ADDB600EDCE
B900A1CFC90066DAB500FFCDA500E8C9BA00E2CFA900FFCC9900F6CC97005CCE
C000E6CB9900F0CA9400F5C994003DD69F00D6CA940032D59E0000D6AD00D6C8
930079CE9A00DEC68C0088CE8800CFC3930073C5910000CC9900C4C1770060C4
8800A5BA890080B8850060B791002EC4710058BB83003AB98C00B0AE850043B5
8D0080B47F0090B07A006BB37F0000BD8000AAB35D0081AF7B00999999008F92
B80050AB740000AF80008DAA5B009898880086B1380029A67E0043B14B007396
9200CC99660001A5750000A764003CA064006484A7005D995C00628A88002AA3
3B00009966000A976C0003925B00038D630000974200058574004C758E005672
9100646F8F001B7887003C7F5F00008B3E001C75720006863400008B24000289
2700078D130000795B003E6D65000A89150008871A002E5E920009821400006C
550099663300087B14000A7A16000F771800017A12000F751D00087312001048
8300006212002E4751003333330000333300FFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000767640404040404040404040404040404040
7600766A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A407600764A0000000000000000
0000000000006A407600764A00626C65686D666F656B627048006A407600764A
005252524C5B5E71574C4C5437006A407600764A0018150F0D2173581209181B
0A006A407600764A00000204055975410C1A000000006A407600764A00033947
4E5C515A67502C0B00006A407600764A000731696317464F6449615F01006A40
7600764A00292E38342535555672604406006A407600764A00263B36272F285D
603E301613006A407600764A001F324B2F2F2F3D6E4D1E1F0E006A407600764A
001C193A3C2A2F4354531D2411006A407600764A00242223233F3342452D202B
10006A407600764A00141313131313131313131308006A407600764A00000000
000000000000000000006A407600764A4A4A4A4A4A4A4A4A4A4A4A4A4A4A6A76
76007676767676767676767676767676767676767600}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_view2Click
end
object Panel33: TPanel
Left = 2
Top = 2
Width = 60
Height = 36
BevelOuter = bvNone
ParentColor = True
TabOrder = 0
object bt_imgRotateh2: TSpeedButton
Left = 1
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido hor'#225'rio'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B00000001000030000000FFFFFF00CCFF
FF0099FFFF00CCCCFF0099CCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCC
CC0099CCCC00CC99CC009999CC00FFCC9900CCCC990099CC990066CC990033CC
990000CC9900CC9999009999990066999900996699006666990033669900CCCC
660099CC660033CC6600CC99660099996600669966003399660000996600CC66
6600996666006666660033666600006666006633660066993300339933000099
3300996633006666330033663300006633006633330066660000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000009
090909090909090909030000000000000000092A221D1C221C1D211D1C220500
0000000000000922060F140F0F0F0F0F0F0D0300000000000000091C0A292929
2525292D1B090500000000000000091D0802070A181F0206040D080000000000
0000092200060A171E240C1000090500000000000000080108012D1F1F1A1F1F
060D0300000000000000090E140E27282012110F0E0905000000000000001413
14090F2D1212121D050D0800000000000000132322090E1E1B15190E0D090500
000000000000232B2309080508050809092B0900000000000000222E2B090D09
0B1E2B2F2E2C0E000000000000002B232E090508050E23262B261D0000000000
0000142B2B14000000000F2E2B2E230500000000000013232B2313090914222B
23162B09000000000000001D262B2B2B262B2B2B220009000000000000000009
1D232E2B2B262B1D0900000000000000000000000013142B231D140000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotateh2Click
end
object bt_imgRotatea2: TSpeedButton
Left = 31
Top = -1
Width = 29
Height = 25
Hint = 'Girar imagem no sentido anti-hor'#225'rio'
BiDiMode = bdLeftToRight
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
B2050000424DB205000000000000360400002800000013000000130000000100
0800000000007C010000120B0000120B0000000100002F000000FFFFFF00CCFF
FF0099FFFF00CCCCFF00FFFFCC00CCFFCC0099FFCC00FFCCCC00CCCCCC0099CC
CC0066CCCC00CC99CC00FFCC9900CCCC990099CC990066CC990033CC990000CC
9900CC999900999999006699990033999900996699006666990033669900CCCC
660099CC6600CC99660099996600669966003399660000996600CC6666009966
6600666666003366660000666600663366009999330033993300009933009966
3300666633003366330000663300663333006666000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000008
0808080808080808080300000000000000071C211B211B1C201C201C29080000
00000000000412060E0E0E0E0E0E0E081C080000000000000007071E2828242C
1F2828081C0800000000000000040D01090218170A0609011B08000000000000
00030C000A131E22140905002108000000000000000408051E1E0E2723280107
010700000000000000080C081A10111F28260D130D080000000000000004070C
0F1511112C0E0813121300000000000000070D070D190F1E1D0D082122120000
0000000000082A0808040707040708222A22000000000000000D2B2D2E2A1D0B
0C08082A2D21000000000000001C252A25220D040704082D222A000000000000
04222D2A2D0E00000000132A2A13000000000000082A16222A2113080812222A
2212000000000000000800212A2A2A252A2A2A251C0000000000000000000008
1C2A252A2A2D221C08000000000000000000000000131C222A13120000000000
00000000000000000000000000000000000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ParentBiDiMode = False
ShowHint = True
Spacing = 0
OnClick = bt_imgRotatea2Click
end
object Label12: TLabel
Left = 19
Top = 23
Width = 25
Height = 12
Alignment = taCenter
Caption = 'Girar'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
ParentFont = False
Transparent = True
end
end
end
end
end
end
end
end
object Panel15: TPanel
Left = 0
Top = 0
Width = 253
Height = 338
Align = alLeft
BevelOuter = bvNone
ParentBackground = True
ParentColor = True
TabOrder = 1
object Lb_countreg2: TLabel
Left = 0
Top = 326
Width = 253
Height = 12
Align = alBottom
Alignment = taRightJustify
Caption = '0'
Transparent = True
end
object DBGrid2: TDBGrid
Left = 0
Top = 29
Width = 253
Height = 255
Align = alClient
Color = clWhite
FixedColor = 15066597
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgConfirmDelete, dgCancelOnExit]
ParentFont = False
TabOrder = 0
TitleFont.Charset = DEFAULT_CHARSET
TitleFont.Color = clBlack
TitleFont.Height = -9
TitleFont.Name = 'Verdana'
TitleFont.Style = []
OnCellClick = DBGrid2CellClick
OnKeyDown = DBGrid2KeyDown
OnKeyUp = DBGrid2KeyUp
OnMouseDown = DBGrid2MouseDown
OnTitleClick = DBGrid2TitleClick
end
object ToolBar_grp: TToolBar
Left = 0
Top = 0
Width = 253
Height = 29
ButtonHeight = 20
Caption = 'ToolBar_grp'
TabOrder = 1
OnResize = ToolBar_grpResize
object Label4: TLabel
Left = 0
Top = 2
Width = 46
Height = 20
Align = alRight
AutoSize = False
Caption = ' Regi'#227'o:'
Layout = tlCenter
end
object cb_group: TComboBox
Left = 46
Top = 2
Width = 202
Height = 20
ItemHeight = 12
TabOrder = 0
OnChange = cb_groupChange
end
end
object ToolBar18: TToolBar
Left = 0
Top = 284
Width = 253
Height = 42
Align = alBottom
AutoSize = True
ButtonHeight = 40
Caption = 'pn_barra'
EdgeBorders = []
Enabled = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 2
Visible = False
object bt_recursive: TSpeedButton
Left = 0
Top = 2
Width = 124
Height = 40
Hint = 'Inclus'#227'o recursiva de imagens'
Caption = 'Importar Pastas'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
1E020000424D1E02000000000000B60000002800000014000000120000000100
08000000000068010000120B0000120B0000200000000000000066330000C0A9
930000FF000099663300FAF5EF00F4E2BE00F6EAD3006D5A4B00FFFFFF00F9F1
E500F6E8CE00FBF8F700F5E5C500F8EEDF00FFF7EF00FCF7F700F7EDD800F4E3
BF00C1AA9000FFFFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000131313131313
1313131313131313131303001313030303030303030303030303131313030303
0013030B0B04090D10100C0C05031313030303030300030B0404070000000C0C
05031313131303001313030B0B040900120A0A0C11031313131303001313030B
0B04040D00120A0C0C031313131303001313030B0B0B000000070A0A0C031313
13130300131303080B0B04040D0D06060C0313131313030013130308080B0B04
090D06060C031313131303001313030303030303030303030303131313130300
13130308080808080808080808031313131303001313030B0404001006000C0C
05031313131303001313030B0B04000000000C0C11031313131303001313030B
0B04000D0D000A0C0C031313131303001313030B0B0B010000120A0A0C031313
13130300131303080B0B04040D0D06060C0313131313030013130308080B0B04
090D06060C031313131303001313030303030303030303030303131313130300
1313}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = bt_recursiveClick
end
object SpeedButton2: TSpeedButton
Left = 124
Top = 2
Width = 124
Height = 40
Hint = 'Exportar todas as imagens para Pasta'
Caption = 'Exportar Itens'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
4E010000424D4E01000000000000760000002800000012000000120000000100
040000000000D8000000120B0000120B00001000000000000000FFFFFF0099FF
FF0099FFCC00FFECCC00DDDDDD00D7D7D700FFCC990086868600555555000000
0000FFFFFF000000000000000000000000000000000000000000000000000009
9999990000000000000009983666690000000000000008283666690000000000
0009982836666900000089999998182836666900000084544448182836666900
0000844445481828333339000000854444481828888888000000844454481822
2229000000008454444818888888000000008444544811111900000000008444
4448888888000000000087777454450900000000000080000444440900000000
0000080004454409000000000000008004444409000000000000000800000009
000000000000000088888889000000000000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
Spacing = 0
OnClick = SpeedButton2Click
end
end
end
end
end
end
object TabSheet2: TTabSheet
Caption = 'Personaliza'#231#245'es'
ImageIndex = 1
object GroupBox3: TGroupBox
Left = 0
Top = 0
Width = 813
Height = 43
Align = alTop
Caption = 'Textos do m'#243'dulo:'
TabOrder = 0
object cfg_cod: TLabel
Left = 707
Top = 0
Width = 7
Height = 12
Alignment = taRightJustify
Caption = '0'
Transparent = True
end
object Label22: TLabel
Left = 9
Top = 20
Width = 33
Height = 12
Alignment = taRightJustify
Caption = 'Texto:'
end
object cfg_title: TEdit
Left = 46
Top = 16
Width = 665
Height = 20
MaxLength = 255
TabOrder = 0
end
end
object GroupBox4: TGroupBox
Left = 0
Top = 258
Width = 813
Height = 108
Align = alBottom
Caption = 'Configura'#231#245'es:'
TabOrder = 1
object GroupBox5: TGroupBox
Left = 2
Top = 14
Width = 357
Height = 92
Align = alLeft
Caption = 'Lista de '#225'lbuns:'
TabOrder = 0
object Label14: TLabel
Left = 8
Top = 17
Width = 121
Height = 12
Caption = 'Forma de apresenta'#231#227'o:'
end
object Label17: TLabel
Left = 8
Top = 35
Width = 55
Height = 12
Caption = 'Descri'#231#227'o:'
end
object Label18: TLabel
Left = 184
Top = 35
Width = 49
Height = 12
Caption = 'Detalhes:'
end
object cp1_0: TRadioButton
Left = 144
Top = 16
Width = 48
Height = 17
Caption = 'Lista'
Checked = True
TabOrder = 0
TabStop = True
end
object cp1_1: TRadioButton
Left = 200
Top = 16
Width = 58
Height = 17
Caption = 'Icones'
TabOrder = 1
end
object cp3: TCheckBox
Left = 8
Top = 72
Width = 167
Height = 14
Caption = 'Exibir descri'#231#227'o ao acessar'
Checked = True
State = cbChecked
TabOrder = 2
end
object cp5: TCheckBox
Left = 182
Top = 72
Width = 164
Height = 14
Caption = 'Exibir detalhes ao acessar'
TabOrder = 3
end
object cp2: TComboBox
Left = 8
Top = 49
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 1
TabOrder = 4
Text = 'Superior'
Items.Strings = (
'Nenhum'
'Superior'
'Inferior'
'Hint')
end
object cp4: TComboBox
Left = 182
Top = 49
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 1
TabOrder = 5
Text = 'Vis'#237'vel'
Items.Strings = (
'Nenhum'
'Vis'#237'vel'
'Bot'#227'o'
'Hint')
end
end
object GroupBox6: TGroupBox
Left = 359
Top = 14
Width = 452
Height = 92
Align = alClient
Caption = 'Banco de imagens:'
TabOrder = 1
object Label15: TLabel
Left = 8
Top = 17
Width = 121
Height = 12
Caption = 'Forma de apresenta'#231#227'o:'
end
object Label19: TLabel
Left = 184
Top = 35
Width = 49
Height = 12
Caption = 'Detalhes:'
end
object Label20: TLabel
Left = 8
Top = 35
Width = 55
Height = 12
Caption = 'Descri'#231#227'o:'
end
object cp6_0: TRadioButton
Left = 134
Top = 16
Width = 48
Height = 17
Caption = 'Lista'
TabOrder = 0
end
object cp6_1: TRadioButton
Left = 190
Top = 16
Width = 58
Height = 17
Caption = 'Icones'
Checked = True
TabOrder = 1
TabStop = True
end
object cp7: TComboBox
Left = 8
Top = 49
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 2
TabOrder = 2
Text = 'Inferior'
Items.Strings = (
'Nenhum'
'Superior'
'Inferior'
'Hint')
end
object cp9: TComboBox
Left = 182
Top = 49
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 0
TabOrder = 3
Text = 'Nenhum'
Items.Strings = (
'Nenhum'
'Vis'#237'vel'
'Bot'#227'o'
'Hint')
end
object cp8: TCheckBox
Left = 8
Top = 72
Width = 167
Height = 14
Caption = 'Exibir descri'#231#227'o ao acessar'
Checked = True
State = cbChecked
TabOrder = 4
end
object cp10: TCheckBox
Left = 182
Top = 72
Width = 164
Height = 14
Caption = 'Exibir detalhes ao acessar'
TabOrder = 5
end
object CheckBox1: TCheckBox
Left = 259
Top = 17
Width = 88
Height = 15
Caption = 'Incluir busca'
Checked = True
State = cbChecked
TabOrder = 6
end
object CheckBox2: TCheckBox
Left = 259
Top = 33
Width = 88
Height = 15
Caption = 'Salvar como'
Checked = True
State = cbChecked
TabOrder = 7
end
end
end
object GroupBox7: TGroupBox
Left = 0
Top = 43
Width = 813
Height = 215
Align = alClient
Caption = 'Banner:'
TabOrder = 2
object Label_size_pers: TLabel
Left = 707
Top = 0
Width = 7
Height = 12
Alignment = taRightJustify
Caption = '0'
Transparent = True
end
object swf_banner: TShockwaveFlash
Left = 2
Top = 14
Width = 580
Height = 199
Cursor = crHandPoint
Hint = 'Icone do '#225'lbum'
TabStop = False
Align = alClient
ParentShowHint = False
ShowHint = True
TabOrder = 0
ControlData = {
6755665510070000413C00008816000008000200000000000800000000000800
0000000008000E000000570069006E0064006F00770000000B00FFFF0B00FFFF
08000A0000004800690067006800000008000200000000000B00FFFF08000200
0000000008000E00000061006C00770061007900730000000800100000005300
68006F00770041006C006C0000000B0000000B00000008000200000000000800
02000000000008000200000000000D0000000000000000000000000000000000
0B0001000B00000008000000000003000000000008000800000061006C006C00
000008000C000000660061006C00730065000000}
end
object Panel17: TPanel
Left = 582
Top = 14
Width = 229
Height = 199
Align = alRight
BevelOuter = bvNone
Color = 16119285
TabOrder = 1
object Label21: TLabel
Left = 18
Top = 21
Width = 33
Height = 12
Caption = 'Estilo:'
end
object Label1: TLabel
Left = 8
Top = 45
Width = 44
Height = 12
Caption = 'Posi'#231#227'o:'
end
object cp14: TComboBox
Left = 56
Top = 16
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 0
TabOrder = 2
Text = 'Auto ajustar proporcional'
Items.Strings = (
'Auto ajustar proporcional'
'Auto ajustar esticado'
'Manter tamanho original')
end
object ToolBar7: TToolBar
Left = 0
Top = 175
Width = 229
Height = 24
Align = alBottom
AutoSize = True
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 1
object bt_open_pers: TSpeedButton
Left = 0
Top = 2
Width = 124
Height = 22
Hint = 'Importar imagem'
Caption = '&Importar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
E6030000424DE603000000000000360200002800000017000000120000000100
080000000000B0010000120B0000120B00008000000000000000FFFFFF00D0FA
FF00CEFBFE00CEFAFE00B7FCFF00CDFAFD0092FAFF0091FAFF0092F9FF0091F9
FF0096F8FF0091F9FE0094F9FE0090F8FD00A9F1FF008AF2FE00A6F0FF0086F2
FE0088F2FD0087F0FE0088F0FF0087EFFE0085EEFF0088EEFF0087EEFF0086EC
FF0083EAFF0085E9FF007CE7FE007BE7FE007DE7FF007FE7FF00A1E6F5007EE7
FD007DE7FE007DE6FD00FFE8CB007AE6FE0078E7FC007BE6FF007DE6FF007DE6
FE007BE6FE0080E5FF007DE5FE007CE5FE007CE4FE007EE5FE007CE5FF0074DD
FE0072DDFF0075DDFE0073DDFE0076DCFF0073DCFF0074DCFE00BDD8E40075DA
EC00FFD9A90065CBE00064C9E1005EC4E00052BBE40067B7DD0083B4C800B7B5
B200B4B0AD0066C582005DACD40000D16E0049ACCC0042A8CC003199CE00319A
CB003399CE003399CD003597CD0066B066002D92C6002C92C30000AF42002287
BB002187B8002187BB002489B400288F8D00009F2F00009E2C001275A7006D6D
6C006767670065666A0003649300646667006567670068666600666765006467
6500646666006665670065646600007C000002466700114053000B2D62000000
0000FFFFFF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000006A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A006A6A6A6A6A6A4242424242424242
4242424242426A6A6A006A6A6A6A6A405B5B5B5B5B5B5B5B5B5B5B595C426A6A
6A006A6A6A6A6A5C3C1A2121212121212121093958426A6A6A006A6A6A6A4054
08080808080808080808084658426A6A6A006A6A6A6A5C3B0F0F0F0F0F0F0F0F
0F1818585C426A6A6A006A6A6A4054132A2A2A2A2A2A2A2A2A16476766426A6A
6A006A6A6A5C3D2F33333333333333333333583869426A6A6A006A6A40540404
0404040404040404043E55000069416A6A006A6A5C5353535353535353535353
535856000000696A6A006A6A6A6A6A53196900003A4550506857004300696A6A
6A006A6A6A6A6A4E1919690024564550574D000069426A6A6A006A6A6A6A6A4B
201B1B6900245665574D00695C426A6A6A006A6A6A6A6A4810031E1E6900243A
24006952526A6A6A6A006A6A6A6A6A443F0E05050569002400696A6A6A6A6A6A
6A006A6A6A6A6A6A44494C4C4F6A6900696A6A6A6A6A6A6A6A006A6A6A6A6A6A
6A6A6A6A6A6A6A696A6A6A6A6A6A6A6A6A006A6A6A6A6A6A6A6A6A6A6A6A6A6A
6A6A6A6A6A6A6A6A6A00}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_open_persClick
end
object bt_limpar_pers: TSpeedButton
Left = 124
Top = 2
Width = 104
Height = 22
Hint = 'Limpar imagem'
Caption = '&Limpar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
56010000424D5601000000000000560000002800000010000000100000000100
08000000000000010000120B0000120B00000800000000000000FFFFFF0000FF
FF000000FF000000990000000000FFFFFF000000000000000000000000000000
0000000000000000000000020004040404040404040404040202000202040100
0100010001000102020000000202000100010001000102030000000000030200
0100010001020204000000000004020200010001020201040000000000040102
0200010202010004000000000004000102020202010001040000000000040100
0102020200010004000000000004000100020202020001040000000000040100
0202010002020004000000000004000202010001040202040000000000040202
0100010004010203000000000003020100010001040404020200000002020404
0404040404040000020200020200000000000000000000000002}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_limpar_persClick
end
end
object cp15: TComboBox
Left = 56
Top = 40
Width = 169
Height = 20
Style = csDropDownList
ItemHeight = 12
ItemIndex = 0
TabOrder = 0
Text = 'Centralizado'
Items.Strings = (
'Centralizado'
'Superior Centralizado'
'Superior Esquerdo'
'Superior Direito'
'Inferior Centralizado'
'Inferior Esquerdo'
'Inferior Direito')
end
end
end
object Panel16: TPanel
Left = 0
Top = 366
Width = 813
Height = 24
Align = alBottom
BevelOuter = bvNone
Color = 16119285
TabOrder = 3
object ToolBar5: TToolBar
Left = 654
Top = 0
Width = 162
Height = 24
Align = alRight
AutoSize = True
Caption = 'pn_barra'
EdgeBorders = []
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
TabOrder = 0
object bt_save_pers: TSpeedButton
Left = 0
Top = 2
Width = 162
Height = 22
Hint = 'Gravar dados'
Caption = '&Gravar'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Verdana'
Font.Style = []
Glyph.Data = {
1E020000424D1E02000000000000B60000002800000014000000120000000100
08000000000068010000120B0000120B00002000000000000000FFFFFF00FFF9
EC00EDEDED00F7ECD800F2E7D300F0E4D000EBD8B600D9C8AB00C7B49200C2AF
8D00BFAC8A00BAA78500B7A48200B4A17F0099999900AF9C7A00A18E6C008673
5100A06C4800806D4B006D5A38006E502F005C4927004E392100140D0000FFFF
FF00000000000000000000000000000000000000000000000000191919191919
1919191919191919191919191919191919191919190E0E0E0E0E0E0E0E0E0E0E
0E191919191919191217171515151515151717170E19191919191919120B0F00
0202020202160C170E19191919191919120B0F00130A000202160C170E191919
190E0E0E120A0D001413000202160C170E1919191217171512090D0000000000
00160C170E191919120B0F001208080C0C0C0C0C0C0C0C170E191919120B0F00
120801030303030405110C170E191919120A0D00120801030303030405110717
0E19191912090D001208010303030304051810170E1919191208080C12060101
0101010101140B170E1919191208010312121212121212121212121219191919
1208010303030304051107170E19191919191919120801030303030405181017
0E19191919191919120601010101010101140B170E1919191919191912121212
1212121212121212191919191919191919191919191919191919191919191919
1919}
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_save_persClick
end
end
end
end
end
object ToolBar_lng1: TToolBar
Left = 236
Top = 2
Width = 589
Height = 24
Align = alNone
ButtonHeight = 25
EdgeBorders = []
TabOrder = 1
object Label11: TLabel
Left = 0
Top = 2
Width = 58
Height = 25
Alignment = taRightJustify
AutoSize = False
Caption = 'Linguagem:'
Layout = tlCenter
end
object PageControl_languagens: TPageControl
Left = 58
Top = 2
Width = 527
Height = 25
ActivePage = lngtb1
Align = alLeft
Style = tsFlatButtons
TabOrder = 0
OnChange = PageControl_languagensChange
object lngtb1: TTabSheet
Caption = 'lngtb1'
end
object lngtb2: TTabSheet
Caption = 'lngtb2'
ImageIndex = 1
TabVisible = False
end
object lngtb3: TTabSheet
Caption = 'lngtb3'
ImageIndex = 2
TabVisible = False
end
object lngtb4: TTabSheet
Caption = 'lngtb4'
ImageIndex = 3
TabVisible = False
end
object lngtb5: TTabSheet
Caption = 'lngtb5'
ImageIndex = 4
TabVisible = False
end
object lngtb6: TTabSheet
Caption = 'lngtb6'
ImageIndex = 5
TabVisible = False
end
object lngtb7: TTabSheet
Caption = 'lngtb7'
ImageIndex = 6
TabVisible = False
end
object lngtb8: TTabSheet
Caption = 'lngtb8'
ImageIndex = 7
TabVisible = False
end
object lngtb9: TTabSheet
Caption = 'lngtb9'
ImageIndex = 8
TabVisible = False
end
object lngtb10: TTabSheet
Caption = 'lngtb10'
ImageIndex = 9
TabVisible = False
end
object lngtb11: TTabSheet
Caption = 'lngtb11'
ImageIndex = 10
TabVisible = False
end
object lngtb12: TTabSheet
Caption = 'lngtb12'
ImageIndex = 11
TabVisible = False
end
object lngtb13: TTabSheet
Caption = 'lngtb13'
ImageIndex = 12
TabVisible = False
end
object lngtb14: TTabSheet
Caption = 'lngtb14'
ImageIndex = 13
TabVisible = False
end
object lngtb15: TTabSheet
Caption = 'lngtb15'
ImageIndex = 14
TabVisible = False
end
object lngtb16: TTabSheet
Caption = 'lngtb16'
ImageIndex = 15
TabVisible = False
end
object lngtb17: TTabSheet
Caption = 'lngtb17'
ImageIndex = 16
TabVisible = False
end
object lngtb18: TTabSheet
Caption = 'lngtb18'
ImageIndex = 17
TabVisible = False
end
object lngtb19: TTabSheet
Caption = 'lngtb19'
ImageIndex = 18
TabVisible = False
end
object lngtb20: TTabSheet
Caption = 'lngtb20'
ImageIndex = 19
TabVisible = False
end
end
end
end
object Panel20: TPanel
Left = 803
Top = 4
Width = 26
Height = 25
BevelOuter = bvNone
ParentColor = True
TabOrder = 1
object bt_help: TSpeedButton
Left = 1
Top = 1
Width = 23
Height = 22
Hint = 'Ajuda'
Caption = '?'
Flat = True
Font.Charset = DEFAULT_CHARSET
Font.Color = 12615680
Font.Height = -9
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = bt_helpClick
end
end
object StatusBar1: TStatusBar
Left = 0
Top = 428
Width = 829
Height = 19
Panels = <
item
Alignment = taRightJustify
Text = 'by HWS Web Solution Ltda '
Width = 50
end>
ParentColor = True
OnClick = StatusBar1Click
end
object XPManifest1: TXPManifest
Left = 112
Top = 334
end
object ImportarImgDialog: TOpenPictureDialog
Filter =
'Todas as imagens (*.jpg;*.jpeg;*.bmp;*.ico,*.swf,*.flv)|*.jpg;*.' +
'jpeg;*.bmp;*.ico;*.swf;*.flv|Imagem JPEG (*.jpg)|*.jpg|Imagem JP' +
'EG (*.jpeg)|*.jpeg|Bitmaps (*.bmp)|*.bmp|Icones (*.ico)|*.ico|Fl' +
'ash (*.swf)|*.swf|Macromedia Flash Video (*.flv)|*.flv'
Title = 'Importar imagem'
Left = 22
Top = 333
end
object Tradutor1: TTradutor
AoTraduzir = Tradutor1AoTraduzir
Left = 82
Top = 334
end
object Timer_traduz: TTimer
Enabled = False
OnTimer = Timer_traduzTimer
Left = 52
Top = 334
end
object OpenBannerDialog: TOpenPictureDialog
Filter =
'Todas as imagens (*.jpg;*.jpeg;*.bmp;*.swf,*.flv)|*.jpg;*.jpeg;*' +
'.bmp;*.swf;*.flv|Imagem JPEG (*.jpg)|*.jpg|Imagem JPEG (*.jpeg)|' +
'*.jpeg|Bitmaps (*.bmp)|*.bmp|Flash (*.swf)|*.swf|Macromedia Flas' +
'h Video (*.flv)|*.flv'
Title = 'Importar imagem'
Left = 174
Top = 333
end
object PopupMenu2: TPopupMenu
Left = 142
Top = 335
object MenuItem1: TMenuItem
Caption = 'Excluir todos os registros'
OnClick = MenuItem1Click
end
end
object ExportarImgDialog: TSavePictureDialog
Filter =
'JPEG arquivo de imagem (*.jpg)|*.jpg|Flash (*.swf)|*.swf|Macrome' +
'dia Flash Video (*.flv)|*.flv'
Left = 24
Top = 364
end
object ColorDialog1: TColorDialog
Left = 56
Top = 364
end
object ToolbarImages: TImageList
Left = 88
Top = 364
Bitmap = {
494C01011C001D00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000008000000001002000000000000080
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A500A5A5A500A5A5A500A5A5A500A5A5
A500A5A5A500A5A5A500A5A5A500A5A5A5000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00002B2A2B002B2A2B002B2A2B00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000808080008080
80008080800000000000FFFFFF0000FFFF00FFFFFF0000FFFF00000000008080
8000808080008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000007B7B
7B00000000000000000000000000000000000000000000000000000000000000
00007B7B7B000000000000000000000000000000000000000000000000000000
00002B2A2B00CED2D500CED2D5002B2A2B000000000000000000000000000000
000000000000000000000000000000000000000000000000000080808000FFFF
FF00808080008080800000000000FFFFFF0000FFFF0000000000FFFFFF008080
8000FFFFFF008080800000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000B54A6300FFDE
E700000000000000000000000000000000000000000000000000000000000000
0000FFCECE000000000000000000000000000000000000000000000000000000
0000000000002B2A2B00ADAEAD00ADAEAD004241420000000000000000000000
00000000000000000000000000000000000000000000FFFFFF00FFFFFF008080
8000FFFFFF00808080000000000000000000000000000000000080808000FFFF
FF0080808000FFFFFF008080800000000000000000000000000000000000A5A5
A500A5A5A500A5A5A50000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000B54A6300FFEF
EF00000000000000000000000000FFF7F700FFDEE700E7B5BD00000000000000
0000FFDEDE000000000000000000000000000000000000000000000000000000
0000000000002B2A2B00ADAEAD00ADAEAD0084828400424142002B2A2B004241
4200000000000000000000000000000000000000000080808000FFFFFF00FFFF
FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF00FFFF
FF00FFFFFF008080800080808000000000000000000063636300000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000B54A63000000
0000000000000000000000000000000000000000000000000000000000000000
0000FFEFEF0094394A0000000000000000000000000000000000424142004241
420042414200ADAEAD00ADAEAD00ADAEAD00ADAEAD00ADAEAD00ADAEAD008482
8400424142004241420000000000000000000000000000000000FFFFFF00FFFF
FF0080808000FFFFFF0000000000000000000000000000000000FFFFFF00FFFF
FF00FFFFFF00808080000000000000000000000000006363630000FFFF0000FF
FF000000000000000000CED6D6000000000000FFFF0000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000007B7B
7B00AD395200AD395200AD3952007BAD31007BAD3100AD395200AD395200B54A
63007B7B7B000000000000000000000000000000000042414200ADAEAD00CED2
D500CED2D500CED2D500ADAEAD009966000099660000ADAEAD00ADAEAD00ADAE
AD00ADAEAD008482840042414200000000000000000000000000FFFFFF008080
8000FFFFFF00000000000000000000000000000000000000000000000000FFFF
FF0080808000FFFFFF000000000000000000000000006363630000FFFF0000FF
FF000000000000000000CED6D6000000000000FFFF0000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000000000
00007BAD31007BAD3100EFD684007BAD31007BAD3100F7E79C00E7C673007BAD
3100ADADB50000000000000000000000000042414200ADAEAD00CED2D500CED2
D500CED2D500CED2D500ADAEAD00FF7D5A00FF7D5A00CED2D500ADAEAD00ADAE
AD00ADAEAD00ADAEAD0084828400424142000000000000000000000000000000
0000000000000000000000000000008080000080800000000000000000000000
000000000000000000000000000000000000000000006363630000FFFF0000FF
FF000000000000000000000000000000000000FFFF0000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000000000
00009CC65A00E7C67300CEDEB500FFEFBD00FFEFBD00B5D67B00EFD684007BAD
3100ADADB5000000000000000000000000002B2A2B00CED2D500CED2D500CED2
D500CED2D500CED2D500CED2D500BD79000099660000ADAEAD00CED2D500CED2
D500ADAEAD00ADAEAD00ADAEAD002B2A2B000000000000000000000000008000
000000FFFF00000000000000000000000000000000000000000000000000FFFF
FF0080000000000000000000000000000000000000006363630000FFFF0000FF
FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000000000
00009CC65A00B5D67B00FFEFBD00FFF7D600FFEFBD009CC65A00E7C673007BAD
3100ADADB5000000000000000000000000002B2A2B000000000000000000CED2
D500CED2D500CED2D500CED2D500FF7D5A0099660000BD790000ADAEAD00CED2
D500CED2D500CED2D500CED2D5002B2A2B000000000000000000000000008000
000000FFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0080000000800000008000
000080000000000000000000000000000000000000006363630000FFFF000000
00000000000000000000000000000000000000FFFF0000000000000000000000
0000000000000000000000000000A5A5A5000000000000000000000000000000
0000E7848400EFD68400FFF7D600FFFFEF00FFF7D6007BAD31007BAD3100C66B
7B00000000000000000000000000000000002B2A2B0000000000000000000000
000000000000F7CFA500FFAE8C00CED2D500FFAE8C0099660000BD790000CED2
D500CED2D500CED2D500CED2D5002B2A2B000000000000000000000000008000
0000FFFFFF0000FFFF0000FFFF00FFFFFF0000FFFF008000000000FFFF008000
000000000000000000000000000000000000000000006363630000FFFF000000
0000CED6D600CED6D600CED6D6000000000000FFFF0000000000A5A5A5000000
0000000000000000000000000000000000000000000000000000000000000000
00009CBD7B00E7848400E78484009CC65A009CC65A00C66B7B00C66B7B00ADAD
B5000000000000000000000000000000000042414200CED2D500000000000000
000000000000BD790000BD790000FF7D5A00FF7D5A0099660000BD7900000000
0000CED2D500CED2D500ADAEAD00424142000000000000000000000000008000
000000FFFF00FFFFFF00FFFFFF0000FFFF00FFFFFF0080000000800000000000
000000000000000000000000000000000000000000006363630000FFFF000000
0000CED6D600CED6D600CED6D6000000000000FFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000009CBD7B00E7848400E78484009CBD7B00CED6C6000000
000000000000000000000000000000000000000000002B2A2B00CED2D5000000
000000000000FFD7D600BD7900009966000099660000BD790000F7CFA5000000
000000000000ADAEAD0042414200000000000000000000000000000000008000
0000FFFFFF0000FFFF0000FFFF00FFFFFF0000FFFF0080000000000000000000
0000000000000000000000000000000000000000000063636300636363006363
6300636363006363630063636300636363006363630063636300000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000002B2A2B004241
4200CED2D500CED2D500CED2D500F7CFA500F7CFA5000000000000000000ADAE
AD002B2A2B004241420000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000424142002B2A2B002B2A2B002B2A2B002B2A2B002B2A2B002B2A2B004241
4200000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000390039003100
3100310031000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00006300100063001000630010006B0810006B0810007B2118007B2118008429
1800943121009C39210000000000000000000000000000000000000000000000
00006300100063001000630010006B0810006B0810007B2118007B2118008429
1800943121009C39210000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000006B08
100000000000000000000000000063001000630010006B081000731818008429
1800000000000000000000000000000000000000000000000000000000000000
00006B081000000000000000000063001000630010006B081000731818008429
1800000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000630010006B08
1000943121009C39210000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000009C3921009431
21006B0810006300100000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000390039002900
2900290029000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000063001000630010006B081000731818007B21
1800943121009C39210000000000000000000000000000000000000000000000
000000000000000000000000000063001000630010006B081000731818007B21
1800943121009C39210000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00006300100063001000630010006B0810006B0810007B2118007B2118008429
1800943121009C39210000000000000000000000000000000000000000000000
00006300100063001000630010006B0810006B0810007B2118007B2118008429
1800943121009C39210000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000080008001800
1000180810000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000009C9C9C00000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000006363630000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000006363630000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000FFFF0000FF
FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF
FF0000FFFF0000FFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000ADADB5000000000000000000000000000000000000000000ADAD
B500000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000FFFF0000FF
FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF
FF0000FFFF0000FFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000ADADB500ADADB500ADADB500ADADB500ADADB50000000000ADAD
B500000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000A594
520000E7E70094310000A5945200BDBDBD000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000FFFF0000E7E7009431000094310000BDBDBD0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000ADADB500ADAD
B500ADADB5000000000000000000ADADB500ADADB500ADADB500000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000A594520094310000FFEFBD008C94730094310000BDBDBD00000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B54A6300AD395200B54A
6300000000000000000000000000B54A6300AD39520000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000006363630000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000007363080000000000FFEFBD00CEDEB50073844A0094310000BDBD
BD00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000B54A
6300000000000000000000000000AD3952000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000007363080063F7F700FFEFBD008C94730073844A009431
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000009C9C9C000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000C66B
7B00B54A6300B54A6300B54A6300B54A630000000000ADADB500000000000000
0000ADADB500ADADB50000000000000000000000000000000000000000000000
0000000000000000000000000000636363000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A5F7FF00FFEFBD00CEDEB5008C94
730094310000BDBDBD0000000000000000000000000000000000000000000000
0000000000000000000000000000000000009C9C9C0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000ADADB50000000000B54A63000000000000000000ADADB500ADADB500ADAD
B500ADADB5000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000006363630000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000736308000000000063F7F700FFEFBD00CEDE
B50073844A009431000000000000000000000000000000000000000000000000
00000000000000000000000000009C9C9C000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000B54A6300ADADB500AD395200000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000636363000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A5945200A5F7FF0063F7F700FFEF
BD008C9473009431000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000AD395200CE949C00AD395200000000000000000000000000ADADB5000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000A5945200000000000000
0000A59452000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000E7B5BD00AD395200CE949C00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A5945200A594
5200000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000C66B7B0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000ADADB500ADADB500ADADB5000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000ADADB500ADADB500ADADB500ADADB500ADAD
B500ADADB5000000000000000000000000000000000000000000000000000000
0000000000000000000000000000002994000029940000299400000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000106BCE00005AB5000029940000217B008CC6
FF00000000000000000000000000000000000000000000000000000000000000
000000000000ADADB5000000000000000000000000000000000000000000ADAD
B500000000000000000000000000000000000000000000000000000000000000
000000000000000000006B8CDE00396BC600396BC600396BC600396BC600396B
C600ADADB5000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000299400ADADB500000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000006BB5F7006BB5F7006BB5F7006BB5F700005A
B5008CC6FF000000000000000000000000000000000000000000000000000000
000000000000ADADB500ADADB500ADADB500ADADB500ADADB50000000000ADAD
B500000000000000000000000000000000000000000000000000000000000000
0000ADADB500ADADB5006B8CDE00F7BDDE00F7BDDE00F7BDDE006BD6FF0063F7
F700ADADB5000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000299400ADADB500000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000106BCE00E7E700006BD6FF006BD6FF005252
FF006BB5F70000217B0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000CE529400CE5294006B8CDE008CEFFF008CEFFF008CEFFF008CEFFF008CEF
FF00ADADB5000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000004AC600ADADB500ADADB500004A
C600000000000000000000000000000000000000000000000000000000000000
00000000000000000000BDBDBD006BB5F700E7E700008CDEFF007384FF000000
DE004AD6F700005AB50000000000000000000000000000000000ADADB500ADAD
B500ADADB5000000000000000000ADADB500ADADB500ADADB500000000000000
000000000000000000000000000000000000000000000000000000000000CE52
9400CEAD7300CEAD73006B8CDE00F7BDDE00F7BDDE00A5F7FF00A5F7FF00A5F7
FF00ADADB5000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000004AC600004AC600004AC600004A
C600000000000000000000000000000000000000000000000000000000000000
0000BDBDBD00106BCE00106BCE00BDEFF700ADE7FF008CDEFF00ADADFF006BD6
FF004AD6F700005AB500000000000000000000000000B54A6300AD395200B54A
6300000000000000000000000000B54A6300AD39520000000000000000000000
000000000000000000000000000000000000000000000000000000000000CE52
9400DEBD8C00DEBD8C006B8CDE00F7BDDE00F7BDDE00396BC60000000000396B
C600ADADB5000000000000000000000000000000000000000000B53139009410
2100BD7B9400000000000000000000000000105ADE00ADADB50000000000105A
DE0000000000ADADB50000000000000000000000000000000000000000000000
00000000000094085A0094085A00EFFFFF00BDEFF70029EF290029EF2900009C
10006BD6FF00106BCE000000000000000000000000000000000000000000B54A
6300000000000000000000000000AD3952000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000CE52
9400EFCEB500EFCEB5006B8CDE00CEF7F700CEF7F700396BC600396BC600EFCE
B500ADADB5000000000000000000000000000000000000000000000000000000
000094102100CE949C000000000000000000105ADE00ADADB500000000000000
00000073F700ADADB50000000000000000000000000000000000000000000000
00000000000094085A009C184200BDBDBD00CEF7F700ADE7FF009CDEFF00087B
08008CC6FF00398CDE000000000000000000000000000000000000000000C66B
7B00B54A6300B54A6300B54A6300B54A630000000000ADADB500000000000000
0000ADADB500ADADB5000000000000000000000000000000000000000000CE52
9400F7DEC600F7DEC600F7DEC600F7DEC600F7DEC600F7DEC600F7DEC600F7DE
C600ADADB5000000000000000000000000000000000000000000000000000000
00000000000094102100CE949C000073F7000073F7000073F7000073F7000073
F7000073F7000000000000000000000000000000000000000000000000000000
000000000000B5313900B5313900FFFFFF00F7FFFF0000000000BDEFF7008CC6
FF008CC6FF000000000000000000000000000000000000000000000000000000
0000ADADB50000000000B54A63000000000000000000ADADB500ADADB500ADAD
B500ADADB500000000000000000000000000000000000000000000000000CE52
9400000000000000000000000000000000000000000000000000F7DEC600F7DE
C600ADADB5000000000000000000000000000000000000000000000000000000
00000000000094102100CE949C00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B5313900B5313900FFFFFF00FFFFFF00EFFFFF00398CDE00398C
DE00000000000000000000000000000000000000000000000000000000000000
0000B54A6300ADADB500AD395200000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000CE52
9400BD217300DEDEDE00DEDEDE00DEDEDE00DEDEDE00BD217300F7DEC600F7DE
C600ADADB5000000000000000000000000000000000000000000000000000000
0000CE949C00AD39520094102100CE949C000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B5313900B5313900398CDE00398CDE00398CDE008CC6FF000000
0000000000000000000000000000000000000000000000000000000000000000
0000AD395200CE949C00AD395200000000000000000000000000ADADB5000000
0000000000000000000000000000000000000000000000000000000000000000
0000BD7B9400BD7B9400BD21730000FFFF00BD217300BD7B9400BD7B9400BD7B
9400000000000000000000000000000000000000000000000000000000000000
0000E7B5BD00CE949C009410210000000000CE949C0000000000000000000000
0000000000000000000000000000000000000000000000000000D6521800BDBD
BD00BDBDBD00D6521800D6521800BDBDBD00BDBDBD00BDBDBD00000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000E7B5BD00AD395200CE949C00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000BD217300BD217300BD21730000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000AD3952009410210094102100941021009C18420000000000000000000000
0000000000000000000000000000000000000000000000000000D6521800D652
1800D6521800D6521800D6521800D6521800D652180000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000C66B7B0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000D6D6D600C6C6C600CECE
CE00DEDEDE000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000084736300634229006B5242009C94
9400BDBDBD00DEDEDE0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000063422900FFF7C600FFF7C6006342
29009C949400BDBDBD00DEDEDE00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000007B635200FFE7AD00FFE7AD00FFE7
AD00634229009C949400CECECE00E7E7E70000000000EFEFEF00EFEFEF00EFEF
EF00000000000000000000000000000000000000000000000000000000000000
0000ADADB500ADADB5000000000000000000000000000000000000000000ADAD
B500000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000ADADB500ADADB500ADADB500ADADB500ADAD
B500ADADB500ADADB50000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000DEDED60063422900FFC68C00FFC6
8C00FFC68C006B524200B5B5B500CECECE00CECECE00C6C6C600C6C6C600C6C6
C600CECECE00DEDEDE00EFEFEF0000000000000000000000000000000000005A
B50000000000005AB500ADADB5000000000000000000005AB500ADADB5000000
0000ADADB5000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5EFEF00A5EFEF00A5EFEF00A5EFEF00A5EF
EF00215AD600ADADB50000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00007B00000000000000000000000000000000000000DEDED60063422900FFB5
7B00FFB57B006342290094847B0073635200735242006342290063422900735A
4A0094847B00BDBDBD00D6D6D600EFEFEF00000000000000000000000000005A
B500ADADB500005AB500ADADB5000000000000000000005AB500ADADB500ADAD
B500000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000A5EFEF00A5EFEF00A5EFEF00A5EFEF00A5EF
EF00215AD600ADADB500000000000000000000000000000000007B0000007B00
00007B0000007B0000007B000000000000000000000000000000000000000000
00007B0000000000000000000000000000000000000000000000DEDED6007B63
520063422900FFB57B00846B5A00D6CEBD00FFF7EF00FFF7EF00FFF7EF00D6CE
BD00846B5A007B6B5A00BDBDBD00DEDEDE000000000000000000000000000000
0000005AB500005AB500ADADB5000000000000000000005AB500005AB500005A
B500000000000000000000000000000000000000000000000000000000000000
0000ADADB500ADADB500ADADB500BDF7F7009CDEEF009CDEEF009CDEEF009CDE
EF00215AD600ADADB500000000000000000000000000000000007B0000007B00
00007B0000007B00000000000000000000000000000000000000000000000000
0000000000007B00000000000000000000000000000000000000000000000000
0000B5ADA500846B5A00F7EFE700FFF7DE00FFF7DE00FFF7DE00FFF7DE00FFF7
DE00F7EFE700846B5A0094847B00CECECE000000000000000000000000000000
000000000000106BCE00106BCE00105ADE00005AB500106BCE00000000000000
0000000000000000000000000000000000000000000000000000000000002184
D600A5EFEF00A5EFEF00A5EFEF00CEF7F7009CDEEF009CDEEF009CDEEF009CDE
EF00215AD600ADADB500000000000000000000000000000000007B0000007B00
00007B0000000000000000000000000000000000000000000000000000000000
0000000000007B00000000000000000000000000000000000000000000000000
000084736300D6C6B500FFEFD60063422900FFEFD600FFEFD600FFEFD6006342
2900FFEFD600D6C6B500735A4A00C6C6C6000000000000000000000000000000
0000000000000000000000000000398CDE00105ADE0000000000000000000000
0000000000000000000000000000000000000000000000000000000000002184
D600A5EFEF00A5EFEF00A5EFEF00EFFFFF00EFFFFF00EFFFFF004A9CE7004A9C
E700215AD600ADADB500000000000000000000000000000000007B0000007B00
0000000000007B00000000000000000000000000000000000000000000000000
0000000000007B00000000000000000000000000000000000000000000000000
00007B635200FFEFD600FFEFCE0063422900FFEFCE00FFEFCE00FFEFCE006342
2900FFEFCE00FFEFD60063422900BDBDBD000000000000000000000000000000
00000000000000000000AD395200D694AD00C66B7B00ADADB500ADADB5000000
0000000000000000000000000000000000000000000000000000000000002184
D600CEF7F700CEF7F700BDF7F700F7FFFF00EFFFFF00EFFFFF004A9CE7002184
D6000000000000000000000000000000000000000000000000007B0000000000
000000000000000000007B0000007B0000000000000000000000000000000000
00007B0000000000000000000000000000000000000000000000000000000000
000063422900FFE7C600FFE7C60084634A009C7B63009C7B63009C7B63008463
4A00FFE7C600FFE7C60063422900C6C6C6000000000000000000000000000000
000000000000AD395200BD7B940000000000D694AD00AD395200ADADB500ADAD
B500000000000000000000000000000000000000000000000000000000002184
D6009CDEEF009CDEEF009CDEEF002184D6002184D6002184D6002184D6002184
D600000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000007B0000007B0000007B0000007B00
0000000000000000000000000000000000000000000000000000000000000000
000063422900FFE7C600FFDEBD00BDA5840063422900FFDEBD0063422900BDA5
8400FFDEBD00FFE7C60063422900CECECE000000000000000000000000000000
0000AD395200BD7B9400D694AD000000000000000000BD7B9400C66B7B00ADAD
B500000000000000000000000000000000000000000000000000000000002184
D600EFFFFF00EFFFFF00F7FFFF006BB5F7006BB5F700ADADB500000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00008C736300D6BDA500FFDEB500FFDEB50084634200FFDEB50084634200FFDE
B500FFDEB500D6BDA5007B635200DEDEDE00000000000000000000000000C66B
7B00D694AD000000000000000000000000000000000000000000D694AD00BD7B
9400ADADB5000000000000000000000000000000000000000000000000002184
D600EFFFFF00EFFFFF00EFFFFF002184D6002184D60000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000BDB5AD00846B5200FFE7C600FFDEAD00BD9C7B0063422900BD9C7B00FFDE
AD00F7DEBD00846B5200A59C8C00EFEFEF00000000000000000000000000BD7B
940000000000000000000000000000000000000000000000000000000000D694
AD00000000000000000000000000000000000000000000000000000000002184
D6002184D6002184D6002184D6002184D6000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000009C847300846B5200D6BD9C00FFDEBD00FFDEAD00FFDEBD00D6BD
9C00846B52008C7B6B00EFEFEF00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000BDB5AD008C7363006342290063422900634229008473
6300B5ADA5000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E7E7E700DEDEDE00FFFFEF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000E7E7E700E7E7E700E7E7E700E7E7E700E7E7E700E7E7E700E7E7E700E7E7
E700E7E7E700E7E7E700FFFFF700000000000000000000000000000000000000
0000000000009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C
9C009C9C9C009C9C9C0000000000000000000000000000000000000000000000
0000E7E7E70063422900C6C6C600E7E7E7000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000009C9C9C009C9C9C009C9C9C009C9C9C009C9C9C009C9C
9C009C9C9C009C9C9C009C9C9C0000000000000000000000000000000000E7E7
E700BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBDBD00BDBD
BD00BDBDBD00BDBDBD00CECECE00FFFFF7000000000000000000000000000000
00009C7B4A00946B4200946B42008C6B42008C6342008C6342008C6342008463
3900845A31009C9C9C000000000000000000000000000000000000000000E7E7
E7006342290063422900BDBDBD00E7E7E7000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000A56B4A004A3921006B5229006B5229006B5229006B5229006B52
29004A3921004A3921009C9C9C00000000000000000000000000E7E7E7006342
2900634229006342290063422900634229006342290063422900634229006342
29006342290063422900BDBDBD00E7E7E7000000000000000000000000000000
0000A5845A00FFF7DE00FFF7DE00FFF7DE00FFEFD600FFEFD600FFEFC600FFEF
C600845A31009C9C9C0000000000000000000000000000000000E7E7E7006342
2900FFDEA50063422900BDBDBD00DEDEDE00E7E7E700E7E7E700E7E7E700E7E7
E700FFFFEF000000000000000000000000000000000000000000000000000000
000000000000A56B4A00AD9C7B0000000000EFEFEF00EFEFEF00EFEFEF00EFEF
EF005A4A2100B5A584009C9C9C000000000000000000E7E7E70063422900E7C6
9400FFF7C600FFF7C600FFF7C600FFF7C600FFF7C600FFF7C600FFF7C600FFF7
C600FFF7C60063422900BDBDBD00E7E7E7000000000000000000000000000000
0000AD8C5A00FFF7E700FFF7E700FFF7E700FFF7DE00FFF7DE00FFEFD600FFEF
D600845A31009C9C9C00000000000000000000000000E7E7E70063422900FFE7
B500FFD6A500634229006B5242006B4A3900634A31006342290063422900BDBD
BD00CECECE00FFFFEF00000000000000000000000000000000009C9C9C009C9C
9C009C9C9C00A56B4A00B5A57B00000000006B5A3900846B4A00EFEFEF00EFEF
EF005A4A2100B5A584009C9C9C0000000000FFFFF70063422900FFF7D600FFF7
D600FFE7AD00FFE7AD00FFE7AD00FFE7AD00FFE7AD00FFE7AD00FFE7AD00FFE7
AD00FFEFB50063422900BDBDBD00E7E7E7000000000000000000000000000000
0000B58C6300FFFFEF00FFFFEF00FFF7E700FFF7E700FFF7DE00FFF7DE00FFF7
DE00845A31009C9C9C000000000000000000FFFFEF0063422900FFEFBD00FFDE
AD00FFD69C0063422900FFE7B500FFE7B500FFE7B500FFE7B500BD845A006342
2900BDBDBD00E7E7E700000000000000000000000000000000004A3921004A39
21006B522900A56B4A00B5A57B00000000000000000000000000000000000000
00005A4A2100B5A584009C9C9C000000000063422900FFF7C600FFF7CE00FFF7
CE00EFC69400EFC69400EFC69400EFC69400EFC69400EFC69400EFC69400EFC6
9400F7D6A50063422900BDBDBD00E7E7E7000000000000000000000000000000
0000B58C6300FFFFEF00FFFFEF00FFFFEF00FFF7E700FFF7E700FFF7DE00FFF7
DE00845A31009C9C9C00000000000000000063422900FFEFBD00FFE7B500FFDE
A500FFCE940063422900FFE7B500FFE7B500FFE7B500FFE7B500BD845A006342
2900BDBDBD00E7E7E70000000000000000000000000000000000BDA58400AD9C
7B0000000000A56B4A00C6B59400B5A58400B5A58400B5A58400B5A58400B5A5
8400B5A58400B5A584009C9C9C000000000063422900FFEFBD00FFF7C600FFF7
C600EFAD7B00EFAD7B00EFAD7B00EFAD7B00EFAD7B00EFAD7B00EFAD7B00EFAD
7B00EFC6940063422900CECECE00FFFFF7000000000000000000000000000000
00009C636300FFFFF700FFFFF700FFFFEF00FFFFEF00FFF7E700EFDEC600EFDE
C600845A31009C9C9C00000000000000000063422900FFEFBD00FFE7B500FFD6
9C00FFC68C0063422900FFEFBD00FFEFBD00FFEFBD00FFEFBD00BD845A006342
2900BDBDBD00E7E7E70000000000000000000000000000000000BDA58400AD9C
7B0000000000A56B4A00FFFFEF00F7EFDE00F7EFDE00F7EFDE00F7E7D600F7E7
D60084735200B5A584009C9C9C000000000063422900FFEFB500EFC694000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000063422900E7E7E700000000000000000000CEFF004A7BA5000000
00009C636300FFFFF7008CA5BD00CEFFFF00FFFFEF00E7D6BD00C6A58400C6A5
8400845A31009C9C9C00000000000000000063422900FFE7B500FFDEA500FFCE
9400FFBD840063422900FFEFC600FFEFC600FFEFC600FFEFC600BD845A006342
2900BDBDBD00E7E7E70000000000000000000000000000000000BDAD8C00B5A5
7B0000000000A56B4A00FFFFEF00F7EFDE00F7EFDE00F7EFDE00F7E7D600F7E7
D60084735200DECEAD009C9C9C000000000063422900EFC69400000000006342
2900634229006342290063422900634229006342290063422900634229006342
290063422900E7E7E700000000000000000000000000EFF7F70000CEFF00527B
A5009C6363005A84AD00CEFFFF00FFFFF700FFFFF700E7D6BD00FFFFF700FFFF
F700845A31009C9C9C00000000000000000063422900FFE7B500FFD6A500FFC6
8C00FFBD840063422900FFF7D600FFF7D600FFF7D600FFF7D600C68C5A006342
2900BDBDBD00E7E7E70000000000000000000000000000000000C6AD8C00B5A5
7B0000000000A56B4A00FFFFEF00F7EFDE00F7EFDE00F7EFDE00F7E7D600F7E7
D60010080000A58C6B009C9C9C00000000006342290000000000000000006342
2900FFD69C00FFD69C00FFD69C00FFD69C00FFD69C00FFD69C00FFD69C006342
2900DEDEDE000000000000000000000000000000000000000000CEFFFF0000CE
FF003152730084FFFF000000000000000000FFFFF700E7D6BD00FFFFF700F7D6
B5009C9C9C0000000000000000000000000063422900FFDEAD00FFD69C00FFC6
8C00FFD6AD0063422900FFF7E700FFF7E700FFF7D600FFF7D600CE8C5A006342
2900BDBDBD00E7E7E70000000000000000000000000000000000C6B59400C6B5
9400B5A58400A56B4A00FFFFEF00FFFFEF00FFFFEF00FFFFEF00FFFFEF00FFFF
EF006B5A3900BDA584009C9C9C00000000006342290063422900634229006342
2900FFDEAD00FFDEAD00FFDEAD00FFDEAD00FFDEAD00FFDEAD00FFDEAD006342
2900E7E7E70000000000000000000000000000000000527BA500527BA50031CE
FF0031CEFF005A84AD005A84AD005A84AD008CADC600E7D6BD00F7D6B500845A
31000000000000000000000000000000000063422900FFDEA500FFCE9400FFD6
B50063422900FFFFF700FFFFF700FFF7E700FFF7E700FFF7E700CE9463006342
2900BDBDBD00E7E7E70000000000000000000000000000000000C6B59400FFFF
EF00F7EFDE00A56B4A00A56B4A00A56B4A00A56B4A00A56B4A00A56B4A00A56B
4A00A56B4A00A56B4A0000000000000000000000000000000000000000006342
2900FFE7C600FFE7C600FFE7C600FFE7C600FFE7C600FFE7C600FFE7C6006342
2900E7E7E7000000000000000000000000000000000000000000527BA50031CE
FF0031CEFF0000CEFF004A7BA500000000000000000000000000000000000000
00000000000000000000000000000000000063422900FFD69C00FFDEBD006342
2900000000000000000000000000FFFFF700FFFFF700FFFFF700CE9463006342
2900BDBDBD00E7E7E70000000000000000000000000000000000C6B59400FFFF
EF00F7EFDE00F7EFDE00F7EFDE00F7E7D600F7E7D600100800004A3921009C9C
9C00000000000000000000000000000000000000000000000000000000006342
2900FFEFDE00FFEFDE00FFEFDE00FFEFDE00FFEFDE00FFEFDE00FFEFDE006342
2900E7E7E70000000000000000000000000000000000527BA50084FFFF000000
0000527BA50084FFFF0000CEFF00527BA5000000000000000000000000000000
00000000000000000000000000000000000063422900FFDEBD00634229000000
0000000000000000000000000000000000000000000000000000D69463006342
2900BDBDBD00E7E7E70000000000000000000000000000000000EFDEB500FFFF
EF00FFFFEF00FFFFEF00FFFFEF00FFFFEF00FFFFEF006B5A39004A3921009C9C
9C00000000000000000000000000000000000000000000000000000000006342
2900FFFFF700FFFFF700FFFFF700FFFFF700FFFFF700FFFFF700FFFFF7006342
2900E7E7E70000000000000000000000000000000000EFF7F700000000000000
0000527BA50000000000EFF7F70000CEFF000000000000000000000000000000
00000000000000000000000000000000000063422900A58C7B00FFC68C00FFC6
8C00FFC68C00FFC68C00FFC68C00FFC68C00FFC68C00FFC68C00FFC68C006342
2900CECECE00FFFFEF0000000000000000000000000000000000A56B4A00A56B
4A00A56B4A00A56B4A00A56B4A00A56B4A00A56B4A00A56B4A00A56B4A000000
0000000000000000000000000000000000000000000000000000000000006342
2900000000000000000000000000000000000000000000000000000000006342
2900FFFFF7000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000063422900634229006342
2900634229006342290063422900634229006342290063422900634229006342
2900FFFFEF000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000006342
2900634229006342290063422900634229006342290063422900634229006342
290000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000800000000100010000000000000400000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFFFFFFFFFFFE00FFFFFFFFFFFFFC00
FFFFF1FF8001FDFCE187F0FF0000FDFCC003F87F0000E1C0CA13F80F0000803C
D003C0030000803CE00780018001800CF0070000C003803CF0070000E007803C
F0076000E0078000F00F7800E00F801FF00F3810E01F803FFC1F9819E03F803F
FFFFC063FFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFF8FFFFFFFFFFFC0FF8C03FFFFFFFFFFFF8FFFFFFFFFFFC007FFFFF003F003
FFFFFFFFFFFFFFFFC0078FFFEE0FF60FFFFF8C03C3FFC3FFC0078FFFFE03FE03
FFFFFFFFFFFFFFFFC007FFFFF003F003FFFF8FFFFFFFFFFFC0078C03FFFFFFFF
FFFF8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFC007C007C007FFFFFFFFFFFFFFFFF87FC03FF83FF807
F93FFFFFFFFFFFFFFE3FC007C007C007FE7FFFFFFFFFFFFFF9BFC03FF01FF807
F93FFFFFFFFFFFFFFC3FC007C007C007FFFFFFFFFFFFFFFFFFFFC03FF83FF807
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
C003FFFFFBEFFFFFC003FFFFF00FFFFFE0FFFFFFF7DFFFFFF07FF19FC63FF87F
F03FF99F8E7FFE7FFA0FF91FEEFFFE7FFC0FF81FE0B3FE7FFF03F81FF587FF3F
FE83F89FF18FFF9FFF03F18FF18FFF0FFFB7FFFFF1DFFFFFFFCFFFFFFBFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1FFFFFFFFF
FE07FE3FFE0FFBEFFC07FF3FFE07F00FF007FF3FFE03F7DFF007FF0FFC03C63F
E007FF0FF0038E7FE027C72BF803EEFFE007F333F803E0B3E007F807F807F587
E007F9FFF80FF18FE007F0FFF81FF18FF00FF17FC03FF1DFFC7FF07FC07FFBFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFF03FFFFFFFFFF
FFFF01FFFFFFFFFFFFFF008FF3EFFE03FFFF0001E997FE03FFF78000E18FFE03
C1F7C000F18FF003C3FBF000F83FE003C7FBF000FE7FE003CBFBF000FC1FE00F
DCF7F000F90FE00FFF0FF000F18FE03FFFFFF000E7C7E07FFFFFF000EFEFE0FF
FFFFF801FFFFFFFFFFFFFC07FFFFFFFFFFFFF8FFFFFFF001F803F0FFFC01E000
F003E0FFF801C000F003C007F9018000F0038003C1010000F0030003C1F10000
F0030003C8010000F0030003C8011FF990030003C801200380030003C8016007
C3070003C0010007800F0003C003E007C1FF0E03C00FE00790FF1FC3C00FE007
B4FF0003C01FEFE7FFFF8007FFFFE00F00000000000000000000000000000000
000000000000}
end
object PopupMenu_editor: TPopupMenu
Images = ToolbarImages
OwnerDraw = True
Left = 120
Top = 364
object Desfazer1: TMenuItem
Caption = 'Desfazer'
ImageIndex = 4
ShortCut = 16474
OnClick = Desfazer1Click
end
object Recortar1: TMenuItem
Caption = 'Recortar'
ImageIndex = 6
ShortCut = 16466
OnClick = Recortar1Click
end
object Copiar1: TMenuItem
Caption = 'Copiar'
ImageIndex = 7
ShortCut = 16451
OnClick = Copiar1Click
end
object Colar1: TMenuItem
Caption = 'Colar'
ImageIndex = 8
ShortCut = 16470
OnClick = Colar1Click
end
object Importar1: TMenuItem
Caption = 'Importar'
ImageIndex = 27
end
object N2: TMenuItem
Caption = '-'
end
object Fontemenu: TMenuItem
Caption = 'Formatar fonte'
ImageIndex = 9
object Negrito1: TMenuItem
Caption = 'Negrito'
ImageIndex = 13
ShortCut = 16462
OnClick = Negrito1Click
end
object Italico1: TMenuItem
Caption = 'It'#225'lico'
ImageIndex = 15
ShortCut = 16457
OnClick = Italico1Click
end
object Sublinhado1: TMenuItem
Caption = 'Sublinhado'
ImageIndex = 16
ShortCut = 16469
OnClick = Sublinhado1Click
end
object N3: TMenuItem
Caption = '-'
end
object Cor1: TMenuItem
Caption = 'Cor'
ImageIndex = 10
OnClick = Cor1Click
end
end
object Formatarpargrafo1: TMenuItem
Caption = 'Formatar par'#225'grafo'
ImageIndex = 17
object esquerdo1: TMenuItem
Caption = 'esquerdo'
ImageIndex = 17
OnClick = esquerdo1Click
end
object centro1: TMenuItem
Caption = 'centro'
ImageIndex = 18
OnClick = centro1Click
end
object direita1: TMenuItem
Caption = 'direita'
ImageIndex = 19
OnClick = direita1Click
end
object justificado1: TMenuItem
Caption = 'justificado'
ImageIndex = 20
OnClick = justificado1Click
end
end
object Marcador1: TMenuItem
Caption = 'Marcador'
ImageIndex = 21
ShortCut = 16461
OnClick = Marcador1Click
end
object Cordefundo1: TMenuItem
Caption = 'Cor de fundo'
ImageIndex = 12
OnClick = Cordefundo1Click
end
end
object OpenDialog1: TOpenDialog
Filter =
'Todos os arquivos [*.*]|*.*|Rich Text [*.rtf]|*.rtf|Arquivos Tex' +
'to [*.txt]|*.txt'
Title = 'Importar arquivo'
Left = 152
Top = 365
end
object ApplicationEvents1: TApplicationEvents
OnException = ApplicationEvents1Exception
Left = 189
Top = 368
end
end
| 50.492756 | 130 | 0.58723 |
838dbfd1e45aaff9f4561f7df429540900ad9c28 | 1,162 | pas | Pascal | ThsFramework/Forms/OutputForms/DbGrid/ufrmAyarPrsTatilTipleri.pas | 3ddark/Ths-Erp-Framewrok | c6569f7f64db10e423d6cc56e91c54184073a9b4 | [
"Unlicense"
]
| 6 | 2019-07-06T23:08:39.000Z | 2021-05-04T19:42:01.000Z | ThsFramework/Forms/OutputForms/DbGrid/ufrmAyarPrsTatilTipleri.pas | 3ddark/Ths-Erp-Framewrok | c6569f7f64db10e423d6cc56e91c54184073a9b4 | [
"Unlicense"
]
| null | null | null | ThsFramework/Forms/OutputForms/DbGrid/ufrmAyarPrsTatilTipleri.pas | 3ddark/Ths-Erp-Framewrok | c6569f7f64db10e423d6cc56e91c54184073a9b4 | [
"Unlicense"
]
| 4 | 2019-03-18T16:57:09.000Z | 2022-02-24T02:33:31.000Z | unit ufrmAyarPrsTatilTipleri;
interface
{$I ThsERP.inc}
uses
System.SysUtils, System.Classes, Vcl.Controls, Vcl.Forms, Data.DB,
Vcl.DBGrids, Vcl.Menus, Vcl.AppEvnts, Vcl.ComCtrls, Vcl.ExtCtrls,
System.ImageList, Vcl.ImgList, Vcl.Samples.Spin, Vcl.StdCtrls, Vcl.Grids,
ufrmBase, ufrmBaseDBGrid;
type
TfrmAyarPrsTatilTipleri = class(TfrmBaseDBGrid)
private
protected
function CreateInputForm(pFormMode: TInputFormMod):TForm; override;
public
published
end;
implementation
uses
Ths.Erp.Database.Singleton,
ufrmAyarPrsTatilTipi,
Ths.Erp.Database.Table.AyarPrsTatilTipi;
{$R *.dfm}
function TfrmAyarPrsTatilTipleri.CreateInputForm(pFormMode: TInputFormMod): TForm;
begin
Result := nil;
if (pFormMode = ifmRewiev) then
Result := TfrmAyarPrsTatilTipi.Create(Application, Self, Table.Clone(), True, pFormMode)
else if (pFormMode = ifmNewRecord) then
Result := TfrmAyarPrsTatilTipi.Create(Application, Self, TAyarPrsTatilTipi.Create(Table.Database), True, pFormMode)
else if (pFormMode = ifmCopyNewRecord) then
Result := TfrmAyarPrsTatilTipi.Create(Application, Self, Table.Clone(), True, pFormMode);
end;
end.
| 26.409091 | 119 | 0.765921 |
f14f8a7e42101d5616ea2231b216c0facd0f4ff9 | 83,642 | pas | Pascal | AlgolV2/Compiler.pas | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| 2 | 2021-02-09T21:54:54.000Z | 2021-09-04T03:30:50.000Z | AlgolV2/Compiler.pas | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| null | null | null | AlgolV2/Compiler.pas | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| null | null | null | unit Compiler;
interface
uses SysUtils, Classes, Generics.Collections, SrcFile, Tokens, CodeGen, U494CodeGen,
Statements, Symbols, Expressions, Literals, Contnrs, AnsiStrings;
type
TTargetType = ( tgtUnknown, tgt494 );
TCompiler = class
private
FSrcFile: TSrcFile;
FAsmFile: TSrcFile;
FTokenGen: TTokenGen;
FBlocks: TBlockStack;
FLiterals: TLiteralList;
FTempVars: TSymbolTable;
FCodeGen: TCodeGen;
FTokenTrace: Boolean;
FInFile: String;
FOutDir: String;
FAsmFileName: String;
FErrorCount: Integer;
FTargetType: TTargetType;
FSymbolNum: Integer;
FSwitchNum: Integer;
FBlockNum: Integer;
FConditionalEndLblNum: Integer;
function Assignment(depth: Integer; dt: TDeclType): Boolean;
function Block(isPgm, isMain, isProc: Boolean): Boolean;
function Declaration: Boolean;
function DesignationalExpr: TExpression;
procedure Endd;
procedure Error(e: String);
function Expression: TExpression;
function FindSymbol(id: AnsiString; st: TSymbolType): TSymbol;
function Forr: Boolean;
function Gotoo: Boolean;
function Iff: Boolean;
function Labell: Boolean;
function NewBlock(isPgm, isMain, isProc: Boolean): TBlock;
function NewSymbol(id: AnsiString; st: TSymbolType; isArray: Boolean): TSymbol;
function ProcedureDecl: Boolean;
function Programm: Boolean;
function Statement: Boolean;
function Write: Boolean;
public
constructor Create;
function Compile(InFile: String; tokenTrace: Boolean; outDir: String;
tgt: TTargetType): Integer;
end;
implementation
uses IOUtils, Math;
{ TCompiler }
function TCompiler.Assignment(depth: Integer; dt: TDeclType): Boolean;
var
ttype1: TTokenType;
token1: AnsiString;
sym: TSymbol;
expr: TExpression;
asg: TExprVariable;
function InAssignment: Boolean;
// We need to scan ahead here to see what the next operator is. If it is := then we are part
// part of an assignment. Otherwise we are part of an expression.
var
save: TTokenStack;
ttype: TTokenType;
token: AnsiString;
t: TToken;
begin
save := TTokenStack.Create;
try
ttype := ttUnknown;
while (ttype <> ttLineSeparator) and (ttype <> ttEof) and (ttype <> ttAssignment) do
begin
FTokenGen.Get(ttype, token);
t.TType := ttype;
t.Value := token;
save.Push(t);
end;
Result := (ttype = ttAssignment);
while (save.Count > 0) do
begin
t := save.Pop;
FTokenGen.Unget(t.TType, t.Value);
end;
finally
save.Free;
end;
end;
procedure Arrayy;
var
ttype: TTokenType;
token: AnsiString;
begin
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
raise Exception.CreateFmt('Expected left bracket following array identifier, got %s', [token]);
//
TExprArray(asg).Subscripts := TList<TExpressionTerm>.Create;
repeat
expr := Expression;
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
Error('Integer expression expected for array subscript');
TExprArray(asg).Subscripts.Add(expr);
FTokenGen.Get(ttype1, token1);
until ttype1 <> ttComma;
if (ttype1 <> ttRightParen) then
begin
Error('Subscript list missing closing bracket');
FTokenGen.Unget(ttype1, token1);
end;
if (TExprArray(asg).Subscripts.Count <> sym.ArraySubscripts) then
Error(Format('Incorrect number of array subscripts for %s', [sym.ID]));
end;
procedure Stringg;
// Check to see if substring specified and return the start and end values of
// the substring.
var
ttype: TTokenType;
token: AnsiString;
elit: TExprLiteral;
lit: TLiteral;
begin
// Check for left paren. If not present, we are done.
FTokenGen.Get(ttype, token);
if (sym.IsArray and (ttype <> ttLeftParen)) then
raise Exception.CreateFmt('Expected left bracket following array identifier, got %s', [token]);
if (ttype <> ttLeftParen) then
begin
FTokenGen.Unget(ttype, token);
Exit;
end;
// This gets complicated. Values given inside [] may be either
// substring start / length or array subscripts or both.
//
// First gather all values until we see something that is not a
// comma. If variable is not an array then values are substring
// start / length and we are done.
//
// If variable is an array and next token is not a colon then
// values are array subscripts and we are done.
//
// If next value is a token, copy assumed array subscripts to
// substring start / length and continue parsing to find array
// subscripts.
if (asg) is TExprArray then
TExprArray(asg).Subscripts := TList<TExpressionTerm>.Create;
repeat
expr := Expression;
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
Error('Integer expression expected for substring / array subscript');
if (sym.IsArray) then
TExprArray(asg).Subscripts.Add(expr)
else if (not Assigned(TExprVariable(asg).StringStart)) then
TExprVariable(asg).StringStart := expr
else if (not Assigned(TExprVariable(asg).StringLength)) then
TExprVariable(asg).StringLength := expr
else
begin
Error('Too many values given for substring');
end;
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
//
if (ttype = ttColon) then
begin
if (sym.IsArray) then
begin
if (TExprArray(asg).Subscripts.Count > 2) then
begin
Error('Too many values given for substring');
end else
begin
with TExprArray(asg) do
begin
StringStart := Subscripts[0];
Subscripts.Delete(0);
if (Subscripts.Count > 0) then
begin
StringLength := Subscripts[1];
Subscripts.Delete(0);
end;
end;
end;
repeat
expr := Expression;
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
begin
Error('Integer expression expected for array subscript');
end;
TExprArray(asg).Subscripts.Add(expr);
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
end else
begin
Error('Colon only allowed for string arrays');
end;
end;
//
if (ttype <> ttRightParen) then
begin
Error(Format('Right bracket expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
if (sym.IsArray) then
begin
if (TExprArray(asg).Subscripts.Count <> sym.ArraySubscripts) then
Error('Incorrect number of array subscripts');
end;
with TExprVariable(asg) do
begin
if (Assigned(StringStart) and (not Assigned(StringLength))) then
begin
elit := TExprLiteral.Create;
lit := TLiteral.Create;
lit.Value := '1';
lit.DeclType := dtInteger;
elit.Literal := lit;
StringLength := elit;
end;
end;
end;
begin
Result := False;
FTokenGen.Get(ttype1, token1);
if (ttype1 <> ttIdentifier) then
begin
FTokenGen.Unget(ttype1, token1);
Exit;
end;
if (not InAssignment) then
begin
FTokenGen.Unget(ttype1, token1);
Exit;
end;
Result := True;
expr := nil;
asg := nil;
sym := FindSymbol(token1, stVariable);
if (not Assigned(sym)) then
begin
Error(Format('%s is undefined', [token1]));
FTokenGen.FlushLine;
Exit;
end;
try
if (Assigned(sym)) then
begin
if ((sym.DeclType <> dt) and (dt <> dtUnknown)) then
Error('All variables in an assignment must be the same type');
if (sym.IsArray) then
asg := TExprArray.Create
else
asg := TExprVariable.Create;
asg.Symbol := sym;
if (sym.DeclType = dtString) then
begin
try
Stringg;
except
on E: Exception do
begin
Error(E.Message);
FTokenGen.FlushLine;
Exit;
end;
end;
end else
begin
if (sym.IsArray) then
begin
try
Arrayy;
except
on E: Exception do
begin
Error(E.Message);
FTokenGen.FlushLine;
Exit;
end;
end;
end;
end;
end;
// burn to := operator
FTokenGen.Get(ttype1, token1);
if (ttype1 <> ttAssignment) then
raise Exception.CreateFmt('OOPS! Internal error. Expected := got %s', [token1]);
if (not Assignment(depth + 1, sym.DeclType)) then
begin
expr := Expression;
if (not Assigned(expr)) then
begin
Error('Expected an assignment or an expression following :=');
FTokenGen.Get(ttype1, token1);
while ((ttype1 <> ttLineSeparator) and (ttype1 <> ttEof)) do
FTokenGen.Get(ttype1, token1);
Exit;
end else if (expr.ErrorCount <> 0) then
begin
Exit;
end else if (Assigned(sym) and
((sym.DeclType = dtReal) and (not expr.IsNumeric)) or
((sym.DeclType = dtInteger) and ( not expr.IsNumeric))) then
begin
Error('Target variable type does not match expression type');
Exit;
end else if (Assigned(sym) and (sym.DeclType = dtLogical) and (expr.TargetDecl <> dtLogical)) then
begin
Error('Not a boolean expression');
Exit;
end;
FCodeGen.Expression(expr);
end;
if (depth = 0) then
begin
FTokenGen.Get(ttype1, token1);
if (ttype1 <> ttLineSeparator) then
begin
Error(Format('Expected line separator, got %s', [token1]));
FTokenGen.Unget(ttype1, token1);
end;
end;
if (Assigned(asg)) then
FCodeGen.Assignment(asg, expr, depth);
finally
expr.Free;
asg.Free;
end;
end;
function TCompiler.Block(isPgm, isMain, isProc: Boolean): Boolean;
var
ttype: TTokenType;
token: AnsiString;
b: TBlock;
I: Integer;
begin
FTokenGen.Get(ttype, token);
if ((ttype = ttLabel) or (ttype = ttBegin)) then
begin
if (isPgm) then
FCodeGen.PgmStart(isMain);
end;
FTokenGen.Unget(ttype, token);
while (Labell) do
;
FTokenGen.Get(ttype, token);
if (ttype <> ttBegin) then
begin
Result := False;
FTokenGen.Unget(ttype, token);
Exit;
end;
FTokenGen.Get(ttype, token);
if (ttype = ttComment) then
FTokenGen.FlushLine
else
FTokenGen.Unget(ttype, token);
Result := True;
b := NewBlock(False, isMain, isProc);
FBlocks.Push(b);
try
FCodeGen.BlockBegin(b);
while (Declaration) do
;
FCodeGen.BlockStart(b);
while (Statement) do
;
FTokenGen.Get(ttype, token);
if (ttype = ttEnd) then
begin
Endd;
for i := 0 to b.Symbols.Count - 1 do
begin
if (b.Symbols.Symbols[i].IsForward) then
Error(Format('Forward symbol %s not defined', [b.Symbols.Symbols[i].ID]));
end;
FCodeGen.BlockEnd(b);
end else
begin
Error(Format('Expected END, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
finally
FBlocks.Pop.Free;
end;
end;
function TCompiler.Compile(InFile: String; tokenTrace: Boolean; outDir: String;
tgt: TTargetType): Integer;
var
ispgm: Boolean;
begin
try
FInFile := InFile;
FTokenTrace := tokenTrace;
FOutDir := outDir;
FTargetType := tgt;
FSrcFile := TSrcFile.Create(InFile);
FAsmFileName := TPath.GetDirectoryName(InFile) + '\' +
TPath.GetFileNameWithoutExtension(InFile) + '.s';
FAsmFile := TSrcFile.Create(FAsmFileName, fmCreate);
case FTargetType of
tgtUnknown: raise Exception.Create('Unknown target type');
tgt494: FCodeGen := T494CodeGen.Create(FAsmFile);
end;
FTokenGen := TTokenGen.Create(FSrcFile, FCodeGen, FTokenTrace);
ispgm := Programm;
if (not ispgm) then
begin
while (ProcedureDecl) do // If not a program, do external subroutines
;
end;
FCodeGen.PgmEnd(ispgm, FLiterals, FTempVars);
except
on E: Exception do
begin
WriteLn(E.Message);
Inc(FErrorCount);
end;
end;
FreeAndNil(FCodeGen);
FreeAndNil(FSrcFile);
FreeAndNil(FAsmFile);
WriteLn(Format('%-20.20s: %d error(s) encountered', [TPath.GetFileName(FInFIle), FErrorCount]));
Result := FErrorCount;
end;
constructor TCompiler.Create;
begin
FBlocks := TBlockStack.Create;
FLiterals := TLiteralList.Create;
FTempVars := TSymbolTable.Create;
end;
function TCompiler.Declaration: Boolean;
var
ttype: TTokenType;
token: AnsiString;
d: TDeclaration;
sym: TSymbol;
b: TBlock;
done: Boolean;
procedure ArraySubscripts; forward;
function SubString(id: AnsiString; sym: TSymbol): Integer;
var
ttype: TTokenType;
token: AnsiString;
len: Integer;
sub: TSubstringSymbol;
sym1: TSymbol;
begin
Result := 0;
if (b.Symbols.TryGetValue(id, stAny, sym1)) then
begin
Error(Format('%s is multipy defined', [id]));
Exit;
end;
sub := TSubstringSymbol.Create;
sub.ID := id;
sub.SymbolType := stVariable;
sub.DeclType := dtString;
sub.IsStatic := sym.IsStatic;
if (sym is TSubstringSymbol) then
begin
sub.Start := TSubstringSymbol(sym).Start +
TSubstringSymbol(sym).Length;
sub.Container := TSubstringSymbol(sym).Container;
sub.SymbolNum := TSubstringSymbol(sym).SymbolNum;
end else
begin
sub.Start := sym.StringLength + 1;
sub.Container := sym;
sub.SymbolNum := sym.SymbolNum;
end;
b.Symbols.Add(id, sub);
//
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
begin
Error(Format('Left bracket expected for substring, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
while ((ttype <> ttRightParen) and (ttype <> ttLineSeparator) and (ttype <> ttEof)) do
begin
FTokenGen.Get(ttype, token);
if (ttype = ttInteger) then
begin
if (not TryStrToInt(String(token), len)) then
len := 0;
if ((len < 1) or (len > 32767)) then
Error('String length must be >= 1 and < 32K');
Inc(sub.Length, len);
end else if (ttype = ttIdentifier) then
begin
Inc(sub.Length, SubString(token, sub));
end else if (ttype = ttComma) then
begin
;
end else
Break;
end;
if (ttype <> ttRightParen) then
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected right bracket to end substring, got %s', [token]));
end {else
FTokenGen.Get(ttype, token)};
Result := sub.Length;
end;
procedure SubscriptsToSubstrings(sym: TSymbol);
var
i: Integer;
sym1: TSymbol;
begin
for i := 0 to b.Symbols.Count - 1 do
begin
sym1 := b.Symbols.Symbols[i];
if (sym1 is TSubstringSymbol) then
begin
if (TSubstringSymbol(sym1).Container = sym) then
begin
sym1.IsArray := True;
sym1.ArraySubscripts := sym.ArraySubscripts;
sym1.ArraySize := sym.ArraySize;
end;
end;
end;
end;
procedure Stringg(sym: TSymbol);
var
len: Integer;
begin
sym.StringLength := 0;
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
begin
FTokenGen.Unget(ttype, token);
Error(Format('Left bracket expected following STRING declaration, got %s', [token]));
Exit;
end;
while ((ttype <> ttRightParen) and (ttype <> ttLineSeparator) and (ttype <> ttEof)) do
begin
FTokenGen.Get(ttype, token);
if (ttype = ttInteger) then
begin
if (not TryStrToInt(String(token), len)) then
len := 0;
if ((len < 1) or (len > 32767)) then
Error('String length must be >= 1 and < 32K');
Inc(sym.StringLength, len);
end else if (ttype = ttIdentifier) then
begin
Inc(sym.StringLength, SubString(token, sym));
end else if (ttype = ttComma) then
begin
;
end else if (ttype = ttColon) then
begin
sym.IsArray := True;
ArraySubscripts;
SubscriptsToSubstrings(sym);
Inc(MinHeapSize, sym.ArraySize);
FCodeGen.NewArray(sym);
end else
Break;
end;
if (ttype <> ttRightParen) then
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected right bracket to end STRING, got %s', [token]));
end;
Inc(MinHeapSize, sym.StringLength + 1);
end;
function Variable(isArray: Boolean): TSymbol;
begin
Result := nil;
if (b.Symbols.TryGetValue(token, stAny, sym)) then
begin
Error(Format('%s is multipy defined', [token]));
Exit;
end;
sym := NewSymbol(token, stVariable, isArray);
Result := sym;
b.Symbols.Add(token, sym);
sym.DeclType := d.DType;
if (b.IsProc) then
sym.IsStatic := False
else
sym.IsStatic := True;
if (sym.DeclType = dtString) then
Stringg(sym);
if (sym.IsStatic) then
FCodeGen.StaticVar(sym)
else
FCodeGen.StackVar(sym);
end;
procedure Local;
var
st: TSymbolType;
begin
FTokenGen.Get(ttype, token);
if (token = 'LABEL') then
st := stLabel
else
begin
Error(Format('%s is not valid for LOCAL', [token]));
FTokenGen.FlushLine;
Exit;
end;
b := FBlocks.Peek;
done := False;
while (not done) do
begin
FTokenGen.Get(ttype, token);
case ttype of
ttIdentifier:
begin
if (b.Symbols.TryGetValue(token, stAny, sym)) then
begin
Error(Format('%s is multipy defined', [token]));
Exit;
end;
sym := NewSymbol(token, st, False);
b.Symbols.Add(token, sym);
sym.IsForward := True;
end;
ttEof:
begin
Error('Unexpected end-of-file');
Exit;
end;
ttLineSeparator:
done := True;
ttComma:
Continue;
else
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected identifier or comma, got %s', [token]));
Exit;
end;
end;
end;
end;
procedure Switch;
var
swtch: TSwitchSymbol;
expr: TExpression;
begin
FTokenGen.Get(ttype, token);
if (ttype <> ttIdentifier) then
begin
Error(Format('Identifier expected got %s', [token]));
FTokenGen.FlushLine;
Exit;
end;
b := FBlocks.Peek;
if (b.Symbols.TryGetValue(token, stSwitch, sym)) then
begin
Error(Format('%s is multiply defined', [token]));
FTokenGen.FlushLine;
Exit;
end;
sym := NewSymbol(token, stSwitch, False);
b.Symbols.Add(token, sym);
swtch := (TSwitchSymbol(sym));
FTokenGen.Get(ttype, token);
if (ttype <> ttAssignment) then
begin
Error(Format('Equal sign expected got %s', [token]));
FTokenGen.FlushLine;
Exit;
end;
done := False;
while (not done) do
begin
Inc(FSwitchNum);
if (swtch.FirstSwitchNum = 0) then
swtch.FirstSwitchNum := FSwitchNum;
expr := DesignationalExpr;
if (Assigned(expr)) then
swtch.Targets.Add(expr)
else
Error('Designational expression expected.');
FTokenGen.Get(ttype, token);
if (ttype = ttComma) then
Continue
else if (ttype = ttLineSeparator) then
done := True
else
begin
Error(Format('Comma or line separator expected, got %s', [token]));
FTokenGen.FlushLine;
end;
end;
FCodeGen.Switch(swtch);
end;
procedure ArraySubscripts;
var
expr: TExpression;
i, len, i1, i2: Integer;
allLiterals: Boolean;
begin
allLiterals := True;
sym.ArraySubscripts := 0;
Inc(FSymbolNum);
sym.NewArrayLabelNum := FSymbolNum;
repeat
expr := Expression;
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
Error('Subscript expressions must be of type integer');
sym.Indices.Add(expr);
FTokenGen.Get(ttype, token);
if (ttype = ttColon) then
begin
expr := Expression;
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
Error('Subscript expressions must be of type integer');
if (Assigned(expr) and (not (TExpressionTerm(expr) is TExprLiteral))) then
allLiterals := False;
sym.Indices.Add(expr);
end else
raise Exception.Create('Subscript not of form ll:uu');
Inc(sym.ArraySubscripts);
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
if (ttype <> ttRightParen) then
begin
FTokenGen.Unget(ttype, token);
Error('Subscript list missing closing bracket');
end;
if (sym.ArraySubscripts > 10) then
Error('Too many array subscripts (max. 10)');
// Calculate total length of static arrays
sym.ArraySize := 0;
if (allLiterals) then
begin
case sym.DeclType of
dtInteger,
dtLogical:
len := 1;
dtReal:
len := 2;
dtString:
len := ((sym.StringLength - 1) div 5) + 2;
else
len := 1;
end;
for i := sym.Indices.Count - 1 downto 0 do
begin
if ((i mod 2) = 0) then
begin
if (not TryStrToInt(String(TExprLiteral(sym.Indices[i]).Literal.Value), i1)) then
i1 := 0;
len := ((i2 - i1) + 1) * len
end else
begin
if (not TryStrToInt(String(TExprLiteral(sym.Indices[i]).Literal.Value), i2)) then
i2 := 0;
end;
end;
sym.ArraySize := len + sym.Indices.Count + 1;
end;
end;
procedure SubscriptsToPrior(syms: TList<TSymbol>);
// Make all preceeding variables reference the same
// array defintion.
var
sym1: TSymbol;
begin
for sym1 in syms do
begin
if (sym1 <> sym) then
begin
sym1.ArraySubscripts := sym.ArraySubscripts;
sym1.NewArrayLabelNum := sym.NewArrayLabelNum;
sym1.ArraySize := sym.ArraySize;
Inc(MinHeapSize, sym.ArraySize);
end;
end;
syms.Clear;
end;
procedure Arrayy;
var
syms: TList<TSymbol>;
begin
syms := TList<TSymbol>.Create;
try
FTokenGen.Get(ttype, token);
while (ttype = ttIdentifier) do
begin
sym := Variable(True);
syms.Add(sym);
if ((sym.DeclType = dtString) and (sym.ArraySubscripts <> 0)) then
SubscriptsToPrior(syms);
FTokenGen.Get(ttype, token);
if (ttype = ttComma) then
begin
FTokenGen.Get(ttype, token);
Continue;
end else if (sym.DeclType = dtString) then
begin
Continue;
end else if (ttype <> ttLeftParen) then
begin
FTokenGen.Unget(ttype, token);
Error('An array declaration must specify some subscripts');
Break;
end;
try
ArraySubscripts;
Inc(MinHeapSize, sym.ArraySize);
FCodeGen.NewArray(sym);
except
on E: Exception do
begin
Error(E.Message);
FTokenGen.FlushLine;
end;
end;
SubscriptsToPrior(syms);
FTokenGen.Get(ttype, token);
if (ttype = ttComma) then
FTokenGen.Get(ttype, token);
end;
if (ttype <> ttLineSeparator) then
begin
Error(Format('Line separator expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
finally
syms.Free;
end;
end;
begin
if (ProcedureDecl) then
begin
Result := True;
Exit;
end;
FTokenGen.Get(ttype, token);
if (ttype = ttComment) then
begin
FTokenGen.FlushLine;
Result := True;
Exit;
end else if (token = 'LOCAL') then
begin
Result := True;
Local;
Exit;
end else if (token = 'SWITCH') then
begin
Result := True;
Switch;
Exit;
end;
if (ttype = ttDeclarator) then
begin
for d in DeclTypes do
begin
if (d.ID = token) then
Break;
end;
if (d.DType = dtArray) then
begin
Result := True;
Error('Variable type required before ARRAY');
Exit;
end;
if (d.DType = dtUnknown) then
begin
Result := False;
FTokenGen.Unget(ttype, token);
Exit;
end;
end else
begin
Result := False;
FTokenGen.Unget(ttype, token);
Exit;
end;
Result := True;
b := FBlocks.Peek;
FTokenGen.Get(ttype, token);
if (token = 'ARRAY') then
begin
Result := True;
Arrayy;
Exit;
end else
FTokenGen.Unget(ttype, token);
done := False;
while (not done) do
begin
FTokenGen.Get(ttype, token);
case ttype of
ttIdentifier:
Variable(False);
ttEof:
begin
Error('Unexpected end-of-file');
Exit;
end;
ttLineSeparator:
done := True;
ttComma:
Continue;
else
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected identifier or comma, got %s', [token]));
Exit;
end;
end;
end;
end;
function TCompiler.DesignationalExpr: TExpression;
var
ttype: TTokenType;
token: AnsiString;
sym: TSymbol;
elbl: TExprLabel;
eswtch: TExprSwitch;
iff: TExprIf;
begin
Result := nil;
FTokenGen.Get(ttype, token);
case ttype of
ttIdentifier:
begin
sym := FindSymbol(token, stLabel);
if (Assigned(sym)) then
begin
elbl := TExprLabel.Create;
elbl.Symbol := sym;
Result := TExpression(elbl);
end else
begin
sym := FindSymbol(token, stSwitch);
if (Assigned(sym)) then
begin
eswtch := TExprSwitch.Create;
eswtch.Symbol := sym;
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
Error(Format('Expected left bracket, got %s', [token]));
eswtch.Index := Expression;
if (eswtch.Index.TargetDecl <> dtInteger) then
Error(Format('Integer expression expected for SWITCH %s', [eswtch.Symbol.ID]));
FTokenGen.Get(ttype, token);
if (ttype <> ttRightParen) then
Error(Format('Expected right bracket, got %s', [token]));
Result := TExpression(eswtch);
end else
begin
Error(Format('%s is not a LABEL or a SWITCH', [token]));
end;
end;
end;
ttIf:
begin
iff := TExprIf.Create;
iff.IfExpr := Expression;
if (iff.IfExpr.TargetDecl = dtLogical) then
begin
FTokenGen.Get(ttype, token);
if (token <> 'THEN') then
begin
Error(Format('THEN expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
iff.ElseLblNum := FSymbolNum + 1;
iff.EndLblNum := FSymbolNum + 2;
Inc(FSymbolNum, 2);
iff.ThenExpr := DesignationalExpr;
if (not Assigned(iff.ThenExpr)) then
Error('Designational expression expected following THEN');
if (Assigned(iff.ThenExpr) and (iff.ThenExpr is TExprIf)) then
Error('IF not allowed following THEN');
FTokenGen.Get(ttype, token);
if (token <> 'ELSE') then
begin
Error(Format('ELSE expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
iff.ElseExpr := DesignationalExpr;
if (not Assigned(iff.ElseExpr)) then
Error('Designational expression expected following ELSE');
Result := TExpression(iff);
end else
begin
Error('Relational expression expected following IF');
end;
end;
end;
end;
procedure TCompiler.Endd;
var
ttype: TTokenType;
token: AnsiString;
begin
FTokenGen.Get(ttype, token);
while ((ttype <> ttEof) and (ttype <> ttEnd) and
(ttype <> ttLineSeparator) and (token <> 'ELSE')) do
FTokenGen.Get(ttype, token);
FTokenGen.Unget(ttype, token);
end;
procedure TCompiler.Error(e: String);
var
s: String;
begin
s := Format('%d: %s', [FSrcFile.LineNum, e]);
WriteLn(s);
FCodeGen.Comment(AnsiString('**** ' + s));
Inc(FerrorCount);
end;
function TCompiler.Expression: TExpression;
const
oprs: array [TExprOperatorType] of AnsiString = (
'**', '-', '*', '/', '//', '+', '-', 'LSS', 'LEQ',
'GTR', 'GEQ', 'EQL', 'NEQ', 'NOT', 'AND', 'OR',
'XOR', 'IMPL', 'EQUIV', 'IF', 'THEN', 'ELSE',
'GET_ARRAY', 'PUSH', 'SIGN', 'UNK'
);
function Factor(priorityLevel, condDepth: Integer; var errCount: Integer): TExpressionTerm; forward;
function OperatorType(opr: AnsiString): TExprOperatorType;
var
i: TExprOperatorType;
begin
for i := Low(oprs) to High(oprs) do
begin
if (opr = oprs[i]) then
begin
Result := i;
Exit;
end;
end;
Result := otUnknown;
end;
function PriorityMatch(opr: AnsiString; priorityLevel: Integer): Boolean;
var
s: AnsiString;
begin
Result := False;
for s in ExprOprPriorities[priorityLevel] do
begin
if (s = opr) then
begin
Result := True;
Break;
end;
end;
end;
function Arrayy(var errCount: Integer; condDepth: Integer; sym: TSymbol): TExpressionTerm;
var
ttype: TTokenType;
token: AnsiString;
expr: TExpressionTerm;
arr: TExprArray;
opr: TExprOperator;
// process array items by treating the array bracket as a high priority operator
begin
Result := nil;
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected left bracket following array identifier, got %s', [token]));
Inc(errCount);
Exit;
end;
arr := TExprArray.Create;
arr.Symbol := sym;
repeat
expr := Factor(0, condDepth, errCount);
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
begin
Error('Integer expression expected for array subscript');
Inc(errCount);
end;
arr.Subscripts.Add(expr);
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
if (ttype <> ttRightParen) then
begin
FTokenGen.Unget(ttype, token);
Error(Format('Expected right bracket, got %s', [token]));
end;
if (arr.Subscripts.Count <> sym.ArraySubscripts) then
begin
Error('Incorrect number of array subscripts');
Inc(errCount);
end;
opr := TExprOperator.Create;
opr.OType := otGetArray;
opr.Right := arr;
opr.TargetDecl := sym.DeclType;
Result := opr;
end;
function Stringg(var errCount: Integer; condDepth: Integer; sym: TSymbol): TExpressionTerm;
// Check to see if substring specified and return the start and end values of
// the substring.
var
ttype: TTokenType;
token: AnsiString;
expr: TExpressionTerm;
opr: TExprOperator;
elit: TExprLiteral;
lit: TLiteral;
begin
if (sym.IsArray) then
Result := TExprArray.Create
else
Result := TExprVariable.Create;
TExprVariable(Result).Symbol := sym;
TExprVariable(Result).TargetDecl := sym.DeclType;
// Check for left paren. If not present, we are done.
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
begin
if (sym.IsArray) then
begin
Error(Format('Left bracket expected for array reference, got %s', [token]));
Inc(errCount);
end;
FTokenGen.Unget(ttype, token);
Exit;
end;
// This gets complicated. Values given inside [] may be either
// substring start / length or array subscripts or both.
//
// First gather all values until we see something that is not a
// comma. If variable is not an array then values are substring
// start / length and we are done.
//
// If variable is an array and next token is not a colon then
// values are array subscripts and we are done.
//
// If next value is a token, copy assumed array subscripts to
// substring start / length and continue parsing to find array
// subscripts.
repeat
expr := Factor(0, condDepth, errCount);
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
begin
Error('Integer expression expected for substring / array subscript');
Inc(errCount);
end;
if (sym.IsArray) then
TExprArray(Result).Subscripts.Add(expr)
else if (not Assigned(TExprVariable(Result).StringStart)) then
TExprVariable(Result).StringStart := expr
else if (not Assigned(TExprVariable(Result).StringLength)) then
TExprVariable(Result).StringLength := expr
else
begin
Error('Too many values given for substring');
Inc(errCount);
end;
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
//
if (ttype = ttColon) then
begin
if (sym.IsArray) then
begin
if (TExprArray(Result).Subscripts.Count > 2) then
begin
Error('Too many values given for substring');
Inc(errCount);
end else
begin
with TExprArray(Result) do
begin
StringStart := Subscripts[0];
Subscripts.Delete(0);
if (Subscripts.Count > 0) then
begin
StringLength := Subscripts[1];
Subscripts.Delete(0);
end;
end;
end;
repeat
expr := Factor(0, condDepth, errCount);
if ((not Assigned(expr)) or (expr.TargetDecl <> dtInteger)) then
begin
Error('Integer expression expected for array subscript');
Inc(errCount);
end;
TExprArray(Result).Subscripts.Add(expr);
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
end else
begin
Error('Colon only allowed for string arrays');
Inc(errCount);
end;
end;
//
if (ttype <> ttRightParen) then
begin
Error(Format('Right bracket expected, got %s', [token]));
Inc(errCount);
FTokenGen.Unget(ttype, token);
end;
with TExprVariable(Result) do
begin
if (Assigned(StringStart) and (not Assigned(StringLength))) then
begin
elit := TExprLiteral.Create;
lit := TLiteral.Create;
lit.Value := '1';
lit.DeclType := dtInteger;
elit.Literal := lit;
StringLength := elit;
end;
end;
if (sym.IsArray) then
begin
if (TExprArray(Result).Subscripts.Count <> sym.ArraySubscripts) then
begin
Error('Incorrect number of array subscripts');
Inc(errCount);
end;
opr := TExprOperator.Create;
opr.OType := otGetArray;
opr.Right := Result;
opr.TargetDecl := sym.DeclType;
Result := opr;
end;
end;
function Operand(var errCount: Integer; condDepth: Integer): TExpressionTerm;
// top of the priority hierarchy. Looking for identifiers, literals
// and parentheses.
var
ttype: TTokenType;
token: AnsiString;
i, itemp: Integer;
ftemp: Double;
sym: TSymbol;
evar: TExprVariable;
elit: TExprLiteral;
ifOpr: TExprIf;
begin
Result := nil;
try
FTokenGen.Get(ttype, token);
case ttype of
ttIf:
begin
ifOpr := TExprIf.Create;
ifOpr.IfExpr := Factor(0, condDepth, errCount);
if ((not Assigned(ifOpr.IfExpr)) or (ifOpr.IfExpr.DeclType <> dtLogical)) then
begin
Error('Boolean expression expected following IF');
Inc(errCount);
end;
Inc(FSymbolNum);
ifOpr.ElseLblNum := FSymbolNum;
// If we are parsing the outermost IF then we need to set the label number
// of the label marking the end of the entire IF chain.
if (condDepth = 0) then
begin
Inc(FSymbolNum);
FConditionalEndLblNum := FSymbolNum;
end;
ifOpr.EndLblNum := FConditionalEndLblNum;
ifOpr.ConditionalDepth := condDepth;
Inc(condDepth);
FTokenGen.Get(ttype, token);
if (token <> 'THEN') then
begin
Error(Format('THEN expected, got %s', [token]));
Inc(errCount);
FTokenGen.Unget(ttype, token);
end;
ifOpr.ThenExpr := Factor(0, condDepth, errCount);
if (not Assigned(ifOpr.ThenExpr)) then
raise Exception.Create('Expression expected following THEN');
if (Assigned(ifOpr.ThenExpr) and (ifOpr.ThenExpr is TExprIf)) then
begin
Error('IF not allowed following THEN');
Inc(errCount);
end;
FTokenGen.Get(ttype, token);
if (token <> 'ELSE') then
begin
Error(Format('ELSE expected, got %s', [token]));
Inc(errCount);
FTokenGen.Unget(ttype, token);
end;
IfOpr.ElseExpr := Factor(0, condDepth, errCount);
if (not Assigned(ifOpr.ElseExpr)) then
raise Exception.Create('Expression expected following ELSE');
Result := ifOpr;
Exit;
end;
ttIdentifier:
begin
sym := FindSymbol(token, stVariable);
if (not Assigned(sym)) then
begin
Error(Format('%s is undefined', [token]));
sym := NewSymbol(token, stVariable, False);
sym.DeclType := dtInteger;
Inc(errCount);
end;
if (sym.DeclType = dtString) then
Result := Stringg(errCount, condDepth, sym)
else if (sym.IsArray) then
Result := Arrayy(errCount, condDepth, sym)
else
begin
evar := TExprVariable.Create;
evar.Symbol := sym;
evar.TargetDecl := sym.DeclType;
Result := evar;
end;
Exit;
end;
ttInteger:
begin
if (not TryStrToInt(String(token), itemp)) then
begin
Error(Format('%s is not a valid integer', [token]));
Inc(errCount);
end;
i := FLiterals.Add(dtInteger, token);
elit := TExprLiteral.Create;
elit.Literal := FLiterals[i];
elit.TargetDecl := dtInteger;
Result := elit;
Exit;
end;
ttReal:
begin
if (not TryStrToFloat(String(token), ftemp)) then
begin
Error(Format('%s is not a valid real number', [token]));
Inc(errCount);
end;
if (token[1] = '.') then
token := '0' + token;
i := FLiterals.Add(dtReal, token);
elit := TExprLiteral.Create;
elit.Literal := FLiterals[i];
elit.TargetDecl := dtReal;
Result := elit;
Exit;
end;
ttEof:
begin
FTokenGen.Unget(ttype, token);
raise Exception.Create('Unexpected end-of-file');
end;
ttLineSeparator:
begin
FTokenGen.Unget(ttype, token);
raise Exception.Create('Expression syntax error');
end;
ttLeftParen:
begin
Result := Expression;
Inc(errCount, Result.ErrorCount);
FTokenGen.Get(ttype, token);
if (ttype <> ttRightParen) then
raise Exception.Create('Unbalanced parenthese');
end;
ttLogicalValue:
begin
if (token = 'TRUE') then
i := FLiterals.Add(dtLogical, '1')
else
i := FLiterals.Add(dtLogical, '0');
elit := TExprLiteral.Create;
elit.Literal := FLiterals[i];
elit.TargetDecl := dtLogical;
Result := elit;
Exit;
end;
ttString:
begin
i := FLiterals.Add(dtString, token);
elit := TExprLiteral.Create;
elit.Literal := FLiterals[i];
elit.TargetDecl := dtString;
Result := elit;
Exit;
end;
else
begin
FTokenGen.Unget(ttype, token);
raise Exception.Create('Expression Syntax error');
end;
end;
except
on E: Exception do
begin
Error(E.Message);
Inc(errCount);
FreeAndNil(Result);
end;
end;
end;
procedure CheckOperands(opr: TExprOperator; var errCount: Integer);
// Validate operand types against the operator type.
begin
if ((not Assigned(opr.Left)) and (not Assigned(opr.Right))) then
Exit;
if (Assigned(opr.Left)) then
begin
opr.TargetDecl := opr.Left.DeclType;
opr.Left.TargetDecl := opr.Left.DeclType;
opr.Right.TargetDecl := opr.Right.DeclType;
if ((opr.Right.DeclType = dtInteger) and (opr.Left.DeclType = dtReal)) then
begin
opr.Right.TargetDecl := dtReal;
opr.TargetDecl := dtReal;
end;
if ((opr.Left.DeclType = dtInteger) and (opr.Right.DeclType = dtReal)) then
begin
opr.Left.TargetDecl := dtReal;
opr.TargetDecl := dtReal;
end;
if (opr.IsLogical or opr.IsRelational) then
opr.TargetDecl := dtLogical;
if ((opr.OType = otExponent) or (opr.OType = otDivide)) then
begin
opr.Left.TargetDecl := dtReal;
opr.Right.TargetDecl := dtReal;
opr.TargetDecl := dtReal;
end else if (opr.OType = otIntDivide) then
begin
if ((opr.Left.DeclType <> dtInteger) or (opr.Right.DeclType <> dtInteger)) then
begin
Error('Both operands of integer divide must be integer');
Inc(errCount);
end;
end;
if (opr.IsArithmetic and (not (opr.Left.TargetIsNumeric and opr.Right.TargetIsNumeric))) then
begin
Error('Non-numeric operand specified for arithmetic operator');
Inc(errCount);
end;
if (opr.IsRelational and
(not ((opr.Left.TargetIsNumeric and opr.Right.TargetIsNumeric) or
(opr.Left.TargetIsString and opr.Right.TargetIsString)))) then
begin
Error('Non-numeric or non-string operand(s) specified for relational operator');
Inc(errCount);
end;
if (opr.IsLogical and (not (opr.Left.TargetIsLogical and opr.Right.TargetIsLogical))) then
begin
Error('Non-logical operand specified for logical operator');
Inc(errCount);
end;
end else
begin
opr.Right.TargetDecl := opr.Right.DeclType;
if (opr.IsArithmetic and (not opr.Right.TargetIsNumeric)) then
begin
Error('Non-numeric operand specified for unary minus');
Inc(errCount);
end;
if (opr.IsLogical and (not opr.Right.TargetIsLogical)) then
begin
Error('Non-logical operand specified for NOT');
Inc(errCount);
end;
end;
end;
function Reduce(opr: TExprOperator): TExpressionTerm;
// Reduce expressions consisting of only literals to a single literal.
var
lint, rint, irslt, i: Integer;
lflt, rflt, rrslt: Double;
tgt: TDeclType;
lit: TExprLiteral;
iff: TExprIf;
stemp: AnsiString;
begin
Result := opr;
irslt := 0;
rrslt := 0;
if (opr is TExprIf) then
begin
// Special processing for IF expressions
iff := TExprIf(opr);
if ((iff.ThenExpr.TargetDecl = dtReal) and (iff.ElseExpr.TargetDecl = dtInteger)) then
iff.ElseExpr.TargetDecl := dtReal;
if ((iff.ThenExpr.TargetDecl = dtInteger) and (iff.ElseExpr.TargetDecl = dtReal)) then
iff.ThenExpr.TargetDecl := dtReal;
iff.TargetDecl := iff.ThenExpr.TargetDecl;
Exit;
end;
if ((not Assigned(opr.Left)) and (not Assigned(opr.Right))) then
Exit;
if (Assigned(opr.Left)) then
begin
if (opr.Left is TExprLiteral) then
begin
if ((opr.Left.TargetDecl = dtReal) and (opr.Left.DeclType = dtInteger)) then
begin
stemp := TExprLiteral(opr.Left).Literal.Value + '.0';
if (stemp[1] = '.') then
stemp := '0' + stemp;
i := FLiterals.Add(dtReal, stemp);
Dec(TExprLiteral(opr.Left).Literal.RefCount);
TExprLiteral(opr.Left).Literal := FLiterals[i];
end;
end;
if (opr.Right is TExprLiteral) then
begin
if ((opr.Right.TargetDecl = dtReal) and (opr.Right.DeclType = dtInteger)) then
begin
stemp := TExprLiteral(opr.Right).Literal.Value + '.0';
if (stemp[1] = '.') then
stemp := '0' + stemp;
i := FLiterals.Add(dtReal, stemp);
Dec(TExprLiteral(opr.Right).Literal.RefCount);
TExprLiteral(opr.Right).Literal := FLiterals[i];
end;
end;
if ((not (opr.Left is TExprLiteral)) or (not (opr.Right is TExprLiteral))) then
Exit;
if ((opr.Left.DeclType = dtReal) or (opr.Right.DeclType = dtReal)) then
begin
tgt := dtReal;
if (not TryStrToFloat(String(TExprLiteral(opr.Left).Literal.Value), lflt)) then
lflt := 0.0;
if (not TryStrToFloat(String(TExprLiteral(opr.Right).Literal.Value), rflt)) then
rflt := 0.0;
end else
begin
tgt := dtInteger;
if (not TryStrToInt(String(TExprLiteral(opr.Left).Literal.Value), lint)) then
lint := 0;
if (not TryStrToInt(String(TExprLiteral(opr.Right).Literal.Value), rint)) then
rint := 0;
end;
end else
begin
if (not (opr.Right is TExprLiteral)) then
Exit;
if (opr.Right.DeclType = dtReal) then
begin
tgt := dtReal;
if (not TryStrToFloat(String(TExprLiteral(opr.Right).Literal.Value), rflt)) then
rflt := 0.0;
end else
begin
tgt := dtInteger;
if (not TryStrToInt(String(TExprLiteral(opr.Right).Literal.Value), rint)) then
rint := 0;
end;
end;
case opr.OType of
otExponent:
begin
if (tgt = dtReal) then
rrslt := Power(lflt, rflt)
else
rrslt := Power(lint, rint);
tgt := dtReal;
end;
otUnaryMinus:
begin
if (tgt = dtReal) then
rrslt := -rflt
else
irslt := -rint;
end;
otMultiply:
begin
if (tgt = dtReal) then
rrslt := lflt * rflt
else
irslt := lint * rint;
end;
otDivide:
begin
if (tgt = dtReal) then
rrslt := lflt / rflt
else
rrslt := lint / rint;
tgt := dtReal;
end;
otIntDivide:
begin
if (tgt = dtReal) then
irslt := 0
else
irslt := lint div rint;
end;
otPlus:
begin
if (tgt = dtReal) then
rrslt := lflt + rflt
else
irslt := lint + rint;
end;
otMinus:
begin
if (tgt = dtReal) then
rrslt := lflt - rflt
else
irslt := lint - rint;
end;
otLess:
begin
if (tgt = dtReal) then
irslt := Integer(lflt < rflt)
else
irslt := Integer(lint < rint);
tgt := dtLogical;
end;
otLessEqual:
begin
if (tgt = dtReal) then
irslt := Integer(lflt <= rflt)
else
irslt := Integer(lint <= rint);
tgt := dtLogical;
end;
otGreater:
begin
if (tgt = dtReal) then
irslt := Integer(lflt > rflt )
else
irslt := Integer(lint > rint);
tgt := dtLogical;
end;
otGreaterEqual:
begin
if (tgt = dtReal) then
irslt := Integer(lflt >= rflt)
else
irslt := Integer(lint >= rint);
tgt := dtLogical;
end;
otEqual:
begin
if (tgt = dtReal) then
irslt := Integer(lflt = rflt )
else
irslt := Integer(lint = rint);
tgt := dtLogical;
end;
otNotEqual:
begin
if (tgt = dtReal) then
irslt := Integer(lflt <> rflt)
else
irslt := Integer(lint <> rint);
tgt := dtLogical;
end;
otNot:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if (rint = 0) then
rint := 1
else
rint := 0;
end;
tgt := dtLogical;
end;
otAnd:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if ((lint <> 0) and (rint <> 0)) then
irslt := 1
else
irslt := 0;
end;
tgt := dtLogical;
end;
otOr:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if ((lint <> 0) or (rint <> 0)) then
irslt := 1
else
irslt := 0;
end;
tgt := dtLogical;
end;
otXor:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if (((lint <> 0) and (rint <> 0)) or ((lint = 0) and (rint = 0))) then
irslt := 0
else
irslt := 1;
end;
tgt := dtLogical;
end;
otImpl:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if ((lint <> 0) and (rint = 0)) then
irslt := 0
else
irslt := 1;
end;
tgt := dtLogical;
end;
otEquiv:
begin
if (tgt = dtReal) then
irslt := 0
else
begin
if (((lint <> 0) and (rint <> 0)) or ((lint = 0) and (rint = 0))) then
irslt := 1
else
irslt := 0;
end;
tgt := dtLogical;
end;
end;
if (tgt = dtReal) then
begin
stemp := AnsiString(FloatToStr(rrslt));
i := FLiterals.Add(dtReal, stemp);
lit := TExprLiteral.Create;
lit.TargetDecl := dtReal;
lit.Literal := FLiterals[i];
end else if (tgt = dtInteger) then
begin
stemp := AnsiString(IntToStr(irslt));
i := FLiterals.Add(dtInteger, stemp);
lit := TExprLiteral.Create;
lit.TargetDecl := dtInteger;
lit.Literal := FLiterals[i];
end else if (tgt = dtLogical) then
begin
if (irslt = 0) then
stemp := '0'
else
stemp := '1';
i := FLiterals.Add(dtLogical, stemp);
lit := TExprLiteral.Create;
lit.TargetDecl := dtLogical;
lit.Literal := FLiterals[i];
end else
begin
lit := nil;
end;
if (Assigned(opr.Left)) then
Dec(TExprLiteral(opr.Left).Literal.RefCount);
Dec(TExprLiteral(opr.Right).Literal.RefCount);
opr.Free;
Result := lit;
end;
function Factor(priorityLevel, condDepth: Integer; var errCount: Integer): TExpressionTerm;
var
ttype: TTokenType;
token: AnsiString;
done: Boolean;
opr: TExprOperator;
left, right: TExpressionTerm;
ot: TExprOperatorType;
begin
if (FTokenTrace) then
WriteLn(Format('Factor (priority %s)', [priorityLevel]));
Result := nil;
left := nil;
right := nil;
opr := nil;
try
FTokenGen.Get(ttype, token);
if ((token = '-') or (token = 'NOT')) then
begin
if (PriorityMatch(token, priorityLevel)) then
begin
right := Factor(priorityLevel + 1, condDepth, errCount);
if (not Assigned(right)) then
Exit;
opr := TExprOperator.Create;
opr.Right := right;
opr.TargetDecl := right.DeclType;
if (token = '-') then
begin
opr.OType := otUnaryMinus;
if (not right.IsNumeric) then
begin
Error('Integer or real value expected for unary minus');
Inc(errCount);
end;
CheckOperands(opr, errCount);
Result := Reduce(opr);
end else
begin
opr.OType := otNot;
if (not right.IsLogical) then
begin
Error('Boolean value expected for NOT');
Inc(errCount);
end;
CheckOperands(opr, errCount);
Result := Reduce(opr);
end;
Exit;
end else
begin
FTokenGen.Unget(ttype, token);
end;
end else
begin
FTokenGen.Unget(ttype, token);
end;
if (priorityLevel >= High(ExprOprPriorities)) then
left := Operand(errCount, condDepth)
else
left := Factor(priorityLevel + 1, condDepth, errCount);
if (not Assigned(left)) then
Exit;
done := False;
while (not done) do
begin
FTokenGen.Get(ttype, token);
ot := OperatorType(token);
if (ot <> otUnknown) then
begin
if (PriorityMatch(token, priorityLevel)) then
begin
if (priorityLevel >= High(ExprOprPriorities)) then
right := Operand(errCount, condDepth)
else
right := Factor(priorityLevel + 1, condDepth, errCount);
if (not Assigned(right)) then
begin
FreeAndNil(left);
Exit;
end;
opr := TExprOperator.Create;
opr.OType := ot;
opr.Left := left;
opr.Right := right;
CheckOperands(opr, errCount);
left := Reduce(opr);
end else
begin
FTokenGen.Unget(ttype, token);
done := True;
end;
end else
begin
FTokenGen.Unget(ttype, token);
done := True;
end;
end;
if ((priorityLevel = 0) and (left is TExprIf)) then
Reduce(TExprIf(left));
Result := left;
except
on E: Exception do
begin
Error(E.Message);
FreeAndNil(left);
FreeAndNil(right);
FreeAndNil(opr);
Result := nil;
end;
end;
end;
function PostFix(term: TExpressionTerm): AnsiString;
// Traverse the expression tree and generate the eqivalent postfix
// expression. Used for debugging purposes only.
begin
if (not Assigned(term)) then
begin
Result := '';
end else if (term is TExprLiteral) then
begin
Result := TExprLiteral(term).Literal.Value + ' ';
end else if (term is TExprVariable) then
begin
Result := TExprVariable(term).Symbol.ID + ' ';
end else if (term is TExprIf) then
begin
Result := PostFix(TExprIf(term).IfExpr) +
oprs[otIf] + ' ' +
PostFix(TExprIf(term).ThenExpr) +
oprs[otThen] + ' ' +
PostFix(TExprIf(term).ElseExpr);
if (TExprIf(term).ConditionalDepth = 0) then
Result := Result + oprs[otElse] + ' ';
end else if (term is TExprOperator) then
begin
Result := PostFix(TExprOperator(term).Left) +
PostFix(TExprOperator(term).Right) +
oprs[TExprOperator(term).OType] + ' ';
end;
end;
var
post: AnsiString;
ttype: TTokenType;
token: AnsiString;
errCount: Integer;
begin
Result := nil;
FTokenGen.Get(ttype, token);
if (not ((ttype = ttIdentifier) or (ttype = ttInteger) or (ttype = ttReal) or
(ttype = ttLogicalValue) or (ttype = ttString) or // (ttype = ttLabel) or
(ttype = ttIf) or (ttype = ttLeftParen) or (token = '-') or
(token = 'NOT'))) then
Exit;
FTokenGen.Unget(ttype, token);
try
errCount := 0;
Result := TExpression(Factor(0, 0, errCount));
if (Assigned(Result)) then
begin
Result.ErrorCount := errCount;
// **********************
// for debugging
post := PostFix(Result);
// **********************
end;
except
on E: Exception do
begin
Error(E.Message);
FreeAndNil(Result);
end;
end;
end;
function TCompiler.FindSymbol(id: AnsiString; st: TSymbolType): TSymbol;
var
blocks: TArray<TBlock>;
i: Integer;
begin
Result := nil;
blocks := FBlocks.ToArray;
for i := High(blocks) downto Low(blocks) do
begin
if (blocks[i].Symbols.TryGetValue(id, st, Result)) then
Exit;
end;
end;
function TCompiler.Forr: Boolean;
var
ttype: TTokenType;
token: AnsiString;
expr: TExpression;
stmt: TForStatement;
asgType: TDeclType;
mult, minus, gt, sign: TExprOperator;
lv: TExprVariable;
zero: TExprLiteral;
i: Integer;
begin
asgType := dtUnknown;
FTokenGen.Get(ttype, token);
if (ttype <> ttFor) then
begin
FTokenGen.Unget(ttype, token);
Result := False;
Exit;
end;
Result := True;
stmt := TForStatement.Create;
FTokenGen.Get(ttype, token);
if (ttype <> ttIdentifier) then
begin
Error(Format('Identifier expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
stmt.LoopVar := FindSymbol(token, stVariable);
if (not Assigned(stmt.LoopVar)) then
begin
Error(Format('%s is undefined', [token]));
FTokenGen.Unget(ttype, token);
end;
FTokenGen.Get(ttype, token);
if (ttype <> ttAssignment) then
begin
Error(Format('Assignment expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
// I := e1[, e2[, e3 ...]]]
Inc(FSymbolNum);
stmt.LoopLblNum := FSymbolNum;
Inc(FSymbolNum);
stmt.EndLblNum := FSymbolNum;
expr := Expression;
if (Assigned(expr)) then
begin
stmt.AsgExpressions.Add(expr);
asgType := expr.TargetDecl;
end else
Error(Format('Expression expected after assignment', [token]));
FTokenGen.Get(ttype, token);
if (ttype = ttComma) then
begin
repeat
expr := Expression;
if (Assigned(expr)) then
begin
if (expr.TargetDecl <> stmt.LoopVar.DeclType) then
Error('All expression must be same type as loop variable');
stmt.AsgExpressions.Add(expr);
end else
Error('Expression expected after comma');
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
FTokenGen.Unget(ttype, token);
end else
FTokenGen.Unget(ttype, token);
if (stmt.LoopVar.DeclType <> asgType) then
Error('Loop variable type and expression type must match');
// DO, STEP or WHILE
FTokenGen.Get(ttype, token);
if (token = 'DO') then
begin
FCodeGen.ForListInit(stmt);
if (not Statement) then
Error('Statement expected following DO');
FCodeGen.ForListEnd(stmt);
end else
begin
if (token = 'STEP') then
begin
// STEP
stmt.IncrExpression := Expression;
if (Assigned(stmt.IncrExpression)) then
begin
if (stmt.IncrExpression.TargetDecl <> asgType) then
Error('Assignment and STEP expressions must the same type');
end else
Error('Expression expected following STEP');
// UNTIL
FTokenGen.Get(ttype, token);
if (token <> 'UNTIL') then
begin
Error(Format('UNTIL expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
expr := Expression;
if (Assigned(expr)) then
begin
if (expr.TargetDecl <> asgType) then
Error('Assignment and UNTIL expressions must be the same type');
end else
Error('Expression expected following UNTIL');
// Generate test expression (SIGN(step) * (LoopVar - TestExpression)) > 0
lv := TExprVariable.Create;
lv.Symbol := stmt.LoopVar;
lv.TargetDecl := stmt.LoopVar.DeclType;
//
sign := TExprOperator.Create;
sign.OType := otSign;
sign.TargetDecl := stmt.LoopVar.DeclType;
sign.Right := stmt.IncrExpression;
//
minus := TExprOperator.Create;
minus.OType := otMinus;
minus.TargetDecl := stmt.LoopVar.DeclType;
minus.Left := lv;
minus.Right := expr;
//
mult := TExprOperator.Create;
mult.OType := otMultiply;
mult.TargetDecl := stmt.LoopVar.DeclType;
mult.Left := sign;
mult.Right := minus;
//
zero := TExprLiteral.Create;
i := FLiterals.Add(stmt.LoopVar.DeclType, '0');
zero.Literal := FLiterals[i];
zero.TargetDecl := stmt.LoopVar.DeclType;
//
gt := TExprOperator.Create;
gt.OType := otGreater;
gt.TargetDecl := dtLogical;
gt.Left := mult;
gt.Right := zero;
//
stmt.TestExpression := TExpression(gt);
FCodeGen.ForStep(stmt);
FTokenGen.Get(ttype, token);
if (token <> 'DO') then
begin
Error(Format('Expected DO or WHILE, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
if (not Statement) then
Error('Statement expected following DO');
FCodeGen.ForStepIncr(stmt);
end else if (token = 'WHILE') then
begin
// WHILE
stmt.TestExpression := Expression;
if (Assigned(stmt.TestExpression)) then
begin
if (stmt.TestExpression.TargetDecl <> dtLogical) then
Error('Boolean expression expected following WHILE');
end else
Error('Expression expected following WHILE');
FTokenGen.Get(ttype, token);
if (token <> 'DO') then
begin
Error(Format('Expected DO or WHILE, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
FCodeGen.ForWhile(stmt);
if (not Statement) then
Error('Statement expected following DO');
FCodeGen.ForWhileEnd(stmt);
end else
begin
Error(Format('Expected DO, STEP or WHILE, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
end;
stmt.Free;
end;
function TCompiler.Gotoo: Boolean;
var
ttype: TTokenType;
token: AnsiString;
gt: TGotoStatement;
begin
FTokenGen.Get(ttype, token);
if (ttype <> ttGoto) then
begin
FTokenGen.Unget(ttype, token);
Result := False;
Exit;
end;
Result := True;
gt := TGotoStatement.Create;
gt.Expr := DesignationalExpr;
if (Assigned(gt.Expr)) then
FCodeGen.Gotoo(gt.Expr)
else
Error('Designational expression expected following GOTO');
gt.Free;
end;
function TCompiler.Iff: Boolean;
var
ttype: TTokenType;
token: AnsiString;
stmt: TIfStatement;
begin
FTokenGen.Get(ttype, token);
if (ttype <> ttIf) then
begin
FTokenGen.Unget(ttype, token);
Result := False;
Exit;
end;
Result := True;
stmt := TIfStatement.Create;
stmt.Expr := Expression;
if (stmt.Expr.TargetDecl <> dtLogical) then
begin
Error('Boolean expression expected following IF');
Exit;
end;
FTokenGen.Get(ttype, token);
if (token <> 'THEN') then
begin
FTokenGen.Unget(ttype, token);
Error(Format('THEN expected, got %s', [token]));
end;
Inc(FSymbolNum);
stmt.ElseLblNum := FSymbolNum;
Inc(FSymbolNum);
stmt.EndLblNum := FSymbolNum;
FCodeGen.IfThen(stmt);
if (not Statement) then
begin
Error('Statement expected following THEN');
Exit;
end;
FCodeGen.IfElse(stmt);
FTokenGen.Get(ttype, token);
if (token = 'ELSE') then
begin
if (not Statement) then
Error('Statement expected');
end else
FTokenGen.Unget(ttype, token);
FCodeGen.IfEnd(stmt);
stmt.Free;
end;
function TCompiler.Labell: Boolean;
var
ttype: TTokenType;
token: AnsiString;
b: TBlock;
sym: TSymbol;
begin
b := FBlocks.Peek;
FTokenGen.Get(ttype, token);
if (ttype = ttLabel) then
begin
sym := NewSymbol(token, stLabel, False);
if (b.Symbols.TryGetValue(token, stLabel, sym)) then
begin
if (sym.IsForward) then
begin
sym.IsForward := False;
FCodeGen.Labell(sym);
end else
Error(Format('Duplicate label %s', [token]));
end else
begin
sym := NewSymbol(token, stLabel, False);
b.Symbols.Add(token, sym);
FCodeGen.Labell(sym);
end;
Result := True;
end else
begin
FTokenGen.Unget(ttype, token);
Result := False;
end;
end;
function TCompiler.NewBlock(isPgm, isMain, isProc: Boolean): TBlock;
begin
Result := TBlock.Create;
Result.IsMain := isMain;
Result.IsProc := isProc;
Result.IsProgram := ispgm;
Inc(FBlockNum);
Result.BlockNum := FBlockNum;
end;
function TCompiler.NewSymbol(id: AnsiString; st: TSymbolType; isArray: Boolean): TSymbol;
begin
if (st = stSwitch) then
Result := TSwitchSymbol.Create
else
Result := TSymbol.Create;
Result.ID := id;
Result.SymbolType := st;
Result.IsArray := isArray;
Inc(FSymbolNum);
Result.SymbolNum := FSymbolNum;
end;
function TCompiler.ProcedureDecl: Boolean;
var
ttypeDecl, ttypeProc: TTokenType;
tokenDecl, tokenProc: AnsiString;
begin
FTokenGen.Get(ttypeDecl, tokenDecl);
if (ttypeDecl = ttComment) then
begin
FTokenGen.FlushLine;
Result := True;
Exit;
end else if ((ttypeDecl = ttDeclarator) and
((tokenDecl = 'INTEGER') or (tokenDecl = 'REAL'))) then
begin
FTokenGen.Get(ttypeProc, tokenProc);
if ((ttypeProc <> ttDeclarator) or (tokenProc <> 'PROCEDURE')) then
begin
Result := False;
FTokenGen.Unget(ttypeProc, tokenProc);
FTokenGen.Unget(ttypeDecl, tokenDecl);
Exit;
end;
end else
begin
if ((ttypeDecl <> ttDeclarator) or (tokenDecl <> 'PROCEDURE')) then
begin
Result := False;
FTokenGen.Unget(ttypeDecl, tokenDecl);
Exit;
end;
ttypeDecl := ttUnknown;
end;
Result := True;
end;
function TCompiler.Programm: Boolean;
var
b: TBlock;
begin
b := NewBlock(True, False, False);
FBlocks.Push(b);
Result := Block(True, True, False);
if (not Result) then
FBlocks.Pop.Free;
end;
function TCompiler.Statement: Boolean;
var
ttype: TTokenType;
token: AnsiString;
parent: TBlock;
begin
Result := False;
while (Labell) do
;
FTokenGen.Get(ttype, token);
case ttype of
ttEof:
begin
Result := False;
Error('Unexpected enf-of-file');
end;
ttLineSeparator:
begin
Result := True;
end;
ttEnd:
begin
FTokenGen.Unget(ttype, token);
Result := False;
end;
ttComment:
begin
FTokenGen.FlushLine;
Result := True;
end;
ttIdentifier:
begin
FTokenGen.Unget(ttype, token);
Result := Assignment(0, dtUnknown);
end;
ttBegin:
begin
FTokenGen.Unget(ttype, token);
parent := FBlocks.Peek;
Result := Block(False, False, parent.IsProc);
end
else
begin
FTokenGen.Unget(ttype, token);
if (Gotoo) then
Result := True
else if (Iff) then
Result := True
else if (Forr) then
Result := True
else if (Write) then
Result := True;
end;
end;
end;
function TCompiler.Write: Boolean;
var
ttype, ttype2: TTokenType;
token, token2: AnsiString;
expr: TExpression;
arr: TExprArray;
sym: TSymbol;
wr: TWriteStatement;
begin
FTokenGen.Get(ttype, token);
if (ttype <> ttWrite) then
begin
FTokenGen.Unget(ttype, token);
Result := False;
Exit;
end;
Result := True;
wr := TWriteStatement.Create;
try
FTokenGen.Get(ttype, token);
if (ttype <> ttLeftParen) then
Error(Format('Left bracket expected, got %s', [token]));
FTokenGen.Get(ttype, token);
if (token = 'PRINTER') then
wr.Device := iodPrinter
else if (token = 'PUNCH') then
wr.Device := iodPunch
else if (token = 'CONSOLE') then
wr.Device := iodConsole
else
FTokenGen.Unget(ttype, token);
if (wr.Device <> iodUnknown) then
begin
// Trash comma following device name, if present
FTokenGen.Get(ttype, token);
if (ttype <> ttComma) then
FTokenGen.Unget(ttype, token);
end else
// Default device to printer
wr.Device := iodPrinter;
repeat
// We need to look ahead a bit here to see if the parameter is
// an array with no subscripts.
FTokenGen.Get(ttype, token);
if (ttype = ttIdentifier) then
begin
sym := FindSymbol(token, stVariable);
if (Assigned(sym) and (sym.IsArray)) then
begin
FTokenGen.Get(ttype2, token2);
if (ttype2 <> ttLeftParen) then
begin
arr := TExprArray.Create;
arr.Symbol := sym;
arr.TargetDecl := sym.DeclType;
wr.Params.Add(arr);
ttype := ttype2;
token := token2;
Continue;
end else
FTokenGen.Unget(ttype2, token2);
end;
end;
FTokenGen.Unget(ttype, token);
expr := Expression;
if (Assigned(expr)) then
wr.Params.Add(expr)
else
begin
FTokenGen.Unget(ttype, token);
Error('Expression or array expected for WRITE');
end;
FTokenGen.Get(ttype, token);
until ttype <> ttComma;
if (ttype <> ttRightParen) then
begin
Error(Format('Right bracket expected, got %s', [token]));
FTokenGen.Unget(ttype, token);
end;
FCodeGen.Write(wr);
finally
wr.Free;
end;
end;
end.
| 32.981861 | 111 | 0.481875 |
477281d8a2f0232ab7a2cefb620558973841b089 | 32,346 | pas | Pascal | lazarus/lazutils/lazconfigstorage.pas | rarnu/golcl-liblcl | 6f238af742857921062365656a1b13b44b2330ce | [
"Apache-2.0"
]
| null | null | null | lazarus/lazutils/lazconfigstorage.pas | rarnu/golcl-liblcl | 6f238af742857921062365656a1b13b44b2330ce | [
"Apache-2.0"
]
| null | null | null | lazarus/lazutils/lazconfigstorage.pas | rarnu/golcl-liblcl | 6f238af742857921062365656a1b13b44b2330ce | [
"Apache-2.0"
]
| null | null | null | {
*****************************************************************************
This file is part of LazUtils.
See the file COPYING.modifiedLGPL.txt, included in this distribution,
for details about the license.
*****************************************************************************
Author: Mattias Gaertner
Abstract:
This unit defines various base classes for loading and saving of configs.
}
unit LazConfigStorage;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, typinfo, Laz_AVL_Tree,
// LazUtils
LazLoggerBase, AvgLvlTree;
type
{ TConfigStorage }
TConfigStorage = class
private
FPathStack: TStrings;
FCurrentBasePath: string;
protected
function GetFullPathValue(const APath, ADefault: String): String; virtual; abstract;
function GetFullPathValue(const APath: String; ADefault: Integer): Integer; virtual; abstract;
function GetFullPathValue(const APath: String; ADefault: Boolean): Boolean; virtual; abstract;
procedure SetFullPathValue(const APath, AValue: String); virtual; abstract;
procedure SetDeleteFullPathValue(const APath, AValue, DefValue: String); virtual; abstract;
procedure SetFullPathValue(const APath: String; AValue: Integer); virtual; abstract;
procedure SetDeleteFullPathValue(const APath: String; AValue, DefValue: Integer); virtual; abstract;
procedure SetFullPathValue(const APath: String; AValue: Boolean); virtual; abstract;
procedure SetDeleteFullPathValue(const APath: String; AValue, DefValue: Boolean); virtual; abstract;
procedure DeleteFullPath(const APath: string); virtual; abstract;
procedure DeleteFullPathValue(const APath: string); virtual; abstract;
protected
procedure WriteProperty(Path: String; Instance: TPersistent;
PropInfo: Pointer; DefInstance: TPersistent = nil;
OnlyProperty: String= '');
procedure ReadProperty(Path: String; Instance: TPersistent;
PropInfo: Pointer; DefInstance: TPersistent = nil;
OnlyProperty: String= '');
public
constructor Create(const {%H-}Filename: string; {%H-}LoadFromDisk: Boolean); virtual;
destructor Destroy; override;
procedure Clear; virtual; abstract;
function GetValue(const APath, ADefault: String): String;
function GetValue(const APath: String; ADefault: Integer): Integer;
function GetValue(const APath: String; ADefault: Boolean): Boolean;
procedure GetValue(const APath: String; out ARect: TRect;
const ADefault: TRect);
procedure GetValue(const APath: String; out APoint: TPoint;
const ADefault: TPoint);
procedure GetValue(const APath: String; const List: TStrings);
procedure SetValue(const APath, AValue: String);
procedure SetDeleteValue(const APath, AValue, DefValue: String);
procedure SetValue(const APath: String; AValue: Integer);
procedure SetDeleteValue(const APath: String; AValue, DefValue: Integer);
procedure SetValue(const APath: String; AValue: Boolean);
procedure SetDeleteValue(const APath: String; AValue, DefValue: Boolean);
procedure SetValue(const APath: String; const AValue: TRect);
procedure SetDeleteValue(const APath: String; const AValue, DefValue: TRect);
procedure SetValue(const APath: String; const AValue: TPoint);
procedure SetDeleteValue(const APath: String; const AValue, DefValue: TPoint);
procedure SetValue(const APath: String; const AValue: TStrings);
procedure DeletePath(const APath: string);
procedure DeleteValue(const APath: string);
property CurrentBasePath: string read FCurrentBasePath;
function ExtendPath(const APath: string): string;
procedure AppendBasePath(const Path: string);
procedure UndoAppendBasePath;
procedure WriteToDisk; virtual; abstract;
function GetFilename: string; virtual; abstract;
procedure WriteObject(Path: String; Obj: TPersistent;
DefObject: TPersistent= nil; OnlyProperty: String= '');
procedure ReadObject(Path: String; Obj: TPersistent;
DefObject: TPersistent= nil; OnlyProperty: String= '');
end;
TConfigStorageClass = class of TConfigStorage;
{ TConfigMemStorageNode }
TConfigMemStorageNode = class
public
Name: string;
Value: string;
Parent: TConfigMemStorageNode;
Children: TAvlTree; // tree of TConfigMemStorageNode
procedure ClearChilds;
constructor Create(AParent: TConfigMemStorageNode; const AName: string);
destructor Destroy; override;
end;
TConfigMemStorageModification = (cmsmSet, cmsmGet, cmsmDelete, cmsmDeleteValue);
const
ConfigMemStorageFormatVersion = 2; // change this when format changes
type
{ TConfigMemStorage }
TConfigMemStorage = class(TConfigStorage)
private
procedure CreateRoot;
procedure CreateChilds(Node: TConfigMemStorageNode);
procedure Modify(const APath: string; Mode: TConfigMemStorageModification;
var AValue: string);
protected
procedure DeleteFullPath(const APath: string); override;
procedure DeleteFullPathValue(const APath: string); override;
function GetFullPathValue(const APath, ADefault: String): String; override;
function GetFullPathValue(const APath: String; ADefault: Boolean): Boolean;
override;
function GetFullPathValue(const APath: String; ADefault: Integer): Integer;
override;
procedure SetDeleteFullPathValue(const APath, AValue, DefValue: String);
override;
procedure SetDeleteFullPathValue(const APath: String; AValue, DefValue:
Boolean); override;
procedure SetDeleteFullPathValue(const APath: String; AValue, DefValue:
Integer); override;
procedure SetFullPathValue(const APath, AValue: String); override;
procedure SetFullPathValue(const APath: String; AValue: Boolean); override;
procedure SetFullPathValue(const APath: String; AValue: Integer); override;
public
Root: TConfigMemStorageNode;
function GetFilename: string; override;
procedure WriteToDisk; override;
destructor Destroy; override;
procedure Clear; override;
procedure SaveToConfig(Config: TConfigStorage; const APath: string);
procedure LoadFromConfig(Config: TConfigStorage; const APath: string);
procedure WriteDebugReport;
end;
procedure LoadStringToStringTree(Config: TConfigStorage; const Path: string;
Tree: TStringToStringTree);
procedure SaveStringToStringTree(Config: TConfigStorage; const Path: string;
Tree: TStringToStringTree);
function CompareConfigMemStorageNames(p1, p2: PChar): integer;
function CompareConfigMemStorageNodes(Node1, Node2: Pointer): integer;
function ComparePCharWithConfigMemStorageNode(aPChar, ANode: Pointer): integer;
implementation
procedure LoadStringToStringTree(Config: TConfigStorage; const Path: string;
Tree: TStringToStringTree);
var
Cnt: LongInt;
SubPath: String;
CurName: String;
CurValue: String;
i: Integer;
begin
Tree.Clear;
Cnt:=Config.GetValue(Path+'Count',0);
for i:=0 to Cnt-1 do begin
SubPath:=Path+'Item'+IntToStr(i)+'/';
CurName:=Config.GetValue(SubPath+'Name','');
CurValue:=Config.GetValue(SubPath+'Value','');
Tree.Values[CurName]:=CurValue;
end;
end;
procedure SaveStringToStringTree(Config: TConfigStorage; const Path: string;
Tree: TStringToStringTree);
var
Node: TAvlTreeNode;
Item: PStringToStringItem;
i: Integer;
SubPath: String;
begin
Config.SetDeleteValue(Path+'Count',Tree.Tree.Count,0);
Node:=Tree.Tree.FindLowest;
i:=0;
while Node<>nil do begin
Item:=PStringToStringItem(Node.Data);
SubPath:=Path+'Item'+IntToStr(i)+'/';
Config.SetDeleteValue(SubPath+'Name',Item^.Name,'');
Config.SetDeleteValue(SubPath+'Value',Item^.Value,'');
Node:=Tree.Tree.FindSuccessor(Node);
inc(i);
end;
end;
function CompareConfigMemStorageNames(p1, p2: PChar): integer;
// compare strings till / or #0
begin
if (p1=nil) then begin
if (p2=nil) or (p2^ in ['/',#0]) then begin
// both empty
Result:=0;
end else begin
// p1 shorter
Result:=-1;
end;
end else begin
if p2=nil then begin
// p2 shorter
Result:=1;
end else begin
Result:=0;
repeat
if p1^ in ['/',#0] then begin
if p2^ in ['/',#0] then begin
// same
exit(0);
end else begin
// p1 shorter
exit(-1);
end;
end else begin
if p2^ in ['/',#0] then begin
// p2 shorter
exit(1);
end else if p1^=p2^ then begin
// continue
end else begin
// differ
exit(ord(p1^)-ord(p2^));
end;
end;
inc(p1);
inc(p2);
until false;
end;
end;
end;
function CompareConfigMemStorageNodes(Node1, Node2: Pointer): integer;
var
CfgNode1: TConfigMemStorageNode absolute Node1;
CfgNode2: TConfigMemStorageNode absolute Node2;
begin
Result:=CompareConfigMemStorageNames(PChar(CfgNode1.Name),PChar(CfgNode2.Name));
end;
function ComparePCharWithConfigMemStorageNode(aPChar, ANode: Pointer): integer;
begin
Result:=CompareConfigMemStorageNames(PChar(aPChar),
PChar(TConfigMemStorageNode(ANode).Name));
end;
{ TConfigStorage }
procedure TConfigStorage.WriteProperty(Path: String; Instance: TPersistent; PropInfo: Pointer;
DefInstance: TPersistent; OnlyProperty: String);
// based on FPC TWriter
// path is already extende
type
tset = set of 0..31;
var
i: Integer;
PropType: PTypeInfo;
Value, DefValue: LongInt;
Ident: String;
IntToIdentFn: TIntToIdent;
SetType: Pointer;
FloatValue, DefFloatValue: Extended;
//WStrValue, WDefStrValue: WideString;
StrValue, DefStrValue: String;
//Int64Value, DefInt64Value: Int64;
BoolValue, DefBoolValue: boolean;
begin
// do not stream properties without getter and setter
if not (Assigned(PPropInfo(PropInfo)^.GetProc) and
Assigned(PPropInfo(PropInfo)^.SetProc)) then
exit;
PropType := PPropInfo(PropInfo)^.PropType;
Path := Path + PPropInfo(PropInfo)^.Name;
if (OnlyProperty <> '') and (OnlyProperty <> PPropInfo(PropInfo)^.Name) then
exit;
case PropType^.Kind of
tkInteger, tkChar, tkEnumeration, tkSet, tkWChar:
begin
Value := GetOrdProp(Instance, PropInfo);
if (DefInstance <> nil) then
DefValue := GetOrdProp(DefInstance, PropInfo);
if (DefInstance <> nil) and (Value = DefValue) then
DeleteValue(Path)
else begin
case PropType^.Kind of
tkInteger:
begin // Check if this integer has a string identifier
IntToIdentFn := FindIntToIdent(PPropInfo(PropInfo)^.PropType);
if Assigned(IntToIdentFn) and IntToIdentFn(Value, Ident{%H-}) then
SetValue(Path, Ident) // Integer can be written a human-readable identifier
else
SetValue(Path, Value); // Integer has to be written just as number
end;
tkChar:
SetValue(Path, Chr(Value));
tkWChar:
SetValue(Path, Value);
tkSet:
begin
SetType := GetTypeData(PropType)^.CompType;
Ident := '';
for i := 0 to 31 do
if (i in tset(Value)) then begin
if Ident <> '' then Ident := Ident + ',';
Ident := Ident + GetEnumName(PTypeInfo(SetType), i);
end;
SetValue(Path, Ident);
end;
tkEnumeration:
SetValue(Path, GetEnumName(PropType, Value));
end;
end;
end;
tkFloat:
begin
FloatValue := GetFloatProp(Instance, PropInfo);
if (DefInstance <> nil) then
DefFloatValue := GetFloatProp(DefInstance, PropInfo);
if (DefInstance <> nil) and (DefFloatValue = FloatValue) then
DeleteValue(Path)
else
SetValue(Path, FloatToStr(FloatValue));
end;
tkSString, tkLString, tkAString:
begin
StrValue := GetStrProp(Instance, PropInfo);
if (DefInstance <> nil) then
DefStrValue := GetStrProp(DefInstance, PropInfo);
if (DefInstance <> nil) and (DefStrValue = StrValue) then
DeleteValue(Path)
else
SetValue(Path, StrValue);
end;
(* tkWString:
begin
WStrValue := GetWideStrProp(Instance, PropInfo);
if (DefInstance <> nil) then
WDefStrValue := GetWideStrProp(DefInstance, PropInfo);
if (DefInstance <> nil) and (WDefStrValue = WStrValue) then
DeleteValue(Path)
else
SetValue(Path, WStrValue);
end;*)
(* tkInt64, tkQWord:
begin
Int64Value := GetInt64Prop(Instance, PropInfo);
if (DefInstance <> nil) then
DefInt64Value := GetInt64Prop(DefInstance, PropInfo)
if (DefInstance <> nil) and (Int64Value = DefInt64Value) then
DeleteValue(Path, Path)
else
SetValue(StrValue);
end;*)
tkBool:
begin
BoolValue := GetOrdProp(Instance, PropInfo)<>0;
if (DefInstance <> nil) then
DefBoolValue := GetOrdProp(DefInstance, PropInfo)<>0;
if (DefInstance <> nil) and (BoolValue = DefBoolValue) then
DeleteValue(Path)
else
SetValue(Path, BoolValue);
end;
end;
end;
procedure TConfigStorage.ReadProperty(Path: String; Instance: TPersistent; PropInfo: Pointer;
DefInstance: TPersistent; OnlyProperty: String);
type
tset = set of 0..31;
var
i, j: Integer;
PropType: PTypeInfo;
Value, DefValue: LongInt;
Ident, s: String;
IdentToIntFn: TIdentToInt;
SetType: Pointer;
FloatValue, DefFloatValue: Extended;
//WStrValue, WDefStrValue: WideString;
StrValue, DefStrValue: String;
//Int64Value, DefInt64Value: Int64;
BoolValue, DefBoolValue: boolean;
begin
// do not stream properties without getter and setter
if not (Assigned(PPropInfo(PropInfo)^.GetProc) and
Assigned(PPropInfo(PropInfo)^.SetProc)) then
exit;
PropType := PPropInfo(PropInfo)^.PropType;
Path := Path + PPropInfo(PropInfo)^.Name;
if (OnlyProperty <> '') and (OnlyProperty <> PPropInfo(PropInfo)^.Name) then
exit;
if DefInstance = nil then
DefInstance := Instance;
case PropType^.Kind of
tkInteger, tkChar, tkEnumeration, tkSet, tkWChar:
begin
DefValue := GetOrdProp(DefInstance, PropInfo);
case PropType^.Kind of
tkInteger:
begin // Check if this integer has a string identifier
Ident := GetValue(Path, IntToStr(DefValue));
IdentToIntFn := FindIdentToInt(PPropInfo(PropInfo)^.PropType);
if TryStrToInt(Ident, Value) then
SetOrdProp(Instance, PropInfo, Value)
else if Assigned(IdentToIntFn) and IdentToIntFn(Ident, Value) then
SetOrdProp(Instance, PropInfo, Value)
else
SetOrdProp(Instance, PropInfo, DefValue)
end;
tkChar:
begin
Ident := GetValue(Path, chr(DefValue));
if Length(Ident) > 0 then
SetOrdProp(Instance, PropInfo, ord(Ident[1]))
else
SetOrdProp(Instance, PropInfo, DefValue);
end;
tkWChar:
SetOrdProp(Instance, PropInfo, GetValue(Path, DefValue));
tkSet:
begin
SetType := GetTypeData(PropType)^.CompType;
Ident := GetValue(Path, '-');
If Ident = '-' then
Value := DefValue
else begin
Value := 0;
while length(Ident) > 0 do begin
i := Pos(',', Ident);
if i < 1 then
i := length(Ident) + 1;
s := copy(Ident, 1, i-1);
Ident := copy(Ident, i+1, length(Ident));
j := GetEnumValue(PTypeInfo(SetType), s);
if j <> -1 then
include(tset(Value), j)
else Begin
Value := DefValue;
break;
end;
end;
end;
SetOrdProp(Instance, PropInfo, Value);
end;
tkEnumeration:
begin
Ident := GetValue(Path, '-');
If Ident = '-' then
Value := DefValue
else
Value := GetEnumValue(PropType, Ident);
if Value <> -1 then
SetOrdProp(Instance, PropInfo, Value)
else
SetOrdProp(Instance, PropInfo, DefValue);
end;
end;
end;
tkFloat:
begin
DefFloatValue := GetFloatProp(DefInstance, PropInfo);
Ident := GetValue(Path, FloatToStr(DefFloatValue));
if TryStrToFloat(Ident, FloatValue) then
SetFloatProp(Instance, PropInfo, FloatValue)
else
SetFloatProp(Instance, PropInfo, DefFloatValue)
end;
tkSString, tkLString, tkAString:
begin
DefStrValue := GetStrProp(DefInstance, PropInfo);
StrValue := GetValue(Path, DefStrValue);
SetStrProp(Instance, PropInfo, StrValue)
end;
(* tkWString:
begin
end;*)
(* tkInt64, tkQWord:
begin
end;*)
tkBool:
begin
DefBoolValue := GetOrdProp(DefInstance, PropInfo) <> 0;
BoolValue := GetValue(Path, DefBoolValue);
SetOrdProp(Instance, PropInfo, ord(BoolValue));
end;
end;
end;
constructor TConfigStorage.Create(const Filename: string; LoadFromDisk: Boolean
);
begin
end;
destructor TConfigStorage.Destroy;
begin
FPathStack.Free;
inherited Destroy;
end;
function TConfigStorage.GetValue(const APath, ADefault: String): String;
begin
Result:=GetFullPathValue(ExtendPath(APath),ADefault);
end;
function TConfigStorage.GetValue(const APath: String; ADefault: Integer
): Integer;
begin
Result:=GetFullPathValue(ExtendPath(APath),ADefault);
end;
function TConfigStorage.GetValue(const APath: String; ADefault: Boolean
): Boolean;
begin
Result:=GetFullPathValue(ExtendPath(APath),ADefault);
end;
procedure TConfigStorage.GetValue(const APath: String; out ARect: TRect;
const ADefault: TRect);
begin
ARect.Left:=GetValue(APath+'Left',ADefault.Left);
ARect.Top:=GetValue(APath+'Top',ADefault.Top);
ARect.Right:=GetValue(APath+'Right',ADefault.Right);
ARect.Bottom:=GetValue(APath+'Bottom',ADefault.Bottom);
end;
procedure TConfigStorage.GetValue(const APath: String; out APoint: TPoint;
const ADefault: TPoint);
begin
APoint.X:=GetValue(APath+'X',ADefault.X);
APoint.Y:=GetValue(APath+'Y',ADefault.Y);
end;
procedure TConfigStorage.GetValue(const APath: String; const List: TStrings);
var
NewCount: LongInt;
i: Integer;
NewLine: String;
begin
NewCount:=GetValue(APath+'Count',0);
for i:=0 to NewCount-1 do begin
NewLine:=GetValue(APath+'Item'+IntToStr(i+1)+'/Value','');
if List.Count>i then
List[i]:=NewLine
else
List.Add(NewLine);
end;
while List.Count>NewCount do List.Delete(List.Count-1);
end;
procedure TConfigStorage.SetValue(const APath, AValue: String);
begin
SetFullPathValue(ExtendPath(APath),AValue);
end;
procedure TConfigStorage.SetDeleteValue(const APath, AValue, DefValue: String);
begin
SetDeleteFullPathValue(ExtendPath(APath),AValue,DefValue);
end;
procedure TConfigStorage.SetValue(const APath: String; AValue: Integer);
begin
SetFullPathValue(ExtendPath(APath),AValue);
end;
procedure TConfigStorage.SetDeleteValue(const APath: String; AValue,
DefValue: Integer);
begin
SetDeleteFullPathValue(ExtendPath(APath),AValue,DefValue);
end;
procedure TConfigStorage.SetValue(const APath: String; AValue: Boolean);
begin
SetFullPathValue(ExtendPath(APath),AValue);
end;
procedure TConfigStorage.SetDeleteValue(const APath: String; AValue,
DefValue: Boolean);
begin
SetDeleteFullPathValue(ExtendPath(APath),AValue,DefValue);
end;
procedure TConfigStorage.SetValue(const APath: String; const AValue: TRect);
begin
SetValue(APath+'Left',AValue.Left);
SetValue(APath+'Top',AValue.Top);
SetValue(APath+'Right',AValue.Right);
SetValue(APath+'Bottom',AValue.Bottom);
end;
procedure TConfigStorage.SetDeleteValue(const APath: String; const AValue,
DefValue: TRect);
begin
SetDeleteValue(APath+'Left',AValue.Left,DefValue.Left);
SetDeleteValue(APath+'Top',AValue.Top,DefValue.Top);
SetDeleteValue(APath+'Right',AValue.Right,DefValue.Right);
SetDeleteValue(APath+'Bottom',AValue.Bottom,DefValue.Bottom);
end;
procedure TConfigStorage.SetValue(const APath: String; const AValue: TPoint);
begin
SetValue(APath+'X',AValue.X);
SetValue(APath+'Y',AValue.Y);
end;
procedure TConfigStorage.SetDeleteValue(const APath: String; const AValue,
DefValue: TPoint);
begin
SetDeleteValue(APath+'X',AValue.X,DefValue.X);
SetDeleteValue(APath+'Y',AValue.Y,DefValue.Y);
end;
procedure TConfigStorage.SetValue(const APath: String; const AValue: TStrings);
var
i: Integer;
begin
SetDeleteValue(APath+'Count',AValue.Count,0);
for i:=0 to AValue.Count-1 do
SetDeleteValue(APath+'Item'+IntToStr(i+1)+'/Value',AValue[i],'');
end;
procedure TConfigStorage.DeletePath(const APath: string);
begin
DeleteFullPath(ExtendPath(APath));
end;
procedure TConfigStorage.DeleteValue(const APath: string);
begin
DeleteFullPathValue(ExtendPath(APath));
end;
function TConfigStorage.ExtendPath(const APath: string): string;
begin
Result:=FCurrentBasePath+APath;
end;
procedure TConfigStorage.AppendBasePath(const Path: string);
begin
if FPathStack=nil then FPathStack:=TStringList.Create;
FPathStack.Add(FCurrentBasePath);
FCurrentBasePath:=FCurrentBasePath+Path;
if (FCurrentBasePath<>'')
and (FCurrentBasePath[length(FCurrentBasePath)]<>'/') then
FCurrentBasePath:=FCurrentBasePath+'/';
end;
procedure TConfigStorage.UndoAppendBasePath;
begin
if (FPathStack=nil) or (FPathStack.Count=0) then
raise Exception.Create('TConfigStorage.UndoAppendBasePath');
FCurrentBasePath:=FPathStack[FPathStack.Count-1];
FPathStack.Delete(FPathStack.Count-1);
end;
procedure TConfigStorage.WriteObject(Path: String; Obj: TPersistent; DefObject: TPersistent;
OnlyProperty: String);
var
PropCount,i : integer;
PropList : PPropList;
begin
// Do Not extebd the path, individual SetValue will be called, and Extend it
//Path := ExtendPath(Path);
PropCount:=GetPropList(Obj,PropList);
if PropCount>0 then begin
try
for i := 0 to PropCount-1 do
WriteProperty(Path, Obj, PropList^[i], DefObject, OnlyProperty);
finally
Freemem(PropList);
end;
end;
end;
procedure TConfigStorage.ReadObject(Path: String; Obj: TPersistent; DefObject: TPersistent;
OnlyProperty: String);
var
PropCount,i : integer;
PropList : PPropList;
begin
// Do Not extebd the path, individual SetValue will be called, and Extend it
//Path := ExtendPath(Path);
PropCount:=GetPropList(Obj,PropList);
if PropCount>0 then begin
try
for i := 0 to PropCount-1 do
ReadProperty(Path, Obj, PropList^[i], DefObject, OnlyProperty);
finally
Freemem(PropList);
end;
end;
end;
{ TConfigMemStorage }
procedure TConfigMemStorage.CreateRoot;
begin
Root:=TConfigMemStorageNode.Create(nil,'');
end;
procedure TConfigMemStorage.CreateChilds(Node: TConfigMemStorageNode);
begin
Node.Children:=TAvlTree.Create(@CompareConfigMemStorageNodes);
end;
procedure TConfigMemStorage.Modify(const APath: string;
Mode: TConfigMemStorageModification; var AValue: string);
var
Node: TConfigMemStorageNode;
p: PChar;
StartPos: PChar;
ChildNode: TAvlTreeNode;
Child: TConfigMemStorageNode;
NewName: string;
begin
//DebugLn(['TConfigMemStorage.Modify APath="',APath,'" Mode=',ord(Mode),' AValue="',AValue,'"']);
p:=PChar(APath);
if p=nil then begin
if Root<>nil then begin
if Mode in [cmsmDelete,cmsmDeleteValue] then
Root.Value:='';
if Mode=cmsmDelete then
Root.ClearChilds;
end;
end else begin
if Root=nil then begin
if Mode in [cmsmDelete,cmsmDeleteValue] then exit;
CreateRoot;
end;
Node:=Root;
repeat
StartPos:=p;
while (not (p^ in ['/',#0])) do inc(p);
//DebugLn(['TConfigMemStorage.Modify Node="',Node.Name,'" StartPos="',StartPos,'"']);
// child node
if Node.Children=nil then begin
if Mode in [cmsmDelete,cmsmDeleteValue,cmsmGet] then exit;
CreateChilds(Node);
end;
ChildNode:=Node.Children.FindKey(StartPos,@ComparePCharWithConfigMemStorageNode);
if ChildNode=nil then begin
if Mode in [cmsmDelete,cmsmDeleteValue,cmsmGet] then exit;
NewName:='';
SetLength(NewName,p-StartPos);
if NewName<>'' then
System.Move(StartPos^,NewName[1],p-StartPos);
//DebugLn(['TConfigMemStorage.Modify Adding "',NewName,'"']);
Child:=TConfigMemStorageNode.Create(Node,NewName);
Node.Children.Add(Child);
end else
Child:=TConfigMemStorageNode(ChildNode.Data);
Node:=Child;
if p^='/' then begin
// next level
while (p^='/') do inc(p);
end else begin
// end of path
case Mode of
cmsmSet: Node.Value:=AValue;
cmsmGet: AValue:=Node.Value;
cmsmDelete,cmsmDeleteValue:
begin
Node.Value:='';
if Mode=cmsmDelete then
Node.ClearChilds;
while (Node<>nil) and ((Node.Children=nil) or (Node.Children.Count=0))
do begin
Child:=Node;
Node:=Node.Parent;
if Root=Child then Root:=nil;
Child.Free;
end;
end;
end;
exit;
end;
until false;
end;
end;
procedure TConfigMemStorage.DeleteFullPath(const APath: string);
var
V: string;
begin
V:='';
Modify(APath,cmsmDelete,V);
end;
procedure TConfigMemStorage.DeleteFullPathValue(const APath: string);
var
V: string;
begin
V:='';
Modify(APath,cmsmDeleteValue,V);
end;
function TConfigMemStorage.GetFullPathValue(const APath, ADefault: String
): String;
begin
Result:=ADefault;
Modify(APath,cmsmGet,Result);
end;
function TConfigMemStorage.GetFullPathValue(const APath: String; ADefault:
Boolean): Boolean;
var
s: string;
begin
if ADefault then
s := 'True'
else
s := 'False';
s := GetFullPathValue(APath, s);
if CompareText(s,'TRUE')=0 then
Result := True
else if CompareText(s,'FALSE')=0 then
Result := False
else
Result := ADefault;
end;
function TConfigMemStorage.GetFullPathValue(const APath: String; ADefault:
Integer): Integer;
begin
Result := StrToIntDef(GetFullPathValue(APath, IntToStr(ADefault)),ADefault);
end;
procedure TConfigMemStorage.SetDeleteFullPathValue(const APath, AValue, DefValue
: String);
begin
if AValue=DefValue then
DeleteFullPathValue(APath)
else
SetFullPathValue(APath,AValue);
end;
procedure TConfigMemStorage.SetDeleteFullPathValue(const APath: String; AValue,
DefValue: Boolean);
begin
if AValue=DefValue then
DeleteFullPath(APath)
else
SetFullPathValue(APath,AValue);
end;
procedure TConfigMemStorage.SetDeleteFullPathValue(const APath: String; AValue,
DefValue: Integer);
begin
if AValue=DefValue then
DeleteFullPath(APath)
else
SetFullPathValue(APath,AValue);
end;
procedure TConfigMemStorage.SetFullPathValue(const APath, AValue: String);
var
V: String;
begin
V:=AValue;
Modify(APath,cmsmSet,V);
end;
procedure TConfigMemStorage.SetFullPathValue(const APath: String; AValue:
Boolean);
begin
if AValue then
SetFullPathValue(APath, 'True')
else
SetFullPathValue(APath, 'False');
end;
procedure TConfigMemStorage.SetFullPathValue(const APath: String; AValue:
Integer);
begin
SetFullPathValue(APath,IntToStr(AValue));
end;
function TConfigMemStorage.GetFilename: string;
begin
Result:='';
end;
procedure TConfigMemStorage.WriteToDisk;
begin
raise Exception.Create('TConfigMemStorage.WriteToDisk invalid operation');
end;
destructor TConfigMemStorage.Destroy;
begin
FreeAndNil(Root);
inherited Destroy;
end;
procedure TConfigMemStorage.Clear;
begin
FreeAndNil(Root);
end;
procedure TConfigMemStorage.SaveToConfig(Config: TConfigStorage;
const APath: string);
procedure Save(Node: TConfigMemStorageNode; SubPath: string);
var
ChildNode: TAvlTreeNode;
Child: TConfigMemStorageNode;
Names: String;
begin
if Node=nil then exit;
if (Node<>Root) then
SubPath:=SubPath+'_'+Node.Name+'/';
Config.SetDeleteValue(SubPath+'Value',Node.Value,'');
Names:='';
if Node.Children<>nil then begin
ChildNode:=Node.Children.FindLowest;
while ChildNode<>nil do begin
Child:=TConfigMemStorageNode(ChildNode.Data);
if Names<>'' then Names:=Names+'/';
Names:=Names+Child.Name;
Save(Child,SubPath);
ChildNode:=Node.Children.FindSuccessor(ChildNode);
end;
end;
Config.SetDeleteValue(SubPath+'Items',Names,'');
end;
begin
Save(Root,APath);
if (Root<>nil) and ((Root.Value<>'') or (Root.Children<>nil)) then
Config.SetValue(APath+'Version',ConfigMemStorageFormatVersion);
end;
procedure TConfigMemStorage.LoadFromConfig(Config: TConfigStorage;
const APath: string);
var
StorageVersion: LongInt;
procedure Load(Node: TConfigMemStorageNode; SubPath: string);
var
ChildNames: string;
ChildName: string;
p: PChar;
StartPos: PChar;
Child: TConfigMemStorageNode;
begin
if Node=nil then exit;
if (Node<>Root) then
SubPath:=SubPath+'_'+Node.Name+'/';
Node.Value:=Config.GetValue(SubPath+'Value','');
if StorageVersion<2 then
ChildNames:=Config.GetValue(SubPath+'Childs','')
else
ChildNames:=Config.GetValue(SubPath+'Items','');
//DebugLn(['Load SubPath="',SubPath,'" Value="',Node.Value,'" ChildNames="',ChildNames,'"']);
if ChildNames<>'' then begin
p:=PChar(ChildNames);
repeat
StartPos:=p;
while not (p^ in ['/',#0]) do inc(p);
ChildName:='';
SetLength(ChildName,p-StartPos);
if ChildName<>'' then
System.Move(StartPos^,ChildName[1],p-StartPos);
Child:=TConfigMemStorageNode.Create(Node,ChildName);
if Node.Children=nil then
CreateChilds(Node);
Node.Children.Add(Child);
Load(Child,SubPath);
if p^=#0 then break;
inc(p);
until false;
end;
end;
begin
//DebugLn(['TConfigMemStorage.LoadFromConfig ']);
Clear;
if Root=nil then
CreateRoot;
StorageVersion:=Config.GetValue(APath+'Version',0);
//debugln(['TConfigMemStorage.LoadFromConfig ',APath,' Version=',StorageVersion]);
Load(Root,APath);
end;
procedure TConfigMemStorage.WriteDebugReport;
procedure w(Node: TConfigMemStorageNode; Prefix: string);
var
AVLNode: TAvlTreeNode;
begin
if Node=nil then exit;
DebugLn(['TConfigMemStorage.WriteDebugReport ',Prefix,'Name="',Node.Name,'" Value="',Node.Value,'"']);
if Node.Children<>nil then begin
AVLNode:=Node.Children.FindLowest;
while AVLNode<>nil do begin
w(TConfigMemStorageNode(AVLNode.Data),Prefix+' ');
AVLNode:=Node.Children.FindSuccessor(AVLNode);
end;
end;
end;
begin
DebugLn(['TConfigMemStorage.WriteDebugReport ']);
w(Root,'');
end;
{ TConfigMemStorageNode }
procedure TConfigMemStorageNode.ClearChilds;
var
OldChilds: TAvlTree;
begin
if Children<>nil then begin
OldChilds:=Children;
Children:=nil;
OldChilds.FreeAndClear;
OldChilds.Free;
end;
end;
constructor TConfigMemStorageNode.Create(AParent: TConfigMemStorageNode;
const AName: string);
begin
Parent:=AParent;
Name:=AName;
end;
destructor TConfigMemStorageNode.Destroy;
begin
ClearChilds;
if (Parent<>nil) and (Parent.Children<>nil) then
Parent.Children.Remove(Self);
inherited Destroy;
end;
end.
| 30.776403 | 106 | 0.665925 |
476dc351c6386610b7dae0e1f3a45c211d310f49 | 4,937 | pas | Pascal | Source/Services/Polly/Base/Model/AWS.Polly.Model.LexiconAttributes.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 67 | 2021-07-28T23:47:09.000Z | 2022-03-15T11:48:35.000Z | Source/Services/Polly/Base/Model/AWS.Polly.Model.LexiconAttributes.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 5 | 2021-09-01T09:31:16.000Z | 2022-03-16T18:19:21.000Z | Source/Services/Polly/Base/Model/AWS.Polly.Model.LexiconAttributes.pas | herux/aws-sdk-delphi | 4ef36e5bfc536b1d9426f78095d8fda887f390b5 | [
"Apache-2.0"
]
| 13 | 2021-07-29T02:41:16.000Z | 2022-03-16T10:22:38.000Z | unit AWS.Polly.Model.LexiconAttributes;
interface
uses
Bcl.Types.Nullable,
AWS.Polly.Enums;
type
TLexiconAttributes = class;
ILexiconAttributes = interface
function GetAlphabet: string;
procedure SetAlphabet(const Value: string);
function GetLanguageCode: TLanguageCode;
procedure SetLanguageCode(const Value: TLanguageCode);
function GetLastModified: TDateTime;
procedure SetLastModified(const Value: TDateTime);
function GetLexemesCount: Integer;
procedure SetLexemesCount(const Value: Integer);
function GetLexiconArn: string;
procedure SetLexiconArn(const Value: string);
function GetSize: Integer;
procedure SetSize(const Value: Integer);
function Obj: TLexiconAttributes;
function IsSetAlphabet: Boolean;
function IsSetLanguageCode: Boolean;
function IsSetLastModified: Boolean;
function IsSetLexemesCount: Boolean;
function IsSetLexiconArn: Boolean;
function IsSetSize: Boolean;
property Alphabet: string read GetAlphabet write SetAlphabet;
property LanguageCode: TLanguageCode read GetLanguageCode write SetLanguageCode;
property LastModified: TDateTime read GetLastModified write SetLastModified;
property LexemesCount: Integer read GetLexemesCount write SetLexemesCount;
property LexiconArn: string read GetLexiconArn write SetLexiconArn;
property Size: Integer read GetSize write SetSize;
end;
TLexiconAttributes = class
strict private
FAlphabet: Nullable<string>;
FLanguageCode: Nullable<TLanguageCode>;
FLastModified: Nullable<TDateTime>;
FLexemesCount: Nullable<Integer>;
FLexiconArn: Nullable<string>;
FSize: Nullable<Integer>;
function GetAlphabet: string;
procedure SetAlphabet(const Value: string);
function GetLanguageCode: TLanguageCode;
procedure SetLanguageCode(const Value: TLanguageCode);
function GetLastModified: TDateTime;
procedure SetLastModified(const Value: TDateTime);
function GetLexemesCount: Integer;
procedure SetLexemesCount(const Value: Integer);
function GetLexiconArn: string;
procedure SetLexiconArn(const Value: string);
function GetSize: Integer;
procedure SetSize(const Value: Integer);
strict protected
function Obj: TLexiconAttributes;
public
function IsSetAlphabet: Boolean;
function IsSetLanguageCode: Boolean;
function IsSetLastModified: Boolean;
function IsSetLexemesCount: Boolean;
function IsSetLexiconArn: Boolean;
function IsSetSize: Boolean;
property Alphabet: string read GetAlphabet write SetAlphabet;
property LanguageCode: TLanguageCode read GetLanguageCode write SetLanguageCode;
property LastModified: TDateTime read GetLastModified write SetLastModified;
property LexemesCount: Integer read GetLexemesCount write SetLexemesCount;
property LexiconArn: string read GetLexiconArn write SetLexiconArn;
property Size: Integer read GetSize write SetSize;
end;
implementation
{ TLexiconAttributes }
function TLexiconAttributes.Obj: TLexiconAttributes;
begin
Result := Self;
end;
function TLexiconAttributes.GetAlphabet: string;
begin
Result := FAlphabet.ValueOrDefault;
end;
procedure TLexiconAttributes.SetAlphabet(const Value: string);
begin
FAlphabet := Value;
end;
function TLexiconAttributes.IsSetAlphabet: Boolean;
begin
Result := FAlphabet.HasValue;
end;
function TLexiconAttributes.GetLanguageCode: TLanguageCode;
begin
Result := FLanguageCode.ValueOrDefault;
end;
procedure TLexiconAttributes.SetLanguageCode(const Value: TLanguageCode);
begin
FLanguageCode := Value;
end;
function TLexiconAttributes.IsSetLanguageCode: Boolean;
begin
Result := FLanguageCode.HasValue;
end;
function TLexiconAttributes.GetLastModified: TDateTime;
begin
Result := FLastModified.ValueOrDefault;
end;
procedure TLexiconAttributes.SetLastModified(const Value: TDateTime);
begin
FLastModified := Value;
end;
function TLexiconAttributes.IsSetLastModified: Boolean;
begin
Result := FLastModified.HasValue;
end;
function TLexiconAttributes.GetLexemesCount: Integer;
begin
Result := FLexemesCount.ValueOrDefault;
end;
procedure TLexiconAttributes.SetLexemesCount(const Value: Integer);
begin
FLexemesCount := Value;
end;
function TLexiconAttributes.IsSetLexemesCount: Boolean;
begin
Result := FLexemesCount.HasValue;
end;
function TLexiconAttributes.GetLexiconArn: string;
begin
Result := FLexiconArn.ValueOrDefault;
end;
procedure TLexiconAttributes.SetLexiconArn(const Value: string);
begin
FLexiconArn := Value;
end;
function TLexiconAttributes.IsSetLexiconArn: Boolean;
begin
Result := FLexiconArn.HasValue;
end;
function TLexiconAttributes.GetSize: Integer;
begin
Result := FSize.ValueOrDefault;
end;
procedure TLexiconAttributes.SetSize(const Value: Integer);
begin
FSize := Value;
end;
function TLexiconAttributes.IsSetSize: Boolean;
begin
Result := FSize.HasValue;
end;
end.
| 27.892655 | 84 | 0.787725 |
47e51a07928ac208699b0f6591180753fc4a6aac | 11,154 | pas | Pascal | IrisEdit/Unit_OpenGLWrapper.pas | zerodowned/Iris1_DeveloperTools | 0b5510bb46824d8939846f73c7e63ed7eecf827d | [
"DOC"
]
| 1 | 2019-02-08T18:03:28.000Z | 2019-02-08T18:03:28.000Z | IrisEdit/Unit_OpenGLWrapper.pas | SiENcE/Iris1_DeveloperTools | 0b5510bb46824d8939846f73c7e63ed7eecf827d | [
"DOC"
]
| null | null | null | IrisEdit/Unit_OpenGLWrapper.pas | SiENcE/Iris1_DeveloperTools | 0b5510bb46824d8939846f73c7e63ed7eecf827d | [
"DOC"
]
| 7 | 2015-03-11T22:06:23.000Z | 2019-12-21T09:49:57.000Z | {==============================================================================
Iris Model Editor - Copyright by Alexander Oster, tensor@ultima-iris.de
The contents of this file are used with permission, subject to
the Mozilla Public License Version 1.1 (the "License"); you may
not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
==============================================================================}
unit Unit_OpenGLWrapper;
interface
uses Windows,
Unit_OpenGL,
Unit_OpenGLGeometry,
SysUtils,
Graphics;
const
FarClipping = 10000.0;
NearClipping = -10000.0;
type
TGLEngine = class(TObject)
PROTECTED
FInitialized: Boolean;
FHandle: HDC;
FRC: HGLRC;
FXPos, FYPos: Integer;
FSize: Single;
FRatio: Single;
FWidth, FHeight: Integer;
FMustbeInitialized: Boolean;
procedure SetPixelFormat(Handle: HDC);
PUBLIC
property Initialized: Boolean READ FInitialized;
property Ratio: Single READ FRatio WRITE FRatio;
property MustbeInitialized: Boolean READ FMustbeInitialized WRITE
FMustbeInitialized;
constructor Create;
destructor Destroy; OVERRIDE;
function StartGL(Handle: HDC): Boolean;
procedure SetupGL;
procedure DeInit (Handle: HDC);
procedure SetViewPortOrtho(XPos, YPos, Width, Height: Integer; Size: Single
=
-1);
procedure SetViewPortPerspective(XPos, YPos, Width, Height: Integer);
procedure ResetMaterial;
procedure MakeCurrent(Handle: HDC);
procedure SwapBuffers(Handle: HDC);
end;
procedure SetClearColor(Color: TColor);
procedure SetColor(AColor: TColor; Transparency: Single = 1.0);
procedure SetMaterial(AAmbient, ADiffuse, ASpecular, AShininess: Single);
procedure SetColorMaterial(Specular, Ambient, Diffuse: TColor; Shininess:
Single);
procedure SetLightColor (Color: TColor);
const
light_position : array[0..3] of TGLfloat = (-2.0, 2.0, 2.0, 0.0);
light_ambient : array[0..3] of TGLfloat = (0.40, 0.40, 0.40, 1.0);
mat_specular : array[0..3] of TGLfloat = (0.2, 0.2, 0.2, 1.0);
mat_shininess : array[0..0] of TGLfloat = (0.2);
mat_ambient : array[0..3] of TGLfloat = (0.9, 0.9, 0.9, 1.0);
mat_diffuse : array[0..3] of TGLfloat = (0.7, 0.7, 0.7, 1.0);
mat_green : array[0..3] of TGLfloat = (0.0, 0.8, 0.0, 1.0);
mat_yellow : array[0..3] of TGLfloat = (0.0, 0.8, 0.8, 1.0);
mat_red : array[0..3] of TGLfloat = (0.8, 0.0, 0.0, 1.0);
var
OpenGLIsInitialized: Boolean = True;
implementation
constructor TGLEngine.Create;
begin
FInitialized := False;
FRatio := 1;
FRC := 0;
FSize := 200;
FMustbeInitialized := True;
end;
destructor TGLEngine.Destroy;
begin
if FInitialized and FMustbeInitialized then
Deinit (FHandle);
end;
function TGLEngine.StartGL(Handle: HDC): Boolean;
begin
result := True;
if not OpenGLIsInitialized then begin
InitOpenGL;
OpenGLIsInitialized := True;
end;
if FInitialized then exit;
{ if not LoadOpenGL then exit;
}
SetPixelFormat(Handle);
{ FRC := wglCreateContext(Handle);
if (FRC=0) then
raise Exception.Create('could not create RC');
if (not wglMakeCurrent(Handle, FRC)) then
raise Exception.Create('OpenGL Error');
{ ClearExtensions;
ReadExtensions;}
// OpenGL-Funtionen initialisieren
// Renderkontext erstellen (32 Bit Farbtiefe, 24 Bit Tiefenpuffer, Doublebuffering)
FRC := CreateRenderingContext(Handle, [opDoubleBuffered], 32, 16, 0, 0, 0, 0);
// Erstellten Renderkontext aktivieren
ActivateRenderingContext(Handle, FRC);
FInitialized := True;
FHandle := Handle;
end;
procedure TGLEngine.SetupGL;
begin
if (not FInitialized and FMustbeInitialized) then
exit;
glClearColor(0.49, 0.52, 1.0, 1.0);
glEnable(GL_DEPTH_TEST);
glEnable(gl_Cull_Face);
glClearDepth(1.0); // Enables Clearing Of The Depth Buffer
glDepthFunc(GL_LESS); // The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glShadeModel(GL_FLAT); // Enables Smooth Color Shading
glMatrixMode(GL_PROJECTION);
glDisable(GL_TEXTURE_2D);
glEnable(GL_NORMALIZE);
glMaterialfv(GL_FRONT, GL_SPECULAR, @mat_specular[0]);
glMaterialfv(GL_FRONT, GL_SHININESS, @mat_shininess[0]);
glMaterialfv(GL_FRONT, GL_AMBIENT, @mat_ambient[0]);
glMaterialfv(GL_FRONT, GL_DIFFUSE, @mat_diffuse[0]);
glLightfv(GL_LIGHT0, GL_POSITION, @light_position[0]);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @light_ambient[0]);
glMatrixMode(GL_MODELVIEW);
end;
procedure TGLEngine.DeInit;
begin
if FRC <> 0 then
begin
if (not wglMakeCurrent(FHandle, 0)) then
MessageBox(0, 'Release of DC and RC failed.', ' Shutdown Error', MB_OK or
MB_ICONERROR);
if (not wglDeleteContext(FRC)) then
begin
MessageBox(0, 'Release of Rendering Context failed.', ' Shutdown Error',
MB_OK or MB_ICONERROR);
end
end;
FInitialized := False;
end;
procedure TGLEngine.SetViewPortOrtho(XPos, YPos, Width, Height: Integer; Size:
Single);
var
ASizeY : Integer;
begin
glViewport(XPos, YPos, Width, Height);
FXPos := XPos;
FYPos := YPos;
FWidth := Width;
FHeight := Height;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if Size > 0 then
FSize := Size;
ASizeY := trunc(FSize * Ratio);
glOrtho(-FSize / 2, FSize / 2, -ASizeY / 2, ASizeY / 2, NearClipping,
FarClipping);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
end;
procedure TGLEngine.SetViewPortPerspective(XPos, YPos, Width, Height: Integer);
//var
// ASizeY: Integer;
begin
if Height <= 0 then
Height := 1;
glViewport(XPos, YPos, Width, Height);
FXPos := XPos;
FYPos := YPos;
FWidth := Width;
FHeight := Height;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, Width / Height, 1, FarClipping);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
end;
procedure TGLEngine.SetPixelFormat(Handle: HDC);
var
PixelFormat : TGLuint;
PFD : pixelformatdescriptor;
begin
Fillchar(PFD, sizeof(PFD), 0);
with pfd do
begin
nSize := SizeOf(PIXELFORMATDESCRIPTOR);
nVersion := 1;
dwFlags := PFD_DRAW_TO_WINDOW
or PFD_SUPPORT_OPENGL
or PFD_DOUBLEBUFFER;
iPixelType := PFD_TYPE_RGBA;
cColorBits := 32;
cRedBits := 0;
cRedShift := 0;
cGreenBits := 0;
cBlueBits := 0;
cBlueShift := 0;
cAlphaBits := 0;
cAlphaShift := 0;
cAccumBits := 0;
cAccumRedBits := 0;
cAccumGreenBits := 0;
cAccumBlueBits := 0;
cAccumAlphaBits := 0;
cDepthBits := 16;
cStencilBits := 0;
cAuxBuffers := 0;
iLayerType := PFD_MAIN_PLANE;
bReserved := 0;
dwLayerMask := 0;
dwVisibleMask := 0;
dwDamageMask := 0
end;
if Handle = 0 then
raise Exception.Create('Invalid OpenGL - Handle!');
PixelFormat := ChoosePixelFormat(Handle, @pfd);
if (PixelFormat = 0) then
raise
Exception.Create('Could not choose Pixel format' + IntToStr(GetLastError()));
if (not Windows.SetPixelFormat(Handle, PixelFormat, @pfd)) then
raise
Exception.Create('Could not set Pixel format' + IntToStr(GetLastError()));
end; (*SetPixelFormat*)
procedure TGLEngine.ResetMaterial;
begin
glMaterialfv(GL_FRONT, GL_SPECULAR, @mat_specular[0]);
glMaterialfv(GL_FRONT, GL_SHININESS, @mat_shininess[0]);
glMaterialfv(GL_FRONT, GL_AMBIENT, @mat_ambient[0]);
glMaterialfv(GL_FRONT, GL_DIFFUSE, @mat_diffuse[0]);
end;
procedure TGLEngine.MakeCurrent(Handle: HDC);
begin
FHandle := Handle;
wglMakeCurrent(Handle, FRC);
end;
procedure TGLEngine.SwapBuffers(Handle: HDC);
begin
MakeCurrent(Handle);
Windows.SwapBuffers(Handle);
end;
procedure SetClearColor(Color: TColor);
begin
glClearColor((Color and $FF) / 255, ((Color shr 8) and $FF) / 255, ((Color shr
16) and $FF) / 255, 1.0);
end;
procedure SetColor(AColor: TColor; Transparency: Single = 1.0);
begin
glColor4f((AColor and $FF) / 255, ((AColor shr 8) and $FF) / 255, ((AColor shr
16) and $FF) / 255, Transparency);
end;
procedure SetMaterial(AAmbient, ADiffuse, ASpecular, AShininess: Single);
var
mat_specular : array[0..3] of TGLfloat;
mat_shininess : array[0..0] of TGLfloat;
mat_ambient : array[0..3] of TGLfloat;
mat_diffuse : array[0..3] of TGLfloat;
begin
mat_specular[0] := ASpecular;
mat_specular[1] := ASpecular;
mat_specular[2] := ASpecular;
mat_specular[3] := 1.0;
mat_ambient[0] := AAmbient;
mat_ambient[1] := AAmbient;
mat_ambient[2] := AAmbient;
mat_ambient[3] := 1.0;
mat_diffuse[0] := ADiffuse;
mat_diffuse[1] := ADiffuse;
mat_diffuse[2] := ADiffuse;
mat_diffuse[3] := 1.0;
mat_shininess[0] := AShininess * 255;
glMaterialfv(GL_FRONT, GL_SPECULAR, @mat_specular[0]);
glMaterialfv(GL_FRONT, GL_SHININESS, @mat_shininess[0]);
glMaterialfv(GL_FRONT, GL_AMBIENT, @mat_ambient[0]);
glMaterialfv(GL_FRONT, GL_DIFFUSE, @mat_diffuse[0]);
end;
procedure SetColorMaterial(Specular, Ambient, Diffuse: TColor; Shininess:
Single);
var
mat_specular : array[0..3] of TGLfloat;
mat_shininess : array[0..0] of TGLfloat;
mat_ambient : array[0..3] of TGLfloat;
mat_diffuse : array[0..3] of TGLfloat;
begin
mat_specular[0] := ((Specular shr 0) and $FF) / 255;
mat_specular[1] := ((Specular shr 8) and $FF) / 255;
mat_specular[2] := ((Specular shr 16) and $FF) / 255;
mat_specular[3] := 1.0;
mat_ambient[0] := ((Ambient shr 0) and $FF) / 255;
mat_ambient[1] := ((Ambient shr 8) and $FF) / 255;
mat_ambient[2] := ((Ambient shr 16) and $FF) / 255;
mat_ambient[3] := 1.0;
mat_diffuse[0] := ((Diffuse shr 0) and $FF) / 255;
mat_diffuse[1] := ((Diffuse shr 8) and $FF) / 255;
mat_diffuse[2] := ((Diffuse shr 16) and $FF) / 255;
mat_diffuse[3] := 1.0;
mat_shininess[0] := Shininess;
glMaterialfv(GL_FRONT, GL_SPECULAR, @mat_specular[0]);
glMaterialfv(GL_FRONT, GL_SHININESS, @mat_shininess[0]);
glMaterialfv(GL_FRONT, GL_AMBIENT, @mat_ambient[0]);
glMaterialfv(GL_FRONT, GL_DIFFUSE, @mat_diffuse[0]);
end;
procedure SetLightColor (Color: TColor);
var
facs: array[0..3] of TGLfloat ;
mat: array[0..3] of TGLfloat;
Index: Integer;
begin
facs[0] := (Color and $FF) / 255;
facs[1] := ((Color shr 8) and $FF) / 255;
facs[2] := ((Color shr 16) and $FF) / 255;
facs[3] := 1.0;
for Index := 0 to 3 do
mat[Index] := mat_ambient[Index] * facs[Index];
glMaterialfv(GL_FRONT, GL_AMBIENT, @mat[0]);
for Index := 0 to 3 do
mat[Index] := mat_diffuse[Index] * facs[Index];
glMaterialfv(GL_FRONT, GL_DIFFUSE, @mat[0]);
end;
initialization
InitOpenGL;
end.
| 28.526854 | 87 | 0.662722 |
f1ec6d4954600daf9eade180380418bbd3ae0a8e | 47,582 | pas | Pascal | src/antic4_tiles_gen.pas | Gury8/Mad-Studio | 1be966f3d939b55ea03d4740a2f7378379836a18 | [
"MIT"
]
| 8 | 2020-10-24T15:33:38.000Z | 2022-01-26T19:58:16.000Z | src/antic4_tiles_gen.pas | Gury8/Mad-Studio | 1be966f3d939b55ea03d4740a2f7378379836a18 | [
"MIT"
]
| 1 | 2021-04-27T13:04:08.000Z | 2021-05-01T18:50:54.000Z | src/antic4_tiles_gen.pas | Gury8/Mad-Studio | 1be966f3d939b55ea03d4740a2f7378379836a18 | [
"MIT"
]
| null | null | null | {
Program name: Mad Studio
Author: Boštjan Gorišek
Release year: 2016 - 2021
Unit: Antic mode 4 tile editor - source code generator
}
unit antic4_tiles_gen;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, lcltype, Windows,
ComCtrls, Buttons, SpinEx, BCListBox, BCMDButton, BCMaterialDesignButton, StrUtils,
common;
type
{ TfrmAntic4TilesGen }
TfrmAntic4TilesGen = class(TForm)
boxColors : TGroupBox;
boxStartLine : TGroupBox;
boxTilePos : TGroupBox;
btnAtariBASIC : TBCMDButton;
btnClose : TBCMaterialDesignButton;
btnCopyToEditor : TBCMaterialDesignButton;
btnEffectus : TBCMDButton;
btnFastBasic : TBCMDButton;
btnKickC : TBCMDButton;
btnMads : TBCMDButton;
btnCC65 : TBCMDButton;
btnMadPascal : TBCMDButton;
btnTurboBasicXL : TBCMDButton;
chkTextWindow : TCheckBox;
chkUseColors : TCheckBox;
color0 : TShape;
color1 : TShape;
color2 : TShape;
color3 : TShape;
color4 : TShape;
editTilePosY : TSpinEditEx;
editStartLine : TSpinEditEx;
editLineStep : TSpinEditEx;
editTilePosX : TSpinEditEx;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Label7 : TLabel;
Label8 : TLabel;
lblLineStep : TLabel;
lblLineStep1 : TLabel;
lblStartLine : TLabel;
lblStartLine1 : TLabel;
ListExamples : TBCPaperListBox;
memo : TMemo;
panelLang : TBCPaperPanel;
radDataType : TRadioGroup;
StaticText1 : TStaticText;
StaticText2 : TStaticText;
StaticText3 : TStaticText;
procedure FormCreate(Sender : TObject);
procedure FormShow(Sender : TObject);
procedure FormKeyDown(Sender : TObject; var Key : Word; Shift : TShiftState);
procedure CloseProc(Sender : TObject);
procedure CopyToEditorProc(Sender : TObject);
procedure ButtonHoverEnter(Sender : TObject);
procedure ButtonHoverLeave(Sender : TObject);
procedure ExamplesProc(Sender : TObject);
procedure LanguageProc(Sender : TObject);
private
listings : TListings;
isCreate : boolean;
fldChar : array[0.._MAX_TILE_CHARS - 1, 0..7, 0..7] of byte;
procedure CreateCode;
function Example01 : string;
function Example02 : string;
function Example03 : string;
function Example04 : string;
function Example05 : string;
function Example06 : string;
function SetTileDataValues(isOnlyTile : boolean) : string;
function SetTileCharDataValues(isOnlyTile : boolean) : string;
public
end;
var
frmAntic4TilesGen : TfrmAntic4TilesGen;
implementation
{$R *.lfm}
uses
antic4_tiles, src_editor, code_lib, lib;
{ TfrmAntic4TilesGen }
procedure TfrmAntic4TilesGen.FormCreate(Sender : TObject);
var
i : byte;
begin
isCreate := true;
// Example 1
for i := 0 to 7 do
listings[0, i] := true;
// Example 2
for i := 0 to 7 do
listings[1, i] := true;
// Example 3
for i := 0 to 7 do
listings[2, i] := true;
// Example 4
for i := 0 to 7 do
listings[3, i] := true;
// Example 5
listings[4, 0] := true;
listings[4, 1] := true;
listings[4, 2] := true;
listings[4, 3] := false;
listings[4, 4] := true;
listings[4, 5] := false;
listings[4, 6] := false;
listings[4, 7] := false;
// Example 6
listings[5, 0] := true;
listings[5, 1] := true;
listings[5, 2] := true;
listings[5, 3] := false;
listings[5, 4] := true;
listings[5, 5] := false;
listings[5, 6] := false;
listings[5, 7] := false;
// anticMode := IntToStr(frmAntic4Tiles.anticMode);
end;
procedure TfrmAntic4TilesGen.FormShow(Sender : TObject);
begin
FormStyle := fsSystemStayOnTop;
color0.Brush.Color := colTab[0]; // POKE 712,C
color1.Brush.Color := colTab[1]; // POKE 708,C
color2.Brush.Color := colTab[2]; // POKE 709,C
color3.Brush.Color := colTab[3]; // POKE 710,C
color4.Brush.Color := colTab[10]; // POKE 711,C
isCreate := false;
langIndex := 0;
ListExamples.ListBox.ItemIndex := 0;
ExamplesProc(Sender);
end;
procedure TfrmAntic4TilesGen.CreateCode;
var
code : string;
begin
boxStartLine.Enabled := langIndex < 2;
boxStartLine.Visible := boxStartLine.Enabled;
if langIndex = 0 then begin
radDataType.ItemIndex := 0;
TRadioButton(radDataType.Controls[1]).Enabled := false;
TRadioButton(radDataType.Controls[2]).Enabled := false;
end
else begin
TRadioButton(radDataType.Controls[1]).Enabled := true;
TRadioButton(radDataType.Controls[2]).Enabled := true;
end;
memo.Lines.Clear;
case ListExamples.ListBox.ItemIndex of
0: code := Example01;
1: code := Example02;
2: code := Example03;
3: code := Example04;
4: code := Example05;
5: code := Example06;
end;
memo.Lines.Add(code);
// Set cursor position at the top of memo object
memo.SelStart := 0;
memo.SelLength := 0;
SendMessage(memo.Handle, EM_SCROLLCARET, 0, 0);
end;
function TfrmAntic4TilesGen.SetTileDataValues(isOnlyTile : boolean) : string;
var
x, y : byte;
line : string;
i, j, index : byte;
bin : string;
tiles, minTile, maxTile : byte;
col : byte;
maxTiles02 : byte;
codeLine : string = '';
sum : word;
begin
if isOnlyTile then begin
minTile := frmAntic4Tiles.antic4Tile.selected;
maxTile := minTile;
end
else begin
minTile := 1;
maxTile := _MAX_TILES;
end;
case langIndex of
_ACTION:
codeLine := 'BYTE ARRAY'#13#10;
_MAD_PASCAL:
codeLine := 'const'#13#10;
end;
for tiles := minTile to maxTile do begin
sum := 0;
// Map Antic 4 mode character data to Antic 2 mode character data
for i := 0 to _MAX_TILE_CHARS - 1 do
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6: begin
col := frmAntic4Tiles.fldCharAntic45Ex[tiles, i, x + 1, y];
Inc(sum, col);
case col of
0: begin
fldChar[i, x, y] := 0;
fldChar[i, x + 1, y] := 0;
end;
1: begin
fldChar[i, x, y] := 0;
fldChar[i, x + 1, y] := 1;
end;
2: begin
fldChar[i, x, y] := 1;
fldChar[i, x + 1, y] := 0;
end;
3, 10: begin
fldChar[i, x, y] := 1;
fldChar[i, x + 1, y] := 1;
end;
end;
end;
end;
if not isOnlyTile and (sum = 0) then continue;
// Comments
case langIndex of
0, 1:
codeLine += IntToStr(code.number) + ' REM';
_ACTION:
codeLine += ' ;';
_FAST_BASIC:
codeLine += '''';
_MAD_PASCAL:
codeLine += ' //';
_KICKC, _CC65:
codeLine += '//';
_MADS:
codeLine += ';';
end;
codeLine += ' TILE ' + IntToStr(tiles) + ' (' +
IntToStr(frmAntic4Tiles.antic4TileArray[tiles].dimX) + 'x' +
IntToStr(frmAntic4Tiles.antic4TileArray[tiles].dimY) + ')'#13#10;
// Declaration
maxTiles02 := frmAntic4Tiles.antic4TileArray[tiles].dimX *
frmAntic4Tiles.antic4TileArray[tiles].dimY shl 3 - 1;
// maxTiles := frmAntic4Tiles.antic4TileArray[tiles].dimX *
// frmAntic4Tiles.antic4TileArray[tiles].dimY - 1;
case langIndex of
_ACTION:
codeLine += ' tile' + IntToStr(tiles) + ' = [';
_MAD_PASCAL:
codeLine += ' tile' + IntToStr(tiles) + ' : array[0..' + IntToStr(maxTiles02) +
'] of byte = ('#13#10;
_FAST_BASIC:
codeLine += 'DATA tile' + IntToStr(tiles) + '() BYTE = ';
_KICKC:
codeLine += 'const unsigned char tile' + IntToStr(tiles) +
'[] = {'#13#10;
_CC65:
codeLine += 'const unsigned char tile' + IntToStr(tiles) +
'[' + IntToStr(maxTiles02) + '] = {'#13#10;
_MADS:
codeLine += 'TILE' + IntToStr(tiles);
end;
// Data values
// index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tiles].dimY - 1 do begin
for x := 0 to frmAntic4Tiles.antic4TileArray[tiles].dimX - 1 do begin
case langIndex of
0, 1: begin
Inc(code.number, code.step);
codeLine += IntToStr(code.number) + ' DATA ';
end;
_FAST_BASIC: begin
if x + y > 0 then
codeLine += 'DATA BYTE = ';
end;
_MADS: begin
codeLine += ' .BYTE ';
end;
end;
index := x + y shl 2;
// index := x + y*(frmAntic4Tiles.antic4TileArray[tiles].dimY - 1);
// DEBUG('index', index);
for i := 0 to _CHAR_DIM do begin
bin := '';
for j := 0 to _CHAR_DIM do
bin += IntToStr(fldChar[index, j, i]);
case radDataType.ItemIndex of
0: line := IntToStr(Bin2Dec(bin));
1: line := '$' + Dec2Hex(bin2Dec(bin));
2: line := '%' + bin;
end;
codeLine += line;
if i < _CHAR_DIM then begin
if langIndex = _ACTION then
codeLine += ' '
else begin
codeLine += ',';
if langIndex > 1 then
codeLine += ' ';
end;
end;
end;
if (langIndex <> _MADS) and (langIndex > 1) then begin
if (x = frmAntic4Tiles.antic4TileArray[tiles].dimX - 1) and
(y = frmAntic4Tiles.antic4TileArray[tiles].dimY - 1) then
begin
if langIndex = _ACTION then
codeLine += ']'#13#10;
end
else
// codeLine += '(' + inttostr(maxTiles) + ') x, (' + inttostr(index) + ')';
codeLine += ', ';
end;
codeLine += #13#10;
// Inc(index);
end;
end;
case langIndex of
//_ACTION:
// codeLine += ']'#13#10#13#10;
_MAD_PASCAL:
codeLine += ');'#13#10#13#10;
_KICKC, _CC65:
codeLine += '};'#13#10#13#10;
end;
if (tiles < maxTile) and (langIndex < 2) then
Inc(code.number, code.step);
end;
result := codeLine;
end;
function TfrmAntic4TilesGen.SetTileCharDataValues(isOnlyTile : boolean) : string;
var
x, y : byte;
line : string;
index : byte;
bin : string;
tiles, minTile, maxTile : byte;
maxTiles : byte;
codeLine : string = '';
sum : word;
i : byte;
col : byte;
begin
if isOnlyTile then begin
minTile := frmAntic4Tiles.antic4Tile.selected;
maxTile := minTile;
end
else begin
minTile := 1;
maxTile := _MAX_TILES;
end;
case langIndex of
_ACTION:
codeLine := 'BYTE ARRAY'#13#10;
_MAD_PASCAL:
codeLine := 'const'#13#10;
end;
for tiles := minTile to maxTile do begin
sum := 0;
// Map Antic 4 mode character data to Antic 2 mode character data
for i := 0 to _MAX_TILE_CHARS - 1 do
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6: begin
// col := frmAntic4Tiles.fldCharAntic45Ex[tiles, i, x, y];
// Inc(sum, col);
col := frmAntic4Tiles.fldCharAntic45Ex[tiles, i, x + 1, y];
Inc(sum, col);
end;
end;
if not isOnlyTile and (sum = 0) then continue;
case langIndex of
0, 1:
codeLine += IntToStr(code.number) + ' REM';
_ACTION:
codeLine += ' ;';
_FAST_BASIC:
codeLine += '''';
_MAD_PASCAL, _KICKC, _CC65:
codeLine += ' //';
_MADS:
codeLine += ';';
end;
// Comments
codeLine += ' TILE ' + IntToStr(tiles) + ' CHARACTER INTERNAL CODE MAP (' +
IntToStr(frmAntic4Tiles.antic4TileArray[tiles].dimX) + 'x' +
IntToStr(frmAntic4Tiles.antic4TileArray[tiles].dimY) + ')'#13#10;
// Declaration
maxTiles := frmAntic4Tiles.antic4TileArray[tiles].dimX *
frmAntic4Tiles.antic4TileArray[tiles].dimY - 1;
case langIndex of
_ACTION:
codeLine += ' tile' + IntToStr(tiles) + 'CharMap = [';
_MAD_PASCAL:
codeLine += ' tile' + IntToStr(tiles) + 'CharMap : array[0..' + IntToStr(maxTiles) +
'] of byte = ('#13#10;
_FAST_BASIC:
codeLine += 'DATA tile' + IntToStr(tiles) + 'CharMap() BYTE = ';
_KICKC:
codeLine += 'const unsigned char tile' + IntToStr(tiles) + 'CharMap' +
'[] = {'#13#10;
_CC65:
codeLine += 'const unsigned char tile' + IntToStr(tiles) + 'CharMap' +
'[' + IntToStr(maxTiles) + '] = {'#13#10;
_MADS:
codeLine += 'TILE' + IntToStr(tiles);
end;
// for index := 0 to _MAX_TILE_CHARS - 1 do
// debug('index, value', index, frmAntic4Tiles.antic4TileArray[tiles].charValues[index]);
// Character internal code values
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tiles].dimY - 1 do begin
case langIndex of
0, 1: begin
Inc(code.number, code.step);
codeLine += IntToStr(code.number) + ' DATA ';
end;
_FAST_BASIC: begin
if y > 0 then
codeLine += 'DATA BYTE = ';
end;
_MADS: begin
codeLine += ' .BYTE ';
end;
end;
for x := 0 to frmAntic4Tiles.antic4TileArray[tiles].dimX - 1 do begin
// index := x + y shl 2;
// index := x + y*frmAntic4Tiles.antic4TileArray[tiles].dimX;
//if y < 2 then begin
// index := x + y shl 2;
//end
//else begin
// if y = 2 then begin
// case x of
// 0: index := 9;
// 1: index := 10;
// 2: index := 11;
// end;
// end;
//end;
// if frmAntic4Tiles.antic4TileArray[tiles].charValues[index] = 0 then begin
// frmAntic4Tiles.antic4TileArray[tiles].charValues[index] := 33;
// debug('index', index);
// end;
// debug('index, value', index, frmAntic4Tiles.antic4TileArray[tiles].charValues[index]);
if radDataType.ItemIndex = 0 then
line := IntToStr(frmAntic4Tiles.antic4TileArray[tiles].charValues[index])
else begin
bin := IntToBin(frmAntic4Tiles.antic4TileArray[tiles].charValues[index], 8);
case radDataType.ItemIndex of
1: line := '$' + Dec2Hex(bin2Dec(bin));
2: line := '%' + bin;
end;
end;
codeLine += line;
if (langIndex = _MADS) and (x = frmAntic4Tiles.antic4TileArray[tiles].dimX - 1) then begin
end
else if (x = frmAntic4Tiles.antic4TileArray[tiles].dimX - 1) and
(y = frmAntic4Tiles.antic4TileArray[tiles].dimY - 1) then
begin
if langIndex = _ACTION then
codeLine += ']'#13#10;
end
else begin
if langIndex = _ACTION then
codeLine += ' '
else begin
if x < frmAntic4Tiles.antic4TileArray[tiles].dimX - 1 then begin
codeLine += ',';
if langIndex > 1 then
codeLine += ' ';
end
else if langIndex > 1 then
codeLine += ',';
end;
end;
Inc(index);
end;
codeLine += #13#10;
end;
case langIndex of
//_ACTION:
// codeLine += ']'#13#10#13#10;
_MAD_PASCAL:
codeLine += ');'#13#10#13#10;
_KICKC, _CC65:
codeLine += '};'#13#10#13#10;
end;
if (tiles < maxTiles) and (langIndex < 2) then
Inc(code.number, code.step);
end;
result := codeLine;
end;
function TfrmAntic4TilesGen.Example01 : string;
begin
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
end;
code.line := SetTileDataValues(true);
result := code.line;
end;
function TfrmAntic4TilesGen.Example02 : string;
begin
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
end;
code.line := SetTileDataValues(false);
result := code.line;
end;
function TfrmAntic4TilesGen.Example03 : string;
begin
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
end;
code.line := SetTileCharDataValues(true);
code.line += SetTileDataValues(true);
result := code.line;
end;
function TfrmAntic4TilesGen.Example04 : string;
begin
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
end;
code.line := SetTileCharDataValues(false);
// if langIndex < 2 then
// Inc(code.number, code.step);
code.line += SetTileDataValues(false);
result := code.line;
end;
function TfrmAntic4TilesGen.Example05 : string;
var
maxTileChars : byte;
i, index : byte;
x, y : byte;
tileSelected : byte;
charx : byte;
inverseIndex : byte;
strTextWindow : string = '';
begin
if not chkTextWindow.Checked then
strTextWindow := '+16';
code.line := '';
tileSelected := frmAntic4Tiles.antic4Tile.selected;
maxTileChars := frmAntic4Tiles.antic4TileArray[tileSelected].dimX *
frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1;
{ Atari BASIC / Turbo BASIC XL
---------------------------------------------------------------------------}
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
code.line += CodeLine('REM ******************************');
code.line += CodeLine('REM MODIFIED CHARACTERS');
code.line += CodeLine('REM ******************************');
code.line += CodeLine('DIM TILE1CHARMAP(' + IntToStr(maxTileChars) + ')');
code.line += CodeLine('NMEMTOP=PEEK(106)-4');
code.line += CodeLine('POKE 106,NMEMTOP');
code.line += CodeLine('GRAPHICS 12' + strTextWindow);
code.line += CodeLine('POKE 82,0');
if chkTextWindow.Checked then
code.line += CodeLine('? "COPY ATARI CHARACTER SET TO RAM AREA"');
code.line += CodeLine('CHRAM=NMEMTOP*256');
code.line += CodeLine('FOR I=0 TO 1023:POKE CHRAM+I,PEEK(57344+I):NEXT I');
//if chkTextWindow.Checked then
// code.line += CodeLine('? "DONE!"');
if chkTextWindow.Checked then
code.line += CodeLine('? "STORE TILE CHARACTERS"');
code.line += CodeLine('FOR I=0 TO ' + IntToStr(maxTileChars) +
':READ CHAR:TILE1CHARMAP(I)=CHAR:NEXT I');
if chkTextWindow.Checked then
code.line += CodeLine('? "MODIFY CHARACTER DATA FOR THE TILE"');
code.line += CodeLine('FOR I=0 TO ' + IntToStr(maxTileChars));
code.line += CodeLine('FOR J=0 TO 7:READ D:POKE CHRAM+J+TILE1CHARMAP(I)*8,D:NEXT J');
code.line += CodeLine('NEXT I');
//if chkTextWindow.Checked then
// code.line += CodeLine('? "DONE!"');
code.line += CodeLine('REM MODIFY CHARACTER SET POINTER');
code.line += CodeLine('POKE 756,NMEMTOP');
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
Inc(code.number, code.step);
code.line += IntToStr(code.number) + ' POS.' + editTilePosX.Text + ',' +
IntToStr(editTilePosY.Value + y) + ':? #6;';
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += 'CHR$(' + IntToStr(charx) + ')';
if x < frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 then
code.line += ';';
Inc(index);
end;
code.line += #13#10;
end;
if chkUseColors.Checked then begin
code.line += GenSetColors(_ATARI_BASIC);
// Inc(code.number, code.step);
// code.line += CodeLine('REM SET COLORS') +
// CodeLine('POKE 708,' + IntToStr(colorValues[1]) +
// ':POKE 709,' + IntToStr(colorValues[2])) +
// CodeLine('POKE 710,' + IntToStr(colorValues[3]) +
// ':POKE 711,' + IntToStr(colorValues[10])) +
// CodeLine('POKE 712,' + IntToStr(colorValues[0]));
end;
if not chkTextWindow.Checked then begin
Inc(code.number, code.step);
code.line += WaitKeyCode(langIndex);
end;
Inc(code.number, code.step);
code.line += SetTileCharDataValues(true);
code.line += SetTileDataValues(true);
end
{ Action!
---------------------------------------------------------------------------}
else if langIndex = _ACTION then begin
code.line := '';
(*
code.line := '; Modified characters'#13#10#13#10 +
'BYTE CH=$2FC'#13#10 +
'BYTE RAMTOP=$6A'#13#10 +
'BYTE CHBAS=$2F4'#13#10#13#10 +
'CARD TOPMEM'#13#10#13#10;
code.line += SetTileCharDataValues(true);
code.line += SetTileDataValues(true);
code.line += 'BYTE _CHAR_OFFSET = [8]'#13#10;
// for i := 0 to 127 do
// if frmFonts.charEditIndex[i] = 1 then begin
// code.line += '; Internal code: ' + IntToStr(i) + ' Atascii code: ' + AtasciiCode(i) + #13#10 +
// 'BYTE ARRAY char' + IntToStr(i) + '=[' + //#13#10' ' +
// SetDataValues(frmFonts.fldChar, frmFonts.fld, i, radDataType.ItemIndex, ' ') +
// ']'#13#10;
//// SetValues(_ACTION, i)
// end;
code.line += #13#10'PROC MAIN()'#13#10#13#10 +
'GRAPHICS(12)'#13#10#13#10 +
'; RESERVE MEMORY FOR NEW CHARACTER SET'#13#10 +
'TOPMEM=RAMTOP-8'#13#10 +
'TOPMEM==*256'#13#10#13#10 +
'; VECTOR TO PAGE ADDRESS OF NEW SET'#13#10 +
'CHBAS=TOPMEM/256'#13#10#13#10 +
'; MOVE NEW CHARACTER SET TO RESERVED MEMORY'#13#10 +
'MOVEBLOCK(TOPMEM,57344,1024)'#13#10#13#10 +
'; CUSTOM CHARACTER SET DATA'#13#10;
// for i := 0 to 127 do
// if frmFonts.charEditIndex[i] = 1 then
// code.line += 'MOVEBLOCK(TOPMEM+' + IntToStr(i) + '*8,char' + IntToStr(i) + ',8)' + #13#10;
for i := 0 to maxTileChars do
//code.line += ' MOVEBLOCK(tile' + IntToStr(tileSelected) + ' + _CHAR_OFFSET*' + IntToStr(i) + ', ' +
// 'TOPMEM + tile' + IntToStr(tileSelected) +
// 'CharMap(' + IntToStr(i) + ')*8), 8)'#13#10;
code.line += 'MOVEBLOCK(TOPMEM+tile' + IntToStr(tileSelected) + 'CharMap(' + IntToStr(i) +
')*8,tile' + IntToStr(tileSelected) + ' + _CHAR_OFFSET*' + IntToStr(i) + ',8)' + #13#10;
// code.line += 's := ''ABCD''';
// code.line += 'GotoXY(2, 2); BPut(6, @s[1], 2);';
(*
code.line += #13#10' s = '''''#13#10;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
index := x + y shl 2;
code.line += ' s = Concat(s, Chr(' + AtasciiCode(frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]) + '))'#13#10;
end;
code.line += #13#10;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
code.line += ' POSITION (2, ' + IntToStr(2 + y) + '); Put(6, @s[' +
IntToStr(1 + frmAntic4Tiles.antic4TileArray[tileSelected].dimX*y) + '], ' +
IntToStr(frmAntic4Tiles.antic4TileArray[tileSelected].dimX) + ')'#13#10;
end;
*)
code.line += 'POSITION(2,2)';
code.line += 'PRINTD(6,"!#$")';
code.line += #13#10'PRINTF("%E%E%EPRESS ANY KEY TO EXIT!%E")'#13#10 +
WaitKeyCode(_ACTION) + #13#10 +
'RETURN';
if chkUseColors.Checked then
code.line += #13#10 +
'POKE(708,' + IntToStr(colorValues[1]) + ') POKE(709,' +
IntToStr(colorValues[2]) + ')'#13#10 +
'POKE(710,' + IntToStr(colorValues[3]) + ') POKE(711,' +
IntToStr(colorValues[10]) + ')'#13#10 +
'POKE(712,' + IntToStr(colorValues[0]) + ')'#13#10;
*)
end
{ Mad Pascal
---------------------------------------------------------------------------}
else if langIndex = _MAD_PASCAL then begin
code.line := 'uses graph, crt, cio;'#13#10#13#10;
code.line += SetTileCharDataValues(true);
code.line += SetTileDataValues(true);
code.line += ' _CHAR_OFFSET = 8;'#13#10#13#10 +
'var'#13#10 +
' CHBAS : byte absolute $2F4;'#13#10 +
' RamSet: word;'#13#10 +
' MEMTOP: word absolute $2E5;'#13#10 +
' Charset : array [0..0] of byte;'#13#10 +
' s: string;'#13#10 +
'begin'#13#10 +
' InitGraph(12' + strTextWindow + ');'#13#10 +
' RamSet := (MEMTOP - $400) and $FC00;'#13#10 +
' chbas := Hi(RamSet);'#13#10#13#10 +
' MEMTOP := RamSet;'#13#10#13#10 +
' // Move new character set to reserved memory'#13#10 +
' Move(pointer($e000), pointer(RamSet), 1024);'#13#10 +
' Charset := pointer(RamSet);'#13#10#13#10;
code.line += ' // Custom character set data'#13#10;
for i := 0 to maxTileChars do
code.line += ' Move(tile' + IntToStr(tileSelected) + '[_CHAR_OFFSET*' + IntToStr(i) + '], ' +
'pointer(word(@Charset) + tile' + IntToStr(tileSelected) +
'CharMap[' + IntToStr(i) + ']*8), 8);'#13#10;
// code.line += 's := ''ABCD''';
// code.line += 'GotoXY(2, 2); BPut(6, @s[1], 2);';
// code.line += 'GotoXY(2, 3); BPut(6, @s[3], 2);';
code.line += #13#10' s := '''';'#13#10;
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += ' s := Concat(s, Chr(' + IntToStr(charx) + '));'#13#10;
Inc(index);
end;
end;
code.line += #13#10;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
code.line += ' GotoXY(' + IntToStr(editTilePosX.Value + 1) + ', ' +
IntToStr(editTilePosY.Value + y + 1) + '); BPut(6, @s[' +
IntToStr(1 + frmAntic4Tiles.antic4TileArray[tileSelected].dimX*y) + '], ' +
IntToStr(frmAntic4Tiles.antic4TileArray[tileSelected].dimX) + ');'#13#10;
end;
if chkUseColors.Checked then
code.line += GenSetColors(_MAD_PASCAL);
//code.line += #13#10' // Set colors'#13#10 +
// ' POKE(712, ' + IntToStr(colorValues[0]) + ');'#13#10 +
// ' POKE(708, ' + IntToStr(colorValues[1]) + ');'#13#10 +
// ' POKE(709, ' + IntToStr(colorValues[2]) + ');'#13#10 +
// ' POKE(710, ' + IntToStr(colorValues[3]) + ');'#13#10 +
// ' POKE(711, ' + IntToStr(colorValues[10]) + ');'#13#10;
if chkTextWindow.Checked then
code.line += ' Write(''Press any key to exit!'');';
code.line += WaitKeyCode(langIndex);
code.line += 'end.';
end
{ FastBasic
---------------------------------------------------------------------------}
else if langIndex = _FAST_BASIC then begin
code.line := SetTileCharDataValues(true);
code.line += SetTileDataValues(true);
code.line += #13#10'NMEMTOP = PEEK(106) - 4'#13#10 +
'POKE 106, NMEMTOP'#13#10 +
'GRAPHICS 12' + strTextWindow + #13#10 +
'CHRAM = NMEMTOP*256'#13#10 +
'MOVE 57344, CHRAM, 1024'#13#10#13#10 +
'CHR_OFFSET = 8'#13#10#13#10;
code.line += ''' Modify characters for the tile'#13#10;
for i := 0 to maxTileChars do
code.line += 'MOVE ADR(tile' + IntToStr(tileSelected) +
') + CHR_OFFSET*' + IntToStr(i) + ', CHRAM + tile' + IntToStr(tileSelected) +
'CharMap(' + IntToStr(i) + ')*8, 8'#13#10;
//MOVE ADR(tile1), CHRAM + tile1char(0)*8, 8
//MOVE ADR(tile1) + CHR_OFFSET, CHRAM + tile1char(1)*8, 8
//MOVE ADR(tile1) + CHR_OFFSET*2, CHRAM + tile1char(2)*8, 8
code.line += #13#10''' Modify character set pointer'#13#10;
code.line += 'POKE 756, NMEMTOP'#13#10;
// POS.2,2 : ? #6,"AB"
// POS.2, 2 : ? #6, CHR$(65); CHR$(66)
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
code.line += 'POS.' + editTilePosX.Text + ', ' + IntToStr(editTilePosY.Value + y) +
' : ? #6, '; //""'#13#10;
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index];
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[index] then
Inc(charx, 128);
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += 'CHR$(' + IntToStr(charx) + ')';
if x < frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 then
code.line += '; ';
Inc(index);
end;
code.line += #13#10;
end;
if chkUseColors.Checked then
code.line += GenSetColors(_FAST_BASIC);
//code.line += #13#10'''Set colors'#13#10 +
// 'POKE 708, ' + IntToStr(colorValues[1]) +
// ' : POKE 709, ' + IntToStr(colorValues[2]) + #13#10 +
// 'POKE 710, ' + IntToStr(colorValues[3]) +
// ' : POKE 711, ' + IntToStr(colorValues[10]) + #13#10 +
// 'POKE 712, ' + IntToStr(colorValues[0]) + #13#10;
if chkTextWindow.Checked then
code.line += '? "Press any key to exit!"';
code.line += WaitKeyCode(langIndex);
end
{ KickC
---------------------------------------------------------------------------}
else if langIndex = _KICKC then begin
end;
result := code.line;
end;
function TfrmAntic4TilesGen.Example06 : string;
var
maxTileChars : byte;
i, j, index : byte;
x, y : byte;
tileSelected : byte;
charx : byte;
scr : word;
inverseIndex : byte;
strTextWindow : string = '';
begin
code.line := '';
if not chkTextWindow.Checked then
strTextWindow := '+16';
{ Atari BASIC / Turbo BASIC XL
---------------------------------------------------------------------------}
if langIndex < 2 then begin
code.number := editStartLine.Value;
code.step := editLineStep.Value;
code.line += CodeLine('REM ******************************');
code.line += CodeLine('REM SCREEN WITH PREDEFINED TILES');
code.line += CodeLine('REM ******************************');
for j := 1 to _MAX_TILES do begin
maxTileChars := frmAntic4Tiles.antic4TileArray[j].dimX *
frmAntic4Tiles.antic4TileArray[j].dimY - 1;
code.line += CodeLine('DIM TILE' + IntToStr(j) + 'CHARMAP(' + IntToStr(maxTileChars) + ')');
end;
code.line += CodeLine('NMEMTOP=PEEK(106)-4');
code.line += CodeLine('POKE 106,NMEMTOP');
code.line += CodeLine('GRAPHICS 12' + strTextWindow);
code.line += CodeLine('POKE 82,0');
if chkTextWindow.Checked then
code.line += CodeLine('? "COPY ATARI CHARACTER SET TO RAM AREA"');
code.line += CodeLine('CHRAM=NMEMTOP*256');
code.line += CodeLine('FOR I=0 TO 1023:POKE CHRAM+I,PEEK(57344+I):NEXT I');
//if chkTextWindow.Checked then
// code.line += CodeLine('? "DONE!"');
for j := 1 to _MAX_TILES do begin
index := 0;
for i := 0 to _MAX_TILE_CHARS - 1 do begin
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6:
Inc(index, frmAntic4Tiles.fldCharAntic45Ex[j, i, x + 1, y]);
end;
end;
if index > 0 then begin
maxTileChars := frmAntic4Tiles.antic4TileArray[j].dimX *
frmAntic4Tiles.antic4TileArray[j].dimY - 1;
if chkTextWindow.Checked then
code.line += CodeLine('? "STORE TILE ' + IntToStr(j) + ' CHARACTERS"');
code.line += CodeLine('FOR I=0 TO ' + IntToStr(maxTileChars) +
':READ CHAR:TILE' + IntToStr(j) + 'CHARMAP(I)=CHAR:NEXT I');
end;
end;
for j := 1 to _MAX_TILES do begin
index := 0;
for i := 0 to _MAX_TILE_CHARS - 1 do begin
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6:
Inc(index, frmAntic4Tiles.fldCharAntic45Ex[j, i, x + 1, y]);
end;
end;
if index > 0 then begin
maxTileChars := frmAntic4Tiles.antic4TileArray[j].dimX *
frmAntic4Tiles.antic4TileArray[j].dimY - 1;
if chkTextWindow.Checked then
code.line += CodeLine('? "MODIFY CHARACTERS FOR TILE' + IntToStr(j) + '"');
code.line += CodeLine('FOR I=0 TO ' + IntToStr(maxTileChars));
code.line += CodeLine('FOR J=0 TO 7:READ D:POKE CHRAM+J+TILE' + IntToStr(j) +
'CHARMAP(I)*8,D:NEXT J');
code.line += CodeLine('NEXT I');
//if chkTextWindow.Checked then
// code.line += CodeLine('? "DONE!"');
end;
end;
code.line += CodeLine('REM MODIFY CHARACTER SET POINTER');
code.line += CodeLine('POKE 756,NMEMTOP');
for scr := 0 to _ANTIC_MODE_4_SIZE - 1 do
if frmAntic4Tiles.tiles[scr].tileIndex > 0 then begin
tileSelected := frmAntic4Tiles.tiles[scr].tileIndex;
maxTileChars := frmAntic4Tiles.antic4TileArray[tileSelected].dimX *
frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1;
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
Inc(code.number, code.step);
code.line += IntToStr(code.number) + ' POS.' + IntToStr(frmAntic4Tiles.tiles[scr].x) + ', ' +
IntToStr(frmAntic4Tiles.tiles[scr].y + y) + ':? #6;';
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += 'CHR$(' + IntToStr(charx) + ')';
if x < frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 then
code.line += ';';
Inc(index);
end;
code.line += #13#10;
end;
end;
if chkUseColors.Checked then begin
code.line += GenSetColors(_ATARI_BASIC);
//Inc(code.number, code.step);
//code.line += CodeLine('POKE 708,' + IntToStr(colorValues[1]) +
// ':POKE 709,' + IntToStr(colorValues[2])) +
// CodeLine('POKE 710,' + IntToStr(colorValues[3]) +
// ':POKE 711,' + IntToStr(colorValues[10])) +
// CodeLine('POKE 712,' + IntToStr(colorValues[0]));
end;
if not chkTextWindow.Checked then begin
Inc(code.number, code.step);
code.line += WaitKeyCode(langIndex);
end;
Inc(code.number, code.step);
code.line += SetTileCharDataValues(false);
code.line += SetTileDataValues(false);
end
{ Action!
---------------------------------------------------------------------------}
else if langIndex = _ACTION then begin
code.line := '';
end
{ Mad Pascal
---------------------------------------------------------------------------}
else if langIndex = _MAD_PASCAL then begin
code.line := 'uses graph, crt, cio;'#13#10#13#10;
code.line += SetTileCharDataValues(false);
code.line += SetTileDataValues(false);
code.line += ' _CHAR_OFFSET = 8;'#13#10#13#10 +
'var'#13#10 +
' CHBAS : byte absolute $2F4;'#13#10 +
' RamSet: word;'#13#10 +
' MEMTOP: word absolute $2E5;'#13#10 +
' Charset : array [0..0] of byte;'#13#10 +
' s: string;'#13#10 +
'begin'#13#10 +
' InitGraph(12' + strTextWindow + ');'#13#10 +
' RamSet := (MEMTOP - $400) and $FC00;'#13#10 +
' chbas := Hi(RamSet);'#13#10#13#10 +
' MEMTOP := RamSet;'#13#10#13#10 +
' // Move new character set to reserved memory'#13#10 +
' Move(pointer($e000), pointer(RamSet), 1024);'#13#10 +
' Charset := pointer(RamSet);'#13#10#13#10;
code.line += ' // Modify characters for the tiles'#13#10;
//for i := 0 to maxTileChars do
// code.line += ' Move(tile' + IntToStr(tileSelected) + '[_CHAR_OFFSET*' + IntToStr(i) + '], ' +
// 'pointer(word(@Charset) + tile' + IntToStr(tileSelected) +
// 'CharMap[' + IntToStr(i) + ']*8), 8);'#13#10;
for j := 1 to _MAX_TILES do begin
index := 0;
for i := 0 to _MAX_TILE_CHARS - 1 do begin
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6:
Inc(index, frmAntic4Tiles.fldCharAntic45Ex[j, i, x + 1, y]);
end;
end;
if index > 0 then begin
maxTileChars := frmAntic4Tiles.antic4TileArray[j].dimX *
frmAntic4Tiles.antic4TileArray[j].dimY - 1;
for i := 0 to maxTileChars do
code.line += ' Move(tile' + IntToStr(j) + '[_CHAR_OFFSET*' + IntToStr(i) + '], ' +
'pointer(word(@Charset) + tile' + IntToStr(j) +
'CharMap[' + IntToStr(i) + ']*8), 8);'#13#10;
end;
end;
// code.line += 's := ''ABCD''';
// code.line += 'GotoXY(2, 2); BPut(6, @s[1], 2);';
// code.line += 'GotoXY(2, 3); BPut(6, @s[3], 2);';
for scr := 0 to _ANTIC_MODE_4_SIZE - 1 do begin
if frmAntic4Tiles.tiles[scr].tileIndex > 0 then begin
tileSelected := frmAntic4Tiles.tiles[scr].tileIndex;
maxTileChars := frmAntic4Tiles.antic4TileArray[tileSelected].dimX *
frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1;
code.line += #13#10' s := '''';'#13#10;
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += ' s := Concat(s, Chr(' + IntToStr(charx) + '));'#13#10;
Inc(index);
end;
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
code.line += 'GotoXY(' + IntToStr(frmAntic4Tiles.tiles[scr].x + 1) + ', ' +
IntToStr(frmAntic4Tiles.tiles[scr].y + y + 1) + '); BPut(6, @s[' +
IntToStr(1 + frmAntic4Tiles.antic4TileArray[tileSelected].dimX*y) + '], ' +
IntToStr(frmAntic4Tiles.antic4TileArray[tileSelected].dimX) + ');'#13#10;
end;
end;
end;
if chkUseColors.Checked then
code.line += GenSetColors(_MAD_PASCAL);
//code.line += #13#10' POKE(712, ' + IntToStr(colorValues[0]) + ');'#13#10 +
// ' POKE(708, ' + IntToStr(colorValues[1]) + ');'#13#10 +
// ' POKE(709, ' + IntToStr(colorValues[2]) + ');'#13#10 +
// ' POKE(710, ' + IntToStr(colorValues[3]) + ');'#13#10 +
// ' POKE(711, ' + IntToStr(colorValues[10]) + ');'#13#10;
if chkTextWindow.Checked then
code.line += 'Write("Press any key to exit!")';
code.line += WaitKeyCode(langIndex);
code.line += 'end.';
end
{ FastBasic
---------------------------------------------------------------------------}
else if langIndex = _FAST_BASIC then begin
code.line := SetTileCharDataValues(false);
code.line += SetTileDataValues(false);
code.line += #13#10'NMEMTOP = PEEK(106) - 4'#13#10 +
'POKE 106, NMEMTOP'#13#10 +
'GRAPHICS 12' + strTextWindow + #13#10 +
'CHRAM = NMEMTOP*256'#13#10 +
'MOVE 57344, CHRAM, 1024'#13#10#13#10 +
'CHR_OFFSET = 8'#13#10#13#10;
code.line += ''' Modify characters for the tiles'#13#10;
for j := 1 to _MAX_TILES do begin
index := 0;
for i := 0 to _MAX_TILE_CHARS - 1 do begin
for y := 0 to _CHAR_DIM do
for x := 0 to _CHAR_DIM do
case x of
0, 2, 4, 6:
Inc(index, frmAntic4Tiles.fldCharAntic45Ex[j, i, x + 1, y]);
end;
end;
if index > 0 then begin
maxTileChars := frmAntic4Tiles.antic4TileArray[j].dimX *
frmAntic4Tiles.antic4TileArray[j].dimY - 1;
for i := 0 to maxTileChars do
code.line += 'MOVE ADR(tile' + IntToStr(j) +
') + CHR_OFFSET*' + IntToStr(i) + ', CHRAM + tile' + IntToStr(j) +
'CharMap(' + IntToStr(i) + ')*8, 8'#13#10;
end;
end;
code.line += #13#10''' Modify character set pointer'#13#10;
code.line += 'POKE 756, NMEMTOP'#13#10;
for scr := 0 to _ANTIC_MODE_4_SIZE - 1 do begin
if frmAntic4Tiles.tiles[scr].tileIndex > 0 then begin
tileSelected := frmAntic4Tiles.tiles[scr].tileIndex;
maxTileChars := frmAntic4Tiles.antic4TileArray[tileSelected].dimX *
frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1;
index := 0;
for y := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimY - 1 do begin
code.line += 'POS.' + IntToStr(frmAntic4Tiles.tiles[scr].x) + ', ' +
IntToStr(frmAntic4Tiles.tiles[scr].y + y) + ' : ? #6, ';
for x := 0 to frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 do begin
inverseIndex := x + y shl 2;
charx := StrToInt(AtasciiCode(
frmAntic4Tiles.antic4TileArray[tileSelected].charValues[index]));
if frmAntic4Tiles.antic4TileArray[tileSelected].charInverse[inverseIndex] then
Inc(charx, 128);
code.line += 'CHR$(' + IntToStr(charx) + ')';
if x < frmAntic4Tiles.antic4TileArray[tileSelected].dimX - 1 then
code.line += '; ';
Inc(index);
end;
code.line += #13#10;
end;
end;
end;
if chkUseColors.Checked then
code.line += GenSetColors(_FAST_BASIC);
//code.line += #13#10 +
// 'POKE 708, ' + IntToStr(colorValues[1]) +
// ' : POKE 709, ' + IntToStr(colorValues[2]) + #13#10 +
// 'POKE 710, ' + IntToStr(colorValues[3]) +
// ' : POKE 711, ' + IntToStr(colorValues[10]) + #13#10 +
// 'POKE 712, ' + IntToStr(colorValues[0]) + #13#10;
if chkTextWindow.Checked then
code.line += '? "Press any key to exit!"';
code.line += WaitKeyCode(langIndex);
end
{ KickC
---------------------------------------------------------------------------}
else if langIndex = _KICKC then begin
end;
result := code.line;
end;
procedure TfrmAntic4TilesGen.FormKeyDown(Sender : TObject; var Key : Word; Shift : TShiftState);
begin
case Key of
VK_ESCAPE: Close;
end;
end;
procedure TfrmAntic4TilesGen.ButtonHoverEnter(Sender : TObject);
begin
SetButton(Sender as TBCMaterialDesignButton, true);
end;
procedure TfrmAntic4TilesGen.ButtonHoverLeave(Sender : TObject);
begin
SetButton(Sender as TBCMaterialDesignButton, false);
end;
procedure TfrmAntic4TilesGen.ExamplesProc(Sender : TObject);
begin
if listExamples.ListBox.ItemIndex < 0 then exit;
// debug(listExamples.ListBox.ItemIndex);
//langIndex := (Sender as TBCMDButton).Tag;
//(Sender as TBCMDButton).Enabled := listings[0, 2];
btnAtariBASIC.Enabled := listings[listExamples.ListBox.ItemIndex, 0];
btnTurboBasicXL.Enabled := listings[listExamples.ListBox.ItemIndex, 1];
btnMadPascal.Enabled := listings[listExamples.ListBox.ItemIndex, 2];
btnEffectus.Enabled := listings[listExamples.ListBox.ItemIndex, 3];
btnFastBasic.Enabled := listings[listExamples.ListBox.ItemIndex, 4];
btnKickC.Enabled := listings[listExamples.ListBox.ItemIndex, 5];
btnMads.Enabled := listings[listExamples.ListBox.ItemIndex, 6];
btnCC65.Enabled := listings[listExamples.ListBox.ItemIndex, 7];
boxTilePos.Enabled := listExamples.ListBox.ItemIndex = 4;
boxTilePos.Visible := boxTilePos.Enabled;
boxColors.Enabled := listExamples.ListBox.ItemIndex >= 4;
boxColors.Visible := boxColors.Enabled;
chkTextWindow.Enabled := listExamples.ListBox.ItemIndex >= 4;
chkTextWindow.Visible := chkTextWindow.Enabled;
CreateCode;
end;
procedure TfrmAntic4TilesGen.CopyToEditorProc(Sender : TObject);
begin
if not CheckEditor then Exit;
frmSrcEdit.Show;
frmSrcEdit.editor.Lines := memo.Lines;
frmSrcEdit.MemoToEditor(Sender);
Close;
end;
procedure TfrmAntic4TilesGen.LanguageProc(Sender : TObject);
begin
langIndex := (Sender as TBCMDButton).Tag;
CreateCode;
end;
procedure TfrmAntic4TilesGen.CloseProc(Sender : TObject);
begin
Close;
end;
end.
| 35.456036 | 132 | 0.53991 |
f1c003f9da9603dab092760a683499d0c826e549 | 353 | dpr | Pascal | U9200/U9200Asm.dpr | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| 2 | 2021-02-09T21:54:54.000Z | 2021-09-04T03:30:50.000Z | U9200/U9200Asm.dpr | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| null | null | null | U9200/U9200Asm.dpr | sboydlns/univacemulators | c630b2497bee9cb9a18b4fa05be9157d7161bca3 | [
"MIT"
]
| null | null | null | program U9200Asm;
uses
Vcl.Forms,
U9200AsmFrm in 'U9200AsmFrm.pas' {U9200AsmForm},
U9200Types in 'U9200Types.pas',
EmulatorTypes in '..\Common\EmulatorTypes.pas';
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TU9200AsmForm, U9200AsmForm);
Application.Run;
end.
| 20.764706 | 55 | 0.716714 |
f13207bb4d87f28dae7087b0813e56f6c8a46319 | 15,107 | pas | Pascal | tools/scitools/sample/dyacclex/src/yacc/yacclook.pas | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
]
| 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/sample/dyacclex/src/yacc/yacclook.pas | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
]
| null | null | null | tools/scitools/sample/dyacclex/src/yacc/yacclook.pas | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
]
| null | null | null | {
Delphi Yacc & Lex
Copyright (c) 2003,2004 by Michiel Rook
Based on Turbo Pascal Lex and Yacc Version 4.1
Copyright (c) 1990-92 Albert Graef <ag@muwiinfa.geschichte.uni-mainz.de>
Copyright (C) 1996 Berend de Boer <berend@pobox.com>
Copyright (c) 1998 Michael Van Canneyt <Michael.VanCanneyt@fys.kuleuven.ac.be>
## $Id: yacclook.pas 11962 2005-10-27 14:47:09Z dpollard $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
}
unit yacclook;
interface
procedure lookaheads;
(* computes the LALR lookahead sets and enters corresponding reductions
into the redn table (sorted w.r.t. rule numbers) *)
implementation
uses
yaccbase,
yacctabl;
(* This implementation is based on algorithms 4.12 and 4.13 in Aho/Sethi/
Ullman 1986 (with some optimizations added), which avoid the need to
construct the full LR(1) set, and are able to compute lookaheads from
LR(0) kernel items only.
We start off with the LR(0) state set together with corresponding (shift
and goto) transitions already computed. We compute the LALR(1) lookahead
sets for kernel items and also record all corresponding reduce actions
in the reduction table (where we also have to consider nonkernel items
with empty right-hand side; these items also call for a reduction, but
never appear in the kernel item table).
This implementation uses some simple optimizations to speed up the
algorithm. The lookahead sets are represented by (IntSet) pointers.
Lookahead sets are associated with each kernel item in the item table,
and with each reduction in the reduction table. A kernel item
calling for a reduction shares its lookahead set pointer with the
corresponding entry in the reduction table. The lookahead set for
a nonkernel reduction item (item with empty right-hand side) only
appears in the reduction table.
The algorithm consists of two phases:
1. Initialization:
The initialization phase consists of a single traversal of the LR(0)
set, where we compute lookahead sets generated spontaneously (lookaheads
which are passed on from nonkernel items to the corresponding items in
successor states), initialize lookahead sets and enter them into the
lookahead and reduction table. Furthermore, during the initialization
phase we also initialize the links for the propagation of lookaheads
in the second phase.
To determine lookaheads and propagation links, we compute the look-
aheads for the closures of single LR(0) sets "in the small", according
to the method in Aho/Sethi/Ullman 1986 (with some modifications),
where we associate with each kernel item i a corresponding endmarker
symbol #i as its lookahead symbol.
The initialization phase proceeds as follows:
1) Initialize all nonkernel item lookahead sets to empty.
Now we pass over each state s in the LR0 set, repeating steps 2) thru
5) specified below:
2) Compute the closure closure(K(s)) of the states's kernel set K(s).
3) Compute the lookahead sets for closure(K(s)) (described in detail
below) where each kernel item i is associated with a special
endmarker symbol #i as lookahead.
Now the lookahead symbols, reductions and propagation links are entered
into the corresponding tables as follows:
4) Process kernel items: Add a propagation link from the kernel item
to the lookahead set of the linked item in the corresponding
successor state (as specified by the next field). If there is no
successor item (kernel item calling for a reduction), add a
corresponding entry into the reduction table instead.
5) Process nonkernel items: find the corresponding kernel item in the
successor state which is generated spontaneously from the nonkernel
item. Add the spontaneous lookahead symbols (except endmarker
symbols) of the nonkernel item determined in step 3) to the kernel
item. If the nonkernel item has an empty right-hand side (nonkernel
item calling for a reduction), add a corresponding entry into the
reduction table instead. Furthermore, for each endmarker symbol
#i in the spontaneous lookahead set of the nonkernel item, add
a corresponding propagation link from the ith kernel item to the
lookahead set of the spontaneous kernel item.
To compute the spontaneous lookaheads (step 3)), we proceed as follows:
3a) First compute the first sets of tail strings of all items in
closure(K(s)). The "tail string" of an item [ X -> v.Yw ], where
Y is a nonterminal, is the symbol sequence w, whose first set
induces corresponding spontaneous lookaheads in the nonkernel
items of the state with left-hand side Y; note that the first
sets of "tail strings" in items [ X -> v.yw ], where y is a
*terminal* symbol, are not required and hence it is not
necessary to compute them. We also record for each item whether
its tail string is "nullable", i.e., may be derived to the empty
string. In this case, the item also passes on its own lookaheads,
in addition to the first symbols of its tail string. First sets
and nullable flags are computed using the information in YaccTable's
first and nullable tables.
3b) Now follows an initialization part in which each item [ X -> v.Yw ]
passes on the first symbols of its tail string to the lookahead
sets of each corresponding nonkernel item [ Y -> .u ].
3c) Finally, we repeatedly pass over the item set, passing on
lookaheads from items with nullable tail strings. Each item
[ X -> v.Yw ] with nullable w propagates its own lookaheads to
all corresponding nonkernel items [ Y -> .u]. Step 3c) terminates
as soon as no lookahead sets have been modified during the previous
pass.
2. Propagation:
The second phase of the lookahead computation algorithm now is quite
simple. We repeatedly pass over all kernel items, propagating lookaheads
according to the propagation links determined in the initialization
phase. The algorithm terminates as soon as no lookahead sets have been
modified during the previous pass. *)
(* Data structures used in lookahead computation: *)
type
SymSetArray = array [1..max_set_items] of IntSet;
BoolArray = array [1..max_set_items] of boolean;
var
item_set: ItemSet;
lookahead_set: SymSetArray;
n_kernel_items: integer;
procedure spontaneous_lookaheads;
(* compute spontaneous lookaheads for item_set; negative symbols are
used for endmarkers (-i denotes endmarker #i) *)
var
Count, last_count, i: integer;
first_syms: SymSetArray;
nullable: BoolArray;
function sym_count(n: integer): integer;
(* count lookahead symbols *)
var
Count, i: integer;
begin
Count := 0;
for i := 1 to n do
Inc(Count, size(lookahead_set[i]));
Result := Count;
end(*sym_count*);
procedure compute_first_syms(i: integer);
(* compute first set and nullable flag for tail string of item
number i *)
var
j: integer;
begin
empty(first_syms[i]);
nullable[i] := True;
with item_set, item[i], rule_table^[rule_no]^ do
if (pos_no <= rhs_len) and (rhs_sym[pos_no] < 0) then
begin
j := pos_no + 1;
while (j <= rhs_len) and nullable[i] do
begin
if rhs_sym[j] < 0 then
begin
setunion(first_syms[i], first_set_table^[ -rhs_sym[j]]^);
nullable[i] := YaccTabl.nullable^[ -rhs_sym[j]];
end
else begin
include(first_syms[i], rhs_sym[j]);
nullable[i] := False;
end;
Inc(j);
end;
end;
end(*compute_first_syms*);
procedure init_lookaheads(i: integer);
(* compute initial lookaheads induced by first sets of tail string
of item i *)
var
sym, j: integer;
begin
with item_set, item[i], rule_table^[rule_no]^ do
if (pos_no <= rhs_len) and (rhs_sym[pos_no] < 0) then
begin
sym := rhs_sym[pos_no];
for j := n_kernel_items + 1 to n_items do
with item[j], rule_table^[rule_no]^ do
if lhs_sym = sym then
setunion(lookahead_set[j], first_syms[i]);
end
end(*initial_lookaheads*);
procedure propagate(i: integer);
(* propagate lookahead symbols of item i *)
var
sym, j: integer;
begin
with item_set, item[i], rule_table^[rule_no]^ do
if (pos_no <= rhs_len) and (rhs_sym[pos_no] < 0) and nullable[i] then
begin
sym := rhs_sym[pos_no];
for j := n_kernel_items + 1 to n_items do
with item[j], rule_table^[rule_no]^ do
if lhs_sym = sym then
setunion(lookahead_set[j], lookahead_set[i]);
end
end(*propagate*);
begin(*spontaneous_lookaheads*)
with item_set do
begin
(* initialize kernel lookahead sets: *)
for i := 1 to n_kernel_items do
singleton(lookahead_set[i], -i);
(* compute first sets and nullable flags: *)
for i := 1 to n_items do
compute_first_syms(i);
(* initialize nonkernel lookahead sets: *)
for i := n_kernel_items + 1 to n_items do
empty(lookahead_set[i]);
for i := 1 to n_items do
init_lookaheads(i);
(* repeated passes until no more lookaheads have been added
during the previous pass: *)
Count := sym_count(n_items);
repeat
last_count := Count;
for i := 1 to n_items do
propagate(i);
Count := sym_count(n_items);
until last_count = Count;
end;
end(*spontaneous_lookaheads*);
{$ifndef fpc}{$F+}{$endif}
function redns_less(i, j: integer): boolean;
{$ifndef fpc}{$F-}{$endif}
begin
Result := redn_table^[i].rule_no < redn_table^[j].rule_no
end(*redns_less*);
{$ifndef fpc}{$F+}{$endif}
procedure redns_swap(i, j: integer);
{$ifndef fpc}{$F-}{$endif}
var
x: RednRec;
begin
x := redn_table^[i];
redn_table^[i] := redn_table^[j];
redn_table^[j] := x;
end(*redns_swap*);
procedure sort_redns;
(* sort reduction entries in act_state w.r.t. rule numbers *)
begin
with state_table^[act_state] do
quicksort(redns_lo, redns_hi, {$ifdef fpc}@
{$endif}
redns_less,
{$ifdef fpc}@
{$endif}
redns_swap);
end(*sort_redns*);
procedure Initialize;
(* initialization phase of lookahead computation algorithm *)
procedure add_prop(i: integer; symset: IntSetPtr);
(* add a propagation link to kernel item i *)
var
prop: PropList;
begin
new(prop);
prop^.symset := symset;
prop^.Next := prop_table^[i];
prop_table^[i] := prop;
end(*add_prop*);
var
i, j, k: integer;
lookaheads: IntSetPtr;
begin
(* initialize lookahead sets and propagation links: *)
for i := 1 to n_items do
lookahead_table^[i] := newEmptyIntSet;
for i := 1 to n_items do
prop_table^[i] := nil;
act_state := 0;
repeat
with state_table^[act_state], item_set do
begin
start_redns;
get_item_set(act_state, item_set);
n_kernel_items := n_items;
(* compute LR(0) closure: *)
closure(item_set);
(* compute spontaneous lookaheads: *)
spontaneous_lookaheads;
(* process kernel items: *)
for i := 1 to n_kernel_items do
with item[i] do
if Next > 0 then
(* add propagation link: *)
add_prop(item_lo + i - 1, lookahead_table^[Next])
else
(* enter reduce action: *)
add_redn(lookahead_table^[item_lo + i - 1], rule_no);
(* process nonkernel items: *)
(* find successor items: *)
for k := trans_lo to trans_hi do
with trans_table^[k] do
for i := n_kernel_items + 1 to n_items do
with item[i], rule_table^[rule_no]^ do
if pos_no > rhs_len then
Next := 0
else if rhs_sym[pos_no] = sym then
Next := find_item(next_state, rule_no, pos_no + 1);
(* add spontaneous lookaheads and propagation links: *)
for i := n_kernel_items + 1 to n_items do
with item[i] do
if Next > 0 then
(* lookaheads are generated spontaneously for successor
item: *)
for j := 1 to size(lookahead_set[i]) do
if lookahead_set[i][j] >= 0 then
include(lookahead_table^[Next]^, lookahead_set[i][j])
else
add_prop(item_lo + ( -lookahead_set[i][j]) - 1,
lookahead_table^[Next])
else (* nonkernel reduction item: *)
begin
lookaheads := newEmptyIntSet;
for j := 1 to size(lookahead_set[i]) do
if lookahead_set[i][j] >= 0 then
include(lookaheads^, lookahead_set[i][j])
else
add_prop(item_lo + ( -lookahead_set[i][j]) - 1,
lookaheads);
add_redn(lookaheads, rule_no);
end;
end_redns;
sort_redns;
end;
Inc(act_state);
until act_state = n_states;
end(*initialize*);
procedure propagate;
(* propagation phase of lookahead computation algorithm *)
var
i, l: integer;
done: boolean;
prop: PropList;
begin
(* repeated passes over the kernel items table until no more lookaheads
could be added in the previous pass: *)
repeat
done := True;
for i := 1 to n_items do
begin
prop := prop_table^[i];
while prop <> nil do
with prop^ do
begin
l := size(symset^);
setunion(symset^, lookahead_table^[i]^);
if size(symset^) > l then
done := False;
prop := Next;
end;
end;
until done;
end(*propagate*);
procedure lookaheads;
begin
Initialize;
propagate;
end(*lookaheads*);
end(*YaccLookaheads*).
| 35.798578 | 85 | 0.636129 |
47f49114966cc674f136f2d41c456fc28eccb045 | 112,875 | pas | Pascal | Source/SynCompletionProposal.pas | sk-Prime/pyscripter | 47ca411066d5acfc60115a135d08d985665aa417 | [
"MIT"
]
| null | null | null | Source/SynCompletionProposal.pas | sk-Prime/pyscripter | 47ca411066d5acfc60115a135d08d985665aa417 | [
"MIT"
]
| null | null | null | Source/SynCompletionProposal.pas | sk-Prime/pyscripter | 47ca411066d5acfc60115a135d08d985665aa417 | [
"MIT"
]
| null | null | null | {-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
-------------------------------------------------------------------------------}
unit SynCompletionProposal;
{$I SynEdit.inc}
interface
uses
Winapi.Windows,
Winapi.Messages,
System.Types,
System.SysUtils,
System.Classes,
System.UITypes,
Vcl.Graphics,
Vcl.Forms,
Vcl.Controls,
Vcl.StdCtrls,
Vcl.ExtCtrls,
Vcl.Menus,
Vcl.ImgList,
SynEditTypes,
SynEditKeyCmds,
SynEdit,
SynUnicode;
type
SynCompletionType = (ctCode, ctHint, ctParams);
TSynForm = TCustomForm;
TSynBaseCompletionProposalPaintItem = procedure(Sender: TObject;
Index: Integer; TargetCanvas: TCanvas; ItemRect: TRect;
var CustomDraw: Boolean) of object;
TSynBaseCompletionProposalMeasureItem = procedure(Sender: TObject;
Index: Integer; TargetCanvas: TCanvas; var ItemWidth: Integer) of object;
TCodeCompletionEvent = procedure(Sender: TObject; var Value: string;
Shift: TShiftState; Index: Integer; EndToken: WideChar) of object;
TAfterCodeCompletionEvent = procedure(Sender: TObject; const Value: string;
Shift: TShiftState; Index: Integer; EndToken: WideChar) of object;
TValidateEvent = procedure(Sender: TObject; Shift: TShiftState;
EndToken: WideChar) of object;
TCompletionParameter = procedure(Sender: TObject; CurrentIndex: Integer;
var Level, IndexToDisplay: Integer; var Key: WideChar;
var DisplayString: string) of object;
TCompletionExecute = procedure(Kind: SynCompletionType; Sender: TObject;
var CurrentInput: string; var x, y: Integer; var CanExecute: Boolean) of object;
TCompletionChange = procedure(Sender: TObject; AIndex: Integer) of object;
TCodeItemInfo = procedure(Sender: TObject; AIndex: Integer; var Info : string) of object;
TSynCompletionOption = (scoCaseSensitive, //Use case sensitivity to do matches
scoLimitToMatchedText, //Limit the matched text to only what they have typed in
scoTitleIsCentered, //Center the title in the box if you choose to use titles
scoUseInsertList, //Use the InsertList to insert text instead of the ItemList (which will be displayed)
scoUsePrettyText, //Use the PrettyText function to output the words
scoUseBuiltInTimer, //Use the built in timer and the trigger keys to execute the proposal as well as the shortcut
scoEndCharCompletion, //When an end char is pressed, it triggers completion to occur (like the Delphi IDE)
scoConsiderWordBreakChars,//Use word break characters as additional end characters
scoCompleteWithTab, //Use the tab character for completion
scoCompleteWithEnter); //Use the Enter character for completion
TSynCompletionOptions = set of TSynCompletionOption;
const
DefaultProposalOptions = [scoLimitToMatchedText, scoEndCharCompletion, scoCompleteWithTab, scoCompleteWithEnter];
DefaultEndOfTokenChr = '()[]. ';
type
TProposalColumns = class;
TSynBaseCompletionProposalForm = class(TSynForm)
private
FCurrentString: string;
FOnPaintItem: TSynBaseCompletionProposalPaintItem;
FOnMeasureItem: TSynBaseCompletionProposalMeasureItem;
FOnChangePosition: TCompletionChange;
FOnCodeItemInfo: TCodeItemInfo;
FItemList: TStrings;
FInsertList: TStrings;
FAssignedList: TStrings;
FPosition: Integer;
FLinesInWindow: Integer;
FTitleFontHeight: Integer;
FFontHeight: integer;
FScrollbar: TScrollBar;
FOnValidate: TValidateEvent;
FOnCancel: TNotifyEvent;
FClSelect: TColor;
fClSelectText: TColor;
FClTitleBackground: TColor;
fClBackGround: TColor;
Bitmap: TBitmap; // used for drawing
TitleBitmap: TBitmap; // used for title-drawing
FCurrentEditor: TCustomSynEdit;
FTitle: string;
FTitleFont: TFont;
FFont: TFont;
FResizeable: Boolean;
FItemHeight: Integer;
FMargin: Integer;
FEffectiveItemHeight: Integer;
FImages: TCustomImageList;
//These are the reflections of the Options property of the CompletionProposal
FCase: boolean;
FMatchText: Boolean;
FFormattedText: Boolean;
FCenterTitle: Boolean;
FUseInsertList: boolean;
FCompleteWithTab: Boolean;
FCompleteWithEnter: Boolean;
FMouseWheelAccumulator: integer;
FDisplayKind: SynCompletionType;
FParameterToken: TCompletionParameter;
FCurrentIndex: Integer;
FCurrentLevel: Integer;
FDefaultKind: SynCompletionType;
FEndOfTokenChr: string;
FTriggerChars: string;
OldShowCaret: Boolean;
FHeightBuffer: Integer;
FColumns: TProposalColumns;
procedure SetCurrentString(const Value: string);
procedure MoveLine(cnt: Integer);
procedure ScrollbarOnChange(Sender: TObject);
procedure ScrollbarOnScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);
procedure ScrollbarOnEnter(Sender: TObject);
procedure SetItemList(const Value: TStrings);
procedure SetInsertList(const Value: TStrings);
procedure SetPosition(const Value: Integer);
procedure SetResizeable(const Value: Boolean);
procedure SetItemHeight(const Value: Integer);
procedure SetImages(const Value: TCustomImageList);
procedure StringListChange(Sender: TObject);
procedure DoDoubleClick(Sender : TObject);
procedure DoFormShow(Sender: TObject);
procedure DoFormHide(Sender: TObject);
procedure AdjustScrollBarPosition;
procedure AdjustMetrics;
procedure SetTitle(const Value: string);
procedure SetFont(const Value: TFont);
procedure SetTitleFont(const Value: TFont);
procedure SetColumns(Value: TProposalColumns);
procedure TitleFontChange(Sender: TObject);
procedure FontChange(Sender: TObject);
procedure RecalcItemHeight;
function IsWordBreakChar(AChar: WideChar): Boolean;
protected
FCodeItemInfoWindow : THintWindow;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: Char); override;
procedure Paint; override;
procedure Activate; override;
procedure Deactivate; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure Resize; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure WMMouseWheel(var Msg: TMessage); message WM_MOUSEWHEEL;
procedure WMActivate (var Message: TWMActivate); message WM_ACTIVATE;
procedure WMEraseBackgrnd(var Message: TMessage); message WM_ERASEBKGND;
procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
procedure CreateParams(var Params: TCreateParams); override;
function CanResize(var NewWidth, NewHeight: Integer): Boolean; override;
procedure ShowCodeItemInfo(Info: string);
function GetCurrentPPI: Integer; override;
public
constructor Create(AOwner: Tcomponent); override;
destructor Destroy; override;
function LogicalToPhysicalIndex(Index: Integer): Integer;
function PhysicalToLogicalIndex(Index: Integer): Integer;
property DisplayType: SynCompletionType read FDisplayKind write FDisplayKind;
property DefaultType: SynCompletionType read FDefaultKind write FDefaultKind default ctCode;
property CurrentString: string read FCurrentString write SetCurrentString;
property CurrentIndex: Integer read FCurrentIndex write FCurrentIndex;
property CurrentLevel: Integer read FCurrentLevel write FCurrentLevel;
property OnParameterToken: TCompletionParameter read FParameterToken write FParameterToken;
property OnKeyPress;
property OnPaintItem: TSynBaseCompletionProposalPaintItem read FOnPaintItem write FOnPaintItem;
property OnMeasureItem: TSynBaseCompletionProposalMeasureItem read FOnMeasureItem write FOnMeasureItem;
property OnValidate: TValidateEvent read FOnValidate write FOnValidate;
property OnCancel: TNotifyEvent read FOnCancel write FOnCancel;
property ItemList: TStrings read FItemList write SetItemList;
property InsertList: TStrings read FInsertList write SetInsertList;
property AssignedList: TStrings read FAssignedList write FAssignedList;
property Position: Integer read FPosition write SetPosition;
property Title: string read fTitle write SetTitle;
property ClSelect: TColor read FClSelect write FClSelect default clHighlight;
property ClSelectedText: TColor read FClSelectText write FClSelectText default clHighlightText;
property ClBackground: TColor read FClBackGround write FClBackGround default clWindow;
property ClTitleBackground: TColor read FClTitleBackground write FClTitleBackground default clBtnFace;
property ItemHeight: Integer read FItemHeight write SetItemHeight default 0;
property Margin: Integer read FMargin write FMargin default 2;
property UsePrettyText: boolean read FFormattedText write FFormattedText default False;
property UseInsertList: boolean read FUseInsertList write FUseInsertList default False;
property CenterTitle: boolean read FCenterTitle write FCenterTitle default True;
property CaseSensitive: Boolean read fCase write fCase default False;
property CurrentEditor: TCustomSynEdit read fCurrentEditor write fCurrentEditor;
property MatchText: Boolean read fMatchText write fMatchText;
property EndOfTokenChr: string read FEndOfTokenChr write FEndOfTokenChr;
property TriggerChars: string read FTriggerChars write FTriggerChars;
property CompleteWithTab: Boolean read FCompleteWithTab write FCompleteWithTab;
property CompleteWithEnter: Boolean read FCompleteWithEnter write FCompleteWithEnter;
property TitleFont: TFont read fTitleFont write SetTitleFont;
property Font: TFont read fFont write SetFont;
property Columns: TProposalColumns read FColumns write SetColumns;
property Resizeable: Boolean read FResizeable write SetResizeable default True;
property Images: TCustomImageList read FImages write SetImages;
end;
TSynBaseCompletionProposal = class(TComponent)
private
FForm: TSynBaseCompletionProposalForm;
FOnExecute: TCompletionExecute;
FOnClose: TNotifyEvent;
FOnShow: TNotifyEvent;
FWidth: Integer;
FPreviousToken: string;
FDotOffset: Integer;
FOptions: TSynCompletionOptions;
FNbLinesInWindow: Integer;
FFormatParams : Boolean;
FCanExecute: Boolean;
function GetClSelect: TColor;
procedure SetClSelect(const Value: TColor);
function GetCurrentString: string;
function GetItemList: TStrings;
function GetInsertList: TStrings;
function GetOnCancel: TNotifyEvent;
function GetOnKeyPress: TKeyPressEvent;
function GetOnPaintItem: TSynBaseCompletionProposalPaintItem;
function GetOnMeasureItem: TSynBaseCompletionProposalMeasureItem;
function GetOnValidate: TValidateEvent;
function GetPosition: Integer;
procedure SetCurrentString(const Value: string);
procedure SetItemList(const Value: TStrings);
procedure SetInsertList(const Value: TStrings);
procedure SetNbLinesInWindow(const Value: Integer);
procedure SetOnCancel(const Value: TNotifyEvent);
procedure SetOnKeyPress(const Value: TKeyPressEvent);
procedure SetOnPaintItem(const Value: TSynBaseCompletionProposalPaintItem);
procedure SetOnMeasureItem(const Value: TSynBaseCompletionProposalMeasureItem);
procedure SetPosition(const Value: Integer);
procedure SetOnValidate(const Value: TValidateEvent);
procedure SetWidth(Value: Integer);
procedure SetImages(const Value: TCustomImageList);
function GetDisplayKind: SynCompletionType;
procedure SetDisplayKind(const Value: SynCompletionType);
function GetParameterToken: TCompletionParameter;
procedure SetParameterToken(const Value: TCompletionParameter);
function GetDefaultKind: SynCompletionType;
procedure SetDefaultKind(const Value: SynCompletionType);
function GetClBack: TColor;
procedure SetClBack(const Value: TColor);
function GetClSelectedText: TColor;
procedure SetClSelectedText(const Value: TColor);
function GetEndOfTokenChar: string;
procedure SetEndOfTokenChar(const Value: string);
function GetClTitleBackground: TColor;
procedure SetClTitleBackground(const Value: TColor);
procedure SetTitle(const Value: string);
function GetTitle: string;
function GetFont: TFont;
function GetTitleFont: TFont;
procedure SetFont(const Value: TFont);
procedure SetTitleFont(const Value: TFont);
function GetOptions: TSynCompletionOptions;
function GetTriggerChars: string;
procedure SetTriggerChars(const Value: string);
function GetOnChange: TCompletionChange;
procedure SetOnChange(const Value: TCompletionChange);
function GetOnCodeItemInfo: TCodeItemInfo;
procedure SetOnCodeItemInfo(const Value: TCodeItemInfo);
procedure SetColumns(const Value: TProposalColumns);
function GetColumns: TProposalColumns;
function GetResizeable: Boolean;
procedure SetResizeable(const Value: Boolean);
function GetItemHeight: Integer;
procedure SetItemHeight(const Value: Integer);
function GetMargin: Integer;
procedure SetMargin(const Value: Integer);
function GetImages: TCustomImageList;
function IsWordBreakChar(AChar: WideChar): Boolean;
protected
procedure DefineProperties(Filer: TFiler); override;
procedure SetOptions(const Value: TSynCompletionOptions); virtual;
procedure EditorCancelMode(Sender: TObject); virtual;
procedure HookedEditorCommand(Sender: TObject; AfterProcessing: Boolean;
var Handled: Boolean; var Command: TSynEditorCommand; var AChar: WideChar;
Data: Pointer; HandlerData: Pointer); virtual;
public
constructor Create(Aowner: TComponent); override;
procedure Execute(s: string; x, y: Integer);
procedure ExecuteEx(s: string; x, y: Integer; Kind: SynCompletionType = ctCode); virtual;
procedure Activate;
procedure Deactivate;
procedure ClearList;
function DisplayItem(AIndex: Integer): string;
function InsertItem(AIndex: Integer): string;
procedure AddItemAt(Where: Integer; ADisplayText, AInsertText: string);
procedure AddItem(ADisplayText, AInsertText: string);
procedure ResetAssignedList;
property OnKeyPress: TKeyPressEvent read GetOnKeyPress write SetOnKeyPress;
property OnValidate: TValidateEvent read GetOnValidate write SetOnValidate;
property OnCancel: TNotifyEvent read GetOnCancel write SetOnCancel;
property CurrentString: string read GetCurrentString write SetCurrentString;
property DotOffset: Integer read FDotOffset write FDotOffset;
property DisplayType: SynCompletionType read GetDisplayKind write SetDisplayKind;
property Form: TSynBaseCompletionProposalForm read FForm;
property PreviousToken: string read FPreviousToken;
property Position: Integer read GetPosition write SetPosition;
property FormatParams : boolean read fFormatParams write fFormatParams;
published
property DefaultType: SynCompletionType read GetDefaultKind write SetDefaultKind default ctCode;
property Options: TSynCompletionOptions read GetOptions write SetOptions default DefaultProposalOptions;
property ItemList: TStrings read GetItemList write SetItemList;
property InsertList: TStrings read GetInsertList write SetInsertList;
property NbLinesInWindow: Integer read FNbLinesInWindow write SetNbLinesInWindow default 8;
property ClSelect: TColor read GetClSelect write SetClSelect default clHighlight;
property ClSelectedText: TColor read GetClSelectedText write SetClSelectedText default clHighlightText;
property ClBackground: TColor read GetClBack write SetClBack default clWindow;
property ClTitleBackground: TColor read GetClTitleBackground write SetClTitleBackground default clBtnFace;
property Width: Integer read FWidth write SetWidth default 260;
property EndOfTokenChr: string read GetEndOfTokenChar write SetEndOfTokenChar;
property TriggerChars: string read GetTriggerChars write SetTriggerChars;
property Title: string read GetTitle write SetTitle;
property Font: TFont read GetFont write SetFont;
property TitleFont: TFont read GetTitleFont write SetTitleFont;
property Columns: TProposalColumns read GetColumns write SetColumns;
property Resizeable: Boolean read GetResizeable write SetResizeable default True;
property ItemHeight: Integer read GetItemHeight write SetItemHeight default 0;
property Images: TCustomImageList read GetImages write SetImages default nil;
property Margin: Integer read GetMargin write SetMargin default 2;
property OnChange: TCompletionChange read GetOnChange write SetOnChange;
property OnCodeItemInfo: TCodeItemInfo read GetOnCodeItemInfo write SetOnCodeItemInfo;
property OnClose: TNotifyEvent read FOnClose write FOnClose;
property OnExecute: TCompletionExecute read FOnExecute write FOnExecute;
property OnMeasureItem: TSynBaseCompletionProposalMeasureItem read GetOnMeasureItem write SetOnMeasureItem;
property OnPaintItem: TSynBaseCompletionProposalPaintItem read GetOnPaintItem write SetOnPaintItem;
property OnParameterToken: TCompletionParameter read GetParameterToken write SetParameterToken;
property OnShow: TNotifyEvent read FOnShow write FOnShow;
end;
TSynCompletionProposal = class(TSynBaseCompletionProposal)
private
fEditors: TList;
FShortCut: TShortCut;
FNoNextKey: Boolean;
FCompletionStart: Integer;
FAdjustCompletionStart: Boolean;
FOnCodeCompletion: TCodeCompletionEvent;
FTimer: TTimer;
FTimerInterval: Integer;
FEditor: TCustomSynEdit;
FOnAfterCodeCompletion: TAfterCodeCompletionEvent;
FOnCancelled: TNotifyEvent;
procedure SetEditor(const Value: TCustomSynEdit);
procedure HandleOnCancel(Sender: TObject);
procedure HandleOnValidate(Sender: TObject; Shift: TShiftState; EndToken: WideChar);
procedure HandleOnKeyPress(Sender: TObject; var Key: WideChar);
procedure HandleDblClick(Sender: TObject);
procedure EditorKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure EditorKeyPress(Sender: TObject; var Key: WideChar);
procedure TimerExecute(Sender: TObject);
function GetPreviousToken(AEditor: TCustomSynEdit): string;
function GetCurrentInput(AEditor: TCustomSynEdit): string;
function GetTimerInterval: Integer;
procedure SetTimerInterval(const Value: Integer);
function GetEditor(i: Integer): TCustomSynEdit;
procedure InternalCancelCompletion;
protected
procedure DoExecute(AEditor: TCustomSynEdit); virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetShortCut(Value: TShortCut);
procedure SetOptions(const Value: TSynCompletionOptions); override;
procedure EditorCancelMode(Sender: TObject); override;
procedure HookedEditorCommand(Sender: TObject; AfterProcessing: Boolean;
var Handled: Boolean; var Command: TSynEditorCommand; var AChar: WideChar;
Data: Pointer; HandlerData: Pointer); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure AddEditor(AEditor: TCustomSynEdit);
function RemoveEditor(AEditor: TCustomSynEdit): boolean;
function EditorsCount: integer;
procedure ExecuteEx(s: string; x, y: Integer; Kind : SynCompletionType = ctCode); override;
procedure ActivateCompletion;
procedure CancelCompletion;
procedure ActivateTimer(ACurrentEditor: TCustomSynEdit);
procedure DeactivateTimer;
property Editors[i: Integer]: TCustomSynEdit read GetEditor;
property CompletionStart: Integer read FCompletionStart write FCompletionStart; // ET 04/02/2003
published
property ShortCut: TShortCut read FShortCut write SetShortCut;
property Editor: TCustomSynEdit read FEditor write SetEditor;
property TimerInterval: Integer read GetTimerInterval write SetTimerInterval default 1000;
property OnAfterCodeCompletion: TAfterCodeCompletionEvent read FOnAfterCodeCompletion write FOnAfterCodeCompletion;
property OnCancelled: TNotifyEvent read FOnCancelled write FOnCancelled;
property OnCodeCompletion: TCodeCompletionEvent read FOnCodeCompletion write FOnCodeCompletion;
end;
TSynAutoComplete = class(TComponent)
private
FShortCut: TShortCut;
fEditor: TCustomSynEdit;
fAutoCompleteList: TStrings;
fNoNextKey : Boolean;
FEndOfTokenChr: string;
FOnBeforeExecute: TNotifyEvent;
FOnAfterExecute: TNotifyEvent;
FInternalCompletion: TSynCompletionProposal;
FDoLookup: Boolean;
FOptions: TSynCompletionOptions;
procedure SetAutoCompleteList(List: TStrings);
procedure SetEditor(const Value: TCustomSynEdit);
procedure SetDoLookup(const Value: Boolean);
procedure CreateInternalCompletion;
function GetOptions: TSynCompletionOptions;
procedure SetOptions(const Value: TSynCompletionOptions);
procedure DoInternalAutoCompletion(Sender: TObject;
const Value: string; Shift: TShiftState; Index: Integer;
EndToken: WideChar);
function GetExecuting: Boolean;
protected
procedure SetShortCut(Value: TShortCut);
procedure Notification(AComponent: TComponent; Operation: TOperation);
override;
procedure EditorKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
virtual;
procedure EditorKeyPress(Sender: TObject; var Key: WideChar); virtual;
function GetPreviousToken(Editor: TCustomSynEdit): string;
public
function GetCompletionProposal : TSynCompletionProposal;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Execute(Token: string; Editor: TCustomSynEdit);
procedure ExecuteEx(Token: string; Editor: TCustomSynEdit; LookupIfNotExact: Boolean);
function GetTokenList: string;
function GetTokenValue(Token: string): string;
procedure CancelCompletion;
property Executing: Boolean read GetExecuting;
published
property AutoCompleteList: TStrings read fAutoCompleteList
write SetAutoCompleteList;
property EndOfTokenChr: string read FEndOfTokenChr write FEndOfTokenChr;
property Editor: TCustomSynEdit read fEditor write SetEditor;
property ShortCut: TShortCut read FShortCut write SetShortCut;
property OnBeforeExecute: TNotifyEvent read FOnBeforeExecute write FOnBeforeExecute;
property OnAfterExecute: TNotifyEvent read FOnAfterExecute write FOnAfterExecute;
property DoLookupWhenNotExact: Boolean read FDoLookup write SetDoLookup default true;
property Options: TSynCompletionOptions read GetOptions write SetOptions default DefaultProposalOptions;
end;
TProposalColumn = class(TCollectionItem)
private
FColumnWidth: Integer;
FInternalWidth: Integer;
FFontStyle: TFontStyles;
protected
procedure DefineProperties(Filer: TFiler); override;
public
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property ColumnWidth: Integer read FColumnWidth write FColumnWidth;
property DefaultFontStyle: TFontStyles read FFontStyle write FFontStyle default [];
end;
TProposalColumns = class(TCollection)
private
FOwner: TPersistent;
function GetItem(Index: Integer): TProposalColumn;
procedure SetItem(Index: Integer; Value: TProposalColumn);
protected
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TPersistent; ItemClass: TCollectionItemClass);
function Add: TProposalColumn;
function FindItemID(ID: Integer): TProposalColumn;
function Insert(Index: Integer): TProposalColumn;
property Items[Index: Integer]: TProposalColumn read GetItem write SetItem; default;
end;
procedure FormattedTextOut(TargetCanvas: TCanvas; const Rect: TRect; PPI: Integer;
const Text: string; Selected: Boolean; Columns: TProposalColumns; Images: TCustomImageList);
function FormattedTextWidth(TargetCanvas: TCanvas; const Text: string; PPI: Integer;
Columns: TProposalColumns; Images: TCustomImageList): Integer;
function PrettyTextToFormattedString(const APrettyText: string;
AlternateBoldStyle: Boolean = False): string;
(*
GetParameter extracts a parameter from a formatted function parameter string
Parameter lists can contain default values which may be strings
Ignores commas in strings and brackets
Python parameter lists can contain type hints which are arbitrary expressions
*)
function GetParameter(var S: string): string;
implementation
uses
System.Math,
Vcl.Themes,
SynEditTextBuffer,
SynEditMiscProcs,
SynEditKeyConst,
JvGnugettext,
uCommonFunctions;
const
TextHeightString = 'CompletionProposal';
//------------------------- Formatted painting stuff ---------------------------
type
TFormatCommand = (fcNoCommand, fcColor, fcStyle, fcColumn, fcHSpace, fcImage);
TFormatCommands = set of TFormatCommand;
PFormatChunk = ^TFormatChunk;
TFormatChunk = record
Str: string;
Command: TFormatCommand;
Data: Pointer;
end;
PFormatStyleData = ^TFormatStyleData;
TFormatStyleData = record
Style: WideChar;
Action: Integer; // -1 = Reset, +1 = Set, 0 = Toggle
end;
TFormatChunkList = class
private
FChunks: TList;
function GetCount: Integer;
function GetChunk(Index: Integer): PFormatChunk;
public
constructor Create;
destructor Destroy; override;
procedure Clear;
procedure Add(AChunk: PFormatChunk);
property Count: Integer read GetCount;
property Chunks[Index: Integer]: PFormatChunk read GetChunk; default;
end;
const
AllCommands = [fcColor..High(TFormatCommand)];
function TFormatChunkList.GetCount: Integer;
begin
Result := FChunks.Count;
end;
function TFormatChunkList.GetChunk(Index: Integer): PFormatChunk;
begin
Result := FChunks[Index];
end;
procedure TFormatChunkList.Clear;
var
C: PFormatChunk;
StyleFormatData: PFormatStyleData;
begin
while FChunks.Count > 0 do
begin
C := FChunks.Last;
FChunks.Delete(FChunks.Count-1);
case C^.Command of
fcStyle:
begin
StyleFormatData := C^.Data;
Dispose(StyleFormatData);
end;
end;
Dispose(C);
end;
end;
constructor TFormatChunkList.Create;
begin
inherited Create;
FChunks := TList.Create;
end;
destructor TFormatChunkList.Destroy;
begin
Clear;
FChunks.Free;
inherited Destroy;
end;
procedure TFormatChunkList.Add(AChunk: PFormatChunk);
begin
FChunks.Add(AChunk);
end;
function ParseFormatChunks(const FormattedString: string; ChunkList: TFormatChunkList;
const StripCommands: TFormatCommands): Boolean;
var
CurChar: WideChar;
CurPos: Integer;
CurrentChunk: string;
PossibleErrorPos: Integer;
ErrorFound: Boolean;
procedure NextChar;
begin
inc(CurPos);
{$IFOPT R+}
// Work-around Delphi's annoying behaviour of failing the RangeCheck when
// reading the final #0 char
if CurPos = Length(FormattedString) +1 then
CurChar := #0
else
{$ENDIF}
CurChar := FormattedString[CurPos];
end;
procedure AddStringChunk;
var
C: PFormatChunk;
begin
C := New(PFormatChunk);
C^.Str := CurrentChunk;
C^.Command := fcNoCommand;
C^.Data := nil;
ChunkList.Add(C);
CurrentChunk := '';
end;
procedure AddCommandChunk(ACommand: TFormatCommand; Data: Pointer);
var
C: PFormatChunk;
begin
C := New(PFormatChunk);
C^.Str := '';
C^.Command := ACommand;
C^.Data := Data;
ChunkList.Add(C);
end;
procedure ParseEscapeSequence;
var
Command: string;
Parameter: string;
CommandType: TFormatCommand;
Data: Pointer;
begin
Assert(CurChar = '\');
NextChar;
if CurChar = '\' then
begin
CurrentChunk := CurrentChunk + '\';
NextChar;
exit;
end;
if CurrentChunk <> '' then
AddStringChunk;
Command := '';
while (CurChar <> '{') and (CurPos <= Length(FormattedString)) do
begin
Command := Command +CurChar;
NextChar;
end;
if CurChar = '{' then
begin
PossibleErrorPos := CurPos;
NextChar;
Parameter := '';
while (CurChar <> '}') and (CurPos <= Length(FormattedString)) do
begin
Parameter := Parameter + CurChar;
NextChar;
end;
if CurChar = '}' then
begin
Command := System.SysUtils.AnsiUpperCase(Command);
Data := nil;
CommandType := fcNoCommand;
if Command = 'COLOR' then
begin
try
Data := Pointer(StringToColor(Parameter));
CommandType := fcColor;
except
CommandType := fcNoCommand;
ErrorFound := True;
end;
end else
if Command = 'COLUMN' then
begin
if Parameter <> '' then
begin
CommandType := fcNoCommand;
ErrorFound := True;
end else
CommandType := fcColumn;
end else
if Command = 'HSPACE' then
begin
try
Data := Pointer(StrToInt(Parameter));
CommandType := fcHSpace;
except
CommandType := fcNoCommand;
ErrorFound := True;
end;
end else
if Command = 'IMAGE' then
begin
try
Data := Pointer(StrToInt(Parameter));
CommandType := fcImage;
except
CommandType := fcNoCommand;
ErrorFound := True;
end;
end else
if Command = 'STYLE' then
begin
if (Length(Parameter) = 2)
and CharInSet(Parameter[1], ['+', '-', '~'])
and CharInSet(System.SysUtils.AnsiUpperCase(Parameter[2])[1],
['B', 'I', 'U', 'S']) then
begin
CommandType := fcStyle;
if not (fcStyle in StripCommands) then
begin
Data := New(PFormatStyleData);
PFormatStyleData(Data)^.Style := System.SysUtils.AnsiUpperCase(Parameter[2])[1];
case Parameter[1] of
'+': PFormatStyleData(Data)^.Action := 1;
'-': PFormatStyleData(Data)^.Action := -1;
'~': PFormatStyleData(Data)^.Action := 0;
end;
end;
end else
begin
CommandType := fcNoCommand;
ErrorFound := True;
end;
end else
ErrorFound := True;
if (CommandType <> fcNoCommand) and (not (CommandType in StripCommands)) then
AddCommandChunk(CommandType, Data);
NextChar;
end;
end;
Result := not ErrorFound;
end;
procedure ParseString;
begin
Assert(CurChar <> '\');
while (CurChar <> '\') and (CurPos <= Length(FormattedString)) do
begin
CurrentChunk := CurrentChunk +CurChar;
NextChar;
end;
end;
begin
Assert(Assigned(ChunkList));
if FormattedString = '' then
exit;
ErrorFound := False;
CurrentChunk := '';
CurPos := 1;
CurChar := FormattedString[1];
while CurPos <= Length(FormattedString) do
begin
if CurChar = '\' then
ParseEscapeSequence
else
ParseString;
end;
if CurrentChunk <> '' then
AddStringChunk;
end;
function StripFormatCommands(const FormattedString: string): string;
var
Chunks: TFormatChunkList;
i: Integer;
begin
Chunks := TFormatChunkList.Create;
try
ParseFormatChunks(FormattedString, Chunks, AllCommands);
Result := '';
for i := 0 to Chunks.Count -1 do
Result := Result + Chunks[i]^.Str;
finally
Chunks.Free;
end;
end;
function PaintChunks(TargetCanvas: TCanvas; const Rect: TRect; PPI : integer;
ChunkList: TFormatChunkList; Columns: TProposalColumns; Images: TCustomImageList;
Invisible: Boolean): Integer;
var
i: Integer;
X: Integer;
C: PFormatChunk;
CurrentColumn: TProposalColumn;
CurrentColumnIndex: Integer;
LastColumnStart: Integer;
Style: TFontStyles;
OldFont: TFont;
begin
OldFont := TFont.Create;
try
OldFont.Assign(TargetCanvas.Font);
if Assigned(Columns) and (Columns.Count > 0) then
begin
CurrentColumnIndex := 0;
CurrentColumn := TProposalColumn(Columns.Items[0]);
TargetCanvas.Font.Style := CurrentColumn.FFontStyle;
end else
begin
CurrentColumnIndex := -1;
CurrentColumn := nil;
end;
LastColumnStart := Rect.Left;
X := Rect.Left;
TargetCanvas.Brush.Style := bsClear;
for i := 0 to ChunkList.Count -1 do
begin
C := ChunkList[i];
case C^.Command of
fcNoCommand:
begin
if not Invisible then
TargetCanvas.TextOut(X, Rect.Top, C^.Str);
inc(X, TargetCanvas.TextWidth(C^.Str));
if X > Rect.Right then
break;
end;
fcColor:
if not Invisible then
TargetCanvas.Font.Color := StyleServices.GetSystemColor(TColor(C^.Data));
fcStyle:
begin
case PFormatStyleData(C^.Data)^.Style of
'I': Style := [fsItalic];
'B': Style := [fsBold];
'U': Style := [fsUnderline];
'S': Style := [fsStrikeout];
else Assert(False);
end;
case PFormatStyleData(C^.Data)^.Action of
-1: TargetCanvas.Font.Style := TargetCanvas.Font.Style - Style;
0: if TargetCanvas.Font.Style * Style = [] then
TargetCanvas.Font.Style := TargetCanvas.Font.Style + Style
else
TargetCanvas.Font.Style := TargetCanvas.Font.Style - Style;
1: TargetCanvas.Font.Style := TargetCanvas.Font.Style + Style;
else Assert(False);
end;
end;
fcColumn:
if Assigned(Columns) and (Columns.Count > 0) then
begin
if CurrentColumnIndex <= Columns.Count -1 then
begin
inc(LastColumnStart, MulDiv(CurrentColumn.FColumnWidth, PPI, 96));
X := LastColumnStart;
inc(CurrentColumnIndex);
if CurrentColumnIndex <= Columns.Count -1 then
begin
CurrentColumn := TProposalColumn(Columns.Items[CurrentColumnIndex]);
TargetCanvas.Font.Style := CurrentColumn.FFontStyle;
end else
CurrentColumn := nil;
end;
end;
fcHSpace:
begin
inc(X, Integer(C^.Data));
if X > Rect.Right then
break;
end;
fcImage:
begin
Assert(Assigned(Images));
Images.Draw(TargetCanvas, X, Rect.Top, Integer(C^.Data));
inc(X, Images.Width);
if X > Rect.Right then
break;
end;
end;
end;
Result := X;
TargetCanvas.Font.Assign(OldFont);
finally
OldFont.Free;
TargetCanvas.Brush.Style := bsSolid;
end;
end;
procedure FormattedTextOut(TargetCanvas: TCanvas; const Rect: TRect; PPI: Integer;
const Text: string; Selected: Boolean; Columns: TProposalColumns; Images: TCustomImageList);
var
Chunks: TFormatChunkList;
StripCommands: TFormatCommands;
begin
Chunks := TFormatChunkList.Create;
try
if Selected then
StripCommands := [fcColor]
else
StripCommands := [];
ParseFormatChunks(Text, Chunks, StripCommands);
PaintChunks(TargetCanvas, Rect, PPI, Chunks, Columns, Images, False);
finally
Chunks.Free;
end;
end;
function FormattedTextWidth(TargetCanvas: TCanvas; const Text: string; PPI: Integer;
Columns: TProposalColumns; Images: TCustomImageList): Integer;
var
Chunks: TFormatChunkList;
TmpRect: TRect;
begin
Chunks := TFormatChunkList.Create;
try
TmpRect := Rect(0, 0, MaxInt, MaxInt);
ParseFormatChunks(Text, Chunks, [fcColor]);
Result := PaintChunks(TargetCanvas, TmpRect, PPI, Chunks, Columns, Images, True);
finally
Chunks.Free;
end;
end;
function PrettyTextToFormattedString(const APrettyText: string;
AlternateBoldStyle: Boolean = False): string;
var
i: Integer;
Color: TColor;
Begin
Result := '';
i := 1;
while i <= Length(APrettyText) do
case APrettyText[i] of
#1, #2:
begin
Color := (Ord(APrettyText[i + 3]) shl 8
+Ord(APrettyText[i + 2])) shl 8
+Ord(APrettyText[i + 1]);
Result := Result+'\color{'+ColorToString(Color)+'}';
inc(i, 4);
end;
#3:
begin
if CharInSet(System.SysUtils.AnsiUpperCase(APrettyText[i + 1])[1], ['B', 'I', 'U']) then
begin
Result := Result + '\style{';
case APrettyText[i + 1] of
'B': Result := Result + '+B';
'b': Result := Result + '-B';
'I': Result := Result + '+I';
'i': Result := Result + '-I';
'U': Result := Result + '+U';
'u': Result := Result + '-U';
end;
Result := Result + '}';
end;
inc(i, 2);
end;
#9:
begin
Result := Result + '\column{}';
if AlternateBoldStyle then
Result := Result + '\style{~B}';
inc(i);
end;
else
Result := Result + APrettyText[i];
inc(i);
end;
end;
// TProposalColumn
constructor TProposalColumn.Create(Collection: TCollection);
begin
inherited;
FColumnWidth := 100;
FInternalWidth := -1;
FFontStyle := [];
end;
destructor TProposalColumn.Destroy;
begin
inherited;
end;
procedure TProposalColumn.Assign(Source: TPersistent);
begin
if Source is TProposalColumn then
begin
FColumnWidth := TProposalColumn(Source).FColumnWidth;
FInternalWidth := TProposalColumn(Source).FInternalWidth;
FFontStyle := TProposalColumn(Source).FFontStyle;
end
else
inherited Assign(Source);
end;
procedure TProposalColumn.DefineProperties(Filer: TFiler);
begin
inherited;
end;
constructor TProposalColumns.Create(AOwner: TPersistent; ItemClass: TCollectionItemClass);
begin
inherited Create(ItemClass);
FOwner := AOwner;
end;
function TProposalColumns.GetOwner: TPersistent;
begin
Result := FOwner;
end;
function TProposalColumns.GetItem(Index: Integer): TProposalColumn;
begin
Result := inherited GetItem(Index) as TProposalColumn;
end;
procedure TProposalColumns.SetItem(Index: Integer; Value: TProposalColumn);
begin
inherited SetItem(Index, Value);
end;
function TProposalColumns.Add: TProposalColumn;
begin
Result := inherited Add as TProposalColumn;
end;
function TProposalColumns.FindItemID(ID: Integer): TProposalColumn;
begin
Result := inherited FindItemID(ID) as TProposalColumn;
end;
function TProposalColumns.Insert(Index: Integer): TProposalColumn;
begin
Result := inherited Insert(Index) as TProposalColumn;
end;
//============================================================================
function GetParameter(var S: string): string;
var
Idx : integer;
BracketCounter : integer;
StringOpener : WideChar;
begin
BracketCounter := 0;
StringOpener := WideChar(0);
for Idx := 1 to Length(S) do begin
if StringOpener <> WideChar(0) then begin
if S[Idx] = StringOpener then
StringOpener := WideChar(0);
end else if Ord(S[Idx]) < 128 then begin
if AnsiChar(S[Idx]) in ['''','"'] then
StringOpener := S[Idx]
else if AnsiChar(S[Idx]) in ['(','{','['] then
Inc(BracketCounter)
else if AnsiChar(S[Idx]) in [')','}',']'] then
Dec(BracketCounter)
else if (BracketCounter = 0) and (S[Idx] = ',') then begin
Result := Copy (S, 1, Idx - 1);
Delete(S, 1, Idx);
Exit;
end;
end;
end;
Result := S;
S := '';
end;
function FormatParamList(const Params: string; CurrentIndex: Integer): string;
var
S, Param: string;
i: Integer;
begin
Result := '';
i := 0;
S := Params.Trim;
Repeat
Param := GetParameter(S);
if i = CurrentIndex then
Result := Result + '\style{~B}' + Param + '\style{~B}'
else
Result := Result + Param;
if S.Length > 0 then
Result := Result + ',';
Inc(i);
Until S.Length = 0;
end;
{ TSynBaseCompletionProposalForm }
constructor TSynBaseCompletionProposalForm.Create(AOwner: TComponent);
begin
FResizeable := False;
CreateNew(AOwner);
Bitmap := TBitmap.Create;
TitleBitmap := TBitmap.Create;
FItemList := TStringList.Create;
FInsertList := TStringList.Create;
FAssignedList := TStringList.Create;
FMatchText := False;
BorderStyle := bsNone;
FScrollbar := TScrollBar.Create(Self);
FScrollbar.Kind := sbVertical;
FScrollbar.ParentCtl3D := False;
FScrollbar.OnChange := ScrollbarOnChange;
FScrollbar.OnScroll := ScrollbarOnScroll;
FScrollbar.OnEnter := ScrollbarOnEnter;
FScrollbar.Parent := Self;
Visible := False;
FTitleFont := TFont.Create;
FTitleFont.Name := 'MS Shell Dlg 2';
FTitleFont.Size := 8;
FTitleFont.Style := [fsBold];
FTitleFont.Color := clBtnText;
FFont := TFont.Create;
FFont.Name := 'MS Shell Dlg 2';
FFont.Size := 8;
ClSelect := clHighlight;
ClSelectedText := clHighlightText;
ClBackground := clWindow;
ClTitleBackground := clBtnFace;
(FItemList as TStringList).OnChange := StringListChange; // Really necessary? It seems to work
FTitle := ''; // fine without it
FUseInsertList := False;
FFormattedText := False;
FCenterTitle := True;
FCase := False;
FColumns := TProposalColumns.Create(AOwner, TProposalColumn);
FItemHeight := 0;
FMargin := 2;
FEffectiveItemHeight := 0;
RecalcItemHeight;
Canvas.Font.Assign(FTitleFont);
FTitleFontHeight := Canvas.TextHeight(TextHeightString);
FHeightBuffer := 0;
FTitleFont.OnChange := TitleFontChange;
FFont.OnChange := FontChange;
OnDblClick := DoDoubleClick;
OnShow := DoFormShow;
OnHide := DoFormHide;
end;
procedure TSynBaseCompletionProposalForm.CreateParams(var Params: TCreateParams);
const
CS_DROPSHADOW = $20000;
begin
inherited;
with Params do
begin
Style := WS_POPUP;
ExStyle := WS_EX_TOOLWINDOW;
if ((Win32Platform and VER_PLATFORM_WIN32_NT) <> 0)
and (Win32MajorVersion > 4)
and (Win32MinorVersion > 0) {Windows XP} then
Params.WindowClass.style := Params.WindowClass.style or CS_DROPSHADOW;
if DisplayType = ctCode then
if FResizeable then
Style := Style or WS_THICKFRAME
else
Style := Style or WS_DLGFRAME;
end;
end;
procedure TSynBaseCompletionProposalForm.Activate;
begin
Visible := True;
if (DisplayType = ctCode) and Assigned(CurrentEditor) then //KV
(CurrentEditor as TCustomSynEdit).AddFocusControl(Self);
end;
procedure TSynBaseCompletionProposalForm.Deactivate;
begin
if (DisplayType = ctCode) and Assigned(CurrentEditor) then begin //KV
(CurrentEditor as TCustomSynEdit).RemoveFocusControl(Self);
Visible := False;
if Assigned(FCodeItemInfoWindow) then
FCodeItemInfoWindow.ReleaseHandle;
end;
//Visible := False; // KV
end;
destructor TSynBaseCompletionProposalForm.Destroy;
begin
inherited Destroy;
FColumns.Free;
Bitmap.Free;
TitleBitmap.Free;
FItemList.Free;
FInsertList.Free;
FAssignedList.Free;
FTitleFont.Free;
FFont.Free;
end;
procedure TSynBaseCompletionProposalForm.KeyDown(var Key: Word; Shift: TShiftState);
var
C: WideChar;
Cmd: TSynEditorCommand;
i: integer;
procedure ExecuteCmdAndCancel;
begin
if Cmd <> ecNone then begin
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(Cmd, #0, nil);
if Assigned(OnCancel) then
OnCancel(Self);
end;
end;
begin
if DisplayType = ctCode then
begin
i := (CurrentEditor as TCustomSynEdit).Keystrokes.FindKeycode(Key, Shift);
if i >= 0 then
Cmd := TCustomSynEdit(CurrentEditor).Keystrokes[i].Command
else
Cmd := ecNone;
case Key of
SYNEDIT_RETURN:
if (FCompleteWithEnter) and Assigned(OnValidate) then
OnValidate(Self, Shift, #0);
SYNEDIT_TAB:
if (FCompleteWithTab) and Assigned(OnValidate) then
OnValidate(Self, Shift, #0);
SYNEDIT_ESCAPE:
begin
if Assigned(OnCancel) then
OnCancel(Self);
end;
SYNEDIT_LEFT:
if (Shift = []) then
begin
if Length(FCurrentString) > 0 then
begin
CurrentString := Copy(CurrentString, 1, Length(CurrentString) - 1);
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(ecLeft, #0, nil);
end
else
begin
//Since we have control, we need to re-send the key to
//the editor so that the cursor behaves properly
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(ecLeft, #0, nil);
if Assigned(OnCancel) then
OnCancel(Self);
end;
end else
ExecuteCmdAndCancel;
SYNEDIT_RIGHT:
if (Shift = []) then
begin
if Assigned(CurrentEditor) then
with CurrentEditor as TCustomSynEdit do
begin
if CaretX <= Length(LineText) then
C := LineText[CaretX]
else
C := #32;
if Self.IsWordBreakChar(C) then
if Assigned(OnCancel) then
OnCancel(Self)
else
else
CurrentString := CurrentString + C;
CommandProcessor(ecRight, #0, nil);
end;
end else
ExecuteCmdAndCancel;
SYNEDIT_PRIOR:
MoveLine(-FLinesInWindow);
SYNEDIT_NEXT:
MoveLine(FLinesInWindow);
SYNEDIT_END:
Position := FAssignedList.Count - 1;
SYNEDIT_HOME:
Position := 0;
SYNEDIT_UP:
if ssCtrl in Shift then
Position := 0
else
MoveLine(-1);
SYNEDIT_DOWN:
if ssCtrl in Shift then
Position := FAssignedList.Count - 1
else
MoveLine(1);
SYNEDIT_BACK:
if (Shift = []) then
begin
if Length(FCurrentString) > 0 then
begin
CurrentString := Copy(CurrentString, 1, Length(CurrentString) - 1);
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(ecDeleteLastChar, #0, nil);
end
else
begin
//Since we have control, we need to re-send the key to
//the editor so that the cursor behaves properly
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(ecDeleteLastChar, #0, nil);
if Assigned(OnCancel) then
OnCancel(Self);
end;
end else
ExecuteCmdAndCancel;
SYNEDIT_DELETE:
if Assigned(CurrentEditor) then
(CurrentEditor as TCustomSynEdit).CommandProcessor(ecDeleteChar, #0, nil);
else
ExecuteCmdAndCancel;
end;
end;
Invalidate;
end;
procedure TSynBaseCompletionProposalForm.KeyPress(var Key: Char);
begin
if Key = #0 then Exit;
if DisplayType = ctCode then
begin
case Key of
#13, #27:; // These keys are already handled by KeyDown
#32..High(WideChar):
begin
if IsWordBreakChar(Key) and Assigned(OnValidate) then
begin
// if Key = #32 then
// OnValidate(Self, [], #0)
// else
OnValidate(Self, [], Key);
end;
CurrentString := CurrentString + Key;
if Assigned(OnKeyPress) then
OnKeyPress(Self, Key);
end;
#8:
if Assigned(OnKeyPress) then
OnKeyPress(Self, Key);
else
with CurrentEditor as TCustomSynEdit do
CommandProcessor(ecChar, Key, nil);
if Assigned(OnCancel) then
OnCancel(Self);
end;
end;
Invalidate;
end;
procedure TSynBaseCompletionProposalForm.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
y := (y - fHeightBuffer) div FEffectiveItemHeight;
Position := FScrollbar.Position + y;
// (CurrentEditor as TCustomSynEdit).UpdateCaret;
end;
function TSynBaseCompletionProposalForm.CanResize(var NewWidth, NewHeight: Integer): Boolean;
var
NewLinesInWindow: Integer;
BorderWidth: Integer;
begin
Result := True;
case FDisplayKind of
ctCode:
begin
if Resizeable then
BorderWidth := 2 * GetSystemMetrics(SM_CYSIZEFRAME)
else
BorderWidth := 2 * GetSystemMetrics(SM_CYFIXEDFRAME);
if FEffectiveItemHeight <> 0 then
begin
//KV Subtracted BorderWidth
NewLinesInWindow := (NewHeight - BorderWidth - FHeightBuffer) div FEffectiveItemHeight;
if NewLinesInWindow < 1 then
NewLinesInWindow := 1;
end else
NewLinesInWindow := 0;
FLinesInWindow := NewLinesInWindow;
NewHeight := FEffectiveItemHeight * FLinesInWindow + FHeightBuffer + BorderWidth;
if (NewWidth-BorderWidth) < FScrollbar.Width then
NewWidth := FScrollbar.Width + BorderWidth;
end;
ctHint:;
ctParams:;
end;
end;
procedure TSynBaseCompletionProposalForm.Resize;
begin
inherited;
if FEffectiveItemHeight <> 0 then
//KV Replaced Height with ClientHeight
FLinesInWindow := (ClientHeight - FHeightBuffer) div FEffectiveItemHeight;
if not(csCreating in ControlState) then
AdjustMetrics;
AdjustScrollBarPosition;
Invalidate;
end;
procedure TSynBaseCompletionProposalForm.Paint;
procedure ResetCanvas;
begin
with Bitmap.Canvas do
begin
Pen.Color := StyleServices.GetSystemColor(FClBackGround);
Brush.Color := StyleServices.GetSystemColor(FClBackGround);
Font.Assign(FFont);
Font.Color := StyleServices.GetSystemColor(clWindowText);
end;
end;
const
TitleMargin = 2;
var
TmpRect: TRect;
TmpX: Integer;
AlreadyDrawn: boolean;
TmpString: string;
i: Integer;
begin
if FDisplayKind = ctCode then
begin
with Bitmap do
begin
ResetCanvas;
Canvas.Pen.Color := StyleServices.GetSystemColor(clBtnFace);
Canvas.Rectangle(0, 0, ClientWidth - FScrollbar.Width, ClientHeight);
for i := 0 to Min(FLinesInWindow - 1, FAssignedList.Count - 1) do
begin
if i + FScrollbar.Position = Position then
begin
Canvas.Brush.Color := StyleServices.GetSystemColor(FClSelect);
Canvas.Pen.Color := StyleServices.GetSystemColor(FClSelect);
Canvas.Rectangle(0, FEffectiveItemHeight * i, ClientWidth - FScrollbar.Width,
FEffectiveItemHeight * (i + 1));
Canvas.Pen.Color := StyleServices.GetSystemColor(fClSelectText);
Canvas.Font.Assign(FFont);
Canvas.Font.Color := StyleServices.GetSystemColor(FClSelectText);
end;
AlreadyDrawn := False;
if Assigned(OnPaintItem) then
OnPaintItem(Self, LogicalToPhysicalIndex(FScrollBar.Position + i),
Canvas, Rect(0, FEffectiveItemHeight * i, ClientWidth - FScrollbar.Width,
FEffectiveItemHeight * (i + 1)), AlreadyDrawn);
if AlreadyDrawn then
ResetCanvas
else
begin
if FFormattedText then
begin
FormattedTextOut(Canvas, Rect(FMargin,
FEffectiveItemHeight * i + ((FEffectiveItemHeight - FFontHeight) div 2),
Bitmap.Width, FEffectiveItemHeight * (i + 1)),
CurrentPPI, FAssignedList[FScrollbar.Position + i],
(i + FScrollbar.Position = Position), FColumns, FImages);
end
else
begin
Canvas.TextOut(FMargin, FEffectiveItemHeight * i,
FAssignedList[FScrollbar.Position + i]);
end;
if i + FScrollbar.Position = Position then
ResetCanvas;
end;
end;
end;
Canvas.Draw(0, FHeightBuffer, Bitmap);
if FTitle <> '' then
begin
with TitleBitmap do
begin
Canvas.Brush.Color := StyleServices.GetSystemColor(FClTitleBackground);
TmpRect := Rect(0, 0, ClientWidth + 1, FHeightBuffer); //GBN
Canvas.FillRect(TmpRect);
Canvas.Pen.Color := StyleServices.GetSystemColor(clBtnShadow);
dec(TmpRect.Bottom, 1);
Canvas.PenPos := TmpRect.BottomRight;
Canvas.LineTo(TmpRect.Left - 1,TmpRect.Bottom);
Canvas.Pen.Color := StyleServices.GetSystemColor(clBtnFace);
Canvas.Font.Assign(FTitleFont);
Canvas.Font.Color := StyleServices.GetSystemColor(FTitleFont.Color);
if CenterTitle then
begin
TmpX := (Width - Canvas.TextWidth(Title)) div 2;
if TmpX < TitleMargin then
TmpX := TitleMargin; //We still want to be able to read it, even if it does go over the edge
end else
begin
TmpX := TitleMargin;
end;
Canvas.TextRect(TmpRect, TmpX, TitleMargin - 1, FTitle); // -1 because TmpRect.Top is already 1
end;
Canvas.Draw(0, 0, TitleBitmap);
end;
end else
if (FDisplayKind = ctHint) or (FDisplayKind = ctParams) then
begin
with Bitmap do
begin
ResetCanvas;
tmpRect := Rect(0, 0, ClientWidth, ClientHeight);
Canvas.FillRect(tmpRect);
Frame3D(Canvas, tmpRect, cl3DLight, cl3DDkShadow, 1);
for i := 0 to FAssignedList.Count - 1 do
begin
AlreadyDrawn := False;
if Assigned(OnPaintItem) then
OnPaintItem(Self, i, Canvas, Rect(0, FEffectiveItemHeight * i + FMargin,
ClientWidth, FEffectiveItemHeight * (i + 1) + FMargin), AlreadyDrawn);
if AlreadyDrawn then
ResetCanvas
else
begin
//KV if FDisplayKind = ctParams then
if (FDisplayKind = ctParams) and (i = 0) and
(Owner as TSynBaseCompletionProposal).FormatParams
then
TmpString := FormatParamList(FAssignedList[i], CurrentIndex)
else
TmpString := FAssignedList[i];
FormattedTextOut(Canvas, Rect(FMargin + 1,
FEffectiveItemHeight * i + ((FEffectiveItemHeight-FFontHeight) div 2) + FMargin,
Bitmap.Width - 1, FEffectiveItemHeight * (i + 1) + FMargin), CurrentPPI, TmpString,
False, nil, FImages);
end;
end;
end;
Canvas.Draw(0, 0, Bitmap);
end;
end;
procedure TSynBaseCompletionProposalForm.ScrollbarOnChange(Sender: TObject);
begin
if Position < FScrollbar.Position then
Position := FScrollbar.Position
else
if Position > FScrollbar.Position + FLinesInWindow - 1 then
Position := FScrollbar.Position + FLinesInWindow - 1
else begin
Repaint;
if Visible and Assigned(FCodeItemInfoWindow) then
ShowCodeItemInfo(FCodeItemInfoWindow.Caption);
end;
end;
procedure TSynBaseCompletionProposalForm.ScrollbarOnScroll(Sender: TObject;
ScrollCode: TScrollCode; var ScrollPos: Integer);
begin
with CurrentEditor as TCustomSynEdit do
begin
SetFocus;
//This tricks the caret into showing itself again.
AlwaysShowCaret := False;
AlwaysShowCaret := True;
// UpdateCaret;
end;
end;
procedure TSynBaseCompletionProposalForm.ScrollbarOnEnter(Sender: TObject);
begin
ActiveControl := nil;
end;
procedure TSynBaseCompletionProposalForm.MoveLine(cnt: Integer);
begin
if (cnt > 0) then begin
if (Position < (FAssignedList.Count - cnt)) then
Position := Position + cnt
else
Position := FAssignedList.Count - 1;
end else begin
if (Position + cnt) > 0 then
Position := Position + cnt
else
Position := 0;
end;
end;
function TSynBaseCompletionProposalForm.LogicalToPhysicalIndex(Index: Integer): Integer;
begin
if FMatchText and (Index >= 0) and (Index < FAssignedList.Count) then
Result := Integer(FAssignedList.Objects[Index])
else
Result := -1;
end;
function TSynBaseCompletionProposalForm.PhysicalToLogicalIndex(Index: Integer): Integer;
var i : Integer;
begin
if FMatchText then
begin
Result := -1;
for i := 0 to FAssignedList.Count - 1 do
if Integer(FAssignedList.Objects[i]) = Index then
begin
Result := i;
break;
end;
end else
Result := Index;
end;
procedure TSynBaseCompletionProposalForm.SetCurrentString(const Value: string);
function MatchItem(AIndex: Integer; UseItemList: Boolean): Boolean;
var
CompareString: string;
begin
{ if UseInsertList then
CompareString := FInsertList[AIndex]
else
begin
CompareString := FItemList[AIndex];
if UsePrettyText then
CompareString := StripFormatCommands(CompareString);
end;}
if UseInsertList then
CompareString := FInsertList[aIndex]
else
begin
if (FMatchText) and (not UseItemList) then
CompareString := FAssignedList[aIndex]
else
CompareString := FItemList[aIndex]; //GBN 29/08/2002 Fix for when match text is not active
if UsePrettyText then
CompareString := StripFormatCommands(CompareString);
end;
CompareString := Copy(CompareString, 1, Length(Value));
if FCase then
Result := AnsiCompareStr(CompareString, Value) = 0
else
Result := AnsiCompareText(CompareString, Value) = 0;
end;
procedure RecalcList;
var
i: Integer;
begin
FAssignedList.Clear;
for i := 0 to FItemList.Count -1 do
begin
if MatchItem(i, True) then
FAssignedList.AddObject(FItemList[i], TObject(i));
end;
end;
var
i: Integer;
begin
FCurrentString := Value;
if DisplayType <> ctCode then
exit;
if FMatchText then
begin
RecalcList;
AdjustScrollBarPosition;
Position := 0;
if Visible and Assigned(FOnChangePosition) and (DisplayType = ctCode) then
FOnChangePosition(Owner as TSynBaseCompletionProposal,
LogicalToPhysicalIndex(FPosition));
Repaint;
end
else
begin
i := 0;
while (i < ItemList.Count) and (not MatchItem(i, True)) do
inc(i);
if i < ItemList.Count then
Position := i
else
Position := 0;
end;
end;
procedure TSynBaseCompletionProposalForm.SetItemList(const Value: TStrings);
begin
FItemList.Assign(Value);
FAssignedList.Assign(Value);
CurrentString := CurrentString;
end;
procedure TSynBaseCompletionProposalForm.SetInsertList(const Value: TStrings);
begin
FInsertList.Assign(Value);
end;
procedure TSynBaseCompletionProposalForm.DoDoubleClick(Sender: TObject);
begin
//we need to do the same as the enter key;
if DisplayType = ctCode then
if Assigned(OnValidate) then OnValidate(Self, [], #0); //GBN 15/11/2001
end;
procedure TSynBaseCompletionProposalForm.SetPosition(const Value: Integer);
Var
Info : string;
begin
// if ((Value <= 0) and (FPosition = 0)) or (FPosition = Value) then
// exit;
if (Value < 0) or (Value > AssignedList.Count - 1) then
begin
ShowCodeItemInfo(''); // Destroys the Info window
exit;
end;
if Value <= FAssignedList.Count - 1 then
begin
FPosition := Value;
if Position < FScrollbar.Position then
FScrollbar.Position := Position else
if FScrollbar.Position < (Position - FLinesInWindow + 1) then
FScrollbar.Position := Position - FLinesInWindow + 1;
if Visible and (DisplayType = ctCode) then
begin
if Assigned(FOnChangePosition) then
FOnChangePosition(Owner as TSynBaseCompletionProposal,
LogicalToPhysicalIndex(FPosition));
if Assigned(FOnCodeItemInfo) then begin
FOnCodeItemInfo(Owner as TSynBaseCompletionProposal,
LogicalToPhysicalIndex(FPosition), Info);
ShowCodeItemInfo(Info);
end;
end;
Repaint;
end;
end;
procedure TSynBaseCompletionProposalForm.SetResizeable(const Value: Boolean);
begin
FResizeable := Value;
RecreateWnd;
end;
procedure TSynBaseCompletionProposalForm.SetItemHeight(const Value: Integer);
begin
if Value <> FItemHeight then
begin
FItemHeight := Value;
RecalcItemHeight;
end;
end;
procedure TSynBaseCompletionProposalForm.SetImages(const Value: TCustomImageList);
begin
if FImages <> Value then
begin
if Assigned(FImages) then
FImages.RemoveFreeNotification(Self);
FImages := Value;
if Assigned(FImages) then
FImages.FreeNotification(Self);
end;
end;
procedure TSynBaseCompletionProposalForm.RecalcItemHeight;
begin
Canvas.Font.Assign(FFont);
FFontHeight := Canvas.TextHeight(TextHeightString);
if FItemHeight > 0 then
FEffectiveItemHeight := FItemHeight
else
begin
FEffectiveItemHeight := FFontHeight;
end;
end;
procedure TSynBaseCompletionProposalForm.StringListChange(Sender: TObject);
begin
FScrollbar.Position := Position;
end;
function TSynBaseCompletionProposalForm.IsWordBreakChar(AChar: WideChar): Boolean;
begin
Result := (Owner as TSynBaseCompletionProposal).IsWordBreakChar(AChar);
end;
procedure TSynBaseCompletionProposalForm.WMMouseWheel(var Msg: TMessage);
var
nDelta: integer;
nWheelClicks: integer;
begin
if csDesigning in ComponentState then exit;
if GetKeyState(VK_CONTROL) >= 0 then nDelta := Mouse.WheelScrollLines
else nDelta := FLinesInWindow;
Inc(fMouseWheelAccumulator, SmallInt(Msg.wParamHi));
nWheelClicks := fMouseWheelAccumulator div WHEEL_DELTA;
fMouseWheelAccumulator := fMouseWheelAccumulator mod WHEEL_DELTA;
if (nDelta = integer(WHEEL_PAGESCROLL)) or (nDelta > FLinesInWindow) then
nDelta := FLinesInWindow;
Position := Position - (nDelta * nWheelClicks);
// (CurrentEditor as TCustomSynEdit).UpdateCaret;
end;
function GetMDIParent (const Form: TSynForm): TSynForm;
{ Returns the parent of the specified MDI child form. But, if Form isn't a
MDI child, it simply returns Form. }
var
I, J: Integer;
begin
Result := Form;
if Form = nil then
exit;
if (Form is TSynForm) and
((Form as TForm).FormStyle = fsMDIChild) then
for I := 0 to Screen.FormCount-1 do
with Screen.Forms[I] do
begin
if FormStyle <> fsMDIForm then Continue;
for J := 0 to MDIChildCount-1 do
if MDIChildren[J] = Form then
begin
Result := Screen.Forms[I];
exit;
end;
end;
end;
procedure TSynBaseCompletionProposalForm.WMActivate(var Message: TWMActivate);
var
ParentForm: TSynForm;
begin
if csDesigning in ComponentState then begin
inherited;
Exit;
end;
{Owner of the component that created me}
if Owner.Owner is TSynForm then
ParentForm := GetMDIParent(Owner.Owner as TSynForm)
else
ParentForm := nil;
if Assigned(ParentForm) and ParentForm.HandleAllocated then
SendMessage(ParentForm.Handle, WM_NCACTIVATE, Ord(Message.Active <> WA_INACTIVE), 0);
end;
procedure TSynBaseCompletionProposalForm.DoFormHide(Sender: TObject);
begin
if CurrentEditor <> nil then
begin
(CurrentEditor as TCustomSynEdit).AlwaysShowCaret := OldShowCaret;
// (CurrentEditor as TCustomSynEdit).UpdateCaret;
if DisplayType = ctCode then
begin
// Save after removing the PPI scaling
(Owner as TSynBaseCompletionProposal).FWidth := MulDiv(Width, 96, CurrentPPI);
(Owner as TSynBaseCompletionProposal).FNbLinesInWindow := FLinesInWindow;
end;
end;
//GBN 28/08/2002
if Assigned((Owner as TSynBaseCompletionProposal).OnClose) then
TSynBaseCompletionProposal(Owner).OnClose(Self);
end;
procedure TSynBaseCompletionProposalForm.DoFormShow(Sender: TObject);
begin
if Assigned(CurrentEditor) then
begin
with CurrentEditor as TCustomSynEdit do
begin
OldShowCaret := AlwaysShowCaret;
AlwaysShowCaret := Focused;
// UpdateCaret;
end;
end;
//GBN 28/08/2002
if Assigned((Owner as TSynBaseCompletionProposal).OnShow) then
(Owner as TSynBaseCompletionProposal).OnShow(Self);
end;
procedure TSynBaseCompletionProposalForm.WMEraseBackgrnd(
var Message: TMessage);
begin
Message.Result:=1;
end;
//GBN 24/02/2002
procedure TSynBaseCompletionProposalForm.WMGetDlgCode(var Message: TWMGetDlgCode);
begin
inherited;
Message.Result := Message.Result or DLGC_WANTTAB;
end;
procedure TSynBaseCompletionProposalForm.AdjustMetrics;
begin
if DisplayType = ctCode then
begin
if FTitle <> '' then
FHeightBuffer := FTitleFontHeight + MulDiv(4, CurrentPPI, 96) {Margin}
else
FHeightBuffer := 0;
if (ClientWidth >= FScrollbar.Width) and (ClientHeight >= FHeightBuffer) then
Bitmap.SetSize(ClientWidth - FScrollbar.Width, ClientHeight - FHeightBuffer);
if (ClientWidth > 0) and (FHeightBuffer > 0) then
TitleBitmap.SetSize(ClientWidth, FHeightBuffer);
end else
begin
if (ClientWidth > 0) and (ClientHeight > 0) then
Bitmap.SetSize(ClientWidth, ClientHeight);
end;
end;
procedure TSynBaseCompletionProposalForm.AdjustScrollBarPosition;
begin
if FDisplayKind = ctCode then
begin
if Assigned(FScrollbar) then
begin
FScrollbar.Top := FHeightBuffer;
FScrollbar.Height := ClientHeight - FHeightBuffer;
FScrollbar.Left := ClientWidth - FScrollbar.Width;
if FAssignedList.Count - FLinesInWindow < 0 then
begin
FScrollbar.PageSize := 0;
FScrollbar.Max := 0;
FScrollbar.Enabled := False;
end else
begin
FScrollbar.PageSize := 0;
FScrollbar.Max := FAssignedList.Count - FLinesInWindow;
if FScrollbar.Max <> 0 then
begin
FScrollbar.LargeChange := FLinesInWindow;
FScrollbar.PageSize := 1;
FScrollbar.Enabled := True;
end else
FScrollbar.Enabled := False;
end;
end;
end;
end;
procedure TSynBaseCompletionProposalForm.SetTitle(const Value: string);
begin
FTitle := Value;
AdjustMetrics;
end;
procedure TSynBaseCompletionProposalForm.SetFont(const Value: TFont);
begin
FFont.Assign(Value);
RecalcItemHeight;
AdjustMetrics;
if Assigned(FCodeItemInfoWindow) then
FCodeItemInfoWindow.Canvas.Font.Assign(FFont);
end;
procedure TSynBaseCompletionProposalForm.SetTitleFont(const Value: TFont);
begin
FTitleFont.Assign(Value);
FTitleFontHeight := Canvas.TextHeight(TextHeightString);
AdjustMetrics;
end;
procedure TSynBaseCompletionProposalForm.ShowCodeItemInfo(Info: string);
Var
HintRect, WorkArea: TRect;
Monitor: TMonitor;
begin
if Info = '' then begin
if Assigned(FCodeItemInfoWindow) then begin
fCodeItemInfoWindow.ReleaseHandle;
FCodeItemInfoWindow.Caption := '';
end;
end
else
begin
if not Assigned(FCodeItemInfoWindow) then begin
FCodeItemInfoWindow := THintWindow.Create(Self);
FCodeItemInfoWindow.Canvas.Font.Assign(FFont);
end;
Monitor := Screen.MonitorFromPoint(ClientToScreen(Point(0,0)));
WorkArea := Monitor.WorkareaRect;
HintRect := FCodeItemInfoWindow.CalcHintRect(Monitor.Width div 2, Info, nil);
// Calculate horizontal position
if Left + Width + (HintRect.Right - HintRect.Left) < WorkArea.Right
then
OffsetRect(HintRect, Left + Width , 0)
else
OffsetRect(HintRect, Left - (HintRect.Right - HintRect.Left), 0);
// Calculate vertical position
OffsetRect(HintRect, 0, ClientToScreen(Point(0,0)).Y +
(FPosition - FScrollbar.Position) * FEffectiveItemHeight);
// No need to fit it to the workarea since ActivateHint does that
FCodeItemInfoWindow.ActivateHint(HintRect, Info);
end;
end;
procedure TSynBaseCompletionProposalForm.SetColumns(Value: TProposalColumns);
begin
FColumns.Assign(Value);
end;
procedure TSynBaseCompletionProposalForm.TitleFontChange(Sender: TObject);
begin
Canvas.Font.Assign(FTitleFont);
FTitleFontHeight := Canvas.TextHeight(TextHeightString);
AdjustMetrics;
end;
procedure TSynBaseCompletionProposalForm.FontChange(Sender: TObject);
begin
RecalcItemHeight;
AdjustMetrics;
if Assigned(FCodeItemInfoWindow) then
FCodeItemInfoWindow.Canvas.Font.Assign(FFont);
end;
function TSynBaseCompletionProposalForm.GetCurrentPPI: Integer;
begin
if Assigned(FCurrentEditor) then
Result := FCurrentEditor.CurrentPPI
else
Result := Screen.PixelsPerInch;
end;
procedure TSynBaseCompletionProposalForm.Notification(AComponent: TComponent;
Operation: TOperation);
begin
if (Operation = opRemove) then
begin
if AComponent = FImages then
Images := nil;
end;
inherited Notification(AComponent, Operation);
end;
{ TSynBaseCompletionProposal }
constructor TSynBaseCompletionProposal.Create(Aowner: TComponent);
begin
FWidth := 260;
FNbLinesInWindow := 8;
inherited Create(AOwner);
FForm := TSynBaseCompletionProposalForm.Create(Self);
EndOfTokenChr := DefaultEndOfTokenChr;
FDotOffset := 0;
FFormatParams := True; // KV
DefaultType := ctCode;
end;
procedure TSynBaseCompletionProposal.Execute(s: string; x, y: integer);
begin
ExecuteEx(s, x, y, DefaultType);
end;
procedure TSynBaseCompletionProposal.ExecuteEx(s: string; x, y: integer; Kind : SynCompletionType);
Var
WorkArea : TRect;
Monitor: TMonitor;
function GetWorkAreaWidth: Integer;
begin
Result := WorkArea.Right;
end;
function GetWorkAreaHeight: Integer;
begin
Result := WorkArea.Bottom;
end;
function GetParamWidth(const S: string): Integer;
var
i: Integer;
List: TStringList;
NewWidth: Integer;
begin
List := TStringList.Create;
try
List.CommaText := S;
Result := 0;
for i := -1 to List.Count -1 do
begin
NewWidth := FormattedTextWidth(Form.Canvas,
FormatParamList(S, i), Form.CurrentPPI, Columns, FForm.Images);
if NewWidth > Result then
Result := NewWidth;
end;
finally
List.Free;
end;
end;
procedure RecalcFormPlacement;
var
i: Integer;
tmpWidth: Integer;
tmpHeight: Integer;
tmpX: Integer;
tmpY: Integer;
tmpStr: string;
BorderWidth: Integer;
NewWidth: Integer;
PPIScaledMargin: Integer;
PPIScaledWidth: Integer;
begin
PPIScaledMargin := MulDiv(Form.Margin, Form.CurrentPPI, 96);
PPIScaledWidth := MulDiv(FWidth, Form.CurrentPPI, 96);
tmpX := x;
tmpY := Y + 2;
tmpWidth := 0;
tmpHeight := 0;
case Kind of
ctCode:
begin
if Resizeable then
BorderWidth := 2 * GetSystemMetrics(SM_CYSIZEFRAME)
else
BorderWidth := 2 * GetSystemMetrics(SM_CYFIXEDFRAME);
tmpWidth := PPIScaledWidth;
tmpHeight := Form.FHeightBuffer + Form.FEffectiveItemHeight * FNbLinesInWindow + BorderWidth;
end;
ctHint:
begin
BorderWidth := 2;
tmpHeight := Form.FEffectiveItemHeight * ItemList.Count + BorderWidth
+ 2 * PPIScaledMargin;
Form.Canvas.Font.Assign(Font);
for i := 0 to ItemList.Count -1 do
begin
tmpStr := ItemList[i];
NewWidth := FormattedTextWidth(Form.Canvas, tmpStr,
Form.CurrentPPI, nil, FForm.Images);
if NewWidth > tmpWidth then
tmpWidth := NewWidth;
end;
inc(tmpWidth, 2 * PPIScaledMargin + BorderWidth);
end;
ctParams:
begin
BorderWidth := 2;
tmpHeight := Form.FEffectiveItemHeight * ItemList.Count + BorderWidth
+ 2 * PPIScaledMargin;
Form.Canvas.Font.Assign(Font);
for i := 0 to ItemList.Count -1 do
begin
if (i = 0) and FFormatParams then //KV
NewWidth := GetParamWidth(StripFormatCommands(ItemList[i]))
else
NewWidth := FormattedTextWidth(Form.Canvas, ItemList[i],
Form.CurrentPPI, nil, FForm.Images);
if Assigned(Form.OnMeasureItem) then
Form.OnMeasureItem(Self, i, Form.Canvas, NewWidth);
if NewWidth > tmpWidth then
tmpWidth := NewWidth;
end;
inc(tmpWidth, 2 * PPIScaledMargin +BorderWidth);
end;
end;
if tmpX + tmpWidth > GetWorkAreaWidth then
begin
tmpX := GetWorkAreaWidth - tmpWidth - 5; //small space buffer
if tmpX < 0 then
tmpX := 0;
end;
if tmpY + tmpHeight > GetWorkAreaHeight then
begin
tmpY := tmpY - tmpHeight - (Form.CurrentEditor as TCustomSynEdit).LineHeight -4;
if tmpY < 0 then
tmpY := 0;
end;
Form.SetBounds(tmpX, tmpY, tmpWidth, tmpHeight);
end;
var
TmpOffset: Integer;
begin
Monitor := Screen.MonitorFromPoint(Point(x, y));
WorkArea := Monitor.WorkareaRect;
DisplayType := Kind;
FCanExecute := True;
if Assigned(OnExecute) then
OnExecute(Kind, Self, s, x, y, FCanExecute);
if (not FCanExecute) or (ItemList.Count = 0) then
begin
if Form.Visible and (Kind = ctParams) then
Form.Visible := False;
exit;
end;
Form.PopupMode := pmExplicit;
if (Kind = ctCode) then Form.FormStyle := fsStayOnTop;
if Assigned(Form.CurrentEditor) then
begin
TmpOffset := (Form.CurrentEditor as TCustomSynEdit).Canvas.TextWidth(Copy(s, 1, DotOffset));
if DotOffset > 1 then
TmpOffset := TmpOffset + (3 * (DotOffset -1));
Form.PopupParent := GetParentForm(Form.CurrentEditor);
end else
TmpOffset := 0;
x := x - tmpOffset;
ResetAssignedList;
case Kind of
ctCode:
if Form.AssignedList.Count > 0 then
begin
//This may seem redundant, but it fixes scrolling bugs for the first time
//That is the only time these occur
Position := 0;
Form.AdjustScrollBarPosition;
Form.FScrollbar.Position := Form.Position;
Form.FScrollbar.Visible := True;
RecalcFormPlacement;
Form.Show;
CurrentString := s; // bug id 1496148
end;
ctParams, ctHint:
begin
Form.FScrollbar.Visible := False;
RecalcFormPlacement;
//ShowWindow(Form.Handle, SW_SHOWNOACTIVATE);
ShowWindow(Form.Handle, SW_SHOWNA);
Form.Visible := True;
Form.Repaint;
end;
end;
end;
function TSynBaseCompletionProposal.GetCurrentString: string;
begin
Result := Form.CurrentString;
end;
function TSynBaseCompletionProposal.GetItemList: TStrings;
begin
Result := Form.ItemList;
end;
function TSynBaseCompletionProposal.GetInsertList: TStrings;
begin
Result := Form.InsertList;
end;
function TSynBaseCompletionProposal.GetOnCancel: TNotifyEvent;
begin
Result := Form.OnCancel;
end;
function TSynBaseCompletionProposal.GetOnKeyPress: TKeyPressEvent;
begin
Result := Form.OnKeyPress;
end;
function TSynBaseCompletionProposal.GetOnPaintItem: TSynBaseCompletionProposalPaintItem;
begin
Result := Form.OnPaintItem;
end;
function TSynBaseCompletionProposal.GetOnMeasureItem: TSynBaseCompletionProposalMeasureItem;
begin
Result := Form.OnMeasureItem;
end;
function TSynBaseCompletionProposal.GetOnValidate: TValidateEvent;
begin
Result := Form.OnValidate;
end;
function TSynBaseCompletionProposal.GetPosition: Integer;
begin
Result := Form.Position;
end;
procedure TSynBaseCompletionProposal.SetCurrentString(const Value: string);
begin
Form.CurrentString := Value;
end;
procedure TSynBaseCompletionProposal.SetItemList(const Value: TStrings);
begin
Form.ItemList := Value;
end;
procedure TSynBaseCompletionProposal.SetInsertList(const Value: TStrings);
begin
Form.InsertList := Value;
end;
procedure TSynBaseCompletionProposal.SetNbLinesInWindow(const Value: Integer);
begin
FNbLinesInWindow := Value;
end;
procedure TSynBaseCompletionProposal.SetOnCancel(const Value: TNotifyEvent);
begin
Form.OnCancel := Value;
end;
procedure TSynBaseCompletionProposal.SetOnKeyPress(const Value: TKeyPressEvent);
begin
Form.OnKeyPress := Value;
end;
procedure TSynBaseCompletionProposal.SetOnPaintItem(const Value:
TSynBaseCompletionProposalPaintItem);
begin
Form.OnPaintItem := Value;
end;
procedure TSynBaseCompletionProposal.SetOnMeasureItem(const Value:
TSynBaseCompletionProposalMeasureItem);
begin
Form.OnMeasureItem := Value;
end;
procedure TSynBaseCompletionProposal.SetPosition(const Value: Integer);
begin
form.Position := Value;
end;
procedure TSynBaseCompletionProposal.SetOnValidate(const Value: TValidateEvent);
begin
form.OnValidate := Value;
end;
function TSynBaseCompletionProposal.GetClSelect: TColor;
begin
Result := Form.ClSelect;
end;
procedure TSynBaseCompletionProposal.SetClSelect(const Value: TColor);
begin
Form.ClSelect := Value;
end;
procedure TSynBaseCompletionProposal.SetWidth(Value: Integer);
begin
FWidth := Value;
end;
procedure TSynBaseCompletionProposal.Activate;
begin
if Assigned(Form) then
Form.Activate;
end;
procedure TSynBaseCompletionProposal.Deactivate;
begin
if Assigned(Form) then
Form.Deactivate;
end;
procedure TSynBaseCompletionProposal.DefineProperties(Filer: TFiler);
begin
inherited;
end;
function TSynBaseCompletionProposal.GetClBack: TColor;
begin
Result := Form.ClBackground;
end;
procedure TSynBaseCompletionProposal.SetClBack(const Value: TColor);
begin
Form.ClBackground := Value
end;
function TSynBaseCompletionProposal.GetClSelectedText: TColor;
begin
Result := Form.ClSelectedText;
end;
procedure TSynBaseCompletionProposal.SetClSelectedText(const Value: TColor);
begin
Form.ClSelectedText := Value;
end;
procedure TSynBaseCompletionProposal.AddItem(ADisplayText, AInsertText: string);
begin
GetInsertList.Add(AInsertText);
GetItemList.Add(ADisplayText);
end;
procedure TSynBaseCompletionProposal.AddItemAt(Where: Integer; ADisplayText, AInsertText: string);
begin
try
GetInsertList.Insert(Where, AInsertText);
GetItemList.Insert(Where, ADisplayText);
except
raise Exception.Create('Cannot insert item at position ' + IntToStr(Where) + '.');
end;
end;
procedure TSynBaseCompletionProposal.ClearList;
begin
GetInsertList.Clear;
GetItemList.Clear;
end;
function TSynBaseCompletionProposal.DisplayItem(AIndex : Integer): string;
begin
Result := GetItemList[AIndex];
end;
function TSynBaseCompletionProposal.InsertItem(AIndex : Integer): string;
begin
Result := GetInsertList[AIndex];
end;
function TSynBaseCompletionProposal.IsWordBreakChar(AChar: WideChar): Boolean;
begin
Result := False;
if (scoConsiderWordBreakChars in Options) and Assigned(Form) and
Assigned(Form.CurrentEditor)
then
Result := Form.CurrentEditor.IsWordBreakChar(AChar);
Result := Result or (Pos(AChar, EndOfTokenChr) > 0);
end;
function TSynBaseCompletionProposal.GetDisplayKind: SynCompletionType;
begin
Result := Form.DisplayType;
end;
procedure TSynBaseCompletionProposal.SetDisplayKind(const Value: SynCompletionType);
begin
Form.DisplayType := Value;
end;
function TSynBaseCompletionProposal.GetParameterToken: TCompletionParameter;
begin
Result := Form.OnParameterToken;
end;
procedure TSynBaseCompletionProposal.SetParameterToken(
const Value: TCompletionParameter);
begin
Form.OnParameterToken := Value;
end;
procedure TSynBaseCompletionProposal.SetColumns(const Value: TProposalColumns);
begin
FForm.Columns := Value;
end;
function TSynBaseCompletionProposal.GetColumns: TProposalColumns;
begin
Result := FForm.Columns;
end;
function TSynBaseCompletionProposal.GetResizeable: Boolean;
begin
Result := FForm.Resizeable;
end;
procedure TSynBaseCompletionProposal.SetResizeable(const Value: Boolean);
begin
if FForm.Resizeable <> Value then
FForm.Resizeable := Value;
end;
function TSynBaseCompletionProposal.GetItemHeight: Integer;
begin
Result := FForm.ItemHeight;
end;
procedure TSynBaseCompletionProposal.SetItemHeight(const Value: Integer);
begin
if FForm.ItemHeight <> Value then
FForm.ItemHeight := Value;
end;
procedure TSynBaseCompletionProposal.SetImages(const Value: TCustomImageList);
begin
FForm.Images := Value;
end;
function TSynBaseCompletionProposal.GetImages: TCustomImageList;
begin
Result := FForm.Images;
end;
function TSynBaseCompletionProposal.GetMargin: Integer;
begin
Result := FForm.Margin;
end;
procedure TSynBaseCompletionProposal.SetMargin(const Value: Integer);
begin
if Value <> FForm.Margin then
FForm.Margin := Value;
end;
function TSynBaseCompletionProposal.GetDefaultKind: SynCompletionType;
begin
Result := Form.DefaultType;
end;
procedure TSynBaseCompletionProposal.SetDefaultKind(const Value: SynCompletionType);
begin
Form.DefaultType := Value;
Form.DisplayType := Value;
Form.RecreateWnd;
end;
procedure TSynBaseCompletionProposal.SetEndOfTokenChar(
const Value: string);
begin
if Form.FEndOfTokenChr <> Value then
begin
Form.FEndOfTokenChr := Value;
end;
end;
function TSynBaseCompletionProposal.GetClTitleBackground: TColor;
begin
Result := Form.ClTitleBackground;
end;
procedure TSynBaseCompletionProposal.SetClTitleBackground(
const Value: TColor);
begin
Form.ClTitleBackground := Value;
end;
function TSynBaseCompletionProposal.GetTitle: string;
begin
Result := Form.Title;
end;
procedure TSynBaseCompletionProposal.SetTitle(const Value: string);
begin
Form.Title := Value;
end;
function TSynBaseCompletionProposal.GetFont: TFont;
begin
Result := Form.Font;
end;
function TSynBaseCompletionProposal.GetTitleFont: TFont;
begin
Result := Form.TitleFont;
end;
procedure TSynBaseCompletionProposal.SetFont(const Value: TFont);
begin
Form.Font := Value;
end;
procedure TSynBaseCompletionProposal.SetTitleFont(const Value: TFont);
begin
Form.TitleFont := Value;
end;
function TSynBaseCompletionProposal.GetEndOfTokenChar: string;
begin
Result := Form.EndOfTokenChr;
end;
function TSynBaseCompletionProposal.GetOptions: TSynCompletionOptions;
begin
Result := fOptions;
end;
procedure TSynBaseCompletionProposal.SetOptions(
const Value: TSynCompletionOptions);
begin
if fOptions <> Value then
begin
fOptions := Value;
Form.CenterTitle := scoTitleIsCentered in Value;
Form.CaseSensitive := scoCaseSensitive in Value;
Form.UsePrettyText := scoUsePrettyText in Value;
Form.UseInsertList := scoUseInsertList in Value;
Form.MatchText := scoLimitToMatchedText in Value;
Form.CompleteWithTab := scoCompleteWithTab in Value;
Form.CompleteWithEnter := scoCompleteWithEnter in Value;
end;
end;
function TSynBaseCompletionProposal.GetTriggerChars: string;
begin
Result := Form.TriggerChars;
end;
procedure TSynBaseCompletionProposal.SetTriggerChars(const Value: string);
begin
Form.TriggerChars := Value;
end;
procedure TSynBaseCompletionProposal.EditorCancelMode(Sender: TObject);
begin
//Do nothing here, used in TSynCompletionProposal
end;
procedure TSynBaseCompletionProposal.HookedEditorCommand(Sender: TObject;
AfterProcessing: Boolean; var Handled: Boolean; var Command: TSynEditorCommand;
var AChar: WideChar; Data, HandlerData: Pointer);
begin
// Do nothing here, used in TSynCompletionProposal
end;
function TSynBaseCompletionProposal.GetOnChange: TCompletionChange;
begin
Result := Form.FOnChangePosition;
end;
function TSynBaseCompletionProposal.GetOnCodeItemInfo: TCodeItemInfo;
begin
Result := Form.FOnCodeItemInfo;
end;
procedure TSynBaseCompletionProposal.SetOnChange(
const Value: TCompletionChange);
begin
Form.FOnChangePosition := Value;
end;
procedure TSynBaseCompletionProposal.SetOnCodeItemInfo(
const Value: TCodeItemInfo);
begin
Form.FOnCodeItemInfo := Value;
end;
procedure TSynBaseCompletionProposal.ResetAssignedList;
begin
Form.AssignedList.Assign(ItemList);
end;
{ ---------------- TSynCompletionProposal -------------- }
procedure TSynCompletionProposal.HandleOnCancel(Sender: TObject);
var
F: TSynBaseCompletionProposalForm;
CurrentEditor : TCustomSynedit;
begin
F := Sender as TSynBaseCompletionProposalForm;
FNoNextKey := False;
CurrentEditor := F.CurrentEditor;
if CurrentEditor <> nil then
begin
if Assigned(FTimer) then
FTimer.Enabled := False;
F.Hide;
if ((CurrentEditor as TCustomSynEdit).Owner is TWinControl) and
(((CurrentEditor as TCustomSynEdit).Owner as TWinControl).Visible) then
begin
((CurrentEditor as TCustomSynEdit).Owner as TWinControl).SetFocus;
end;
if (CurrentEditor as TCustomSynEdit).CanFocus then //KV added line
(CurrentEditor as TCustomSynEdit).SetFocus;
if Assigned(OnCancelled) then
OnCancelled(Self);
end;
end;
procedure TSynCompletionProposal.HandleOnValidate(Sender: TObject;
Shift: TShiftState; EndToken: WideChar);
var
F: TSynBaseCompletionProposalForm;
Value: string;
Index: Integer;
begin
F := Sender as TSynBaseCompletionProposalForm;
if Assigned(F.CurrentEditor) then
with F.CurrentEditor as TCustomSynEdit do
begin
//Treat entire completion as a single undo operation
BeginUpdate;
BeginUndoBlock;
try
if FAdjustCompletionStart then
FCompletionStart := BufferCoord(FCompletionStart, CaretY).Char;
BlockBegin := BufferCoord(FCompletionStart, CaretY);
if EndToken = #0 then
BlockEnd := BufferCoord(WordEnd.Char, CaretY)
else
BlockEnd := BufferCoord(CaretX, CaretY);
if scoUseInsertList in FOptions then
begin
if scoLimitToMatchedText in FOptions then
begin
if (Form.FAssignedList.Count > Position) then
//GBN 15/01/2002 - Added check to make sure item is only used when no EndChar
if (InsertList.Count > Integer(Form.FAssignedList.Objects[position])) and
((scoEndCharCompletion in fOptions) or (EndToken = #0)) then
Value := InsertList[Integer(Form.FAssignedList.Objects[position])]
else
Value := SelText
else
Value := SelText;
end else
begin
//GBN 15/01/2002 - Added check to make sure item is only used when no EndChar
if (InsertList.Count > Position) and
((scoEndCharCompletion in FOptions) or (EndToken = #0)) then
Value := InsertList[position]
else
Value := SelText;
end;
end else
begin
//GBN 15/01/2002 - Added check to make sure item is only used when no EndChar
if (Form.FAssignedList.Count > Position) and
((scoEndCharCompletion in FOptions) or (EndToken = #0)) then
Value := Form.FAssignedList[Position]
else
Value := SelText;
end;
Index := Position; //GBN 15/11/2001, need to assign position to temp var since it changes later
//GBN 15/01/2002 - Cleaned this code up a bit
if Assigned(FOnCodeCompletion) then
FOnCodeCompletion(Self, Value, Shift,
F.LogicalToPhysicalIndex(Index), EndToken); //GBN 15/11/2001
if SelText <> Value then
SelText := Value;
with (F.CurrentEditor as TCustomSynEdit) do
begin
//GBN 25/02/2002
//This replaces the previous way of cancelling the completion by
//sending a WM_MOUSEDOWN message. The problem with the mouse down is
//that the editor would bounce back to the left margin, very irritating
InternalCancelCompletion;
if CanFocus then // KV added
SetFocus;
EnsureCursorPosVisible; //GBN 25/02/2002
CaretXY := BlockEnd;
BlockBegin := CaretXY;
end;
//GBN 15/11/2001
if Assigned(FOnAfterCodeCompletion) then
FOnAfterCodeCompletion(Self, Value, Shift,
F.LogicalToPhysicalIndex(Index), EndToken);
finally
EndUndoBlock;
EndUpdate;
end;
end;
end;
procedure TSynCompletionProposal.HandleOnKeyPress(Sender: TObject; var Key: WideChar);
var
F: TSynBaseCompletionProposalForm;
begin
F := Sender as TSynBaseCompletionProposalForm;
if F.CurrentEditor <> nil then
begin
with F.CurrentEditor as TCustomSynEdit do
CommandProcessor(ecChar, Key, nil);
//Daisy chain completions
Application.ProcessMessages;
if (System.Pos(Key, TriggerChars) > 0) and not F.Visible then
begin
if (Sender is TCustomSynEdit) then
DoExecute(Sender as TCustomSynEdit)
else
if Assigned(Form.CurrentEditor) then
DoExecute(Form.CurrentEditor as TCustomSynEdit);
end;
end;
end;
procedure TSynCompletionProposal.SetEditor(const Value: TCustomSynEdit);
begin
if Editor <> Value then
begin
if Assigned(Editor) then
RemoveEditor(Editor);
FEditor := Value;
if Assigned(Value) then
AddEditor(Value);
end;
end;
procedure TSynCompletionProposal.Notification(AComponent: TComponent;
Operation: TOperation);
begin
if (Operation = opRemove) then
begin
if Editor = AComponent then
Editor := nil
else if AComponent is TCustomSynEdit then
RemoveEditor(TCustomSynEdit(AComponent));
end;
inherited Notification(AComponent, Operation);
end;
constructor TSynCompletionProposal.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Form.OnKeyPress := HandleOnKeyPress;
Form.OnValidate := HandleOnValidate;
Form.OnCancel := HandleOnCancel;
Form.OnDblClick := HandleDblClick;
EndOfTokenChr := DefaultEndOfTokenChr;
TriggerChars := '.';
fTimerInterval:= 1000;
fNoNextKey := False;
fShortCut := Vcl.Menus.ShortCut(Ord(' '), [ssCtrl]);
Options := DefaultProposalOptions;
fEditors := TList.Create;
end;
procedure TSynCompletionProposal.SetShortCut(Value: TShortCut);
begin
FShortCut := Value;
end;
procedure TSynCompletionProposal.EditorKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
var
ShortCutKey: Word;
ShortCutShift: TShiftState;
begin
ShortCutToKey (fShortCut,ShortCutKey,ShortCutShift);
with Sender as TCustomSynEdit do
begin
if ((DefaultType <> ctCode) or not(ReadOnly)) and (Shift = ShortCutShift) and (Key = ShortCutKey) then
begin
Form.CurrentEditor := Sender as TCustomSynEdit;
Key := 0;
DoExecute(Sender as TCustomSynEdit);
end;
end;
end;
function TSynCompletionProposal.GetCurrentInput(AEditor: TCustomSynEdit): string;
var
s: string;
i: integer;
begin
Result := '';
if AEditor <> nil then
begin
s := AEditor.LineText;
i := AEditor.CaretX - 1;
if i <= Length(s) then
begin
FAdjustCompletionStart := False;
while (i > 0) and (s[i] > #32) and not Self.IsWordBreakChar(s[i]) do
dec(i);
FCompletionStart := i + 1;
Result := Copy(s, i + 1, AEditor.CaretX - i - 1);
end
else
FAdjustCompletionStart := True;
FCompletionStart := i + 1;
end;
end;
function TSynCompletionProposal.GetPreviousToken(AEditor: TCustomSynEdit): string;
var
Line: string;
X: Integer;
begin
Result := '';
if not Assigned(AEditor) then
exit;
Line := AEditor.Lines[AEditor.CaretXY.Line - 1];
X := AEditor.CaretXY.Char - 1;
if (X = 0) or (X > Length(Line)) or (Length(Line) = 0) then
exit;
if Self.IsWordBreakChar(Line[X]) then
dec(X);
while (X > 0) and not(Self.IsWordBreakChar(Line[X])) do
begin
Result := Line[X] + Result;
dec(x);
end;
end;
procedure TSynCompletionProposal.EditorKeyPress(Sender: TObject; var Key: WideChar);
begin
if fNoNextKey then
begin
FNoNextKey := False;
Key := #0;
end
else
if Assigned(FTimer) then
begin
DeactivateTimer;
if Pos(Key, TriggerChars) <> 0 then
ActivateTimer(Sender as TCustomSynEdit);
// else
// DeactivateTimer;
end;
end;
procedure TSynCompletionProposal.ActivateTimer(ACurrentEditor: TCustomSynEdit);
begin
if Assigned(FTimer) then
begin
Form.CurrentEditor := ACurrentEditor;
FTimer.Enabled := True;
end;
end;
procedure TSynCompletionProposal.DeactivateTimer;
begin
if Assigned(FTimer) then
begin
FTimer.Enabled := False;
end;
end;
procedure TSynCompletionProposal.HandleDblClick(Sender: TObject);
begin
HandleOnValidate(Sender, [], #0);
end;
destructor TSynCompletionProposal.Destroy;
begin
if Form.Visible then
CancelCompletion;
Editor := nil;
while fEditors.Count <> 0 do
RemoveEditor(TCustomSynEdit(FEditors.Last));
inherited;
fEditors.Free;
end;
procedure TSynCompletionProposal.TimerExecute(Sender: TObject);
begin
if not Assigned(FTimer) then exit;
FTimer.Enabled := False; //GBN 13/11/2001
if Application.Active then
begin
DoExecute(Form.CurrentEditor as TCustomSynEdit);
FNoNextKey := False;
end else if Form.Visible then begin
Form.Hide;
Form.PopupParent := nil;
end;
end;
function TSynCompletionProposal.GetTimerInterval: Integer;
begin
Result := FTimerInterval;
end;
procedure TSynCompletionProposal.SetTimerInterval(const Value: Integer);
begin
FTimerInterval := Value;
if Assigned(FTimer) then
FTimer.Interval := Value;
end;
procedure TSynCompletionProposal.SetOptions(const Value: TSynCompletionOptions);
begin
inherited;
if scoUseBuiltInTimer in Value then
begin
if not(Assigned(FTimer)) then
begin
FTimer := TTimer.Create(Self);
FTimer.Enabled := False;
FTimer.Interval := FTimerInterval;
FTimer.OnTimer := TimerExecute;
end;
end else begin
if Assigned(FTimer) then
begin
FreeAndNil(FTimer);
end;
end;
end;
procedure TSynCompletionProposal.ExecuteEx(s: string; x, y: integer;
Kind: SynCompletionType);
begin
inherited;
if Assigned(FTimer) then
FTimer.Enabled := False;
end;
procedure TSynCompletionProposal.AddEditor(AEditor: TCustomSynEdit);
var
i : integer;
begin
i := fEditors.IndexOf(AEditor);
if i = -1 then begin
AEditor.FreeNotification(Self);
fEditors.Add(AEditor);
AEditor.AddKeyDownHandler(EditorKeyDown);
AEditor.AddKeyPressHandler(EditorKeyPress);
AEditor.RegisterCommandHandler(HookedEditorCommand, Self);
end;
end;
function TSynCompletionProposal.EditorsCount: integer;
begin
result := fEditors.count;
end;
function TSynCompletionProposal.GetEditor(i: integer): TCustomSynEdit;
begin
if (i < 0) or (i >= EditorsCount) then
Result := nil
else
Result := fEditors[i];
end;
function TSynCompletionProposal.RemoveEditor(AEditor: TCustomSynEdit): boolean;
var
i: integer;
begin
i := fEditors.Remove(AEditor);
result := i <> -1;
if result then begin
if Form.CurrentEditor = AEditor then
begin
if Form.Visible then
CancelCompletion;
Form.CurrentEditor := nil;
end;
AEditor.RemoveKeyDownHandler(EditorKeyDown);
AEditor.RemoveKeyPressHandler(EditorKeyPress);
AEditor.UnregisterCommandHandler(HookedEditorCommand);
RemoveFreeNotification( AEditor );
if fEditor = AEditor then
fEditor := nil;
end;
end;
procedure TSynCompletionProposal.DoExecute(AEditor: TCustomSynEdit);
var
p: TPoint;
i: integer;
begin
i := FEditors.IndexOf(AEditor);
if i <> -1 then
with AEditor do
begin
if (DefaultType <> ctCode) or not ReadOnly then
begin
if DefaultType = ctHint then
GetCursorPos(P)
else
begin
p := ClientToScreen(RowColumnToPixels(DisplayXY));
Inc(p.y, LineHeight);
end;
Form.CurrentEditor := AEditor;
FPreviousToken := GetPreviousToken(Form.CurrentEditor as TCustomSynEdit);
ExecuteEx(GetCurrentInput(AEditor), p.x, p.y, DefaultType);
FNoNextKey := (DefaultType = ctCode) and FCanExecute and Form.Visible;
end;
end;
end;
procedure TSynCompletionProposal.InternalCancelCompletion;
begin
if Assigned(FTimer) then FTimer.Enabled := False;
FNoNextKey := False;
if (Form.Visible) then
begin
Deactivate;
Form.Hide;
Form.PopupParent := nil;
end;
end;
procedure TSynCompletionProposal.CancelCompletion;
begin
InternalCancelCompletion;
if Assigned(OnCancelled) then OnCancelled(Self);
end;
procedure TSynCompletionProposal.EditorCancelMode(Sender: TObject);
begin
if (DisplayType = ctParams) then CancelCompletion;
end;
procedure TSynCompletionProposal.HookedEditorCommand(Sender: TObject;
AfterProcessing: Boolean; var Handled: Boolean; var Command: TSynEditorCommand;
var AChar: WideChar; Data, HandlerData: Pointer);
begin
inherited;
if AfterProcessing and Form.Visible then
begin
case DisplayType of
ctCode:
begin
end;
ctHint:
begin
CancelCompletion
end;
ctParams:
begin
case Command of
// KV So that param completion is not hidden when you display code completion
// ecGotFocus, ecLostFocus:
// CancelCompletion;
ecLineBreak:
DoExecute(Sender as TCustomSynEdit);
ecChar:
begin
case AChar of
#27:
CancelCompletion;
#32..'z':
with Form do
begin
{ if Pos(AChar, FTriggerChars) > 0 then
begin
if Assigned(FParameterToken) then
begin
TmpIndex := CurrentIndex;
TmpLevel := CurrentLevel;
TmpStr := CurrentString;
OnParameterToken(Self, CurrentIndex, TmpLevel, TmpIndex, AChar, TmpStr);
CurrentIndex := TmpIndex;
CurrentLevel := TmpLevel;
CurrentString := TmpStr;
end;
end;}
DoExecute(Sender as TCustomSynEdit);
end;
else DoExecute(Sender as TCustomSynEdit);
end;
end;
else DoExecute(Sender as TCustomSynEdit);
end;
end;
end;
end else
if (not Form.Visible) and Assigned(FTimer) then
begin
if (Command = ecChar) then
if (Pos(AChar, TriggerChars) = 0) then
FTimer.Enabled := False
else
else
FTimer.Enabled := False;
end;
end;
procedure TSynCompletionProposal.ActivateCompletion;
begin
DoExecute(Editor);
fNoNextKey := False; // Synedit bug report 1496151
end;
{ TSynAutoComplete }
constructor TSynAutoComplete.Create(AOwner: TComponent);
begin
inherited;
FDoLookup := True;
CreateInternalCompletion;
FEndOfTokenChr := DefaultEndOfTokenChr;
fAutoCompleteList := TStringList.Create;
fNoNextKey := false;
fShortCut := Vcl.Menus.ShortCut(Ord(' '), [ssShift]);
end;
procedure TSynAutoComplete.SetShortCut(Value: TShortCut);
begin
FShortCut := Value;
end;
destructor TSynAutoComplete.Destroy;
begin
Editor := nil;
if Assigned(FInternalCompletion) then
begin
FInternalCompletion.Free;
FInternalCompletion := nil;
end;
inherited;
fAutoCompleteList.free;
end;
procedure TSynAutoComplete.EditorKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
ShortCutKey: Word;
ShortCutShift: TShiftState;
begin
ShortCutToKey (fShortCut,ShortCutKey,ShortCutShift);
if not (Sender as TCustomSynEdit).ReadOnly and
(Shift = ShortCutShift) and (Key = ShortCutKey) then
begin
Execute(GetPreviousToken(Sender as TCustomSynEdit), Sender as TCustomSynEdit);
fNoNextKey := True;
Key := 0;
end;
end;
procedure TSynAutoComplete.EditorKeyPress(Sender: TObject; var Key: WideChar);
begin
if fNoNextKey then
begin
fNoNextKey := False;
Key := #0;
end;
end;
procedure TSynAutoComplete.Execute(Token: string; Editor: TCustomSynEdit);
begin
ExecuteEx(Token, Editor, FDoLookup);
end;
procedure TSynAutoComplete.ExecuteEx(Token: string; Editor: TCustomSynEdit;
LookupIfNotExact: Boolean);
var
Temp: string;
i, j: integer;
StartOfBlock: TBufferCoord;
ChangedIndent: Boolean;
ChangedTrailing: Boolean;
TmpOptions: TSynEditorOptions;
OrigOptions: TSynEditorOptions;
BeginningSpaceCount : Integer;
Spacing: string;
begin
if Assigned(OnBeforeExecute) then OnBeforeExecute(Self);
try
i := AutoCompleteList.IndexOf(Token);
if (Length(Token) > 0) and (i <> -1) then
begin
Editor.Lines.BeginUpdate;
try
TmpOptions := Editor.Options;
OrigOptions := Editor.Options;
ChangedIndent := eoAutoIndent in TmpOptions;
ChangedTrailing := eoTrimTrailingSpaces in TmpOptions;
if ChangedIndent then Exclude(TmpOptions, eoAutoIndent);
if ChangedTrailing then Exclude(TmpOptions, eoTrimTrailingSpaces);
if ChangedIndent or ChangedTrailing then
Editor.Options := TmpOptions;
Editor.UndoList.AddChange(crAutoCompleteBegin, StartOfBlock, StartOfBlock, '',
smNormal);
fNoNextKey := True;
for j := 1 to Length(Token) do
Editor.CommandProcessor(ecDeleteLastChar, ' ', nil);
BeginningSpaceCount := Editor.DisplayX - 1;
if not(eoTabsToSpaces in Editor.Options) and
(BeginningSpaceCount >= Editor.TabWidth)
then
Spacing := StringofChar(#9, BeginningSpaceCount div Editor.TabWidth)
+ StringofChar(' ', BeginningSpaceCount mod Editor.TabWidth)
else
Spacing := StringofChar(' ', BeginningSpaceCount);
inc(i);
if (i < AutoCompleteList.Count) and
(Length(AutoCompleteList[i]) > 0) and
(AutoCompleteList[i][1] = '|') then
begin
inc(i);
end;
StartOfBlock.Char := -1;
StartOfBlock.Line := -1;
while (i < AutoCompleteList.Count) and
(length(AutoCompleteList[i]) > 0) and
(AutoCompleteList[i][1] = '=') do
begin
{ for j := 0 to PrevSpace - 1 do
Editor.CommandProcessor(ecDeleteLastChar, ' ', nil);}
Temp := AutoCompleteList[i];
for j := 2 to Length(Temp) do begin
if (Temp[j] = #9) then
Editor.CommandProcessor(ecTab, Temp[j], nil)
else
Editor.CommandProcessor(ecChar, Temp[j], nil);
if (Temp[j] = '|') then
StartOfBlock := Editor.CaretXY
end;
inc(i);
if (i < AutoCompleteList.Count) and
(length(AutoCompleteList[i]) > 0) and
(AutoCompleteList[i][1] = '=') then
begin
Editor.CommandProcessor (ecLineBreak,' ',nil);
for j := 1 to length(Spacing) do
if (Spacing[j] = #9) then
Editor.CommandProcessor(ecTab, #9, nil)
else
Editor.CommandProcessor (ecChar, ' ', nil);
end;
end;
if (StartOfBlock.Char <> -1) and (StartOfBlock.Line <> -1) then begin
Editor.CaretXY := StartOfBlock;
Editor.CommandProcessor(ecDeleteLastChar, ' ', nil);
end;
if ChangedIndent or ChangedTrailing then Editor.Options := OrigOptions;
Editor.UndoList.AddChange(crAutoCompleteEnd, StartOfBlock, StartOfBlock,
'', smNormal);
fNoNextKey := False;
finally
Editor.Lines.EndUpdate;
end;
end
else if LookupIfNotExact and Assigned(FInternalCompletion) then
begin
FInternalCompletion.AddEditor(Editor);
FInternalCompletion.ClearList;
for i := 0 to AutoCompleteList.Count - 1 do
if (Length(AutoCompleteList[i]) > 0) and (AutoCompleteList[i][1] <> '=') and (AutoCompleteList[i][1] <> '|') then
begin
if (i + 1 < AutoCompleteList.Count) and (length(AutoCompleteList[i + 1]) > 0) and
(AutoCompleteList[i + 1][1] = '|') then
begin
Temp := _(AutoCompleteList[i + 1]);
Delete(Temp, 1, 1);
end
else
Temp := AutoCompleteList[i];
Temp := '\style{+B}' + AutoCompleteList[i] + '\style{-B}\column{}' + Temp;
FInternalCompletion.ItemList.Add(Temp);
FInternalCompletion.InsertList.Add(AutoCompleteList[i]);
end;
FInternalCompletion.DoExecute(Editor);
end;
finally
if Assigned(OnAfterExecute) then OnAfterExecute(Self);
end;
end;
procedure TSynAutoComplete.DoInternalAutoCompletion(Sender: TObject;
const Value: string; Shift: TShiftState; Index: Integer; EndToken: WideChar);
begin
ExecuteEx(GetPreviousToken(Editor), Editor, False);
FInternalCompletion.Editor := nil;
end;
function TSynAutoComplete.GetPreviousToken(Editor: TCustomSynEdit): string;
var
s: string;
i: Integer;
begin
Result := '';
if Editor <> nil then
begin
s := Editor.LineText;
i := Editor.CaretX - 1;
if i <= Length (s) then
begin
while (i > 0) and (s[i] > ' ') and (Pos(s[i], FEndOfTokenChr) = 0) do
Dec(i);
Result := copy(s, i + 1, Editor.CaretX - i - 1);
end;
end
end;
procedure TSynAutoComplete.Notification(AComponent: TComponent; Operation: TOperation);
begin
if (Operation = opRemove) and (Editor = AComponent) then
Editor := nil;
inherited Notification(AComponent, Operation);
end;
procedure TSynAutoComplete.SetAutoCompleteList(List: TStrings);
begin
fAutoCompleteList.Assign(List);
end;
procedure TSynAutoComplete.SetEditor(const Value: TCustomSynEdit);
begin
if Editor <> Value then
begin
if Editor <> nil then
begin
Editor.RemoveKeyDownHandler( EditorKeyDown );
Editor.RemoveKeyPressHandler( EditorKeyPress );
RemoveFreeNotification( Editor );
end;
fEditor := Value;
if Editor <> nil then
begin
Editor.AddKeyDownHandler( EditorKeyDown );
Editor.AddKeyPressHandler( EditorKeyPress );
FreeNotification( Editor );
end;
end;
end;
function TSynAutoComplete.GetTokenList: string;
var
List: TStringList;
i: integer;
begin
Result := '';
if AutoCompleteList.Count < 1 then Exit;
List := TStringList.Create;
i := 0;
while (i < AutoCompleteList.Count) do begin
if (length(AutoCompleteList[i]) > 0) and (AutoCompleteList[i][1] <> '=') then
List.Add(Trim(AutoCompleteList[i]));
inc(i);
end;
Result := List.Text;
List.Free;
end;
function TSynAutoComplete.GetTokenValue(Token: string): string;
var
i: integer;
List: TStringList;
begin
Result := '';
i := AutoCompleteList.IndexOf(Token);
if i <> -1 then
begin
List := TStringList.Create;
Inc(i);
while (i < AutoCompleteList.Count) and
(length(AutoCompleteList[i]) > 0) and
(AutoCompleteList[i][1] = '=') do begin
if Length(AutoCompleteList[i]) = 1 then
List.Add('')
else
List.Add(Copy(AutoCompleteList[i], 2, Length(AutoCompleteList[i])));
inc(i);
end;
Result := List.Text;
List.Free;
end;
end;
procedure TSynAutoComplete.SetDoLookup(const Value: Boolean);
begin
FDoLookup := Value;
if FDoLookup and not Assigned(FInternalCompletion) then
CreateInternalCompletion
else if not FDoLookup and Assigned(FInternalCompletion) then begin
FInternalCompletion.Free;
FInternalCompletion := nil;
end;
end;
procedure TSynAutoComplete.CreateInternalCompletion;
begin
FInternalCompletion := TSynCompletionProposal.Create(Self);
FInternalCompletion.Options := DefaultProposalOptions + [scoUsePrettyText] - [scoUseBuiltInTimer];
FInternalCompletion.EndOfTokenChr := FEndOfTokenChr;
FInternalCompletion.ShortCut := 0;
FInternalCompletion.OnAfterCodeCompletion := DoInternalAutoCompletion;
FInternalCompletion.Columns.Add;
FInternalCompletion.Width := 350;
end;
function TSynAutoComplete.GetOptions: TSynCompletionOptions;
begin
Result := FOptions;
end;
procedure TSynAutoComplete.SetOptions(const Value: TSynCompletionOptions);
begin
FOptions := Value;
if Assigned(FInternalCompletion) then
FInternalCompletion.Options := FOptions + [scoUsePrettyText] - [scoUseBuiltInTimer];
end;
procedure TSynAutoComplete.CancelCompletion;
begin
if Assigned(FInternalCompletion) then
FInternalCompletion.CancelCompletion;
end;
function TSynAutoComplete.GetCompletionProposal: TSynCompletionProposal;
begin
Result := FInternalCompletion;
end;
function TSynAutoComplete.GetExecuting: Boolean;
begin
if Assigned(FInternalCompletion) then
Result := FInternalCompletion.Form.Visible
else Result := False;
end;
end.
| 30.581143 | 146 | 0.672983 |
fc3708748bcea53d25ac04e4778ceba724f9d029 | 2,203 | pas | Pascal | delphi/0136.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 11 | 2015-12-12T05:13:15.000Z | 2020-10-14T13:32:08.000Z | delphi/0136.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| null | null | null | delphi/0136.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 8 | 2017-05-05T05:24:01.000Z | 2021-07-03T20:30:09.000Z | (*
> David Swaddle <100657.155@CompuServe.COM> wrote:
>
> >Can anyone suggest a method of running an MS DOS applications
> >(yuck) from within Delphi 2 where the program can be forced to
> >wait for the DOS process to finish before resuming??
>
> >I know that this sounds like an odd request, but I have a legacy
> >EXE file without the source and it runs a vital part of a system
> >that I'm writing. Previously I used the TExecFile component, but
> >I don't have the source for this. I have tried using the
> >ShellExecute API call and this works fine, except that I can't
> >find a way of waiting to see if the new process has terminated.
>
> >I'm not very au fait with the Win32 API yet, so any help
> >appreciated.
> This works in 1.0 and should work in 2.0
> var
> AppHandle : THandle;
>
> begin
> AppHandle := ShellExecute(Application.MainForm.Handlle, 'OPEN',
> EXEName, Params, 'C:\PROGRAMS', SW_SHOWNORMAL);
>
> if AppHandle <= 32 then { Error Running Program}
> raise Exception.Create('There was a problem Running the App');
>
> while (GetModuleUsage(AppHandle) = 0) do
> Application.ProcessMessages;
> end;
>
> Brad Huggins
That code will not work in Delphi 2.0 because the GetModuleUsage function
doesn't exist under Win32. You can get this behavior, however, using the
Win32 CreateProcess function. Here is a function I use to wait for another
program to finish execution:
*)
function CreateProcessAndWait(const AppPath, AppParams: String;
Visibility: word): DWord;
var
SI: TStartupInfo;
PI: TProcessInformation;
Proc: THandle;
begin
FillChar(SI, SizeOf(SI), 0);
SI.cb := SizeOf(SI);
SI.wShowWindow := Visibility;
if not CreateProcess(PChar(AppPath), PChar(AppParams), Nil, Nil, False,
Normal_Priority_Class, Nil, Nil, SI, PI) then
raise Exception.CreateFmt('Failed to execute program. Error Code %d',
[GetLastError]);
Proc := PI.hProcess;
CloseHandle(PI.hThread);
if WaitForSingleObject(Proc, Infinite) <> Wait_Failed then
GetExitCodeProcess(Proc, Result);
CloseHandle(Proc);
end;
| 35.532258 | 76 | 0.679074 |
6a367a9275f0c1d96ecc61a1fa154cec9a60c600 | 329 | dpr | Pascal | MAF_Tutorials/Tutorial_6/Modules/TestModule2/TestModule2.dpr | HelgeLange/MAF | 405f34c132fa5c391ee2c3a056bacc0de0aa721f | [
"Apache-2.0"
]
| 4 | 2018-06-20T08:41:00.000Z | 2018-11-01T19:47:41.000Z | MAF_Tutorials/Tutorial_7/Modules/TestModule2/TestModule2.dpr | AdriaanBoshoff/MAF | 405f34c132fa5c391ee2c3a056bacc0de0aa721f | [
"Apache-2.0"
]
| null | null | null | MAF_Tutorials/Tutorial_7/Modules/TestModule2/TestModule2.dpr | AdriaanBoshoff/MAF | 405f34c132fa5c391ee2c3a056bacc0de0aa721f | [
"Apache-2.0"
]
| 2 | 2018-06-20T13:46:12.000Z | 2019-08-26T00:29:03.000Z | library TestModule2;
uses
SysUtils,
Classes,
uModuleService in '..\..\..\..\uModuleService.pas',
dmTestModule2 in 'dmTestModule2.pas' {dmTM2: TDataModule},
frmTestForm1 in 'frmTestForm1.pas' {fTestForm1},
frmPageControl2 in 'frmPageControl2.pas' {fPageControl2};
{$R *.res}
begin
__RegisterDMClass(TdmTM2);
end.
| 20.5625 | 60 | 0.726444 |
f11004dbc623d9c2bb051c835859770c7be24d4b | 2,211 | pas | Pascal | samples/persons-no-aspects/Person.Repository.pas | ezequieljuliano/Security4Delphi | 8e294a05b3f1b0d84f2236ddbac692d11a37a907 | [
"Apache-2.0"
]
| 41 | 2016-02-10T16:35:37.000Z | 2022-03-29T20:30:56.000Z | samples/persons-no-aspects/Person.Repository.pas | ezequieljuliano/Security4Delphi | 8e294a05b3f1b0d84f2236ddbac692d11a37a907 | [
"Apache-2.0"
]
| null | null | null | samples/persons-no-aspects/Person.Repository.pas | ezequieljuliano/Security4Delphi | 8e294a05b3f1b0d84f2236ddbac692d11a37a907 | [
"Apache-2.0"
]
| 12 | 2017-03-30T19:16:30.000Z | 2022-02-17T07:25:40.000Z | unit Person.Repository;
interface
uses
Person,
Security.Core,
App.Context;
type
TPersonRepository = class
private
{ private declarations }
protected
{ protected declarations }
public
function Insert(person: TPerson): TPerson; virtual;
function Update(person: TPerson): TPerson; virtual;
function Delete(personId: Integer): Boolean; virtual;
function FindById(personId: Integer): TPerson; virtual;
end;
implementation
{ TPersonRepository }
function TPersonRepository.Delete(personId: Integer): Boolean;
begin
if not SecurityContext.HasAnyRole(['ROLE_ADMIN', 'ROLE_MANAGER']) then
raise EAuthorizationException.Create('You do not have role to access this feature.');
if not SecurityContext.HasAuthority('PERSON_DELETE') then
raise EAuthorizationException.Create('You do not have permission to access this feature.');
Result := True;
end;
function TPersonRepository.FindById(personId: Integer): TPerson;
begin
if not SecurityContext.HasAnyRole(['ROLE_ADMIN', 'ROLE_MANAGER', 'ROLE_GUEST']) then
raise EAuthorizationException.Create('You do not have role to access this feature.');
if not SecurityContext.HasAuthority('PERSON_VIEW') then
raise EAuthorizationException.Create('You do not have permission to access this feature.');
Result := TPerson.Create(personId, 'Ezequiel', 31);
end;
function TPersonRepository.Insert(person: TPerson): TPerson;
begin
if not SecurityContext.HasAnyRole(['ROLE_ADMIN']) then
raise EAuthorizationException.Create('You do not have role to access this feature.');
if not SecurityContext.HasAuthority('PERSON_INSERT') then
raise EAuthorizationException.Create('You do not have permission to access this feature.');
person.Id := Random(1000);
Result := person;
end;
function TPersonRepository.Update(person: TPerson): TPerson;
begin
if not SecurityContext.HasAnyRole(['ROLE_ADMIN', 'ROLE_MANAGER']) then
raise EAuthorizationException.Create('You do not have role to access this feature.');
if not SecurityContext.HasAuthority('PERSON_UPDATE') then
raise EAuthorizationException.Create('You do not have permission to access this feature.');
Result := person;
end;
end.
| 29.48 | 95 | 0.759385 |
47d18492ba363ca8ee0fd822366e0a2f4b232b41 | 565 | pas | Pascal | graphics/0055.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 11 | 2015-12-12T05:13:15.000Z | 2020-10-14T13:32:08.000Z | graphics/0055.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| null | null | null | graphics/0055.pas | nickelsworth/swag | 7c21c0da2291fc249b9dc5cfe121a7672a4ffc08 | [
"BSD-2-Clause"
]
| 8 | 2017-05-05T05:24:01.000Z | 2021-07-03T20:30:09.000Z | {
> does anyone know how to scroll up or down in 320*200*256 mode ??
Enter mode-x (look for source on any board, quite common), and
then pan the screen like this:
}
Asm
mov bx,StartMem
mov ah,bh
mov al,0ch
mov dx,3d4h
out dx,ax
mov ah,bl
inc al
out dx,ax
End;
{
To begin, zero StartMem and then increase it with 80 each time -
tada - the screen pans down. Oh, btw, If I were you I would call
a sync just before running it...
} | 25.681818 | 70 | 0.545133 |
Subsets and Splits
HTML Code Excluding Scripts
The query retrieves a limited set of HTML content entries that are longer than 8 characters and do not contain script tags, offering only basic filtering with minimal analytical value.