New Dialog -> Edit -> Add RichEdit -> Object Behavior ->

Got a problem you cannot solve? Try here.
Post Reply
glenharvy
Posts: 167
Joined: Fri Sep 14, 2007 3:53 am

New Dialog -> Edit -> Add RichEdit -> Object Behavior ->

Post by glenharvy »

Receives Information

OK I am now lost.

I presume I should be able to select the rtf file that I added to the Support Files however I can only see the Read Me and Licence files listed.

If I'm on the wrong track, how do I add the text to the RichEdit object.

I also wish to include the contents of a variable in the body of the text. How do I do that?

I feel so stupid :cry:
glenharvy
Posts: 167
Joined: Fri Sep 14, 2007 3:53 am

Post by glenharvy »

How do I edit the text in the richtext object?
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

Glen,

I think this might get you started. In your dialog add the memo object. In the Object Properties open the Lines property. In there, enter, for example, $MYTEXT$.

In your code, add something like:

label: Test Dialog
Set Variable MYTEXT to Hello...
Display Dialog: SampleDialog, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end


Build and run the project. When I do this I get the value to display ok. In theory, you should be able to use the Read from Text File statement and get text from a support file or a file bag.

When you use a label, you'd enter the variable $MYTEXT$ into the Caption property. I have not tested the RichEdit object but I'd like to think it might work the same way as the Memo object. I'll let you investigate that further.

Edit: I can confirm the RichEdit works the same way as the Memo. That is, add your variable to the Lines property.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
glenharvy
Posts: 167
Joined: Fri Sep 14, 2007 3:53 am

Post by glenharvy »

bokkie wrote:Glen,

I think this might get you started. In your dialog add the memo object. In the Object Properties open the Lines property. In there, enter, for example, $MYTEXT$.
Peter, your a godsend.

I've since had a long break (instead of hitting my head against a wall) and I began to think about how variables were passed to dialogs and also how the license dialog works as well. In another day or so I may have worked it out (or I may not have) but as usual, once you are pointed in the right direction it all begins to make sense.

I'll work on this some more tomorrow (it's getting on midnight here in Australia) but I'm sure I'll be OK now.

You may be interested to know that I also discovered how to just add text instead of going the route you suggest. I will implement your way however because that's how you can insert variables into the text.......
bokkie wrote:In the Object Properties open the Lines property
I 'accidentally' double clicked the lines property and guess what happened :D

The elipses also give the game away - but I wasn't looking there was I :(

Thanks for your help.

Warm regards,
glenharvy
Posts: 167
Joined: Fri Sep 14, 2007 3:53 am

Post by glenharvy »

bokkie wrote:Glen,

I think this might get you started. In your dialog add the memo object. In the Object Properties open the Lines property. In there, enter, for example, $MYTEXT$.
Oops - I may have spoken to soon.

In that box there is (TMemoStrings) and I'm not able to delete or change it.
I'm using IA 7 Studio Version R2.

I can change a label OK though.

I'm beginning to think I've installed the wrong version!!!!

Edit:
Instead of theory, I went into practice mode and discovered that placing $MYTEXT$ into the body of the text to be displayed works fine.

I think (back to theory mode) this problem is resolved.
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post by ALive »

bokkie wrote:Glen,

I think this might get you started. In your dialog add the memo object. In the Object Properties open the Lines property. In there, enter, for example, $MYTEXT$.

In your code, add something like:

label: Test Dialog
Set Variable MYTEXT to Hello...
Display Dialog: SampleDialog, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end


Build and run the project. When I do this I get the value to display ok. In theory, you should be able to use the Read from Text File statement and get text from a support file or a file bag.

When you use a label, you'd enter the variable $MYTEXT$ into the Caption property. I have not tested the RichEdit object but I'd like to think it might work the same way as the Memo object. I'll let you investigate that further.

Edit: I can confirm the RichEdit works the same way as the Memo. That is, add your variable to the Lines property.
Hi!

Beautiful solution, but has a bug when using with Localizations. We're using Russian localizations. Localization tool does not has this variable (that you specify in Lines property). I suppose the Tools just miss such variables and when IA find the variable on the runtime it simply puts an empty string, instead of the value (even with English words only). Just turn off the localizations, and the text is inside the Memo or RichEdit.

So it's definitely a bug in IA when using Localizations. Founded on 8.0 and 9.0 versions. I hope 9.01 does not have this...

Have a nice day!
Post Reply