public interface CalendarEventWithJavaScriptEvent extends CalendarEvent
CalendarEventWithJavaScriptEvent
is a BBj Interface that contains event information for
a BBjCalendarWidget. This is
the base class for all BBjCalendarWidget
events that also contain the underlying native JavaScript event object.
This interface that provides methods that simplify retreiving useful information from the underly native JavaScript event object. For example,
it gives developers easy access to mouse coordinates for events that have a native JavaScript event (see the hyperlinked list of qualifying events below).
The data in this class is technically available in the JavaScript JSON event object if you call the getJsEvent()
method and parse the resultant JSON for the desired coordinates.
The purpose of this class is to simplify getting the mouse coordinates from the CalendarEvent
instead of having to parse them out of the native JavaScript event.
This makes it much easier to display a popup menu as a result of a user clicking on the calendar or a calendar entry, as you would usually call the
BBjPopupMenu::show() method which takes a control (the calendar's control) and X and Y coordinates that are relative to the control. For example:
This class provides the X/Y coordinates of the user's mouse for calendar events that contain such information, namely: The class parses out X/Y coordinates from the native JavaScript event for the screenX, screenY, clientX, and clientY values. It also provides computed coordinates called calendarX and calendarY. This values are relative to the calendar control, and they are determined by taking the mouse's clientX value and subtracting the calendar's X coordinate. This makes the X/Y values relative to the calendar control instead of the screen or client area of the browser.
rem Display the popup menu based on the calendar control and the mouse's X and Y positions myPopupMenu!.show(myCal!.getHtmlView(), myEvent!.getCalendarX(), myEvent!.getCalendarY())
Modifier and Type | Method and Description |
---|---|
BBjNumber |
getAltKey()
Returns whether the user's alt key was pressed when the event occurred.
|
BBjNumber |
getCalendarX()
Returns the X-coordinate of the user's mouse relative to the calendar control.
|
BBjNumber |
getCalendarY()
Returns the Y-coordinate of the user's mouse relative to the calendar control.
|
BBjNumber |
getClientX()
Returns the X-coordinate of the user's mouse relative to the calendar's window.
|
BBjNumber |
getClientY()
Returns the Y-coordinate of the user's mouse relative to the calendar's window.
|
BBjNumber |
getControlKey()
Returns whether the user's control key was pressed when the event occurred.
|
JsonObject |
getJsEvent()
Returns the native JavaScript event for the calendar event with low-level information such as click coordinates.
|
BBjString |
getJsEventAsFormattedString()
Returns a formatted, i.e.
|
BBjString |
getJsEventAsString()
Returns a stringified JsonObject representation of the native JavaScript event.
|
BBjNumber |
getMetaKey()
Returns whether the user's meta key was pressed when the event occurred.
|
BBjNumber |
getScreenX()
Returns the X-coordinate of the user's mouse relative to the screen.
|
BBjNumber |
getScreenY()
Returns the Y-coordinate of the user's mouse relative to the screen.
|
BBjNumber |
getShiftKey()
Returns whether the user's shift key was pressed when the event occurred.
|
getAsFormattedString, getAsJsonObject, getAsString, getCalendarUuid, getCalendarView, getEventNumber
JsonObject getJsEvent()
BBjString getJsEventAsString()
BBjString getJsEventAsFormattedString()
BBjNumber getScreenX()
In the BUI and DWC clients, this value increases as the browser's position moves further right on the screen. In the GUI client, this value increases as the window moves further right on the screen.
BBjNumber getScreenY()
BBjNumber getClientX()
In the BUI and DWC clients, this value increases as the windows's position moves further right on the browser. In the GUI client, this value increases as the mouse moves further right on the calendar.
BBjNumber getClientY()
BBjNumber getCalendarX()
getCalendarY()
to show a popup at the user's click location relative to the calendar control.
This value is calculated to be the horizontal offset of the mouse compared to the calendar control. It's technically the clientX of the mouse minus the calendar's X coordinate. This method can be used to show a popup when the user clicks on the calendar or an entry in the calendar:
rem Display the popup menu based on the calendar control and the click X and Y positions myPopupMenu!.show(myCal!.getHtmlView(), myEvent!.getCalendarX(), myEvent!.getCalendarY())
BBjNumber getCalendarY()
getCalendarX()
to show a popup at the user's click location relative to the calendar control.
This value is calculated to be the vertical offset of the mouse compared to the calendar control. It's technically the clientY of the mouse minus the calendar's Y coordinate. This method can be used to show a popup when the user mouses on the calendar or an entry in the calendar:
rem Display the popup menu based on the calendar control and the click X and Y positions myPopupMenu!.show(myCal!.getHtmlView(), myEvent!.getCalendarX(), myEvent!.getCalendarY())
BBjNumber getControlKey()
BBjNumber getShiftKey()
BBjNumber getAltKey()
BBjNumber getMetaKey()