Sign in to follow this  
xod

Indirect UI – embedded Help file

Recommended Posts

xod    174

I saw on the BoltBait's site – beyond CodeLab –  how to embed an icon but does not explain how to embed the Help file.
If I Add Existing item and select the .rtf file then Embedded Resource nothing happens. The message showed in Help box is an error: System.ArgumentNullException: Value cannot be null.

// Change the effect's window title
            props[ControlInfoPropertyNames.WindowTitle].Value = "Test01";
// Add help button to effect UI
            props[ControlInfoPropertyNames.WindowHelpContentType].Value = WindowHelpContentType.CustomViaCallback;
            props[ControlInfoPropertyNames.WindowHelpContent].Value = "Test01Effect.Test01.rtz";

Maybe someone can help me. Thanks in advance.

Share this post


Link to post
Share on other sites
toe_head2001    792
props[ControlInfoPropertyNames.WindowHelpContentType].Value = WindowHelpContentType.CustomViaCallback;

The CustomViaCallback enum means you're going to provide your own custom function to handle the help content.

 

CodeLab can generate example code for you:

Spoiler

codeLab-rtf.png

source-rtf.png

 

Or do you already have that code generated from CodeLab?

Share this post


Link to post
Share on other sites
xod    174

Yes, I already have that code generated from CodeLab but the .rtf text is not showed in the Help window. Only the error.

What I need to do?

Edited by xod

Share this post


Link to post
Share on other sites
toe_head2001    792

Sorry, I misread your post. :roll:

 

Perhaps the Namespace is not correct?

Is the Default Namespace in your Project set to "Test01Effect"?

And is your file named "Test01.rtz"?

 

EDIT: Here's a screenshot, if that helps:

Spoiler

rtf-shot.png

 

  • Upvote 1

Share this post


Link to post
Share on other sites
xod    174

My file have rtf extension not rtz but I don't understand why in the code generated from CodeLab have rtz.
The Namespace is correct.
Ok, I'll see tomorow what is happening. Now is late. In my country it is time 23:20.
Thank you for your help.

Share this post


Link to post
Share on other sites
MJW    637

Perhaps I don't understand what's going on, but in my VS projects, the help menu file always takes a name like Properties.Resources.Help, where the resource in the project is called Help. Likewise, the icon is Properties.Resources.Icon. They're defined (automatically by VS) in Properties>Resources.Designer.cs in code like,

internal static string Help {
            get {
                return ResourceManager.GetString("Help", resourceCulture);
            }

 

  • Upvote 1

Share this post


Link to post
Share on other sites
BoltBait    1,226

rtz is an rtf file that has been compressed.  CodeLab compresses the help files to save space.

 

You can use the following utility to compress your rtf file for embedding:

 

CompressV2.zip

 

(This was written by me. It compresses the help file the same way CodeLab does.  It can also uncompress a file.)

 

BTW, I don't want any bug reports on this utility. I wrote it for my own use and am sharing it now because I'm such a nice guy.

  • Upvote 3

Share this post


Link to post
Share on other sites
xod    174

Ok, now everything is working correct. Thanks BoltBait for this small utility.

Share this post


Link to post
Share on other sites
xod    174
On 1/24/2017 at 3:00 AM, BoltBait said:

BTW, I don't want any bug reports on this utility. I wrote it for my own use and am sharing it now because I'm such a nice guy.

 

I appreciate that. You're a really nice guy. :D

 

I don't want to abuse for your kindness but maybe you can help me in the next problem:

//two sliders AmountX, AmountY with link checkbox = AmountZ; if the checkbox is ticked then AmountX and AmountY sliders is linked.
propRules.Add(new LinkValuesBasedOnBooleanRule<int, Int32Property>(new ValueType[] { PropertyNames.AmountX, PropertyNames.AmountY }, PropertyNames.AmountZ, false)); //found on simonbrown site

//one slider = AmountX with enable checkbox = AmountY; if the checkbox is unticked then AmountX slider is disabled.
 propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.AmountX, PropertyNames.AmountY, true));//also found on simonbrown site

Now, if I have a dropdown list and I want to enable a slider when an option from that dropdown list is choosed, how can I make that?

 

propRules.Add(new ReadOnlyBoundToBooleanRule(PropertyNames.AmountXOptionN, PropertyNames.AmountY, true));//does not work

 

Edited by xod

Share this post


Link to post
Share on other sites
ReMake    403

Your code might look like this:

        protected override PropertyCollection OnCreatePropertyCollection()
        {
            List<Property> props = new List<Property>();
            
            props.Add(StaticListChoiceProperty.CreateForEnum<AmountXOptions>(PropertyNames.AmountX, 0, false));
            props.Add(new Int32Property(PropertyNames.AmountY, 5, 0, 100));
            ...
            ...
            
            List<PropertyCollectionRule> propRules = new List<PropertyCollectionRule>();
            propRules.Add(new ReadOnlyBoundToValueRule<object, StaticListChoiceProperty>(PropertyNames.AmountY, PropertyNames.AmountX, AmountXOptions.AmountXOptionN, true));
            
            return new PropertyCollection(props, propRules);
        }

Pay attention to the last line.

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this