aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-26 21:38:59 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-26 21:38:59 +0000
commit65a64b2404ae4e7c4c5e75724e25a1189c29c3ad (patch)
tree74f7db5dcce5cba273c764c70ed7ce7785fee4b0 /src
parentd73dd340314b2d23ac569ffa1a66532beba1b74f (diff)
downloadusdx-65a64b2404ae4e7c4c5e75724e25a1189c29c3ad.tar.gz
usdx-65a64b2404ae4e7c4c5e75724e25a1189c29c3ad.tar.xz
usdx-65a64b2404ae4e7c4c5e75724e25a1189c29c3ad.zip
replace integer by enumeration type alignment
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1526 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/base/UEditorLyrics.pas44
-rw-r--r--src/screens/UScreenEditSub.pas4
2 files changed, 25 insertions, 23 deletions
diff --git a/src/base/UEditorLyrics.pas b/src/base/UEditorLyrics.pas
index 0b16110f..485fabe8 100644
--- a/src/base/UEditorLyrics.pas
+++ b/src/base/UEditorLyrics.pas
@@ -40,23 +40,25 @@ uses
UTexture;
type
+ alignment = (left, center, right);
+
TWord = record
- X: real;
- Y: real;
- Size: real;
- Width: real;
- Text: string;
- ColR: real;
- ColG: real;
- ColB: real;
- FontStyle: integer;
- Italic: boolean;
- Selected: boolean;
+ X: real;
+ Y: real;
+ Size: real;
+ Width: real;
+ Text: string;
+ ColR: real;
+ ColG: real;
+ ColB: real;
+ FontStyle: integer;
+ Italic: boolean;
+ Selected: boolean;
end;
TEditorLyrics = class
private
- AlignI: integer;
+ AlignI: alignment;
XR: real;
YR: real;
SizeR: real;
@@ -67,7 +69,7 @@ type
procedure SetX(Value: real);
procedure SetY(Value: real);
function GetClientX: real;
- procedure SetAlign(Value: integer);
+ procedure SetAlign(Value: alignment);
function GetSize: real;
procedure SetSize(Value: real);
procedure SetSelected(Value: integer);
@@ -94,7 +96,7 @@ type
property X: real write SetX;
property Y: real write SetY;
property ClientX: real read GetClientX;
- property Align: integer write SetAlign;
+ property Align: alignment write SetAlign;
property Size: real read GetSize write SetSize;
property Selected: integer read SelectedI write SetSelected;
property FontStyle: integer write SetFontStyle;
@@ -103,10 +105,10 @@ type
implementation
uses
- TextGL,
- UGraphic,
- UDrawTexture,
- Math,
+ TextGL,
+ UGraphic,
+ UDrawTexture,
+ Math,
USkins;
constructor TEditorLyrics.Create;
@@ -135,7 +137,7 @@ begin
Result := Word[0].X;
end;
-procedure TEditorLyrics.SetAlign(Value: integer);
+procedure TEditorLyrics.SetAlign(Value: alignment);
begin
AlignI := Value;
end;
@@ -183,7 +185,7 @@ var
begin
WordNum := Length(Word);
SetLength(Word, WordNum + 1);
- if WordNum = 0 then
+ if WordNum = 0 then
Word[WordNum].X := XR
else
Word[WordNum].X := Word[WordNum - 1].X + Word[WordNum - 1].Width;
@@ -227,7 +229,7 @@ var
W: integer;
TotWidth: real;
begin
- if AlignI = 1 then
+ if AlignI = center then
begin
TotWidth := 0;
for W := 0 to High(Word) do
diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas
index 949dffae..873d7185 100644
--- a/src/screens/UScreenEditSub.pas
+++ b/src/screens/UScreenEditSub.pas
@@ -530,7 +530,7 @@ begin
end;
// ctrl + left
- if SDL_ModState = KMOD_LCTRL the
+ if SDL_ModState = KMOD_LCTRL then
begin
Dec(Lines[0].Line[Lines[0].Current].Note[CurrentNote].Start);
Inc(Lines[0].Line[Lines[0].Current].Note[CurrentNote].Length);
@@ -1270,7 +1270,7 @@ begin
Lyric.Clear;
Lyric.X := 400;
Lyric.Y := 500;
- Lyric.Align := 1;
+ Lyric.Align := center;
Lyric.Size := 42;
Lyric.ColR := 0;
Lyric.ColG := 0;