10412 : How do I add output text for a timebar

Question

How do i output text for a timebar, positioned to the right of the bar (or on the bar) on the calendar area of the control?  I am using the code below to add timebars:

*— add the bar to the calendar 
tTime=ThisForm.Gant1.AddGantTime(nChildTask,0)
tTime.start = cTasks.taskbeg
tTime.stop =  cTasks.taskend
tTime.CanEdit = .t.
tTime.UserIntegerReference = 1
IF cTasks.InOffice
   tTime.color = RGB(128,255,255)
ELSE
   tTime.color = RGB(0,255,64)
ENDIF

Do i use tTime.TimeItemsTextSet(1,”test”,10,10,1) or do i use “TimeItemsTextAdd”, or a combination of the two?

Answer

Yes you first call TimeItemsTextAdd to create a placeholder and then use that placeholder (they will be indexed 0,1,2…)

TimeItemsTextSet(0,”test”,X,Y,FontIndex(0..2 that maps to IphGantX3.TimeItemTextFont1…TimeItemTextFont3))

 

Leave a Reply