Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Truly skinnable GUI for allegro released

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
Truly skinnable GUI for allegro released
spellcaster
Member #1,493
September 2001
avatar

Quote:

How about it? If people make their own skins the best ones could be distributed with the library?

Sure, why not?
But I was thinking about putting a list of downloadable skins on my website, so the actual download doesn't get too large.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Julien Cugniere
Member #947
February 2001

Quote:

Now I just have to figure out where to stick the 'lex_gui_shutdown' function

Hey, couldn't you register it with atexit()? Or you can wait a week or two... I'll soon release a new version of dlg, where plugins can register init/shutdown functions, as well as menu hooks, so you can for example let the user change themes from the menus of the editor (works will with agup!).

Spellcaster: very nice! do you somehow expose the contents of the skin to the user? That way, one could make its custom procs follow lexgui's theme, whatever it would be 8-)

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Hey, couldn't you register it with atexit()

Its crashing, when exiting the DLG demo mode, you know, the one that says its dangerous? ;)

gnuduch: The problem was, the version I have doesn't have that bit, here this is what mine looks like: gimp.jpg

:) It was late last night... you can all safely ignore my late night rantings ;D

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

Quote:

do you somehow expose the contents of the skin to the user? That way, one could make its custom procs follow lexgui's theme, whatever it would be

Hm... what internals? :-)

My dialog procs are pretty simple and straight forward, since it's mainly image blitting.

But I guess I could add some of the internal helper functions to the lexgui.h file, so you can use the draw_skinned_rect() function inside your own programs.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Julien Cugniere
Member #947
February 2001

Quote:

Its crashing, when exiting the DLG demo mode, you know, the one that says its dangerous?

Eh! I'll see if there's a way around this...

Quote:

Hm... what internals? :-) My dialog procs are pretty simple and straight forward, since it's mainly image blitting.

Ok, never mind! I've actually looked at the code ;D, and you already export a global LexSkin. It's all good, then!

spellcaster
Member #1,493
September 2001
avatar

Ahm, 'lex_gui_shutdown' should be called only before exiting the program (or as soon as you know that you don't want to use any of the lex_ dialog procs anymore).

Had a look at DLG... now that's a nice program you wrote there :-)

Really nice work.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Niunio
Member #1,975
March 2002
avatar

I've tested the lexgui ussing the DJGPP and it works right, but I discover a small mistake in the test program: It tries to use large file names, and DOS uses the 8.3 file names, so it doesn't works right until change all file references to the 8.3 from test.c and all skin files.

And the test.exe included in the zip doesn't work in my W98, but it did in Wxp ??? I don't tried to compile with MingW32 in my computer, but I'll try tomorrow...

Somebody test it in Linux?

-----------------
Current projects: Allegro.pas | MinGRo

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Somebody test it in Linux?

Yup. Works fine for me in linux.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

spellcaster
Member #1,493
September 2001
avatar

Hey, thanks for the feedback.
I'll change the extension for the skin files, so it works with dos also.
Not sure why the example program didn't run under w98, I'm using w98 myself.

Next release will contain makefiles and a vc project file. Hopes that will solve the problems.

I'm currently coding the filechooser (have a look at a first screenshot: [url http://www.steinke.net/allegro/index.html#inprogress]
The listbox dialog proc works fine already and allows you to use whatever you want as list items (not just text).
On the to-do-list are scrollbars (almost done) and a combo-box (just started) as well as menus.

For the filechooser I've implemented a small hack which allows you to access all drives as parent directory of a disc root. (So, if you go to the parent dir of C:\ youll get to the drives overview). You guys think that this is ok?

Thomas, could you test the next version in Linux before I release it? I think the filechooser should work, but since I haven't tested it yet...

And thanks again for the feedback.

--
There are no stupid questions, but there are a lot of inquisitive idiots.

gnudutch
Member #951
February 2001
avatar

Hmm that is very wierd Thomas. Ah well, you can also bring up the brush dialog (or any dialog) by right clicking on your image, and choosing the "dialog..." menu. Did the new version build?

SystemDown
Member #663
September 2000
avatar

Hey spellcaster, the in-progress file chooser looks good :)

Just wondering if I could make a request about dialogs, specifically, a dialog_proc() function to make non-movable dialogs. I'm not real sure if I could've done it easily or not by using inheritance (well, you know what I mean), but I just played around a bit with your source and made a lex_dialog_proc() which doesn't do anything with the MSG_CLICK message (I made it just broadcast a MSG_IDLE) so it can't be dragged by the title bar.

Could you possibly include something like that in the next release? Just so there's that option..
I'm thinking about writing some C++ wrappers for your functions so I can bastardize perfectly good C code to please my infatuation with objects ;D
For example I'm thinking along the lines of:

LexDialog *dialog = new LexDialog();
dialog.setMovable(true);

And so on.
But that's just an idea. I tend to do stuff like that just for the hell of it.

Anyway.. that's enough of my rant.

---
BEER: It's not just for breakfast anymore.

spellcaster
Member #1,493
September 2001
avatar

Quote:

the in-progress file chooser looks good

Thanks :-)

Quote:

Just wondering if I could make a request about dialogs, specifically, a dialog_proc() function to make non-movable dialogs. I'm not real sure if I could've done it easily or not by using inheritance

Ok, this code snippet will give an un-moveable dialog.

