Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid and Container
Message
De
09/08/2006 07:21:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
09/08/2006 06:09:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01143737
Message ID:
01144039
Vues:
17
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform