PDA

View Full Version : %MF_CHECKED (Menu Equate)



marcuslee
21-03-2009, 20:03
I am assuming that the use of %MF_CHECKED is to show the toggle state of a menu item. That's how I have seen it used in other programs. Like in Excel or Word, when you display a toolbar, for example, the menu shows check marks next to the toolbars that are currently visible.

Is that the only purpose of this equate? Would you use it for any other purpose, in other words?

And, what options do you have for this equate? I ask this because the check mark on Excel doesn't look like the one TB creates. TB creates a flat check mark, and Excel creates a check mark inside an engraved square (opposite of embossed ... couldn't think of another name for it).


Mark

Petr Schreiber
21-03-2009, 21:41
Mark,

I think you can use the checked icon in TB in very similar way as in other applications.

You can give %MF_CHECKED style to menu item during the creation. Then you can check whether user clicked this item like you would do for any other control.

To check/uncheck any menu item later you can use MENU SET STATE, to retrieve current state MENU GET STATE.

ErosOlmi
30-03-2009, 16:13
Mark,

Window exposes a standard menu type that is the one exposed by thinBasic.
But Windows also allows programmers to substitute the standard drawing functions of each control with some personalized one. In this way every application can create different way of showing the same menu. Excel and all Office family applications in the many different versions have always changed the way menu were drown.

The process is called "Own Drawing". If you Google "Own Drawing menu" you will find many ways to achieve this.
Honestly I can develop some personalized kind of menu but it would be just my interpretation and many other different interpretations can be asked. So this is a kind of "programmer" decision even if I do not think an interpreter is the right kind of language where to develop an own draw menu because at some point you need to pass some pointers to your own drawing functions and this (at the moment) is not possible in thinBasic.

Ciao
Eros