phGantt Time Package控件常见问题解答(四)

本文介绍了phGant Time Package控件常见问题并做解答。

phGant Time Package同时包含了phGantt 和phSchema控件,是一款快速、完全面向对象的ActiveX控件,有着丰富的图形用户界面,客户可以熟练地操作时间进度条。时间进度条可以以甘特图和概要视图的形式显示。该控件是一款强大的日程安排、项目管理控件,被国际上许多大公司所使用,控件作为PlexityHide公司在中国的核心代理商,为客户提供优质的客服和技术之支持。

10886:我想用phGantTimePackage用不同的颜色为某些日子的列着色。

问题

我想用phGantTimePackage用不同的颜色为某些日子涂色。您能否提供一个示例,说明如何使用OnGantAreaDrawBackground处理程序实现此目的/span>

回答

为此,您必须知道一天的开始和结束时间(以像素为单位),可以通过将日期时间发送到IphGantX3.DateToPixel方法来轻松找到。

所以在伪代码中,我将像这样:

int numberOfDaysOnScreen=Round(phGant.Stop-phGant.Start)for i=0 to numberOfDaysOnScreen-1 dobegin  DateTime oneDay=phGantt.Start+i  Color c=GetColorForThisDay(oneDay)  int PixelForStartOfDay=phGantt.DateToPixel(Trunc(oneDay))  int PixelForEndOfDay=phGantt.DateToPixel(Trunc(oneDay)+1)  DrawColoredRectangle(PixelForStartOfDay,0,PixelForEndOfDay,Gantt.Height)end

10702:我希望更多控制Links的外观。

问题

我希望对链接的外观有更多的控制。我一直试图以有限的成功使用OnUserDrawLinks。是否有使用OnUserDrawLinks的示例(首选Delphi)/span>

回答

绘制链接以使它们在所有情况下看起来都很好,这很难。这就是为什么我们通过用户绘制链接事件为您打开一扇门的原因。

这是我们绘制链接的代码:

