HMG Help

Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
  1. Thanks for sharing. I am having problems catching keyboard events (up, down etc). I need to refresh data outside of a grid when the user presses up or down but its not working. It DOES work if the user clicks on a different row in the grid!!

    This example might help me solve the problem (with up, down arrow etc).

    Z

    Statistics: Posted by Zimbo — Sun Jan 20, 2019 3:23 pm


  2. You are great Edward! Thank you very much!

    Statistics: Posted by mol — Sat Jan 19, 2019 4:58 pm


  3. How can I set different tooltip for every row?
    Is it the way to detect row pointed by mouse hovering and change tooltip depends on pointed (without clicking) grid cell?
    Did anybody realized this?
    I did not do it before, but I made this code especially for you ;) :

    CODE:

    #include "hmg.ch"Function MainLocal aRows [20] [3]DEFINE WINDOW Form_1 ;AT 0,0 ;WIDTH 800 ;HEIGHT 550 ;TITLE 'Hello World!' ;MAIN aRows [1]:= {'Simpson','Homer','555-5555'}aRows [2]:= {'Mulder','Fox','324-6432'} aRows [3]:= {'Smart','Max','432-5892'} aRows [4]:= {'Grillo','Pepe','894-2332'} aRows [5]:= {'Kirk','James','346-9873'} aRows [6]:= {'Barriga','Carlos','394-9654'} aRows [7]:= {'Flanders','Ned','435-3211'} aRows [8]:= {'Smith','John','123-1234'} aRows [9]:= {'Pedemonti','Flavio','000-0000'} aRows [10]:= {'Gomez','Juan','583-4832'} aRows [11]:= {'Fernandez','Raul','321-4332'} aRows [12]:= {'Borges','Javier','326-9430'} aRows [13]:= {'Alvarez','Alberto','543-7898'} aRows [14]:= {'Gonzalez','Ambo','437-8473'} aRows [15]:= {'Batistuta','Gol','485-2843'} aRows [16]:= {'Vinazzi','Amigo','394-5983'} aRows [17]:= {'Pedemonti','Flavio','534-7984'} aRows [18]:= {'Samarbide','Armando','854-7873'} aRows [19]:= {'Pradon','Alejandra','???-????'} aRows [20]:= {'Reyes','Monica','432-5836'} @ 10,10 GRID Grid_1 ;WIDTH 760 ;HEIGHT 240 ;HEADERS {'Last Name','First Name','Phone'} ;WIDTHS {140,140,140};ITEMS aRows ;VALUE {1,1} ;TOOLTIP 'Editable Grid Control' ;EDIT ;                JUSTIFY { GRID_JTFY_CENTER,GRID_JTFY_RIGHT, GRID_JTFY_RIGHT } ;CELLNAVIGATION @ 250,10 GRID Grid_2 ;WIDTH 760 ;HEIGHT 240 ;HEADERS {'Last Name','First Name','Phone'} ;WIDTHS {140,140,140};ITEMS aRows ;VALUE 1 EDIT ;TOOLTIP 'Editable Grid Control' ;ON HEADCLICK { {||MsgInfo('Click 1')} , {||MsgInfo('Click 2')} , {||MsgInfo('Click 3')} } ;                JUSTIFY { GRID_JTFY_LEFT,GRID_JTFY_CENTER, GRID_JTFY_CENTER } CREATE EVENT PROCNAME Grid_ToolTip()END WINDOWCENTER WINDOW Form_1ACTIVATE WINDOW Form_1ReturnFUNCTION Grid_ToolTip()LOCAL nHWnd := EventHWND(), aCellMouseOver, cCtrlName:="", cFormName:=""LOCAL nIndex := GetControlIndexByHandle ( nHWnd )LOCAL cCtrlType := IF( nIndex > 0, GetControlTypeByIndex (nIndex) , "") STATIC aTT := {0,0}IF cCtrlType == 'GRID'GetControlNameByHandle (nHWnd, @cCtrlName, @cFormName)aCellMouseOver := ListView_HitTest ( nHWnd , GetCursorRow() - GetWindowRow ( nHWnd )  , GetCursorCol() - GetWindowCol ( nHWnd ) )IF aTT [1] # aCellMouseOver [1] .OR. aTT [2] # aCellMouseOver [2]aTT [1] := aCellMouseOver [1]aTT [2] := aCellMouseOver [2]IF aCellMouseOver [1] = 0 .AND. aCellMouseOver [2] = 0SetProperty( cFormName, cCtrlName, "ToolTip", "")ELSESetProperty( cFormName, cCtrlName, "ToolTip", "ToolTip for Row=" + Alltrim(HB_ValToStr( aCellMouseOver [1] )) + " Col=" + Alltrim(HB_ValToStr( aCellMouseOver [2] )) + " Value=" + GetProperty (cFormName, cCtrlName, "CellEx", aCellMouseOver [1], aCellMouseOver [2] ) )ENDIFENDIFENDIFRETURN Nil
    There is a different ToolTip for each cell, but you'll easy manage to get this effect for a different row ;) .

    Statistics: Posted by edk — Sat Jan 19, 2019 1:29 pm


  4. How can I set different tooltip for every row?
    Is it the way to detect row pointed by mouse hovering and change tooltip depends on pointed (without clicking) grid cell?
    Did anybody realized this?

    Statistics: Posted by mol — Sat Jan 19, 2019 11:14 am


  5. Hola amigo Pepe
    Muy Bueno
    Saludos
    Mustafa
    Hola amigo Mustafa, te sigo en los posts que publicas (como siempre muy buenos) en esta gran comunidad llena de amigos y aprovecho para enviarte un gran saludo y desearte todo lo mejor para este 2019, al igual que a todos los componentes de HMGFORUM.

    Statistics: Posted by Pepe Ruano — Sun Jan 13, 2019 7:03 pm