BBI Style-menu script generator
| Author |
Message |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|
 BBI Style-menu script generator
Well, this was the screenshot that ultimately got me to make this little proggy, though it'd be nice if someone actually know where I could get my hands on that style setter.
Anyhow, this .NET program is pretty much a cross between a useful project, and an experiment with a new language (I've never touched .NET before), so there are quite a few bugs... Like exceptions not being handled, at all. This was all I would scavenge from help files. The ominous 'browse' button would be nice, too, had I known how to implement a directory selection dialog.
So, provided the styles directory is correct, the program looks for style files there, their extension should be empty. After that, it creates the matching scripts that use the pictures directory for the source of 200*150 BMP preview images. It also adds some default scripts to show a style selection window to your BBInterface.rc.
Well, I don't know if this would be of much use to anyone else, but 30 minutes coding was worth it, I'm far too lazy to add these things by hand.
You need the .NET framework to be able to run it. If anyone's interested, I could upload the (not that great) source code as well.
|
| Wed Feb 15, 2006 5:30 pm |
|
 |
|
Google
Sponsored Links
|
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|
So yeah, new version.
Uses a template file, with pretty powerful command tag replacement. These have the form of <command+modifier>. So <stylename> would replace this tag with the name of the style, <stylecomments+1> would be the comments of the next style, and <filepath-2> would become the full path of the second last file. Image files are still linked to filenames, but you specify the extension now, in the template file.
One more interesting addition is the seeking keyboard. Just throw in a few hundred styles in some directory (or subdirectories therein), and they'll be automatically sorted by stylename, and the first of each letter linked to a button.
I've included a template, so take a look at that, create the matching BBI controls, then execute one of the generated scripts (and the keyboard script too, if you wish), and you should be set.
I'd do a sample script containing the styles on boxshots were the pictures not using a different name than the styles. Gah...
Attachments:
Sample.jpg [ 18.07 KiB | Viewed 2551 times ]
File comment: Styleview script generator, new and improved version.
ScriptGenerator2.zip [7.87 KiB]
Downloaded 337 times
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Fri Mar 03, 2006 11:22 pm |
|
 |
|
txGreg
BBWise
Joined: Wed Jun 15, 2005 6:13 pm Posts: 52
|
 Re: BBI Style-menu script generator
pkt-zer0 wrote: Well, this was the screenshot that ultimately got me to make this little proggy, though it'd be nice if someone actually know where I could get my hands on that style setter.
Did you ever get any feedback on this? I'm not certain, but it looks very similar to the control panel from Pitkon's sidebar. I'm not sure though.
|
| Wed Apr 12, 2006 10:11 pm |
|
 |
|
Nightbreed
Moderator
Joined: Wed Jan 26, 2005 8:04 am Posts: 2252 Location: Philadelphia, PA
|
Well, they look similar to me, but then again, you really arent going to get that much of a different look in blackbox..lol..
I hadn't really had a chance to play around with this app... but I have had gone as far as having it generate script.. so, in that since, it's very cool...
_________________ if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page
|
| Thu Apr 13, 2006 3:46 am |
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|
 Re: BBI Style-menu script generator
txGreg wrote: Did you ever get any feedback on this? I'm not certain, but it looks very similar to the control panel from Pitkon's sidebar. I'm not sure though.
Hmm... thanks! It really is similar. Though I could always just bug Jimmy (the guy who posted the screenshot originally) about it, if I really needed to.
Anyhow, I'll post some templates and the matching BBI interfaces sometime soon-ish.
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Thu Apr 13, 2006 9:46 pm |
|
 |
|
Nightbreed
Moderator
Joined: Wed Jan 26, 2005 8:04 am Posts: 2252 Location: Philadelphia, PA
|
I would be interested in the src to be honest. I'd like to impliment something like this to do a picture directory... I really need to replace bbslideshow with something else 
_________________ if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page
|
| Wed Apr 19, 2006 2:09 am |
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|
Alright then, here's the source. Utterly crappy, and without error testing in most places, mind you. Don't be surprised that it's this simple, it is not much more than a text processing utility. The reason it's done in the bloaty .NET is that it was easier to make it more user friendly this way.
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Wed Apr 19, 2006 11:26 am |
|
 |
|
Nightbreed
Moderator
Joined: Wed Jan 26, 2005 8:04 am Posts: 2252 Location: Philadelphia, PA
|
thanks pkt-zer0 I'll give it all a go sometime today.
_________________ if you can not believe it's not butter, then help out with the blackbox Wiki http://wiki.bb4win.org/wiki/Main_Page
|
| Wed Apr 19, 2006 5:10 pm |
|
 |
|
unkamunka
Moderator
Joined: Sun Feb 04, 2007 2:57 pm Posts: 1008 Location: austria
|
 ScriptPreview
I have had a go at making this promising tool far more flexible - although I didn't feel hassled enough to transfer it from C# & .NET:  I have changed it enough to feel I deserve to be able to change the name. That said, it has ONLY been tested on NET 2.0.
Correction of last minute minor tweaks on 0.3 version - now 0.31
ANY wallpaper can now be previewed - regardless of the file format or the file name. A rendering of the background colours is now included - in most cases. The bbInterface Module is automatically provided - automatically scaling to whatever the user's current screen resolution may be. Previews have been increased to groups of 9 (previously 5) & navigation is in intervals of 9 (left-click) or 18 (right-click) - previously 1 at a time. Any of the 9 visible previews can be directly installed (previously 1) - by a left-click - or loaded into your bbEditor - by a right-click. The script-loading bug has been removed. There's a fairly complete ReadMe in Fatman's new XML format - which should be loaded into your browser. A fair few of the known remaining bugs involve rendering the Background Colours & are bbInterface issues: There's a full list in the Documentation.
Enjoy! 
Attachments:
File comment: drastic increase in previewing/editing capabilities
stylepreview.zip [17.11 KiB]
Downloaded 199 times
|
| Wed Mar 21, 2007 2:01 pm |
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|

First off, good job, it's a great deal friendlier than what I've initially cooked up. There seem to be a few bugs that need to be ironed out, though.
Using the styleTemplate.txt provided, the <imagefile> tags do not seem to be replaced properly for me - that is, they're all empty in the generated files.
Also, I'm either blind, or the tags themselves aren't really described in detail in the provided documentation.
For style captions, I sometimes get stuff like "deathnotestretches the image to fill the workspace", for the style "death note", in this case.
Finally, the scripts generated for the individual styles in the script directory seem to be the same template file parsed that the whole module uses. That's not quite correct, since all the Create commands and Module comments are still there, as well as lots of window properties being set again, when you only need to change a bunch of stuff, like the pictures, captions, and their functions - the general layout remains the same.
I'd suggest going back to the old way in terms of parsing, only creating the script files responsible for updating the interface - and have the option of creating a default previewer interface as a separate function.
Or even better, making it so that the commands that do not affect dynamic elements are parsed out from the output scripts, only lines that contain a <color>, <tocolor>, <imagefile>, <filepath>, etc. tag will remain.
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Sat Apr 07, 2007 4:15 pm |
|
 |
|
unkamunka
Moderator
Joined: Sun Feb 04, 2007 2:57 pm Posts: 1008 Location: austria
|

Thanks for posting back. pkt-zer0 wrote: ....the <imagefile> tags do not seem to be replaced properly for me - that is, they're all empty in the generated files. Images will not show if the default entry in the Backgrounds TextBox does not apply to you & you have not changed it before generating the scripts....I have to change the default entry every time in order to make it work for me - for example  I had hoped to get the next version out some time ago - but *serious* HW problems have intervened. Perhaps some time next week.  I have only _just_ regained access to the working version of the code.... What is intended for 0.4 (that is, issues already resolved) includes: resolution of the "rgb" colour format issue resolution of your "stretches to fill the screen" issue [crossfingers] option for increased # of thumbnails per screen - 36 (possibly 81 as well???) closing a smaller bug revolving around the -vdesk switch may have to wait  There are 2 main aims for me in tweaking this utility - which may be different from what you originally were aiming for: simple & wide style choices; simple & wide style review for tweaking.
Longer term, it would be nice to see this made into a "true" plugin - which would require porting the code (among other things). 
|
| Tue Apr 10, 2007 7:37 pm |
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|

unkamunka wrote: Images will not show if the default entry in the Backgrounds TextBox does not apply to you & you have not changed it before generating the scripts....I have to change the default entry every time in order to make it work for me - for example  All right, let me clarify a bit. I have "C:\blackbox\" set for the blackbox folder, and "backgrounds\" set for the background folder. With these settings, all it produces as the picture paths are "C:\blackbox\backgrounds\" for every style except one, which has the full path to the image specified in the bsetroot: "c:\blackbox\backgrounds\image.jpg", which results in a still erroneous "c:\blackbox\backgrounds\blackbox\backgrounds\image.jpg". Tried to set "C:\blackbox\backgrounds\" as the background folder, too, results with that made even less sense.  unkamunka wrote: Longer term, it would be nice to see this made into a "true" plugin - which would require porting the code (among other things). 
I agree, it could be nice. Though I think that templatized BBI script generation would most likely be more flexible than a hard-coded preview method... a lot less efficient as well, though. 
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Tue Apr 10, 2007 10:09 pm |
|
 |
|
unkamunka
Moderator
Joined: Sun Feb 04, 2007 2:57 pm Posts: 1008 Location: austria
|
At a guess, all your styles - bar one  - have neither / nor \ in the RootCommand. Unfortunately, the code relies on those very two characters to parse the picture from the RootCommand string....... The code was set up that way to deal with image names (and sub-folders) that include spaces but do not have any switches (such as -f, -c or -t) before them.
Warning: the 0.3 version caters for only one of the two. The 0.4 version caters for both. At the moment, I can't test as I am running a recovery program on my surviving OS.
At the moment, I've got the code running fairly quickly & am looking to pare it back even further.... That _may_, however, result in a fork from the keyboard option.
I haven't touched the keyboard.rc code at all. Does it still work as intended? As I'm not much of a KeyHook user, can you give me a brief idea of how it should work.
|
| Wed Apr 11, 2007 9:48 am |
|
 |
|
pkt-zer0
BBDinosaur
Joined: Wed Feb 15, 2006 4:57 pm Posts: 249
|

unkamunka wrote: At a guess, all your styles - bar one  - have neither / nor \ in the RootCommand. Unfortunately, the code relies on those very two characters to parse the picture from the RootCommand string....... The code was set up that way to deal with image names (and sub-folders) that include spaces but do not have any switches (such as -f, -c or -t) before them. I think all of the styles having a wallpaper image use "bsetroot -full image.jpg". Don't know about all of bsetroot's commandline options, but it seems to me that such formats could be detected relatively easily, too. unkamunka wrote: I haven't touched the keyboard.rc code at all. Does it still work as intended? As I'm not much of a KeyHook user, can you give me a brief idea of how it should work.
I was slightly puzzled by what you meant there for a second.
The keyboard.rc is a generated BBI script, too (would be a BBI module now, but back when I made the original of this there was no such functionality in it) Has nothing to do with KeyHook.
So, all it does is create a frame with a bunch of buttons on it, each corresponding to a letter. When you press the button, the first config file starting with that letter is loaded, effectively "jumping" to that position in the list of styles... and that's about it. I suck at explaining such things, though, so you might want to try it yourself.
_________________ Dislike the lack of documentation for bb4win? You have the power to change this... Help out on the bb4win wiki.
|
| Wed Apr 11, 2007 11:18 am |
|
 |
|
unkamunka
Moderator
Joined: Sun Feb 04, 2007 2:57 pm Posts: 1008 Location: austria
|

Thanks for the breakdown on the keyboard option. That gives some alternatives.
pkt-zer0 wrote: I think all of the styles having a wallpaper image use "bsetroot -full image.jpg". Don't know about all of bsetroot's commandline options, but it seems to me that such formats could be detected relatively easily, too. Most of what seems to be around for d/l these days reads "backgrounds/<name of image>.<type of image>". <name of image> can be anything - including having one or more spaces in the name (which is also true of style names) - & folks can also swap in their own choice of wallpaper. String parsing (aka finding which type of needle is in a haystack & where exactly it is) is similar to guessing in the dark. Also, some languages are better than C# at this. Basically you can only guess one character's position at a time, and if a character appears more than twice in a string, you have to guess recursively. When it comes to spaces, life's too short....
Now that the code is catering for the background colour choices - where the image doesn't cover the full screen - there are an awful lot more parameters in play. Factoring in the 16 forms of "-gradient", the 3 places where "-vdesk" can appear, the 4 different ways that colours are expressed (and other things) makes producing lean code fairly challenging. 
The short version of how the 0.4 version code finds an image name is that it searches for a "/ or a "\". All characters after the first "/" or "\" up to three characters after the first "." after that are treated as an image name. That image name is then tacked onto the end of the contents of the Backgrounds TextBox. (If the Backgrounds TextBox does not have a colon, then the contents of the BB Path TextBox are tacked on to the front of that.)
If someone has all their style files in the format -full <name of image>.<type of image>, a decent text editor should let them do a global search & replace to swap in "-full backgrounds/" for "-full " & swap it back out again if they don't want to keep it. 
You can access a fairly complete list of the bsetroot switches by clicking on bsetroot.exe.
|
| Wed Apr 11, 2007 5:32 pm |
|
 |
|
Google
Sponsored Links
|
|
 |
|
Who is online |
Users browsing this forum: nkrlfiief and 1 guest |
|
You cannot post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|