Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tooltip causes crosshair glitch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tooltip causes crosshair glitch

    I coded up some tooltips into my indicator, using the standard C# tooltip class.

    When the tooltip for my indicator appears, it causes the crosshair to leave a shadow where it was, so I end up with an extra crosshair on the screen as soon as I move the mouse.

    I can't get a screenshot of the problem because pressing the CTRL or ALT keys makes the crosshair shadow disappear, i.e. I can't press ALT-print screen.

    Can I do anything about this in the way I code the tooltip?

    In my OnBarUpdate() I create the Button control, call Hide() so it doesn't show yet, and add it to the Screen Panel 'pnlChart' and I then create a new ToolTip and add the button control to it with the text.

    I then make the button visible in Plot() when necessary.

    I'd post code but there's lots of it.

    Is this a known issue?

    Thanks

    #2
    Can you reproduce this on another computer? Some graphics drivers will leave artifacts ("ghosts") of tool tip items when they should disappear.

    If it's reproducible, did you define any delays in your tooltip object properties? Are you using the AutoPopDispaly or antyhing else here? http://msdn.microsoft.com/en-us/libr...opopdelay.aspx
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew

      it's ghosts of the crosshair that are left on the chart, not the tooltip.

      I have seen it before especially when working with horizontal lines on the chart.

      I didn't use any tooltip properties, they are all the defaults.

      Comment


        #4
        Thanks for the clarification. I'm not aware of any direct items from using tool tips, but there are several aspects that may hang especially with an nVidia card that we've seen.

        Can you clarify if you see this behavior on a second PC?
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          Thanks for the clarification. I'm not aware of any direct items from using tool tips, but there are several aspects that may hang especially with an nVidia card that we've seen.

          Can you clarify if you see this behavior on a second PC?
          It's an ATI Mobility Radeon, for what it's worth. I don't think that's based on nVidia.

          I don't know when I'll get a chance to try it on a second PC, I'll have to get back to you on that one.

          Comment


            #6
            Originally posted by adamus View Post
            It's an ATI Mobility Radeon, for what it's worth. I don't think that's based on nVidia.

            I don't know when I'll get a chance to try it on a second PC, I'll have to get back to you on that one.
            Your video drivers are upto date for the card?

            Comment


              #7
              Originally posted by sledge View Post
              Your video drivers are upto date for the card?
              OK Just upgraded the video drivers which was way too complicated with about 10 downloads and installs of various bits of software from AMD, and it made no difference.

              Nice idea though, thanks.

              Comment


                #8
                Hi Adamus,

                Thanks for trying that. I'm not able to immediately reproduce, however what you're attempting to do with the tool tips/cross hair may not be fully understood.

                Would you be able to email a copy of the add-on you're using? If you'd like, you can send me the protected DLL and I'd be happy to just see if we can reproduce on another machine. And we can work from there.
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Hi Matthew

                  I just emailed you a zip with the indicator for you to test on your machine.

                  Thanks

                  Comment


                    #10
                    Originally posted by adamus View Post
                    I coded up some tooltips into my indicator, using the standard C# tooltip class.
                    Could you share a code snippet showing how you added a tooltip? What type of object did you attach it to?

                    Or, perhaps point me to any kind of examples you may have followed yourself?

                    Thank you in advance!
                    Daniel

                    Comment


                      #11
                      Hi Daniel,

                      I attached buttons to the tooltips. There is a slight glitch with the screen refresh when you hover and dehover over the tooltip buttons - I'd interested to see if it affects you too.

                      This is my code:

                      Code:
                      screenControl.Controls.Add(button);
                      tt = new ToolTip();
                      tt.SetToolTip(button, "text etc");

                      Comment


                        #12
                        Originally posted by adamus View Post
                        Code:
                        screenControl.Controls.Add(button);
                        tt = new ToolTip();
                        tt.SetToolTip(button, "text etc");
                        Could you define "screenControl" for me? Do you mean the ChartControl?

                        In my scenario, I am looking to attach my tooltips to ITriangleDown, ITriangleUp, IDot, etc type objects. I'm hoping that I can replace "button" with my objects.

                        Did you have to do anything special with garbage collection with all these tooltips? I'm thinking I'll add them to an array of objects, then dispose of them OnTermination().

                        I'll gladly share my experience with that screen glitch/refresh that you're referring to.

                        Daniel
                        Last edited by neoikon; 04-03-2014, 07:14 AM.

                        Comment


                          #13
                          Actually I had a lot of issues getting hold of and keeping that control - here's what I did in OnStartUp:

                          Code:
                          if (ChartControl != null && ChartControl.Controls.Count > 0 &&
                              ChartControl.Controls["pnlChart"] != null)
                          {
                              screenControl = ChartControl.Controls["pnlChart"];
                              for (int k = 0; k <= screenControl.Controls.Count - 1; k++)
                              {
                                  Control button = screenControl.Controls[k];
                                  string msg = button.Name + " " + button.ToString()  
                                          + " L:" + button.Left
                                          + " T:" + button.Top
                                          + " H:" + button.Height
                                          + " W:" + button.Width;
                                  Print(msg);
                              }
                          }
                          just to make sure I wasn't leaving stuff in there or going crazy.

                          By the way if you do this at the top:

                          using System.Collections.Generic;

                          you can use List to replace array declaration and manipulation.
                          Last edited by adamus; 04-03-2014, 07:45 AM.

                          Comment


                            #14
                            Originally posted by adamus View Post
                            Code:
                                screenControl = ChartControl.Controls["pnlChart"];
                            Thank you for the quick reply. I see how it's being set in your example, but could you tell me the type of screenControl? I apologize if it's obvious.

                            In the past, when I access the ChartControl.Controls[] I'm accessing a ToolStrip, so I cast it as such. Not sure in this situation.

                            Daniel

                            Comment


                              #15
                              private Control screenControl;

                              You probably don't want to follow my usage of capitalization - I'm too used to coding in Java and Microsoft for what they're worth, would call probably call it ScreenControl. Call it Banana if you want though.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              148 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Started by tkaboris, Today, 05:13 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post tkaboris  
                              Started by GussJ, 03-04-2020, 03:11 PM
                              16 responses
                              3,283 views
                              0 likes
                              Last Post Leafcutter  
                              Working...
                              X