Hi,
I have implemented 2 procedures to set the language used by Notepad at startup.
Now it selects language by using string key "Language" under HKCU\Software\Wine\Notepad.
Restore of the language functions now. But I'm new in Windows coding so I don't know which procedure is called when I click on an item in the Language menu.So saving the language in the registry is not called.The procedure is ready to use but never called.
Could someone help ?
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
On Tue, 26 Feb 2002, Sylvain Petreolle wrote:
Hi,
I have implemented 2 procedures to set the language used by Notepad at startup.
Now it selects language by using string key "Language" under HKCU\Software\Wine\Notepad.
Restore of the language functions now. But I'm new in Windows coding so I don't know which procedure is called when I click on an item in the Language menu.So saving the language in the registry is not called.The procedure is ready to use but never called.
Actually, does thi skind of functionality belong in Notepad? Doesn't Wine have some notion of the current language used by the user? Maybe even inherited from LANG? Why should notepad have its own notion of which language the user is using?
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ f u kn rd ts, ur wy 2 gky 4 ur wn gd.
--- Francois Gouget fgouget@free.fr wrote:
On Tue, 26 Feb 2002, Sylvain Petreolle wrote:
Hi,
I have implemented 2 procedures to set the language used by Notepad at startup.
Now it selects language by using string key
"Language"
under HKCU\Software\Wine\Notepad.
Restore of the language functions now. But I'm new in Windows coding so I don't know
which
procedure is called when I click on an item in the Language menu.So saving the language in the
registry
is not called.The procedure is ready to use but
never
called.
Look at the function LANGUAGE_DefaultHandle in language.c and where it is called from.
Actually, does this kind of functionality belong in Notepad? Doesn't Wine have some notion of the current language used by the user? Maybe even inherited from LANG? Why should notepad have its own notion of which language the user is using?
Sylvain noticed that the selection does not persist and is fixing the bug.
Hmm, I do not know why this functionality exists in the WineNotepad in the first place - maybe to test the languages selection functionality?
Windows application can get information about the current language with using functions GetUserDefaultLangID, GetLocaleInfo.
Then, what is the correct approach will be? Set the default language based on system settings? We can leave the language menu for now for testing purposes.
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
"Andriy Palamarchuk" apa3a@yahoo.com wrote:
Then, what is the correct approach will be? Set the default language based on system settings?
Make use of the resources.
We can leave the language menu for now for testing purposes.
LANG=en_US notepad LANG=ru_RU notepad etc. will do.
On Tue, 26 Feb 2002, Andriy Palamarchuk wrote: [...]
Then, what is the correct approach will be? Set the default language based on system settings? We can leave the language menu for now for testing purposes.
I guess this depends on whether you see Wine's notepad as: 1. a test program, primarily used by Wine developpers to test Wine 2. strictly a replacement for the Windows applet
If 1 then the menu can stay. But it could even set the system-wide notion of which language is used. If 2, then it is not necessary and should probably disappear.
Notepad is an application that is used so often that we need something to fill the role of 2. 1 and 2 need not be completely incompatible either. But I would personally lean more towards 2, and a removal of the menu. It seems to me that testing various languages would be better done by setting LANG, and even better, by writing test units.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ The nice thing about meditation is that it makes doing nothing quite respectable -- Paul Dean
--- Francois Gouget fgouget@free.fr wrote:
On Tue, 26 Feb 2002, Andriy Palamarchuk wrote: [...]
Then, what is the correct approach will be? Set
the
default language based on system settings? We can leave the language menu for now for testing purposes.
I guess this depends on whether you see Wine's notepad as:
- a test program, primarily used by Wine
developpers to test Wine 2. strictly a replacement for the Windows applet
If 1 then the menu can stay. But it could even set the system-wide notion of which language is used. If 2, then it is not necessary and should probably disappear.
Notepad is an application that is used so often that we need something to fill the role of 2. 1 and 2 need not be completely incompatible either. But I would personally lean more towards 2, and a removal of the menu. It seems to me that testing various languages would be better done by setting LANG, and even better, by writing test units.
Agree, I'm also for notepad as an application and do the testint with unit tests.
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com
Notepad is an application that is used so often that we need something to fill the role of 2. 1 and 2 need not be completely incompatible either. But I would personally lean more towards 2, and a removal of the menu. It seems to me that testing various languages would be better done by setting LANG, and even better, by writing test units.
No problem if you want to remove the menu and the key. I will modify my proc to handle the function that gets the language from the system. In this case i can drop the proc that saves the language. What functions do the retrieval o the langage ? I'm pretty young in programming windows.
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
"Sylvain Petreolle" spetreolle@yahoo.fr wrote:
I have implemented 2 procedures to set the language used by Notepad at startup.
You don't need to mess with languages manually. All resource related functions choose language automagically. Have a look at FindResource and functions which do use of it: LoadString/ LoadIcon/LoadMenu/etc.