Hi,
After many changes in my program I could recompile it with FWH 7.1 and xHB.com 2007/January.
Only 2 little things don't work for me:
WhatsNew.txt says that now TBtnBmp accept multiline text. I try define the text "Line 1"+CRLF+"Line 2" but it didn't worked... Displayed text in button is "Line 1 || Line 2" showed in one line (CRLF appears like "||" or any).
I search fwbmp.c and included PalBtnPaint function in my app but I couldn't debbug it. I think it isn't entering in code marked with: #ifdef UNICODE
Then I declared UNICODE (#define UNICODE) but this way I get any warnings and errors when compile.
Another one: background of TreeView changed the color to BtnFace color (was WHITE). The text items is all black color (only display correct color on selected items) and last row of treeview don't display [+] mark and icon correctly.
Antonio, can you help me?
Thanks a lot!
Maurilio
Multiline in TBtnBmp and color in TreeView
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
Re: Multiline in TBtnBmp and color in TreeView
Problem of TreeView is solved (I found solution in other topic) but multiline in TBtnBmp continues...
Regards,
Maurilio
Regards,
Maurilio
This is a bad workaround
In the method PAint() after PalBtnPaint(
PalBtnPaint( ::hWnd, ::hBitmap1, ::hPalette1, ::hBitmap2, ::hPalette2,;
::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
::oPopup != nil, ::nClrPane, ::cCaption, ::nLayout,;
If( ::oFont != nil, ::oFont:hFont, 0 ), ::nClrText, ::hDC )
//----- My_modi
IF empty(::cBmpFile1)
::cCaption := cOldCAption
nLenText := GetTextWidth( hDC, ::cCaption , If( ::oFont != nil, ::oFont:hFont, 0 ) )
IF nLenText > ::nWidth()
hDC = ::hDC
SetBkMode( hDc, 1 )
SetTextColor( hDC,::nClrText )
SelectObject( hDC, If( ::oFont != nil, ::oFont:hFont, 0 ) )
nTxtHeight := Max(14, GetTextHeight( ::hWnd )-2)
FOR nX := 1 TO len(::cCaption)
IF substr(::cCaption,nX,1) == " " // or seek for a CRLF
TextOut( hDC,nR * nTxtHeight , 1 , substr(::cCaption,n1,nX-n1) )
n1 := nX + 1
nR++
ENDIF
NEXT
ENDIF
ENDIF
//------ End
In the method PAint() after PalBtnPaint(
PalBtnPaint( ::hWnd, ::hBitmap1, ::hPalette1, ::hBitmap2, ::hPalette2,;
::hBitmap3, ::hPalette3, ::lPressed, ::lAdjust, ::lBorder,;
::oPopup != nil, ::nClrPane, ::cCaption, ::nLayout,;
If( ::oFont != nil, ::oFont:hFont, 0 ), ::nClrText, ::hDC )
//----- My_modi
IF empty(::cBmpFile1)
::cCaption := cOldCAption
nLenText := GetTextWidth( hDC, ::cCaption , If( ::oFont != nil, ::oFont:hFont, 0 ) )
IF nLenText > ::nWidth()
hDC = ::hDC
SetBkMode( hDc, 1 )
SetTextColor( hDC,::nClrText )
SelectObject( hDC, If( ::oFont != nil, ::oFont:hFont, 0 ) )
nTxtHeight := Max(14, GetTextHeight( ::hWnd )-2)
FOR nX := 1 TO len(::cCaption)
IF substr(::cCaption,nX,1) == " " // or seek for a CRLF
TextOut( hDC,nR * nTxtHeight , 1 , substr(::cCaption,n1,nX-n1) )
n1 := nX + 1
nR++
ENDIF
NEXT
ENDIF
ENDIF
//------ End
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact:
Hello Maurilio
I use it
@ 1 ,2 BTNBMP oBtn OF oDlg SIZE 40 ,40
oBtn:cCaption := "Test in button"
[img][img]http://img142.imageshack.us/img142/5164/immaginemd1.jpg[/img][/img]
I use it
@ 1 ,2 BTNBMP oBtn OF oDlg SIZE 40 ,40
oBtn:cCaption := "Test in button"
[img][img]http://img142.imageshack.us/img142/5164/immaginemd1.jpg[/img][/img]
- Maurilio Viana
- Posts: 252
- Joined: Tue Oct 25, 2005 2:48 pm
- Location: Garça/Garza/Heron City - Brazil
- Contact: