Class: DrawingDialog

Cadcorp.UI.DrawingDialog

new DrawingDialog(config)

A dialog that displays drawing controls
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Extends

Members

alreadyOpen

Properties:
Name Type Description
alreadyOpen boolean If set to true, the dialog is already open
Inherited From:

canvasControl

Properties:
Name Type Description
canvasControl Object The Canvas control used for displaying preview of the line/polygon styles

closeText

Properties:
Name Type Description
closeText string The text added to the close button
Inherited From:

currentFontSize

Properties:
Name Type Description
currentFontSize number The size of font used to draw text on the map i.e OpenLayers.Symbolizer.Line.strokeOpacity

drawingStyleTitle

Properties:
Name Type Description
drawingStyleTitle string The title for header of a panel with line/polygon colour & style selector controls

events

Properties:
Name Type Description
events Cadcorp.Util.Events The events object
Inherited From:

fillColourControl

Properties:
Name Type Description
fillColourControl Cadcorp.UI.ColourPickerControl The control for setting hexadecimal representation of colour for fill i.e OpenLayers.Symbolizer.Polygon.fillColor

fillOpacity

Properties:
Name Type Description
fillOpacity number The opacity of polygon fill i.e OpenLayers.Symbolizer.Polygon.fillOpacity

fontSizes

Properties:
Name Type Description
fontSizes Array The array of numbers allowed to use as font size

footerId

Properties:
Name Type Attributes Description
footerId string <nullable>
The id of the footer element
Inherited From:

(constant) HEIGHT_SPACER :number

Used to give a constant spacing between the top of a dialog and the top element on the screen
Type:
  • number
Inherited From:

heightFactor

Properties:
Name Type Description
heightFactor number Used when calculating the height of the dialog
Inherited From:

icons

Properties:
Name Type Description
icons Array Collection of {OpenLayers.Icon} configured with a map, typically used in conjunction with a OpenLayers.Marker to represent markers on a screen

id

Properties:
Name Type Description
id string The id for this control
Inherited From:

isMobileDevice

Properties:
Name Type Description
isMobileDevice boolean If set to true, the device this dialog is running on is a mobile device
Inherited From:

lineColourControl

Properties:
Name Type Description
lineColourControl Cadcorp.UI.ColourPickerControl The control for setting hexadecimal representation of colour for line i.e OpenLayers.Symbolizer.Line.strokeColor

lineDashStyles

Properties:
Name Type Description
lineDashStyles Array Collection of line dash tyles configured with a map.

lineStyleControl

Properties:
Name Type Description
lineStyleControl Cadcorp.UI.PatternPickerControl The control for setting line-style for line i.e OpenLayers.Symbolizer.Line.strokeDashstyle

lineWidth

Properties:
Name Type Description
lineWidth number The width of line i.e OpenLayers.Symbolizer.Line.strokeWidth

(protected) m_content

Properties:
Name Type Description
m_content Object The jquery object that contains the content for this dialog
Inherited From:

(protected) m_dialog

Properties:
Name Type Description
m_dialog Object The jquery object that is this dialog
Inherited From:

(protected) m_errorDialog

Properties:
Name Type Description
m_errorDialog Cadcorp.UI.ErrorDialog The jquery dialog used to display any error for this dialog
Inherited From:
Properties:
Name Type Attributes Description
m_menu Object <nullable>
The jquery object that is the menu
Inherited From:
Properties:
Name Type Attributes Description
m_menuItem Object <nullable>
The jquery object that is the menu item
Inherited From:

mapId

Properties:
Name Type Attributes Description
mapId string <nullable>
The id of the map this dialog is linked to
Inherited From:
Properties:
Name Type Attributes Description
menuId string <nullable>
The id of the menu control
Inherited From:
Properties:
Name Type Attributes Description
menuItemId string <nullable>
The id of the menu item control this dialog is triggered by
Inherited From:
Properties:
Name Type Description
modal boolean If set to true, the dialog will have modal behavior; other items on the page will be disabled, i.e., cannot be interacted with. Modal dialogs create an overlay below the dialog but above other page elements.
Inherited From:
Default Value:
  • false

pointStyleControl

Properties:
Name Type Description
pointStyleControl Object The control for setting point-style using externalGraphic for point i.e OpenLayers.Symbolizer.Point.externalGraphic

prefix

Properties:
Name Type Description
prefix string The asp.net client id
Inherited From:

stayOpen

Properties:
Name Type Description
stayOpen boolean If set to true, stops the dialog from closing
Inherited From:

