[Chameleon] Creating Widgets

Ken Sanderson ken at rockies.ca
Wed Aug 4 16:30:32 EDT 2004


Hello all. I took a first stab at creating a widget, actually it was
more editing of other widgets, but I did get it working and I had a
couple general questions.

In order to get it to work in the end I needed to manually add my widget
tool name to several parts of MapDHTMLWidget.widget.php. Is there a way
to make this get automatically added from your specific widget php file?

For example, I changed the following in the MapWchkMouseUp function:

    if((window.gMapDHTMLForm != null) && 
       (gMapDHTMLForm.NAV_CMD != null) &&
       (gMapDHTMLForm.NAV_CMD.value == "PAN_MAP" ||
        gMapDHTMLForm.NAV_CMD.value == "RULER" ||
        gMapDHTMLForm.NAV_CMD.value == "QUERY" ||
        gMapDHTMLForm.NAV_CMD.value == "GetPoint"))
        return true;

My change is the GetPoint portion line which I needed added. Basically I
am wondering if I can invoke that change, which was also added to the
MapWgetMouse and MapWmapTool functions, at my widget rather then in the
MapDHTMLWidget itself, which means I wont need to go back and change
that file every time I upgrade Chameleon.

My other question is in regards to functions. Is there any check for
adding duplicate functions from different widgets? Basically I use a
function from the CursorPos widget in my widget. Can I add the exact
same function to my widget in case CursorPos isnt loaded or will that
cause two functions of the same name to be outputted to the HTML file?

Thanks,

Ken






More information about the Chameleon mailing list