|
PHP Obfuscator
C# Obfuscator
Perl Obfuscator
Java Obfuscator
Javascript Obfuscator
JSP Obfuscator
Actionscript Obfuscator
C/C++ Formatter
Perl Formatter
Pascal/Delphi Formatter
C# Formatter
CSS Formatter
CMAC Formatter
Java Formatter
Javascript Formatter
PHP Formatter
JSP Formatter
HTML/XML Formatter
Python Formatter
ASP Formatter
Visual Basic Formatter
Actionscript Formatter
|
Step 1: Unformatted Delphi/Pascal Source
Overall Delphi/Pascal Features
Step 1: Unformatted Source
Step 2: Example Source
Step 3: Formatted Source
Let's start with a real life source file:
procedure TdBDialog.HandleEvent(var Event: TEvent);
var
Chg : boolean;
Rfrsh : boolean;
MLine : TPoint;
Q,
R : TRect;
L : integer;
W : word;
P : Pointer;
begin
if Event.What = evKeyDown then
begin
case Event.KeyCode of
kbPgUp,
kbPgDn : begin
if Event.KeyCode = kbPgUp then W := cmPageUp
else W := cmPageDn;
ClearEvent(Event);
P := Message(Owner,evCommand,W,@Self);
exit;
end;
kbAltE : begin end;
kbEnter : if Current^.HelpCtx = hcDataField then
Event.KeyCode := kbTab;
kbDown : Event.KeyCode := kbTab;
kbUp : Event.KeyCode := kbShiftTab;
else begin
TDialog.HandleEvent(Event);
exit;
end;
end;
if Current^.Valid(1) then TDialog.HandleEvent(Event)
else
ClearEvent(Event);
exit;
end;
if Event.What = evMouseDown then
begin
dbCancel^.GetBounds(Q);
Current^.GetBounds(R);
MakeLocal(Event.Where,MLine);
Chg := R.has(MLine);
if not Chg then Chg := Q.has(MLine);
if not Chg then Chg := (MLine.X = 3) and (Mline.Y = 0);
if Chg then TDialog.HandleEvent(Event)
else
if Current^.Valid(1) then TDialog.HandleEvent(Event)
else
ClearEvent(Event);
exit;
end;
if Event.What = evCommand then
begin
case Event.Command of
cmPageUp,
cmPageDn : begin
Chg := true;
if (Current^.HelpCtx = hcDataField) then
Chg := Current^.Valid(1);
if Chg then
begin
L := FirstField;
if Event.Command = cmPageUp then
FirstField := FirstField-(FldsOnScrn-1)
else
FirstField := FirstField+(FldsOnScrn-1);
if FirstField < 1 then FirstField := 1
else
if FirstField > FldsInFile-(FldsOnScrn-1) then
FirstField := FldsInFile-(FldsOnScrn-1);
if FirstField <> L then
begin
SaveDialog(0,true);
ShowDialog(true);
end;
FirstItem^.Select;
end;
ClearEvent(Event);
exit;
end;
cmNextRec,
cmPrevRec : begin
Chg := true;
if (Current^.HelpCtx = hcDataField) then
Chg := Current^.Valid(1);
if Chg then
begin
Rfrsh := FirstField <> 1;
FirstField := 1;
SaveDialog(1,Rfrsh);
if Event.Command = cmNextRec then
Skip(1)
else Skip(-1);
ShowDialog(Rfrsh);
FirstItem^.Select;
end;
ClearEvent(Event);
exit;
end;
end;
end;
TDialog.HandleEvent(Event)
end;
Next, in Step 2 we'll look at our example source which defines our style.
|
|