|
|
Thanks Mike.
It was easy to port this example to C.
It works fine.
|
|
|
|
|
hi all,
can anyone please tell me how to set font for menu items??? Can I set my own font for menu items?? Kindly help me.
thanks!!
ramya.
|
|
|
|
|
I don't recommend changing the font on menu items (Users pick these fonts through the appearance manager and you have no right to be going around changing them).
That said, if you are desperate (idiot managers pushing you to do so) you can create an owner drawn menu, and implement the DrawItem function to select and use whatever font you like. You'll have to implement MeasureItem as well to decide the height of menu items.
There are about 7 billion custom menu implementations out there. Grab one and get to work.
|
|
|
|
|
Anonymous wrote:
(Users pick these fonts through the appearance manager and you have no right to be going around changing them).
Funniest thing I've read all week. I guess Microsoft better go ripping the chapters for owner draw menus out of their MFC and Windows programming books right about now then!
I hope you were joking!
|
|
|
|
|
He (or she) wasn't joking. Ownerdraw menus are for the purpose of adding graphical bits to menu's who's purpose is to select something visual. They are not to encourage programmers to choose what _they_ think is a cool new menu font. The fact that you _can_ do something doesn't mean you should.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I think that a big asset to windows and MFC is the fact that you don't have to follow standardized ui and font schemes.
Good thing we don't program for a framework that forces you to conform, what a boring world it would be.
Just look at KDevelop linux programming with GTK, that's a whole new level of boring conformity, unless you make your own custom widgets and menus from scratch.
You can't even C++ style subclass GTK widgets at all. You can only psuedo subclass them with C
|
|
|
|
|
A consistent user interface is a good thing. Those who can not remember the past are condemned to repeat it.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I agree with Blake.
Software that fails to conform with my expectations gets junked. It's a little rule known as "The Path of Least Astonishment". You never do anything in an application that the user does not expect, and this includes changing the user interface unnecessarily.
What happens if you use some sort of "cool" font not installed on my system? (And BTW, I don't want "cool" fonts installed on mine)
What happens if I have specific disability settings, and your code doen't manage them properly - would you doom a blind or partially sighted person to not being able to use your application, because you decided that your groovy interface was more important than having an application that everyone can use.
Don't be so bloody arrogant. You might find it boring, but then again, I want applications that I can just get on and use, not have a million and one applications with their own conflicting ideas on what my user experience should be. Who is more important - your users, or your ego?
The framework doesn't force you to conform because there are occasions you need to break it. Looking groovy isn't one of those occasions!
One reason for using a framework is to reduce development times. Why then increase it by pissing about owner drawing your menus?
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
you can just bitmap the menu items and draw that instead, then they don't have to have the font installed.
As for blind people, well, I guess they can't use it, but there are already so many applications they can use that I doubt it would make a big difference with a few owner draw apps out there.
Maybe microsoft should consider making DirectX 3D Visually impaired compatible too if we're going to go down the road you describe.
|
|
|
|
|
Beer26 wrote:
you can just bitmap the menu items and draw that instead, then they don't have to have the font installed.
So people who use large fonts? Maybe you could StretchBlit your menu items to the larger size so they look inconsistent and crap!
Beer26 wrote:
As for blind people, well, I guess they can't use it, but there are already so many applications they can use that I doubt it would make a big difference with a few owner draw apps out there.
So your application is probably being done better elsewhere, because I would suggest that people considering disabilities probably develop more usable software anyway.
Beer26 wrote:
Maybe microsoft should consider making DirectX 3D Visually impaired compatible too if we're going to go down the road you describe.
You fail to appreciate the difference between an application that is primarily visual (ie, a lot of games), and an application that does not need to be visual at all (just about everything else). There are also people who have written games designed to be played as an aural rather than visual experience. Like this guy, in fact:
http://student-kmt.hku.nl/~audiogam/ag/articles/chrislewisinterview01.htm[^]
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Ian Darling wrote:
Maybe you could StretchBlit your menu items
I didn't mention anything about StretchBliting, If the draw rect is bigger, you draw the real size and center it, and screw their large font settings.
I'm personally sick of the windows standard ui, and if it didn't take so much longer to do owner draw I would do it alot more.
As a matter of fact I will be doing it alot more even though it takes a little extra effort.
|
|
|
|
|
Beer26 wrote:
screw their large font settings
And that sums up entirely what is wrong with your attitude towards application development.
Maybe you should go read some books on user interfaces, like GUI Bloopers or The Inmates Are Running The Asylum.
Then you'll (hopefully) appreciate what an asinine, and quite frankly, appalling, attitude towards users you have there.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
hi all,
If it's going to be difficult to set font for the menu items.........i would like to switch to a Popup ListBox containing list of items that i want to display....in that case how do i popup a ListBox on right click??? Currently im using an AutoRichEditCtrl where i would like to popup a ListBox containing set of items.....
Can anyone please help me...
thanks!
ramya.
|
|
|
|
|
Hi,
Thanks for ur responses.......as the GUI is for different set of users who might not know english and hence the menu items should be in their own language...that is why i got to set new font for menu items....
ramya.
|
|
|
|
|
Well, start here for some info that might be useful regarding character sets:
http://www.joelonsoftware.com/articles/Unicode.html[^]
In fact, IIRC JoS has a few articles that deal with developing for multiple langauges.
As long as you write your software with internationalization in mind (sometimes referred to as "i10n" or "i18n" - try googling those terms), you shouldn't need to worry about the specific fonts - as users in different languages will have the appropriate (unicode) font set themselves anyway!
I don't know of any developer that internationalizes their software in a manner that requires a new font being used instead of the systems default fonts.
HTH.
[EDIT] Just a thought - this still applies, even when the base operating system is set as English - at least on 2000/XP, as I seem to recall it's poosible to have multiple language bases installed. [/EDIT]
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
Ian Darling wrote:
sometimes referred to as "i10n" or "i18n"
Internationalisation is always 'i18n' - there are 18 characters between the leading i and the trailing n. Internationalisation normally refers to the process of stripping out any language- or culture-dependent behaviour from the application, using the user's preferred language and culture.
l10n (not i10n) is Localisation (again, 10 characters between l and n), the process of taking an internationalised application and creating the appropriate resources to adapt it for a particular culture.
I seem to recall it's poosible to have multiple language bases installed.
What, you mean the Multilingual User Interface[^]?
Microsoft's Global Development Portal[^] is a good start for anyone needing to write an international application.
|
|
|
|
|
Mike Dimmick wrote:
Internationalisation is always 'i18n' - there are 18 characters between the leading i and the trailing n.
Mike Dimmick wrote:
l10n (not i10n) is Localisation (again, 10 characters between l and n),
I must have misread the 'l' in l10n as 'i' - I thought that the 18 and 10 might have had something to do with the number of languages being translated, 18 being a bigger and more complex job because you would include arabic, hebrew, japanese and chinese scripts, on top of a load of mostly straightforward left-to-right european dialects (being the original 10).
Learn something new every day
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
I posted this twice earlier, no responses. They got buried in a few pages of messages.
I have classes car, street, building and static world. The car, street, and building are created and modified and "exist" in the world object. Here is my post (after posting a question about how to create global class objects):
I declared a global static class world, and it was indeed available to all objects. Thank you for the advice. Eventually I'll do the singleton method. The only problem now is, for some reason, objects are incapable of modifying public attributes or calling public methods of the global class.
Lets go back to my example. Before I had the global class, when constructing a "building" object, I had to pass it the myworld object constructor. The constructor would initialize certain variables, and call some initializing member functions. It would also call a member function of the myworld object, that would essentially(on the myworld object side) just increment the building count attribute of the world class. Before and after building object construction, I cout'ed myworld object's building count. It didnt change.
Now, with the static global object myworld, the results are the same. Myworld just refuses to change. Building has been made a friend class to the world class. In fact, nothing is private in the world class.
Just to check my coding, I called world class member functions and modified building counts directly from the main function, and it worked. It just doesnt seem to want to be modified by another object.
Any ideas?
|
|
|
|
|
I suspect the reason no one has responded is that your problem is clearly not where you think it is. The situation you are describing isn't the case, a public method on a static object that you've tested from main can certainly be called and work from a member of some other class.
The real problem is something you haven't mentioned in your question, because you don't know about it. It's pretty much impossible to guess what that might be given your description.
Try boiling it down, come up with the smallest set of code that exhibits the problem that's plaguing you. Sounds like you should be able to express it in 10 lines of code or less. Don't use your existing code, cut it down to just an example of the problem - two classes, one static and one not.
Once you've done that, if you haven't already spotted the problem, post the code and I'm sure someone will help you.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hello, everyone!
I want to get all the handles of opened msword windows on the local machine. And then send message to close them. I have no experience on FindWindow function before and the two parameters of this API make me puzzled. Are there some sample codes that I can make a reference?
BTW: Can I get the how long a specified window have been opened?
I am using VC++ 6.0.
Thanks in advance,
Geo
|
|
|
|
|
|
Thanks, Anthony_Yio buddy!
I will take some time to see the source codes of this project.
regards,
Geo
|
|
|
|
|
Is there a way to write up a littl C code in .NET or V6 and be able to look at the assembly code that it produced after it compiled?
|
|
|
|
|
Easy -- set a breakpoint at the beginning of the code you want to view the assembly for, execute the program in debug mode, then when the breakpoint is triggered, right-click on the statement and select "Go To Disassembly". (This is for VS.NET 2K3).
- Mike
|
|
|
|