Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 747 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 10 of 17 1 2 8 9 10 11 12 16 17
Re: LBGUI - RELEASE [Re: Espér] #396645
03/08/12 20:02
03/08/12 20:02
Joined: Mar 2012
Posts: 3
H
helloMoto Offline
Guest
helloMoto  Offline
Guest
H

Joined: Mar 2012
Posts: 3
Hello!
I have a problem, i'm trying to use a combobox and get the result selected.
I'm looking for a example in internet and in the forum.
Please, I need help.
Code:
void comboClick()
{
  LBG_LISTITEM* item;
  if(comboboxForeign->chosen_option!=NULL)
  {		
    printf(comboboxForeign->chosen_option->caption);
  }
   else printf("No selected");
}
...

  comboboxForeign = LBG_create_combobox(window_menu,30, 110, 256, 16, 4, "Select the language", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), 16, 16, 224, &listbox_bmaps, LBG_bbmaps(combobox_button1_tga,combobox_button2_tga,combobox_button3_tga,combobox_button1_tga,combobox_button2_tga,combobox_button1_tga), CBF_SHOW);

  LBG_create_listitem (comboboxForeign->menu, 100, strSpanish, 0);
  LBG_create_listitem (comboboxForeign->menu, 100, strEnglish, 0);
  LBG_create_listitem (comboboxForeign->menu, 100, strChinese, 0);
		
  comboboxForeign->Open=comboClick;
  comboboxForeign->Close=comboClick;
  comboboxForeign->Destroy=comboClick;


The problem is that when i close, the printf don't show the correct selected item text, only show rubish.

I looked the manual but i didn't see nothing about.

Please, help.

Thanks a lot!

Re: LBGUI - RELEASE [Re: helloMoto] #396647
03/08/12 20:10
03/08/12 20:10
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
that´s cause you just need comboboxForeign->caption

The combobox is an editobox object, so it handles the caption string of the chosen item by itself ^^


Little Question to Lukas:
Any chance to get file/object trees?


I don´t need folder support, but file/subfile/sub-subfile support would be great ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: LBGUI - RELEASE [Re: Espér] #396649
03/08/12 20:20
03/08/12 20:20
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
Originally Posted By: Espér
Little Question to Lukas:
Any chance to get file/object trees?


I don´t need folder support, but file/subfile/sub-subfile support would be great ^^


Maybe, but don't count on it. Especially not for the near future. I'm pretty certain I'm going to release an update this year, but it won't contain trees yet. Things like multiline textboxes are more important.

Re: LBGUI - RELEASE [Re: Espér] #396657
03/08/12 20:54
03/08/12 20:54
Joined: Mar 2012
Posts: 3
H
helloMoto Offline
Guest
helloMoto  Offline
Guest
H

Joined: Mar 2012
Posts: 3
Originally Posted By: Espér
that´s cause you just need comboboxForeign->caption

The combobox is an editobox object, so it handles the caption string of the chosen item by itself ^^



Thanks, Espér. But I have the same problem.
The printf show me the text: q[]

It's so wrong.

Code:
void comboClick()
{
	if(comboboxForeign->chosen_option!=NULL)
	{		
		printf(comboboxForeign->caption);
		printf((comboboxForeign->editbox->text.pstring)[0]);
		printf(comboboxForeign->editbox->caption);
		
		(pruebas_txt.pstring)[0]=comboboxForeign->caption;
   }
   else printf("No selected");
}


¿Any ideas?

If anybody knows some example of this, i will looked.

Thanks brothers!

Re: LBGUI - RELEASE [Re: helloMoto] #396658
03/08/12 20:59
03/08/12 20:59
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
when i look at the code..
Did you say the combobox to use a Select script?

i did it this way:
Code:
LBG_COMBOBOX* combobox1 = 0;
void combobox_clicked()
{
	wait(1);
	//object_category_string
	str_cpy(object_category_string, combobox1->caption);
	call_kategorie(-kategorie);
	if(edit_property_text_open == 1)
	{
		empty_texture_list();
		change_texture_list(wich_skinnumber);
	}
}


STRING* combobox_category = "";
void call_file_category()
{
	var ysize = screen_size.y-(bmap_height(bmedit_gui_top)+(bmap_height(bmedit_gui_bottom)+128));
	var xsize = bmap_width(bmedit_gui_lm)-6;
	var yposition = bmap_height(bmedit_gui_top)+128;
	combobox1 = LBG_create_combobox(0, 0, yposition, xsize, 4, 4, "1 - Vatikan", LBG_ebmaps(editbox_left_tga,editbox_middle_tga,editbox_right_tga), 4, 4, xsize-4, &listbox_bmaps, LBG_bbmaps(combobox_button1_tga,combobox_button2_tga,combobox_button3_tga,combobox_button1_tga,combobox_button2_tga,combobox_button1_tga), CBF_SHOW);
	combobox1->menu->layer      = 2010;
	combobox1->editbox->layer   = 2010;
	combobox1->button->layer    = 2010;
	combobox1->layer            = 2010;
	combobox1->menu->font       = list_font;
	combobox1->menu->itemheight = 20;
	combobox1->menu->bmaps_over.bmap_left = listitem_over_left_tga;
	combobox1->menu->bmaps_over.bmap_middle = listitem_over_middle_tga;
	combobox1->menu->bmaps_over.bmap_right = listitem_over_right_tga;
	combobox1->menu->bmaps_marked.bmap_left = listitem_marked_left_tga;
	combobox1->menu->bmaps_marked.bmap_middle = listitem_marked_middle_tga;
	combobox1->menu->bmaps_marked.bmap_right = listitem_marked_right_tga;
	
	var fhandle;
	fhandle= file_open_read("kdata.nfg");
	while(1)
	{
		file_str_read(fhandle, combobox_category);
		if(str_cmpi(combobox_category, "ENDE") == 0)
		{LBG_create_listitem(combobox1->menu, 100, combobox_category, 0);}
		else
		{break;}
		wait(1);
	}
	file_close(fhandle);
	
	vec_set(combobox1->menu->color_default,vector(1,1,1));
	vec_set(combobox1->menu->color_over,vector(255,1,1));
	vec_set(combobox1->menu->color_marked,vector(1,1,1));
	
	LBG_editbox_set_text_color(combobox1->editbox,vector(1,1,1));
	
	combobox1->menu->Select=combobox_clicked; //giving each listitem the select function
	
	LBG_update_combobox(combobox1);
}



And it´s working


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: LBGUI - RELEASE [Re: Espér] #396699
03/09/12 08:36
03/09/12 08:36
Joined: Mar 2012
Posts: 3
H
helloMoto Offline
Guest
helloMoto  Offline
Guest
H

Joined: Mar 2012
Posts: 3
Thank you for your attention!!

I'm a beginner:
Printf has a char* parameter not a *STRING parameter.
laugh

Thanks a lot!

Re: LBGUI - RELEASE [Re: Lukas] #397903
03/25/12 03:04
03/25/12 03:04

M
Malice
Unregistered
Malice
Unregistered
M




EDIT*** Nevermind I got it. These doc and examples are not newbie friendly. Maybe one day I'll be a pro like most of you.

I'm a newbie so I'm sure this will be a newbie question. I have LBG_windows that are created at runtime randomly. Their pointers are local to the function, they are suposed to be destory when the 'OK' button is click, but from what I can tell in the manual the parent windows pointer is not passed to the button event function. If only one window was on screen then I could set the window pointer to a globel pointer at time of creaation and use that in the button event function. But I have many windows open at once. How do I pass the pointer of the parent window to the button event function???

Thanks
Malice

Last edited by Malice; 03/25/12 03:36.
Re: LBGUI - RELEASE [Re: ] #400123
04/26/12 08:08
04/26/12 08:08
Joined: Apr 2005
Posts: 795
U.S.A. Michigan
exile Offline
User
exile  Offline
User

Joined: Apr 2005
Posts: 795
U.S.A. Michigan
-Please remove post


Last edited by exile; 04/27/12 10:07.
Re: LBGUI - RELEASE [Re: exile] #417355
02/11/13 21:15
02/11/13 21:15
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline
Senior Member
NeoNeper  Offline
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
First I like of the say that is really good LBGUI. TANKS Lukas.
I want to take this opportunity to ask for help to solve a problem I'm not able to solve alone!.

How could I do for my (Vertical Scrolling), of the my LISTBOX, roll yourself Whenever I add a new ITEM on the list?


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: LBGUI - RELEASE [Re: NeoNeper] #417356
02/11/13 21:27
02/11/13 21:27
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
If I understood your problem correctly, you want a listbox to automatically scroll down to a newly added item?

You can do so by setting the scrollamount of its scrollbar to its scrollmax value right after creating the item. That will make it scroll down to the very bottom.

Page 10 of 17 1 2 8 9 10 11 12 16 17

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1