strokeOpacity

Properties:
Name Type Description
fillOpacity number The opacity of line i.e OpenLayers.Symbolizer.Line.strokeOpacity

textCanvasControl

Properties:
Name Type Description
textCanvasControl Object The Canvas control used for displaying preview of the Text with selected colour and font

textColourControl

Properties:
Name Type Description
textColourControl Cadcorp.UI.ColourPickerControl The control for setting hexadecimal representation of colour for text colour i.e OpenLayers.Symbolizer.Text.fillColor

textStyleTitle

Properties:
Name Type Description
textStyleTitle string The title for header of a panel with text-font, text-colour selector controls

titleText

Properties:
Name Type Description
titleText string The title text for this dialog
Inherited From:

Methods

(protected) calculateInitialWidth() → {number}

Calculates the initial width of the dialog. This can called before create.
Inherited From:
Returns:
The width of the dialog in pixels
Type
number

(protected) calculateMaxHeight() → {number}

Calculates the height of the dialog. If menu and footerId are not null the height of these 2 elements is subtracted from the height so the dialog always fits on the page.
Inherited From:
Returns:
The height of the dialog in pixels
Type
number

(protected) calculateWidth() → {number}

Calculates the width of the dialog. This method should only be called after create has been called.
Inherited From:
Returns:
The width of the dialog in pixels
Type
number

controlActivatedHandler(e)

Triggered when a drawing control is activated
Parameters:
Name Type Description
e Object The event object

create(userDialogConfig)

Creates the jQuery UI dialog. The userDialogConfig parameter is used to override the default options.
Parameters:
Name Type Description
userDialogConfig Object An object containing options for this dialog. Any valid option for the jQuery Ui Dialog widget can be supplied
Inherited From:

deactivateAndActivateControlIfActive()

Deactivates and activates any drawing {OpenLayers.Control} that is active.

deactivateOtherControlsAndActivateCurrent(currentControlId)

Deactivates all other controls and activates the control whose id is passed as a parameter
Parameters:
Name Type Description
currentControlId string The id of the {OpenLayers.Control} to activate

destroy()

Destroys this dialog
Inherited From:

(protected) getBottomPosition() → {Cadcorp.UI.DialogBase.Position}

Calculates the bottom position for this dialog. If footerId is not null the top of the footer is used to calculate the bottom position, otherwise the full height of the page is used.
Inherited From:
Returns:
The bottom left coordinate of this dialog
Type
Cadcorp.UI.DialogBase.Position

getIcon(imageUrl) → {OpenLayers.Icon}

Gets the icon from the list of icons configured with map where the icon file name = imageUrl
Parameters:
Name Type Description
imageUrl string The url of the image
Returns:
or null
Type
OpenLayers.Icon

getLineStyle(selectedValue) → {OpenLayers.Feature.Vector.style}

Gets the line style from the list of line styles configured with map where the line style = selectedValue
Parameters:
Name Type Description
selectedValue string The name of line style
Returns:
strokeDashstyle attribute or null
Type
OpenLayers.Feature.Vector.style

(protected) getMenu() → {Cadcorp.UI.Menu}

Gets the menu object, if any, for this dialog
Inherited From:
Returns:
The menu linked to this dialog
Type
Cadcorp.UI.Menu

(protected) getMenuHeight() → {number}

Gets the height of the linked menu in pixels. If menuId is null 0 is returned, otherwise the height of the menu.
Inherited From:
Returns:
The height of the linked menu
Type
number

(protected) getSize() → {Cadcorp.UI.DialogBase.Size}

Gets the current size of this dialog.
Inherited From:
Returns:
The size of the dialog
Type
Cadcorp.UI.DialogBase.Size

(protected) getTopPosition() → {Cadcorp.UI.DialogBase.Position}

Calculates the top position for this dialog. If menuId is not null the bottom of the menu is used to calculate the top position
Inherited From:
Returns:
The top left coordinate of this dialog
Type
Cadcorp.UI.DialogBase.Position

hide()

Hides this dialog.
Inherited From:

isOpen() → {boolean}

Determines if this dialog is open or not.
Inherited From:
Returns:
True if the dialog is open, otherwise false
Type
boolean

(protected) resizeHandler()

Event handler for the window resize event
Inherited From:

show()

Shows the dilog
Overrides:

Events

beforeclose

Before close event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event
Inherited From:

close

Close event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event
Inherited From:

open

Open event
Type:
  • Object
Properties:
Name Type Description
object Cadcorp.UI.DialogBase The sender of the event
Inherited From: