Announcement

Collapse
No announcement yet.

Tooltip Window for hMenu Item?

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

  • Tooltip Window for hMenu Item?

    Hi,

    Would like to show a tool tip for a dialog menu item?

    Thanks,

    Brent

  • #2
    Wouldn't tooltips get in the way of the menu? Most applications use the statusbar for showing text descriptions of menu items.
    sigpic
    Mobile Solutions
    Sys Analyst and Development

    Comment


    • #3
      Roger,

      Your right. Menu item is not a good candadate for tool tips. I don't
      really have enough room to add toolbar buttons, so guess leave the
      way it is. Actually, I don't even like tool tips, they just distract and get
      in the way.

      Thanks for your comments,

      Brent

      Comment


      • #4
        This can be implemented using tracking tooltips. It is similar to what Windows explorer does when the Favorites menu is acccessed.
        I can post an example if you like.
        Dominic Mitchell
        Phoenix Visual Designer
        http://www.phnxthunder.com

        Comment


        • #5
          Dominic,

          Just looked at Explorer, Favorites. This is what I need. Hope it works
          for DDT? If so, please post.

          Thank you,

          Brent

          Comment


          • #6
            The following SDK sample demonstrates displaying tooltips for menu items.
            In the code below OFFSET_BROWSE is the value that has to be added to the menu identifiers to get the identifiers of the tooltip text in the resource file.

            Basic code file MenuToolTips.bas

            Code:
            '###############################################################################
            '                             Phoenix Visual Designer
            '                              Generated source code
            '###############################################################################
            
            '                                Acknowledgements
            ' José Roca:
            ' For his ground breaking work which interfaces low-level COM and
            ' PowerBASIC-COM automation.
            '
            ' Jeffrey Richter:
            ' For his original implementation of a layout algorithm which positions
            ' controls in a window based on a set of rules.
            
            #DIM ALL
            #REGISTER NONE
            #COMPILE EXE
            #OPTION VERSION4
            
            #INCLUDE "WIN32API.INC"
            #INCLUDE "COMMCTRL.INC"
            
            #RESOURCE "MenuToolTips.PBR"
            
            '============================= [ String offsets ] ==============================
            
            ' Maps numeric identifiers of objects to the identifiers
            ' of descriptive strings in the resource file.
            ' Toolbars and menus
            ' ------------------
            ' <command id>                  -> <tooltip id>
            ' <command id> + OFFSET_CAPTION -> <caption id>
            ' <command id> + OFFSET_BROWSE  -> <statusbar text id>
            
            ' Controls
            ' --------
            ' <control id>                  -> <tooltip id>
            ' <control id> + OFFSET_CAPTION -> <Caption id>
            
            ' Control data(tab, statusbar | combobox, listbox)
            ' ------------------------------------------------
            ' <caption id> + OFFSET_BROWSE  -> <tooltip id> | <item data>
            %OFFSET_CAPTION                             = 18
            %OFFSET_BROWSE                              = 36
            
            '=========================== [ Command Identifiers ] ===========================
            
            %IDR_FORM1_MAINMENU1                        = 101
            %IDM_FILE                                   = 28000
            %IDM_NEW                                    = 28001
            %IDM_OPEN                                   = 28002
            %IDM_SAVE                                   = 28003
            %IDM_SAVE_AS                                = 28004
            %IDM_EXIT                                   = 28005
            %IDM_EDIT                                   = 28006
            %IDM_UNDO                                   = 28007
            %IDM_CUT                                    = 28008
            %IDM_COPY                                   = 28009
            %IDM_PASTE                                  = 28010
            %IDM_WINDOW                                 = 28011
            %IDM_TILE_HORIZONTALLY                      = 28012
            %IDM_CASCADE                                = 28013
            %IDM_ARRANGE                                = 28014
            %IDM_CLOSE                                  = 28015
            %IDM_CLOSEALL                               = 28016
            %IDM_TILE_VERTICALLY                        = 28017
            
            '============================ [ Timer Identifiers ] ============================
            
            ' Form1 window
            %IDC_INITIALTIPTIMER                        = 1
            
            '====================== [ Global Variable Declarations ] =======================
            
            GLOBAL  ghInstance    AS DWORD          ' handle of the application instance
            GLOBAL  ghWndTip      AS DWORD          ' handle of tooltip control
            GLOBAL  gfTipVisible  AS LONG           ' if nonzero, tooltip is visible
            GLOBAL  gtpt          AS POINTAPI       ' position of mouse when tooltip was displayed
            GLOBAL  gtrcBnd       AS RECT           ' bounding rectangle of menu item
            GLOBAL  gszTip        AS ASCIIZ * 1024  ' buffer for tooltip text
            
            ' Windows95 and WindowsNT MENUITEMINFO struct size
            %MENUITEMINFO_WIN95_SIZE = 44
            
            '----------------------------------------------------------------------
            '
            ' FUNCTION: IsWin95WinNT
            ' PURPOSE:  Determines whether the application is running on Windows95
            '           or WindowsNT.
            ' RETURNS:  TRUE if OS is Windows95 or WindowsNT, FALSE if it is not.
            '
            '----------------------------------------------------------------------
            
            FUNCTION IsWin95WinNT () AS LONG
            
              LOCAL tos     AS OSVERSIONINFO
            
              tos.dwOsVersionInfoSize = SIZEOF(tos)
            
              IF ISTRUE GetVersionEx(tos) THEN
                IF tos.dwPlatformId = %VER_PLATFORM_WIN32_WINDOWS THEN
                  IF tos.dwMinorVersion < 10 THEN
                    FUNCTION = %TRUE
                    EXIT FUNCTION
                  END IF
                  ELSEIF tos.dwPlatformId = %VER_PLATFORM_WIN32_NT THEN
                    IF tos.dwMajorVersion < 5 THEN
                      FUNCTION = %TRUE
                      EXIT FUNCTION
                    END IF
                END IF
              END IF
            
              FUNCTION = %FALSE
            
            END FUNCTION
            
            ' Size of TOOLINFO structure in version 5 of common controls
            %TOOLINFO_V5_SIZE = 44
            
            ' File version
            TYPE FILEVERSIONSTRUCT  ' fvs
              wMajor      AS WORD   ' major version of file
              wMinor      AS WORD   ' major version of file
              wBuild      AS WORD   ' build number of file
              wRevision   AS WORD   ' revision number of file
            END TYPE
            
            '-------------------------------------------------------------------------------
            '
            ' PROCEDURE: phnxGetFileVersion
            ' PURPOSE:   Returns the version of the specified file.
            ' RETURNS:   TRUE if successful, FALSE on failure.
            '
            '-------------------------------------------------------------------------------
            
            FUNCTION phnxGetFileVersion _
              ( _
              szFile  AS ASCIIZ, _            ' file name
              tfvs    AS FILEVERSIONSTRUCT _  ' version information
              ) AS LONG
            
              LOCAL ptvsffi         AS VS_FIXEDFILEINFO PTR
              LOCAL lpVerInfo       AS DWORD
              LOCAL dwHandle        AS DWORD
              LOCAL dwVersion       AS DWORD
              LOCAL cblVer          AS LONG
              LOCAL lRet            AS LONG
            
              cblVer = GetFileVersionInfoSize(szFile, BYVAL VARPTR(dwHandle))
              IF ISTRUE cblVer THEN
                lpVerInfo = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, cblVer)
                IF ISTRUE lpVerInfo THEN
                  IF ISTRUE GetFileVersionInfo(szFile, BYVAL VARPTR(dwHandle), cblVer, BYVAL lpVerInfo) THEN
                    ' Get the Fixed File Info
                    IF ISTRUE VerQueryValue(BYVAL lpVerInfo, "\", BYVAL VARPTR(ptvsffi), BYVAL VARPTR(cblVer)) THEN
                      tfvs.wMajor    = HIWRD(@ptvsffi.dwFileVersionMS)
                      tfvs.wMinor    = LOWRD(@ptvsffi.dwFileVersionMS)
                      tfvs.wBuild    = HIWRD(@ptvsffi.dwFileVersionLS)
                      tfvs.wRevision = LOWRD(@ptvsffi.dwFileVersionLS)
                      lRet           = %TRUE
                    END IF
                  END IF
                  HeapFree GetProcessHeap(), 0, lpVerInfo
                END IF
              END IF
            
              FUNCTION = lRet
            
            END FUNCTION
            
            '----------------------------------------------------------------------
            
            FUNCTION GetMenuIndexFromId _
              ( _
              BYVAL hMenu AS DWORD, _
              BYVAL dwId  AS DWORD _
              ) AS LONG
            
              LOCAL tmii    AS MENUITEMINFO         ' used to retrieve submenu information
              LOCAL cItems  AS LONG
              LOCAL iPos    AS LONG
            
              IF IsWin95WinNT() THEN
                tmii.cbSize = %MENUITEMINFO_WIN95_SIZE
              ELSE
                tmii.cbSize = SIZEOF(tmii)
              END IF
            
              cItems = GetMenuItemCount(hMenu)
            
              WHILE iPos < cItems
                tmii.fMask  = %MIIM_ID
                GetMenuItemInfo hMenu, iPos, %TRUE, BYVAL VARPTR(tmii)
                IF tmii.wID = dwId THEN
                  FUNCTION = iPos
                  EXIT FUNCTION
                END IF
                INCR iPos
              WEND
            
              FUNCTION = -1
            
            END FUNCTION
            
            '----------------------------------------------------------------------
            
            FUNCTION SetToolTipTool _
              ( _
              BYVAL hWnd    AS DWORD, _
              BYVAL wParam  AS DWORD, _
              BYVAL lParam  AS LONG _
              ) AS LONG
            
              LOCAL tmii      AS MENUITEMINFO         ' used to retrieve submenu information
              LOCAL tfvs      AS FILEVERSIONSTRUCT
              LOCAL tti       AS TOOLINFO             ' specifies the attributes of a tool in a tooltip control
              LOCAL fShowTip  AS LONG
            
              IF IsWindow(ghWndTip) THEN
                ' Initialize structure size
                phnxGetFileVersion "COMCTL32.DLL", tfvs
                IF tfvs.wMajor >= 6 THEN
                  tti.cbSize   = SIZEOF(tti)
                ELSE
                  tti.cbSize   = %TOOLINFO_V5_SIZE
                END IF                     
                ' Delete old tool
                tti.hwnd         = hWnd
                tti.uId          = 0
                SendMessage ghWndTip, %TTM_DELTOOL, 0, BYVAL VARPTR(tti)
            
                ' If menu was not dismissed
                IF HIWRD(wParam) <> &HFFFF?? THEN
                  ' System menu
                  IF (HIWRD(wParam) AND %MF_SYSMENU) = %MF_SYSMENU THEN
                    '
                  ELSE
                    ' Pop-up menu(low-order word is menu item index)
                    IF (HIWRD(wParam) AND %MF_POPUP) = %MF_POPUP THEN    
                      fShowTip = -1
                      ' Get the identifier of the pop-up menu
                      IF IsWin95WinNT() THEN
                        tmii.cbSize = %MENUITEMINFO_WIN95_SIZE
                      ELSE
                        tmii.cbSize = SIZEOF(tmii)
                      END IF
                      tmii.fMask  = %MIIM_ID
                      GetMenuItemInfo lParam, LOWRD(wParam), %TRUE, BYVAL VARPTR(tmii)
                      GetMenuItemRect %NULL, lParam, LOWRD(wParam), gtrcBnd
                      LoadString ghInstance, tmii.wID + %OFFSET_BROWSE, BYVAL VARPTR(gszTip), 1024
                    ' Menu command item(low-order word is menu item identifier)
                    ELSE
                      fShowTip = -1
                      GetMenuItemRect %NULL, lParam, GetMenuIndexFromId(lParam, LOWRD(wParam)), gtrcBnd
                      LoadString ghInstance, wParam + %OFFSET_BROWSE, BYVAL VARPTR(gszTip), 1024
                    END IF
                  END IF
            
                  IF fShowTip THEN
                    ' Add new tool 
                    tti.uFlags   = %TTF_TRACK OR %TTF_ABSOLUTE
                    tti.hinst    = GetModuleHandle(BYVAL %NULL)
                    tti.lpszText = %LPSTR_TEXTCALLBACK
                    tti.rec      = gtrcBnd
                    MapWindowPoints %NULL, hWnd, BYVAL VARPTR(tti.rec), 2
                    SendMessage ghWndTip, %TTM_ADDTOOL, 0, BYVAL VARPTR(tti)
                    ' A timer is used to avoid showing the tooltips as the
                    ' mouse pointer is moved quickly across the menu items
                    SetTimer hWnd, %IDC_INITIALTIPTIMER, SendMessage(ghWndTip, %TTM_GETDELAYTIME, %TTDT_INITIAL, 0), BYVAL %NULL
                  END IF
                END IF
              END IF
            
            END FUNCTION
            
            '----------------------------------------------------------------------
            
            FUNCTION ToolTipDeactivate _
              ( _
              BYVAL hWnd  AS DWORD _
              ) AS LONG
            
              LOCAL tfvs    AS FILEVERSIONSTRUCT
              LOCAL tti     AS TOOLINFO             ' specifies the attributes of a tool in a tooltip control
            
              IF gfTipVisible THEN
                gfTipVisible = 0
                IF IsWindow(ghWndTip) THEN
                  phnxGetFileVersion "COMCTL32.DLL", tfvs
                  IF tfvs.wMajor >= 6 THEN
                    tti.cbSize   = SIZEOF(tti)
                  ELSE
                    tti.cbSize   = %TOOLINFO_V5_SIZE
                  END IF
                  tti.hwnd         = hWnd
                  tti.uId          = 0
                  SendMessage ghWndTip, %TTM_TRACKACTIVATE, %FALSE, BYVAL VARPTR(tti)
                END IF
              END IF
            
            END FUNCTION
            
            '-------------------------------------------------------------------------------
            '
            ' PROCEDURE: WinMain
            ' PURPOSE:   Program entry point, calls initialization function, processes
            '            message loop.
            '
            '-------------------------------------------------------------------------------
            
            FUNCTION WinMain _
              ( _
              BYVAL hInstance     AS DWORD, _       ' handle of current instance
              BYVAL hPrevInstance AS DWORD, _       ' handle of previous instance(not used in Win32)
              BYVAL pszCmdLine    AS ASCIIZ PTR, _  ' address of command line
              BYVAL nCmdShow      AS LONG _         ' show state of window
              ) AS LONG
            
              LOCAL szClassName     AS ASCIIZ * %MAX_PATH   ' class name
              LOCAL twcx            AS WNDCLASSEX           ' class information
              LOCAL tmsg            AS tagMsg               ' message information
              LOCAL hWnd            AS DWORD                ' handle of main window
              LOCAL hWndModeless    AS DWORD                ' handle of the current active window
              LOCAL hAccel          AS DWORD                ' handle of accelerator table
              LOCAL hMenu           AS DWORD                ' handle of menu attached to main window
            
              ' Save the handle of the application instance
              ghInstance = hInstance
            
              ' Register the Form1 window
              szClassName        = "Form1_Class"
              twcx.cbSize        = SIZEOF(twcx)                               ' size of WNDCLASSEX structure
              twcx.style         = %CS_DBLCLKS                                ' class styles
              twcx.lpfnWndProc   = CODEPTR(Form1_WndProc)                     ' address of window procedure used by class
              twcx.cbClsExtra    = 0                                          ' extra class bytes
              twcx.cbWndExtra    = 0                                          ' extra window bytes
              twcx.hInstance     = ghInstance                                 ' instance of the process that is registering the window
              twcx.hIcon         = LoadIcon(%NULL, BYVAL %IDI_APPLICATION)    ' handle of class icon
              twcx.hCursor       = LoadCursor(%NULL, BYVAL %IDC_ARROW)        ' handle of class cursor
              twcx.hbrBackground = %COLOR_BTNFACE + 1                         ' brush used to fill background of window's client area
              twcx.lpszMenuName  = %NULL                                      ' resource identifier of the class menu
              twcx.lpszClassName = VARPTR(szClassName)                        ' class name
              twcx.hIconSm       = %NULL                                      ' handle of small icon shown in caption/system Taskbar
              IF ISFALSE RegisterClassEx(twcx) THEN
                FUNCTION = %TRUE
                EXIT FUNCTION
              END IF
            
              ' Load the accelerator table.
              ' An accelerator table that is loaded from a resource
              ' is freed automatically when the program terminates.
              hAccel = LoadAccelerators(ghInstance, BYVAL %IDR_FORM1_MAINMENU1)
            
              ' Create the Form1 window
              ' A menu that is attached to a window overrides the class
              ' menu and is destroyed when the window is destroyed.
              hMenu = LoadMenu(ghInstance, BYVAL %IDR_FORM1_MAINMENU1)
              hWnd = CreateWindowEx(%WS_EX_WINDOWEDGE, _                                          ' extended styles
                                    "Form1_Class", _                                              ' class name
                                    "Menu Tooltips", _                                            ' caption
                                    %WS_OVERLAPPEDWINDOW OR %WS_VISIBLE, _                        ' window styles
                                    70, 130, _                                                    ' left, top
                                    360, 394, _                                                   ' width, height
                                    %NULL, hMenu, _                                               ' handle of owner, menu handle
                                    ghInstance, BYVAL %NULL)                                      ' handle of instance, creation parameters
              ' If window could not be created, return "failure"
              IF ISFALSE hWnd THEN
                FUNCTION = %FALSE
                EXIT FUNCTION
              END IF
            
              ' Make the window visible; update its client area
              ShowWindow hWnd, nCmdShow
              UpdateWindow hWnd
            
              ' Main message loop of program.
              ' Acquire and dispatch messages until a WM_QUIT message is received.
              WHILE ISTRUE GetMessage(tmsg, BYVAL %NULL, 0, 0)
                IF ISFALSE TranslateAccelerator(hWnd, hAccel, tmsg) THEN
                  IF ISFALSE IsDialogMessage(hWnd, tmsg) THEN
                    TranslateMessage tmsg
                    DispatchMessage tmsg
                  END IF
                END IF
              WEND
            
              FUNCTION = tmsg.wParam
            
            END FUNCTION
            
            '-------------------------------------------------------------------------------
            '
            ' PROCEDURE: Form1_WndProc
            ' PURPOSE:   Processes messages for the Form1 window.
            '
            '-------------------------------------------------------------------------------
            
            FUNCTION Form1_WndProc _
              ( _
              BYVAL hWnd    AS DWORD, _ ' window handle
              BYVAL uMsg    AS DWORD, _ ' type of message
              BYVAL wParam  AS DWORD, _ ' first message parameter
              BYVAL lParam  AS LONG _   ' second message parameter
              ) EXPORT AS LONG
            
              LOCAL tpt     AS POINTAPI
              LOCAL tmii    AS MENUITEMINFO         ' used to retrieve submenu information
              LOCAL tfvs    AS FILEVERSIONSTRUCT
              LOCAL tti     AS TOOLINFO             ' specifies the attributes of a tool in a tooltip control
              LOCAL ptttdi  AS NMTTDISPINFO PTR     ' tooltip notification message information
              LOCAL hFont   AS DWORD                ' handle of font used by form
            
              SELECT CASE uMsg
                CASE %WM_COMMAND
            
                CASE %WM_NOTIFY
                  ptttdi = lParam
                  IF @ptttdi.hdr.hwndFrom = ghWndTip THEN
                    IF @ptttdi.hdr.code = %TTN_GETDISPINFO THEN
                      @ptttdi.hInst    = ghInstance
                      @ptttdi.lpszText = VARPTR(gszTip)
                    END IF
                  END IF
            
                CASE %WM_ENTERIDLE
                  IF wParam = %MSGF_MENU THEN
                    IF gfTipVisible THEN
                      ' Dismiss the tooltip if the mouse pointer has moved
                      GetCursorPos tpt
                      IF (tpt.x <> gtpt.x) OR (tpt.y <> gtpt.y) THEN
                        ToolTipDeactivate hWnd
                      END IF
                    END IF
                  END IF
            
                CASE %WM_MENUSELECT
                  ToolTipDeactivate hWnd
                  KillTimer hWnd, %IDC_INITIALTIPTIMER
                  SetToolTipTool hWnd, wParam, lParam
            
                CASE %WM_TIMER
                  IF wParam = %IDC_INITIALTIPTIMER THEN
                    KillTimer hWnd, wParam
                    IF IsWindow(ghWndTip) THEN  
                      ' Get the current position of the mouse pointer and save it
                      GetCursorPos tpt
                      gtpt = tpt  
                      ' If the mouse pointer is within the bounding rectangle of the menu item   
                      ' (usually the case when the mouse is being used to browse the menu)
                      IF PtInRect(gtrcBnd, tpt.x, tpt.y) THEN
                        tpt.y = tpt.y + GetSystemMetrics(%SM_CYCURSOR) \ 2 + 5
                      ' The mouse pointer is not within the bounding rectangle of the menu item      
                      ' (usually the case when the keyboard is being used to browse the menu)
                      ELSE                          
                        tpt.x = (gtrcBnd.nLeft + gtrcBnd.nRight) \ 2
                        tpt.y = gtrcBnd.nBottom + 1
                      END IF
                      SendMessage ghWndTip, %TTM_TRACKPOSITION, 0, MAKLNG(tpt.x, tpt.y)
            
                      ' Show the tooltip          
                      phnxGetFileVersion "COMCTL32.DLL", tfvs
                      IF tfvs.wMajor >= 6 THEN
                        tti.cbSize   = SIZEOF(tti)
                      ELSE
                        tti.cbSize   = %TOOLINFO_V5_SIZE
                      END IF
                      tti.hwnd         = hWnd
                      tti.uId          = 0
                      SendMessage ghWndTip, %TTM_TRACKACTIVATE, %TRUE, BYVAL VARPTR(tti)
                      gfTipVisible = -1
                    END IF
                  END IF
                  FUNCTION = %FALSE
                  EXIT FUNCTION
            
                CASE %WM_DESTROY
                  ' Destroy timer
                  KillTimer hWnd, %IDC_INITIALTIPTIMER
            
                  PostQuitMessage 0
                  FUNCTION = %FALSE
                  EXIT FUNCTION
            
                CASE %WM_CREATE
                  ' Create font used by container
                  hFont = GetStockObject(%DEFAULT_GUI_FONT)
            
                  ghWndTip = CreateWindowEx(%WS_EX_TOOLWINDOW OR %WS_EX_TOPMOST, _                 ' extended styles
                                            "tooltips_class32", _                                  ' class name
                                            "", _                                                  ' caption
                                            %WS_POPUP OR %WS_BORDER OR %WS_CLIPSIBLINGS OR _       ' window styles
                                            %TTS_NOPREFIX, _
                                            0, 0, _                                                ' left, top
                                            0, 0, _                                                ' width, height
                                            %NULL, %NULL, _                                        ' handle of parent, control ID
                                            ghInstance, BYVAL %NULL)                               ' handle of instance, creation parameters
            
                  ' Register a dummy tool with the tooltip control
                  phnxGetFileVersion "COMCTL32.DLL", tfvs
                  IF tfvs.wMajor >= 6 THEN
                    tti.cbSize   = SIZEOF(tti)
                  ELSE
                    tti.cbSize   = %TOOLINFO_V5_SIZE
                  END IF
                  tti.uFlags       = 0
                  tti.hwnd         = hWnd
                  tti.hinst        = ghInstance
                  tti.lpszText     = %LPSTR_TEXTCALLBACK
                  tti.uId          = 0
                  SendMessage ghWndTip, %TTM_ADDTOOL, 0, BYVAL VARPTR(tti)
            
                  ' Set the maximum width allowed for text
                  ' before it is broken into multiple lines.
                  SendMessage ghWndTip, %TTM_SETMAXTIPWIDTH, 0, 300 * GetSystemMetrics(%SM_CXBORDER)
            
                  FUNCTION = %FALSE
                  EXIT FUNCTION
              END SELECT
            
              FUNCTION = DefWindowProc(hWnd, uMsg, wParam, lParam)
            
            END FUNCTION
            Resource header file MenuToolTips.h

            Code:
            // Phoenix generated include file.
            // Used by "MenuToolTips.rc"
            
            // NOTE: Code may be modified or placed anywhere in a file except
            //       inside a >>PHNX_BEGIN_XXX and >>PHNX_END_XXX pair of tags.
            //       The >>PHNX_XXX_LOAD code block is programmer accessible, and is
            //       only modified when a project is packaged as a custom control.
            //       DO NOT remove the >>PHNX_BEGIN_XXX/>>PHNX_END_XXX tags.
            //       The code generator modifies tagged blocks on every build.
            
            // >>PHNX_BEGIN_DECLARES
            //========================================================================================
            ////////////////////////////////////////////////////////////////////////////////
            //
            //  Menu/Toolbar Identifiers 
            //
            
            #define IDR_FORM1_MAINMENU1                 101
            #define IDM_FILE                            28000
            #define IDM_NEW                             28001
            #define IDM_OPEN                            28002
            #define IDM_SAVE                            28003
            #define IDM_SAVE_AS                         28004
            #define IDM_EXIT                            28005
            #define IDM_EDIT                            28006
            #define IDM_UNDO                            28007
            #define IDM_CUT                             28008
            #define IDM_COPY                            28009
            #define IDM_PASTE                           28010
            #define IDM_WINDOW                          28011
            #define IDM_TILE_HORIZONTALLY               28012
            #define IDM_CASCADE                         28013
            #define IDM_ARRANGE                         28014
            #define IDM_CLOSE                           28015
            #define IDM_CLOSEALL                        28016
            #define IDM_TILE_VERTICALLY                 28017
            
            ////////////////////////////////////////////////////////////////////////////////
            //
            //  Menu/Toolbar browse string table 
            //
            
            #define O_B_IDM_FILE                        28036
            #define O_B_IDM_NEW                         28037
            #define O_B_IDM_OPEN                        28038
            #define O_B_IDM_SAVE                        28039
            #define O_B_IDM_SAVE_AS                     28040
            #define O_B_IDM_EXIT                        28041
            #define O_B_IDM_EDIT                        28042
            #define O_B_IDM_UNDO                        28043
            #define O_B_IDM_CUT                         28044
            #define O_B_IDM_COPY                        28045
            #define O_B_IDM_PASTE                       28046
            #define O_B_IDM_WINDOW                      28047
            #define O_B_IDM_TILE_HORIZONTALLY           28048
            #define O_B_IDM_CASCADE                     28049
            #define O_B_IDM_ARRANGE                     28050
            #define O_B_IDM_CLOSE                       28051
            #define O_B_IDM_CLOSEALL                    28052
            #define O_B_IDM_TILE_VERTICALLY             28053
            //========================================================================================
            // >>PHNX_END_DECLARES
            Resource file MenuToolTips.rc

            Code:
             
            // Phoenix generated resource script.
            
            // NOTE: Code may be modified or placed anywhere in a file except
            //       inside a >>PHNX_BEGIN_XXX and >>PHNX_END_XXX pair of tags.
            //       The >>PHNX_XXX_LOAD code block is programmer accessible, and is
            //       only modified when a project is packaged as a custom control.
            //       DO NOT remove the >>PHNX_BEGIN_XXX/>>PHNX_END_XXX tags.
            //       The code generator modifies tagged blocks on every build.
            
            // >>PHNX_BEGIN_INCLUDES
            //========================================================================================
            #include "resource.h"
            #include "MenuToolTips.h"
            //========================================================================================
            // >>PHNX_END_INCLUDES
            
            // >>PHNX_BEGIN_RESOURCE
            //========================================================================================
            ////////////////////////////////////////////////////////////////////////////////
            //
            //  Menus 
            //
            
            // Form1
            
            IDR_FORM1_MAINMENU1 MENUEX DISCARDABLE
            BEGIN
              POPUP "&File",                      IDM_FILE
              BEGIN
                MENUITEM "&New\tCtrl+N",          IDM_NEW
                MENUITEM "&Open...\tCtrl+O",      IDM_OPEN
                MENUITEM MFT_SEPARATOR
                MENUITEM "&Save\tCtrl+S",         IDM_SAVE
                MENUITEM "Save &As...",           IDM_SAVE_AS
                MENUITEM MFT_SEPARATOR
                MENUITEM "E&xit\tAlt+F4",         IDM_EXIT
              END
              POPUP "&Edit",                      IDM_EDIT
              BEGIN
                MENUITEM "&Undo\tCtrl+Z",         IDM_UNDO
                MENUITEM MFT_SEPARATOR
                MENUITEM "Cu&t\tCtrl+X",          IDM_CUT
                MENUITEM "&Copy\tCtrl+C",         IDM_COPY
                MENUITEM "&Paste\tCtrl+V",        IDM_PASTE
              END
              POPUP "&Window",                    IDM_WINDOW
              BEGIN
                MENUITEM "Casca&de",              IDM_CASCADE
                MENUITEM "Tile &Horizontally",    IDM_TILE_HORIZONTALLY
                MENUITEM "&Tile Vertically",      IDM_TILE_VERTICALLY
                MENUITEM "&Arrange Icons",        IDM_ARRANGE
                MENUITEM MFT_SEPARATOR
                MENUITEM "&Close\tCtrl+F4",       IDM_CLOSE
                MENUITEM "C&lose All",            IDM_CLOSEALL
              END
            END
            
            ////////////////////////////////////////////////////////////////////////////////
            //
            //  Accelerators 
            //
            
            // Form1
            
            IDR_FORM1_MAINMENU1 ACCELERATORS DISCARDABLE
            BEGIN
              "N",              IDM_NEW,    VIRTKEY, CONTROL, NOINVERT
              "O",              IDM_OPEN,   VIRTKEY, CONTROL, NOINVERT
              "S",              IDM_SAVE,   VIRTKEY, CONTROL, NOINVERT
              "Z",              IDM_UNDO,   VIRTKEY, CONTROL, NOINVERT
              "X",              IDM_CUT,    VIRTKEY, CONTROL, NOINVERT
              "C",              IDM_COPY,   VIRTKEY, CONTROL, NOINVERT
              "V",              IDM_PASTE,  VIRTKEY, CONTROL, NOINVERT
            END
            
            ////////////////////////////////////////////////////////////////////////////////
            //
            //  Menu/Toolbar browse string table 
            //
            
            STRINGTABLE DISCARDABLE
            BEGIN
              O_B_IDM_FILE                ""
              O_B_IDM_NEW                 "Create new document"
              O_B_IDM_OPEN                "Open an existing document"
              O_B_IDM_SAVE                "Save current document"
              O_B_IDM_SAVE_AS             "Save document under a new name"
              O_B_IDM_EXIT                "Close application"
              O_B_IDM_EDIT                ""
              O_B_IDM_UNDO                "Undo last action"
              O_B_IDM_CUT                 "Copy and remove selection to the clipboard"
              O_B_IDM_COPY                "Copy selection to the clipboard"
              O_B_IDM_PASTE               "Insert items from the clipboard"
              O_B_IDM_WINDOW              ""
              O_B_IDM_TILE_HORIZONTALLY   "Tile Horizontally"
              O_B_IDM_CASCADE             "Cascade"
              O_B_IDM_ARRANGE             "Arrange Icons"
              O_B_IDM_CLOSE               "Close the current window"
              O_B_IDM_CLOSEALL            "Close all open windows"
              O_B_IDM_TILE_VERTICALLY     "Tile Vertically"
            END
            //========================================================================================
            // >>PHNX_END_RESOURCE
            
            // >>PHNX_BEGIN_VERSION
            //========================================================================================
            //========================================================================================
            // >>PHNX_END_VERSION
            
            // >>PHNX_BEGIN_MANIFEST
            //========================================================================================
            //========================================================================================
            // >>PHNX_END_MANIFEST
            Last edited by Dominic Mitchell; 13 Sep 2007, 09:15 PM.
            Dominic Mitchell
            Phoenix Visual Designer
            http://www.phnxthunder.com

            Comment


            • #7
              Dominic,

              Thank you for posting MenuToolTips. I hope there is someone out
              there that has a interest in converting your code example to DDT.

              Thanks,

              Brent

              Comment

              Working...
              X