Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid and Container
Message
From
09/08/2006 07:21:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
09/08/2006 06:09:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01143737
Message ID:
01144039
Views:
22
>>Hey Dragan,
>>I still can't understand the problem. I said he could use gridhittest,no?
>
>Sorry Cetin, i only look at the code, and don't see your explanation.
>
>I try your code in the container, but the tooltip only show in the first grid record, if you move the cursor down, no more tooltip show, any more tip on this.
>
>Thank's for your time.
>
>João Batista

Joao,
Container doesn't have a tooltiptext property in earlier versions and IMHO even it had it's an ill behaving property.
Public oForm
oForm  = Createobject('myForm')
oForm.Show

Define Class myForm As Form
  DataSession = 2
  Height = 400
  Width=600
  ShowTips = .T.
  Procedure Load
    Use employee
  Endproc
  Add Object myGrd As Grid With RecordSource = 'Employee',;
    left = 10,Top=10,Height=380,Width=580,;
    Highlight=.F.,HighlightRow=.F.
  Add Object myContainer As Container With ;
    left = 10,Top=10,Height=360,Width=580, BorderWidth=0,BackStyle=0
  Add Object myLbl As Label With ;
    backcolor=Rgb(255,255,225),Visible=.F.,AutoSize = .T.

  Procedure myGrd.Init
    This.SetAll('enabled',.F.)
    This.SetAll('disabledforecolor',0)
  Endproc

  Procedure myContainer.MouseMove
    Lparameters nButton, nShift, nXCoord, nYCoord
    Local lcTip
    With Thisform.myGrd
      Store 0 To nWhere_Out , nRelRow_Out , nRelCol_Out , nView_Out
      If .GridHitTest(nXCoord, nYCoord, ;
          @nWhere_Out, @nRelRow_Out, @nRelCol_Out) And nWhere_Out = 3
        .ActivateCell(m.nRelRow_Out, m.nRelCol_Out)
        With .Columns(.ActiveColumn)
          lcTip = ;
            iif(Type(.ControlSource)='C',  Eval(.ControlSource),;
            iif(Type(.ControlSource)='M',  Mline(Eval(.ControlSource),1)+'...',''))
        Endwith
      Endif
    Endwith
    With This.Parent.myLbl
      .Move(m.nXCoord+16,m.nYCoord+16)
      If !Empty(m.lcTip)
        .Caption = Trim(m.lcTip)
        .Visible = .T.
        If .Left + .Width > Thisform.Width
          .Move(Thisform.Width - .Width - 10,.Top)
        Endif
      Else
        .Visible = .F.
      Endif
    Endwith
  Endproc
Enddefine
With Tooltiptext anyway:
  Procedure myContainer.MouseMove
    Lparameters nButton, nShift, nXCoord, nYCoord
    Local lcTip
    With Thisform.myGrd
      Store 0 To nWhere_Out , nRelRow_Out , nRelCol_Out , nView_Out
      If .GridHitTest(nXCoord, nYCoord, ;
          @nWhere_Out, @nRelRow_Out, @nRelCol_Out) And nWhere_Out = 3
        .ActivateCell(m.nRelRow_Out, m.nRelCol_Out)
        With .Columns(.ActiveColumn)
          this.tooltiptext = ;
            iif(Type(.ControlSource)='C',  Eval(.ControlSource),;
            iif(Type(.ControlSource)='M',  Mline(Eval(.ControlSource),1)+'...',''))
        Endwith
      Endif
    Endwith
  Endproc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform