The documentation information provided in this section. Gives specific information on the activities and state of the current widget document. en-CA This document is written in Canadian English 1999-12-31 The date of the document was last processed through doc builder. $id:$ CVS repository version description The following active authors for this widget document are: Doc_Builder DM Solutions Group Inc. chameleon@lists.maptools.org The following active editors for this widget document are: Christopher R. Thorne DM Solutions Group Inc. chameleon@lists.maptools.org Paul Spencer DM Solutions Group Inc. chameleon@lists.maptools.org The main developers of this widget should present them selves bellow: MapSize The name of this widget based on last current widget name is: TBD The widget installation package the widget is in. TBD 1.99 Chameleon Technical Release 2005-01-10 Chameleon Technical Release TECHRELEASE - (i.e., in development, functionally complete, no know major bugs, minimal documentation) Paul Spencer DM Solutions Group Inc. chameleon@lists.maptools.org This section holds all content description for a specific widget. The general description of the importance of the current widget. The MapSize widget is used to allow the user to specify new dimensions for the map image, either from a pre-defined list of sizes or by specifying a custom size. Note that the MapDHTMLWidget widget must have ALLOWRESIZE set to "TRUE" for MapSize to have any effect. This widget can be embedded into the interface with a drop down list or with a popup that is launched by a button. When the widget is embedded, it has Label attributes, and when it is not embedded it has Button attributes. The MapDHTML widget must be present in the application template and it must have its ALLOWRESIZE attribute set to "true" to allow the MapSize widget to change the map size within an application. The type of attributes used by this widget determines what kind of Shared Resources the widget can use. The MapSize widget tag has attributes from the Button Attributes and Popup Attributes Groups. This means MapSize has access to the Style and PopupCSS Shared Resources. To learn about these Shared Resources, please refer to the appropriate attribute group sections for details. This widget provides the capability to modify the size of the map image. The widget may be embedded in the page as a dropdown list of map sizes (choose the desired size) or represented by a button that launches a small dialog to allow picking a map size. This widget may be configured to allow only pre-defined sizes, or it may be configured to allow the user to enter a custom map size. In the latter case, enter the new dimensions (in pixels) and click OK to change the size of the map. Note that larger map sizes take longer to generate and download. The smallest size is typically 400 x 300. The largest size is typically 1000 x 750. If the MapSize widget is set to embedded mode then a labeled drop-down list of map size options is created. Examples of options could be: Large, Medium, Small, and Custom. If "custom" is included in the list of choices, a dialog box will be opened to allow the user to specify the new size, despite the fact the widget is in embedded mode. If the MapSize widget is not set to be embedded, then it is represented as a button that launches a dialog box. The dialog box allows the user to pick from pre-defined sizes or enter a custom size (if "custom" is one of the choices). In the popup window, if "custom" is defined in the "MapSize" Widget tag, text fields are displayed to allow the user to define the WIDTH and HEIGHT of the map. The tag syntax of the widget and possible shared resource is outlined here. It is important to show how the tag structure is declared within an HTML, because it will help to determine where and how an attribute is declared. It is important to note that Shared Resource may also be declared through a specific widget. If this is the case for the current widget than there should be a shared resource tag syntax definition below the widget. If a widget utilizes an Attribute Group the current widget will also have access to the Attribute Group Shared Resource. If the EMBEDDED attribute is set to "TRUE", then the following widget definition is available. Note that the popup attributes are available, since a popup is available if "custom" is an option in the embedded drop down list. Also note that the widget has label attributes when it is embedded. <CWC2 TYPE="MapSize" ENABLED="[TRUE|FALSE]" FORMINDEX="[0 < integer]" VISIBLE="[TRUE|FALSE]" <!-- MapSize Attributes --> EMBEDDED="[TRUE|FALSE]" <!-- Popup Attribute Group --> POPUPHEIGHT="[0 < integer]" POPUPWIDTH="[0 < integer]" MENUBAR="[TRUE|FALSE]" POPUPSTYLERESOURCE="[string]" RESIZABLE="[TRUE|FALSE]" SCROLLBARS="[TRUE|FALSE]" STATUS="[TRUE|FALSE]" TOOLBAR="[TRUE|FALSE]"> <!-- Label Attribute Group--> LABEL="[string]" LABELPOSITION="[0 < integer < 8]" LABELHALIGN="[LEFT|CENTER|RIGHT]" LABELVALIGN="[TOP|MIDDLE|BOTTOM]" LABELCLASS="[string]" LABELSTYLE="[string]"/> <!-- MapSize Subtag Group --> <MAPSIZE LABEL="[string]" HEIGHT="[CUSTOM|0 < integer]" WIDTH="[CUSTOM|0 < integer]"/> </CWC2> If the EMBEDDED attribute is set to "FALSE", then the Button and Popup Attribute Groups are valid for this widget. The widget will not use any Label attributes when not embedded. The following widget definition is available: <CWC2 TYPE="MapSize" ENABLED="[TRUE|FALSE]" FORMINDEX="[0 < integer]" VISIBLE="[TRUE|FALSE]" <!-- MapSize Attributes --> EMBEDDED="[TRUE|FALSE]" <!-- Popup Attribute Group --> POPUPHEIGHT="[0 < integer]" POPUPWIDTH="[0 < integer]" MENUBAR="[TRUE|FALSE]" POPUPSTYLERESOURCE="[string]" RESIZABLE="[TRUE|FALSE]" SCROLLBARS="[TRUE|FALSE]" STATUS="[TRUE|FALSE]" TOOLBAR="[TRUE|FALSE]"> <!-- Button Attribute Group--> BACKGROUNDIMAGE="[path]" DEFAULT="[TRUE|FALSE]" IMAGE="[path]" IMAGEHEIGHT="[integer]" IMAGETIP="[string]" IMAGEWIDTH="[integer]" LABELALIGN="[LEFT|CENTER|RIGHT]" LABELANTIALIAS="[TRUE|FALSE]" LABELCOLOR="[#RRGGBB]" LABELFONT="[string]" LABELFONTSIZE="[0 < integer]" ONCLICK="[string]" STYLERESOURCE="[string]" TEXTBUTTONBORDER="[path]" TEXTBUTTONBORDER_BOTTOM_IMAGE="[path]" TEXTBUTTONBORDER_BOTTOMLEFT_IMAGE="[path]" TEXTBUTTONBORDER_BOTTOMRIGHT_IMAGE="[path]" TEXTBUTTONBORDER_LEFT_IMAGE="[path]" TEXTBUTTONBORDER_RIGHT_IMAGE="[path]" TEXTBUTTONBORDER_TOP_IMAGE="[path]" TEXTBUTTONBORDER_TOPLEFT_IMAGE="[path]" TEXTBUTTONBORDER_TOPRIGHT_IMAGE="[path]" TEXTBUTTONCOLOR="[#RRGGBB]" TEXTBUTTONNUDGE="[integer]" TEXTBUTTONPADDING="[0 < integer]" TOOLSET="[string]" USETEXTBUTTONCACHE="[TRUE|FALSE]"> <!-- Button Subtag Group --> <IMAGE STATE="[NORMAL|SELECTED|HOVER|DISABLED]" IMAGE="[path]"/> <!-- MapSize Subtag Group --> <MAPSIZE LABEL="[string]" HEIGHT="[CUSTOM|0 < integer]" WIDTH="[CUSTOM|0 < integer]"/> </CWC2> This is the section for all code examples. From Widget, Shared Resource to Advance Scripting examples. Below are examples of Chameleon widget tags that could be placed into an HTML template with little to no attribute value changes. All Widget Tags should be placed between the HTML <form> </form> tag with the Template. The following is an embedded="TRUE" example. Please note that the mapsize subtag is required. <cwc2 type="MapSize" embedded="true" popupwidth="480" popupheight="200"> <mapsize label="Small" width="400" height="300"/> <mapsize label="Medium" width="600" height="450"/> <mapsize label="Large" width="800" height="600"/> <mapsize label="Custom ..." width="custom" height="custom"/> </cwc2> The following is an embedded="FALSE" example. Button group attributes should be defined in a Shared Resource. <cwc2 type="MapSize" embedded="false" popupwidth="480" popupheight="200" toolbar="false" status="false" menubar="false" visible="true" image="icons/icon_mapsize.png" imagewidth="19" imageheight="18" imagetip="Set Map Size" label="Map Size"> <mapsize label="Small" width="400" height="300"/> <mapsize label="Medium" width="600" height="450"/> <mapsize label="Large" width="800" height="600"/> <mapsize label="Custom ..." width="custom" height="custom"/> </cwc2> See this widget in action! Here are some applications that use this widget. Hawaii Demo http://www.mapsherpa.com/hawaii2/ The Hawaii Demo uses the latest 1.99 Chameleon version. Base Button Popup Label This Attribute section outlines the declared attributes found specifically within this specific widget. This attributes declared include: Widget Attributes, Shared Resource Attributes, as well as Widget XML Sub Tags and Sub Tag attribute groupings. EMBEDDED boolean Widget Only false true false Defines two optional modes for the MapSize widget. If set to "true", the MapSize widget is represented as a dropdown combo-box list. If set to "false", the MapSize widget is represented as a button that launches a popup. WIDGETCLASS string Widget Only NULL Specify a CSS class to be used for the HTML select element used when the widget is embedded. <MAPSIZE /> XML Child Element to Chameleon Widget Tag (Subtag) Required A subtag placeholder for MapSize attributes settings. These attributes define what map size options the user of the application has. These options are placed within the combo-box list. Since there are no default settings for this widget, the subtag and attributes are required for the widget to function. HEIGHT integer Required 1 2147483647 This attribute defines the height option (in pixels) of the map size. The HEIGHT attribute has a reserved word option, "custom". If the WIDTH attribute is also defined with this word, then the user can define their own map size using the custom popup interface of the MapSize widget. LABEL string Required Define what is displayed to the user in the drop down list of map size options. For example, Small, Medium, Large, or Custom. WIDTH integer Required 1 2147483647 This attribute defines the width option (in pixels) of the map size. The WIDTH attribute has a reserved word option "custom". If the HEIGHT attribute is also defined with this word, then the user can define their own map size using the custom popup interface of the MapSize widget. What is a form element? Needs an introduction. SET_MAP_WIDTH integer The new map width (in pixels) when changing the map window size. SET_MAP_HEIGHT integer The new map height (in pixels) when changing the map window size. All Java Script Variables defined within the specific widget code should be described here. string Private 0 NULL 1 2 What is this variable??? Here all Java Script Functions that are written within the widget code should be defined here. Along with there parameters, the functions return value and possible JS API event the function might trigger. clickMapSizePopup Private Callback function for the user clicking the map size button The parameters for the current Java Script function are outlined here. string false 0 Null 0 10 Description of TESTING Parameter..... The Value to be returned by the current JS Function is as follows. Some JS Functions define or rather trigger events through the Chameleon Api. applyMapSize Private Set the map size. The parameters for the current Java Script function are outlined here. nWidth integer true 1 INF The new width of the map. nHeight integer true 1 INF The new height of the map. The Value to be returned by the current JS Function is as follows. Some JS Functions define or rather trigger events through the Chameleon Api. cancelMapSize Private Callback function when the user cancels changing the map size so the selection can be reset. None. The Value to be returned by the current JS Function is as follows. Some JS Functions define or rather trigger events through the Chameleon Api. getMapSize Private Return the size of the map (in pixels) as an array. The parameters for the current Java Script function are outlined here. string false The Value to be returned by the current JS Function is as follows. array array This function returns an array with index 0 set to the width and index 1 set to the height. Some JS Functions define or rather trigger events through the Chameleon Api. changeMapSize Private Callback function when the user has selected a new map size from the combo-box on the page. The parameters for the current Java Script function are outlined here. string false The Value to be returned by the current JS Function is as follows. Some JS Functions define or rather trigger events through the Chameleon Api. Some Chameleon Widgets have some or all of its Java Script functions and variables defined within a Java Script File. This file may serve a general purpose that will be described or may have functions, variables or API events that are important to an Chameleon application developer. The specific widget is programmed to listen for an particular action from the Java Script API that produces a triggered event. It is this action reaction between the widgets and the JS API that allow the Chameleon JS API service to function. The Java Script Events that are being listened for are listed below. Description of this listened event. For each JS API function calls for the widget are outlined here. CALEDFUNCTION NAME? Description of function called A few of the widgets have been designed to contain widget events. These type of events are described below. The widget events parameters. WIGETEVENT PARAMETER Name string false red test red blue Description of parameter of widget event..... Description of widget event.....