To Antonio : create a tooltip

To Antonio : create a tooltip

Postby Silvio.Falconi » Sat Feb 20, 2016 11:34 am

Dear Antonio
I have a graphic problem and I not Know how resolve it
I explai you
In Blackjack if the player has an ace that counts as 11, the hand is called 'soft' indicating that the player can not busting by drawing one additional card, otherwise it is called 'hard'.

To simplify the calculations, soft hands show both possible scores for the Ace in a black balloon above the cards, separated by a blue line.

sample if the player have and Ace and a seven I must create a tooltip with

17
----- <- line blu
8

I thnked to use c5tooltip but I not know how make it
can you help me pls . thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Antonio : create a tooltip

Postby cnavarro » Sat Feb 20, 2016 12:02 pm

Silvio, test

Code: Select all  Expand view


// This sample shows how to easily implement 'C5 Tool-tips' in FiveWin!

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   local oBar, oBtn, oGet1, oGet2
   local cVar1 := Space( 15 )
   local cVar2 := Space( 25 )
   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"

   @ 4,1 GET oGet1 VAR cVar1 OF oWnd PICTURE '@!'
   oGet1:cToolTip = { || HazC5ToolTip( oGet1 ) } //"Here it is!"

   @ 6,1 GET oGet2 VAR cVar2 OF oWnd PICTURE '@!'
   oGet2:cToolTip = { || HazC5ToolTip( oGet2 ) } //"Here it is!"

   GetSelectAll( oWnd )

   @ 20, 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 MAXIMIZED

   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_HGRAY, CLR_HGRAY, CLR_BLUE, 0 , 0, 110 )  // 110 -> nAlpha

oTip:nTimer                    := -1 //15000
oTip:lLineHeader           := .T.
oTip:cHeader                 := "Header"
oTip:cBmpHeader         := "..\bitmaps\16edit.bmp"

oTip:cHeader2                := "Header 2"

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"  //Memoread( "tooltip.prg")

oTip:lBtnClose              := .F.   //.T.
oTip:lBorder                 := .F.

//oTip:lBalloon               := .T.

oCtrl:oToolTip      := oTip
Return oTip

//----------------------------------------------------------------------------//

Function GetSelectAll( oDlg )
   AEval( oDlg:aControls, { | o | IF( o:ClassName() = "TGET", o:bGotFocus := { | o | if( !Empty( o:oGet:Buffer ), o:SelectAll(), ) }, )  } )  
Return nil

//----------------------------------------------------------------------------//

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: To Antonio : create a tooltip

Postby Silvio.Falconi » Sat Feb 20, 2016 12:42 pm

Cristobal on OWnd run ok
on Dialog make error
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests