Announcement

Collapse
No announcement yet.

Menu Set State %mf_highlite

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Menu Set State %mf_highlite

    Hi, I just tried using %MF_HIGHLIGHT mentioned in the PBWIN help and I get an undefined equate. Has anyone ever used this? Is this to turn off %MF_GRAYED?

  • #2
    MF_DISABLED Disables the menu item so that it cannot be selected, but the flag does not dim the menu item.

    MF_ENABLED Enables the menu item so that it can be selected, restoring it from its dimmed state.

    MF_GRAYED Disables the menu item, dimming it so that it cannot be selected.
    A dozen what.

    Comment


    • #3
      %MF_HIGHLIGHT , I can not find a reference to that. I do not see it in the winapi.inc or the MS SDK

      MF_HIGHLIGHT as a guess, might be the state when the mouse is over a menu item or has focus and it becomes highlighted , it would be a fired event.

      Can you be kind enough to point out where you see that in pb help ?
      Last edited by Michael Mayerhoffer; 6 Apr 2008, 11:41 PM.
      A dozen what.

      Comment


      • #4
        Is this to turn off %MF_GRAYED?
        No, to disabled the grayed appearance you must use either MENU SET STATE or SetMenuItemInfo without specifying MF_GRAYED. Simply omitting the style flag will enable the item. MF_ENABLED is zero, so it will be on by default.

        MF_HIGHLITE is under the MENU SET STATE topic in the PB/WIN 8 help file. This style simply sets the display text of the menu item to a bold font.
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          MF_HIGHLITE is under the MENU SET STATE

          Thanks for explaining what %MF_HIGHLITE does. I'm wondering why I get an undefined equate when I try to complie it. Is there an include file I can look in for these equates?

          Comment


          • #6
            Larry,

            It is not an fired even as I guessed,

            I think you are looking for %MF_HILITE and is defined, not %MF_HIGHLITE

            MENU GET STATE or MENU SET STATE when using DDT, I think if you have the correct spelling it will work.

            Either there is a %MF_HILITE and a %MF_HIGHLITE or there is missing equate , the sdk says MF_HILITE .

            If %MF_HILITE works then we will know

            Sorry for the confusion.

            -Mike
            ---------------------------

            It is a document error should be %MF_HILITE - %MF_HILITE works just fine.
            Last edited by Michael Mayerhoffer; 7 Apr 2008, 01:27 AM.
            A dozen what.

            Comment


            • #7
              Hmm, seems to be a spelling mistake in the docs

              Here's a link to the definition for the menu item structure direct from Microsoft:

              MENUITEMINFO Structure ()
              kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

              Comment


              • #8
                Kev
                we posted at the same time It is a document error should be %MF_HILITE

                from the SDK under

                HiliteMenuItem

                MF_HILITE Highlights the menu item. If this flag is not specified, the highlighting is removed from the item.
                Last edited by Michael Mayerhoffer; 7 Apr 2008, 01:23 AM.
                A dozen what.

                Comment


                • #9
                  Code:
                  ' myprogram.bas
                  #INCLUDE "WIN3API.INC" 
                  
                  #IF NOT %DEF (%MF_HIGHLIGHT) 
                    %MF_HIGHLIGHT =  %MF_HILITE
                  #ENDIF
                  
                  ..
                  .. any existing code using %MF_HIGHLIGHT

                  Or I guess you could just do a global search and replace.
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    MF_HILITE Mystry solved.

                    Yes, I had suspected it was a documentation error but didn't know how to go about proving it. %MF_HILITE does work. It Places the menu item under high lighting like when you select text. Might come in useful.

                    Thanks everyone for the info.
                    Larry

                    Comment


                    • #11
                      MENUITEMINFO Structure

                      Something else I learned from these postings from Kev is that these equates are really just another definition of the MSF equates. Makes me wonder why they weren't used in the first place? Now I know where to find some additional documentation.

                      Comment


                      • #12
                        Larry,

                        They are taken from the Win32 SDK (Windows Software Development kit commonly referred to as "Windows API" or just "API"), which handles all low level interaction. The DDT MENU commands call the SDK functions underneath which is why it uses the same equates - they are the same and not redefinitions.

                        Yes, MSDN is the most up to date source for SDK information. A quick tip: use Google with the function name or equate (do not prefix % in your search, as that is for PB only, so you'd search for "MF_ENABLED" and not "%MF_ENABLED") and it will quickly bring up results. Google is better because the MSDN search function is sorely lacking, slow, and usually shows non-relevant results.
                        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                        Comment

                        Working...
                        X