Jump to content
Sign in to follow this  
mrcurry

Dialogs and Listbox/Combobox creation

Recommended Posts

I've been looking on the Dialog Control on the Biki, trying to create a simpe working listBox or combobox...

Could anyone gimme any pointers to a couple of good tutorials?

Or possibly post a working listbox or combobox for me take a look at?

Here's the one I've managed to piece together from that Biki site (which isn't very good tbh).

class WeaponsList {

idc = WO_WEAPLIST_ID;
type = CT_COMBO;
style = 0;

x = 0.1;
y = 0.2;
w = 0.9;
h = 0.3;

font = "TahomaB";
sizeEx = 0.025;

rowHeight = 0.025;
wholeHeight = 0.025;

color[] = {0,0.5,0,1};
colorText[] = {0.6, 0.5, 0, 1};
colorBackground[] = {0,0,0,1};
colorSelect[] = {1,0,0,1};
colorSelectBackground[] = {0,1,0,1};

soundSelect[] = {"", 0.0, 1};
soundExpand[] = {"", 0.0, 1};
soundCollapse[] = {"", 0.0, 1};

autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
maxHistoryDelay = 10;
arrowEmpty = "#(argb,8,8,3)color(0.5,1,1,1)";
arrowFull = "#(argb,8,8,3)color(0.5,1,1,1)";

class ScrollBar
{
	color[] = {0.5,0.5,0.5,0};
	colorActive[] = {0.5,0.5,1,0};
	colorDisabled[] = {1,0.5,0.5,0};
	thumb = "#(argb,8,2,3)color(0.5,1,1,1)";
	arrowEmpty = "#(argb,6,4,3)color(0.5,1,1,1)";
	arrowFull = "#(argb,4,6,3)color(0.5,1,1,1)";
	border = "#(argb,2,8,3)color(0.5,1,1,1)";
};	
};

Edited by mrCurry
Typos

Share this post


Link to post
Share on other sites

Ressources (Description.ext):

//--- Ressources.
class RscPicture {
type = 0;
idc = -1;
style = 48;
colorText[] = {0.75, 0.75, 0.75, 1};
colorBackground[] = {0, 0, 0, 0};
font = "Bitstream";
sizeEx = 0.025;
soundClick[] = {"ui\ui_ok", 0.2, 1};
soundEnter[] = {"ui\ui_over", 0.2, 1};
soundEscape[] = {"ui\ui_cc", 0.2, 1};
soundPush[] = {"", 0.2, 1};
w = 0.275;
h = 0.04;
text = "";
};

class RscListBox {
idc = -1;
type = 5;
style = 0 + 0x10;
font = "Zeppelin32";
sizeEx = 0.04221;
       rowHeight = 0.03;
color[] = {1, 1, 1, 1};
colorText[] = {1, 1, 1, 0.75};
colorScrollbar[] = {0.95, 0.95, 0.95, 1};
colorSelect[] = {0.95, 0.95, 0.95, 1};
colorSelect2[] = {0.95, 0.95, 0.95, 1};
colorSelectBackground[] = {0.6, 0.8392, 0.4706, 1.0};
colorSelectBackground2[] = {0.6, 0.8392, 0.4706, 1.0};
columns[] = {0.1, 0.7, 0.1, 0.1};
period = 0;
colorBackground[] = {0, 0, 0, 1};
maxHistoryDelay = 1.0;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
soundSelect[] = {"\ca\ui\data\sound\new1", 0.09, 1};

class ScrollBar {
	color[] = {1, 1, 1, 0.6};
	colorActive[] = {1, 1, 1, 1};
	colorDisabled[] = {1, 1, 1, 0.3};
	thumb = "\ca\ui\data\igui_scrollbar_thumb_ca.paa";
	arrowFull = "\ca\ui\data\igui_arrow_top_active_ca.paa";
	arrowEmpty = "\ca\ui\data\igui_arrow_top_ca.paa";
	border = "\ca\ui\data\igui_border_scroll_ca.paa";
};
};

class RscCombo {
idc = -1;
type = 4;
style = 1;
x = 0;
y = 0;
w = 0.3;
h = 0.035;
colorSelect[] = {0.023529, 0, 0.0313725, 1};
colorText[] = {0.023529, 0, 0.0313725, 1};
colorBackground[] = {0.95, 0.95, 0.95, 1};
colorSelectBackground[] = {0.543, 0.5742, 0.4102, 1.0};
colorScrollbar[] = {0.023529, 0, 0.0313725, 1};
arrowEmpty = "\ca\ui\data\ui_arrow_combo_ca.paa";
arrowFull = "\ca\ui\data\ui_arrow_combo_active_ca.paa";
wholeHeight = 0.45;
color[] = {0, 0, 0, 0.6};
colorActive[] = {0, 0, 0, 1};
colorDisabled[] = {0, 0, 0, 0.3};
font = "Zeppelin32";
sizeEx = 0.031;
soundSelect[] = {"\ca\ui\data\sound\new1", 0.09, 1};
soundExpand[] = {"\ca\ui\data\sound\new1", 0.09, 1};
soundCollapse[] = {"\ca\ui\data\sound\new1", 0.09, 1};
maxHistoryDelay = 1.0;

class ScrollBar {
	color[] = {1, 1, 1, 0.6};
	colorActive[] = {1, 1, 1, 1};
	colorDisabled[] = {1, 1, 1, 0.3};
	thumb = "\ca\ui\data\ui_scrollbar_thumb_ca.paa";
	arrowFull = "\ca\ui\data\ui_arrow_top_active_ca.paa";
	arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa";
	border = "\ca\ui\data\ui_border_scroll_ca.paa";
};
};

//--- Dialogs.
class Sample {
movingEnable = 1;//--- The dialog window can be moved.
idd = 10001;
onLoad = "ExecVM 'test.sqf'"; //--- Script loaded upon creation.

class controlsBackground {
	class Mainback : RscPicture {
		x = 0.04;
		y = 0.01;
		w = 1.25;
		h = 1.67;
		moving = 1;
		text = "\ca\ui\data\igui_background_buy_units_ca.paa";
	};
};

class controls {
	class listboxA : RscListBox {
		idc = 10002;
		x = 0.043;
		y = 0.167676;
		w = 0.45;
		h = 0.444;
	};
	class comboA: RscCombo {
		idc = 10003;
		x = 0.65;
		w = 0.3;
		y = 0.127;
	};
};
};

Script: test.sqf (Called upon dialog creation).

{lbAdd[10002,_x]} forEach ["Listbox 1","Listbox 2","Listbox 3"]; //--- listbox IDC.
{lbAdd[10003,_x]} forEach ["Combo 1","Combo 2","Combo 3"]; //--- combo IDC

Creating the dialog (init.sqf or addAction):

createDialog "Sample"

Hope that it'll help you.

Share this post


Link to post
Share on other sites

After a quick check it looks like exactly what I need, I'll give it a closer look later on. Cheers mate!

Share this post


Link to post
Share on other sites

Sorry, I have a question:

When I use those code. I got a BIG arrow, and I don't have scroll, don't have content, why?? I'm sorry I can't send a picture...

Share this post


Link to post
Share on other sites

So When you said create a test.sqf do I put those in the test.sqf and it automatically adds it or do I add it to the dialog.hpp? 

Share this post


Link to post
Share on other sites

So When you said create a test.sqf do I put those in the test.sqf and it automatically adds it or do I add it to the dialog.hpp? 

Lol, nvm. Sryy

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  

×