⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cqyskbb.~pas

📁 这是用Delphi编写的中小企业管理系统
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
        Bold := False;
      if (fsUnderline	 in BtFont.RFontStyle) then
        underline := True
      else
        underline := False;
      if (fsItalic	 in BtFont.RFontStyle) then
        Italic := True
      else
        Italic := False;
      if (fsStrikeOut	in BtFont.RFontStyle) then
        Strikeout := True
      else
        Strikeout := False;
      ypos := ypos+Content.BtHeight ;
      printLeft('操作员姓名:',zbj);
      printleft(Trim(czyxx.czymc),Content.Czyjj+zbj);
      PrintRight(FormatDateTime('yyyy-mm-dd',Now),zbj+Rowzdkd);
      printRight('时间:',zbj+Rowzdkd-Content.sjjj);
      ypos := ypos+Content.Bgjj;
      m:= zds mod Cols;
      n:= zds div Cols;
      if m<>0 then
        n:=n+1;//n记录需要折几行
      For i:=0 to n-1 do
      begin
        Cleartabs;
        setFont(BgtitleFont.RFontName,BgtitleFont.RFontSize);
        FontColor := BgtitleFont.RFontColor;
        if (fsBold in BgTitleFont.RFontStyle) then
          Bold := True
        else
          Bold := False;
        if (fsUnderline	 in BgTitleFont.RFontStyle) then
          underline := True
        else
          underline := False;
        if (fsItalic in BgTitleFont.RFontStyle) then
          Italic := True
        else
          Italic := False;
        if (fsStrikeOut	in BgTitleFont.RFontStyle) then
          Strikeout := True
        else
          Strikeout := False;
        setpen(clblack,pssolid,1,pmcopy);
        settab(zbj,pjcenter,Azdkd[Cols*i],0,boxlineall,0);//在折行时,第一个字段的宽度等于每行的列数*行号(第一行行号为0)
        if i <>n-1 then //不是最后一行
          if Cols = 1 then
            tab(-2,-2,-2,-2,10)
          else
            tab(-2,Na,-2,-2,10)
        else
        begin
          if m<>0 then
          begin
            if (Cols = 1) then  //每行只有一列
              tab(-2,-2,-2,-2,10)
            else if m=1 then
              tab(-2,-2,-2,-2,10)
            else
              tab(-2,na,-2,-2,10);
          end
          else
          begin
            if Cols = 1 then
              tab(-2,-2,-2,-2,10)
            else
              tab(-2,Na,-2,-2,10)
          end;
        end;
        Print(Azdmc[Cols*i]);
        if Cols<>1 then
          if m=0 then //折行时最后一行字段数等于指定的字段数
          begin
            For l:=1 to Cols-1 do
            begin
              settab(na,pjcenter,Azdkd[Cols*i+l],0,boxlineall,0);
                if l=Cols-1 then
                  tab(na,-2,-2,-2,10)
                else
                  tab(na,Na,-2,-2,10);
              Print(Azdmc[Cols*i+l]);
            end;
          end
          else //折行时最后一行字段数不等于指定的字段数
          begin
            if i= n-1 then //最后一行
              For l :=1 to m-1 do
              begin
                if m>0 then
                begin
                  settab(na,pjcenter,Azdkd[Cols*i+l],0,boxlineall,0);
                    if l=m-1 then
                      tab(na,-2,-2,-2,10)
                    else
                      tab(na,Na,-2,-2,10);
                  Print(Azdmc[Cols*i+l]);
                end;
              end
            else
            begin
              For l := 1 to Cols-1 do
              begin
                settab(na,pjcenter,Azdkd[Cols*i+l],0,boxlineall,0);
                  if l=cols-1 then
                    tab(na,-2,-2,-2,10)
                  else
                    tab(na,na,-2,-2,10);
                Print(Azdmc[Cols*i+l]);
              end;
            end;
          end;
        ClearTabs;
        setFont(BgFont.RFontName,BgFont.RFontSize);
        FontColor := BgFont.RFontColor;
        if (fsBold in BgFont.RFontStyle) then
          Bold := True
        else
          Bold := False;
        if (fsUnderline	 in BgFont.RFontStyle) then
          underline := True
        else
          underline := False;
        if (fsItalic	 in BgFont.RFontStyle) then
          Italic := True
        else
          Italic := False;
        if (fsStrikeOut	in BgFont.RFontStyle) then
          Strikeout := True
        else
          Strikeout := False;
        Case Content.Bgdqfs of
          0: Justify := pjLeft;
          1: Justify := pjRight;
          2: Justify := pjCenter;
        end;
        settab(zbj,Justify,Azdkd[Cols*i],0,boxlineall,0);
        if Cols<>1 then
          if m=0 then //折行时最后一行字段数等于指定的字段数
          begin
            For l:=1 to Cols-1 do
            begin
              settab(na,Justify,Azdkd[Cols*i+l],0,boxlineall,0);
            end;
          end
          else //折行时最后一行字段数不等于指定的字段数
          begin
            if i= n-1 then //最后一行
            begin
              if m>1 then
                For l :=1 to m-1 do
                  settab(na,Justify,Azdkd[Cols*i+l],0,boxlineall,0);
            end
            else
            begin
              For l := 1 to Cols-1 do
                settab(na,Justify,Azdkd[Cols*i+l],0,boxlineall,0);
            end;
          end;
        println('');
        For r:=1 to bg.RowCount-1 do
        begin
          if m = 0 then
          begin
            For l:=0 to Cols-1 do
            begin
              if l=0 then//第一列
                if Cols<>1 then
                  Tab(-2,na,na,na,0)
                else
                  Tab(-2,-2,na,na,0)
              else if l=Cols-1 then //最后一列
                Tab(na,-2,na,na,0)
              else
                Tab(na,na,na,na,0);
              Print(bg.Cells[i*Cols+l+1,r]);
            end;
          end
          else
          begin
            if i = n-1 then
            begin
              For l :=0 to m-1 do
              begin
                if l=0 then //第一列
                  if m>1 then
                    Tab(-2,na,na,na,0)
                  else
                    Tab(-2,-2,na,na,0)
                else if l=m-1 then //最后一列
                  Tab(na,-2,na,na,0)
                else
                  Tab(na,na,na,na,0);
                Print(bg.Cells[i*Cols+l+1,r]);
              end;
            end
            else
            begin
              For l :=0 to Cols-1 do
              begin
                if l=0 then //第一列
                  Tab(-2,na,na,na,0)
                else if l=Cols-1 then //最后一列
                  Tab(na,-2,na,na,0)
                else
                  Tab(na,na,na,na,0);
                Print(bg.Cells[i*Cols+l+1,r]);
              end;
            end;
          end;
          Println('');
        end;
      end;
    end;
end;

procedure Tf_cqyskbb.dyClick(Sender: TObject);
begin
  Rprinter.Execute;
end;

procedure Tf_cqyskbb.ylClick(Sender: TObject);
begin
  Application.CreateForm(Tf_cqyskdysz,f_cqyskdysz);
  f_cqyskdysz.ShowModal;
  f_cqyskdysz.Free;
end;

procedure Tf_cqyskbb.bgClick(Sender: TObject);
var
  Rect: TRect;
begin
  if row<>0 then
  begin
    rect := bg.CellRect(0,row);
    bg.Canvas.Brush.Color := clBtnFace;
    bg.Canvas.FillRect(rect);
  end;
  rect := bg.CellRect(0,row1);
  bg.Canvas.Draw(rect.Left+Trunc((rect.Right-rect.Left-tx.Width)/2),rect.Top+Trunc((rect.Bottom-rect.Top-tx.Height)/2),tx.Picture.Graphic);
  row := row1;
  bg.Repaint;
end;

procedure Tf_cqyskbb.bgSelectCell(Sender: TObject; ACol, ARow: Integer;
  var CanSelect: Boolean);
begin
  row1 := Arow;
end;

procedure Tf_cqyskbb.bgDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  rect1: TRect;
begin
  SetGridFieldName;
  if Row1<>0 then
  begin
    rect1 := bg.CellRect(0,row1);
      bg.Canvas.Draw(rect1.Left+Trunc((rect1.Right-rect1.Left-tx.Width)/2),rect1.Top+Trunc((rect1.Bottom-rect1.Top-tx.Height)/2),tx.Picture.Graphic);
  end;
  rect1 := bg.CellRect(0,0);
  bg.Canvas.Brush.Color := clBtnFace;
  bg.Canvas.FillRect(rect1);
end;

procedure Tf_cqyskbb.SetGridFieldName;
var
  rect: TRect;
  zdmc: String;
  zdwidth: integer;
  zdheight,i: Integer;
begin
  zdheight:= 12;
  For i := 1 to bg.ColCount-1 do
  begin
    rect := bg.CellRect(i,0);
    case i of
      1: zdmc := '客户名称';
      2: zdmc := '客户欠款';
      3: zdmc := '最近付款金额';
      4: zdmc := '最近付款时间';
    end;
    zdwidth := length(Trim(zdmc));
    bg.Canvas.Brush.Color := clBtnFace;
    bg.Canvas.Font.Color := clRed;
    bg.Canvas.TextOut(Rect.Left+Trunc((bg.ColWidths[i]-zdwidth*6.5)/2),Rect.Top+Trunc((bg.RowHeights[0] -zdheight)/2),zdmc );
  end;
end;

end.

⌨️ 快捷键说明

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