You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

"refresh..." message in status bar   Deroche Nicolas Sep 17, 2007
Re: "refresh..." message in status bar   Miles Hitchen Sep 17, 2007
Re: "refresh..." message in status bar   Deroche Nicolas Sep 17, 2007
Re: "refresh..." message in status bar   Miles Hitchen Sep 17, 2007
Re: "refresh..." message in status bar   Deroche Nicolas Sep 18, 2007
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject "refresh..." message in status bar 
Author Deroche Nicolas 
Date Sep 17, 2007 
Message Hello,

my problem is the following : I want to draw a line element one point is fixed, the other one follows the mouse movement.
I'd like to show the line length in the main pane of the status bar.
However, the message seems to blink because I get the others layers "refresh..." message even with a partial refresh on graphics elements.

Do you know how I can avoid this "refresh..." message ?

Thanks, 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: "refresh..." message in status bar 
Author Miles Hitchen 
Date Sep 17, 2007 
Message Hi,

You could use one of the other message panes, see below.

Hope it helps,
Miles.

 
 
' This uses the page position pane (only used in pagelayout mode)
Application.StatusBar.Panes = Application.StatusBar.Panes OR esriStatusPagePosition
Application.StatusBar.Message(esriStatusPagePosition) = "Distance: xxxxx"
 
  Miles Hitchen
Software Engineer
Geospatial Team
Ordnance Survey
UK
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: "refresh..." message in status bar 
Author Deroche Nicolas 
Date Sep 17, 2007 
Message The problem is that my message is too long to be in this pane.

I have another problem (not only with this pane) : when my mouse doesn't move, i can't see my message (i have only implemented the onMouseMove event of my ITool). 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: "refresh..." message in status bar 
Author Miles Hitchen 
Date Sep 17, 2007 
Message Hi,

The VBA code below shows how to use a line symbol (and ROP value to draw a line on the display without using a refresh). Paste the code into a new UITool, click & drag the tool onto a toolbar and then click the tool, a thick red line will be drawn from the centre of the map to wherever the mouse pointer is, the length of the line will be displayed in the message pane in the lower left of the ArcMap window. Click any other command to stop it.

It was easier for me to write the code than to try and explain how to go about it.

Hope it helps,
Miles.
 
 
Option Explicit

Dim m_pMxDoc As IMxDocument
Dim m_pLine As IPolyline
Dim m_pSym As ISymbol
Dim m_pScrnDisp As IScreenDisplay


Private Sub UIToolControl1_Select()
' Initialize the polyline, symbol and screen display variables
Dim pEnv As IEnvelope
Dim pPt As IPoint

    ' Make the starting point of the polyline the centre of the map frame
    Set m_pMxDoc = ThisDocument
    Set pEnv = m_pMxDoc.ActiveView.Extent
    Set pPt = New Point
    pPt.PutCoords (pEnv.XMax + pEnv.XMin) / 2, (pEnv.YMax + pEnv.YMin) / 2
    Set m_pLine = New Polyline
    m_pLine.FromPoint = pPt

    ' Create the line symbology - red, width = 2
    Dim pRGB As IRgbColor
    Set pRGB = New RgbColor
    pRGB.RGB = vbRed
    Dim pLineSym As ISimpleLineSymbol
    Set pLineSym = New SimpleLineSymbol
    pLineSym.Color = pRGB
    pLineSym.Style = esriSLSSolid
    pLineSym.Width = 2
    Set m_pSym = pLineSym
    ' Important bit, allows us to erase the line without erasing what's underneath it
    m_pSym.ROP2 = esriROPNotXOrPen
    
    ' Get the screen display
    Set m_pScrnDisp = m_pMxDoc.ActiveView.ScreenDisplay

End Sub


Private Sub UIToolControl1_MouseMove(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
' Draw the polyline on the screen, erasing any previously drawn line first
Static bOverwrite As Boolean

    ' Initialsise drawing on the screen with the line symbology
    m_pScrnDisp.StartDrawing 0, esriNoScreenCache
        m_pScrnDisp.SetSymbol m_pSym
        ' Erase the line if we've drawn it previosuly
        If bOverwrite Then
            m_pScrnDisp.DrawPolyline m_pLine
        End If
        ' set the new endpoint for the line and draw it
        m_pLine.ToPoint = m_pMxDoc.CurrentLocation
        m_pScrnDisp.DrawPolyline m_pLine
        ' ensure that it's erased next time
        bOverwrite = True
    m_pScrnDisp.FinishDrawing
    
    ' display length of line in message pane
    Application.StatusBar.Message(0) = "Length Of Line: " + CStr(m_pLine.Length)
    
End Sub


Private Function UIToolControl1_Deactivate() As Boolean

    ' Clear the line when the tool is deactivated
    m_pMxDoc.ActiveView.PartialRefresh esriViewBackground, Nothing, Nothing
    UIToolControl1_Deactivate = True

End Function
 
  Miles Hitchen
Software Engineer
Geospatial Team
Ordnance Survey
UK
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: "refresh..." message in status bar 
Author Deroche Nicolas 
Date Sep 18, 2007 
Message It works perfectly !

Thanks for your answers,