亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? reportcontrol.pas

?? 國產的報表控件
?? PAS
?? 第 1 頁 / 共 5 頁
字號:
  FLeftLineWidth := Cell.FLeftLineWidth;

  FTopLine := Cell.FTopLine;
  FTopLineWidth := Cell.FTopLineWidth;

  FRightLine := Cell.FRightLine;
  FRightLineWidth := Cell.FRightLineWidth;

  FBottomLine := Cell.FBottomLine;
  FBottomLineWidth := Cell.FBottomLineWidth;

  // 斜線
  FDiagonal := Cell.FDiagonal;

  // color
  FTextColor := Cell.FTextColor;
  FBackGroundColor := Cell.FBackGroundColor;

  // align
  FHorzAlign := Cell.FHorzAlign;
  FVertAlign := Cell.FVertAlign;

  // string
//  FCellText := Cell.FCellText;

  // font
  FLogFont := Cell.FLogFont;

  if Cell.OwnerCell <> nil then
  begin
    if bInsert then
    begin
      Cell.OwnerCell.FCellsList.Insert(
        Cell.OwnerCell.FCellsList.IndexOf(Cell),
        Self);
      FOwnerCell := Cell.OwnerCell;
    end
    else
      Cell.OwnerCell.AddOwnedCell(Self);
  end;
end;

// 一覺醒來,又是一個陽光燦爛的日子

///////////////////////////////////////////////////////////////////////////
// CReportLine

{ TReportLine }

procedure TReportCell.RemoveOwnedCell(Cell: TReportCell);
begin
  FCellsList.Remove(Cell);
  Cell.OwnerCell := nil;
end;

procedure TReportLine.CalcLineHeight;
var
  I: Integer;
  ThisCell: TReportCell;
begin
  FMinHeight := 0;

  for I := 0 to FCells.Count - 1 do
  begin
    ThisCell := TReportCell(FCells[I]);
    if ThisCell.CellHeight > FMinHeight then
      FMinHeight := ThisCell.CellHeight;
    ThisCell.CellIndex := I;

    if (I = 0) and (ReportControl <> nil) then
      ThisCell.CellLeft := ReportControl.FLeftMargin;

    if I > 0 then
      ThisCell.CellLeft := TReportCell(FCells[I - 1]).CellLeft + TReportCell(FCells[I - 1]).CellWidth;
  end;
end;

procedure TReportLine.CopyLine(Line: TReportLine; bInsert: Boolean);
var
  I: Integer;
  NewCell: TReportCell;
begin
  if Line = nil then
    Exit;

  FDragHeight := 0;
  FMinHeight := 20;
  FReportControl := Line.FReportControl;

  for I := 0 to Line.FCells.Count - 1 do
  begin
    NewCell := TReportCell.Create;
    FCells.Add(NewCell);
    NewCell.FOwnerLine := Self;
    NewCell.CopyCell(Line.FCells[I], bInsert);
  end;
end;

constructor TReportLine.Create;
begin
  FReportControl := nil;
  FCells := TList.Create;
  FIndex := 0;

  FMinHeight := 0;
  FDragHeight := 0;
  FLineTop := 0;
  FLineRect.left := 0;
  FLineRect.top := 0;
  FLineRect.right := 0;
  FLineRect.bottom := 0;
end;

destructor TReportLine.Destroy;
var
  I: Integer;
  ThisCell: TReportCell;
begin
  for I := FCells.Count - 1 downto 0 do
  begin
    ThisCell := TReportCell(FCells[I]);
    ThisCell.Free;
  end;

  FCells.Free;
  FCells := nil;

  inherited Destroy;
end;

procedure TReportLine.CreateLine(LineLeft, CellNumber, PageWidth: Integer);
var
  I: Integer;
  NewCell: TReportCell;
  CellWidth: Integer;
begin
  CellWidth := trunc(PageWidth / CellNumber + 0.5);

  for I := 0 to CellNumber - 1 do
  begin
    NewCell := TReportCell.Create;
    FCells.Add(NewCell);
    NewCell.OwnerLine := Self;
    NewCell.CellIndex := I;
    NewCell.CellLeft := I * CellWidth + LineLeft;
    NewCell.CellWidth := CellWidth;
  end;
end;

function TReportLine.GetLineHeight: Integer;
begin
  if FMinHeight > FDragHeight then
    Result := FMinHeight
  else Result := FDragHeight;
end;

function TReportLine.GetLineRect: TRect;
var
  I: Integer;
begin
  // 重新由各個CELL計算出該行的矩形來

  // 由各個CELL計算出行的高度
//  CalcLineHeight;                  // 移到UpdateLines中樂,呵呵。

  // 通知每個CELL重新計算坐標
  for I := 0 to FCells.Count - 1 do
  begin
    TReportCell(FCells[I]).CellIndex := I;
    TReportCell(FCells[I]).CalcCellRect;
  end;

  if FCells.Count > 0 then
    Result.Left := TReportCell(FCells.First).CellLeft;
  Result.Top := FLineTop;
  Result.Bottom := Result.Top + LineHeight;
  Result.Right := Result.Left;

  for I := 0 to FCells.Count - 1 do
    Result.Right := Result.Right + TReportCell(FCells[I]).CellWidth;

  FLineRect := Result;
end;

procedure TReportLine.SetDragHeight(const Value: Integer);
begin
  FDragHeight := Value;
end;

procedure TReportLine.SetLineTop(const Value: Integer);
var
  I: Integer;
begin
  if FLineTop = Value then
    Exit;

  FLineTop := Value;

  for I := 0 to FCells.Count - 1 do
  begin
    TReportCell(FCells[I]).CalcCellRect;
  end;
end;

///////////////////////////////////////////////////////////////////////////
// TReportControl

{TReportControl}

procedure TReportControl.CreateWnd;
begin
  inherited;

  if Handle <> INVALID_HANDLE_VALUE then
    SetClassLong(Handle, GCL_HCURSOR, 0);
end;

constructor TReportControl.Create(AOwner: TComponent);
var
  hDesktopDC: HDC;
  nPixelsPerInch: Integer;
begin
  inherited Create(AOwner);

// 設定為無光標,防止光標閃爍。
//  Cursor := crNone;

  FPreviewStatus := False;

  Color := clWhite;
  FLineList := TList.Create;
  FSelectCells := TList.Create;

  Celldisp := nil;
  cellline_d := nil;
  FEditCell := nil;

  FNewTable := True;
//  FDataLine := 2147483647;
//  FTablePerPage := 2147483647;
  FDataLine := 57; //廖伯志 1999.1.16
  FTablePerPage := 1; //

  pgw := 0;
  pgh := 0;

  FReportScale := 100;
  scale := FReportScale;
  FPageWidth := 0;
  FPageHeight := 0;

  hDesktopDC := GetDC(0);
  nPixelsPerInch := GetDeviceCaps(hDesktopDC, LOGPIXELSX);

  FLeftMargin1 := 20;
  FRightMargin1 := 20;
  FTopMargin1 := 20;
  FBottomMargin1 := 20;

  FLeftMargin := trunc(nPixelsPerInch * FLeftMargin1 / 25 + 0.5);
  FRightMargin := trunc(nPixelsPerInch * FRightMargin1 / 25 + 0.5);
  FTopMargin := trunc(nPixelsPerInch * FTopMargin1 / 25 + 0.5);
  FBottomMargin := trunc(nPixelsPerInch * FBottomMargin1 / 25 + 0.5);

  ReleaseDC(0, hDesktopDC);

  // 鼠標操作支持
  FMousePoint.x := 0;
  FMousePoint.y := 0;

  // 編輯、顏色及字體
  FEditWnd := INVALID_HANDLE_VALUE;
  FEditBrush := INVALID_HANDLE_VALUE;
  FEditFont := INVALID_HANDLE_VALUE;
  CalcWndSize;
end;

destructor TReportControl.Destroy;
var
  I: Integer;
  ThisLine: TReportLine;
begin
  FSelectCells.Free;
  FSelectCells := nil;

  for I := FLineList.Count - 1 downto 0 do
  begin
    ThisLine := TReportLine(FLineList[I]);
    ThisLine.Free;
  end;

  FLineList.Free;
  FLineList := nil;
  inherited Destroy;
end;

procedure TReportControl.CalcWndSize;
var
  hClientDC: HDC;
