Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Color inside SimpleFont group

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

    Color inside SimpleFont group

    Hey guys,

    I'm wonder if I can put the Color property inside the SimpleFont group like in the image below:

    Click image for larger version

Name:	simpleFontGroup.png
Views:	88
Size:	9.7 KB
ID:	1258353

    #2
    Here:


    I found a workaround created by NinjaTrader_ChelseaB.

    Click image for larger version

Name:	inside.png
Views:	83
Size:	4.2 KB
ID:	1258404

    But, it is missing on how make something like in the stroke property:

    Click image for larger version

Name:	inside2.png
Views:	90
Size:	1.3 KB
ID:	1258403

    Any idea how to show the text align with "Text Style" like​:
    (little OrangeRed rectangle), Arial, 11px

    ?

    Comment


      #3
      Hello rafaelcoisa,

      The post you linked is just for making an expandable object however that will not work correctly in all cases. The properties won't be displayed correctly in the UI like you have pictured, it shows the color as #FFF4500 and includes the internal naming of the type.

      When you want to make a color for a text you need to make a seperate Brush property.

      If you wanted to group these items you can use a Display attribute and use the same group for all of the properties: https://ninjatrader.com/support/help...yattribute.htm


      JesseNinjaTrader Customer Service

      Comment


        #4
        Hey NinjaTrader_Jesse ,

        "SimpleFont" and "Stroke" do not work with "ExpandableObject" in order to further customize the UI of an indicator. But, for "Strokes", you can, within an "ExpandableObject" class, create the necessary properties to fill a "Stroke" object created in "State.Configure". I wonder if there is a procedure like this for "SimpleFont" object. An "ExpandableObject" class with an "int" property and a "string" property to fill the "SimpleFont" object in "State.Configure". How to make the string part?​

        Comment


          #5
          Hello rafaelcoisa,

          There is not a way to add more properties to an existing type, for example you can't add a new stroke to the SimpleFont. The UI is only displaying what the SimpleFont is programmed to display for its existing properties.

          This would be a situation where we would recommend using groups in the grid rather than using an expandable object. You can make multiple public properties for what you want and then group them together using the Display attribute.

          [Display(GroupName="MyOverallPropertyName")]

          JesseNinjaTrader Customer Service

          Comment


            #6
            Nevermind, a post of NinjaTrader_ChelseaB showed me how to do it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by llanqui, Today, 03:53 AM
            0 responses
            6 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            10 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            15 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            14 views
            0 likes
            Last Post strategist007  
            Working...
            X