Re: [Dclib-devel] Menus
Brought to you by:
davisking
From: Davis K. <dav...@us...> - 2008-04-04 14:52:33
|
Nils, I just uploaded a snapshot of the library to http://dclib.sf.net/snapshot. It contains everything I have done with this stuff up now. I think I have got most of what you sent me in there but can you take a look at it and let me know what you think? I ended up changing a lot of stuff so it is hard to keep track of the differences or parts I might be missing. But the things that are in there now are a menu_bar, popup_menu, 3 popup_menu_item styles (a text style, a submenu style, and a horizontal line style), the dlib::button now takes a style argument as well but I only have two styles in there, and there is also a tooltip widget. What is notably missing is all your button styles. So there is still that part to do. But I believe that can be done by just adding more style objects to what is now in the library. I also haven't added any unicode strings to the widget interfaces. I think this can be easily done by overloading the set_text() functions to take ustring and wstring as well as just string. But I'm not sure what to do about the on_keydown event since I never even thought about having it emit unicode characters when I made it way back when. Do you know how to get unicode key codes out of X11 and win32 events? The PNG code you sent me works fine near as I can tell. I ran valgrind on it and it didn't detect any resource leaks so I guess the png_read_end thing doesn't matter. I also looked at the png documentation and it didn't seem to say anything about it being a problem if we don't call it. Anyway, I added it into the library under the name of png_loader. I also added some template and preprocessor magic that should direct a user to a message saying "you have to install libpng" if they haven't and they try to use png_loader. Anyway, take a look at let me know what your thoughts are. -Davis P.S. I also sent this to the dlib development mailing list. I'm not sure it is even configured correctly but I'm trying to get it all setup :) On Sun, Mar 23, 2008 at 12:39 PM, Davis King < dav...@us...> wrote: > Ok. I'll look over it all and integrate it into the library however seems > appropriate and see what I can do about the TODOs and what not. I'll email > you once I have it all in so you can give me your feedback. Should be a > week or two. > > -Davis > > > On Sun, Mar 23, 2008 at 12:04 PM, Nils Labugt <el...@on...> wrote: > > > I'm getting a bit tired of this GUI stuff now, so I'm tempted to leave > > the rest to you. I haven't written any abstract.h file. There are still > > TODOs left in the list (see top of menu.h), but some are just ideas, and > > most are not release blockers. If there are specific classes or > > functions that needs more comments then just say so. > > > > I hope you review the code before you release it, especially the mutex > > stuff, because I don't know how to test that, and I don't have much > > experience with them. Some of the class interfaces are a bit arbitrary > > WRT constructor argument vs. set-function, and I didn't even consider > > the requirements of a future layout manager. I have fixed a lot of bugs, > > but there are probably more left (I think this must be some of the > > buggiest code I have written). Both menu.h and menu.cpp are too long and > > hard to scroll. There are a lot of magic constants, but I think I have > > managed to confine them (mostly) to the style classes. There is no > > support for Tab-key cycling, but I think that would require changes to > > existing widgets (text fields at least). > > > > Note that the images aren't mine, except for the button backgrounds. (I > > downloaded the icons from http://www.openclipart.org/ .) > > > > I found a forum thread about PNG where you say you would consider adding > > optional PNG support. I have no opinion on whether you should do that, > > but before I found that thread I had already written a few lines of glue > > code, which I have included just in case it would be useful. (Note the > > problem with png_read_end, I don't know if it leaks any resources > > because of it.) > > > > > > Nils > > > > > |