Select to view content in your preferred language

Change DrawTool Tooltip

988
11
03-12-2010 02:29 AM
JoseSousa
Esri Contributor
Dear ArcGIS API Flex Team,

How can I change the default DrawTool tooltip?
For instance, for extent is: "press down to start and let go to finish" ...

Thanks advanced,

José Sousa
Tags (2)
0 Kudos
11 Replies
BjornSvensson
Esri Regular Contributor
Is it so that you can translate them?
We are planning to provide localization kits/instructions for the API.
0 Kudos
JoseSousa
Esri Contributor
🙂

It will solve my problem.

Thanks a lot,

José Sousa
ESRI Portugal
0 Kudos
FabioSantos
Deactivated User
Hi there,

I can't find into the API where I could change that message.

Could you show me?

Thanks,
Fabio Santos
Petrobras Brazil
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bjorn,

    I would like to see the tooltip customizable for more than just internationalization. I would like to add different text based on my custom action I am using the drawtool for.
0 Kudos
FabioSantos
Deactivated User
Sorry. I solved that problem changing the FlexViwer 2.1 core. 😉

Thanks,
Fabio Santos
Petrobras Salvador/Brazil
0 Kudos
BjornSvensson
Esri Regular Contributor
I would like to see the tooltip customizable for more than just internationalization. I would like to add different text based on my custom action I am using the drawtool for.


@Robert, we have this as an enhancement request.  Not sure yet if it's going to make it in to version 2.2 or not.
0 Kudos
TonyCollins
Regular Contributor
@Robert, we have this as an enhancement request.  Not sure yet if it's going to make it in to version 2.2 or not.


Any news on this?

Would it be possible to override this if not?
0 Kudos
sreekanthreddy
Deactivated User
We can change DrawTool tooltip as per our requirement(Replacing default tooltip).I finished this as follows,
step 1: set property showDrawTips = "false"  for u r DrawTool.
step 2: Handle the following method on mouseMove event of esrp Map.
          private var myToolTip:ToolTip;
         protected function showCursorToolTip(event:MouseEvent):void
  {
   
  if(myToolTip==null)
  {
      myToolTip = ToolTipManager.createToolTip("<Your custom tool tip>", stage.mouseX, stage.mouseY) as ToolTip;
  }
  if(myToolTip !=null)
  {
   if(stage != null)
   {
    myToolTip.x=stage.mouseX;
    myToolTip.y=stage.mouseY;
   }
  }         
   
}

step 3: destroy this tool tip where ever u want(Usually we can destroy on DrawTool end handler).
           like as follows.
           ToolTipManager.destroyToolTip(myToolTip);
    myToolTip=null;

I hope this helps to guys.
0 Kudos
TonyCollins
Regular Contributor
We can change DrawTool tooltip as per our requirement(Replacing default tooltip).I finished this as follows,
step 1: set property showDrawTips = "false"  for u r DrawTool.
step 2: Handle the following method on mouseMove event of esrp Map.
          private var myToolTip:ToolTip;
         protected function showCursorToolTip(event:MouseEvent):void
  {
   
  if(myToolTip==null)
  {
      myToolTip = ToolTipManager.createToolTip("<Your custom tool tip>", stage.mouseX, stage.mouseY) as ToolTip;
  }
  if(myToolTip !=null)
  {
   if(stage != null)
   {
    myToolTip.x=stage.mouseX;
    myToolTip.y=stage.mouseY;
   }
  }         
   
}

step 3: destroy this tool tip where ever u want(Usually we can destroy on DrawTool end handler).
           like as follows.
           ToolTipManager.destroyToolTip(myToolTip);
    myToolTip=null;

I hope this helps to guys.


Thanks for that, that works fine.

I was wondering if there were any events in the drawTool (can't see any) to monitor the polyline as it is being moved around. So I can start a custom tooltip when the drawing starts and apply some maths to get the length of the line (just in pixels for now) so It will show as the line is being dragged about?

Thanks again
0 Kudos