FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour add a symbol
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
add a symbol
Posted: Mon Jan 15, 2018 03:50 PM

I wish insert a symbol on a urlink object near to caption and I wuish insert a Arrow down
How I can make ?

oBarOpenWithlist:= TUrlLink():New( 200, 20, oAllegati, .T., .F., oFontOpenlist, "Apri con...", "Apri con..." )

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: add a symbol
Posted: Mon Jan 15, 2018 05:34 PM
Look in


METHOD AddLink( cPrompt, bAction, cBitmap, oFnt, nClrT, nClrP, nClrO ) CLASS TTaskPanel


from TExplBar.prg
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: add a symbol
Posted: Mon Jan 15, 2018 05:43 PM

Please ?

on TUrlLink I cannot see bitmap I see only Hbmp as data and then a method Destroy() at the end

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: add a symbol
Posted: Mon Jan 15, 2018 06:10 PM
Add your code after define you urllink

Code (fw): Select all Collapse
.../...
   if File( cBitmap )
      oUrlLink:hBmp = ReadBitmap( 0, cBitmap )
   else
      oUrlLink:hBmp = LoadBitmap( GetResources(), cBitmap )
   endif

.../...
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: add a symbol
Posted: Tue Jan 16, 2018 09:21 AM

I put it but not run I not see any bitmap

cBitmap:= "APRICON"

oBarOpenWithlist:= TUrlLink():New( 200, 20, oAllegati, .T., .F., oFontOpenlist, "Apri con...", "Apri con..." )

 if File( cBitmap )
  oBarOpenWithlist:hBmp = ReadBitmap( 0, cBitmap )

else
oBarOpenWithlist:hBmp = LoadBitmap( GetResources(), cBitmap )
endif

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: add a symbol
Posted: Tue Jan 16, 2018 02:25 PM

What is it cBitmap:= "APRICON"

File or Resource?

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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: add a symbol
Posted: Tue Jan 16, 2018 06:19 PM

resource and I tried also with .\bitmaps\apricon.bmp

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: add a symbol
Posted: Tue Jan 16, 2018 06:27 PM
this code run OK in
Code (fw): Select all Collapse
METHOD AddLink( cPrompt, bAction, cBitmap, oFnt, nClrT, nClrP, nClrO ) CLASS TTaskPanel


Put a little sample for test
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: add a symbol
Posted: Fri Jan 19, 2018 09:09 PM

Function Test()
Local oAllegati,
Local nBottom := 33
Local nRight := 115
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H

LOcal oFontOpenlist:= TFont():New( "Tahoma", 0, -12,,.F. )
DEFINE DIALOG oAllegati ;
TITLE "test" ;
SIZE nWidth, nHeight TRANSPARENT PIXEL

cBitmap:= "APRICON" // resource or bmp

oBarOpenWithlist:= TUrlLink():New( 200, 20, oAllegati, .T., .F., oFontOpenlist, "Apri con...", "Apri con..." )

 if File( cBitmap )
  oBarOpenWithlist:hBmp = ReadBitmap( 0, cBitmap )

else
oBarOpenWithlist:hBmp = LoadBitmap( GetResources(), cBitmap )
endif

ACTIVATE DIALOG oAllegati CENTERED
return nil

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: add a symbol
Posted: Fri Jan 19, 2018 10:33 PM
You have to paint the image

Code (fw): Select all Collapse
//----------------------------------------------------------------------------//

Function Test()
聽 聽
聽 聽Local oDlg
聽 聽Local nBottom := 33
聽 聽Local nRight := 115
聽 聽Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
聽 聽Local nHeight := nBottom * DLG_CHARPIX_H
聽 聽local oItem
聽 聽local oFontOpen := TFont():New( "Tahoma", 0, -18,,.F. )
聽 聽
聽 聽DEFINE DIALOG oDlg TITLE "test" SIZE nWidth, nHeight PIXEL //TRANSPARENT 

聽 聽oItem := TUrlLink():New( 60, 100, oDlg, .T., .F., oFontOpen, "Prueba de UrlLink con Bitmap...", "Prueba de UrlLink con Bitmap..." )

聽 聽ACTIVATE DIALOG oDlg CENTERED ; // 聽 聽 聽ON INIT 聽( oItem := HazLink( oDlg ) ) ;
聽 聽 聽 ON PAINT ( PaintMyBmp( oDlg, oItem ) ) ;
聽 聽 聽 VALID 聽 聽( DeleteObject( oItem:hBmp ), .T. )
return nil

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

Function HazLink( oDlg )

聽 聽local oFontOpen := TFont():New( "Tahoma", 0, -18,,.F. )
聽 聽local oItem

聽 聽oItem := TUrlLink():New( 60, 100, oDlg, .T., .F., oFontOpen, "Prueba de UrlLin con Bitmap...", "Prueba de UrlLin con Bitmap..." )

Return oItem

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

Function PaintMyBmp( oDlg, oItem )

聽 聽local cBitmap
聽 聽cBitmap:= "d:\fwh\fwhteam\bitmaps\16x16\about.bmp"
聽 聽
聽 聽if File( cBitmap )
聽 聽 聽 oItem:hBmp := ReadBitmap( 0, cBitmap )
聽 聽else
聽 聽 聽 oItem:hBmp := LoadBitmap( GetResources(), cBitmap )
聽 聽endif
聽 聽if !Empty( oItem:hBmp )
聽 聽 聽 DrawTransparent( oDlg:hDC, oItem:hBmp, oItem:nTop + 2, ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽oItem:nLeft - nBmpWidth( oItem:hBmp ) - 6 )
聽 聽endif
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
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: add a symbol
Posted: Tue Jan 23, 2018 08:17 PM

run ok
but the bitmap is before and then I cannot make on paint because it refresh all dialog allways when I resize the dialog
I must search another solution

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion