LBGUI - RELEASE

Posted By: Lukas

LBGUI - RELEASE - 07/26/10 19:58



This is LBGUI, a Lite-C header for creating GUI elements, such as:

  • Buttons (better ones than you already have)
  • Windows
  • Checkboxes and Radiobuttons
  • Infoboxes that appear when you keep the mouse calm over something
  • Progress bars
  • Sliders (better ones than you already have)
  • Listboxes
  • Scrollbars for windows and listboxes
  • Rightclick menus
  • Comboboxes
  • Digits (that work like "normal" digits but use use "real" TEXTs)
  • Editboxes, which are 1024x better than inkey() wink

You will also be able to put "normal" panels and texts on a window.

It's going to be my entry for the contest.
It's going to be Open Source (as it's a Lite-C header), but I won't make it available before the deadline of the contest.

Here's the demo (~2.41MB):
http://www.brogames.de/LBGUI/LBGUI_demo_20100726.zip


Here's the header:
http://www.brogames.de/LBGUI/LBGUI.zip
http://www.opserver.de/coni_users/web_users/pirvu/au/demo/zips/lbgui.zip
Posted By: Rei_Ayanami

Re: LBGUI - Demo - 07/26/10 20:05

Wow, really really nice laugh
Posted By: MasterQ32

Re: LBGUI - Demo - 07/26/10 20:16

you beat me!
nice stuff!
i like it
Posted By: Superku

Re: LBGUI - Demo - 07/26/10 20:20

I've just played with it for some minutes and I'm impressed, this is really useful and well done. The only thing you could improve is to add a text selection (in edit boxes) with copy&paste (ctrl+c/v or rightclick).
Posted By: Lukas

Re: LBGUI - Demo - 07/26/10 20:29

Thanks guys! laugh

@Superku: I initially planned to make the text of the editboxes selectable, and implement copy/paste, but I realized that I wouldn't be able to get that working before the deadline, so it's not implemented in the contest release, but maybe later. I also tried just implementing the paste thing, but those WINAPI functions are too complicated to understand and implement them in time.

Posted By: Widi

Re: LBGUI - Demo - 07/26/10 20:29

Just one: great, good work!
Posted By: WretchedSid

Re: LBGUI - Demo - 07/26/10 20:55

Just a question (haven't looked into the sourcecode), are your controls delegate based?
Posted By: SchokoKeks

Re: LBGUI - Demo - 07/26/10 21:00

WOW!
This is soooo useful. Too late to insert into my project unfortunately.

It would be the perfect solution for menus if you could completely skin it, including freely changing the size of the elements (borders, bars, etc). If that will be possible (maybe it already is), you've got my vote wink
Posted By: Lukas

Re: LBGUI - Demo - 07/26/10 21:16

@JustSid: I don't know exactly what "delegate based" you means, but the system works like this:
You can create objects, which are stored in structs (the nearest to classes you can get in Lite-C...) with their specific create" function, and you can access their members like engine objects. The objects are "managed" in one loop that calls the respective "manage" function for each object (that's faster than using Caroutines, and I have more control about in which order they are managed).
You can assign them events (like button events) for different things, like when they are destroyed, when windows are maximized, etc. In these functions you can also e.g. prevent a window from being maximized/closed etc.
If "delegate based" means that you write your own function to access the messages of Windows windows and interfere with them, I guess the events can satisfy you. If not, you can change it like you want, because it's open source. wink

@SchokoKeks: Yes, you can use you own bitmaps and change the sizes of all elements (even at runtime). The bitmaps that you finally see in the demo are made out of smaller ones and built up on runtime (have a look at the "files" folder wink ).
Posted By: mk_1

Re: LBGUI - Demo - 07/26/10 21:23

What's missing is multiple selection in list boxes (using ctrl and shift)

Otherwise this is pretty damn good stuff. Customizable theme?
Posted By: Lukas

Re: LBGUI - Demo - 07/26/10 21:25

"What's missing is multiple selection in list boxes (using ctrl and shift)"
- Putting it on the ToDo list.

"Customizable theme?"
Yes, you can even use an other "theme" for each instance of an object.
Posted By: WretchedSid

Re: LBGUI - Demo - 07/26/10 21:25

Quote:
You can assign them events (like button events) for different things, like when they are destroyed, when windows are maximized, etc. In these functions you can also e.g. prevent a window from being maximized/closed etc.

That's what I meant with delegate based.

Does this also count for data setup? Eg you have a function that returns an array of Strings that should be used for this table view and say the tableview: Use this function as data source?
Posted By: Lukas

Re: LBGUI - Demo - 07/26/10 21:30

"Does this also count for data setup? Eg you have a function that returns an array of Strings that should be used for this table view and say the tableview: Use this function as data source?"
No. If by "tableview" you mean something like a listbox, the items in the list are also structs stored in linked lists.
EDIT: But you can of course write your own function that puts an array of strings into that linked list.

But you can do stuff like I showed with the editbox that only accepts odd ASCII codes. You can even access the input string so you can make it always write capital letters, although you typed in lower-case letters. And there is the button Condition function.
Posted By: JibbSmart

Re: LBGUI - Demo - 07/27/10 03:45

Just fantastic. I can see this being extremely useful, for games as well as for making tools in the future laugh

Well done.

Jibb
Posted By: bart_the_13th

Re: LBGUI - Demo - 07/27/10 03:56

Very nice, like Julz said, this can be Game making Tool making Tool grin
Waiting for the final release wink
Posted By: Rasch

Re: LBGUI - Demo - 07/27/10 06:36

Its just great.

Some thinks you could add:

- Marking the text (with mosue hold or shift and cursors)
- Multiple Selection
- Jumping trought the different fields with TAB

Anyway its perfect. Thanks laugh
Posted By: Helghast

Re: LBGUI - Demo - 07/27/10 08:01

Wow... this couldn't have come in on a better time for me grin!
I hope you release the header file soon so I can start making stuff with it.

regards,
Posted By: Lukas

Re: LBGUI - Demo - 07/27/10 12:53

@Rasch: Making the text markable and multiple selection has already been asked for in this thread. The latter one has a good chance to be implemented in the contest release.
About the tab thing: This would only make sense if all elements would somehow react on the mouse, but that's currently only the case for buttons and editboxes (of course). This would also require a system that makes one window "the" active window, which currently isn't the case.
Personally, I only use tab to switch between different editboxes while filling out a form (like name and password). I could make a "tab event" or "key event" for editboxes so you can do that by yourself.


@Helghast: It's going to be released soon when the contest begins. I guess in one week you can download it. wink

Posted By: Slin

Re: LBGUI - Demo - 07/27/10 13:41

Wenn jetzt noch der Code schöner ist als bei 3D Tetris 1, kann es ziemlich super sein wink.

Edit: Sorry for the language... I noticed too late that this thread was english tongue
Posted By: Lukas

Re: LBGUI - Demo - 07/27/10 14:12

grin 3D-Tetris 1 war von 2007... und 2007 hab ich mit GS angefangen. wink
Und wie kann irgendein Code nicht schöner sein als der von damals? grin
Posted By: HeelX

Re: LBGUI - Demo - 07/27/10 15:54

When I go into fullscreen I don't see the mouse... can you please add this and proof that you can work with it in fullscreen mode?

Otherwise: great work!!!
Posted By: BoH_Havoc

Re: LBGUI - Demo - 07/27/10 16:18

Great work!
This comes just in time laugh

Can't wait to get the source in my hands.
Posted By: Lukas

Re: LBGUI - Demo - 07/27/10 16:33

@HeelX: That requires creating bitmap mouse cursors. I will create them and add them to the demo at the latest in the contest release.
But be assured that it works with bmap cursors in fullscreen, too. The cursor changing is independent from the actual mouse cursor. There is a variable called LBG_mouse_cursor which tells you which cursor the GUI "suggests" you to use. It's up to the user to change the cursor according to that information.
Posted By: Lukas

LBGUI - Prerelease... kindof - 07/29/10 19:15

I have uploaded a "Prerelease" of LBGUI, which does not yet include the header, but the source code of the last demo, an other, smaller demo including commented source code, which also shows that multiple selection is now possible, and that bitmap cursors work (although you need a little workaround for the hotspot), and the manual of LBGUI.

http://www.brogames.de/LBGUI/LBGUI_pre.zip
Posted By: ratchet

Re: LBGUI - Prerelease... kindof - 07/29/10 23:36

Should be integrated to A8 as standard !!!!!!!!

Great work laugh
Posted By: bodden

Re: LBGUI - Prerelease... kindof - 07/30/10 09:49

Great work!
Posted By: jenGs

Re: LBGUI - Prerelease... kindof - 07/30/10 11:29

This is really great. The only thing that's missing now is a GUI-Editor laugh And a "good" code editor. Because I hate to write BMAP definitions. And Code auto completion would be very usefull for a project like this (But thats JCL's problem not yours).

Am I right, that you created the buttons/controls with the winapi, made them somehow "invisible" and created a graphics representation of each state in the engine?
I tried this a year ago and failed with the message handling of the winapi.

Again, great work.

MfG,
Ich
Posted By: Lukas

Re: LBGUI - Prerelease... kindof - 07/30/10 11:48

First, thanks to all who posted after I said thanks the last time. grin

"Am I right, that you created the buttons/controls with the winapi, made them somehow "invisible" and created a graphics representation of each state in the engine?"
You are wrong. wink
I programmed the buttons and all other controls completely myself. They act like Windows buttons, because I examined the behaviour of the Windows buttons and made my buttons do the same.


Maybe I'll make a GUI editor some time, but not in the near future...
Posted By: Lukas

LBGUI - RELEASE! - 08/01/10 12:08

Now the deadline is over as it's the 1st of August even in GMT-12. So there is no reason to hide the source code anymore.

Here you go:
http://www.brogames.de/LBGUI/LBGUI.zip
(~687KB)

This is the contest release. It's much smaller than the first two downloads as this doesn't include an exe anymore. I put the other downloads down, as especially in the first demo I gave you there were some small bugs, which are now fixed.

Credits would be nice.
Posted By: Macro

Re: LBGUI - RELEASE! - 08/12/10 18:15

Likas,

This looks like a contribution of epic proportions. GUIs have always been doable in 3DGS but they have come with an amount of pain. I am looking forward to playing with this and seeing what it can do!!

Thanks

MACRO
Posted By: TerraSame

Re: LBGUI - RELEASE! - 08/12/10 21:58

Very nice Lukas...
I see you have info about LBGUI on your web site...
I look forward to seeing more of your web site completed.
You obviously have control of C-Lite as your GBUI project shows.
Thanks for sharing and best of luck with the contest...
Posted By: nfs42

Re: LBGUI - RELEASE! - 09/27/10 22:24

Hi,
based on this cool lbgui i've started GSTGUI with only one skinfile instead of 120 files to show the usage of SpriteSheetPacker2LiteC.
Look here
Posted By: Lukas

Re: LBGUI - RELEASE! - 09/30/10 19:11

So you made a tool to puts all skins into one file and added some functions to LBGUI?
Nice.

But you lost the alpha channel of the window borders.

And you just took my demo and changed it, leaving many things like they were, making the texts confusing, lol. grin

And why does a MessageBox need to be resizable?

Btw, your demo freezes when I try to close it.
Posted By: jenGs

Re: LBGUI - RELEASE! - 10/07/10 20:03

Hi Lukas,
Your Gui System is great. At the moment I am creating a small addition to your header with procedural rendered graphics, because I hate to copy/create Bitmaps every time I need a gui in a small test project.
Until now it is only a plain Win98 style, because that's enough for prototypes and small tools.

My problem is:
My window borders are very small bitmaps (6 x 16 pix).
I have seen that you have used bmap_blitt to resize your windows.
The problem is, that my small graphics get "washed out" through the blitting/resizing. I hope you understand my problem laugh
My graphics are exact fitting on eachothers edges, but blurred horizontaly. I don't completly understand the algorithm of the bmap_blitt function. I checked your function and saw that you use the original hight of the middle Titlebar. But it is blurred out as if it would have been scaled in y direction.

My suggestion:
What do you think? Is it usefull to rewrite the scaling function and use the panel element "window". Of course you need a long bitmap with the length of the maximum resolution, but it would be an enorm gain of speed when it comes to resizing.
Posted By: Lukas

Re: LBGUI - RELEASE! - 10/07/10 20:33

Yeah, I know bmap_blit doesn't work like I would want it. If you look carefully at the (in the examples) black area of a window, you see some kind of lines, which are also artefacts of the bmap_blit scaling.

Your idea with the windows might work, but this would require creating a bitmap that is big enough so it's always bigger than the window. As it would seem senseless to create such big bitmaps in files, I guess it would make sense to create them procedurally with many bmap_blit commands. But I think this would be much slower than one bmap_blit command, although it normally could be faster if bmap_blit had an option for "nearest neighbour" interpolation. That's why I would hate using workarounds like this. I would prefer an option to scale bitmaps fast without getting them blurred.
Also, this would destroy the possibility to have a border bitmap with a width of more than 1 pixel, which is then scaled.

But if you think it would be useful for your project, you could rewrite this part of LBGUI yourself. I currently don't have the time for an update like this anyway.

If your window doesn't need to be resized, you could also create a bitmap for the whole window and then assign window->panel->bmap to that bmap each time your window is updated.
Posted By: jenGs

Re: LBGUI - RELEASE! - 10/08/10 02:14

So, I tried it and it worked well.
the "window" element of the PANEL struct has a nice habbit.
If you use a bitmap that has the power of 2 it will be repeatet, when you exceed the borders of the given bitmap in dx or dy.
With this method you can use very small bitmaps, without interpolated pixels.
I removed every blitting operation in your header (concering the Windows) and I removed the bmap_createblack command ind the window_update function.
The update function only sets the window elements positions new and scales the borders and the content.

The speed gain is huge.
When I cleaned up the code tomorrow (or weekend) I will upload it.

I don't now If I am boring you with this posts laugh I hope not.
Posted By: Lukas

Re: LBGUI - RELEASE! - 10/08/10 10:46

Nice, I didn't know about this behaviour of window elements. In this case, window elements are a nice and much more efficient solution for resizable windows. laugh

When I finally get the time to make an update for LBGUI, I'll propably include your solution and add a flag for this, so you could still use the old method for backwards compatibility. I was going to make an update for LBGUI anyway, as I'm currently adding some small features for one of my projects, and I need to do some bugfixes. But as I said, I currently don't have the time...

I'm looking forward to trying your code. laugh

"I don't now If I am boring you with this posts laugh I hope not."
Yaaaawn... what? grin
No, seriously, you are not boring me, always like to see better solutions for my problems. laugh
Posted By: jenGs

Re: LBGUI - RELEASE! - 10/09/10 22:46

Hi,
Here is my Project.
I had not the time to clean the code. It is a bit unclean here and there.
To test my modifications you have to run the "render.c".
I used your split scripts, because SED realy sucks when you open big files.
Until now I only modified "lbgui_windowfunc.h":
I copied "LBG_window_border_bitmap" function to(LBG_window_border_bitmap_n)
and
"LBG_window_content_bitmap" function to(LBG_window_content_bitmap_n)
you will see.
The panels (content and panel) still have the bitmaps attached. With the window elements, you could delete them completly, of yourse with backward compatibility in mind you should not.

Link: Project

I have a small problem with your gui system.
- My mouse Mode is 4
- I am in fullscreen mode
- A mouse_map is attached
Problem: The mouse flickers when I am on top of the titlebar