begin
  isprint := 0;
  if printer.Printers.Count <= 0 then
  begin
    isprint := 1; //未安裝打印機
    if pgw <> 0 then
    begin
      FPageWidth := pgw;
      FPageHeight := pgh;
    end;
  end;

  // 根據用戶選擇的紙來確定報表窗口的大小并對該窗口進行設置。
  hClientDC := GetDC(0);
  if pgw = 0 then
  begin
    if isprint = 1 then
    begin
      FPageWidth := 768; //未安裝打印機時,設置默認紙寬
      FPageHeight := 1058; //未安裝打印機時,設置默認紙高
    end
    else
    begin
      FPageWidth := trunc(Printer.PageWidth / GetDeviceCaps(Printer.Handle, LOGPIXELSX)
        * GetDeviceCaps(hClientDC, LOGPIXELSX) + 0.5);
      FPageHeight := trunc(Printer.PageHeight / GetDeviceCaps(Printer.Handle, LOGPIXELSY)
        * GetDeviceCaps(hClientDC, LOGPIXELSY) + 0.5);
    end;
  end;
  pgw := FPageWidth;
  pgh := FPageHeight;
  Width := trunc(FPageWidth * FReportScale / 100 + 0.5);
  Height := trunc(FPageHeight * FReportScale / 100 + 0.5);
  ReleaseDC(0, hClientDC);
end;

procedure TReportControl.WMPaint(var Message: TMessage);
var
  hPaintDC: HDC;
  ps: TPaintStruct;
  I, J: Integer;
  TempRect: TRect;
  hGrayPen, hPrevPen: HPEN;
  ThisLine: TReportLine;
  ThisCell: TReportCell;
  WndSize: TSize;
  rectPaint: TRect;
begin
  hPaintDC := BeginPaint(Handle, ps);

  SetMapMode(hPaintDC, MM_ISOTROPIC);
  WndSize.cx := Width;
  WndSize.cy := Height;
  SetWindowExtEx(hPaintDC, FPageWidth, FPageHeight, @WndSize);
  SetViewPortExtEx(hPaintDC, Width, Height, @WndSize);

  rectPaint := ps.rcPaint;

  if FReportScale <> 100 then
  begin
    rectPaint.Left := trunc(rectPaint.Left * 100 / FReportScale + 0.5);
    rectPaint.Top := trunc(rectPaint.Top * 100 / FReportScale + 0.5);
    rectPaint.Right := trunc(rectPaint.Right * 100 / FReportScale + 0.5);
    rectPaint.Bottom := trunc(rectPaint.Bottom * 100 / FReportScale + 0.5);
  end;

  Rectangle(hPaintDC, 0, 0, FPageWidth, FPageHeight);

  hGrayPen := CreatePen(PS_SOLID, 1, RGB(128, 128, 128));
  hPrevPen := SelectObject(hPaintDC, hGrayPen);

  // 左上
  MoveToEx(hPaintDC, FLeftMargin, FTopMargin, nil);
  LineTo(hPaintDC, FLeftMargin, FTopMargin - 25);

  MoveToEx(hPaintDC, FLeftMargin, FTopMargin, nil);
  LineTo(hPaintDC, FLeftMargin - 25, FTopMargin);

  // 右上
  MoveToEx(hPaintDC, FPageWidth - FRightMargin, FTopMargin, nil);
  LineTo(hPaintDC, FPageWidth - FRightMargin, FTopMargin - 25);

  MoveToEx(hPaintDC, FPageWidth - FRightMargin, FTopMargin, nil);
  LineTo(hPaintDC, FPageWidth - FRightMargin + 25, FTopMargin);

  // 左下
  MoveToEx(hPaintDC, FLeftMargin, FPageHeight - FBottomMargin, nil);
  LineTo(hPaintDC, FLeftMargin, FPageHeight - FBottomMargin + 25);

  MoveToEx(hPaintDC, FLeftMargin, FPageHeight - FBottomMargin, nil);
  LineTo(hPaintDC, FLeftMargin - 25, FPageHeight - FBottomMargin);

  // 右下
  MoveToEx(hPaintDC, FPageWidth - FRightMargin, FPageHeight - FBottomMargin, nil);
  LineTo(hPaintDC, FPageWidth - FRightMargin, FPageHeight - FBottomMargin + 25);

  MoveToEx(hPaintDC, FPageWidth - FRightMargin, FPageHeight - FBottomMargin, nil);
  LineTo(hPaintDC, FPageWidth - FRightMargin + 25, FPageHeight - FBottomMargin);

  SelectObject(hPaintDC, hPrevPen);
  DeleteObject(hGrayPen);

  ///////////////////////////////////////////////////////////////////////////
    // 繪制所有與失效區相交的矩形
  for I := 0 to FLineList.Count - 1 do
  begin
    ThisLine := TReportLine(FLineList[I]);
    {
        if ThisLine.LineRect.Bottom < ps.rcPaint.top then
          Continue;

        if ThisLine.LineTop > ps.rcPaint.bottom then
          Break;
    }
    for J := 0 to TReportLine(FLineList[i]).FCells.Count - 1 do
    begin
      ThisCell := TReportCell(ThisLine.FCells[J]);

      if ThisCell.CellRect.Left > rectPaint.Right then
        Break;

      if ThisCell.CellRect.Right < rectPaint.Left then
        Continue;

      if ThisCell.CellRect.Top > rectPaint.Bottom then
        Break;

      if ThisCell.CellRect.Bottom < rectPaint.Top then
        Continue;

      if ThisCell.OwnerCell = nil then
        ThisCell.PaintCell(hPaintDC, FPreviewStatus);
    end;
  end;

  if not FPreviewStatus then
  begin
    for I := 0 to FSelectCells.Count - 1 do
    begin
      IntersectRect(TempRect, ps.rcPaint, TReportCell(FSelectCells[I]).CellRect);
      if (TempRect.right >= TempRect.Left) and (TempRect.bottom >= TempRect.top) then
        InvertRect(hPaintDC, TempRect);
    end;
  end;

  // 劃線的算法目前還沒有想出來
  // 各個CELL之間表線重疊的部分如何處理,如何存儲這些線的設置呢?顯然,現在的方法太土了。

  // 改樂,如果右面的CELL或下面的CELL的左邊線或上邊線為0時,不畫不就得樂。(1998.9.9)

  EndPaint(Handle, ps);
