add a symbol

add a symbol

Postby Silvio.Falconi » Mon Jan 15, 2018 3: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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: add a symbol

Postby cnavarro » Mon Jan 15, 2018 5: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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: add a symbol

Postby Silvio.Falconi » Mon Jan 15, 2018 5: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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: add a symbol

Postby cnavarro » Mon Jan 15, 2018 6:10 pm

Add your code after define you urllink

Code: Select all  Expand view

.../...
   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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: add a symbol

Postby Silvio.Falconi » Tue Jan 16, 2018 9: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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: add a symbol

Postby cnavarro » Tue Jan 16, 2018 2: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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: add a symbol

Postby Silvio.Falconi » Tue Jan 16, 2018 6: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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: add a symbol

Postby cnavarro » Tue Jan 16, 2018 6:27 pm

this code run OK in
Code: Select all  Expand view

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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: add a symbol

Postby Silvio.Falconi » Fri Jan 19, 2018 9: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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: add a symbol

Postby cnavarro » Fri Jan 19, 2018 10:33 pm

You have to paint the image

Code: Select all  Expand view

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

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
User avatar
cnavarro
 
Posts: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: add a symbol

Postby Silvio.Falconi » Tue Jan 23, 2018 8: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 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: 7061
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 94 guests