• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access to NT Color Picker (again)

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

    Access to NT Color Picker (again)

    Hello,

    is there a way to use the existing wpf nt control for the color picker?
    I found an older post but the WpfPropertyGrid has either been moved or is no longer accessible in NT8.

    https://ninjatrader.com/support/foru...pfPropertyGrid

    Thank you,
    Mike

    #2
    Hello,

    Thank you for the post.

    I see this is still available for use in nt8, can you tell me where are you currently trying to use the syntax from the other post, was this from an Addon? Are you trying to use this in an Indicator for a user input?

    I tried the following and see this is able to compile:

    Code:
    System.Windows.Controls.WpfPropertyGrid.Controls.BrushPicker bPicker = new System.Windows.Controls.WpfPropertyGrid.Controls.BrushPicker();
    This would be the syntax to use if you wanted to include a brush picker in a custom window. if you are looking for a brush property for an Indicator that would require different syntax. Can you clarify your question further for me?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      thank you very much for your response.
      I am trying to add a BrushPicker in a custom drawing tool which draws a canvas to the chart where i would like to insert wpf controls.

      Thank you,
      Mike

      Comment


        #4
        Hello,

        Thank you for the reply.

        To further clarify, are you trying to draw the WPF brush picker control on the chart, or will this brush be selected by the user in the drawing tools options, for example, the Line tool and its Line brush?

        If the second is true and you want a brush in the drawing tools options, you would need to make a public property in the drawing tool. If you are instead trying to add the brush picker to the chart, I would likely need to better understand your overall goal to assist further.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you for your message.

          I am currently developing a custom Drawing-Tool to Draw a Midas Curve on the Chart.
          Now there are a bunch of settings i should be able to configure after its built.

          Instead of me to have to double click the curve or Right-Click to open the Drawing object properties, i want to display a few form controls to adjust the Drawing object right after the curve is built or is in DrawingState.Editing.

          This all works. I am able to add a grid to the chartControl and i am able to add controls like sliders etc to that grid, all directly from the custom Drawing Tool.

          Now one of the options i would like to be able to change is the Brush i am using for the Draw Object. As WPF doesn't have any Color Pickers available it would be great if i could use the controls from NT.

          The Problem is that in the custom drawing tool i can't reference the WpfPropertyGrid as System.Windows.Controls does not include the WpfPropertyGrid. The same is true from an indicator.

          Thank you,
          Mike
          Last edited by mk77ch; 02-01-2018, 09:08 AM.

          Comment


            #6
            Hello,

            Thank you for the reply.

            I can see this is working from an indicator, but you do need to add a reference for this to work as this is not included to be used in NinjaScript by default. have you added a Reference to the System.Windows.Controls.WpfPropertyGrid.dll?

            https://lh3.googleusercontent.com/-t...1_08-33-14.png

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you for your message.

              if i share this custom drawing tool with somebody, will the added reference persist or will the other person get an error?

              All the best,
              Mike

              Comment


                #8
                Hello,

                When you export in NT8 there is now a drop down menu to choose the various different types. You just need to ensure to check the box for the references you had used in the References drop down.

                https://lh3.googleusercontent.com/-5...1_09-01-14.png

                This would add the Additional references.txt to the zip, you can find the full instructions to include third party assemblies in exports here: https://ninjatrader.com/support/help...esOrNativeDlls

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  perfect thank you!

                  All the best,
                  Mike

                  Comment


                    #10
                    Hello Jesse,

                    i've got two more questions.

                    This works fine now and i am pretty happy with it but there are two problems i am fiddling with.

                    As soon as i try to type in the BrushPicker Control to quickly select a color by entering the name of the color, the instrument selector, which appears when you start to type on a chart, pops up and i can't type in the BrushPicker control.

                    Is there a possibility to somehow prevent this behaviour?

                    The other thing is that i didn't found an event in the BrushPicker control which is fired when i select a brush from the dropdown. Is this possible or did i just not see the event method?

                    Thank you very much!
                    Mike

                    Comment


                      #11
                      Hello,

                      Thank you for the reply.

                      In regard to the instrument picker, yes that would be expected in this case. You could potentially handle the incoming keyboard events from the ChartControl's keyboard event handlers but you would need to figure out a way to know when to do that and when not to do that. This isn't something we generally suggest as this prevents the default chart functions but can also interrupt other ninjaScript items that receive keyboard input. There is also no guarantee that other items that handle the keyboard input will not interrupt your item if applied together.

                      For the event, I do see the following which you could try:
                      Code:
                      bPicker.SelectedBrush.Changed
                      Otherwise, if this does not update when you make modifications, you would need to check the pickers value when you are trying to complete the action this needs to do.

                      I look forward to being of further assistance.
                      JesseNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Johnny Santiago, Today, 04:50 AM
                      1 response
                      5 views
                      0 likes
                      Last Post NinjaTrader_ChrisSch  
                      Started by rickyblah12, Yesterday, 08:17 PM
                      1 response
                      11 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Started by jamarc, Today, 02:30 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post jamarc
                      by jamarc
                       
                      Started by mrlucky1x, Yesterday, 08:07 PM
                      1 response
                      5 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Started by uday12, Yesterday, 07:21 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post uday12
                      by uday12
                       
                      Working...
                      X