Select to view content in your preferred language

Draw Widget tooltips

2198
10
03-17-2011 04:19 AM
HugoDurana
Emerging Contributor
Good afternoon all,

I am having a hard time figuring out how to change the tooltips of the draw operations.

Example:
I click on the Draw Circle. The tooltip that is next to the cursor says:
"Press down to start and let go to finish"

Where can i change this text?

TIA,
Hugo
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Hugo,

   You can't in the current API. This is already submitted as an enhancement request though.
0 Kudos
HugoDurana
Emerging Contributor
Hugo,

   You can't in the current API. This is already submitted as an enhancement request though.


First of all, thanks for the update.

Second, where can i find the enhancement request list for Flex Viewer and it's API?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hugo,

   It is not publicly available. I only know about it because I am part of a private beta testing of the 2.3 API and Viewer.
0 Kudos
IvanBespalov
Frequent Contributor
You right Robert, but...

Listen your application (viewer or other) creation complete handler. Get resource bundle with name "ESRIMessages"

...
creationComplete="onCreationComplete()"
...
<fx:Script>
    <![CDATA[
...
/**
 * Listen creation complete handler
 */
protected function onCreationComplete():void
{
       var rb:IResourceBundle = resourceManager.getResourceBundle("en_US", "ESRIMessages") as IResourceBundle;
 rb.content["drawTooltipMappoint"] = "New message text 1";
 rb.content["drawTooltipPolygonContinueDrawing"] = "New message text 2";
 rb.content["drawTooltipPolylinePolygonStart"] = "New message text 3";
 rb.content["drawTooltipPolylinePolygonComplete"] = "New message text 4";      
}
]]>
</fx:Script>


Look for more decompiled resources in attachment
0 Kudos
TammyBearly
Deactivated User
Thank you Ivan.  That works perfect!

Note, I had to add: import mx.resources.IResourceBundle;
0 Kudos
GiosiaPoma
Regular Contributor
Hi,
you must create a ESRIMessages.properties and other properties file from Flex Locale. After that you must to compile a swf for your specific locale and at end you must to pass the path to the new Locale swf in html wrapper. It's a bit hard but I've made that for my specific country it_CH.

If need some infos... write here
0 Kudos
IvanBespalov
Frequent Contributor
Giosia,
you're right, but a little too late. Where are alot of ways to make it work.

1 - One of them: compile and compile project fo each locale. If the client change language, application loads new swf (if we are tolking about mapping application application loads >1 new swfs) - as a result new initialization of all components ... The cliant lost the result of his work.

2 - Other way to change locale on fly: if  final application has >1 locale. For example: your client works with application, and the result of his work is some report, which contains search results, some diagrams, images, map in specific extent, some number of highlighted features ... The client wants to print a report for all possible languages�??�??, without losing search results without losing the map condition, without losing anything except change the language.

P.S. We choosed to: create 1 resource xml file for each language, create public singleton class witch holds information about current locale, create public singleton class witch can read xml resources + listen locale change + has public property for each string property. May be its not better way: but 1-we hold all messages/strings in 1 file, we can access it in anytime from any part of application, it works 🙂
0 Kudos
BrunoPereira1
Deactivated User
You right Robert, but...

Listen your application (viewer or other) creation complete handler. Get resource bundle with name "ESRIMessages"

...
creationComplete="onCreationComplete()"
...
<fx:Script>
    <![CDATA[
...
/**
 * Listen creation complete handler
 */
protected function onCreationComplete():void
{
       var rb:IResourceBundle = resourceManager.getResourceBundle("en_US", "ESRIMessages") as IResourceBundle;
 rb.content["drawTooltipMappoint"] = "New message text 1";
 rb.content["drawTooltipPolygonContinueDrawing"] = "New message text 2";
 rb.content["drawTooltipPolylinePolygonStart"] = "New message text 3";
 rb.content["drawTooltipPolylinePolygonComplete"] = "New message text 4";      
}
]]>
</fx:Script>


Look for more decompiled resources in attachment




Thanks Ivan!! This helps me a lot!! lol
Bruno Faria
0 Kudos
MLowry
by
Frequent Contributor
You right Robert, but...

Listen your application (viewer or other) creation complete handler. Get resource bundle with name "ESRIMessages"

...
creationComplete="onCreationComplete()"
...
<fx:Script>
    <![CDATA[
...
/**
 * Listen creation complete handler
 */
protected function onCreationComplete():void
{
       var rb:IResourceBundle = resourceManager.getResourceBundle("en_US", "ESRIMessages") as IResourceBundle;
 rb.content["drawTooltipMappoint"] = "New message text 1";
 rb.content["drawTooltipPolygonContinueDrawing"] = "New message text 2";
 rb.content["drawTooltipPolylinePolygonStart"] = "New message text 3";
 rb.content["drawTooltipPolylinePolygonComplete"] = "New message text 4";      
}
]]>
</fx:Script>


Look for more decompiled resources in attachment


Thanks very much for this. Using it now in 2.5, works just fine.
0 Kudos