Page 1 of 1

xProgrammer - help please

PostPosted: Fri Feb 26, 2010 9:41 pm
by MGA
xProgrammer - help-me please!

@ 10,10 @ var get ooget nVal picture "@ E 999,999.99" RIGHT <--- RIGHT is possible??

:(

Re: xProgrammer - help please

PostPosted: Fri Feb 26, 2010 11:49 pm
by Antonio Linares
SGS,

It is not implemented yet in FiveLinux.

If you review FiveLinux.ch you will see that such clause is not implemented yet.

Re: xProgrammer - help please

PostPosted: Sat Feb 27, 2010 11:16 am
by MGA
thanks

Re: xProgrammer - help please

PostPosted: Sun Feb 28, 2010 3:37 am
by xProgrammer
Hi SGS

Just at the moment I am stranded away from any FiveWin documentation so I am not certain what the RIGHT clause is for. My guess is that it is for aligning the contents of the FiveWin GET within the entry on a dialog? And you want the same behaviour for a GTKEntry in a FiveLinux dialog?

The way FiveLinux works (from memory) is that it basically intercepts keystrokes from the GTKEntry, uses that keystroke to update its own buffer, and then writes the contents of its buffer (in it entirety) to the GTKEntry.

One less than perfect way would be to modify that code so that the buffer is always the same length (presumably using PadL) but that will not give you the level of control you really want as it won't be directly aligning the text in the GTKEntry and so the results will be affected by the width of the string (variable due to variable character widths) and the width of the GTKEntry.

I haven't tried to control text alignment within a GTKEntry but I have done so successfully for a SAY (GTKLabel). When I get somewhere I can look out the code I did that with I will post it. I am not promising that you can do the same with a GTKEntry as I would have to look at what GTK object this alignment code related to and whether the GTKEntry class inherits from that class or, if it is through an interface, implements that interface.

I do recall that alignment was controlled by two floats, one for the x-alignment, the other for the y-alignment. I know I discussed this issue in part on a bit I wrote for the FiveLinux section of the FiveTechSoft wiki.

Good luck. Let me know if I have understood what you want correctly or not. Either way I will try to help more if I can be of help.

Regards
xProgrammer

Re: xProgrammer - help please

PostPosted: Thu Mar 11, 2010 10:22 pm
by xProgrammer
The function I wrote will only work for labels because it calls a function in GTKMisc which is a parent of GTKLabel but not of GTKEntry.

However there is a similar function for a GTKEntry but it controls horizontal positioning only (which is what I think you want) avaible from GTK+ 2.4 on.

Code: Select all  Expand view
gtk_entry_set_alignment ()

void                gtk_entry_set_alignment             (GtkEntry *entry,
                                                         gfloat xalign);

Sets the alignment for the contents of the entry. This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry.

entry :
    a GtkEntry

xalign :
    The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts

Since 2.4


I don't know if you are still pursuing this issue, or for that matter that I have understood exactly what you want, but if you do need some help implementing the above let me know

Regards
xProgrammer