![]() |
|
Truly skinnable GUI for allegro released |
spellcaster
Member #1,493
September 2001
![]() |
The Allegro GUI is a very flexible and easy to use user interface. But, as On the other hand, it's very easy to change the look of the widgets. You int my_button_proc(int msg, DIALOG *d, int c) { int ret = D_O_K; if (msg == MSG_DRAW) { /* All drawing code here */ } else { ret = d_button_proc(msg,d,c); } return ret; }
While this is not that hard, it's still a repeating task. So, why not {"name":"screenshot.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/4\/e4d12f04b9172211c8de6390168b6eec.jpg","w":440,"h":600,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/4\/e4d12f04b9172211c8de6390168b6eec"} Overloaded Dialog Functions - lex_button_proc What's new? I added a few extra extra features to the button and listbox. lex_button_proc int button_callback(int id)
The submitted id is the d1 member of the dialog struct. Set it to NULL if I also created one new function DIALOG the_dialog[] = { /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */ { lex_dialog_proc, 100, 100, 440, 200, 0, -1, 0, 0, 0, 0, "Dialog", NULL, NULL }, /* Dialog box content goes here */ } The dp member is used for the dialog title. The remainder works as you would expect it from the normal Allegro To use it, simply use the lex_ prefixed dialog functions. I've also added a slightly enhanced version of do_dialog() called (be prepared for a surprise...) lex_do_dialog() which allows you to If you want to create new skins, have a look at the provided aqua.skin file... it's heavily commented, so you should be able to create You can download it from the (fresh, ugly but functional) lexgui homepage: [url http://www.steinke.net/allegro] Tell me what you think... is this something you might want to use? -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Looks nice. I'll have to give that a go. Any change you'll write a dlg plugin for your addon? Hmmm... your test doesn't update properly, it seems the objects sit in thier own loop, so Im guessing your still using some of the original gui code... and its horribly slow if i turn your Buffer into a sub bitmap of the screen and comment out the blit command... -- |
Matt Smith
Member #783
November 2000
|
Spellcaster: It does look very nice indeed Tom: That slowdown is inevitable when anti-aliasing or doing translucency |
Thomas Fjellstrom
Member #476
June 2000
![]() |
what aliasing or translucency? I have a 900Mhtz Tbird. It shouldn't be that slow... I mean it was really slow. as if I was running windows 98 on a 486@90Mhtz, the only thing that i know that goes that slow on this machine is TuxRacer with Hardware OpenGL turned off. (with all the extra effects turned on, like shadows, trails, more aliasing, more detail, etc...) -- |
Matt Smith
Member #783
November 2000
|
The symptoms you describe are are sure sign that there is some blending going on. No matter how fast your cpu is reading from video memory can be horribly slow. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
I dont think there is. But I haven't checked the code. I think the custom update_dialog is doing something funky casue the dialog is dragable. -- |
spellcaster
Member #1,493
September 2001
![]() |
Hm... not really. Not unless you you actually drag the dialog. Ahm... why would you want to turn the buffer into a sub bitmap? If you want to do blit to the screen, just use the normal do_dialog. -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
I was just playing with your 'test' code. I executed it without changing a thing, and if I click a button, I don't get to see the button pressed image cause the drawing is halted till I let go of the mouse button, but by that time the button has reverted to the 'not pressed' image. The list box does the same, it doesn't draw till you stop scrolling, and when draging the dialog no objects update, but the draging is SLOOOOOWWW, slow enough to see the individual blits that update the background image. I turned the buffer into a sub bitmap to remove the extra blit. -- |
topaz22
Member #2,049
March 2002
![]() |
i just looked at it... dragging the dialog makes the whole dialog white while dragging, and the scroll bar move while you drag it, but it goes to the place where you let go of the button. this is from running gui.exe. i have an athlon xp 1.1ghz w/geforce2. haven't looked at the code, lemme see what's going on. |
Pradeepto Bhattacharya
Member #1,340
May 2001
|
Hi all(egorites):) Great one SC ...it really looks cool...if i may say u have CAST-A-SPELL;)...pls send me ur magic wand ...;D Quote: Thomas Fjellstrom : Any change you'll write a dlg plugin for your addon?
I second that thought , SC any change of that...will really help lazy bones like me;)..will luv it.. -- |
Specter Phoenix
Member #1,425
July 2001
![]() |
Very cool;D. Will that work with the stuff posted here concerning GUI, DLG, AGUP, and a link to the GUI Clinic tutorial on the AGDN site by Daniel Harmon?
|
spellcaster
Member #1,493
September 2001
![]() |
Ok, first of all: It seems like the allegro dialog functions really like to do stuff in loops, and that they don't have callback functions. Quote: Will that work with the stuff posted here concerning GUI, DLG, AGUP, and a link to the GUI Clinic tutorial on the AGDN site by Daniel Harmon?
Let's start to work through that list step by step: b) Not sure what the questions are regarding AGUP and the GUI clinic tutorial? I'm also not sure if there's interest in that kind of functionality (skinable GUI procs). Right now I've these things on my list (most important things first): Next release: Other things on the list -- |
gnudutch
Member #951
February 2001
![]() |
Spellcaster: Oooooh pretty! |
Thomas Fjellstrom
Member #476
June 2000
![]() |
But... I wan't DLG to show me my pretty dialogs when I make them
-- |
Julien Cugniere
Member #947
February 2001
|
Quote: It seems like the allegro dialog functions really like to do stuff in loops, and that they don't have callback functions.
I think that when they do something in a loop, they broadcast a MSG_IDLE to the whole dialog... this could be the callback you need! But it might not be easy to differentiate it from regular MDG_IDLE |
Bob
Free Market Evangelist
September 2000
![]() |
Perhaps it can be merged in with AGUP, since that has Win32, GTK, and QNX Photon themes. -- |
Peter Wang
Member #23
April 2000
|
I'd love to see that, lexgui as an AGUP theme. And maybe that Aqua thing (by gnudutch? sorry, I forget) too.
|
spellcaster
Member #1,493
September 2001
![]() |
Quote: Perhaps it can be merged in with AGUP, since that has Win32, GTK, and QNX Photon themes.
Hm... as I said, that code can switch "themes" dynamically. So it's not really efficient to throw it together with AGUP. Hm... so you guys want more themes? Give me half an hour... -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Cool. But please not the Clown theme from XP... shudder -- |
spellcaster
Member #1,493
September 2001
![]() |
Ok, it took a bit longer (had to eat dinner in between ;-) ) and also needed to change the code slightly. {"name":"screen_bill32.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/e\/4efc335c192b01e33431796de328b98f.jpg","w":646,"h":505,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/e\/4efc335c192b01e33431796de328b98f"} That's a plain and boring win98 screen. I'll upload the changed package in the evening, this should contain a better doublebuffering stratgy, also. -- |
SystemDown
Member #663
September 2000
![]() |
Just like to say, nice initiative to create a skinnable GUI, it's looking great thus far. And a question about the scroller on the listbox in the demo program.. it doesn't follow the mouse when it is dragged. Is it supposed to do that?
--- |
spellcaster
Member #1,493
September 2001
![]() |
Quote: And a question about the scroller on the listbox in the demo program.. it doesn't follow the mouse when it is dragged. Is it supposed to do that? Nope, that's a a problem with the double buffer repaint code. It will be fixed this evening. -- |
SystemDown
Member #663
September 2000
![]() |
Great, can't wait.
--- |
Specter Phoenix
Member #1,425
July 2001
![]() |
Spellcaster: Thanks, but that was only the answer to my first question. What about my second question? The question was: Quote: One question I have is would I be able to make a GUI that when you click on a menu it opens and has a pic of a character or whatever to the left of the text and menu names and that stuff? For example, if I made my World of Gaia(WoG)RPG and decided that I wanted the main character(Ryu) to be on the left side of the first menu bar to the left of the text would I be able to do that and how would I be able to do that if I can do it?
Here is a lame image I made in M$ Paint to illustrate what I'm asking:
|
spellcaster
Member #1,493
September 2001
![]() |
Hm... I haven't touched the menu stuff yet. But it shouldn't be too hard. So, you want to be able to specify a BITMAP that is placed at a side of a menu? If this is what you want, it shouldn't be too hard to do. (I've no idea right now, because I've not used the allegro menus yet) I'll add it to my "todo" list together with skinnable menu support. -- |
|
|