Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » Applications created with U++ » drawing toy ( sort of )
drawing toy ( sort of ) [message #23221] Wed, 30 September 2009 22:09 Go to next message
g6b0r is currently offline  g6b0r
Messages: 11
Registered: August 2009
Promising Member
hi U++ folks,

please find my small experiment from sourceforge.
from here: http://sourceforge.net/projects/griddraw/
it is a way for me to explore some of the features of U++.
I know my code is messy and sort of, but please leave me some feedback on this.
Thanks.

g6b0r
Re: drawing toy ( sort of ) [message #23222 is a reply to message #23221] Wed, 30 September 2009 23:15 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello g6b0r

Thank you for your code.

The program interface is naļve, but it seems that is the goal of the program:
the most simple interface and the best results

Perhaps some simple things I would add are:
- Internationalization
- Include help hints when moving the mouse over the buttons (very easy in Upp)
- Button to include pictures. Perhaps the program could have some predefined

Best regards and thank you again
Koldo


Best regards
IƱaki
Re: drawing toy ( sort of ) [message #23248 is a reply to message #23222] Sun, 04 October 2009 20:43 Go to previous messageGo to next message
g6b0r is currently offline  g6b0r
Messages: 11
Registered: August 2009
Promising Member
Thanks for the feedback.

I am adding internationalization.

What is the way to force language set inside the application if the user changes from one to other?
For instance, how the tooltip text can be set to one language from another?

thanks,

g6b0r
Re: drawing toy ( sort of ) [message #23249 is a reply to message #23248] Mon, 05 October 2009 09:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello

It is very simple:

- Add a language variable in your application class, like "int lang;"
- Use serialization and include that variable
- In the beginning of the program after serialization set the language to use with SetLanguage
- Add an option in your program to set the language for the next time the program is opened

A good example is example/HomeBudget

Best regards
Koldo


Best regards
IƱaki
Re: drawing toy ( sort of ) [message #23250 is a reply to message #23249] Mon, 05 October 2009 12:23 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
koldo wrote on Mon, 05 October 2009 10:58

Hello
- Add a language variable in your application class, like "int lang;"
- Use serialization and include that variable
- In the beginning of the program after serialization set the language to use with SetLanguage
- Add an option in your program to set the language for the next time the program is opened



or you could use GetSystemLNG() to get system language and use it instead of serialization of custom language. I usually set language once for entire system and applications should use that one. I think this is the "good way" because i don't want to configure each application which language to use Smile
Re: drawing toy ( sort of ) [message #23252 is a reply to message #23250] Mon, 05 October 2009 13:26 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello Andrei (sorry g6b0r)

What is the way to know the list of languages available for a program?

This way to populate a droplist with the available languages it would not be necessary to change the program if a new language is added, so something like

dlg.lang.Add(0, "English").Add(1, "Czech");

would not be necessary.

Best regards
Koldo


Best regards
IƱaki
Re: drawing toy ( sort of ) [message #23254 is a reply to message #23252] Mon, 05 October 2009 15:06 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
Hi Koldo,
I'm thinking at doing something like
GUI_APP_MAIN
{
    SetLanguage(GetSystemLNG());
    // ...
}


and you don't have to put the user to choose which language the program use. If you have a translation for program and the system language match translation language my program will use that language else it will use the default one (which is passed to t_() and which is english). You may provide external translation files *.tr and use them without changing any line of code. I think a good application should not let the user choose which language to use and instead get the language from system and use that language and if you don't have a translation file for the chosen language, use english.
Re: drawing toy ( sort of ) [message #23255 is a reply to message #23221] Mon, 05 October 2009 15:42 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Why is that good? If the user is just visiting that country and actually doesn't speak that language, he can't switch it?
I can see why it is a good default choice, but I think it's bad to not allow to change it easily.

Also I prefer English version always for myself. I don't understand some common czech/slovak translations of computer words, while I have no problems to understand english application.
Re: drawing toy ( sort of ) [message #23257 is a reply to message #23255] Mon, 05 October 2009 20:01 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
mr_ped wrote on Mon, 05 October 2009 16:42

Why is that good? If the user is just visiting that country and actually doesn't speak that language, he can't switch it?



If a user visit a country and doesn't speak that language he/she will change the language for entire system not just for an application. Simple is better. Smile For example: if i have more than 10 applications made by other U++ programmers from this forum and all these applications have language switching implemented as a user choice in application and a friend of mine from Germany visits me for one week and i let him using my PC than he will have to switch language to German individually for every application he use. I think it's better to change once the system language and then the application to use system language instead of changing language in every application.
Andrei
Re: drawing toy ( sort of ) [message #23258 is a reply to message #23257] Mon, 05 October 2009 21:09 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Quote:


mr_ped wrote on Mon, 05 October 2009 16:42


Why is that good? If the user is just visiting that country and actually doesn't speak that language, he can't switch it?




If a user visit a country and doesn't speak that language he/she will change the language for entire system not just for an application. Simple is better.


I agree with mr_ped on this... For example on my system there is only czech and english locale installed, so my German friend has no choice... But even if he doesn't speak any of those languages, I should be able to switch the application into German for him. I would probably not install full German locale just because he needs to use one application. Simple is better Wink

PS: That said, I agree that automatic detection should be primary way to setup language. Just saying that there should be a choice in configuration or somewhere.

[Updated on: Mon, 05 October 2009 21:16]

Report message to a moderator

Re: drawing toy ( sort of ) [message #23259 is a reply to message #23258] Mon, 05 October 2009 21:48 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
If so, then why other programmers are not putting language selector in their applications? Because we are following some guidelines*. And it's not that hard to install a new locale on your system(and make your friend happy Smile ). It took me less than one minute(on Linux) to have my system in a complete new language. Why Firefox doesn't have a language selector (it have one for pages but not for UI), why Visual Studio doesn't have one? Because it's not normal to choose language for every application and adding language selection to an application just add complexity to user without any gain(maybe little). I'm against using language selectors in applications. An application should use system language.

*
http://techbase.kde.org/Projects/Usability/HIG
http://library.gnome.org/devel/hig-book/stable/
http://msdn.microsoft.com/en-us/library/aa511258.aspx
http://developer.apple.com/mac/library/documentation/UserExp erience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.htm l
Re: drawing toy ( sort of ) [message #23260 is a reply to message #23249] Mon, 05 October 2009 22:06 Go to previous messageGo to next message
g6b0r is currently offline  g6b0r
Messages: 11
Registered: August 2009
Promising Member
Hi Koldo,

Thanks for the useful info and different view from others too.
Meanwhile I have just added there some internationalization.
It is really easy with U++.

Cheers.

g6b0r
Re: drawing toy ( sort of ) [message #23261 is a reply to message #23258] Mon, 05 October 2009 22:07 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Hello all

I really understand everybody. I like to do:

if(program.lang == -1)
	SetLanguage(SetLanguage(GetSystemLNG()));
else
	SetLanguage(program.lang);

So the first time the program starts with the system language an the rest with the one the user has chosen.

Because of it I need an option to choose the language and I would prefer to populate it with the supported languages. But I would like to know how to find the languages included in a project .t file.

Best regards
Koldo


Best regards
IƱaki
Re: drawing toy ( sort of ) [message #23262 is a reply to message #23261] Mon, 05 October 2009 22:58 Go to previous message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
koldo wrote on Mon, 05 October 2009 23:07

Hello all
if(program.lang == -1)
	SetLanguage(SetLanguage(GetSystemLNG()));
else
	SetLanguage(program.lang);

So the first time the program starts with the system language an the rest with the one the user has chosen.


Once you've set the language manually you loose automatic change of language if you change the system language.

Quote:


Because of it I need an option to choose the language and I would prefer to populate it with the supported languages. But I would like to know how to find the languages included in a project .t file.

I don't think that is possible(or not so easy) because AFAIK U++ translations are shared with application translations. You may detect that you have multiple translations (in U++ part) but in reality your application may not provide translations to that language and it result in incomplete translation (mixed translation i think, en-us - your-lang).
Previous Topic: Port giFT (a great but abandoned P2P project) to U++?
Next Topic: Scrum Tool
Goto Forum:
  


Current Time: Thu Mar 28 10:24:00 CET 2024

Total time taken to generate the page: 0.02040 seconds