Hi,
Is it possible to show tooltip when the checkbox is disabled?
Checkbox does not show Tooltip when disabled.
- Antonio Linares
- Site Admin
- Posts: 42604
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 44 times
- Been thanked: 88 times
- Contact:
Re: Checkbox does not show Tooltip when disabled.
Hakan,
Place an "empty" SAY below the checkbox and use the SAY tooltip
Place an "empty" SAY below the checkbox and use the SAY tooltip
Re: Checkbox does not show Tooltip when disabled.
Place an "empty" SAY below the checkbox and use the SAY tooltip
another solution to keep the mouse-cursor inside
the checkboxarea :

Code: Select all | Expand
#include "FiveWin.ch"
static oWnd
//---------------------------
FUNCTION MAIN()
LOCAL oBtn[3], oChk, lValue := .T.
SetBalloon( .T. )
DEFINE WINDOW oWnd TITLE "Testing tooltips " + FWVERSION from 1,1 to 300, 300 pixel
@ 50, 50 BTNBMP oBtn[3] OF oWnd ;
SIZE 100, 20 PIXEL NOBORDER TRANSPARENT
oBtn[3]:cToolTip := { "Testing tooltips on" + CRLF + "DISABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
@ 0, 0 CHECKBOX oChk VAR lValue PROMPT "&Disabled" SIZE 100, 20 OF oBtn[3] PIXEL ;
ON CHANGE oChk:SetText( "Enabled" )
oChk:cToolTip := { "Testing tooltips on" + CRLF + "ENABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
oChk:disable()
oChk:SetColor("W+/R")
@ 100, 50 BUTTON "&Enable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Enable(), oChk:SetColor("W+/B"), oChk:SetText( "Enabled" ), oChk:Refresh() )
@ 150, 50 BUTTON "&Disable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Disable(), oChk:SetColor("W+/R"), oChk:SetText( "Disablrd" ), oChk:Refresh() )
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
best regards
Uwe

Last edited by ukoenig on Fri May 28, 2021 5:07 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- karinha
- Posts: 7951
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: Checkbox does not show Tooltip when disabled.
Very good.
Regards, saludos.
Code: Select all | Expand
// \SAMPLES\CHKDISAB.PRG
#Include "FiveWin.ch"
STATIC oWnd
// ---------------------------
FUNCTION Main()
LOCAL oBtn[ 3 ], oChk, lValue := .T.
SetBalloon( .T. )
DEFINE WINDOW oWnd TITLE "Testing tooltips " + FWVERSION ;
FROM 1, 1 TO 300, 300 PIXEL
@ 50, 50 BTNBMP oBtn[ 3 ] OF oWnd ;
SIZE 100, 20 PIXEL NOBORDER TRANSPARENT
oBtn[ 3 ]:cToolTip := { "Testing tooltips on" + CRLF + "DISABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
@ 0, 0 CHECKBOX oChk VAR lValue PROMPT "&Disabled" SIZE 100, 20 OF oBtn[ 3 ] PIXEL ;
ON CHANGE oChk:SetText( "Enabled" )
oChk:cToolTip := { "Testing tooltips on" + CRLF + "ENABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
oChk:disable()
oChk:SetColor( "W+/R" )
@ 100, 50 BUTTON "&Enable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Enable(), oChk:SetColor( "W+/B" ), oChk:SetText( "Enabled" ), oChk:Refresh() )
/* // Original:
@ 150, 50 BUTTON "&Disable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Disable(), oChk:SetColor( "W+/R" ), oChk:SetText( "Disabled" ), oChk:Refresh() )
*/
// Modified:
@ 150, 50 BUTTON "&Disable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Disable(), oChk:SetColor( "W+/R" ), ;
oChk:SetText( "Disabled" ), CHANGE_COLOR_CHECBOX() )
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
STATIC FUNCTION CHANGE_COLOR_CHECBOX()
LOCAL oSay AS OBJECT
@ 50, 63 SAY oSay PROMPT "Disabled " OF oWnd SIZE 088, 20 ;
COLORS CLR_BLACK, CLR_YELLOW PIXEL CENTER BORDER ADJUST
RETURN( .T. )
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Re: Checkbox does not show Tooltip when disabled.
Antonio Linares wrote:Hakan,
Place an "empty" SAY below the checkbox and use the SAY tooltip
Thank you Antonio,
But it seems the cTooltip does not executed in TSay object.
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Re: Checkbox does not show Tooltip when disabled.
ukoenig wrote:Place an "empty" SAY below the checkbox and use the SAY tooltip
another solution to keep the mouse-cursor inside
the checkboxarea :Code: Select all | Expand
#include "FiveWin.ch"
static oWnd
//---------------------------
FUNCTION MAIN()
LOCAL oBtn[3], oChk, lValue := .T.
SetBalloon( .T. )
DEFINE WINDOW oWnd TITLE "Testing tooltips " + FWVERSION from 1,1 to 300, 300 pixel
@ 50, 50 BTNBMP oBtn[3] OF oWnd ;
SIZE 100, 20 PIXEL NOBORDER TRANSPARENT
oBtn[3]:cToolTip := { "Testing tooltips on" + CRLF + "DISABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
@ 0, 0 CHECKBOX oChk VAR lValue PROMPT "&Disabled" SIZE 100, 20 OF oBtn[3] PIXEL ;
ON CHANGE oChk:SetText( "Enabled" )
oChk:cToolTip := { "Testing tooltips on" + CRLF + "ENABLED", "ATTENTION", 1, CLR_BLACK, 14089979 }
oChk:disable()
oChk:SetColor("W+/R")
@ 100, 50 BUTTON "&Enable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Enable(), oChk:SetColor("W+/B"), oChk:SetText( "Enabled" ), oChk:Refresh() )
@ 150, 50 BUTTON "&Disable" SIZE 120, 25 PIXEL ;
ACTION ( oChk:Disable(), oChk:SetColor("W+/R"), oChk:SetText( "Disablrd" ), oChk:Refresh() )
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
best regards
Uwe
Thank you Uwe. I use dialog and I could not use checkbox in TBtnBmp object in dialog.
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
- Antonio Linares
- Site Admin
- Posts: 42604
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 44 times
- Been thanked: 88 times
- Contact:
Re: Checkbox does not show Tooltip when disabled.
Hakan,
I have modified FWH\samples\testsay.prg this way and see the result as I explained you, using a SAY under the checkbox:

I have modified FWH\samples\testsay.prg this way and see the result as I explained you, using a SAY under the checkbox:
Code: Select all | Expand
procedure Dlg_Grad
local oDlg, oSay, oBrush, lTest := .T., oCbx
define brush oBrush gradient { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
{ 0.6, nRGB( 24, 61, 118 ), nRGB( 50, 95, 158 ) } }
define dialog odlg title "Test Say With Gradient Brush" ;
size 400,400 pixel brush oBrush transparent
@ 2,2 GROUP TO 100,100 of odlg pixel
@ 25,15 say oSay prompt "This a Test" of oDlg SIZE 40, 40 COLOR CLR_WHITE PIXEL transparent adjust
@ 25.5,15 CHECKBOX oCbx VAR lTest PROMPT "Checkbox" OF oDlg SIZE 30, 20 PIXEL
@ 10,120 button "Test" pixel action oSay:SetText( "Change Text" )
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( EnableWindow( oCbx:hWnd, .F. ), oSay:lWantClick := .T., oSay:cTooltip := "this is a test", oSay:ShowToolTip(), .T. )
release brush oBrush
return