Jump to content
Sign in to follow this  
AAD10 Pete

use dialog/controls: change text or picture of control dynamically?

Recommended Posts

Hi all

In my new mission I would like to present a text or picture on the screen.

Therefor I made a dialog class and a control subclass in a *.hpp file included to the description.ext.

So far all works fine. I can show the text with cutRsc "SomeTextDialogWithSubClass" or with createDialog "SomeTextDialogWithSubClass". The same for the picture.

BUT:

If I present the text with cutRsc, I am not able to change the text dynamically anymore with ctrlSetText.

If I present the text with createDialog, I enter the dialog-mode with getting the normal mouse pointer etc.

Question:

How can I present a text from a dialog class with a text-control subclass with the possibility to change the text dynamically but without entering the "normal mouse pointer mode"?

BTW:

For the dialog class I use the idd=100; for the idc of the control subclass I use idc=101. Both IDs are unique.

Thanks for your help in advance.

Share this post


Link to post
Share on other sites

You really ought to be using the alternative syntax since Arma that takes Control as the parameter instead of IDC. That way you can sure which dialog you're targeting (in case you somehow end up with more than one open at once) and as far as I know it's also the only way to access titles.

This should work in your case:

((findDisplay 100) displayCtrl 101) ctrlSetText "image2.paa";

Share this post


Link to post
Share on other sites

thx for your advice.

But it doesn't bring the solution. If I publish the text with cutRsc then I cannot change the text with ctrlSetText anymore.

If I publish the text with the createDialog, the function ctrlSetText works fine, but then I am in the Dialog-Mode...

Share this post


Link to post
Share on other sites

class RscTitles
{
  class SomeTextDialogWithSubClass
  {
     onLoad = "uiNamespace setVariable [""TAG_SomeTextDialogWithSubClass"", _this select 0]";
     //...
  };
};

((uiNamespace getVariable "TAG_SomeTextDialogWithSubClass") displayCtrl 101) ctrlSetText "image2.paa";

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×