Tooltips on MaxGUI buttons?

BlitzMax Forums/BlitzMax Programming/Tooltips on MaxGUI buttons?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

@hub, yes ive working tooltip's on textfield in winblitz3d. basicly it possable on most standard winapi gadgets, ive little time to code this up but i will help if anyone wants to do this. athough this would only work under win32, im have no idea under linux or macos.

some c code i use to enable tooltips on any passed gadget, NOTE this is takin from my winblitz3d's sourcecode. so some modifcation would be needed to port it into blitzmax.


 DWORD dwStyle = WS_POPUP  |
                      TTS_ALWAYSTIP | // appears when button active/inactive
                      TTS_NOPREFIX |TTF_IDISHWND;  // don't strip ampersand (&) character

        if(type==1){
                dwStyle = dwStyle | TTS_BALLOON;
        }
        
     HWND hwndToolTip = CreateWindowEx( 0, "tooltips_class32", 0, dwStyle,
                                    CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
                                    CW_USEDEFAULT, gadget, (HMENU)0,
                                    GetModuleHandle(0),0 ) ;

      //+----------------------------------------------------------+
      //| You must explicitly define a ToolTip control as topmost. |
      //| Otherwise, it might be covered by the parent window.     |
      //+----------------------------------------------------------+
      SetWindowPos( hwndToolTip, HWND_TOPMOST,0, 0, 0, 0,
                    SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE );

      //+------------------------------------------------------------+
      //| Get the bounding rect of the buttons. We will need this to |
      //| fill in the rect member of the TOOLINFO structures.        |
      //+------------------------------------------------------------+
      RECT rc ;
      GetClientRect( gadget, &rc ) ;

      //+--------------------------------------------+
      //| Fill in a TOOLINFO structure for Gadget.   |
      //+--------------------------------------------+
      TOOLINFO ti ;
      ti.cbSize   = sizeof ( TOOLINFO ) ;
      ti.hinst    = GetModuleHandle(0)  ;
      ti.hwnd     = hwndToolTip ;    // tooltip hwnd 
      ti.lpszText = TEXT(tiptext) ; // tooltip for gadget
      ti.rect     = rc ;
      ti.uFlags   = TTF_SUBCLASS | TTF_IDISHWND  ;  // tool tip control handles own messages
      ti.uId = (UINT)gadget; // gadget hwnd to add tooltip

      //+---------------------------------------------------+
      //| Add the tool for Gadget to the ToolTip control. |
      //+---------------------------------------------------+
      SendMessage( hwndToolTip,
                   TTM_ADDTOOL, // Registers a tool with a ToolTip control.
                   0,
                   (LPARAM)(LPTOOLINFO)(&ti) ) ; // address of TOOLINFO struct



kev