CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGJQButtonSetHelperUnit

Share your useful code here.

by JohnFSklavounos » 28 Sep 2013 22:10

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.
John F. Sklavounos
Software Developer
Always learning

XE7: Update 1
FireDAC: 20.0.16277 (Build 1276)
IW: 14.0.41
CG : 2.6.0.100
JohnFSklavounos
 
Posts: 109
Joined: 14 Aug 2013 00:35
Location: Miami, FL

Return to Community Code

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.