Page 1 of 1

TTitle from RESOURCE a Image-problem ?

Posted: Fri Apr 27, 2012 6:06 pm
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 :?:

Re: TTitle from RESOURCE a Image-problem ?

Posted: Sun Jun 17, 2012 7:44 pm
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

Re: TTitle from RESOURCE a Image-problem ?

Posted: Mon Jun 18, 2012 4:19 pm
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

Re: TTitle from RESOURCE a Image-problem ?

Posted: Wed Sep 25, 2013 1:23 pm
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 :?:

Re: TTitle from RESOURCE a Image-problem ?

Posted: Wed Sep 25, 2013 10:20 pm
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

Re: TTitle from RESOURCE a Image-problem ?

Posted: Wed Feb 26, 2014 8:54 pm
by ukoenig
Problem not fixed in FWH-updates ????

Image

Best regards
Uwe :?: