aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/UMenuSelectSlide.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 14:42:34 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 14:42:34 +0000
commit9975f56cded5f6251d0110238fd97b7ee7ccae31 (patch)
treecf93bba0e884f629dec6f869700468bf86ada68d /src/menu/UMenuSelectSlide.pas
parentd36fb79a6e0914a43fe9381c32dfdc4639e9a19e (diff)
downloadusdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.tar.gz
usdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.tar.xz
usdx-9975f56cded5f6251d0110238fd97b7ee7ccae31.zip
some changes on mousesupport
- you can click on the whole area of a button after fading - options on selects can be changed by clicking on the arrows - fix mouse parsing at the screensong extensions git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1950 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/menu/UMenuSelectSlide.pas')
-rw-r--r--src/menu/UMenuSelectSlide.pas33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/menu/UMenuSelectSlide.pas b/src/menu/UMenuSelectSlide.pas
index 6bc824f4..11be4c2a 100644
--- a/src/menu/UMenuSelectSlide.pas
+++ b/src/menu/UMenuSelectSlide.pas
@@ -37,7 +37,8 @@ uses
gl,
TextGL,
UMenuText,
- UTexture;
+ UTexture,
+ UMenuInteract;
type
PSelectSlide = ^TSelectSlide;
@@ -135,6 +136,9 @@ type
//Automatically Generate Lines (Texts)
procedure genLines;
+
+ function GetMouseOverArea: TMouseOverRect;
+ function OnClick(X, Y: Real): TMouseClickAction;
end;
implementation
@@ -405,4 +409,31 @@ begin
end;
end;
+function TSelectSlide.GetMouseOverArea: TMouseOverRect;
+begin
+ Result.X := Texture.X;
+ Result.Y := Texture.Y;
+ Result.W := (TextureSBG.X + TextureSBG.W) - Result.X;
+ Result.H := Max(Texture.H, TextureSBG.H);
+end;
+
+function TSelectSlide.OnClick(X, Y: Real): TMouseClickAction;
+ var
+ AreaW: Real;
+begin
+ // default: press return on click
+ Result := maReturn;
+
+ // use left sides to inc or dec selection by click
+ AreaW := TextureSbg.W / 20;
+
+ if (Y >= TextureSBG.Y) and (Y <= TextureSBG.Y + TextureSBG.H) then
+ begin
+ if (X >= TextureSBG.X) and (X <= TextureSBG.X + AreaW) then
+ Result := maLeft // hit left area
+ else if (X >= TextureSBG.X + TextureSBG.W - AreaW) and (X <= TextureSBG.X + TextureSBG.W) then
+ Result := maRight; // hit right area
+ end;
+end;
+
end.