Deixo aqui mais uma contribuição
Este exemplo foi modificado no fonte \fwh\samples\tooltip.prg
- Code: Select all Expand view RUN
// This sample shows how to easily implement 'tool-tips' in FiveWin!
#include "FiveWin.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar, oBtn
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" + CRLF + "standard"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Two" ) TOOLTIP "Two" + CRLF + "standard"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Three" ) TOOLTIP "Three" + CRLF + "standard"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Four" ) TOOLTIP "Four" + CRLF + "standard"
@ 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 := "Tooltip with class !" + CRLF + "Ballon" + CRLF + "Resize" + CRLF + "Colors" + CRLF + "Icon" + CRLF + "Title"
oBtn:lToolTipBallon := .t.
oBtn:nTooltipWidth := 100
oBtn:nTooltipTexColor := rgb(255,255,255)
oBtn:nTooltipBKColor := rgb(58,116,241)
oBtn:cTooltipTitle := "Título"
oBtn:nTooltipIcon := 1 && 0=NONE / 1=TTI_INFO / 2=TTI_WARNING / 3=TTI_ERROR
SET MESSAGE OF oWnd ;
TO "FiveWin: CA-Clipper, xBase && OOPS development power" CENTER
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
Para que isto funcione é preciso fazer algumas mudanças em \FWH\SOURCE\CLASSES\WINDOW.PRG
- Code: Select all Expand view RUN
DATA ltooltipBallon, nTooltipWidth, nTooltipTexColor, nTooltipBKColor, ; && By Rossine
cTooltipTitle, nToolTipIcon && By Rossine
- Code: Select all Expand view RUN
//----------------------------------------------------------------------------//
#define TTM_SETMAXTIPWIDTH (WM_USER + 24) && By Rossine
#define TTM_SETTIPTEXTCOLOR (WM_USER + 20) && By Rossine
#define TTM_SETTIPBKCOLOR (WM_USER + 19) && By Rossine
#define TTM_SETTITLE (WM_USER + 32) && By Rossine
#define TTI_NONE 0 && By Rossine
#define TTI_INFO 1 && By Rossine
#define TTI_WARNING 2 && By Rossine
#define TTI_ERROR 3 && By Rossine
METHOD ShowToolTip( nRow, nCol, cToolTip ) CLASS TWindow
...
#ifndef __CLIPPER__
if ::lToolTipBallon == NIL && By Rossine
::lToolTipBallon := .f. && By Rossine
endif
DestroyWindow( oToolTip:hWnd )
hWnd = CreateToolTip( Self:hWnd, cToolTip, iif( ::ltooltipBallon, .t., .f. ) ) && for ballon tooltips !
oToolTip = oTemp
oToolTip:hWnd = hWnd
if ::cTooltipTitle != NIL && By Rossine
SendMessage(hwnd, TTM_SETTITLE, iif( ::nToolTipIcon = NIL, TTI_NONE, ::nToolTipIcon ), ::cTooltipTitle ) && By Rossine
endif
if ::nTooltipWidth != NIL && By Rossine
SendMessage(hwnd, TTM_SETMAXTIPWIDTH, 0, ::nTooltipWidth ) && By Rossine
endif
if ::nTooltipTexColor != NIL && By Rossine
SendMessage(hwnd, TTM_SETTIPTEXTCOLOR, ::nTooltipTexColor, 0) && By Rossine
endif
if ::nTooltipBKColor != NIL && By Rossine
SendMessage(hwnd, TTM_SETTIPBKCOLOR, ::nTooltipBKColor, 0) && By Rossine
endif
...
Antonio, seria possível incluir esta modificações em FWH ?
Abraços a todos
Rossine.