Adding numbers from a combo box to on screen text

And I just tried. I can’t do math with the content of the widget text boxes ( not without some really ugly code ). That’s why you need to bind the text fields to variables.

Inside your widget:

289117-screenshot-2019-10-03-at-223440.png

You see there’s an integer variable for each table and a total. You bind the text boxes to the integers. Then adding the integers is easy…

Ok, so here it is, everything’s contained in the widget except putting it on the screen which I did in the level BP. Textbox Table1, 3 features:

  1. I bound it to Table1Int

so it will always show this number. And I set it to update that integer when an amount was entered:

( I know it’s not a pull down like yours, but it’s the totalling you’re having a problem with. Then I made two other tables just like this, bound to more integers, and with update events.

Then I made a 4th text box which I bound to an integer representing the total ( no input here, just the binding ). And I made a button which totals them, it has the event:

So you see, 3 tables ( you can make more of course ) with an Int behind them. When the button is pressed the total is easily shown in the total box.

I’m also giving you a link to a ( very ) basic project with this content in case you can’t get it working… :slight_smile:

https://drive.google.com/open?id=1V81lB2iUkW0L_i5NlrJxOqVnnR_p8y7y

In fact you don’t even need the button, you could make each of the boxes total things whenever text was committed…

i will impliment this into my project later on today and see how it goes but it looks like it should work thank you so much for all the help, i will report back with results.

I took a look, I’m afraid you’re REALLY over complicating it :frowning:

If you wanna know why your version wasn’t working, here it is in a nutshell:

  1. First of all, you need to bind those boxes in the FloorPlan widget to integers like I showed you.

  2. Then when you cast to the FloorPlan in the Table widget you have to set the correct integer in the FloorPlan, although I have no idea how you will know which one it is, because you don’t know which button on the FloorPlan has called the drop down.

To stay in the same widget you can use the table button to increment the number shown on the table. I did the first 3 tables like this:

The increment function:

Custom event:

It works just fine, but once again I bound the textboxes to integer variables like I showed you in the example project.

If you do it this way you don’t need ANY of those booleans or macros.

Then all you have to do is save everything in a savegame, so it’s the same when you open it back up, but that’s for another day…

Here is my project for work so you can really see what i mean.

https://drive.google.com/open?id=1eyvk2-X94ZFU56eJdiMgLZGbJ5SPgFvQ

thank you so much