[fpc-devel] Chosing a graphical interface for specific proposals

luciano de souza luchyanus at gmail.com
Tue Oct 26 16:18:05 CEST 2010


IUP 2.x are not compatible with screen readers. The reason is the
excessive usage of Canvas Draw. I did a large number of tests with IUP
and Lua and I can assure IUP 3.1 and 3.2, the last version, are very
good so in Linux as in Windows. For this reason, I would like to
translate IUP 3.2.

Yes, we can find lots of "define", but I find a problem seeming to be
more complicated.

See this declaration in C:

ihandle* IupVbox(ihandle *child, ...)

IupVbox is a vertical container wich can encompass several objects, so
it's not possible to know how many arguments it will contain.

Here, an example in C. If a translation of IUP is done, the sintax
will be similar.

#include <iup.h>

int main(int argc, char **argv)
{
ihandle button1, button2, button3, label1, hbox1, vbox, dlg;

IupOpen();

// Creating the controls
button1 = IupButton();
button2 = IupButton();
button3 = IupButton();

// Setting their attributes
IupSetAttribute(button1, "TITLE", "Button 1");
IupSetAttribute(button2, "TITLE", "Button 2");
IupSetAttribute(button3, "TITLE", "Button 3");

// Packing the controls into a vertical box
hbox1 = IupHbox(button1, button2, button3, null);
vbox1 = IupVbox(Iuplabel("Label 1"), hbox1, null);

// Building the window
dlg = IupDialog(vbox1);
IupSetAttribute(dlg, "TITLE", "Program for test");
IupShowXY(dlg, iup_CENTER, iup_CENTER);
IupMainLoop();
IupClose();
return 0;
}

This is a simple example. Using templates in LED (Dialog Specification
Language) and other IUP features, we can reduce the quantity of code
and become easier the assignment of attributes.

But you can see. "..." in C, defining a variable number of arguments
is something complicated. In Pascal, we probably work with arrays. I
don't know how to translate it.

Is it simple? As I told you, IUP would be the best solution since I
understand it.


2010/10/26, Sven Barth <pascaldragon at googlemail.com>:
> Am 25.10.2010 19:12, schrieb luciano de souza:
>> 7. IUP - It fulfills all the requirements. Previous experiences using
>> Lua and IUP, graphical tool kit developed by brazilian reseachers,
>> shows  excelent results. Graphical interfaces can be created by blind
>> programmers, without any coordenate, using only containers. The work
>> can be done as in Windows as in Linux. IUP seems to be the perfect
>> solution.
>>
>> However, IUP was not ported to Object Pascal and, having contacted the
>> developers, he said this won't be done. The alternative could be to
>> translate the C headers of IUP, producing the respective units Pascal.
>> I have tried to do it using H2pas. But after the process, the unit
>> contained errors. And the correction of these errors would probably
>> require a large background in C programming.
>>
>> Finally, I ask: does someone have an idea what can I do? Does someone
>> know other interfaces container based compatible with Pascal? If I
>> decided to port IUP to Pascal, wich kind of knowledge should I have?
>>
>> IUP is available for C and Lua programmers. Perhaps, adopting C or Lua
>> I could obtain earlier results. Yes, I regard seriously it. But if the
>> investment was not endless, I prefer to look for a Pascal solution. If
>> I am successful in my project, I will write a manual for blind
>> programmers.
>
> The include files look rather simple so far. The errors might be because
> of the many #define in the header files, but those could be converted
> manually as well. I'll try to test some of the files with h2pas by
> myself and see what the errors are. Then I can give you the needed
> knowledge for corrections, so that you can finish the headers yourself. :)
>
> Do you want to use version 2 or 3 of IUP?
>
> Regards,
> Sven
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>


-- 
Luciano de Souza



More information about the fpc-devel mailing list