ER%Zd^7BkGpur1Fk^x?1QY648CPf2m
zX87Ma?eyT)4)6+-1_Nwm(hz{{OiBjW!KC2;uQO=`z)mKO2Iykacz`#VGzs8sCfx?m
z&7^FAJq-U%+(kt)v3cw@Ycj0^X#`#C*l1oDPuGp?HUfJqjoAbbvwQ)H34Fk22~aM;
z0s@bH9#KJXn$amhjR5x&c;i|`6Tt<>Wd#28`-tTP?=`jw&_ST}MP)6)4&!y6J5
z7+<}Sz*okX1lS_LYXmMDcM0$ofy>6-0_+#ypa6#jI4Zyg1g;uC6ySsapAs;bJ|`fX
z&Is@ofk@L}1)$>nAp~xVN+ysWHJre-s8IxdbQ2p*a7)y90^6b{32>VL*#usT$|vwv
z)HDH#1(+qk0s`q3bghVX5^zS>2v8@$y##8aml62IbklNzN2A*ad>Gv>K!*Tp37m*t
zFTfK5JWb%!=;sK09=(mg-kqk`2+9L@5r`i6mH@j2I7q;Bn66C&KOi7|NZ0iPKPB*^
zpRmsfwpqU-kh{Wof#B2Ds|0?}6a%^6_Cf0+jYH%Xylx{U%frkgESHz|w8;+U0H%6RuF6|Rn6JvaM)nw#{Xa4rl+Q=?$jXHb
zY>=Zz_e3hUjWI_mlg9Q$EBWKh(MtIQuzF$wI>O~G`OHM+u>9#{^9S;f+bkc*HM4q<
zD@E>dSqJ$B_}iIf>TSSe73Cu7mD?;mFDc~~^GnKY1AEpgLu}?{%A_BF7?-tl*`l13r1R2iidEUBSk1eX
zPb_aK=c9Hh!&%Q;%5AJ?m+}%r)k_R@ Value then
+ begin
+ FEditorstyle := Value;
+ Invalidate;
+ end;
+end;
+
+{ ΪIֶʾϢķ}
+procedure TJkPanel.AddHits(ItemIndex :Integer; Hits :array of string);
+var
+ m,n,i :Integer;
+begin
+
+ if FEditorstyle = Tscombox then
+ begin
+ n := Length(comEditors);
+ m := Length(Hits);
+ if ItemIndex< n then
+ for i:= 0 to m - 1 do
+ comEditors[ItemIndex].Items.Add(Hits[i]);
+ end
+ else if FEditorstyle = Tsedit then
+ begin
+ n := Length(edEditors);
+ m := Length(Hits);
+ if ItemIndex< n then
+ for i:=0 to m-1 do
+ edEditors[ItemIndex].Hint:= Hits[i];
+ end
+ else if FEditorstyle = TsMemo then
+ begin
+ n := Length(memoEditors);
+ m := Length(Hits);
+ if ItemIndex< n then
+ for i:=0 to m-1 do
+ memoEditors[ItemIndex].Hint:= Hits[i];
+ end;
+end;
+
+procedure TJkPanel.AKeyDown(Sender :TObject; var Key :Word; Shift :TShiftState);
+begin
+ //
+end;
+
+procedure TJkPanel.AProgressEditorChange(Sender :TObject);
+begin
+ //
+end;
+
+procedure TJkPanel.AKeyPress(Sender :TObject; var Key :Char);
+begin
+ if (Sender is TComboBox) or (Sender is Tedit) or (Sender is TMemo) then
+ if Key=#13 then
+ (Owner as TForm).Perform(WM_NEXTDLGCTL, 0, 0);
+end;
+
+procedure TJkPanel.ClearHits(ItemIndex :Integer);
+var
+ n :Integer;
+begin
+ if FEditorstyle = Tscombox then
+ begin
+ n := Length(comEditors);
+ if ItemIndex< n then comEditors[ItemIndex].Items.Clear;
+ end
+ else if FEditorstyle = Tsedit then
+ begin
+ n := Length(edEditors);
+ if ItemIndex< n then edEditors[ItemIndex].Hint:='';;
+ end
+ else if FEditorstyle = TsMemo then
+ begin
+ n := Length(MemoEditors);
+ if ItemIndex< n then MemoEditors[ItemIndex].Hint:='';;
+ end;
+
+end;
+
+
+{ ֶεؼķ}
+procedure TJkPanel.CreateEditors(var DS :TDataSource; cnnstr :String; Const Defaultsheet :String = '');
+var
+ Tmp_CheJian,Tmp_Parm :String;
+ i,j,n,k,This_Index,TextHeight :Integer;
+ tmp_col0,Tmp_Row0,Tmp_Row1 :Integer;
+ XXX :TStringList;
+ kkk,RRR :array of integer;
+ DefaultIndex :Integer; //Ĭϳ
+begin
+ if (Data_CheJianField = '') then exit;
+ { ͷȫؼڴ}
+ FreeEditors;
+ if DS = nil then exit;
+ if DataSource = nil then FDataSource := Ds;
+ if not DataSource.DataSet.Active then exit;
+ if (DataSource.DataSet is TAdoDataSet) = False then exit;
+ TmpDgListIdx := -1;
+ FPageCount := 0;
+ DefaultIndex := 0;
+ n := DataSource.DataSet.RecordCount;
+ if n <= 0 then exit;
+ DataSource.DataSet.DisableControls;
+ if TitleWidth < maxTextLen then
+ maxTextLen := TitleWidth;
+
+ { ıⳤȼʾ}
+ DataSource.DataSet.First;
+ { ߶}
+ TextHeight := Canvas.TextHeight(DataSource.DataSet.Fields[0].DisplayLabel) + LineHeight; //10;
+
+ { ڴ}
+ SetLength(AdoLists,n);
+ SetLength(DsLists,n);
+ SetLength(DGLists,n);
+
+ SetLength(Labels,n);
+ SetLength(ColorLabels,n);
+ SetLength(ProgressEditor,n);
+ SetLength(Shapes,n);
+
+ { ݸ֪ؼ AdoGlidesDsGlides}
+ AdoGlides := TadoDataset.Create(owner);
+ DsGlides := TDatasource.Create(owner);
+ DsGlides.DataSet := AdoGlides;
+
+ if Columns = 0 then Columns := 6;
+ try
+ tmpado := TadoDataset.Create(Owner);
+ tmpDs := TDatasource.Create(Owner);
+ tmpDs.DataSet := tmpado;
+ with tmpado do
+ begin
+ Active := False;
+ Fcnnstr := cnnstr;
+ tmpado.ConnectionString := Fcnnstr;
+ tmpado.CommandText := Data_PageSql;
+ Active := True;
+ FPageCount := RecordCount;
+ if FPageCount = 0 then exit;
+
+ setlength(kkk,FPageCount);
+ for i := 0 to high(kkk) do
+ kkk[i] := -1;
+ SetLength(RRR,FPageCount);
+ for i := 0 to high(RRR) do
+ RRR[i] := 0;
+ first;
+ // PageControl
+ FPageControl := TPageControl.Create(Owner);
+ FPageControl.Parent := Self;
+ FPageControl.Font.Name := '';
+ FPageControl.Font.Size := 9;
+ FPageControl.Align := alClient;
+ FPageControl.Visible := False;
+
+ { ڴ}
+ setlength(FTabSheets,FPageCount+1);
+ setlength(ScrollBoxs,FPageCount+1);
+ setlength(FootPanels,FPageCount+1);
+ setlength(Splitters,FPageCount+1);
+ setlength(Co_Shapes,FPageCount+1);
+ setlength(Co_DllBtn,FPageCount+1);
+ setlength(Co_Panels,FPageCount+1);
+ SetLength(DGGlides,FPageCount+1);
+
+ XXX := TStringList.Create();
+ for j := 0 to FPageCount do
+ begin
+ { FPageControlҳ}
+ FTabSheets[j] := TTabSheet.Create(Owner);
+ FTabSheets[j].Parent := FPageControl;
+ FTabSheets[j].ParentFont := True;
+ FTabSheets[j].PageControl := FPageControl;
+ FTabSheets[j].Visible := True;
+ FTabSheets[j].PageIndex := j;
+
+ if j < FPageCount then
+ begin
+ Tmp_CheJian := trim(fieldByName(Data_CheJianField).AsString);
+ if Defaultsheet <> '' then //ָĬϳ
+ begin
+ if Tmp_CheJian = Defaultsheet then
+ DefaultIndex := j;
+ end;
+ FTabSheets[j].Caption := '䣺' + Tmp_CheJian;
+ FTabSheets[j].Hint := Tmp_CheJian;
+ XXX.Append(Tmp_CheJian);
+ end
+ else
+ begin
+ Tmp_CheJian := '';
+ FTabSheets[j].Caption := 'δָ';
+ FTabSheets[j].Hint := Tmp_CheJian;
+ XXX.Append('δָ');
+ end;
+ FTabSheets[j].ShowHint := False;
+ FTabSheets[j].Visible := True;
+ FTabSheets[j].Align := alClient;
+
+ //Footҳʾؼ
+ FootPanels[j] := TJKFootpanel.Create(Owner);
+ with FootPanels[j] do
+ begin
+ Visible := True;
+ Parent := FTabSheets[j];
+ // BevelInner := bvLowered;
+ //BevelOuter := bvRaised;
+ Left := 0;
+ Width := 1;
+ Align := alRight;
+ Hint := FTabSheets[j].Hint;
+ ShowHint := False;
+ onDblclick := FootPanelDblclick;
+ LimitLeft := 8;
+ Ctl3D := False;
+ end;
+
+ //ɫʾؼ
+ Co_Panels[j] := Tpanel.Create(Owner);
+ with Co_Panels[j] do
+ begin
+ Visible := True;
+ Parent := FootPanels[j];
+ BevelInner := bvLowered;
+ BevelOuter := bvRaised;
+ height := 40;
+ Co_Panels[j].BorderWidth := 2;
+ Align := alTop;
+ end;
+
+ //ɫʾؼ
+ Co_Shapes[j] := TShape.Create(Owner);
+ with Co_Shapes[j] do
+ begin
+ Visible := True;
+ Parent := Co_Panels[j];
+ Width := FootHeight;
+ Align := alClient;
+ end;
+
+ //ťؼ
+ Co_DllBtn[j] := TSpeedButton.Create(Owner);
+ with Co_DllBtn[j] do
+ begin
+ Visible := True;
+ Parent := FootPanels[j];
+ height := 25;
+ Tag := j;
+ Font.name := '';
+ Font.Size := 9;
+ Align := alTop;
+ Font.Color := ClBlue;
+ //Flat := true;
+ caption := '̴';
+ OnClick := Co_DllBtnClick;
+ end;
+
+ { DbGridؼ DGGlides}
+ DGGlides[j]:= TDBGrid.Create(owner);
+ with DGGlides[j] do
+ begin
+ Visible := True;
+ Parent := FootPanels[j];
+ height := 110;
+ Align := alTop;
+ Tag := j;
+ Font.name := '';
+ Font.Size := 9;
+ ReadOnly := True;
+ Options := [dgEditing,dgMultiSelect]; //,dgRowLines,dgColumnResize,
+ FixedColor := clSkyBlue;
+ OnDrawColumnCell := DGGlideDrawColumnCell;
+ end;
+
+ //ָؼ
+ Splitters[j] := TSplitter.Create(Owner);
+ with Splitters[j] do
+ begin
+ Visible := True;
+ Parent := FTabSheets[j];
+ Width := 4;
+ Align := alRight;
+ end;
+
+ //
+ ScrollBoxs[j] := TScrollBox.Create(Owner);
+ with ScrollBoxs[j] do
+ begin
+ Visible := True;
+ Parent := FTabSheets[j];
+ Color := RGB(100,100,100);//clTeal;
+ Align := alClient;
+ Hint := FTabSheets[j].Hint;
+ ShowHint := False;
+ end;
+
+ next;
+ end;
+
+ end;
+
+ if FEditorstyle = Tscombox then
+ SetLength(comEditors,n)
+ else if FEditorstyle = Tsedit then
+ SetLength(edEditors,n)
+ else
+ SetLength(MemoEditors,n);
+
+
+ { ༭}
+ for i := 0 to n - 1 do
+ begin
+ if DataSource.DataSet.Fieldbyname(Data_CheJianField).AsVariant = null then
+ This_Index := FPageCount
+ else
+ This_Index := XXX.IndexOf(trim(DataSource.DataSet.Fieldbyname(Data_CheJianField).Asstring));
+ if kkk[This_Index] >= Columns -1 then
+ begin
+ kkk[This_Index] := 0;
+ RRR[This_Index] := RRR[This_Index] +1;
+ end
+ else
+ kkk[This_Index] := kkk[This_Index] + 1;
+ tmp_col0 := kkk[This_Index];
+ tmp_Row0 := RRR[This_Index];
+
+ { ݸ֪ؼ AdoListsDsLists}
+ AdoLists[i] := TadoDataset.Create(owner);
+ AdoLists[i].Tag := i;
+ AdoLists[i].AfterScroll:= AdolistsAfterScroll;
+ DsLists[i] := TDatasource.Create(owner);
+ DsLists[i].DataSet := AdoLists[i];
+ DsLists[i].Tag := i;
+ //DsLists[i].OnDataChange := DsListsDataChange;
+ { }
+ Labels[i] := TLabel.Create(owner);
+ Labels[i].visible := FTitleVisible;
+ Labels[i].Parent := (ScrollBoxs[This_Index] as TScrollBox);
+ Labels[i].Font.Name := '';
+ Labels[i].Font.Size := 9;
+ Labels[i].Font.Color := ClBlue;
+ Labels[i].OnClick := LabelsClick;
+ Labels[i].Tag := i;
+ //Labels[i].Font.Style := [FsBold];
+ Labels[i].Transparent := True;
+
+ //̨
+ if DataSource.DataSet.Fieldbyname(DataField_Title).AsVariant <> null then
+ Labels[i].caption := DataSource.DataSet.Fieldbyname(DataField_Title).AsString
+ else
+ Labels[i].caption := '';
+ Tmp_CheJian := trim((ScrollBoxs[This_Index] as TScrollBox).Hint);
+
+ //̨
+ if DataSource.DataSet.Fieldbyname(DataField_ColA).AsVariant <> null then
+ Labels[i].Hint := trim(DataSource.DataSet.Fieldbyname(DataField_ColA).AsString)
+ else
+ Labels[i].Hint := '';
+ Labels[i].ShowHint := False;
+
+ if FEditorstyle = TsMemo then
+ begin
+ Labels[i].Top := FTop + tmp_Row0 * (TextHeight*3+DgHeight+5) + 2;
+ Labels[i].Left := FLeft + (TitleWidth + 20) * tmp_Col0 + 5;
+ Labels[i].Width := TitleWidth;
+ end
+ else
+ begin
+ Labels[i].Top := FTop + tmp_Row0 * (TextHeight*2+DgHeight+5) + 2;
+ Labels[i].Left := FLeft + (TitleWidth + 12) * tmp_Col0;
+ Labels[i].Width := TitleWidth;
+ end;
+
+ { Ϣʾݶ}
+ if FEditorstyle = Tscombox then
+ begin
+ comEditors[i] := TComboBox.Create(Owner);
+ comEditors[i].Parent := ScrollBoxs[This_Index]; //Self;
+ comEditors[i].Left := Labels[i].Left; //+ Labels[i].Width;
+ comEditors[i].Width := maxTextLen;
+ if FTitleVisible then
+ comEditors[i].Top := Labels[i].Top+14
+ else
+ comEditors[i].Top := Labels[i].Top;
+
+ if DataSource.DataSet.Fieldbyname(DataField_Editor).AsVariant <> null then
+ comEditors[i].Text := DataSource.DataSet.Fieldbyname(DataField_Editor).AsString;
+ comEditors[i].OnKeyPress := OnKeyPress;
+ comEditors[i].OnKeyDown := OnKeyDown;
+ comEditors[i].Visible := EditorVisible;
+ comEditors[i].Tag := i;
+
+ DGLists[i] := TDbGrid.Create(Owner);
+ DGLists[i].Parent := ScrollBoxs[This_Index];
+ DGLists[i].Font.name := '';
+ DGLists[i].Font.Size := 9;
+ DGLists[i].ReadOnly := True;
+ DGLists[i].FixedColor := clSkyBlue;
+ DGLists[i].Left := comEditors[i].Left;
+ DGLists[i].Width := comEditors[i].Width;
+ DGLists[i].Height := DgHeight;
+ DGLists[i].Options := [dgRowSelect];
+ if EditorVisible then
+ DGLists[i].Top := comEditors[i].Top+comEditors[i].height+2
+ else
+ DGLists[i].Top := comEditors[i].Top+2;
+ DGLists[i].Hint := trim(Labels[i].caption);
+ DGLists[i].ShowHint := False;
+
+ DGLists[i].OnDrawColumnCell := DGListsDrawColumnCell;
+ DGLists[i].OnCellClick := DGListsCellClick;
+ DGLists[i].Tag := i;
+ ColorLabels[i] := TLabel.Create(Owner);
+ ColorLabels[i].Parent := ScrollBoxs[This_Index];
+ ColorLabels[i].AutoSize := true;
+ ColorLabels[i].Font.name := '';
+ ColorLabels[i].Font.Size := 9;
+ ColorLabels[i].Top := Labels[i].top;
+ ColorLabels[i].Left := Labels[i].Left + round(Labels[i].Width/2)+20;
+ ColorLabels[i].Width := round(Labels[i].Width/2)-20;
+ ColorLabels[i].BringToFront;
+ ColorLabels[i].Tag := i;
+ ColorLabels[i].Font.Color := ClWhite;
+ ColorLabels[i].Color := RGB(100,100,100);
+ ColorLabels[i].Caption := '';
+ end
+ else if FEditorstyle = Tsedit then
+ begin
+ edEditors[i] := Tedit.Create(Owner);
+ edEditors[i].Parent := ScrollBoxs[This_Index];
+ edEditors[i].Left := Labels[i].Left; //+ Labels[i].Width;
+ edEditors[i].Width := maxTextLen;
+ if FTitleVisible then
+ edEditors[i].Top := Labels[i].Top+14
+ else
+ edEditors[i].Top := Labels[i].Top;
+ edEditors[i].ReadOnly := DataReadOnly;
+ if DataSource.DataSet.Fieldbyname(DataField_Editor).AsVariant <> null then
+ edEditors[i].Text := DataSource.DataSet.Fieldbyname(DataField_Editor).AsString;
+ edEditors[i].OnKeyPress := OnKeyPress;
+ edEditors[i].OnKeyDown := OnKeyDown;
+ edEditors[i].Visible := EditorVisible;
+ DGLists[i] := TDbGrid.Create(Owner);
+ DGLists[i].Parent := ScrollBoxs[This_Index];
+ DGLists[i].Font.name := '';
+ DGLists[i].Font.Size := 9;
+ DGLists[i].ReadOnly := True;
+ DGLists[i].Options := [dgRowSelect];
+ DGLists[i].FixedColor := clSkyBlue;
+ DGLists[i].Left := edEditors[i].Left;
+ DGLists[i].Width := edEditors[i].Width;
+ DGLists[i].Height := DgHeight;
+ DGLists[i].Tag := i;
+ if EditorVisible then
+ DGLists[i].Top := edEditors[i].Top+edEditors[i].height+2
+ else
+ DGLists[i].Top := edEditors[i].Top+2;
+ DGLists[i].Hint := trim(Labels[i].caption);
+ DGLists[i].ShowHint := False;
+ DGLists[i].OnDrawColumnCell := DGListsDrawColumnCell;
+ DGLists[i].OnCellClick := DGListsCellClick;
+ DGLists[i].Tag := i;
+
+ ColorLabels[i] := TLabel.Create(Owner);
+ ColorLabels[i].Parent := ScrollBoxs[This_Index];
+ ColorLabels[i].AutoSize := False;
+ ColorLabels[i].Font.name := '';
+ ColorLabels[i].Font.Size := 9;
+ ColorLabels[i].Top := Labels[i].top;
+ ColorLabels[i].Left := Labels[i].Left + round(Labels[i].Width/2)+20;
+ ColorLabels[i].Width := round(Labels[i].Width/2)-20;
+ ColorLabels[i].BringToFront;
+ ColorLabels[i].Tag := i;
+ ColorLabels[i].Font.Color := ClWhite;
+ ColorLabels[i].Color := RGB(100,100,100);
+ ColorLabels[i].Caption := '';
+ end
+ else
+ begin
+ MemoEditors[i] := Tmemo.Create(Owner);
+ MemoEditors[i].Parent := ScrollBoxs[This_Index];
+ MemoEditors[i].Left := Labels[i].Left;
+ MemoEditors[i].Width := maxTextLen;
+ if FTitleVisible then
+ MemoEditors[i].Top := Labels[i].Top+14
+ else
+ MemoEditors[i].Top := Labels[i].Top;
+ MemoEditors[i].Height := 60;
+ MemoEditors[i].ReadOnly := DataReadOnly;
+ if DataSource.DataSet.Fieldbyname(DataField_Editor).AsVariant <> null then
+ MemoEditors[i].Lines.Add(DataSource.DataSet.Fieldbyname(DataField_Editor).AsString);
+ MemoEditors[i].OnKeyPress := OnKeyPress;
+ MemoEditors[i].OnKeyDown := OnKeyDown;
+ MemoEditors[i].Visible := EditorVisible;
+ MemoEditors[i].Tag := i;
+ DGLists[i] := TDbGrid.Create(Owner);
+ DGLists[i].Parent := ScrollBoxs[This_Index];
+ DGLists[i].Font.name := '';
+ DGLists[i].Font.Size := 9;
+ DGLists[i].ReadOnly := True;
+ DGLists[i].FixedColor := clSkyBlue;
+ DGLists[i].Left := MemoEditors[i].Left;
+ DGLists[i].Width := MemoEditors[i].Width;
+ DGLists[i].Height := DgHeight;
+ DGLists[i].Options := [dgRowSelect];
+ if EditorVisible then
+ DGLists[i].Top := MemoEditors[i].Top+MemoEditors[i].height+2
+ else
+ DGLists[i].Top := MemoEditors[i].Top+2;
+ DGLists[i].Hint := trim(Labels[i].caption);
+ DGLists[i].ShowHint := False;
+ DGLists[i].OnDrawColumnCell := DGListsDrawColumnCell;
+ DGLists[i].OnCellClick := DGListsCellClick;
+ DGLists[i].Tag := i;
+
+ ColorLabels[i] := TLabel.Create(Owner);
+ ColorLabels[i].Parent := ScrollBoxs[This_Index];
+ ColorLabels[i].AutoSize := False;
+ ColorLabels[i].Font.name := '';
+ ColorLabels[i].Font.Size := 9;
+ ColorLabels[i].Left := DGLists[i].Left + DGLists[i].Width +1;
+ ColorLabels[i].Height := DGLists[i].Height + MemoEditors[i].Height;
+ ColorLabels[i].Top := DGLists[i].Top;
+ ColorLabels[i].Tag := i;
+ ColorLabels[i].Font.Color := ClWhite;
+ ColorLabels[i].Color := RGB(100,100,100);
+ ColorLabels[i].Caption := '';
+ end;
+ Tmp_Parm := trim(DataSource.DataSet.Fieldbyname(DataField_Editor).Value);
+ with AdoLists[i] do
+ begin
+ DisableConTrols;
+ Active := False;
+ ConnectionString := Fcnnstr; //ݿӴ
+ CursorType := ctStatic;
+ LockType := ltReadOnly;
+ CommandText := Data_DgListSql;
+ Parameters.ParamValues['ListParm'] := Tmp_Parm;
+ Active := True;
+ {
+ tmpSql := 'select a.AutoID,case a.MachMiss when ''0000000000'' then '
+ + 'convert(varchar(20),f.GlideName) else convert(varchar(20),d.ShortName) end'
+ + ' as ShortName,rtrim(b.MP_Crock) as MP_Crock,'
+ + 'convert(varchar(20),c.ChnName) as ChnName,a.MachLen,'
+ + 'convert(varchar(20),f.GlideName) as GlideName,'
+ + 'a.MachMiss,a.TaskOrder,a.Status,'
+ + 'c.RedCode,c.GreenCode,c.BlueCode'
+ + ' from MD_Dev_Mission a '+#10#13
+ + ' left join MD_PlanCrock b on b.mp_autocrk = left(a.MachMiss,10)'
+ + ' left join Mc_color c on c.ColorId = b.MP_Color '
+ + ' left join Mc_Glide f on f.GlideNo = a.MachGlide'+#10#13
+ + ' left join BC_Customer d on d.customno = b.MP_Customno'+#10#13
+ + ' where a.Status <> ''6'''
+ + ' and a.Machine =:ListParm'+#10#13
+ + ' order by a.Machine,a.TaskOrder';
+ }
+ for k := 0 to Fields.Count -1 do
+ Fields[k].Visible := False;
+ Fieldbyname('ShortName').Visible := True; //ӹλ
+ Fieldbyname('MP_Crock').Visible := True; //Ǹ
+ Fieldbyname('ChnName').Visible := True; //ɫ
+ Fieldbyname('MachLen').Visible := True; //
+ Fieldbyname('GlideName').Visible := True; //
+ DGLists[i].DataSource := DsLists[i];
+ EnableConTrols;
+ DGLists[i].Columns[0].width := 50;
+ DGLists[i].Columns[1].width := 30;
+ DGLists[i].Columns[2].width := 55;
+ DGLists[i].Columns[3].width := 45;
+ DGLists[i].Columns[4].width := 50;
+ //DGLists[i].Columns[0].Alignment := TaCenter;
+ //DGLists[i].Columns[1].Alignment := TaCenter;
+ //DGLists[i].Columns[2].Alignment := TaCenter;
+ //DGLists[i].Columns[3].Alignment := TaCenter;
+ //DGLists[i].Columns[4].Alignment := TaCenter;
+ First;
+ end;
+
+ Shapes[i] := TShape.Create(Owner);
+ Shapes[i].Parent := ScrollBoxs[This_Index];
+ Shapes[i].Left := Labels[i].Left - 5;
+ Shapes[i].top := Labels[i].Top - 5;
+ if FEditorstyle = TsMemo then
+ begin
+ Shapes[i].height := ColorLabels[i].height + Labels[i].height +20 +10;
+ Shapes[i].Width := (ColorLabels[i].left - Labels[i].left) + ColorLabels[i].Width + 10;
+ end
+ else
+ begin
+ Shapes[i].height := (DGLists[i].Top + DGLists[i].Height - Labels[i].Top)+ 10;
+ Shapes[i].Width := Labels[i].Width +10;
+ end;
+ Shapes[i].Brush.Color := clSkyBlue;
+ Shapes[i].Visible := True;
+ Shapes[i].SendToBack;
+ Shapes[i].Tag := i;
+ if not DataSource.DataSet.Eof then
+ DataSource.DataSet.next;
+ end;
+ DataSource.DataSet.EnableControls;
+ tmpado.Close;
+ XXX.Free;
+ if FPageControl.PageCount > 0 then
+ begin
+ FPageControl.ActivePageIndex := FPageControl.PageCount-1;
+ FPageControl.ActivePageIndex := DefaultIndex;
+ end;
+ Finally
+ FPageControl.Visible := True;
+ end;
+end;
+
+procedure TJkPanel.Co_DllBtnClick(Sender: TObject);
+var
+ this_Gh :String;
+ k :Integer;
+
+begin
+ if not CanLCCL then //жǷȨ
+ begin
+ application.messagebox('ԲĿǰûбȨܡ','Ϣʾ',mb_ok or MB_ICONInformation);
+ Exit;
+ end;
+ k := (sender as TSpeedButton).Tag;
+ if not FootPanels[k].DataSource.dataset.active then exit;
+ if Co_DllBtn[k].Caption = '̴' then
+ begin
+ if FootPanels[k].DataSource.dataset.FieldValues[''] = null then exit;
+ this_Gh := FootPanels[k].DataSource.dataset.fieldbyname('').AsString;
+ //̴ִ
+ DoAbnormalC(TmpHandle,cnn_Base,V_UserId,V_User,this_Gh);
+ end
+ else
+ begin
+ //ִϴ
+ if This_Jth <> '' then
+ DoRinseprt(TmpHandle,cnn_Base,V_UserId,V_User,This_Jth,This_TaskOrder);
+ end;
+end;
+
+procedure TJkPanel.DGListsDrawColumnCell(Sender: TObject;
+ const Rect: TRect; DataCol: Integer; Column: TColumn;
+ State: TGridDrawState);
+var
+ Redcode,GreenCode,BlueCode,TmpStatus :Integer;
+begin
+ with (Sender as TdbGrid) do
+ begin
+ if DataSource = nil then exit;
+ if not DataSource.DataSet.Active then exit;
+ Redcode := (DataSource.DataSet as TAdoDataset).fieldByName('Redcode').AsInteger;
+ Greencode := (DataSource.DataSet as TAdoDataset).fieldByName('Greencode').AsInteger;
+ Bluecode := (DataSource.DataSet as TAdoDataset).fieldByName('Bluecode').AsInteger;
+ TmpStatus := (DataSource.DataSet as TAdoDataset).fieldByName('Status').AsInteger;
+ if gdFocused in State then
+ begin
+ Canvas.Brush.Color := clblack;
+ Canvas.Font.Color := Clred;
+ end
+ else if TmpStatus = 5 then
+ begin
+ Canvas.Font.Color := clBlue;
+ Canvas.Brush.Color := clWhite;
+ Canvas.Font.Style := [fsBold]; //fsItalic
+ ColorLabels[(Sender as TDbGrid).Tag].Color := RGB(Redcode,Greencode,Bluecode);
+ if (Redcode <=10) or (Bluecode <=10) or (Greencode <=10) then
+ ColorLabels[(Sender as TDbGrid).Tag].Font.Color := ClWhite
+ else
+ ColorLabels[(Sender as TDbGrid).Tag].Font.Color := ClBlack;
+ ColorLabels[(Sender as TDbGrid).Tag].Caption := '';
+ end
+ else if (Redcode <=100) or (Greencode <=100) then
+ begin
+ Canvas.Font.Color := ClWhite;
+ Canvas.Brush.Color := RGB(Redcode,Greencode,Bluecode);
+ end
+ else
+ begin
+ Canvas.Font.Color := ClBlack;
+ Canvas.Brush.Color := RGB(Redcode,Greencode,Bluecode);
+ end;
+ DefaultDrawColumnCell(Rect,DataCol,Column,State);
+ end;
+end;
+
+procedure TJkPanel.DGGlideDrawColumnCell(Sender: TObject;
+ const Rect: TRect; DataCol: Integer; Column: TColumn;
+ State: TGridDrawState);
+begin
+ with (Sender as TDbGrid) do
+ begin
+ if DataSource = nil then exit;
+ if not DataSource.DataSet.Active then exit;
+ if gdFocused in State then exit;
+ if (Sender as TDbGrid).SelectedRows.CurrentRowSelected then
+ begin
+ Canvas.Brush.Color := clHighlight;
+ Canvas.Font.Color := ClWhite;
+ end
+ else if DataSource.DataSet.RecNo mod 2 = 0 then
+ begin
+ Canvas.Brush.Color := $00DEDEDE;
+ Canvas.Font.Color := ClBlack;
+ end
+ else
+ begin
+ Canvas.Brush.Color := clwhite;
+ Canvas.Font.Color := ClBlack;
+ end;
+ DefaultDrawColumnCell(Rect,DataCol,Column,State);
+ end;
+end;
+
+procedure TJkPanel.refreshFootpanel(Tag :integer);
+var
+ i,Listindex,PageIndex :integer;
+ R,G,B :Integer;
+ tmpCarN0 :String;
+ TmpMachMiss :String; //
+begin
+ try
+ PageIndex := FPageControl.ActivePageIndex;
+ Listindex := Tag;
+ if AdoLists[Listindex].RecordCount = 0 then
+ begin
+ FootPanels[PageIndex].DataSource := Nil;
+ exit;
+ end;
+ //ȡ̨
+ This_Jth := Labels[Listindex].Hint;
+ //ȡ
+ This_TaskOrder := trim(AdoLists[Listindex].FieldByName('TaskOrder').AsString);
+ TmpMachMiss := trim(AdoLists[Listindex].FieldByName('MachMiss').AsString);
+ if TmpMachMiss = '0000000000' then
+ Co_DllBtn[PageIndex].Caption := 'ϴ'
+ else
+ Co_DllBtn[PageIndex].Caption := '̴';
+
+ with tmpado do
+ begin
+ DisableConTrols;
+ Active := False;
+ ConnectionString := Fcnnstr;
+ CursorType := ctStatic;
+ LockType := ltReadOnly;
+ CommandText := Data_FootSql;
+ Parameters.ParamValues['FootParm'] := AdoLists[Listindex].Fields[0].Value;
+ Active := True;
+ for i := 0 to fieldCount -1 do
+ tmpado.Fields[i].Alignment := taLeftJustify;
+ tmpDs.dataset := tmpado;
+ EnableConTrols;
+ end;
+ with adoGlides do
+ begin
+ DisableConTrols;
+ Active := False;
+ ConnectionString := Fcnnstr;
+ CursorType := ctStatic;
+ LockType := ltReadOnly;
+ CommandText := Data_GlideSql;
+ if AdoLists[Listindex].Fieldbyname('MachMiss').AsString <> null then
+ begin
+ tmpCarN0 := trim(AdoLists[Listindex].Fieldbyname('MachMiss').AsString);
+ tmpCarN0 := Copy(tmpCarN0,1,10);
+ end
+ else
+ tmpCarN0 := '////';
+ Parameters.ParamValues['PCarNo'] := tmpCarN0;
+ Active := True;
+ First;
+ EnableConTrols;
+ end;
+ DGGlides[PageIndex].DataSource := DsGlides;
+ DGGlides[PageIndex].Columns[0].Width := 74;
+ DGGlides[PageIndex].Columns[1].Width := 40;
+ FootPanels[PageIndex].Width := 140;
+ FootPanels[PageIndex].Columns := 1;
+ FootPanels[PageIndex].DataSource := tmpDs;
+ FootPanels[PageIndex].CreateEditors(tmpDs,1);
+ R := 255; G:= 255; B := 255;
+ R := AdoLists[Listindex].Fieldbyname('RedCode').AsInteger;
+ G := AdoLists[Listindex].Fieldbyname('GreenCode').AsInteger;
+ B := AdoLists[Listindex].Fieldbyname('BlueCode').AsInteger;
+ Co_Shapes[PageIndex].Brush.Color := RGB(R,G,B);
+ except
+ //
+ end;
+end;
+
+procedure TJkPanel.DGListsCellClick(Column: TColumn);
+var
+ tmpIdx,TmpCol,TmpTag :Integer;
+begin
+ if not Column.Grid.DataSource.DataSet.Active then exit;
+ if Column.Grid.DataSource.DataSet.RecordCount = 0 then exit;
+
+ if Column.Grid.DataSource.DataSet.RecNo = 1 then
+ begin
+ tmpIdx := (Column.Grid as TCustomDbGrid).ComponentIndex;
+ TmpCol := Column.Index;
+ if TmpDgListIdx = -1 then
+ begin
+ TmpDgListIdx := tmpIdx;
+ TmpDgListCol := TmpCol;
+ refreshFootpanel((Column.Grid as TCustomDbGrid).DataSource.DataSet.Tag);
+ end
+ else
+ begin
+ if TmpDgListIdx <> tmpIdx then
+ refreshFootpanel((Column.Grid as TCustomDbGrid).DataSource.DataSet.Tag);
+ TmpDgListIdx := tmpIdx;
+ TmpDgListCol := TmpCol;
+ end;
+ (Column.Grid as TCustomDbGrid).SetFocus;
+ end
+end;
+
+procedure TJkPanel.AdolistsAfterScroll(DataSet: TDataSet);
+begin
+ //ˢ Footpanel
+ refreshFootpanel(DataSet.tag);
+end;
+
+
+//ӦLabels[i]Click¼
+procedure TJkPanel.LabelsClick(Sender: TObject);
+begin
+ //
+end;
+
+{
+procedure TJkPanel.LabelsClick(Sender: TObject);
+var
+ i :integer;
+ Tmp_CheJian,Tmp_JiTai :String;
+begin
+
+ try
+ if FP_Parent = nil then inti_Grid(Sender);
+ if FP_Parent = nil then exit;
+ Tmp_JiTai := trim((Sender as Tlabel).Caption);
+ Tmp_CheJian := trim(((Sender as Tlabel).Parent as TScrollBox).Hint);
+ if tmpado.Active then
+ begin
+ if tmpado.FieldValues['̨'] <> null then
+ if tmpado.FieldByName('̨').AsString = Tmp_JiTai then
+ exit;
+ end;
+ screen.Cursor := crSQLWait;
+ //FP_Parent.Visible := False;
+ //FP_Parent.Left := FPageControl.Left + (Sender as Tlabel).Left + (Sender as Tlabel).Width + 28;
+ //FP_Parent.Top := FPageControl.Top + (Sender as Tlabel).top + (Sender as Tlabel).Height +4;
+ FP_Move.Caption := trim((Sender as Tlabel).Hint) + 'ϸб';
+ with tmpado do
+ begin
+ DisableConTrols;
+ Active := False;
+ ConnectionString := Fcnnstr;
+ tmpado.CursorType := ctStatic;
+ tmpado.LockType := ltReadOnly;
+ CommandText := 'Exec '+Data_BerthListSql+' '''+Tmp_CheJian+''','''+Tmp_JiTai+'''';
+ Active := True;
+ First;
+ EnableConTrols;
+ for i := 0 to Fields.Count -1 do
+ begin
+ Fields[i].Alignment := taCenter;
+ if i = 0 then
+ fields[i].DisplayWidth := 20
+ else
+ fields[i].DisplayWidth := 8;
+
+ Fpass_Grid.Columns[i].Title.Alignment := taCenter;
+ Fpass_Grid.Columns[i].Title.Font.Style:= [];
+ end;
+
+ end;
+ screen.Cursor := crDefault;
+ FP_Parent.Visible := True;
+ except
+ screen.Cursor := crDefault;
+ end;
+end;
+ }
+
+procedure TJkPanel.FootPanelDblclick(Sender: TObject);
+begin
+ if sender is TScrollBox then
+ (sender as TScrollBox).Parent.width := 1;
+end;
+
+procedure TJkPanel.FP_MovePanelDblClick(Sender: TObject);
+begin
+ FP_Parent.Visible := False;
+end;
+
+ //Registerؼ
+procedure Register;
+begin
+ RegisterComponents('Data Controls', [TJkPanel]);
+end;
+
+// ڴͷҪ˳ģԴ෴˳Уǵ֮иӹϵʱ
+procedure TJkPanel.FreeEditors;
+begin
+ if FPageControl <> nil then
+ begin
+ if FP_Parent <> nil then
+ begin
+ try
+ FPass_Grid.Free;
+ FP_Move.Free;
+ FP_Parent.Free;
+ except
+ //
+ end;
+ end;
+ DGGlides := nil;
+ DsGlides := nil;
+ AdoGlides := nil;
+ DsGlides.Free;
+ AdoGlides.Free;
+
+ DGLists := nil;
+ DsLists := nil;
+ AdoLists := nil;
+
+ FPass_Grid := nil;
+ FP_Move := nil;
+ FP_Parent := nil;
+ Shapes := nil;
+ ProgressBars := nil;
+ comEditors := nil;
+ edEditors := nil;
+ MemoEditors := nil;
+ ScrollBoxs := nil;
+
+ Splitters := nil;
+ Co_Shapes:= nil;
+ Co_DllBtn := Nil;
+ Co_Panels:= nil;
+ FootPanels := nil;
+
+ tmpDs.Free;
+ tmpado.Free;
+
+ FPageControl.Free;
+ end;
+end;
+
+end.
+
diff --git a/T03贸易布匹检验/DbPanel/.svn/text-base/L_DBDateTime.dcr.svn-base b/T03贸易布匹检验/DbPanel/.svn/text-base/L_DBDateTime.dcr.svn-base
new file mode 100644
index 0000000000000000000000000000000000000000..13509775eba0c5e19a678feba4ea9777d644eaec
GIT binary patch
literal 2164
zcmeIyv2oNu6b9f28^7E}u1B1t>AtFNdC*Lpa
z?$fUJTvfG@-1+#&@$#YSqbte#`dnY@M}4a=^}Rlwt)8Esw74HH{w$|=bzXkD-+O%?
zE;Py>oyH;)YWSrIwaPSMb{sUJHkl^WF4KfrWYE9nxG1q0W^rp#U#1Cy`ZA$bnI_B!
z9W27KtXz$q$-Pt4tH-!VH>Fn@kgGmubRW#6gpDL5D?c
zLM^NMGGQ+Epb53gG-1AoK@)0|X+rHXO_(oj(Byo9L-qL+YH9T)!hE@dCe$j^g!$qJ
zO{h(#3AM{KK_m5La&DMm(=?%$O?{bQF!g0ZtujqeNPU@5n@kgGmuZ5F>dWNZpu;9@
zLM^-cGC^ncWkRhoO)#+fGNCq^Ce$v|1Sj=na(*GkvGQ^DrC97jnxL`zGND$PCKyP4
znNXWd6Ka=ff})0$$^1w2FOJ(Ra-80-cDuNDbe#=uk4LyU-X8h5s^`(-ahvM_X8()f
zJ=%5u+2HZR8~HE#UypEo_g>&)1{d9ri60Ai)&KGAj)@=rua@xQ0WQk^zIDC4zuW!)
I^m+w;0@}}_)c^nh
literal 0
HcmV?d00001
diff --git a/T03贸易布匹检验/DbPanel/.svn/text-base/L_DBDateTime.dcu.svn-base b/T03贸易布匹检验/DbPanel/.svn/text-base/L_DBDateTime.dcu.svn-base
new file mode 100644
index 0000000000000000000000000000000000000000..eb169d57fdda046ac0d3db4d03e22e4f34cbcdae
GIT binary patch
literal 6578
zcmd^Cjgwo|b-(vmetRvnYe|;n^;#G$vE8+2Q5Sp3fD5j)(k|HX+UxzWvk-qgzxSkl
zwpMQ~J=tESCUO=SHi`j%U;;G+CpDp&CS{;7OkjYpTWrEd5{D*~kGA8sX$l$Fr48em
zx~rb^p1#-l3#u92_wM;{;#5Bubo2le*mUxz2T~WWBN@)9SB^a|&BULiO
z_Ij(F)KyYc$hAC*Uf1#1Mh}?dXf7N^4uAbJQ7bM7XoW@f(lIS#rj7AMB)Fs=L@!GY
z{3oqFTk{Cno<_}z+7Q#_q>(76nMc$~V_P#dn@*9cyp<3e8kM22>
zSXfI7*&h7uJOBC{G_poV2yL_oo8(dLWnx%V$Ixr2dR*7kvji@v1G`n-d=mjh6|t^C
zc{j$eRIZ8&v98i2ehmdx9x$?LMccpV@pE=8EH^?!V=88+UsH^<8tClUh9;C;B=ahQ
zg*6CzZ4*M6H(GsAJ7|7-?w*enb#9N59<5p)H&6<5Q?-E_2BW>*2X*uDm;deKL_@T9
zXZKgv4<3$O{v_cW+@`0B{GmuDqbE{>#zUWm{u=A08d3LTGiEfYYbg`$H6JF9#WfsB
z6fG@$jNnDpa8yo3vZgVh->n@daA6(TuVoNALD01|kdeYVll7FQ+AJrDrMZU1s#1I3
zJx1u#*(kcA8V78iQ^fP78Xok`7>$qz>r)vmZFXsKBdtA2jMx1E#y%sXo4S$u4l&il
zDyGHJ+`hCihMIIO^VBRg#l2H))OU%=U%gg|DW!gouqD+PZCxuDo6~wiPd!fzHQ6XL
zP_q7p;F_osY}ZKlK@(G&d4X7Jyg-(iwqI8?V#HE=kvM8n+J{*&Z6DqsuqLJbnye0(
zSl!bE)dUeM8(S@|+9fM{6KNxxQhzo}`M`*AplISR2wYI@KK5Y@ukuR*TB-pIy_`*&
zcAnF}C%h)6>r?xwC!$$%KC4&SuZ@vIf`A%V(B3XGGII?
zt&Er3ctXckHU8j(pZ~4~wvJ(|&!;dL4-rh(6}5-9r7=I&RykHLxh1Qm$JgWbOUGqJ
zJ5I25iraRD>@H>XiL6ytr|LNdZ!rQNrLt46QYUXAA*OxGS1LK(?Q?DE^i8-5$13L%L{xf2|S|&qP
zTsr^oFt=MoH3bz=$|^h(QcP{MM2I&GZr;5IJJ&1s{^icNG+?H&$iM!6;n#6zB$d%C
zbBwdi7>dL#OX;w%WAW`9yycWs7sDV_G!g@u()P=mG
zg+2t>3Vbi#64^3Kh5d!V9Lfq8eg~AlB644R|84GLtMJxUradsfW%xRO5JIct&8*E^
zg@mHL8s3U>(kDGp_L696bqr|9c-(*a`i5d1`voX