end;

procedure TReportControl.WMLButtonDBLClk(var Message: TMessage);
var
  ThisCell: TReportCell;
  TempPoint: TPoint;
  dwStyle: DWORD;
begin
  RemoveAllSelectedCell;
  GetCursorPos(TempPoint);
  Windows.ScreenToClient(Handle, TempPoint);

  ThisCell := CellFromPoint(TempPoint);

  if (ThisCell <> nil) and (ThisCell.CellWidth > 10) then
  begin
    FEditCell := ThisCell;

    if FEditFont <> INVALID_HANDLE_VALUE then
      DeleteObject(FEditFont);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日产精品1区| 亚洲精品大片www| 精品久久久久久最新网址| www欧美成人18+| 国产精品免费网站在线观看| 亚洲免费高清视频在线| 久久伊人蜜桃av一区二区| 蜜桃av一区二区在线观看| 久久不见久久见免费视频1| 国产91综合一区在线观看| 99精品视频一区| 日韩一区二区麻豆国产| 亚洲天堂av一区| 国产一区二区三区免费播放| 91精品办公室少妇高潮对白| 日韩欧美一级二级| 视频一区二区国产| 99久久精品免费精品国产| 亚洲欧洲中文日韩久久av乱码| 欧美视频一二三区| 日韩一区中文字幕| 成人免费毛片片v| 精品日韩一区二区| 风间由美一区二区三区在线观看| 玉足女爽爽91| 亚洲欧洲99久久| 国产黑丝在线一区二区三区| 久久精品国产精品亚洲红杏| 26uuu精品一区二区| a亚洲天堂av| 中文字幕的久久| 国产一区二三区| 最近日韩中文字幕| 日韩一区二区在线看| 成人av影视在线观看| 国产欧美日韩激情| 欧美亚洲国产怡红院影院| 激情综合五月天| 日韩免费电影一区| 97精品久久久午夜一区二区三区| 日本免费新一区视频| 91精品久久久久久久91蜜桃| 17c精品麻豆一区二区免费| 欧美福利一区二区| 日韩不卡在线观看日韩不卡视频| 久久综合视频网| 97aⅴ精品视频一二三区| 蜜臀av一区二区在线免费观看| 国产精品欧美综合在线| 欧美一区二区三区在线视频| 日本欧美肥老太交大片| 中文字幕制服丝袜成人av | 亚洲国产精品精华液ab| 欧美视频在线观看一区二区| 成人久久久精品乱码一区二区三区| 亚洲不卡一区二区三区| 在线精品视频一区二区三四| 亚洲国产精品嫩草影院| 欧美精品xxxxbbbb| 色一情一伦一子一伦一区| 尤物视频一区二区| 国产精品乱子久久久久| 久久亚洲精品小早川怜子| 911国产精品| 色丁香久综合在线久综合在线观看| 国内外精品视频| 中文天堂在线一区| 欧美日韩视频不卡| 另类中文字幕网| www激情久久| 欧美日韩你懂得| hitomi一区二区三区精品| 老司机精品视频导航| 亚洲制服欧美中文字幕中文字幕| 欧美日韩精品一区二区三区四区| 天堂久久一区二区三区| 18欧美乱大交hd1984| 国产欧美一区二区精品秋霞影院| 91精品国产aⅴ一区二区| www.欧美日韩| 岛国一区二区在线观看| 狠狠狠色丁香婷婷综合激情 | 欧美亚洲一区三区| 成人av影院在线| 国产成人小视频| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲制服丝袜av| 亚洲手机成人高清视频| 中文字幕在线观看一区二区| 欧美一激情一区二区三区| 欧美日韩国产欧美日美国产精品| 色呦呦一区二区三区| 成人高清视频免费观看| 成人黄色在线视频| 成人中文字幕在线| 国产999精品久久久久久绿帽| 国产高清亚洲一区| 国产精品一区二区你懂的| av激情亚洲男人天堂| 国产高清精品久久久久| 午夜伊人狠狠久久| 另类小说视频一区二区| 麻豆视频一区二区| 另类小说色综合网站| 韩国成人精品a∨在线观看| 精久久久久久久久久久| 国产一区二区三区黄视频| 国产成人av电影| www.亚洲精品| 色综合天天综合给合国产| 久久超碰97中文字幕| 精品一区二区三区香蕉蜜桃| 国内成人自拍视频| 丁香婷婷综合网| 99精品欧美一区二区三区小说| 99久久婷婷国产| 欧美综合色免费| 欧美日韩久久不卡| 久久久久久电影| 亚洲欧美日韩在线不卡| 三级欧美韩日大片在线看| 久久国产精品一区二区| 国产成人精品三级麻豆| 色呦呦国产精品| 在线91免费看| 久久久噜噜噜久久中文字幕色伊伊 | 蜜臀av一区二区| 成人永久免费视频| 色婷婷综合久色| 日韩一区二区不卡| 欧美国产禁国产网站cc| 一区二区三区在线视频观看58| 奇米在线7777在线精品| 欧美私人免费视频| 欧美电影免费观看完整版| 风流少妇一区二区| 欧美日韩视频一区二区| 欧美精品丝袜久久久中文字幕| 久久精品亚洲精品国产欧美kt∨| 亚洲色图视频网站| 日本中文字幕一区| 成人高清视频在线| 国产呦萝稀缺另类资源| 日韩电影在线免费看| 视频在线观看一区| 美国欧美日韩国产在线播放| 蜜臀av性久久久久av蜜臀妖精| 轻轻草成人在线| 狠狠色狠狠色综合系列| 国产jizzjizz一区二区| 白白色 亚洲乱淫| 91麻豆精品在线观看| www.综合网.com| 91精品国产高清一区二区三区| 91精品国产综合久久婷婷香蕉 | 国产一区二区不卡| 成人毛片在线观看| 91在线porny国产在线看| 在线视频亚洲一区| 欧美一级夜夜爽| 久久精品夜色噜噜亚洲aⅴ| 国产精品美女久久久久av爽李琼| 最新国产成人在线观看| 香蕉久久夜色精品国产使用方法 | 亚洲制服欧美中文字幕中文字幕| 蜜臀久久久久久久| 国产99精品视频| 欧美综合视频在线观看| 欧美一区二区免费观在线| 久久精品一区二区| 尤物视频一区二区| 激情欧美日韩一区二区| 色先锋资源久久综合| 精品国产三级电影在线观看| 国产女人aaa级久久久级| 亚洲电影视频在线| 国产寡妇亲子伦一区二区| 精品视频在线视频| 欧美一区二区三区白人| 亚洲综合精品久久| 国产在线视视频有精品| 欧美亚洲国产bt| 国产亚洲美州欧州综合国| 又紧又大又爽精品一区二区| 国产一区久久久| 91激情五月电影| 亚洲女人****多毛耸耸8| 精品一区二区在线观看| 91极品美女在线| 国产日韩成人精品| 日韩国产欧美一区二区三区| 99综合电影在线视频| 精品国产第一区二区三区观看体验| 亚洲精品久久7777| 成人午夜免费视频| 6080午夜不卡| 亚洲成人精品一区| 色88888久久久久久影院按摩| 国产视频视频一区| 麻豆精品国产传媒mv男同|