Right-To-Left language support?!
Right-To-Left language support?!
Hello All.
I think i am missing somthing here.
I have this application i want to code in Hebrew which is a right to left language, and it finally hit me - the menus are in the wrong position
the problem is with menus, listicongadget and all those gadgets .
Now i dont know what to do, i cant make the application in english.
Is there anyway i can make the whole app in a LOCAL mode?!
Please if you know anything in the subject write a comment, anything helpful will do.
Thank you.
Pantcho.
I think i am missing somthing here.
I have this application i want to code in Hebrew which is a right to left language, and it finally hit me - the menus are in the wrong position
the problem is with menus, listicongadget and all those gadgets .
Now i dont know what to do, i cant make the application in english.
Is there anyway i can make the whole app in a LOCAL mode?!
Please if you know anything in the subject write a comment, anything helpful will do.
Thank you.
Pantcho.
The language fonts are okey, you can put any font you wish to any gadget of course but it is the position of the menus.
For example if a windows menu is diaplayed in the top left corner of the window in localized applications the menu start in the right top window corner.
2nd example is ListIconGadget which in localized languages the first field you enter like "field1" + chr(10) + "field2" the field2 if presented first because of the localization of the app.
there must be a way, even a suggestion will be nice.
Thank you.
For example if a windows menu is diaplayed in the top left corner of the window in localized applications the menu start in the right top window corner.
2nd example is ListIconGadget which in localized languages the first field you enter like "field1" + chr(10) + "field2" the field2 if presented first because of the localization of the app.
there must be a way, even a suggestion will be nice.
Thank you.
Yes, all software made in my hebrew language are in oppsite directions.
I personally never program in my mother language, but when you do know to programming but you cant localize it, that is very distrubing
there for i searched and downloaded a few examples and screen shot them.
ListIconGadget Example:

ListViewGadget Example:

And most important MenuBar example:

ANY help/thoughts/advices will be great.
Thank you.
Pantcho.
I personally never program in my mother language, but when you do know to programming but you cant localize it, that is very distrubing
there for i searched and downloaded a few examples and screen shot them.
ListIconGadget Example:

ListViewGadget Example:

And most important MenuBar example:

ANY help/thoughts/advices will be great.
Thank you.
Pantcho.
@pantcho:
is this waht you are looking for? (same for windows?)
is this waht you are looking for? (same for windows?)
Code: Select all
; -------- by va!n --------
#MB_RIGHT = $80000
#MB_RTLREADING = $100000
MessageBox_(0,"Test","Text from right to left",#MB_RIGHT|#MB_RTLREADING )
MessageBox_(0,"Test","Text from right to left",#MB_RIGHT )
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
@pantcho:
afaik its not so easy to do with PB commands, because stuff like scrollbar on left are API constants you have to use and i dont know if there is an easy way using SendMessage_ or something like this to change the flags of a window/control. when having next days some more time, i will try what i can do for you to solve the problem.
afaik its not so easy to do with PB commands, because stuff like scrollbar on left are API constants you have to use and i dont know if there is an easy way using SendMessage_ or something like this to change the flags of a window/control. when having next days some more time, i will try what i can do for you to solve the problem.
va!n aka Thorsten
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
no support at all 
Only for Listview via Tabstops
For Other gadgets , i would prefer using Spaces in front of strings

Only for Listview via Tabstops
For Other gadgets , i would prefer using Spaces in front of strings
Code: Select all
;;
; Right align with gadgets
; first atempt for ListView with tabstops
;
; done by Siegfried.Rings 2 use in Purebasic (c) 2006
;
;
Procedure GadgetAlignRight(Gadget)
hwndListview= GadgetID(Gadget);get hwnd for gadget
result=SendMessage_(hwndListview,#LB_SETTABSTOPS,0,0) ;first set 2 NULL
;now calculate the distance from left 2 right
rc.RECT
GetClientRect_(hwndListview, @rc)
hDC = GetDC_(hwndListview)
If hDC
hFont = SendMessage_(hwndListview, #WM_GETFONT, 0, 0)
hFontOld = SelectObject_(hDC, hFont)
sChars.s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
sz.size
If GetTextExtentPoint32_(hDC, sChars, Len(sChars), sz)
cxAvLBChar = sz\cx / Len(sChars)
cxDlgBase = GetDialogBaseUnits_()
cxDlgBase =cxDlgBase & $FFFF
CalcPixelsPerDlgUnit.f = (2 * cxAvLBChar) / cxDlgBase
EndIf
SelectObject_(hDC, hFontOld)
ReleaseDC_(hwndListview, hDC)
EndIf
If CalcPixelsPerDlgUnit=0
ProcedureReturn
EndIf
value= - ((rc\Right - rc\Left)/CalcPixelsPerDlgUnit)
result=SendMessage_(hwndListview,#LB_SETTABSTOPS,1,@value);set tabstop
InvalidateRect_(hwndListview,0,-1);invalidate winbdow 2 redraw
EndProcedure
If OpenWindow(0, 0, 0, 270, 240, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
#Listview=0
ListViewGadget(#Listview, 10, 10, 250, 120,#LBS_USETABSTOPS);note the additional flag !
For a = 1 To 500
AddGadgetItem (#Listview, -1, Chr(9) + "Item " + Str(a) + " of the Listview") ;
Next
SetGadgetState(0, 9)
GadgetAlignRight(#Listview)
#Button=1
ButtonGadget(#Button, 10, 130, 180, 30, "right Button",#PB_Button_Right)
#Text=2
TextGadget(#Text, 10, 170, 180, 30, "right text",#PB_Text_Right)
#Checkbox=3
CheckBoxGadget(#Checkbox,10, 200, 180, 30, "right Checkbox",#PB_CheckBox_Right)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
SPAMINATOR NR.1
Absolutely untrue..Rings wrote:no support at all
Code: Select all
SetWindowLong_(GadgetID(Listview_0),#GWL_EXSTYLE,#WS_EX_LAYOUTRTL|0)
for the window:
Code: Select all
SetWindowLong_(WindowID(window_0),#GWL_EXSTYLE,#WS_EX_LAYOUTRTL | 0);#WS_EX_TOOLWINDOW)
SetWindowPos_(WindowID(window_0), 0, -1 , -1, -1, -1, #SWP_NOSIZE | #SWP_NOMOVE | #SWP_NOZORDER | #SWP_FRAMECHANGED | #SWP_SHOWWINDOW)
Thanks Rings for you detailed example! i apperciate it alot!
And va!n to you too
and damn big thanks to thefool!! for showing it is possible.
I posted a little code in the tricks and tips
http://www.purebasic.fr/english/viewtopic.php?t=21840
Pantcho.
And va!n to you too
and damn big thanks to thefool!! for showing it is possible.
I posted a little code in the tricks and tips
http://www.purebasic.fr/english/viewtopic.php?t=21840
Pantcho.