xProgrammer - help please

Post Reply
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

xProgrammer - help please

Post by MGA »

xProgrammer - help-me please!

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

:(
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: xProgrammer - help please

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
MGA
Posts: 1219
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá
Contact:

Re: xProgrammer - help please

Post by MGA »

thanks
ubiratanmga@gmail.com

FWH17.04
FWPPC
Harbour/xHarbour
xMate
Pelles´C
TDolphin
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: xProgrammer - help please

Post 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
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Re: xProgrammer - help please

Post 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

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
Post Reply