MfG,
Me
Posted By: Lukas

Re: LBGUI - RELEASE! - 10/10/10 13:47

Nice, the window is resized without any lag. laugh
But the Windows 98 style isn't quite nice for a game or even a tool. wink

I haven't looked much in the code other than the changes in LBGUI, but I don't think LBGUI is responsible for the mouse flickering because it doesn't change the mouse directly. So it must be something in your own code.
Posted By: jenGs

Re: LBGUI - RELEASE! - 10/10/10 20:14

I know laugh Win98 is not very nice. And it is a bit too small for big HD resolution.
I am working on a tool to create your own procedural rendered graphics (with alpha channel). It is like a paint programm with the typical brushes. The generated code will be loaded and parsed by my lite-c header. So you start the generator with the filename as parameter and then LBGUI.

At the moment I am trying to find the flickering problem.
It only appears consequent, when a window is maximized.
Posted By: Lukas

Re: LBGUI - RELEASE! - 10/11/10 11:01

Hmm that's a nice idea.
But procedural graphics propably won't be good enough for games, but maybe for tools. wink
Posted By: Joozey

Re: LBGUI - RELEASE! - 11/05/10 19:20

str_printf is A8 feature? would be nice if you made it compatible to A7... at least my engine can't find str_printf... I look forward using this laugh.
Posted By: Lukas

Re: LBGUI - RELEASE! - 11/06/10 17:15

The str_printf function has been added in V7.81.3b. Just update to 7.86(+patch) and it should work.
LBGUI is fully compatible to A7 (and has been made with A7 wink ).


http://manual.3dgamestudio.net/beta.htm
Posted By: rojart

Re: LBGUI - RELEASE! - 11/06/10 19:02

Thanks for the very useful lbgui.h header file.
I'm very busy to study your code now, but I noticed that in the ListBox is not possible to select via the CTRL key + LMB (left mouse button) more than one Item, like Item 1 + Item 2 ...
Posted By: Joozey

Re: LBGUI - RELEASE! - 11/07/10 15:05

Very cool, it works all now laugh. Thanks!
Posted By: Lukas

Re: LBGUI - RELEASE! - 11/07/10 15:32

@rojart: It is possible, just set the LF_MULTIPLE flag. wink
Posted By: lostclimate

Re: LBGUI - RELEASE! - 11/07/10 20:51

I'll be implementing this in a clients project today. exactly what we need grin
Posted By: rojart

Re: LBGUI - RELEASE! - 11/07/10 22:14

Originally Posted By: Lukas
@rojart: It is possible, just set the LF_MULTIPLE flag. wink

Thanks, I check this in Manual of 3dgs, instead in your Manual of LBGUI.
Posted By: lostclimate

Re: LBGUI - RELEASE! - 11/25/10 09:45

hmmmm for some reason I cant read the caption from the editbox's. I tried the
editPointer.caption

and

editPoint->caption

and


_str() surrounding both of them but neither will work.
Posted By: lostclimate

Re: LBGUI - RELEASE! - 11/25/10 10:18

its weird, i can get it to work properly within the scope of the same function, but lets say I try to read it in a function called by a button, it comes back as an empty pointer.


EDIT:wtf! sooooo much work, only to realize it was an error because I was destoying the parent just before I tried to access it... problem solved.
Posted By: Aku_Aku

Re: LBGUI - RELEASE - 01/21/11 14:19

Great job!
I would like to know, do you plan to implement treeviews?
Posted By: Lukas

Re: LBGUI - RELEASE - 01/22/11 19:30

I might do that some time, but I'm can't say that for sure now.

But I will most propably make an update some time, which will include editboxes with multiple lines, maybe window menus (like File, Edit,...), and some bugfixes. But I can't promise that it will include treeviews.
Posted By: 3run

Re: LBGUI - RELEASE - 01/22/11 19:56

Thank you Lukas. We appreciate it.
Posted By: Quad

Re: LBGUI - RELEASE - 01/22/11 19:58

was working on a new theme for lbgui, but then accidentaly saved wrong files over them. Going to remake them though.
Posted By: Lukas

Re: LBGUI - RELEASE - 01/23/11 15:39

Sounds interesting. If it looks good, I might include it to the update, together with the old theme, to show how easily you can mix two themes. laugh
Posted By: SchokoKeks

Re: LBGUI - RELEASE - 01/29/11 09:32

Because there was some criticism of LBGUI in the german podcast (thanks to my game), I want to speak out here to stress that LBGUI was extremly helpful for me and saved me a lot of work.

I really didn't find to hard to learn it. The long functions and many parameters are the price you pay for its functionality. The manual gives you all the information you need. I have to admit that I was afraid to use it when it first came out because even the small example file was so huge. Working through and understanding the small example took ~30 minutes, after that I knew everything I needed.

My advice: Split the small example into two files: on "skin.c" file where all the bitmap and struct definitions are. make sure you create LBG_*_BMAPS for all the components, so you don't have to create temporary structs in the function calls, bloating them up. Then you have one small file left where the function calls are in and everyone can see how easy it really is.

Just note somewhere that temporary LBG_*_BMAPS structs exist and that you don't need to have a single skin but can mix then as you like.

And JustSid is partly right with the flag names. why not share some? on the other hand, its easy to derive the name of the flag for each component.
Posted By: Dark_samurai

Re: LBGUI - RELEASE - 01/29/11 12:23

What you could also implement is an easy interface. I saw this in other c-libraries. If you don't need the full functionality of the library you can use the easy interface: It has functions with less parameters and functionality but are shorter and easier to use.

I saw such an easy interface wrapper in the lite-c contributions, but it could also be implemented by default.
Posted By: Rondidon

Re: LBGUI - RELEASE - 01/29/11 12:43

The perfect LBGUI would have 2 modes. One is the pure API. And the other one is a flexible GUI editor. Would love to click together my menus, export the code and graphics and afterwards just include them in the project.