procedure TphGant_ComBasic.DrawLink(theStartPoint,theStopPoint:TPoint;  theCanvas:TCanvas;theLinkStyle:TLinkStyle; theLinkColor:TColor;theLinkPenWidth: Integer;  aDataEntity_Link:TphDataEntity_Link);var  aMiddlePoint, aNewStopPoint:TPoint;  cLRArr, cUDArr ,cOri,ssFold,ssMinDist, OldPenWidth:Integer;  aColor : TColor;begin  OldPenWidth := theCanvas.Pen.Width;  try    theCanvas.Pen.Color := theLinkColor;    theCanvas.Pen.Width := theLinkPenWidth;    theCanvas.MoveTo(theStartPoint.X,theStartPoint.Y);    cLRArr := 3;    cUDArr := 3;    cOri:=1;    ssMinDist:=7;    if GA.IsPrinting then    begin      cLRArr := Round(3*GA.Scalex);      cUDArr := Round(3*GA.Scaley);      ssMinDist:=Round(ssMinDist*GA.Scalex);    end;    aNewStopPoint := theStopPoint;    if Assigned(aDataEntity_Link) and (aDataEntity_Link.StartFinishOption=tlsfSS) then    begin      // tlsfSS is treated the same way for tlsDefault and tlsMSProject      if theStartPoint.X>theStopPoint.X then        ssFold:=theStopPoint.X-ssMinDist      else        ssFold:=theStartPoint.X-ssMinDist;      theCanvas.LineTo(ssFold,theStartPoint.Y);      theCanvas.LineTo(ssFold,aNewStopPoint.Y);      theCanvas.LineTo(aNewStopPoint.X,aNewStopPoint.Y);      theLinkStyle:=tlsDefault;    end    else    begin      case theLinkStyle of        tlsDefault:    begin      if theStartPoint.X>theStopPoint.X then              cOri:=-1;            // Moves horizonatal endpoint one extra pixel to get get nicer looking arrows            aNewStopPoint.X := theStopPoint.X-cOri;            // This code draws the line cut in three parts - horizontal - vertical - horizontal            aMiddlePoint.X:=theStartPoint.X+((aNewStopPoint.X-theStartPoint.X) div 2);            aMiddlePoint.Y:=theStartPoint.Y+((aNewStopPoint.Y-theStartPoint.Y) div 2);            theCanvas.LineTo(aMiddlePoint.X,theStartPoint.Y);            theCanvas.LineTo(aMiddlePoint.X,aNewStopPoint.Y);            theCanvas.LineTo(aNewStopPoint.X,aNewStopPoint.Y);          end;        tlsMSProject:          begin            if theStartPoint.Y<theStopPoint.Y then              cOri:=-1;            if theStartPoint.X < theStopPoint.X then              aNewStopPoint.X := theStopPoint.X + cUDArr  // Moves endpoint horizontal get the arrow "inside" the box            else              aNewStopPoint.X := theStopPoint.X - cUDArr; // Moves endpoint horizontal get the arrow "inside" the box            // Moves endpoint one extra pixel up/down to get nicer looking arrows            aNewStopPoint.Y := theStopPoint.Y+cOri;            // Draw horizontal line, then downwards to the recieving point            theCanvas.LineTo(aNewStopPoint.X,theStartPoint.Y);            theCanvas.LineTo(aNewStopPoint.X,aNewStopPoint.Y+cUDArr*cOri);          end;      end;    end;    // Don't draw the arrow if we are "out of bounds"    if PointInRect( aNewStopPoint, theCanvas.ClipRect ) then    begin      case theLinkStyle of        tlsDefault:          begin            // This code draws the arrow            theCanvas.LineTo(aNewStopPoint.X-cLRArr*cOri,aNewStopPoint.Y-cLRArr);            theCanvas.LineTo(aNewStopPoint.X-cLRArr*cOri,aNewStopPoint.Y+cLRArr);            theCanvas.LineTo(aNewStopPoint.X,aNewStopPoint.Y);          end;        tlsMSProject:          begin            // This code draws the arrow downwards or upwards!            aColor := theCanvas.Brush.Color;            theCanvas.Brush.Color := theLinkColor;            theCanvas.Polygon( [              Point(aNewStopPoint.X,aNewStopPoint.Y),              Point(aNewStopPoint.X-cUDArr,aNewStopPoint.Y+cUDArr*cOri),              Point(aNewStopPoint.X+cUDArr,aNewStopPoint.Y+cUDArr*cOri)              ] );            theCanvas.Brush.Color := aColor;          end;      end;    end;  finally    theCanvas.Pen.Width := OldPenWidth;  end;end;

10876:请让我知道您对Vista提供的支持。

问题

我们在产品集中使用GTP Gannt,并且需要支持Vista。请让我知道您对Vista提供的支持。

回答

GTP.NET 3.0完全支持Windows Windows Vista。phGantTimePackage 3.2还支持Vista。

10669:隐藏非工作日

问题

在日历上,我只需要发布卷轴工作的日期,这意味着我不必发布工作日和公众假期。因此,能否请您告诉我如何在日历上发布我自己解决的工作日,最后您可以向我发送vb6代码。

回答

datescaler只能“隐藏”特定的日期类型(如所有星期五),而不能“隐藏”特定的日期(如2月23日)。

当我们开发时间隐藏功能时,我们发现人们在零星的日子消失时感到困惑。但并非如此(如所有星期五)。

要隐藏所有星期五,您可以调用SetHiddenDayType 5,true

相关产品介绍:

VARCHART XGantt:支持ActiveX、.Net等平台的C#甘特图控件
AnyGantt:构建复杂且内容丰富的甘特图的理想工具
phGantt Time Package:对任务和时间的分配管理的甘特图
dhtmlxGantt:交互式JavaScript / HTML5甘特图


APS帮助提升企业生产效率,真正实现生产计划可视化呈现与控制,快速有效响应不同场景的生产计划,提高准时交货能力,提高产能和资源利用率

想要了解phGant Time PackageAPS系统,请登录网咨询在线客服,解决您的问题!

phGantt Time Package控件常见问题解答(四)

标签:

来源:慧都

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2020年11月4日
下一篇 2020年11月4日

相关推荐

发表回复

登录后才能评论