how to make a fill-in widget right aligned for integer value

Posted by Admin on 18-Feb-2007 22:32

hello,

i want to enter numeric value in fill-in widget and it should right aligned while entering.

All Replies

Posted by Alon Blich on 19-Feb-2007 07:20

Nothing specifc to adm ...

/* windows constants */

&scoped GWL_EXSTYLE -20

&scoped WS_EX_LEFT 0

&scoped WS_EX_RIGHT 4096

define var iFillIn as int no-undo.

form

iFillIn

with frame fMain side-labels three-d.

view frame fMain. /* realize widget */

run setWidgetAlign(iFillIn:handle, "right").

update iFillIn with frame fMain.

procedure setWidgetAlign:

define input param phWidget as widget no-undo.

define input param pcAlign as char no-undo.

if pcAlign = "right" then

run SetWindowLongA (

phWidget:hwnd,

,

).

else

if pcAlign = "left" then

run SetWindowLongA (

phWidget:hwnd,

,

).

else return error.

end procedure. /* setWidgetAlign */

procedure SetWindowLongA external "user32.dll":

define input param hWnd as long.

define input param nIndex as long.

define input param dwNewLong as long.

end procedure. /* SetWindowLongA */

Hope this helps.

Posted by Admin on 19-Feb-2007 22:15

thank you .

Posted by Admin on 21-Feb-2007 23:29

thank u for u r reply ,

but this code is not working . Is this code need some environment setting .

currently i am working on windowxp .

if possible reply.

Posted by Alon Blich on 22-Feb-2007 04:05

Works for me. 10.0B and XP (I've also got support for right-to-left languages installed, may be related ?).

Try the code as-is before using it with ADM.

What do you mean by not working ? are there any errors ?

Maybe someone could also try the code and see if it works.

Posted by kevin_saunders on 22-Feb-2007 04:31

Interestingly, it doesn't work on 10.1A01 on XP SP2. Works on 10.1B on Vista, however which makes me think it is a bug in 10.1A01..

Kevin

Posted by Alon Blich on 22-Feb-2007 04:54

Thank you Kevin,

But if it was an API bug in 10.1A it would have probably showed up in many other places, Win API's, 3rd party tools etc. right ?

Maybe it's a regional settings issue that requires having right-to-left language support installed ?

I tried the code with 9.1C, 9.1D and 9.1E on Win 2000 and XP (all have right-to-left language support installed) and seems to be working.

Posted by kevin_saunders on 22-Feb-2007 05:07

Hmm.. Yeah, one would expect that an API bug would show up in other places.

How do I tell if there is right-to-left language support installed (is that a Windows thing?)?

Posted by Alon Blich on 22-Feb-2007 05:37

Yes. I think, it's an optional Windows installation component, so it probably wouldn't be installed if it wasn't needed.

In the Control Panel > Regional and Language Settings, Under the Languages tab, Supplemental Language Support section, there should be a something, something ... right-to-left languages ... checkbox.

BTW if you run the code and right-click the fill-in is there a Right to Left Reading Order item in the popup menu ?

Posted by Alon Blich on 22-Feb-2007 05:48

Kevin,

Could you try replacing the preprocessor used in the setWidgetAlign procedure with 4096 + 8192 + 16384 meaning WS_EX_RIGHT BIT-OR WS_EX_RTLREADING BIT-OR WS_EX_LEFTSCROLLBAR.

Posted by kevin_saunders on 22-Feb-2007 06:01

There is a Right to Left Reading Order option on the Vista machine, but not the XP machine, which is probably why the code works on one and not the other (sorry Progress developers ).

Replacing the preprocessor results in the Vista machine having a check next to the menu item, but no change on the XP machine (still left-to-right).

Posted by Alon Blich on 22-Feb-2007 06:14

There is a Right to Left Reading Order option on the Vista machine, but not the XP machine, which is probably why the code works on one and not the other (sorry Progress developers ).

Then it is a regional settings issue, probably.

I think, the R2L support could be installed from the control panel (the installation disc would be needed). But it would probably be way too much for a such a small cosmetic feature. There's probably other ActiveX controls that will let you do that. Sorry.

Posted by Admin on 22-Feb-2007 08:01

code is running without any error.

But it showing fill-in with left alignment.

R2L is not installed on my system .

Posted by Alon Blich on 22-Feb-2007 08:45

Sorry I can't be of anymore help.

PS if any of my R2L language friends (like Hebrew, Arabic, and Persian) are looking for I18N consulting feel free to contact me privately.

And if anyone at Progress is interested in adding support for the bi-directional algorithm I'd be happy to share code and any experiences I've had. I've always found it hard to read Hebrew Progress messages (PROMSGS) left-to-right on UNIX installations, though I've gotten quite skilled at it

This thread is closed