Forum Jump :

Author Message

Mafi  



Posts: 2
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-08-18 03:28        
     
I'm trying to create an Dialog to spawn vehicles.
I already created the the design with the GUI-Creator from A3.

Now my Question is:
How can i change the content from a picture box and or from a text box when i select a Vehicle.

I want this to happen:
I select a vehicle and than a info and a picture about it appears.

I already searched several pages and it took me about 2 hours but i found
nothing which helped me / worked for me.

Thank you!


Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#2 Posted at 2014-08-18 10:23        
     
Use rscStructuredText instead of rscText. You can put images and text together in it :-)

Like this:

CONTROL ctrlSetStructuredText parseText "<img align = 'center' size = '5' image = 'path\to\image.paa'/><br/><br/>This is an image!",

If you dont understand structured texts very well then there are examples at the bottom of this page:
https://community.bistudio.com/wiki/parseText

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface

Advertisement


Author Message

Mafi  



Posts: 2
Rank:


Level: Member

Country: at
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-08-18 15:02        
     
# BrotherhoodOfHam : Use rscStructuredText instead of rscText. You can put images and text together in it :-)

Like this:

CONTROL ctrlSetStructuredText parseText "<img align = 'center' size = '5' image = 'path\to\image.paa'/><br/><br/>This is an image!",

If you dont understand structured texts very well then there are examples at the bottom of this page:
https://community.bistudio.com/wiki/parseText

Isn't this a html code?
How should i use this code?
Just add to a button:
action = "CONTROL ctrlSetStructuredText parseText ""<img align = 'center' size = '5' image = 'path\to\image.paa'/><br/><br/>This is an image!"";"

Can I use it like that?

In my dialogs.hpp i got a RscStructuredText. This one:
class RscStructuredText_1000: RscStructuredText
{
	idc = 1000;
	text = "Vehicle Information";
	x = 20.5 * GUI_GRID_W + GUI_GRID_X;
	y = 13.5 * GUI_GRID_H + GUI_GRID_Y;
	w = 6.5 * GUI_GRID_W;
	h = 3 * GUI_GRID_H;
};

After pressing a button i want to change the text to like:
Price: xx
Speed: xx
....

Can anybody please help me?


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#4 Posted at 2014-08-18 17:42        
     
First, you need a combo box for the vehicle selection, at least that's the most friendly one. Whenever the combo box changes, you need to get the selected vehicle and do something according to that.

You probably did this tutorial already, you gotta do it just like that, but with combo boxes and not buttons. You should be able to run the sqf script when the combo boxes selected item changes, just like you run a script when the buttons are clicked. You should be able to send a variable to the script, such as the selected box in the whole list; so using combo boxes, you'll be running a script every time the selection changes, with the selection that is changed. For example the user can see "ATV", "Car", and "Offroad", but the script will only see "veh_0", "veh_1" and "veh_2". Of course changing those to classnames will be the best.
Hope I was able to explain my self *THUMBS UP*

I'm saying all of this with my general coding knowledge, as someone who never used ArmA dialog making for advanced stuff, so if Bohemia did it all different (because why wouldn't they) and I'm wrong, just ignore this. But I don't think they can do combo boxes any different than rest of the whole world. Maybe some UI guru can come in and explain better.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#5 Posted at 2014-08-19 11:04        
     
Wak:
You are right about the comboboxes, and it would be better than buttons.

Mafi
A structured text is a little bit like HTML, although the way you are using it at the moment is wrong.
Maybe if you posted your entire dialog that would help?

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface