Maps a schedule time to a coordinate point.
Syntax
Coordinate = Send_Message(Ctrl, "OLE.MapTimeToClient", Time, RoundToNearestInterval)
Parameters
Parameter | Description |
---|---|
Time | The time value to be mapped |
RoundToNearestInterval | Determines whether the result is rounded to the nearest interval |
Returns
The coordinate above the given time.
Remarks
The MapTimeToClient method maps a given time (in internal format) to the coordinate where that time appears to the user. This method returns a coordinate relative to the top left corner of the SRP Schedule Control, not the top left corner of the screen or parent form. The format of the time you pass and the meaning of the result differs depending on the current View.
View = "SingleDay"
In this case you pass the time in internal Time format (as opposed to a DateTime). The result will be the Y coordinate of that time's location.
View = "SingleDayHorz"
When using this view, the time is also in internal Time format. However, the result is the X coordinate of that time's location.
View = MultiDayHorz"
Unlike the other horizontal view, you must pass the time in internal DateTime format, since this view has muliple days in one view. The result will also be an X coordinate.
The RoundToNearestInterval parameter is a flag that determines the nature of the result. When you pass 0, then you get the exact coordinate above the time. If you pass 1, then you get the coordinate at the interval nearest the given time.
Example
// Based on the current view, determine the location of the time CurrentView = Get_Property(@Window:".OLE_SCHEDULE", "OLE.View") Begin Case Case CurrentView EQ "SingleDay" // Pass Time format, result is Y Y = Send_Message(Ctrl, "OLE.MapTimeToClient", IConv("1:17PM", "MTH"), 0) Case CurrentView EQ "SingleDayHorz" // Pass Time format, result is X X = Send_Message(Ctrl, "OLE.MapTimeToClient", IConv("1:17PM", "MTH"), 0) Case CurrentView EQ "MultiDayHorz" // Pass DateTime format, result is X X = Send_Message(Ctrl, "OLE.MapTimeToClient", IConv("7/4/2011 4:40PM", "DT"), 0) End Case