Dykodialogs (gui routines)

Started by handsource-dyko, July 18, 2011, 06:16:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

handsource-dyko

After 3 roughly weeks of hacking and some more time thinking about it's design,  I'd like to announch my 2nd project:

"DYKO dialogs for bennugd".

It's a library that you can include in your programs, It's party written in bennu, and partly made with Freepascal's Lazarus IDE.
The library consists of external gui programs created with Lazarus, that are invoked by a bennu program. Along with the library
I also created a stand-alone version that can act as a replacement for Zenity and Kdialog. The reason I created it was that I wasn't
satisfied with Zenity on Windows 7 (64 bit version in particulair). It also didn't work well with wine. And the Malvado editor uses Zenity
for it's gui dialogs.

So I wanted something that was portable (works on Windows, Linux, Wine, and potentially FreeBsd and Mac).
The main intension is to use it in further versions of the malvado editor, but I think it can be usefull for other people's projects too.

The project is Licensed under the LGPL, so both free software and non-free software programs can use it. For more information and
downloads, you can find them here: http://code.google.com/p/dykodialogs-for-bennugd/ (you can find a sample program in the wiki section).

I hope it can be usefull, and that it solves some basic gui needs. ;)





BlackCurtain

Looks awesome. Would this work on the Pandora and Caanoo too?

handsource-dyko

#2
Maybe, if Freepascal and LCL were ported to it. But to realistic, it's quite inpractial. The LCL library uses the system's native widgets.
On windows it' s using the win32 api, on linux and unix style systems it's gtk2, and on macos it uses carbon and/or cocoa. The LCL library of Lazarus is basically a clone of Delphi's VLC library.

And, it's mainly targeted at desktop use, for use in tools. I envisioned it for use in level editors, fpg/palette tools, and utility programs made in bennu for bennu.

JaViS

Sounds very interesting, could this project to be used for creating a multi platform IDE for Bennu?
Working on Anarkade. A couch multiplayer 2D shooter.

handsource-dyko

Perhaps. It has a very basic textediting window. Lazarus is not very difficult once you get around the intristics of pascal.
If you've ever worked with Delphi, Lazarus is pretty familiar. The concept of dykodialogs is that the different programs exchage data trough ascii textfiles.

handsource-dyko

#5
I've uploaded a new version with some bugfixes and a few extra functions, since I noticed I needed to fix a few things whilst implementing it in the malvado editor.

Here's a list of changes/fixes:

(revision A) 25-07-2011:

Added a function extract a relative path from the absolute path returned by a file
dialog. This function was developed because the malvado editor uses relative paths.


(revision B) 27-07-2011:

Added a function to set the initial dir from the path of the calling program.
I.e. Malvado editor runs in an arbitrary directory, and the files are located in sub-
directory's. The file dialog that is called by mapdit has to have a initialdir depending
on the filetype, i.e. c:\malvado\lev or c:\malvado\fpg etc etc.


(revision C) 29-07-2011:

Small bugfix in dykodialogs_functions.prg at line 656, now checks for file existance, when
cancel button was pressed, dialog now returns -1, in this case file does  not exist.
Previousely the dialog would crash due to trying to read the contents of an nonexisting file.

(revision D) 07-08-2011:

Fixed return codes of the dialogs in commandline mode, now the %errorlevel% should work fine.
The list dialog(s) now output -1 when cancel is clicked.

(revision E) 14-08-2011:

Chaged the variable "filename" into "dyko_filename" to prevent naming conflicts when "filename"
is already used as a global variable by a bennugd program. Also added an itemindex feature to
the list dialog. It is supported by the listbox, checklistbox and combobox, and allows a higher
item in a list to be selected as default. A value of 0 is always safe to use, but do not specify
a number out of range, so be carefull. Also added some example scripts, in the examples folder.

The revision numbers are sourcefile revisions, the latest packages are labelled "rev B. (14-08-2011)".
Please note that some features do not work 100% in a shell script (exit status limitations), but inside
a bennu program everything should be fine.
Right know I'm working on the malvado editor, wich uses dykodialogs as gui. So, depending on my own
requirements, things may be fixed, extended or changed.

Here are some screenshots of dykodialogs in use by the current malvado editor development version:

changing the increment angle of a chain platform with a listdialog-combobox


viewing the hiscoretable editor a listdialog-stringgrid


viewing the leveltable editor a listdialog-stringgrid


editing the walking speed of a pumpkin with a nummericaldialog


viewing the resource table a listdialog-listbox


editing the text of the selected messagepoint with a memoedit dialog




link to the album: https://picasaweb.google.com/dykodesigns/DykodialogsScreenshots?authuser=0&authkey=Gv1sRgCMmm57vdqoqsXw&feat=directlink



handsource-dyko

I've made some small improvements yet again, this time on the example scripts. Also, the commandline version now creates a tempfile as additional output, see the scripts for their details. This tempfile is created to overcome some of the limitations of exitcodes and pipes, and get around a very annoying lazarus glitch on linux (it created more output then I desired). I must admit, the shell scripts kinda gave me a headache to make them work properly, I so dislike bash and the rather obnoxious syntax of shell scripts  ;D. Some suggestions on improving the scripts from linux/unix experts would be welcome. 

The testprogram now has a few more examples, also the scripts can also be found on the wiki page.

Also, I know there are some mac users with linux experience out here, I don't know how well Lazarus works on mac, but I think porting shouldn't be much harder then the usual recompile I do for the linux version.

MisterN

I should pay you to make me a level editor for my game :O jk. any tips on making a level editor? tried porting to dreamcast?
werg

gecko

Torres Baldi Studio
http://torresbaldi.com

handsource-dyko

Uploaded a preview version of malvado 1.7. with dykodialogs in action.
Version is almost complete, except for cutscene editor, wich I'm still hacking on.
All the sources are included, so you can use it as a reference on how dykodialogs is implemented/used in an real world application.

some keys: Alt-H: Hiscore table
                Alt-R: Resource table
                Alt-L: Level table


Also demonstrates how a leveleditor can be made, although it's a lot of sources with rather messy dependancies and a lot of includes.

Enjoy! ;D

http://www.megaupload.com/?d=MSW40JMG