翻譯|使用教程|編輯:楊鵬連|2020-12-07 11:48:37.903|閱讀 267 次
概述:本文介紹了phGant Time Package控件常見問題并做解答。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
phGant Time Package同時包含了phGantt 和phSchema控件,是一款快速、完全面向?qū)ο蟮腁ctiveX控件,有著豐富的圖形用戶界面,客戶可以熟練地操作時間進度條。時間進度條可以以甘特圖和概要視圖的形式顯示。該控件是一款強大的日程安排、項目管理控件,被國際上許多大公司所使用,慧都控件作為PlexityHide公司在中國的核心代理商,為客戶提供優(yōu)質(zhì)的客服和技術(shù)之支持。
10886:我想用phGantTimePackage用不同的顏色為某些日子的列著色。
問題
我想用phGantTimePackage用不同的顏色為某些日子涂色。您能否提供一個示例,說明如何使用OnGantAreaDrawBackground處理程序?qū)崿F(xiàn)此目的?
回答
為此,您必須知道一天的開始和結(jié)束時間(以像素為單位),可以通過將日期時間發(fā)送到IphGantX3.DateToPixel方法來輕松找到。
所以在偽代碼中,我將像這樣:
int numberOfDaysOnScreen=Round(phGant.Stop-phGant.Start) for i=0 to numberOfDaysOnScreen-1 do begin 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) end10702:我希望更多控制Links的外觀。
問題
我希望對鏈接的外觀有更多的控制。我一直試圖以有限的成功使用OnUserDrawLinks。是否有使用OnUserDrawLinks的示例(首選Delphi)?
回答
繪制鏈接以使它們在所有情況下看起來都很好,這很難。這就是為什么我們通過用戶繪制鏈接事件為您打開一扇門的原因。
這是我們繪制鏈接的代碼:
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提供的支持。
問題
我們在產(chǎn)品集中使用GTP Gannt,并且需要支持Vista。請讓我知道您對Vista提供的支持。
回答
GTP.NET 3.0完全支持Windows Windows Vista。phGantTimePackage 3.2還支持Vista。
10669:隱藏非工作日
問題
在日歷上,我只需要發(fā)布卷軸工作的日期,這意味著我不必發(fā)布工作日和公眾假期。因此,能否請您告訴我如何在日歷上發(fā)布我自己解決的工作日,最后您可以向我發(fā)送vb6代碼。
回答
datescaler只能“隱藏”特定的日期類型(如所有星期五),而不能“隱藏”特定的日期(如2月23日)。
當(dāng)我們開發(fā)時間隱藏功能時,我們發(fā)現(xiàn)人們在零星的日子消失時感到困惑。但并非如此(如所有星期五)。
要隱藏所有星期五,您可以調(diào)用SetHiddenDayType 5,true
相關(guān)產(chǎn)品介紹:
VARCHART XGantt:支持ActiveX、.Net等平臺的C#甘特圖控件
AnyGantt:構(gòu)建復(fù)雜且內(nèi)容豐富的甘特圖的理想工具
phGantt Time Package:對任務(wù)和時間的分配管理的甘特圖
dhtmlxGantt:交互式JavaScript / HTML5甘特圖
APS幫助提升企業(yè)生產(chǎn)效率,真正實現(xiàn)生產(chǎn)計劃可視化呈現(xiàn)與控制,快速有效響應(yīng)不同場景的生產(chǎn)計劃,提高準(zhǔn)時交貨能力,提高產(chǎn)能和資源利用率
想要了解phGant Time Package或慧都APS系統(tǒng),請登錄慧都網(wǎng),解決您的問題!
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: