From e06c097dbfbebee3c03bf82cdcd05805f546a61d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 15:01:16 +0000 Subject: rename Menu part2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1310 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuButtonCollection.pas | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/menu/UMenuButtonCollection.pas (limited to 'src/menu/UMenuButtonCollection.pas') diff --git a/src/menu/UMenuButtonCollection.pas b/src/menu/UMenuButtonCollection.pas new file mode 100644 index 00000000..c700c812 --- /dev/null +++ b/src/menu/UMenuButtonCollection.pas @@ -0,0 +1,71 @@ +unit UMenuButtonCollection; + +interface + +{$I switches.inc} + +uses UMenuButton; + +type + //---------------- + //TButtonCollection + //No Extra Attributes or Functions ATM + //---------------- + AButton = Array of TButton; + PAButton = ^AButton; + TButtonCollection = class(TButton) + //num of the First Button, that can be Selected + FirstChild: Byte; + CountChilds: Byte; + + ScreenButton: PAButton; + + procedure SetSelect(Value : Boolean); override; + procedure Draw; override; + end; + +implementation + +procedure TButtonCollection.SetSelect(Value : Boolean); +var I: Integer; +begin + inherited; + + //Set Visible for Every Button that is a Child of this ButtonCollection + if (Not Fade) then + For I := 0 to High(ScreenButton^) do + if (ScreenButton^[I].Parent = Parent) then + ScreenButton^[I].Visible := Value; +end; + +procedure TButtonCollection.Draw; +var I, J: Integer; +begin + inherited; + //If fading is activated, Fade Child Buttons + if (Fade) then + begin + For I := 0 to High(ScreenButton^) do + if (ScreenButton^[I].Parent = Parent) then + begin + if (FadeProgress < 0.5) then + begin + ScreenButton^[I].Visible := SelectBool; + + For J := 0 to High(ScreenButton^[I].Text) do + ScreenButton^[I].Text[J].Visible := SelectBool; + end + else + begin + ScreenButton^[I].Texture.Alpha := (FadeProgress-0.666)*3; + + For J := 0 to High(ScreenButton^[I].Text) do + ScreenButton^[I].Text[J].Alpha := (FadeProgress-0.666)*3; + end; + end; + end; +end; + + + +end. -- cgit v1.2.3 From 1ef212ba89e50965b6b3b2d756be2c17e110b3ee Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 6 Sep 2008 09:53:53 +0000 Subject: Delphi-mode set for FPC git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1348 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuButtonCollection.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/menu/UMenuButtonCollection.pas') diff --git a/src/menu/UMenuButtonCollection.pas b/src/menu/UMenuButtonCollection.pas index c700c812..1e36a565 100644 --- a/src/menu/UMenuButtonCollection.pas +++ b/src/menu/UMenuButtonCollection.pas @@ -2,6 +2,10 @@ unit UMenuButtonCollection; interface +{$IFDEF FPC} + {$MODE Delphi} +{$ENDIF} + {$I switches.inc} uses UMenuButton; -- cgit v1.2.3 From dbf39d5bfc56c24a67d481187c619dc84828221f Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 23 Sep 2008 21:17:22 +0000 Subject: gpl header added and property svn:header set to "HeadURL Id" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1403 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuButtonCollection.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/menu/UMenuButtonCollection.pas') diff --git a/src/menu/UMenuButtonCollection.pas b/src/menu/UMenuButtonCollection.pas index 1e36a565..3cf22417 100644 --- a/src/menu/UMenuButtonCollection.pas +++ b/src/menu/UMenuButtonCollection.pas @@ -1,3 +1,28 @@ +{* UltraStar Deluxe - Karaoke Game + * + * UltraStar Deluxe is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + *} + unit UMenuButtonCollection; interface -- cgit v1.2.3 From 015b6c092b0779ee9b53ed1ee78044737f8dc592 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 23 Sep 2008 21:43:52 +0000 Subject: indentation unified, no code change. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1406 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuButtonCollection.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/menu/UMenuButtonCollection.pas') diff --git a/src/menu/UMenuButtonCollection.pas b/src/menu/UMenuButtonCollection.pas index 3cf22417..c6c6dd81 100644 --- a/src/menu/UMenuButtonCollection.pas +++ b/src/menu/UMenuButtonCollection.pas @@ -33,7 +33,8 @@ interface {$I switches.inc} -uses UMenuButton; +uses + UMenuButton; type //---------------- -- cgit v1.2.3 From 13bff3dc29108cde5ec88d6e9ce656ce377b4694 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 24 Apr 2009 18:43:12 +0000 Subject: cosmetics. No code change git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1692 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuButtonCollection.pas | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/menu/UMenuButtonCollection.pas') diff --git a/src/menu/UMenuButtonCollection.pas b/src/menu/UMenuButtonCollection.pas index c6c6dd81..8b7a1c3f 100644 --- a/src/menu/UMenuButtonCollection.pas +++ b/src/menu/UMenuButtonCollection.pas @@ -41,61 +41,61 @@ type //TButtonCollection //No Extra Attributes or Functions ATM //---------------- - AButton = Array of TButton; + AButton = array of TButton; PAButton = ^AButton; TButtonCollection = class(TButton) //num of the First Button, that can be Selected - FirstChild: Byte; - CountChilds: Byte; + FirstChild: byte; + CountChilds: byte; ScreenButton: PAButton; - procedure SetSelect(Value : Boolean); override; + procedure SetSelect(Value : boolean); override; procedure Draw; override; end; implementation -procedure TButtonCollection.SetSelect(Value : Boolean); -var I: Integer; +procedure TButtonCollection.SetSelect(Value : boolean); +var + Index: integer; begin inherited; //Set Visible for Every Button that is a Child of this ButtonCollection - if (Not Fade) then - For I := 0 to High(ScreenButton^) do - if (ScreenButton^[I].Parent = Parent) then - ScreenButton^[I].Visible := Value; + if (not Fade) then + for Index := 0 to High(ScreenButton^) do + if (ScreenButton^[Index].Parent = Parent) then + ScreenButton^[Index].Visible := Value; end; procedure TButtonCollection.Draw; -var I, J: Integer; +var + I, J: integer; begin inherited; //If fading is activated, Fade Child Buttons if (Fade) then begin - For I := 0 to High(ScreenButton^) do + for I := 0 to High(ScreenButton^) do if (ScreenButton^[I].Parent = Parent) then begin if (FadeProgress < 0.5) then begin ScreenButton^[I].Visible := SelectBool; - For J := 0 to High(ScreenButton^[I].Text) do + for J := 0 to High(ScreenButton^[I].Text) do ScreenButton^[I].Text[J].Visible := SelectBool; end else begin ScreenButton^[I].Texture.Alpha := (FadeProgress-0.666)*3; - For J := 0 to High(ScreenButton^[I].Text) do + for J := 0 to High(ScreenButton^[I].Text) do ScreenButton^[I].Text[J].Alpha := (FadeProgress-0.666)*3; end; end; end; end; - - end. -- cgit v1.2.3