FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TTitle from RESOURCE a Image-problem ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
TTitle from RESOURCE a Image-problem ?
Posted: Fri Apr 27, 2012 06:06 PM
Hello,

It seems, it is not possible, to add a image to a TTitle from resource.
using TTitles from Resource, I getting a error on this line :

650 DEFAULT nRow := ::nHeight / if( ::ClassName() == "TWINDOW", 2, 1 ) - nBmpHeight( hBmp ) / 2 - If( ::lBase, 3, 0 )

Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = N 10
[ 2] = U

Stack Calls
===========
Called from: .\TTitle.PRG => TTITLE:LOADBITMAPS( 650 )


from code, there is no problem.

The Test :

REDEFINE TITLE oMTitle1 ID 110 TEXT "Test" OF oDlg1 SHADOWSIZE 0
oMTitle1:lTransparent := .F.
oMTitle1:lBorder := .F.
oMTitle1:aGrdBack := { { 1, nDColorF, nDColorF }, ;
{ 1, nDColorF, nDColorF } }


@ 10, 10 TITLEIMG OF oMTitle1 BITMAP c_path + "\Images\" + cDImage TRANSPARENT ;
ACTION MsgAlert( "Button with Action","Attention" )


Best Regards
Uwe :-)
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.
Posts: 22
Joined: Fri May 04, 2012 03:26 PM
Re: TTitle from RESOURCE a Image-problem ?
Posted: Sun Jun 17, 2012 07:44 PM
colleague has achieved something, I'm also experiencing this problem

Code (fw): Select all Collapse
    REDEFINE TITLE oTitle ID 4001 OF oDlg SHADOW NOSHADOW 
    oTitle:lBorder:=.F.
    @ 10, 4 TITLETEXT OF oTitle TEXT "Manutenção de Classificação de Clientes" font Arial18B
    @  5,510  TITLEIMG  OF oTitle BITMAP "bitmaps\keys.bmp" SIZE 30, 30 REFLEX TRANSPARENT ANIMA


Code (fw): Select all Collapse
  Path and name: C:\empre-gestor\empre-gestor.EXE (32 bits)
   Size: 2,301,440 bytes
   Time from start: 0 hours 0 mins 11 secs 
   Error occurred at: 17/06/2012, 16:21:32
   Error description: Error BASE/1081  Argument error: +
   Args:
     [   1] = N   5
     [   2] = U



thank you

Luizão PITBULL
fwh1104
Posts: 22
Joined: Fri May 04, 2012 03:26 PM
Re: TTitle from RESOURCE a Image-problem ?
Posted: Mon Jun 18, 2012 04:19 PM
changed the class of the form below, and it worked ...

Code (fw): Select all Collapse
// DEFAULT nRow :=  ::nHeight / if( ::ClassName() == "TWINDOW", 2, 1 ) - nBmpHeight( hBmp ) / 2 - If( ::lBase, 3, 0 )
         AAdd( ::aImgs, { nRow,;
                                  nCol,;
                                  hBmp, ;
                                  hPalette, ;
                                  ::HasAlpha( hBmp ), ;
                                  nAlphaLevel, lReflex, lTransparent, lAnima,;
                                  bAction } )


http://www.fivewin.com.br/forum/topic.a ... C_ID=20907

Tranks

Luizão PITBULL
fwh1104
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TTitle from RESOURCE a Image-problem ?
Posted: Wed Sep 25, 2013 01:23 PM
Luizão,

I changed these lines and it works.
But the changes are still missing inside the original class TTitle.
Is there maybe any reason, NOT to add these changes ?

I still need the TTitle-resource-height and width, because of some needed calculations
for text- and image-position.
I tested :
aRect := GetClientRect( oTitle1:hWnd )
but get only result 0 for aRect[3] .and. aRect[4] ( at STARTUP !!! )
Changes at runtime, it returns the needed values.

function TITLE_SET

REDEFINE TITLE oTitle1 ID 700 OF oTDlg
TITLE_SET( oTDlg, oTitle1, nTStyle, .F., .F., "Title-painter" )
( function to define settings andvalues )

FUNCTION TITLE_SET( oTDlg, oTitle, nStyle, lShadow, lBase, cTitle )

aRect := GetClientRect( oTitle:hWnd ) // Returns 0, 0 at STARTUP !

MsgAlert( aRect[ 3 ] ) // Resource Width returns 0 !!!
MsgAlert( aRect[ 4 ] ) // Resource Height returns 0 !!!
...
...

Working on a section : title-painter from RESOURCES :



Best Regards
Uwe :-)
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.
Posts: 22
Joined: Fri May 04, 2012 03:26 PM
Re: TTitle from RESOURCE a Image-problem ?
Posted: Wed Sep 25, 2013 10:20 PM
thanks for the feedback

the epoch so decided


Code (fw): Select all Collapse
REDEFINE TITLE oTitle ID 4001 OF oBairro SHADOW NOSHADOW 
oTitle:lBorder:=.F.
@ 10, 4 TITLETEXT OF oTitle TEXT "Manutenção Cadastro de Bairros" font Arial18B 
@  5,600  TITLEIMG  OF oTitle BITMAP "LOGOMINI" SIZE 60,40 ANIMA LEVEL 220


within the class

Code (fw): Select all Collapse
 ) / 2 - If( ::lBase, 3, 0 )

         AAdd( ::aImgs, { nRow,;

                          nCol,;

                          hBmp, ;

                          hPalette, ;

                          ::HasAlpha( hBmp ), ;

                          nAlphaLevel, lReflex, lTransparent, lAnima,;

                          bAction } )

         oImg := TTitleImg():New( Self, ATail( ::aImgs ) )


so it works 100%


Luizão

Gracias
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TTitle from RESOURCE a Image-problem ?
Posted: Wed Feb 26, 2014 08:54 PM
Problem not fixed in FWH-updates ????



Best regards
Uwe :-)
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.

Continue the discussion