Announcement

Collapse
No announcement yet.

Question about PB Note

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

  • Question about PB Note

    Hello,
    i'm studying the PBNote source code, and i wonder why
    the menu work's this strange way ? I mean, it doesn't works
    like any other's. I would want to make it downloaded with just
    a single click.
    Could someone help ? ? ?

    Thank's.

    ------------------
    Dominique

  • #2
    Please could someone help me with that question ? ? ?

    ------------------
    Dominique

    Comment


    • #3
      Dominique,

      I am not sure what the problem is that you are having, PBnote should build
      from the IDE if I remember correctly. The PBnote.rc file is a bit unusual
      in that it defines the menu items as an equate from WM_USER and then
      increments each following item from that reference point.

      You can quite easily use numbers as menu item identifiers which is in fact
      more efficient according to the Microsoft documentation.

      Code:
          POPUP "&File"
            BEGIN
              MENUITEM "&New\tCtrl+N",                         IDM_NEW
              MENUITEM "&Open\tCtrl+O",                        IDM_OPEN
              MENUITEM SEPARATOR
              MENUITEM "&Save\tCtrl+S",                        IDM_SAVE
              MENUITEM "Save &As",                             IDM_SAVEAS
              MENUITEM SEPARATOR
              MENUITEM "E&xit\tAlt+F4",                        IDM_EXIT
            END
      
      would become,
      
          POPUP "&File"
            BEGIN
              MENUITEM "&New\tCtrl+N",                         100
              MENUITEM "&Open\tCtrl+O",                        101
              MENUITEM SEPARATOR
              MENUITEM "&Save\tCtrl+S",                        102
              MENUITEM "Save &As",                             103
              MENUITEM SEPARATOR
              MENUITEM "E&xit\tAlt+F4",                        104
            END
      
      or any other number sequence that you found convenient. The only thing is
      of course is that you would have to have the same numbers in the WndProc
      function where the WM_COMMAND messages are processed.
      
          CASE %WM_COMMAND
            SELECT CASE LOWRD(wParam)
      
              CASE %IDM_NEW ' becomes CASE 100    etc....
      This way you don't need to duplicate the equates in the PowerBASIC code
      and it is simpler to keep track of what identifier is used for each menu
      item.

      Regards,

      [email protected]


      ------------------
      hutch at movsd dot com
      The MASM Forum

      www.masm32.com

      Comment


      • #4
        Don't understand "downloaded with just a single click". What do
        you mean?


        ------------------

        Comment


        • #5
          Borje,
          I mean that when i click on the menu, it doesn't show it's
          content immediately !
          It only does whent the mouse cursor moves down under the item
          clicked.
          Then i can see the content of the menu and chose one of the
          option !

          A "normal" menu immediatly shows it's content when you click on
          it, and it's what i whant !

          Steve,
          thank's for the answer, i will try to do it the way you explained .

          Thank's to both of you !

          Dominique Bodin.

          ------------------
          Dominique

          Comment


          • #6
            Strange. It drops down the menus fine for me. What kind of system
            do you use? Win95/98/NT/2000? Especially NT is very picky about all
            details being absolutely correct. When I look at the code, something
            is missing in WndProc, under %WM_MENUSELECT. Win32api.hlp states
            "If an application processes this message, it should return zero",
            but that is not done in this sample.

            Maybe it will work better if you add this, so it looks like:
            Code:
                CASE %WM_MENUSELECT
                  LoadString hInst, wParam, zText, SIZEOF(zText)
                  SendMessage hStatus, %WM_SETTEXT, 0, VARPTR(zText)
                  FUNCTION = 0 : EXIT FUNCTION
            It's a long shot, I know, but still worth trying..

            ------------------

            Comment


            • #7
              Steve,
              Thank's for your suggestions, it works fine now !

              Borje,
              I tried your suggestion, but made no differencies !
              But as you said, perhaps would it make a difference
              for NT users or others ? I'm using Win98.

              Thanks to both of you for help!

              Dominique.

              ------------------
              Dominique

              Comment


              • #8
                I am using Windows 98 and it works perfect. Does any of
                the other programs that came with PB do the same thing?
                Curtis

                Comment

                Working...
                X