All time blocks in the control.

Usage

Set_Property(OLECtrlEntID, "OLE.TimeBlockList", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<0, 1>Entity IDTextID of the entity to which the time block belongs""
<0, 2>IDTextThe unique key ID of the time block used to identify it in other properties, methods, and events""
<0, 3>Start Date & TimeDecimalThe time block's start date & time in OI internal format0.0
<0, 4>End Date & TimeDecimalThe time block's end date & time in OI internal format0.0
<0, 5>Back ColorColorThe color of the time blockSelect L=90
<0, 6>Fore ColorColorThe color of the time block's textSelectText
<0, 7>CaptionTextThe time block's caption""

Remarks

The TimeBlockList property contains all the time blocks stored in the control. Each field in the list represents a single time block. This property is a replacement to the EntityTimeBlocks property, which wasn't flexible enough for some needs. This property creates time blocks that have the same flexibility as appointments.

A time block is associated to an existing entity by that entity's ID. Therefore, you must call EntityList prior to calling TimeBlockList. The next value is the time blocks's ID.

Each time block MUST have a completely unique ID. This ID is used elsewhere to quickly identify any time block. IMPORTANT! Keys are case sensitive. For example, "Key" is different than "KEY".

TIP: Avoid using semi-colons in your IDs or some properties will not work correctly.

The start and end times use OI's internal format for date & time, thus you will have to IConv your data if it's not already in this format (or if your date and times are stored separately).

The colors of the time blocks are defined by the Back Color and Fore Color values.

Currently, time blocks can show a a single caption displayed in the center. It may be multilined.

Example

Declare function Min, Max 

Caption = "Hello, World!" 
ForeColor = "RGB{255, 255, 255}"

// Create random time blocks for the next 30 days 
TimeBlocks = "" 
ID = 0 
For i = 1 to 30      
   Count = 0 
   CurrDate = Date() + i 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey2-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey2-1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey2-1-1":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey2-1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
   TimeBlocks<-1> = "EntityKey2-1-2":@VM:ID:@VM:StartTime:@VM:EndTime:@VM:BackColor:@VM:ForeColor:@VM:Caption
   Count = Count + 1; ID = ID + 1 
   GoSub Get_Random_Data 
Next i 

// Add the time blocks 
Set_Property(@Window:".OLE_SCHEDULE", "OLE.TimeBlockList", TimeBlocks) 

Get_Random_Data: 

   // Generate random times 
   Time1 = Rnd( 48 ) * 1800 
   Time2 = Rnd( 48 ) * 1800 
    
   // Convert to OI Internal DT format 
   StartTime = IConv(OConv(CurrDate - Rnd(2), "D4/") : " " : OConv(Min(Time1, Time2), "MTS"), "DT") 
   EndTime = IConv(OConv(CurrDate, "D4/") : " " : OConv(Max(Time1, Time2), "MTS"), "DT") 
        
   // Generate random back color 
   BackColorHue = Rnd(256) 
   BackColor = "HSL{":BackColorHue:", 127, 45}" 

return

See Also

EntityListAddTimeBlocksRemoveTimeBlocks

  • No labels