unit P3E_Ukolnicek;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, P3KvaFormQE, AdvUtil, Vcl.Menus,
  System.ImageList, Vcl.ImgList, System.Actions, Vcl.ActnList, KvaActionSource,
  Vcl.Grids, AdvObj, BaseGrid, AdvGrid, Vcl.ExtCtrls, AdvGlowButton, P3Types,
  AdvSmoothLabel, Vcl.StdCtrls, GradientLabel, AdvPanel, P3ObjPPC, P3ObjSFr, P3ObjUzi,
  P3BrwPra, AdvSplitter;

type
  TE_Ukolnicek = class(TKvaFormQE)
    ACvyberUzi: TKvaAction;
    ACvyberPra: TKvaAction;
    AdvSplitter5: TAdvSplitter;
    Panel1: TPanel;
    AdvPanel1: TAdvPanel;
    AdvSmoothLabel1: TAdvSmoothLabel;
    EMpopis: TMemo;
    ACvyberUko: TKvaAction;
    procedure OQedityCanEditCell(Sender: TObject; ARow, ACol: Integer;
      var CanEdit: Boolean);
    procedure OQedityCellValidate(Sender: TObject; ACol, ARow: Integer;
      var Value: string; var Valid: Boolean);
    procedure OQedityGetAlignment(Sender: TObject; ARow, ACol: Integer;
      var HAlign: TAlignment; var VAlign: TVAlignment);
    procedure OQedityGetCellColor(Sender: TObject; ARow, ACol: Integer;
      AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
    procedure OQedityGetDisplText(Sender: TObject; ACol, ARow: Integer;
      var Value: string);
    procedure OQedityGetEditMask(Sender: TObject; ACol, ARow: Integer;
      var Value: string);
    procedure OQedityGetEditText(Sender: TObject; ACol, ARow: Integer;
      var Value: string);
    procedure OQedityGetEditorType(Sender: TObject; ACol, ARow: Integer;
      var AEditor: TEditorType);
    procedure OQedityButtonClick(Sender: TObject; ACol, ARow: Integer);
    procedure ACvyberUziExecute(Sender: TObject);
    procedure OQedityRadioClick(Sender: TObject; ACol, ARow, AIdx: Integer);
    procedure ACvyberPraExecute(Sender: TObject);
    procedure EMpopisChange(Sender: TObject);
    procedure OQedityDblClickCell(Sender: TObject; ARow, ACol: Integer);
    procedure ACvyberUkoExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    UzivatelList:TKvaUzivatelList;
    TypyUkoluList:TKvaTypUkoluList;
    PracovniciList:TKvaBrwPrac;
    EUkolPracovnika:TKvaUkolPracovnika;
    EUkolZadavatel:TKvaUkolZadavatel;
    EUkolOdpovednaOs:TKvaUkolOdpovednaOs;
    ETypUkolu:TKvaTypUkolu;
    AktMes,AktRok:word;
    BrwPrac:TKvaBrwPrac;
    SetFormularWarn:TKvaSetFormular;
    SetFormularQuest:TKvaSetFormular;
    SetFormularVyberUzivatele:TKvaSetFormular;
    SetFormularVyberPracovniky:TKvaSetFormular;
    SetFormularVyberStrediska:TKvaSetFormular;
    SetFormularFiltrBrowser:TKvaSetFormular;
    SetFormularTypyUkoluVyber:TKvaSetFormular;
    function CorrectForm:integer; override;
    procedure InitGrid; override;
    procedure ReFillGrid; override;
    procedure InitFirstGo; override;
    procedure InitForm(NewSectiom:TKvaTypeSection); override;
    constructor CreateNew(AOwner:TComponent; Dummy: Integer=0); override;
    destructor Destroy; override;
  end;

var
  E_Ukolnicek: TE_Ukolnicek;

implementation

{$R *.dfm}

uses P3Global, P3VizTyp, P3Sys001, P3SysTxt, P3TxtErr, P3Obj001,
     P3VizCis, P3ObjCis, P3V_DUzivat, P3V_BRWPRA, P3V_TypyUkolu;

const
  rad_nazuko=0;
  rad_typuko=1;
  rad_datzad=2;
  rad_datpln=3;
  rad_zadava=4;
  rad_odposa=5;
  rad_pracov=6;
  rad_stauko=7;
  rad_castka=8;

{ TE_Ukolnicek }

procedure TE_Ukolnicek.ACvyberPraExecute(Sender: TObject);
begin
  inherited;
    if V_BRWPRA=nil then V_BRWPRA:=TV_BRWPRA.createKvaForm(Application,0);
    V_BRWPRA.Visible:=false;
    V_BRWPRA.AktUzivatel:=AktUzivatel;
    V_BRWPRA.SetFormular:=SetFormularVyberPracovniky;
    V_BRWPRA.SetFormularVyberStrediska:=SetFormularVyberStrediska;
    V_BRWPRA.SetFormularFiltrBrowser:=SetFormularFiltrBrowser;
    V_BRWPRA.WhichData:=1;
    V_BRWPRA.Obdobi:=Obdobi;
    V_BRWPRA.BrowPrac:=BrwPrac;
    V_BRWPRA.InitForm(tsDefault);
    V_BRWPRA.ShowModal;
    if V_BRWPRA.VybPracovnik<>nil then
    begin
       if (EUkolZadavatel<>nil) and (EUkolZadavatel.incipr<>V_BRWPRA.VybPracovnik.incipr) then
          EUkolZadavatel.incipr:=V_BRWPRA.VybPracovnik.incipr;
       SetAkce(sender);
       OQedity.Invalidate;
    end;
    V_BRWPRA.Destroy;
    V_BRWPRA:=nil;
end;

procedure TE_Ukolnicek.ACvyberUkoExecute(Sender: TObject);
begin
  inherited;
  if (TypyUkoluList<>nil) then
   begin
   if V_TypyUkolu=nil then V_TypyUkolu:=TV_TypyUkolu.createKvaForm(Application,0);
      V_TypyUkolu.Visible:=false;
      V_TypyUkolu.AktUzivatel:=AktUzivatel;
      V_TypyUkolu.TypyUkolu:=TypyUkoluList;
      V_TypyUkolu.SetFormular:=SetFormularTypyUkoluVyber;
      V_TypyUkolu.InitForm(tsDefault);
      try
        V_TypyUkolu.ShowModal;
      except
      end;
      if V_TypyUkolu.VybTypUkolu<> nil then
      begin
          if (EUkolZadavatel<>nil) then
             EUkolZadavatel.typuko:=V_TypyUkolu.VybTypUkolu.typuko;
          OQedity.Invalidate;
          SetAkce(sender);
          ReFillGrid;
      end;
      V_TypyUkolu.Destroy;
      V_TypyUkolu:=nil;
   end;
end;

procedure TE_Ukolnicek.ACvyberUziExecute(Sender: TObject);
begin
  inherited;
  if (UzivatelList<>nil) then
   begin
   if V_DUzivat=nil then V_DUzivat:=TV_DUzivat.createKvaForm(Application,0);
      V_DUzivat.Visible:=false;
      V_DUzivat.IsMulti:=false;
      V_DUzivat.VcetneAktUzivatele:=False;
      V_DUzivat.AktUzivatel:=AktUzivatel;
      V_DUzivat.Uzivatele:=UzivatelList;
      V_DUzivat.SetFormular:=SetFormularVyberUzivatele;
      V_DUzivat.InitForm(tsDefault);
      try
        V_DUzivat.ShowModal;
      except
      end;
      if V_DUzivat.VybUzivatel<> nil then
      begin
          if (EUkolZadavatel<>nil) and (EUkolZadavatel.odposa<>V_DUzivat.VybUzivatel.incuzi) then
             EUkolZadavatel.odposa:=V_DUzivat.VybUzivatel.incuzi;
          OQedity.Invalidate;
          SetAkce(sender);
          ReFillGrid;
      end;
      V_DUzivat.Destroy;
      V_DUzivat:=nil;
   end;
end;

function TE_Ukolnicek.CorrectForm: integer;
begin
  if WhichData=2 then
     EUkolZadavatel.Popis.Assign(EMpopis.Lines);
  Result:=inherited CorrectForm;
  case WhichData of
      2:
      begin
        if Trim(EUkolZadavatel.nazuko)='' then
           begin
             Result:=1;
             ShowWarning(AktUzivatel,TxtLng('Nutné zadat název úkolu!'),0,5,SetFormularWarn);
             Exit;
           end
        else if not ((EUkolZadavatel.datpln>cidMin) and (EUkolZadavatel.datpln<cidMax)) then
           begin
             Result:=2;
             ShowWarning(AktUzivatel,TxtLng('Nutné zadat datum plnění!'),0,5,SetFormularWarn);
             Exit;
           end
        else if EUkolZadavatel.odposa<=0 then
           begin
             Result:=3;
             ShowWarning(AktUzivatel,TxtLng('Nutné zadat odpovědnou osobu!'),0,5,SetFormularWarn);
             Exit;
           end;
        if (EUkolZadavatel.stauko=1) and (OQedity.Enabled=true) and not
        (ShowQuestion(AktUzivatel,'Opravdu nastvait na Splněno? Nebude možné již editovat.',true,SetFormularQuest)) then
           begin
             Result:=4;
           end;
      end;
      3:
      begin
        if (EUkolOdpovednaOs.stauko=1) and (OQedity.Enabled=true) and not
        (ShowQuestion(AktUzivatel,'Opravdu nastvait na Splněno? Nebude možné již editovat.',true,SetFormularQuest)) then
           begin
             Result:=4;
           end;
      end;
  end;
end;

constructor TE_Ukolnicek.CreateNew(AOwner: TComponent; Dummy: Integer);
begin
  inherited;
  ReadComponentResFile(GUnitsDir+'\P3E_Ukolnicek.dfm',self);
end;

destructor TE_Ukolnicek.Destroy;
begin
  inherited;
end;

procedure TE_Ukolnicek.EMpopisChange(Sender: TObject);
begin
  inherited;
  SetAkce(sender);
end;

procedure TE_Ukolnicek.InitFirstGo;
var PomStr:String;
begin
   FDefTop:=100;
   FDefLeft:=100;
   Constraints.MinHeight:= 200;
   Constraints.MinWidth:= 450;
   Constraints.MaxHeight:=GMaxHeight;
   Constraints.MaxWidth:=GMaxWidth;
   inherited;
   OQedity.CreateBitButton(1,rad_typuko,22,20, '   ', haRight, AdvGrid.vaCenter).LoadFromResourceName(HInstance,'BtnCisel');
   OQedity.CreateBitButton(1,rad_odposa,22,20, '   ', haRight, AdvGrid.vaCenter).LoadFromResourceName(HInstance,'BtnCisel');
   OQedity.CreateBitButton(1,rad_pracov,22,20, '   ', haRight, AdvGrid.vaCenter).LoadFromResourceName(HInstance,'BtnCisel');
   OQedity.Options := OQedity.Options + [goEditing]-[goRowSelect];
   OQedity.ColCount:=2;
   OQedity.RowCount:=9;
   OQedity.FixedCols:=1;
   OQedity.FixedRows:=0;
   OQedity.ColWidths[0]:=100;
   OQedity.ColWidths[1]:=300;
   with OQedity.CreateRadio(1, rad_stauko, 1, 0) do
   begin
      Add(' '+TxtLng('Nesplněno')+'  ');
      Add(' '+TxtLng('Splněno')+'   ');
      Add(' '+TxtLng('Odmítnuto')+'  ');
   end;
   OQedity.UnHideRowsAll;
   EMpopis.Clear;
   case WhichData of
     1:
     begin
       PomStr:=TxtLng('5UkolPrac');
       if (EUkolPracovnika<>nil) then
       begin
          EMpopis.Lines.Assign(EUkolPracovnika.Popis);
          EMpopis.Enabled:=false;
          OQEdity.SetRadioIdx(1, rad_stauko, EUkolPracovnika.stauko);
       end;
       OQedity.HideRow(rad_pracov);
     end;
     2:
     begin
       PomStr:=TxtLng('5Zadavatel');
       if (EUkolZadavatel<>nil) then
         begin
            OQedity.SetRadioIdx(1, rad_stauko, EUkolZadavatel.stauko);
            EMpopis.Lines.Assign(EUkolZadavatel.Popis);
         end;
       OQedity.HideRow(rad_zadava);
       if (EUkolZadavatel.stauko=1) then
       begin
          OQedity.Enabled:=false;
          EMpopis.Enabled:=false;
       end;
     end;
     3:
     begin
       PomStr:=TxtLng('5Odposoba');
       if (EUkolOdpovednaOs<>nil) then
         begin
            OQedity.SetRadioIdx(1, rad_stauko, EUkolOdpovednaOs.stauko);
            EMpopis.Lines.Assign(EUkolOdpovednaOs.Popis);
         end;
       OQedity.HideRow(rad_odposa);
       if (EUkolOdpovednaOs.stauko=1) then
       begin
          OQedity.Enabled:=false;
          EMpopis.Enabled:=false;
       end;
     end;
   end;
   Caption:=AktUzivatel.CaptionPERM(Width,PomStr,GUserMan);
   XEheadText.Caption.Text:=PomStr;
   SetWidthCol(SetFormular);
   FirstGo:=false;
end;

procedure TE_Ukolnicek.InitForm(NewSectiom: TKvaTypeSection);
begin
  inherited;
  case WhichData of
  1: EUkolPracovnika:=TKvaUkolPracovnika(EditObj);
  2: EUkolZadavatel:=TKvaUkolZadavatel(EditObj);
  3: EUkolOdpovednaOs:=TKvaUkolOdpovednaOs(EditObj);
  end;
  if FirstGo then InitFirstGo;
  InitGrid;
  ReFillGrid;
end;

procedure TE_Ukolnicek.InitGrid;
begin
  inherited;
  OQedity.DefaultRowHeight:=18+((Lsf_Edity*4)*FDefPixel);
end;

procedure TE_Ukolnicek.OQedityButtonClick(Sender: TObject; ACol, ARow: Integer);
begin
  inherited;
  if (ACol>0) and (WhichData=2) then
     case OQEdity.RealRowIndex(ARow) of
       rad_typuko: ACvyberUko.Execute;
       rad_odposa: ACvyberUzi.Execute;
       rad_pracov: ACvyberPra.Execute;
     end;
end;

procedure TE_Ukolnicek.OQedityCanEditCell(Sender: TObject; ARow, ACol: Integer;
  var CanEdit: Boolean);
begin
  inherited;
  if rad_datzad=ARow then
    CanEdit:=False
  else
    begin
      case WhichData of
        1:
          begin
            CanEdit:=False;
          end;
        2:
          begin
            if ACol=1 then
            begin
              CanEdit:=True;
            end
            else
              CanEdit:=False;
          end;
        3:
          begin
            if ACol=1 then
            begin
              case OQedity.RealRowIndex(ARow) of
                rad_stauko: CanEdit:=True
                else
                   CanEdit:=False;
              end;
            end
            else
              CanEdit:=False;
          end;
      end;
    end;
end;

procedure TE_Ukolnicek.OQedityCellValidate(Sender: TObject; ACol, ARow: Integer;
  var Value: string; var Valid: Boolean);
var
  DDatum:String;
  VDatum:TDateTime;
begin
  inherited;
  case WhichData of
    2:
      begin
        if EUkolZadavatel<>nil then
        begin
          case OQedity.RealRowIndex(ARow) of
            rad_nazuko: EUkolZadavatel.nazuko:=Trim(Value);
            rad_typuko: EUkolZadavatel.typuko:=StrToInt(Value);
            rad_datpln:
              begin
                DoplnDatum(Value,AktMes,AktRok,0,DDatum);
                if (DDatum<>'.  .')and TryStrToDate(DDatum,VDatum)
                and(VDatum>EUkolZadavatel.datzad)then
                  EUkolZadavatel.datpln:=VDatum
                else EUkolZadavatel.datpln:=P3Obj001.cidMin;
              end;
            rad_stauko: EUkolZadavatel.stauko:=StrToInt(Value); //(0 nesplneno 1 splneno 2 odmidnuto)
            rad_castka: EUkolZadavatel.castka:=StrToFloat(Value);
          end;
        end;
      end;
    3:
      begin
        if EUkolOdpovednaOs<>nil then
        begin
          case OQedity.RealRowIndex(ARow) of
            rad_nazuko: EUkolOdpovednaOs.nazuko:=Value;
            rad_typuko: EUkolOdpovednaOs.typuko:=StrToInt(Value);
            rad_datpln: EUkolOdpovednaOs.datpln:=KvaStrToDate(Value);
            rad_stauko: EUkolOdpovednaOs.stauko:=StrToInt(Value); //(0 nesplneno 1 splneno 2 odmidnuto)
            rad_castka: EUkolOdpovednaOs.castka:=StrToFloat(Value);
          end;
        end;
      end;
  end;
end;

procedure TE_Ukolnicek.OQedityDblClickCell(Sender: TObject; ARow,
  ACol: Integer);
begin
  inherited;
   if (ACol>0) and (WhichData=2) then
     case OQEdity.RealRowIndex(ARow) of
       rad_typuko: ACvyberUko.Execute;
       rad_odposa: ACvyberUzi.Execute;
       rad_pracov: ACvyberPra.Execute;
     end;
end;

procedure TE_Ukolnicek.OQedityGetAlignment(Sender: TObject; ARow, ACol: Integer;
  var HAlign: TAlignment; var VAlign: TVAlignment);
begin
   inherited;
   case ACol of
     0:   HAlign:=taRightJustify;
     else HAlign:=taLeftJustify;
   end;
end;

procedure TE_Ukolnicek.OQedityGetCellColor(Sender: TObject; ARow, ACol: Integer;
  AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
  inherited;
  AFont.Size:=6+(Lsf_Edity*2);
end;

procedure TE_Ukolnicek.OQedityGetDisplText(Sender: TObject; ACol, ARow: Integer;
  var Value: string);
begin
  inherited;
  if ACol=1 then
  begin
    case WhichData of
      1:
        begin
          if EUkolPracovnika<>nil then
          begin
            case OQedity.RealRowIndex(ARow) of
              rad_nazuko: Value:=EUkolPracovnika.nazuko;
              rad_typuko:
                if TypyUkoluList<>nil then
                  begin
                     var AktTypUkolu:=TypyUkoluList.TypUkoluDleKodu(EUkolPracovnika.typuko);
                     if AktTypUkolu<>nil then
                        Value:=AktTypUkolu.naztyp;
                  end;
              rad_datzad: Value:=KvaRealDateToStr(EUkolPracovnika.datzad);
              rad_datpln: Value:=KvaRealDateToStr(EUkolPracovnika.datpln);
              rad_zadava:
                if BrwPrac <>nil then
                  begin
                     var AktPracovnik:=BrwPrac.Row[BrwPrac.RowDleIncipr(EUkolPracovnika.zadava)];
                     if AktPracovnik<>nil then
                        Value:= AktPracovnik.priajm;
                  end;
               rad_odposa:
                begin
                var POmOdposa:= EUkolPracovnika.odposa;
                var PomUzivatel:= UzivatelList.UzivatelDleKodu(POmOdposa);
                if PomUzivatel<>nil then
                   Value:=PomUzivatel.jmenou;
                end;
               rad_stauko: Value:=IntToStr(EUkolPracovnika.stauko); //(0 nesplneno 1 splneno 2 odmidnuto)
               rad_castka: Value:=FloatToStr(EUkolPracovnika.castka);
            end;
          end;
        end;
      2:
        begin
          if EUkolZadavatel<>nil then
          begin
            case OQedity.RealRowIndex(ARow) of
              rad_nazuko: Value:=EUkolZadavatel.nazuko;
              rad_typuko:
                if TypyUkoluList<>nil then
                  begin
                     var AktTypUkolu:=TypyUkoluList.TypUkoluDleKodu(EUkolZadavatel.typuko);
                     if AktTypUkolu<>nil then
                        Value:=AktTypUkolu.naztyp;
                  end;
              rad_datzad: Value:=KvaRealDateToStr(EUkolZadavatel.datzad);
              rad_datpln: Value:=KvaRealDateToStr(EUkolZadavatel.datpln);
              rad_odposa:
                begin
                var POmOdposa:= EUkolZadavatel.odposa;
                var PomUzivatel:= UzivatelList.UzivatelDleKodu(POmOdposa);
                if PomUzivatel<>nil then
                   Value:=PomUzivatel.jmenou;
                end;
              rad_pracov:
                if (BrwPrac<>nil)and(EUkolZadavatel.incipr<>0) then
                  begin
                     var AktPracovnik:=BrwPrac.Row[BrwPrac.RowDleIncipr(EUkolZadavatel.incipr)];
                     if AktPracovnik<>nil then
                        Value:= AktPracovnik.priajm;
                  end;
              rad_stauko: Value:=IntToStr(EUkolZadavatel.stauko); //(0 nesplneno 1 splneno) radio
              rad_castka: Value:=FloatToStr(EUkolZadavatel.castka);
            end;
          end;
        end;
      3:
        begin
          if EUkolOdpovednaOs<>nil then
          begin
            case OQedity.RealRowIndex(ARow) of
              rad_nazuko: Value:=EUkolOdpovednaOs.nazuko;
              rad_typuko:
                if TypyUkoluList<>nil then
                  begin
                     var AktTypUkolu:=TypyUkoluList.TypUkoluDleKodu(EUkolOdpovednaOs.typuko);
                     if AktTypUkolu<>nil then
                        Value:=AktTypUkolu.naztyp;
                  end;
              rad_datzad: Value:=KvaRealDateToStr(EUkolOdpovednaOs.datzad);
              rad_datpln: Value:=KvaRealDateToStr(EUkolOdpovednaOs.datpln);
              rad_zadava:
                if BrwPrac <>nil then
                  begin
                     var AktPracovnik:=BrwPrac.Row[BrwPrac.RowDleIncipr(EUkolOdpovednaOs.zadava)];
                     if AktPracovnik<>nil then
                        Value:= AktPracovnik.priajm;
                  end;
               rad_pracov:
                if BrwPrac <>nil then
                  begin
                     var AktPracovnik:=BrwPrac.Row[BrwPrac.RowDleIncipr(EUkolOdpovednaOs.incipr)];
                     if AktPracovnik<>nil then
                        Value:= AktPracovnik.priajm;
                  end;
               rad_castka: Value:=FloatToStr(EUkolOdpovednaOs.castka);
            end;
          end;
        end;
    end;
  end;
end;

procedure TE_Ukolnicek.OQedityGetEditMask(Sender: TObject; ACol, ARow: Integer;
  var Value: string);
begin
  inherited;
  if ACol=1 then
    begin
      case OQedity.RealRowIndex(ARow) of
       rad_datpln,rad_datzad:   Value := '!90\.90\.9900;1;_';
      end;
    end;
end;

procedure TE_Ukolnicek.OQedityGetEditorType(Sender: TObject; ACol,
  ARow: Integer; var AEditor: TEditorType);
begin
  inherited;
  case OQedity.RealRowIndex(ARow) of
    rad_nazuko:
      begin
        OQedity.MaxEditLength:=80;
        AEditor:=edNormal;
      end;
    rad_castka:
      begin
        OQedity.MaxEditLength:=12;
        AEditor:=edPositiveNumeric;
      end
    else AEditor:=edNormal;
  end;
end;

procedure TE_Ukolnicek.OQedityGetEditText(Sender: TObject; ACol, ARow: Integer;
  var Value: string);
begin
  inherited;
  case WhichData of
    2:
      begin
        if EUkolZadavatel<>nil then
        begin
          case OQedity.RealRowIndex(ARow) of
            rad_nazuko: Value:=EUkolZadavatel.nazuko;
            rad_typuko: Value:=IntToStr(EUkolZadavatel.typuko);
            rad_datpln: Value:=KvaRealDateToStr(EUkolZadavatel.datpln);
            rad_stauko: Value:=IntToStr(EUkolZadavatel.stauko); //(0 nesplneno 1 splneno 2 odmidnuto)
            rad_castka: Value:=FloatToStr(EUkolZadavatel.castka);
          end;
        end;
      end;
    3:
      begin
        if EUkolOdpovednaOs<>nil then
        begin
          case OQedity.RealRowIndex(ARow) of
            rad_nazuko: Value:=EUkolOdpovednaOs.nazuko;
            rad_typuko: Value:=IntToStr(EUkolOdpovednaOs.typuko);
            rad_datpln: Value:=KvaRealDateToStr(EUkolOdpovednaOs.datpln);
            rad_stauko: Value:=IntToStr(EUkolOdpovednaOs.stauko); //(0 nesplneno 1 splneno 2 odmidnuto)
            rad_castka: Value:=FloatToStr(EUkolOdpovednaOs.castka);
          end;
        end;
      end;
  end;
end;

procedure TE_Ukolnicek.OQedityRadioClick(Sender: TObject; ACol, ARow,
  AIdx: Integer);
begin
  inherited;
   case WhichData of
   2:   if (EUkolZadavatel<>nil) and (OQedity.RealRowIndex(ARow)=rad_stauko) and (ACol=1) then
           EUkolZadavatel.stauko:=AIdx;
   3:   if (EUkolOdpovednaOs<>nil) and (OQedity.RealRowIndex(ARow)=rad_stauko) and (ACol=1) then
           EUkolOdpovednaOs.stauko:=AIdx;
   end;
   SetAkce(sender);
end;

procedure TE_Ukolnicek.ReFillGrid;
begin
  inherited;
  OQedity.Invalidate;
end;

end.