Sure, that`s a lot of work. Maybe you could work together with the other guys from AckStudio wink
Posted By: Clemens

Re: LBGUI - RELEASE - 01/29/11 13:43

I really like the LBGUI - even if I didn't worked a lot with it YET and it get some critics... Implement some of the suggestions like making it more structural/user friendly and implement the most important features like multiline text field, text selection and copy/past - would be awesome wink

Thanks anyway for that good stuff!
(who knows when ever conitec would have released their GUI DLL -> but I remember it had a "high priority" until it was removed - guessing cause of Lukas' GUI cool)
Posted By: Lukas

Re: LBGUI - RELEASE - 01/29/11 16:49

Thanks for the kind words. laugh

The skin.c is a good idea. I can make it be usable as a header script that is included at the beginning of the main script for all who want to use the default skin.

Before I'd make an editor, I think it would be useful to make an XML-like syntax for defining GUI elements. Then I could make an editor that creates those XML files. Those files would then be easier to be reopened by the editor.
But if I can ever do that it will be in the far future...

An improved API and multiline text fields will certainly be part of an update some time.
Posted By: Dark_samurai

Re: LBGUI - RELEASE - 01/29/11 17:03

Sounds great laugh
Posted By: Quad

Re: LBGUI - RELEASE - 01/29/11 17:20

i have a undocumented XML plugin ready, i can document it fast if you need it.

read/write,iterate walkthrough etc all available, tinyxml wrapper.
Posted By: Lukas

Re: LBGUI - RELEASE - 01/29/11 17:53

Well, the XML thing is, if anything planned for the far future. A finished XML parser sounds good. I initially thought I'd write the XML parser myself, but if yours works good I might just use it. On the other hand, I'm not sure if I want LBGUI to be dependant to a DLL...
So not matter what, you don't need to do it fast.^^
Posted By: Quad

Re: LBGUI - RELEASE - 01/29/11 18:27

hmm... i got some ideas, but do not want to tell them before i am sure about them.
Posted By: FBL

Re: LBGUI - RELEASE - 01/29/11 18:31

I have some simple XML parser script for Lite-C somehwere on this forum.

You can use it if you want, but it's neither well documented, nor very good in handling damaged xml files.
Posted By: Clemens

Re: LBGUI - RELEASE - 01/29/11 18:47

yeah, try to keep it independent to a DLL
Posted By: Dark_samurai

Re: LBGUI - RELEASE - 01/29/11 18:58

Maybe jcl implements a .c library for xml reading/writing if we ask him. Sounds like a useful feature to me (saving configs, savegame, ...).
Posted By: FBL

Re: LBGUI - RELEASE - 01/29/11 19:06

Found the files:

http://www.opserver.de/ubb7/ubbthreads.p...true#Post343254

somewhere in there
Posted By: Lukas

Re: LBGUI - RELEASE - 01/29/11 21:31

Thanks, I copied your files to my harddisk. They are propably going to be the best solution as they are native Lite-C code.

But don't expect anything in the near future. I don't even have time to begin working on this atm.
Posted By: Clemens

Re: LBGUI - RELEASE - 08/24/11 11:38

Originally Posted By: Lukas

An improved API and multiline text fields will certainly be part of an update some time.


Dear Lukas,
is there any (multiline!!;)) soon update we can look forward to?
Best regards, clemens
Posted By: Lukas

Re: LBGUI - RELEASE - 08/24/11 13:29

Yes, I already started working on an LBGUI update some time ago and the multiline textbox has the highest priority. But my time is very limited atm.

It will also include some API optimisations that weren't suggested here, but in some podcast...
However, current scripts using LBGUI won't have to be changed.

For the editor and the XML parser, this future isn't far enough.
Posted By: Clemens

Re: LBGUI - RELEASE - 08/25/11 09:41

Great! I'll have to develope a multimedia application for which I necessary need multiline textboxes. The deadline is quite soon, in about 1-6 weeks (depending on the version, the final one in about six weeks).
Is it realistic to get that feature within this space of time?

Your answer is essential if I'll be able to create it with 3dGS (which I truly prefer).
Is there further more any chance to motivate you to set up the priority for finishing this specific feature? maybe with some euros... (I'm a "poor student" so it won't be really much - more a symbol instead of a real payment).
Posted By: Lukas

Re: LBGUI - RELEASE - 08/25/11 12:08

I'm very unsure about when I can release the update, it may or may not be finished within 6 weeks, so it would be safer if you'd plan your projects without it. Sorry.

Money always motivates me. grin
But the multiline textbox already has the highest priority. wink

However, if things like scrollbars or a proper documentation are not crucial for you, I could maybe give you a crippled version earlier. You could PM me about this.
Posted By: Clemens

Re: LBGUI - RELEASE - 08/26/11 18:45

Sounds great! You've got post
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 01/29/12 22:54

I am having a little problem with an option from the manuall:
I have a working gui with this, and movable windows, but you can lose them if dragged outside the engine window.
Quote:
The GUI itself also has flags, which are stored in the global long LBG_flags. The following flags are available:
LBGUI_RUNNING - The GUI is running (it has been opened).
LBGUI_DISABLED - Disables the whole GUI.
LBGUI_PROTECTMOUSE - If the mouse is outside the engine window, the GUI considers the mouse as at the border of the window. This prevents windows to be moved outside the window, where they would be lost.
LBGUI_STOPACTION - Stops an action that is normally executed after certain events. This flag is enabled by LBG_stop_action.
I am not sure how to do this, I tried setting the flag several ways but couldn't get it to work:
Code:
LBGUI_PROTECTMOUSE=1;
set(LBG_flags,LBGUI_PROTECTMOUSE);

Any advice would be great to set this flag.

P.S: How is that multiline textbox update going? Is it still being worked on?
Posted By: Espér

Re: LBGUI - RELEASE - 01/30/12 04:44

not sue what you've done there.. but is must be:
Code:
set(windowname, LBGUI_PROTECTMOUSE);

or

windowname->flags |= LBGUI_PROTECTMOUSE;


Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 01/30/12 13:28

I finally got it to work like this:
Code:
LBG_flags |= LBGUI_PROTECTMOUSE;


Could someone explain to me why that line works and this one dosn't?:
Code:
set(LBG_flags,LBGUI_PROTECTMOUSE);


I think I am not getting something about how LBGUI_PROTECTMOUSE and set() works.
Posted By: Uhrwerk

Re: LBGUI - RELEASE - 01/30/12 13:36

You second code snippet is a macro, so that your code gets replaced to:
Code:
LBG_flags->flags |= (LBGUI_PROTECTMOUSE);


which is of course rubbish. Only use the "set" macro for entities.
Posted By: Lukas

Re: LBGUI - RELEASE - 01/30/12 16:38

Originally Posted By: Carlos3DGS
P.S: How is that multiline textbox update going? Is it still being worked on?


There is an alpha where is works pretty good so far, but I can't guarantee a release very soon, because I have not much time because of school, especially as my Abitur will come this year. I guess I will be able to release it this year, but if the deadline of your project is less than let's say 6 months in the future, don't count on it to be released on time.
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 02/01/12 18:27

Thanks for the info Uhrwerk.

@Lukas: Don't worry, I'm in no hurry for that feature. By the way, what is an Abitur?

And another question:
How do I detect if the cursor is over any LBGUI object?
I found LBG_mouse_over_object(LBG_WINDOW* obj) in the manual, but that only checks a window I send as parameter.
Is there any way to know if it is on any object?
(What I am trying to do is stop other "click-related" things that happen in my game when the cursor is over any LBGUI object.)
Posted By: Lukas

Re: LBGUI - RELEASE - 02/01/12 18:58

An Abitur is the final exams of the "Gymnasium", the highest branch of the three-branch school system in Germany.
http://en.wikipedia.org/wiki/Abitur


I'm pretty sure LBG_mouse_over_object works for all LBGUI objects, not just windows, because internal LBGUI functions also use that function for the same purpose.

But to make sure the mouse is really over that object and no other window is covering it, you should do it like this:


Code:
if(LBG_mouse_over_object(obj) && (obj->parent == LBG_mouse_window()) && LBG_window_mouse_over_content (obj->parent))
{...}



If it's a button with a Condition function, you should also include this: LBG_button_condition(but,but->Condition)
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 02/01/12 20:36

I'm not sure if I am not understanding you correclty or mabe I explained myself wrong before.

Let's say I have a lot of UI components (created with LBGUI) on the screen. And I also have a separate function that creates an entity in the 3d view when I left click.
What I want is for the entity not to be created when the click is on any of all the LBGUI objects. So if I am clicking on interface elements the 3d objects are not created, but if I click on the view (where there is no GUI element) then the object is created as it normally would.

What I'm looking for is some global variable that I can check if the mouse has a an LBGUI element under it or not.
something like the 3DGS mouse_panel, to do something like this:

Code:
if((mouse_left)&&(!mouse_panel))
{
   //create entity in 3d view
}



I have tried to search for a similar global variable in your manual for LBGUI but I can't seem to find an equivalent to mouse_panel.

In your previous example something did draw my attention:
"LBG_window_mouse_over_content"
But I searched for it in the manual and couln't find it, so I'm not quite sure how it works or what it does exactly. It might do what I am trying to achieve?

P.S: If I understood you correctly an Abitur would be something like "Selectividad" here. The last and toughest exam (series of exams) before entering university, that conditions what careers you can study and what universities you can go to? I wish you the best of luck on your Abitur!
Posted By: Lukas

Re: LBGUI - RELEASE - 02/01/12 20:55

Hmm, the only thing that comes close to such a global variable is LBG_mouse_window() which returns the window the mouse is currently over. If the mouse is over no window, it returns 0. Of course, this will only be helpful if the view you are talking about is not on a view.

If your view is on a window, I guess the solution would be going through all LBGUI objects using their linked lists, as described on the intro page of the LBGUI manual. Or, if most of your LBGUI objects are on windows you could cover those with LBG_mouse_window() and the rest manually.


Quote:
P.S: If I understood you correctly an Abitur would be something like "Selectividad" here. The last and toughest exam (series of exams) before entering university, that conditions what careers you can study and what universities you can go to?

I never heard of the Selectivdad, but what you description of it almost fits the Abitur, too. But if you pass the Abitur you can chose to study anything you like (if the university takes you), unless it's a "Fachabitur" which is more specialized.

Quote:
I wish you the best of luck on your Abitur!
Thanks! laugh
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 02/01/12 21:27

Thankyou very much, that looks exactly like what I needed!
And it's in the manual too, but when I first saw that function I discarded it because I thought it wouldn't work if it was over a button or some other elemnent of a window.

But I just did a test and it works perfectly no matter what element of the windows it is over. here is an example for anyone else that might run into this problem in the future:
Code:
if((mouse_left)&&(LBG_mouse_window()==0))
{
   //shoot,create,select,etc... whatever you want
}


Posted By: 3run

Re: LBGUI - RELEASE - 02/01/12 23:32

Sorry if anyone already asked this, is there anyway to change edit box size?
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 02/02/12 01:27

editbox_pointer.size_x=number1;
editbox_pointer.size_y=number2;
Posted By: 3run

Re: LBGUI - RELEASE - 02/02/12 09:04

couldn't get visual part to work properly, it still as it was before but text position is changed.
Posted By: Carlos3DGS

Re: LBGUI - RELEASE - 02/02/12 14:07

after changing the size_x and size_y try running this:
LBG_update_editbox(editbox_pointer);
Posted By: 3run

Re: LBGUI - RELEASE - 02/02/12 23:21

Ok, that what i forgot about, but still i can't change it's height, but can change it's width properly now.
Posted By: Espér

Re: LBGUI - RELEASE - 02/03/12 05:19

the height changes by itself when you scale up the bitmaps for the editbox (don't forget to change font size).
Posted By: helloMoto

Re: LBGUI - RELEASE - 03/08/12 20:02

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!
Posted By: Espér

Re: LBGUI - RELEASE - 03/08/12 20:10

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 ^^
Posted By: Lukas

Re: LBGUI - RELEASE - 03/08/12 20:20

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.
Posted By: helloMoto

Re: LBGUI - RELEASE - 03/08/12 20:54

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!
Posted By: Espér

Re: LBGUI - RELEASE - 03/08/12 20:59

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
Posted By: helloMoto

Re: LBGUI - RELEASE - 03/09/12 08:36

Thank you for your attention!!

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

Thanks a lot!
Posted By: Anonymous

Re: LBGUI - RELEASE - 03/25/12 03:04


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
Posted By: exile

Re: LBGUI - RELEASE - 04/26/12 08:08

-Please remove post

Posted By: NeoNeper

Re: LBGUI - RELEASE - 02/11/13 21:15

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?
Posted By: Lukas

Re: LBGUI - RELEASE - 02/11/13 21:27

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.
Posted By: NeoNeper

Re: LBGUI - RELEASE - 02/11/13 22:59

Oh Yea. Its Work Lukas. Tanks (^.^)
Posted By: Bone

Re: LBGUI - RELEASE - 02/18/13 08:19

Hi,

I want to use LBGUI for my project but I have a problem.
I want to hide a window and show it later again so I tried to remove
the WF_SHOW Flag but nothing happen, also with LBG_update_window.
After that, I thought I have to recreate the Window because its destroyed with
a click on the close button but it seems that its still there but invisible.
How do I do it correctly?

My second problem is, that the listbox/listitems of a combobox doesnt react on mouse click where the combobox listbox overlays an other listbox.
I tried to set the layer of the combobox and the combobox menu to a high value but it doesnt work. The menu listbox is visible but how i explained, it
doesnt react on the mouse where it overlays an other listbox.
How can I solve this?

Thanks
Posted By: lostzac

Re: LBGUI - RELEASE - 02/18/13 11:48

to destroy a window look at LBG_WINDOW* LBG_destroy_window (LBG_WINDOW* win) in the manual....
Posted By: Lukas

Re: LBGUI - RELEASE - 02/18/13 12:59

Hi Bones,

it's a known bug that windows don't react on changing their WF_SHOW flag. As a workaround, you have to make its panels and children manually invisible. This will be fixed in the update I hope to release this year.

Windows SHOULD be destroyed when you click on their x button. A reason it doesn't may be because you call LBG_stop_action in its Close function, if you assigned one, but that shouldn't make it invisible...
Or maybe you checked its WF_DONTDESTROYCHILDS flag, so only its children are still there. I don't know how it "seems to be still there" exactly, so I can't guess further than that.

I could not reproduce the combobox/listbox issue. It works fine for me. Maybe the problem is in your code?
Posted By: Bone

Re: LBGUI - RELEASE - 02/18/13 13:28

Thanks Lukas,

this is my function I use to create the combobox and listbox in a window

Code:
window_linemanager = LBG_create_window(0, 96, 64, 512, 400, 12, 1,"Linienmanager",&win_bbmaps,&win_cbmaps,&win_tbmaps,1, 0,  WF_SHOW | WF_XBUTTON | WF_MAXBUTTON | WF_RESIZABLE );
	window_linemanager->xbutton_offx = -25; 
	window_linemanager->xbutton_offy = 1;
	window_linemanager->minsize_x = 64; 
	window_linemanager->minsize_y = 64;
	window_linemanager->tpos_y = 8;
	
	// Combobox für Linienfilter
	LBG_COMBOBOX* combobox_linefilter = LBG_create_combobox(window_linemanager, 10, 40, 240,16, 4, "Alle", 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);

	// Comboboxes have a member listbox called menu. To add options to the combobox, we just have to add items to its menu:
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Alle", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Zug", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Straßenbahn", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Transrapid", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Monorail", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Bus und Lkw", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Schiff", 0);
	LBG_create_listitem (combobox_linefilter ->menu, 100, "Flugzeug", 0);
	// Linien Liste
	
	// Create a listbox
	list_lines = LBG_create_listbox (window_linemanager, 10, 70, 240, 256, 16, 16, 220, 230, &listbox_bmaps, LF_SHOW | LF_AUTOVSCROLL);
	list_lines->tpos_x = 4; // This sets the text position of the items of this list relative to their positions
	list_lines->tpos_y = 1;
	list_lines->itemheight = 20; // This sets the height of the list items and thus the distance of two items. On default, the height is LBG_listitem_font.dy
	
	list_lines->bmaps_over.bmap_left = listitem_over_left_tga; // This determines the bitmap of the list items, when the mouse is over them.
	list_lines->bmaps_over.bmap_middle = listitem_over_middle_tga;
	list_lines->bmaps_over.bmap_right = listitem_over_right_tga;
	list_lines->bmaps_marked.bmap_left = listitem_over_left_tga; // This determines the bitmap of the list items, when they are selected.
	list_lines->bmaps_marked.bmap_middle = listitem_over_middle_tga;
	list_lines->bmaps_marked.bmap_right = listitem_over_right_tga;
	
	LBG_create_vscrollbar(list_lines, LBG_vsbmaps (vscrollbar_top_tga,vscrollbar_middle_tga,vscrollbar_bottom_tga,vscrollbar_bar_tga), LBG_bbmaps(vscrollbar_up1_tga,vscrollbar_up2_tga,vscrollbar_up3_tga,vscrollbar_up1_tga,vscrollbar_up2_tga,vscrollbar_up1_tga), LBG_bbmaps(vscrollbar_down1_tga,vscrollbar_down2_tga,vscrollbar_down3_tga,vscrollbar_down1_tga,vscrollbar_down2_tga,vscrollbar_down1_tga), VSF_SHOW);
	
	LBG_update_listbox(list_lines);



Its only possible to select the first listitem of the combobox menu.
Whats wrong?

I have another question. I add some listitems to the listbox 'list_lines' and assign a Select function to the listbox. In this function I want to
get the number of the selected listitem like this:

Code:
function selectLine(){
	selectedLineItem = list_lines.marked_item;
	num_selectedLineItem = LBG_object_getnum(list_lines, selectedLineItem);
	
}



But num_selectedLineItem is always 0, else if I dont select the first listitem .
How get I the correct number of the selected listitem?
Posted By: Lukas

Re: LBGUI - RELEASE - 02/18/13 13:51

To your combobox/listbox problem: You simply forgot to update your combobox after creating all the list items.

As for the problem of getting the number of a listitem: list_lines is NOT the first list item in the linked list, it's the parent listbox! So you have to use LBG_object_getnum(list_lines->item_first, selectedLineItem); instead.
Posted By: Bone

Re: LBGUI - RELEASE - 02/19/13 11:30

Thanks Lukas, it works.
Posted By: NeoNeper

Re: LBGUI - RELEASE - 02/20/13 00:43

is there any way to use parameters in the event function of the button?
Sample:
mybuttom->Event = myfunction(myparamiter);
Posted By: MasterQ32

Re: LBGUI - RELEASE - 02/20/13 00:52

nope, not possible in Lite-C
Posted By: NeoNeper

Re: LBGUI - RELEASE - 02/20/13 11:44

Tanks (^.~)
Posted By: Rackscha

Re: LBGUI - RELEASE - 02/20/13 15:45

@NeoNapper: What are you trying to do?
Calling an event with a parameter or somehow attach a routinepointer with predefined parameters?!
Posted By: NeoNeper

Re: LBGUI - RELEASE - 02/20/13 19:56

I do not know what it means "routinepointer"
One solution that I usually use is:

Code:
//only logic
LBG_BUTTON* button_test (..., ..., ..., ..., NULL); //event function NULL
...

//Function thread for button press

...
while(button_test)
{
//if mouse over
//if mouse left
//work parameters

}


I am creating a chat system for an MMO that I'm working.
for each player who talk to me in private chat, I create a LISTBOX and a BUTTON.

If there is any SIMPLER WAY, PLEASE TEACH ME

Preview.


Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/01/13 02:44

I'm having trouble creating a function that removes all items within a ListBox.
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/01/13 14:18

I'm doing this way, but not working correctly.

Code:
void clean_log()
{
	//number of items in the list
int total = LBG_object_getnum(_listbox->item_first,LBG_object_last(_listbox));
	int ping; //for loop

	for(ping =0; ping < total; ping ++)
	{
           LBG_destroy_listitem(_listbox->item_first);
	   _listbox->item_first = _listbox->item_first->next;
	}
	
	
}



I believe the problem is the following reason:
I am destroying the ITEM before knowing what is next on the list.

LBG_destroy_listitem(_listbox->item_first);
_listbox->item_first = _listbox->item_first->next; ??????

know someone give me an idea?
Posted By: Ch40zzC0d3r

Re: LBGUI - RELEASE - 03/01/13 15:37

Save it in a void* (pointer)...
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/02/13 14:57

is not this the problem!
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/02/13 15:08


this work!.
Code:
void clean_log()
{
	//number of items in the list
int total = LBG_object_getnum(_listbox->item_first,LBG_object_last(_listbox));
	int ping; //for loop
        LBG_LISTITEM* item_old;

	for(ping =0; ping <= total; ping ++)
	{
           item_old = _listbox->item_first->next;           
           LBG_destroy_listitem(_listbox->item_first);
	   _listbox->item_first = item_old;
	}
	
	
}

Posted By: NeutronBlue

Re: LBGUI - RELEASE - 03/05/13 20:58

This is exactly what I've been looking for - THANKS!!
(There used to be a GUIControls package years ago, now I can't find it...)

I just downloaded your package today, and the files are dated around July 2010.

Am I using the correct link? - Did I miss an update somewhere?

Thanks Again.
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/05/13 22:53

Quote:


I just downloaded your package today, and the files are dated around July 2010.

Am I using the correct link? - Did I miss an update somewhere?


I'm also using this package.

Doubt:

Code:
LBG_LISTITEM* item_folow = LBG_rightclick_add_option(_lbgrightclick1,1,"Seguir",LIF_SHOW,NULL);
//Its work, the item is created


Once created an item in a LBG_RIGHTCLICK* I can not make it invisible.

Sample:
Code:
reset(item_folow,LIF_SHOW); //no WORK
//or
item_folow.flags &= ~LIF_SHOW); //no WORK



Why? how can I do this?
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/12/13 22:33

I continue with this problem and I can not solve!
Anyone know give me a hand?
reset(item_folow,LIF_SHOW); in LBG_RIGHTCLICK* no work.
Posted By: Lukas

Re: LBGUI - RELEASE - 03/15/13 17:15

Hi, sorry for the delay of my answer.

I checked and it is in fact a bug that listitems won't turn invisible when their LIF_SHOW flag isn't set. I put it on my ToDo list. For now, as a workaround, in addition to turning off the LIF_SHOW flag, manually turn its panel and text invisible.
Posted By: NeoNeper

Re: LBGUI - RELEASE - 03/15/13 20:06

makes sense! Tanks Lukas.
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/26/13 05:47

Hi I think a simple check in the function LBG_resize_window for 'NULL = no change' would help save typing. I haven't looked but anywhere this can be used would be helpful.
e.g.
Code:
LBG_resize_window(some_win,NULL,some_win->size_y/2);

Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/27/13 08:29

Originally Posted By: Lukas
it's a known bug that windows don't react on changing their WF_SHOW flag. As a workaround, you have to make its panels and children manually invisible. This will be fixed in the update I hope to release this year.
How do I properly hide each element? I tried resetting the SHOW flag and WF_SHOW but neither work to make the window invisible.

EDIT: And how can I check if the Enter key was pressed inside an EditBox like with inkey?
Code:
var r = inkey(input_string);
if(r==13){ // enter key was pressed
... // handle the string now
}


EDIT2: Just found in the manual --> void Key() should do the trick!
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/27/13 20:06

Quote:
How do I properly hide each element? I tried resetting the SHOW flag and WF_SHOW but neither work to make the window invisible.


For the parent window win->panel->flags &=~SHOW; As for the children. I think it was something about going through link-list to see if thier 'parent' is that window and the respectively resetting the acknex panel 'show' flag for their 'panel' like elements.

I'd show you code but I haven't tried it yet as I haven't had a need.

Code:
win->panel->flags &=~SHOW;
reset(win->panel,SHOW);

Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/27/13 20:16

Code:
LBG_WINDOW* a_window = 0;

void a_function(){
  a_window = LBG_create_window(0, 20, 160, 512, 256, 12, 1,"Window",&win_bbmaps,&win_cbmaps,&win_tbmaps,1, 0, WF_SHOW | WF_RESIZABLE);
}

void toggle_window()
{
	while(key_y)wait(1);
	if(is(a_window,SHOW)){
		a_window->flags &= ~SHOW;
	}
	else{
//		set(a_window,SHOW);
		a_window->flags |= SHOW;
	}
}

on_y = toggle_window;

It does not work when I set it with the above code.
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/27/13 20:21

Code:
LBG_WINDOW* a_window = 0;

void a_function(){
  a_window = LBG_create_window(0, 20, 160, 512, 256, 12, 1,"Window",&win_bbmaps,&win_cbmaps,&win_tbmaps,1, 0, WF_SHOW | WF_RESIZABLE);
}

void toggle_window()
{
	while(key_y)wait(1);
	if(is(a_window->panel,SHOW)){
		a_window->panel->flags &= ~SHOW;
	}
	else{
//		set(a_window->panel,SHOW);
		a_window->panel->flags |= SHOW;
	}
}

on_y = toggle_window;




a_window is a lbgui object that holds the pointer to a real acknex panel object in the var panel[confusing] lbgui_window->panel->flags


@Lukas Maybe change that pointers name to ack_panel would help.
Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/27/13 20:24

Ohhh I understand now! Thanks Malice! laugh
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/27/13 23:24

It is possible to modify thee LBG_destroy_window to instead hide the window and all it's children. Should I try and post the result?

I also would like to suggest flag e.g. WF_LOCK_INSIDE_PARENT so I can't move the child out of the parent.

Quote:
EDIT* I said lbgui_elements megatype struct (wow confusing). How about just thinking of a lbg_composite struct.


Quote:
OP* Lukas maybe this is a bad idea but could you have a lbgui_elements mega-type struct so that all elements create with a NULL parent get assign and then any element that is assign to a parent also stores it pointer in to lbugi_elements megatype struct.

Code:
typedef struct
{
	LBG_WINDOW* owner_obj;
	LBG_BUTTON* my_buts[100];
	LBG_WINDOW* my_wins[100];
	ect.
	ect.
}LBG_ELEMENTS;

#define LBG_MAX_ELEMENTS 500;
LBG_ELEMENTS* LBG_screen_elements[LBG_MAX_ELEMENTS];

void LBG_create_x(var parent,x,x,x)
{
	var 1;
	if(!parent)
	{
		for(i=0;i<LBG_MAX_ELEMENTS;i++)
		{
			if(i=LBG_MAX_ELEMENTS)
			{
				printf("LBG_MAX_ELEMENTS too small or full");
				break
			}
			if(!LBG_screen_elements[i])
			{
				LBG_screen_elements[i]->owner = me;
				break;
			}
		}
	}
	else
	{
		var j;
		// find the parents LBG_screen_elements struct
		for(i=0;i<LBG_MAX_ELEMENTS;i++)
		{
			if(LBG_screen_elements[i]->owner == parent)
			{
		        /* find an empity struct pointer in the right 
type based on create function 
type e.i. LBG_create_button pass 
LBG_screen_elements[i]->my_buts[j]*/
				for(j=0;j<LBG_MAX_ELEMENTS;j++)
				{
					if(!LBG_screen_elements[i]->my_buts[j])
					LBG_screen_elements[i]->my_buts[j] = my;
					break;
				}
				// hand over point.
			}
		}
		
	}
}



Then I could write a function the goes through the elements struct and set/reset(s) and panel->flags parameters.


Well I'm just a beginner and you may very well have something like this or else how could the destor() functions work.
Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/30/13 23:50

Any idea how to get vertical scrollbars to work with LBG_create_text when the text string spans longer than or is positioned outside the window itself?

EDIT: What's the best way to approach having a large TEXT*'s string in a window with scrollbars? The entire string gets clipped once the topmost part of it is scrolled off the window.
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/31/13 15:52

EDIT* Ok I understand. If the text object is fully clipped the use any TEXT objects. Or if not the maybe many string.
strings =10; ect...
Or like before invisible window that is large then the screen
or use a non-lbgui text and scroll it with user function.


EDIT* have you looked for it in demo.c? And Why is your text item outside the window? It doesn't make sense for a child object to be outside the parent.

EDIT2* You want the text object to be bigger then and outside the window. Why not put it in a lager invisible window (&bbmaps = NULL, &cbmaps = NULL) ..? I'm just not clear on what you trying to do so I'm having trouble solving it.

Without looking into it.

Get a Text with x(10) strings then move the content of the strings up and down with str_cpy. You need 1 outside string to hold the string content that has go above the text ( i.e. copied out of text.pstring[0] ). When the first string goes out of the text copy append it to the outside string and mark its begin and end points in a 2x array (v[10]10]). If all 10 strings go above the text then that are all contained in the holder string as one long string.

That's just off the top of my head. I'd have to look into LBG to see how that fits into it. I'll look after my morning coffee.
Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/31/13 17:59

Hi, I tried using a multistring array in a TEXT* but once a string goes past the top part of a window, the entire TEXT* gets clipped. I'm assuming it gets clipped because all the strings are contained in the same object and if any part of the object extends beyond the top or left part of a window it gets completely clipped.

I tried using txt_create on runtime but it's actually really slow, freezing the game engine for several seconds. This solution isn't a viable one.

Finally, I've tried shortening the text string by removing a line at a time and keeping a complete log of the strings in the text, restoring the text string when scrolling up. The only problem I've been having is that this method doesn't work when the user scrolls fast.

EDIT: Is it possible to have a TEXT string behind the actual level? Then the window does not need to clip the strings and I can simply bind the text to the background.
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/31/13 19:02

Have you tried breaking the string into many TEXT object and positioning them and assign all of them as children in the lbg window? Unless there is some limit to the number of lbg_text per lbg_window. I believe this is how Lukas did it in demo.c


Quote:
Is it possible to have a TEXT string behind the actual level?


Level like in the rendered wmb ? So rendering a string on the sky/background texture?

Quote:
Then the window does not need to clip the strings and I can simply bind the text to the background.


Like rendering to target.bmap of the windows->content_panel ? Sort of the idea last post here post about text on texture Like maybe with bmap_blit. Or not using lbgui and making a acknex panel->window and placing the TEXT object behind it off full size and then scrolling by changing the TEXT objects pos_y ?
Really bad solution - make a full screen bmap with a alpha window for where the lgb_window is on screen. Make the lbg_window content set to transparent background. Place Text* object behind screen bmap and lbg_window and scroll by changing text object pos_y. vscrollbar can be use if you find the var that actually changes the pos of things in lbg_windows. (will lo0k)
Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/31/13 19:30

Originally Posted By: Malice
Have you tried breaking the string into many TEXT object and positioning the and assign all as children in the lbg window? Unless there is some limit to the number of lbg_text per lbg_window. I believe this is how Lukas did it in demo.c

Yea, since the strings are modified at runtime (the user can enter in text into an editbox which gets added to a log), I tried creating TEXT* on runtime using txt_create. But as I mentioned earlier, it creates them in several seconds and locks up the entire game.

I cannot create TEXT* statically since I do not know how much text will be entered into the editboxes.

Originally Posted By: Malice
Or not using lbgui and making a acknex panel->window and placing the TEXT object behind it off full size and then scrolling by changing the TEXT objects pos_y ?
Yes, I suppose I meant something like this method. So I can make the LBG_window have no content then use the scrolling to change the pos_y of the TEXT*. But how do I get the TEXT* to be clipped once it's past the LBG_window frames?
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/31/13 19:51

Quote:
So I can make the LBG_window have no content then use the scrolling to change the pos_y of the TEXT*. But how do I get the TEXT* to be clipped once it's past the LBG_window frames?

To clip it - ? Hum.. Did you read Really bad solution? The text is behind the lbg_window which is behind the screen bmap. sceen bmap is colored screen color anything not in the alpha window is invisible.


What is wrong with a simple string swapping method ? People were doing long before lbgui. AUM scrolling text

Maybe a way with bmap font and bmap manipulation to blit text on to the a panel that's the child of a LBG_window. But you have to keep changing the panels size to fit new text.

A scrolling text that the player adds new content to and has to be able to back scroll fast? Like looking back in a chat log? Any reason you can't limit the look back range to say 20 post?
Posted By: Anonymous

Re: LBGUI - RELEASE - 05/31/13 21:07

Have you looked at the TEXT* object in the manual? I just found 'offset_y' this is new to me.

This is getting Off topic of Thread
Posted By: 82RJZAE

Re: LBGUI - RELEASE - 05/31/13 23:40

Thanks, offset_y works like a charm!
Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 20:44

Problem with WINDOW vertical scroolBar and ComboBoxes in(caption) and (button).

I tried to fix, but I'm not having success in my attempts.

The problem is the following:.

> I have a WINDOWS that contains some components.
> In this window I have a Vertical ScrollBar.

Whenever I use the scrolling window, the components are usually hidden, With the exception of the caption and button of the combobox!

See picture for sample;
WINDOW with components:


Scrroling window


If someone could correct this problem, please notify me.
This problem is not just with the components combobox.
EDITBOX->caption Too.

I do not veriquei with LISTBOX.
Posted By: Ch40zzC0d3r

Re: LBGUI - RELEASE - 11/01/13 20:53

Why not use another solution??
GWEn for example... LBGUI is such a slow thing o.0
Play it on 1920*1080 and watch your fps dropping to 50%
Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 21:04

It would be wonderful to use in LITEC Gwen. But it exists?
Posted By: Ch40zzC0d3r

Re: LBGUI - RELEASE - 11/01/13 21:08

Sure, I converted it. Its a bit crappy because you cant use Function in classes and virtual functions, but It works fine.



Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 21:24

Wooow but this is incredible.
You provided somewhere for us to use or is commercial?
Posted By: Ch40zzC0d3r

Re: LBGUI - RELEASE - 11/01/13 21:30

I could upload it, but I have to fix much on the names and on the using then.
Its a engine plugin dll, sou you nee dto have com or above to use it laugh
If more people are interested I could fix it up and upload some codenz grin
EDIT: Could also attach my Anti-Cheat System xD
Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 21:36

I really am interested.
Unfortunately I'm with many financial problems and would not be able to help you financially, but if I can help you in any way in the finalization of this plugin, I would be very happy to help.
Long time wait for a GUI in real 3DGS. I have much interest in it, I believe we all !
Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 21:38

Originally Posted By: NeoNeper
Problem with WINDOW vertical scroolBar and ComboBoxes in(caption) and (button).

I tried to fix, but I'm not having success in my attempts.

The problem is the following:.

> I have a WINDOWS that contains some components.
> In this window I have a Vertical ScrollBar.

Whenever I use the scrolling window, the components are usually hidden, With the exception of the caption and button of the combobox!

See picture for sample;
WINDOW with components:


Scrroling window


If someone could correct this problem, please notify me.
This problem is not just with the components combobox.
EDITBOX->caption Too.

I do not veriquei with LISTBOX.


Meanwhile, the LUCAS can lend a hand to fix the bugs mentioned above? I also would be very grateful
Posted By: NeoNeper

Re: LBGUI - RELEASE - 11/01/13 21:54

keep me informed about your GUI Ch40zzC0d3r
Posted By: Kartoffel

Re: LBGUI - RELEASE - 11/02/13 09:01

yeah I'd also be interested in gwen...
Posted By: sivan

Re: LBGUI - RELEASE - 11/02/13 11:21

Chaozzcoder, it looks great!
Posted By: rojart

Re: LBGUI - RELEASE - 11/02/13 13:43

@Ch40zzC0d3r: I'm also interested.
Posted By: Anonymous

Re: LBGUI - RELEASE - 11/05/13 20:41

@Ch40zzC0d3r - Very much interested, packaged UI takes a of work off me.
Posted By: Ch40zzC0d3r

Re: LBGUI - RELEASE - 11/05/13 20:44

Hm ok, this looks like I should give it a go ^^
At the moment Im a bit busy, so it may take some days till weeks but Im going to release something you can work with. But it is far from complete and far from bugfree xD
Posted By: Kartoffel

Re: LBGUI - RELEASE - 11/05/13 20:51

nice, looking forward to it laugh
Posted By: Anonymous

Re: LBGUI - RELEASE - 11/05/13 20:54

Awesome laugh Thank you.
Posted By: alibaba

Re: LBGUI - RELEASE - 05/02/15 20:52

Here is the fixed version without memory leaks:
http://skytitans.de/lbgui.h
Posted By: Lukas

Re: LBGUI - RELEASE - 05/04/15 20:00

Hello.

I guess now that other people are fixing bugs in LBGUI, I should talk about the state of the official update. I don't consider the project dead, even though it has been a while since I worked on it and I know it has been a long time since I announced it first. Since I started my Physics study I have had little time to work on LBGUI, pretty much only in the holidays after the last exam each semester, and it takes a while each time to get back into it after not looking into the code for so long.

Actually, it's mostly finished and I had already started updating the manual so I could release it. But then I found new bugs that are so severe that releasing this version before fixing them was out of the question. So I only have to fix these bugs. Maybe I'll even be able to finally release LBGUI 1.1 in this year (but I'm not promising anything).

I guess what I can give you now is the manual pages about the new features and the bugfixes I implemented:
https://drive.google.com/file/d/0B8eheNsaIoF9c0ZqME5IcXNyOUE/view?usp=sharing

If you found a bug that is not listed there, I encourage you to post it here. If you already told me or posted it in the past and it's not on the list I probably didn't properly note it in my todo-list, so please post it again in that case.

alibaba: Could you tell me where you edited the code and what of what nature the memory leaks were? It's possible that it's the memory leak I already fixed, but if not I'd like to implement these fixes in which case I'd credit you of course.

About the long-term future of LBGUI: In hindsight, I don't like many aspects of how LBGUI works internally (which make it slower than it needs to be), so LBGUI 1.1 will be the last update in a while and the last that tries to be as backwards-compatible as possible. If there will ever be an LBGUI 2.0, it will be different in many ways and code using LBGUI 1.0 will not necessarily work with it anymore.
Posted By: alibaba

Re: LBGUI - RELEASE - 05/04/15 22:11

Awesome! It contains all bugs i´ve experienced so far! Especially the slider resizing thing was bugging me. Thank you!

The leaks were, as you stated, from unfreed ent_createblack bitmaps from some elements.
Posted By: nfs42

Re: LBGUI - RELEASE - 05/06/15 22:35

@alibaba: it seems you got them (leaks)
@Lukas: nice to see you workiung (again) on your contribution
Posted By: alibaba

Re: LBGUI - RELEASE - 05/06/15 23:15

Hey Lukas, is it possible to get the almost fixed version earlier? I need it so badly. If not, could you maybe tell me how you fixed that slider not updating it´s ranges bug?
Posted By: sivan

Re: LBGUI - RELEASE - 05/07/15 07:27

you could put it to GitHub...
Posted By: MasterQ32

Re: LBGUI - RELEASE - 05/07/15 12:33

Would be nice to have LBGUI on GitHub, totally support this!
Posted By: NeoJones

Re: LBGUI - RELEASE - 05/23/17 08:19

Great work Lucas!
Does someone have a last updated version of this or a functional link to it?
Or is there a newer gui?
Posted By: Lukas

Re: LBGUI - RELEASE - 05/23/17 20:09

Sadly, the version linked on the original post is still the latest released version. I still plan to release an update, but as I only really get to work on LBGUI during the holidays between semesters and I have become a terrible procrastinator on working on LBGUI I often waste most of the holidays when I finally get back to it I spend most of the time I have getting back into the code. I'm kinda ashamed to see that my last post about this is already two years old...

Basically, you should treat the update for LBGUI like The Winds of Winter. You know that it's coming, but don't expect it to come soon. Then you can only be pleasantly surprised.
Posted By: NeoJones

Re: LBGUI - RELEASE - 05/24/17 09:24

Ah okay, thanks laugh
Posted By: 20BN

Re: LBGUI - RELEASE - 06/24/17 11:31

@Lukas

Hi, LBGUI how to hide window? (not destory and recreate)
© 2024 lite-C Forums