[fpc-devel] Chosing a graphical interface for specific proposals
luciano de souza
luchyanus at gmail.com
Mon Oct 25 20:29:29 CEST 2010
It's really interesting. After looking for so libraries, it would be
fantastic to find a solution with tform. But, regarding everything
needs to be created only writing codes, without opening the
inaccessible interface of Lazarus, do you believe can it be done?
I give you an example using Lua.
require('iuplua')
label1 = iup.label{title = 'This is the text of label 1'}
button1 = iup.button{title = 'Button 1')
button2 = iup.button{title = 'Button 2')
button3 = iup.button{title = 'Button 3')
list1 = iup.list{'Option 1', 'Option 2', 'Option 3'; multiple = 'NO',
dropdown = 'YES', value = 2}
box = iup.vbox
{
iup.hbox{label1; border = 'NO'},
iup.hbox{list1; border = 'NO'},
iup.hbox{button1, button2, button3; border = 'NO'}
}
dlg = iup.dialog{box; title = 'Example of IUP library', gap = 5, size
= 'HALFxTHIRD'}
dlg:showxy(iup.CENTER, iup.CENTER)
iup.MainLoop()
function button1:action()
return iup.CLOSE
end
This code defines a pannel with a vertical box in wich is set three
horizontal boxes. The first one, with a label, the second, with a
combobox, and the third with three buttons. Some attributes were
defined and a callback for button1 click is also defined. And
everything only typing codes.
This is only an example. A sintax for C is also available and if it
was ported to Pascal, certainly the C sintax would prevail.
My question is: is it possible to create all the interface with tform
without using the Lazarus interfaces, in other words, only typing
codes in a text editor?
2010/10/25, JosĪ¹ Mejuto <joshyfun at gmail.com>:
> Hello FPC,
>
> Monday, October 25, 2010, 7:12:25 PM, you wrote:
>
> lds> 1. tform - it fulfills the items 1 and 3. A blind person cannot
> lds> program it. At first, because Lazarus environment is not accessible
> lds> and a blind people prefer to use only hard code without move objects
> lds> on a form. Secondly, even we adopt hard code, it's not possible to
> lds> program using tform without writing codes like: button1.left := 30.
> lds> The way blind people can program is not based on coordenates or
> lds> dimensions, but in the automatic layout management.
>
> Using a TForm you can program based in a containers style using
> alignment and anchors (advanced anchoring, not the Delphi one).
>
> So you can insert a panel with aligment top, and autosize on, now add
> a label with a caption and autosize on, now add a textbox to input
> data and anchor it to the left of the label and to the top of the
> label, so if your label is bigger the textbox is moved to the right.
>
> It is not exactly the same as GTK or other container oriented
> interfaces but it is doable.
>
> Anyway this should be more Lazarus/LCL related.
>
> --
> Best regards,
> Jose
>
> _______________________________________________
> 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