frm_s_endrightpas.pas

来自「是一个用delphi设计的考勤系统」· PAS 代码 · 共 73 行

PAS
73
字号
unit frm_s_endRightpas;

interface

uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ModalForm, Menus, StdCtrls, ExtCtrls, CheckLst, UTGroup;

type
   Tfrm_s_endRight = class(TMyModalForm)
      clbRight1: TCheckListBox;
      clbRight: TCheckListBox;
      procedure FormActivate(Sender: TObject);
      procedure clbRightClickCheck(Sender: TObject);
   private
    { Private declarations }
   public
    { Public declarations }
      ParentRight: string;
      Group: TGroup;
   end;

var
   frm_s_endRight: Tfrm_s_endRight;

implementation

{$R *.dfm}

procedure Tfrm_s_endRight.FormActivate(Sender: TObject);
var
   i: integer;
   s: string;
   j: integer;
begin
   inherited;
   clbRight.Items.Clear;
   clbRight1.Items.Clear;
   for i := 0 to group.RightCount - 1 do
   begin
      if (length(group.RecGRight[i].RightNum) > 4) and
         (copy(group.RecGRight[i].RightNum, 1, 4) = ParentRight) then
      begin
         j := clbRight.Items.Add(group.RecGRight[i].RightMc);
         clbRight1.Items.Add(group.RecGRight[i].RightNum);
         clbRight.Checked[j] := group.RecGRight[i].Right;
         if not group.RecGRight[i].Right then
            clbRight.State[j] := cbUnchecked
         else
         begin
            if group.RecGRight[i].RightCount = group.RecGRight[i].SubCount then
               clbRight.State[j] := cbchecked
            else
               clbRight.State[j] := cbGrayed;
         end;
      end;
   end;
end;


procedure Tfrm_s_endRight.clbRightClickCheck(Sender: TObject);
begin
   inherited;
   if clbRight.ItemIndex > -1 then
   begin
      group.SetRight(clbRight1.Items.Strings[clbRight.ItemIndex],
         clbRight.Checked[clbRight.ItemIndex]);
      group.UpdateRecGRight;
   end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?