DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: randy522732557
今日帖子: 21
在线用户: 12
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/4/19 3:59:35
标题:
Iocomp Components v4.0.4 SP2 Delphi Rio 浏览:1756
加入我的收藏
楼主: https://dl3.downloadly.ir/Files/Software/Iocomp_Components_Full_Sources_Product_4.0.4_SP2_Delphi_Rio_Compatible_Downloadly.ir.rar
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 zhhzm (Redbreast) ★☆☆☆☆ -
盒子活跃会员
2021/4/19 14:04:45
1楼: 这个再不见高版本源码版了
----------------------------------------------
菩提有树无树,明镜是台非台,关我鸡毛鸟事,坐看云去云来。
作者:
男 agilent7416 (agilent7416) ▲△△△△ -
普通会员
2023/11/9 16:04:46
2楼: iknob控件不显示箭头
----------------------------------------------
-
作者:
男 janker (janker) ★☆☆☆☆ -
盒子活跃会员
2023/11/9 17:33:19
3楼: 2楼:
改 procedure TiKnob.DrawIndicator(Canvas: TCanvas; const CenterPoint: TPoint);
begin
  IndicatorDegrees := RotationStartDegrees - PositionDegrees;

  //with Canvas, IndicatorRect do
  with Canvas do
    begin
      Brush.Style := bsSolid;
      IndicatorCenterPoint := GetXYRadPoint(IndicatorDegrees, FKnobRadius - FIndicatorMargin - FIndicatorSize, CenterPoint);

      IndicatorRect := Rect(IndicatorCenterPoint.x - FIndicatorSize,
          IndicatorCenterPoint.y - FIndicatorSize,
          IndicatorCenterPoint.x + FIndicatorSize,
          IndicatorCenterPoint.y + FIndicatorSize);

      if FMouseDown or FKeyDown then begin Pen.Color := FIndicatorActiveColor;   Brush.Color := FIndicatorActiveColor    end
      else          begin Pen.Color := FIndicatorInactiveColor; Brush.Color := FIndicatorInactiveColor; end;

      case FIndicatorStyle of
        ikisDotLowered : begin
          Ellipse(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom);
          Pen.Color := clGray;  Arc(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom, IndicatorRect.Right, IndicatorRect.Top, IndicatorRect.Left, IndicatorRect.Bottom);
          Pen.Color := clWhite; Arc(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom, IndicatorRect.Left , IndicatorRect.Bottom, IndicatorRect.Right, IndicatorRect.Top);
          end;
        ikisDotRaised  : begin
          Ellipse(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom);
          Pen.Color := clWhite; Arc(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom, IndicatorRect.Right, IndicatorRect.Top, IndicatorRect.Left, IndicatorRect.Bottom);
          Pen.Color := clGray;  Arc(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom, IndicatorRect.Left, IndicatorRect.Bottom, IndicatorRect.Right, IndicatorRect.Top);
          end;
        ikisDot        : begin
          Ellipse(IndicatorRect.Left, IndicatorRect.Top, IndicatorRect.Right, IndicatorRect.Bottom);
          end;
..........

end;

这里出问题了:
with Canvas, IndicatorRect do

Canvas和IndicatorRect 都有 Left和Top 属性

还有,TiAnlogDisplay控件也有这个问题:
procedure TiAnalogDisplay.iPaintTo(Canvas: TCanvas);
var
  AText      : String;
  ATextRect  : TRect;
  ATextFlags : TiTextFlags;
begin
  with Canvas, ATextRect do
    begin
      if not ErrorActive then
        begin
          if FPrecision >= 0 then
          AText := Trim(Format('%.' + IntToStr(FPrecision) + 'f', [FValue])) + FUnitsText
          else
          AText := Trim(Format('%g', [FValue])) + FUnitsText;

          Font.Assign(FFont);
          DrawBackGround(Canvas, BackGroundColor);
        end
      else
        begin
          AText := ErrorText;
          Font.Assign(ErrorFont);
          DrawBackGround(Canvas, ErrorBackGroundColor);
        end;

      case BorderStyle of
        ibsNone    : begin
          ATextRect.Top    := 2;
          ATextRect.Bottom := Self.Height - 2;
          end;
        ibsRaised  : begin
          ATextRect.Top    := 2;
          ATextRect.Bottom := Self.Height - 2;
          end;
        ibsLowered : begin
          ATextRect.Top    := 2;
          ATextRect.Bottom := Self.Height - 4;
          end;
      end;

      case FAlignment of
        iahCenter : begin
          ATextFlags := [itfHCenter, itfVCenter, itfSingleLine];
          ATextRect.Left  := 2;
          ATextRect.Right := Self.Width - 2;
          end;
        iahLeft   : begin
          ATextFlags := [itfHLeft, itfVCenter, itfSingleLine];
          ATextRect.Left  := 2 + FAlignmentMargin;
          ATextRect.Right := Self.Width - 2;
          end;
        else        begin
          ATextFlags := [itfHRight, itfVCenter, itfSingleLine];
          ATextRect.Left  := 2;
          ATextRect.Right := Self.Width - 2 - FAlignmentMargin;
          end;
      end;

      Brush.Style := bsClear;
      iDrawText(Canvas, AText, ATextRect, ATextFlags, True, BackGroundColor);
    end;
end;

  Height和Width前面加Self.

其它控件估计也有,只是没用上。类似方法修改。
----------------------------------------------
-
作者:
男 agilent7416 (agilent7416) ▲△△△△ -
普通会员
2024/3/6 15:01:27
4楼: 多谢赐教
----------------------------------------------
-
作者:
男 agilent7416 (agilent7416) ▲△△△△ -
普通会员
2024/3/6 15:18:11
5楼: iSwitchled不显示On和指示灯
----------------------------------------------
-
作者:
男 agilent7416 (agilent7416) ▲△△△△ -
普通会员
2024/3/12 15:19:02
6楼: procedure TiSwitchLed.iPaintTo(Canvas: TCanvas);
var
  DrawRect         : TRect;
  DrawWidth        : Integer;
  DrawHeight       : Integer;
  LedRect          : TRect;
  TempWidth        : Integer;
  TempHeight       : Integer;
  CenterPoint      : TPoint;
  ATextRect        : TRect;
  ATextFlags       : TiTextFlags;
begin
  CenterPoint := GetCenterPoint(Canvas);
  LedRect     := Rect(0,0,0,0);
  with Canvas, DrawRect do
    begin
      DrawBackGround(Canvas, BackGroundColor);
      DrawBorder(Canvas);

      DrawRect.Left   :=          (FBorderSize-2);
      DrawRect.Top    :=          (FBorderSize-2);
      DrawRect.Right  := Self.Width  -1 - (FBorderSize-2);
      DrawRect.Bottom := Self.Height -1 - (FBorderSize-2);

      DrawWidth       := DrawRect.Right  - DrawRect.Left;
      DrawHeight      := DrawRect.Bottom - DrawRect.Top;

      Font.Assign(FCaptionFont);

Width,Height前面加上Self就显示正常了
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行78.125毫秒 RSS