/** A not moving dialog */
int lex_static_dialog_proc(int msg, DIALOG *d, int c) {
    if (msg != MSG_CLICK) {
        return lex_dialog_proc(msg, d, c);
    } else {
        return D_O_K;
    }
}

Regarding the c++ wrappers: Wait a week with them. This should give me enough time to finish the filechooser, combobox and multi-line text input (And maybe the menus).

--
There are no stupid questions, but there are a lot of inquisitive idiots.

SystemDown
Member #663
September 2000
avatar

Ahh, yes, of course. Thanks for the hint.
I really should read up on the Allegro GUI stuff and familiarize myself more with simple inheritance like that. I tend to think in terms of inheritance with C++/Java more so.

And please, take your time with implementing those other features! I've got some brushing up to do before I get these wrappers going.. and a lot of work to do on uni projects besides.
It was just an idea anyhow, probably not something which people would want to use.
I guess I'll just see what eventuates with it.. I'll keep ya posted of course.

---
BEER: It's not just for breakfast anymore.

Thomas Fjellstrom
Member #476
June 2000
avatar

Awesome. spellcaster, Just awesome.

gnudutch> yeah, the new gimp built fine, just gotta install it now. :) (talk about lazy eh?)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

topaz22
Member #2,049
March 2002
avatar

looks nice- have you looked at using a dirty rectangle system, tho ?

spellcaster
Member #1,493
September 2001
avatar

Next version will allow you to ask for changed rects.
While I don't think that this is needed (In game most GUIs will use a predefined space, which you can blit easily), you guys keep asking for it.

I'll add functions like:

RECT* lex_get_changed_rect();
RECT* lex_get_changed_area();

so you can use dirty rects if you want, or simply blit the changed area.

Heh, seems like the next release will contain some pretty big changes...

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Wer fu
Member #1,084
March 2001
avatar

Great work spellcaster, this skin add-on is exactly what I was looking for! I will surely make a new skin (I'll post a screen shot and a link) for my game. A request: Put all this stuff in an staticly linkable library, this would be easiest of use.

A question : Is very round shaped skin would work?

Thomas - Could you post the plug-in for DLG to make it work with lexgui? I'm too lazy to write it myself ;)

SystemDown - I would be interested to work on a wrapper too. If you need help let me know! ;D

ICQ:71667703 or Email&MSN: werfu_dx@yahoo.fr
Werfu was here

Thomas Fjellstrom
Member #476
June 2000
avatar

Wer fu> There is a slight problem with DLG and lex_gui. It works for the most part, but crashes when exiting from the 'Test This Dialog' option.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Wer fu
Member #1,084
March 2001
avatar

Thomas - Why not post it anyway? Maybe we'll find the bug...

Spellcaster - Why not resizable window and message box?

ICQ:71667703 or Email&MSN: werfu_dx@yahoo.fr
Werfu was here

Niunio
Member #1,975
March 2002
avatar

I'm here again.

I've created a very interesting module. It is a utility to 'compile' the SKIN file and the BITMAPS in a DAT file and a C module wich loads this file and creates the skin. I've put it here. Read the readme.txt before do nothing.

I hope it pleases you and it will added in to the library;).

-----------------
Current projects: Allegro.pas | MinGRo

Thomas Fjellstrom
Member #476
June 2000
avatar

Wer Fu> Ok, I'll clean up the hack, and write some docs (*gasp*).

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Richard Phipps
Member #1,632
November 2001
avatar

I think a few people are looking forward to this lexgui now! Especially if it has loads of extra features!! :)

Keep up the good work all..

Rich.

spellcaster
Member #1,493
September 2001
avatar

WerFu: Hm... I'm going to change the .skin format slightly. First of all I need to rename it to something with only 3 letters, so the dos users have less problems.

I'll also need some extra features, so you might want to wait for the next release before you start working on your theme.
I case you don't want to wait: There will be changes in the listbox skin and dialog skin, you'll need to do two scrollbar skins (horiz and vertic).
It's not that much work, but you might want to wait. I think I'll write a "How to skin lexGui" tutorial anyway.
(geez... this is becoming work 8-) )

Niunio: Downloaded the file, will have a look at it in a sec. I wanted to something like this anyway, and your contribution has saved me the time :)
Thanks a lot.

I'll start working on the gui now, I hope that I can finish the boring parts (scrollbars) today and moveon to something more interesting (multi-line input).

--
There are no stupid questions, but there are a lot of inquisitive idiots.

Niunio
Member #1,975
March 2002
avatar

spellcaster: Ok. Tell me about all changes you do and I'll update the compiler and the loader module (less work to you). And a suggestion: do not erase the 'old style' load function, it's useful while developping.

-----------------
Current projects: Allegro.pas | MinGRo

Specter Phoenix
Member #1,425
July 2001
avatar

spellcaster: If you are planning to change the .skin format slightly to a 3 character format for DOS users why not just go with .skn (it's 3 characters and it says basically the same thing:)). Also when is the next release because I'm interested to see what you can do with MENUS and DIALOGS in your skinnable GUI library:D (especially if you add the idea I was talking about).

"Can't a man even talk to himself without being interrupted?" -Krull(1983)
"Through vengence I was born. Through war I was trained. Through love I was found. Through death I was released. Through release I was given a purpose." -- Specter Phoenix
"Programming == AWESOME the rest is just tools to accomplish it."
END OF LINE

 1   2   3   4 


Go to: