Page 1 of 1

IWCGJQButtonSetHelperUnit

PostPosted: 28 Sep 2013 22:10
by JohnFSklavounos
Hello,

This helper unit is for working with Button Sets. I'm emulating a global Enabled property...

Enjoy,
John

delphi code
unit IWCGJQButtonSetHelperUnit;

/// =================================================================================================
///
/// Author: John F. Sklavounos
/// Date: 2013-09-28
///
/// Ownership:
/// You are free to use and distribute this code as you see fit. I only ask that improvements be
/// returned to the community at viewforum.php?f=109
///
/// Abstract:
/// ButtonSets do not have certain global properties such as Enabled, so this helper class is
/// designed to allow me to emulate those features I would like to see.
///
/// The idea for this came when attempting to disable a button set in code - it's allowed because
/// the property is there, but it doesn't actually enable/disable the entire component.
///
/// Notes:
///
/// =================================================================================================

interface

uses
IWCGJQButtons;

type TIWCGJQButtonSetHelper = class
class procedure SetButtonSetEnabledStatus(aButtonSet: TIWCGJQButtonSet; aEnabled: boolean);
end;

implementation

class procedure TIWCGJQButtonSetHelper.SetButtonSetEnabledStatus(aButtonSet: TIWCGJQButtonSet; aEnabled: boolean);
var
i: integer;
begin
for i := 0 to aButtonSet.JQButtonSetOptions.Buttons.Count - 1 do
aButtonSet.JQButtonSetOptions.Buttons[i].Disabled := not aEnabled;
end;

end.