[Gambas-user] Missing feature?

Benoît Minisini gambas at ...1...
Mon Oct 19 11:22:26 CEST 2009


> On Sun, 2009-10-18 at 17:53 +0200, Benoît Minisini wrote:
> > > TextBoxes and Labels have an alignment property but DataControls do
> > > not.
> > >
> > > Is that by design? Are there plans to change it?
> > >
> > > Is there a workaround to allow the alignment of a DataControl, apart
> > > from hiding the DataControls and mirroring the data in a TextBox?
> >
> > Not really, not really. But it should be not really difficult to add it.
> >
> > The idea behind DataControl is changing the actual control used according
> > to the datatype of the field. So it just a matter of being careful that
> > not all true controls used by DataControl support an Alignment property.
> >
> > If I remember, at the moment, Number are right aligned, and other data
> > left aligned by default.
> 
> Ok, thanks. I'll put it down as a limitation :)
> 
> > > Is there any way to set the foreground and background colours of a
> > > disabled TextBox to something other than the almost unreadable colours
> > > used in the default linux colour schemes?
> > >
> > > All suggestions, other than rude suggestions, are welcome.
> >
> > Alas the behaviour of disabled controls mostly depends on the toolkit,
> > the theme used, and the colours used in the control center for KDE.
> >
> > And if setting the background (or foreground) color of a control sets its
> > colour both for normal and disabled mode, there will be no way for the
> > user to see the difference between a normal and a disabled control, which
> > is not a good thing.
> 
> I found a perfect workaround while I was working around the limitation
> mentioned above. The TextArea control doesn't change the colour of text
> when it is disabled. Instead of using the TextBox control to replace the
> DataControls, which I need to align, I now use TextArea. It looks good,
> like it should.
> 
> If TextArea isn't supposed to be like that, please don't fix it :)
> 

The cleaner way to play with the control used by DataControl is using 
DataControl.Children[0], that returns a reference to it.

Regards,

-- 
Benoît Minisini




More information about the User mailing list