...
hWnd = CreateToolTip( Self:hWnd, cToolTip, .F.)
SetAddTool(hWnd)
#define STM_SETIMAGE 0x0172
hBitmap := ReadBitmap( 0, "\video.bmp")
SendMessage( hWnd, STM_SETIMAGE, 0, hBitmap )
ti.uFlags = TTF_SUBCLASS
n1:= SendMessage(hwnd, TTM_SETDELAYTIME, TTDT_INITIAL, 300)
n2:= SendMessage(hwnd, TTM_SETMAXTIPWIDTH, 0, 1000)
SetAddTool(hWnd)
#define STM_SETIMAGE 0x0172
hBitmap := ReadBitmap( 0, "\video.bmp")
n3:= SendMessage( hWnd, STM_SETIMAGE, 0, hBitmap )
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
#include <commctrl.h>
HB_FUNC( SETADDTOOL ) // hWnd
{
TOOLINFO ti;
HWND hWnd = ( HWND ) hb_parnl( 1 );
ti.cbSize = sizeof( ti );
// ti.uFlags = TTF_SUBCLASS; //TTF_TRANSPARENT | TTF_CENTERTIP;
ti.uFlags = TTF_TRANSPARENT | TTF_CENTERTIP;
ti.hwnd = hWnd;
ti.uId = 0;
ti.hinst = NULL;
ti.lpszText = NULL; //LPSTR_TEXTCALLBACK;
GetClientRect( hWnd, &ti.rect );
// SetWindowLong( hWnd, GWL_STYLE, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON) ;
// SetWindowLong( hWnd, GWL_EXSTYLE, WS_EX_TOPMOST | WS_EX_TOOLWINDOW ) ;
// SetWindowLong( hWnd, GWL_STYLE, WS_CLIPSIBLINGS|WS_CHILD|WS_VISIBLE|SS_BITMAP|WS_TABSTOP) ;
SetWindowLong( hWnd, GWL_STYLE, SS_BITMAP) ;
SendMessage( hWnd, TTM_ADDTOOL, 0, ( LPARAM ) &ti );
SetWindowLong( hWnd, GWL_STYLE, SS_BITMAP) ;
// SetWindowLong( hWnd, GWL_STYLE, TBSTYLE_TOOLTIPS | TBSTYLE_FLAT ) ;
// SetWindowLong( hWnd, GWL_STYLE, TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | WS_EX_TOOLWINDOW ) ;
// SetWindowLong( hWnd, GWL_STYLE, TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | WS_EX_TOPMOST|WS_EX_TOOLWINDO) ;
// SetWindowLong( hWnd, GWL_STYLE, TOOLTIPS_CLASS ³ WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON) ;
}
#pragma ENDDUM
hmpaquito wrote:Gracias Marcelo por su comentario.
No he visto ninguna clase que incorpore el C5ToolTip. Los ejemplos que he visto solo son pruebas de concepto, pero no estan aplicados a ninguna clase y por ende no aparece en ellos el ciclo del tooltip de creacion-new()/ mostrado-show()/ destruccion-destroy()
Efectivamente estaba viendo las posibilidades de C5ToolTip e implementandolo dentro de un control TSBrowse.
En primera instancia la implementacion que he hecho hace crash porque porque consume todos los recursos.
He visto que el señor Silvio ha dado unas pautas, que voy a probar, en http://fivetechsupport.com/forums/viewt ... =0#p142167
Saludos
//CheckRes.txt
07/26/15 13:03:12: D:\Fwh\Fwh1506\samples\tooltip.exe -- ====================================================================================================
// This sample shows how to easily implement 'tool-tips' in FiveWin!
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar, oBtn
SetResDebug( .T. )
DEFINE WINDOW oWnd TITLE "ToolTips in FiveWin!"
DEFINE BUTTONBAR oBar 3D SIZE 33, 33 OF oWnd
DEFINE BUTTON OF oBar ACTION MsgInfo( "One" ) TOOLTIP "This is a long tooltip"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Two" ) TOOLTIP "Two"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Three" ) TOOLTIP "Three"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Four" ) TOOLTIP "Four"
@ 10, 8 BUTTON oBtn PROMPT "Where is my tooltip?" SIZE 180, 28 OF oWnd ;
ACTION MsgInfo( "Oh! Thanks!" )
// Manipulate directly the cToolTip DATA of other controls than ButtonBitmaps
oBtn:cToolTip = { || HazC5ToolTip( oBtn ) } //"Here it is!"
SET MESSAGE OF oWnd ;
TO "FiveWin: CA-Clipper, xBase && OOPS development power" CENTER
ACTIVATE WINDOW oWnd
if File( "checkres.txt" )
FErase( "checkres.txt" )
endif
CheckRes()
return nil
//----------------------------------------------------------------------------//
Function HazC5ToolTip( oCtrl )
Local oTip
//New( nTop, nLeft, nWidth, nHeight, oWnd, lDisenio, nClrPane, nClrPane2, nClrText, nWRadio, nHRadio ) CLASS TC5ToolTip
oTip := TC5ToolTip():New( 0 , 0 , 200, 150, oWnd, , CLR_GRAY, CLR_WHITE, CLR_RED, , )
oTip:lLineHeader := .T.
oTip:cHeader := "Header"
oTip:cBmpHeader := "..\bitmaps\16edit.bmp"
oTip:lLineFoot := .T.
oTip:cFoot := "Footer"
oTip:cBmpFoot := "..\bitmaps\16object.bmp"
oTip:lSplitHdr := .T.
oTip:lLeft := .T.
oTip:cBmpLeft := "..\bitmaps\16code.bmp"
oTip:lRightAlignBody := .T.
oTip:cBody := "En un lugar de la Mancha de cuyo nombre no quiero acordarme"
oTip:lBtnClose := .F. //.T.
oTip:lBorder := .F.
oCtrl:oToolTip := oTip
Return oTip
//----------------------------------------------------------------------------//
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 21 guests