TTitle from RESOURCE a Image-problem ?

Post Reply
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

TTitle from RESOURCE a Image-problem ?

Post by ukoenig »

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( ::oWnd: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.
Luisão PITBULL
Posts: 22
Joined: Fri May 04, 2012 3:26 pm

Re: TTitle from RESOURCE a Image-problem ?

Post by Luisão PITBULL »

colleague has achieved something, I'm also experiencing this problem

Code: Select all

    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: Select all

  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
Luisão PITBULL
Posts: 22
Joined: Fri May 04, 2012 3:26 pm

Re: TTitle from RESOURCE a Image-problem ?

Post by Luisão PITBULL »

changed the class of the form below, and it worked ...

Code: Select all

// DEFAULT nRow :=  ::nHeight / if( ::oWnd: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
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: TTitle from RESOURCE a Image-problem ?

Post by ukoenig »

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 :

Image

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.
Luisão PITBULL
Posts: 22
Joined: Fri May 04, 2012 3:26 pm

Re: TTitle from RESOURCE a Image-problem ?

Post by Luisão PITBULL »

thanks for the feedback

the epoch so decided

Code: Select all

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: Select all

 ) / 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
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: TTitle from RESOURCE a Image-problem ?

Post by ukoenig »

Problem not fixed in FWH-updates ????

Image

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.
Post Reply