当前位置: 代码迷 >> PB >> tooltip 在数据窗口中的用法,该如何解决
  详细解决方案

tooltip 在数据窗口中的用法,该如何解决

热度:575   发布时间:2016-04-29 10:15:45.0
tooltip 在数据窗口中的用法
Long ii_dwID

inv_Tooltip.of_SetMaxWidth( 1500 )
inv_Tooltip.of_SetTipTitle( inv_Tooltip.TTI_INFO, ls_Roomno )
ii_dwID = inv_ToolTip.of_AddTool(dw_4, "" , 0 ) 


inv_Tooltip.of_SettipText( This, ii_dwID, '测试aaa' )

我在Clicked 或者 自定义 pbm_mousemove 事件.当我点一下的时候不会弹出信息.总是要再移动一下鼠标才能弹出信息出来
 

------解决方案--------------------
看一下你的of_setiptext是怎么写的?

或者单步跟踪一下

如果你用的是pb11以上的版本,数据窗口的列有tip属性,设置即可
------解决方案--------------------
有数据窗口tip示例,如果需要可发至邮箱





------解决方案--------------------
forward
global type n_cst_dwsrv_autohint from nonvisualobject
end type
type logfont from structure within n_cst_dwsrv_autohint
end type
type textsize from structure within n_cst_dwsrv_autohint
end type
end forward

type logfont from structure
long lfHeight
long lfWidth
long lfEscapement
long lfOrientation
long lfWeight
character lfItalic
character lfUnderline
character lfStrikeOut
character lfCharSet
character lfOutPrecision
character lfClipPrecision
character lfQuality
character lfPitchAndFamily
string lfFaceName
end type

type textsize from structure
long l_cx
long l_cy
end type

global type n_cst_dwsrv_autohint from nonvisualobject
event type long ue_mousemove ( unsignedlong flags, integer xpos, integer ypos )
event type long resize ( unsignedlong sizetype, integer newwidth, integer newheight )
end type
global n_cst_dwsrv_autohint n_cst_dwsrv_autohint

type prototypes
FUNCTION ulong GetDC(ulong hwnd) LIBRARY "user32.dll"
FUNCTION ulong ReleaseDC(ulong hwnd,ulong hdc) LIBRARY "user32.dll"
FUNCTION ulong SelectObject(ulong hdc,ulong hObject) LIBRARY "gdi32.dll"
FUNCTION ulong DeleteObject(ulong hObject) LIBRARY "gdi32.dll"
FUNCTION ulong CreateFontIndirect(ref LOGFONT lpLogFont) LIBRARY "gdi32.dll" ALIAS FOR "CreateFontIndirectA"
FUNCTION ulong GetTextExtentExPoint(ulong hdc,ref string lpszStr,ulong cchString,ulong nMaxExtent,ref ulong lpnFit,ref ulong alpDx,ref textSIZE lpSize) LIBRARY "gdi32.dll" ALIAS FOR "GetTextExtentExPointA"
FUNCTION ulong GetTextExtentPoint32(ulong hdc,ref string lpsz,ulong cbString,ref textSIZE lpSize) LIBRARY "gdi32.dll" ALIAS FOR "GetTextExtentPoint32A"
Function long MulDiv (long nNumber, long nNumerator, long nDenominator) Library "KERNEL32.DLL"
FUNCTION ulong GetDeviceCaps(ulong hdc,ulong nIndex) LIBRARY "gdi32.dll"

end prototypes

type variables
Private:
DataWindow idw_requestor
nvo_tooltips ToolTip
String is_prior_dwo

end variables

forward prototypes
public function long of_gettextwidth (string as_colname, string as_text)
public subroutine of_replacestring (ref string as_src, string as_oldstr, string as_newstr)
public function integer of_setrequestor (datawindow adw_requestor)
end prototypes

event type long ue_mousemove(unsignedlong flags, integer xpos, integer ypos);String ls_dwo,ls_col,ls_text
Long ll_row
Int li_pos


ls_dwo = idw_requestor.GetObjectAtPointer()

If is_prior_dwo = ls_dwo Then
Return 0
Else
is_prior_dwo = ls_dwo
End If

If Tooltip.tipvisible() or flags <> 0 Then 
Tooltip.hidetip(idw_requestor)
end if

li_pos = Pos(ls_dwo, "~t")
If li_pos <= 0 Then Return 0


ls_col = Left (ls_dwo, li_pos - 1 )
ll_row = Long(Mid(ls_dwo,li_pos + 1 ))
  相关解决方案