aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 20:39:22 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2016-01-03 20:39:22 +0000
commitf40cc42f14bd6bfbe9a23eabe6cf6517c6835e4e (patch)
tree92e3ee3eeda44a70fef09a6703378cde30dec08f /src
parent8345e50a415417f377482d7f7d13d734beeaafd2 (diff)
downloadusdx-f40cc42f14bd6bfbe9a23eabe6cf6517c6835e4e.tar.gz
usdx-f40cc42f14bd6bfbe9a23eabe6cf6517c6835e4e.tar.xz
usdx-f40cc42f14bd6bfbe9a23eabe6cf6517c6835e4e.zip
enable writable
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3183 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/base/UThemes.pas8
-rw-r--r--src/menu/UMenu.pas18
-rw-r--r--src/menu/UMenuText.pas23
3 files changed, 22 insertions, 27 deletions
diff --git a/src/base/UThemes.pas b/src/base/UThemes.pas
index 283c148d..6584590a 100644
--- a/src/base/UThemes.pas
+++ b/src/base/UThemes.pas
@@ -79,6 +79,13 @@ const
type
+ TThemePosition = record
+ X: integer;
+ Y: integer;
+ H: integer;
+ W: integer;
+ end;
+
TThemeStatic = record
X: integer;
Y: integer;
@@ -118,6 +125,7 @@ type
Size: integer;
Align: integer;
Text: UTF8String;
+ Writable: boolean; // true -> add a blink char (|) at the end
//Reflection
Reflection: boolean;
ReflectionSpacing: real;
diff --git a/src/menu/UMenu.pas b/src/menu/UMenu.pas
index a290ee51..964da6ac 100644
--- a/src/menu/UMenu.pas
+++ b/src/menu/UMenu.pas
@@ -116,10 +116,7 @@ type
function AddText(ThemeText: TThemeText): integer; overload;
function AddText(X, Y: real; const Text_: UTF8String): integer; overload;
function AddText(X, Y: real; Style: integer; Size, ColR, ColG, ColB: real; const Text: UTF8String): integer; overload;
- function AddText(X, Y, W: real; Style: integer; Size, ColR, ColG, ColB: real; Align: integer; const Text_: UTF8String; Reflection_: boolean; ReflectionSpacing_: real; Z : real): integer; overload;
-{ for later additions
function AddText(X, Y, W: real; Style: integer; Size, ColR, ColG, ColB: real; Align: integer; const Text_: UTF8String; Reflection_: boolean; ReflectionSpacing_: real; Z : real; Writable: boolean): integer; overload;
-}
// button
procedure SetButtonLength(Length: cardinal); //Function that Set Length of Button Array in one Step instead of register new Memory for every Button
@@ -802,9 +799,7 @@ end;
function TMenu.AddText(ThemeText: TThemeText): integer;
begin
Result := AddText(ThemeText.X, ThemeText.Y, ThemeText.W, ThemeText.Font, ThemeText.Size,
- ThemeText.ColR, ThemeText.ColG, ThemeText.ColB, ThemeText.Align, ThemeText.Text, ThemeText.Reflection, ThemeText.ReflectionSpacing, ThemeText.Z);
-// add later when writable is available
-// ThemeText.ColR, ThemeText.ColG, ThemeText.ColB, ThemeText.Align, ThemeText.Text, ThemeText.Reflection, ThemeText.ReflectionSpacing, ThemeText.Z, ThemeText.Writable);
+ ThemeText.ColR, ThemeText.ColG, ThemeText.ColB, ThemeText.Align, ThemeText.Text, ThemeText.Reflection, ThemeText.ReflectionSpacing, ThemeText.Z, ThemeText.Writable);
end;
function TMenu.AddText(X, Y: real; const Text_: UTF8String): integer;
@@ -823,9 +818,7 @@ function TMenu.AddText(X, Y: real;
Size, ColR, ColG, ColB: real;
const Text: UTF8String): integer;
begin
- Result := AddText(X, Y, 0, Style, Size, ColR, ColG, ColB, 0, Text, false, 0, 0);
-// add with writable
-// Result := AddText(X, Y, 0, Style, Size, ColR, ColG, ColB, 0, Text, false, 0, 0, false);
+ Result := AddText(X, Y, 0, Style, Size, ColR, ColG, ColB, 0, Text, false, 0, 0, false);
end;
function TMenu.AddText(X, Y, W: real;
@@ -835,18 +828,15 @@ function TMenu.AddText(X, Y, W: real;
const Text_: UTF8String;
Reflection_: boolean;
ReflectionSpacing_: real;
- Z : real{; add writable
- Writable: boolean}): integer;
+ Z : real;
+ Writable: boolean): integer;
var
TextNum: integer;
begin
// adds text
TextNum := Length(Text);
SetLength(Text, TextNum + 1);
- Text[TextNum] := TText.Create(X, Y, W, Style, Size, ColR, ColG, ColB, Align, Text_, Reflection_, ReflectionSpacing_, Z);
-{ add with writable
Text[TextNum] := TText.Create(X, Y, W, Style, Size, ColR, ColG, ColB, Align, Text_, Reflection_, ReflectionSpacing_, Z, Writable);
-}
Result := TextNum;
end;
diff --git a/src/menu/UMenuText.pas b/src/menu/UMenuText.pas
index ca480adc..7f02171c 100644
--- a/src/menu/UMenuText.pas
+++ b/src/menu/UMenuText.pas
@@ -72,7 +72,7 @@ type
Reflection: boolean;
ReflectionSpacing: real;
-// for adding later Writable: boolean;
+ Writable: boolean;
procedure SetSelect(Value: boolean);
property Selected: boolean read SelectBool write SetSelect;
@@ -85,10 +85,8 @@ type
procedure Draw;
constructor Create; overload;
constructor Create(X, Y: real; const Text: UTF8String); overload;
- constructor Create(ParX, ParY, ParW: real; ParStyle: integer; ParSize, ParColR, ParColG, ParColB: real; ParAlign: integer; const ParText: UTF8String; ParReflection: boolean; ParReflectionSpacing: real; ParZ: real); overload;
-{ when adding writable
constructor Create(ParX, ParY, ParW: real; ParStyle: integer; ParSize, ParColR, ParColG, ParColB: real; ParAlign: integer; const ParText: UTF8String; ParReflection: boolean; ParReflectionSpacing: real; ParZ: real; Writable: boolean); overload;
-
+{
function GetMouseOverArea: TMouseOverRect;
}
end;
@@ -321,14 +319,13 @@ begin
if (not (SelectBool and SelectBlink)) or (I <> High(TextTiles)) then
Text2 := TextTiles[I]
else
-// begin
-// if (Writable) then
- Text2 := TextTiles[I] + '|';
-{
+ begin
+ if (Writable) then
+ Text2 := TextTiles[I] + '|'
else
Text2 := TextTiles[I];
end;
-}
+
case Align of
1: X2 := X + MoveX - glTextWidth(tmpText2)/2; { centered }
2: X2 := X + MoveX - glTextWidth(tmpText2); { right aligned }
@@ -362,7 +359,7 @@ end;
constructor TText.Create(X, Y: real; const Text: UTF8String);
begin
- Create(X, Y, 0, ftNormal, 30, 0, 0, 0, 0, Text, false, 0, 0{, false});
+ Create(X, Y, 0, ftNormal, 30, 0, 0, 0, 0, Text, false, 0, 0, false);
end;
constructor TText.Create(ParX, ParY, ParW: real;
@@ -372,8 +369,8 @@ constructor TText.Create(ParX, ParY, ParW: real;
const ParText: UTF8String;
ParReflection: boolean;
ParReflectionSpacing: real;
- ParZ: real{;
- Writable: boolean});
+ ParZ: real;
+ Writable: boolean);
begin
inherited Create;
Alpha := 1;
@@ -393,7 +390,7 @@ begin
Visible := true;
Reflection := ParReflection;
ReflectionSpacing := ParReflectionSpacing;
-// Writable := Writable;
+ Writable := Writable;
end;
{ add later
function TText.GetMouseOverArea: TMouseOverRect;