Page 1 of 1

btnbmp error on 15.01

PostPosted: Wed Jan 21, 2015 5:33 pm
by Silvio.Falconi
I recompiled one my application with 15.01 and I saw all btnbmp buttons with bitmaps with black background... why ?

Image


test.prg
Code: Select all  Expand view

#include "Fivewin.ch"
#include "constant.ch"

#define LIGHTCYAN    nRGB( 203, 225, 252 )


Function ZipBackup()

   LOCAL oDlg, oLbx, oCol
   Local   oBtnOk,oBtnNO ,oBtnConf
   Local  nBottom   := 24
   Local  nRight    := 51.9
   Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight := nBottom * DLG_CHARPIX_H
   Local bClrGrad := { | lPressed | If( ! lPressed,;
                           { { 1, nRGB( 253, 254, 255 ), nRGB( 179, 217, 255 ) } },;
                           { { 1, nRGB( 179, 217, 255 ), nRGB( 253, 254, 255 ) } } ) }


     DEFINE DIALOG oDlg SIZE nWidth, nHeight   TRANSPARENT ;
      TITLE  " - creare una copia di salvataggio"  ;
      GRADIENT { { 1,CLR_WHITE, LIGHTCYAN } }


 @ 163, 90 BTNBMP oBtnOK PROMPT "&Conferma" RESOURCE "DLG_OK" SIZE 50, 15 ;
      LEFT NOBORDER    ACTION   (  oDlg:end( IDOK )  )

   oBtnOK:bClrGrad := bClrGrad

  @ 163, 145 BTNBMP oBtnCan PROMPT "&Annulla" RESOURCE "DLG_NO" SIZE 50, 15 ;
      LEFT NOBORDER         2007   ;
      ACTION   ( oDlg:end( IDCANCEL ) )

   oBtnCan:bClrGrad := bClrGrad

 ACTIVATE DIALOG oDlg
return nil
 



I use these bmps

DLG_NO.bmp
Image

DLG_OK.bmp
Image



I saw also if change the size SIZE 50, 15 into SIZE 45, 12 perhaps it run but I not understood why ...
thanks

Re: btnbmp error on 15.01

PostPosted: Wed Jan 21, 2015 5:39 pm
by ukoenig
Silvio,

can You add :

oBtn1:lTransparent := .t.

in all my buttons I'm using, this line is included
I never tested without this line.

best regards
Uwe :?:

Re: btnbmp error on 15.01

PostPosted: Wed Jan 21, 2015 5:47 pm
by Silvio.Falconi
Uwe
I found the error.. if the bmp is smaller run ok .... Now Imust change all buttons and all bmps... ufffffffff :(

Re: btnbmp error on 15.01

PostPosted: Wed Jan 21, 2015 6:00 pm
by ukoenig
Silvio,

NO, it must be something else ( tested with new FWH )
Images are adjusted to button-size.
Also tested => oBtn1:lTransparent := .t.
.t. or .f. doesn't make any difference.
I tested with alphablended bitmaps. I will test, using other images.

Image

best regards
Uwe :?:

Re: btnbmp error on 15.01

PostPosted: Wed Jan 21, 2015 11:47 pm
by nageswaragunupudi
Please try this fix.
viewtopic.php?f=6&t=30023

Re: btnbmp error on 15.01

PostPosted: Thu Jan 22, 2015 8:26 am
by Silvio.Falconi
Mr Rao,
I made the modifies and run ok
A question ... " if .t."
What is .t. ?
it not need a variable type "Uwe:= .t."

Re: btnbmp error on 15.01

PostPosted: Thu Jan 22, 2015 8:29 am
by nageswaragunupudi
.t. means true.

We shall soon publish a more comprehensive fix.

Re: btnbmp error on 15.01

PostPosted: Fri Jan 23, 2015 10:36 am
by Silvio.Falconi
But on Winxp professional SP3 I have also the error


@ 235, 118 BTNBMP oBtnOK PROMPT "&Conferma" RESOURCE "DLG_OK" SIZE 55, 12 ;
LEFT 2007 ROUND ACTION ( oDlg:end( IDOK ) )
oBtnOK:bClrGrad = bClrGrad
oBtnOK:oCursor := oCursorBtn
oBtnOK:cTooltip := i18n("Registra o modifica il movimento")

@ 235, 182 BTNBMP oBtnCan PROMPT "&Annulla" RESOURCE "DLG_NO" SIZE 55, 12 ;
LEFT 2007 ROUND ACTION ( oDlg:end( IDCANCEL ) )
oBtnCan:bClrGrad = bClrGrad
oBtnCan:oCursor := oCursorBtn
oBtnCan:cTooltip := i18n("Annulla la registrazione del movimento")



When I compile the preprocessor give me an error " Invalid numeric" ERROR ON LEFT
i MUST CHANGE WITH obtnCan:nLayout := 2 why ?

Re: btnbmp error on 15.01

PostPosted: Fri Jan 23, 2015 2:28 pm
by nageswaragunupudi
Firstly your statement has syntax error.
There is no ROUND clause. Should be NOROUND or nothing.
I can also understand that you did not enable warnings for undeclared variables while compiling. That is the reason you did not notice this.

Please remove ROUND clause and it is always desirable to have "OF oDlg"

Re: btnbmp error on 15.01

PostPosted: Fri Jan 23, 2015 11:15 pm
by Silvio.Falconi
Mr Rao , You're Right but I made a test

As you can see I put "ROUND" BUT NOT LEFT and I not inser of dlg and here the sample test run ok I not Know why

Code: Select all  Expand view
#include "fivewin.ch"
#include "constant.ch"

Function Main()

   Local oDlg

   Local  nBottom   := 26
   Local  nRight    := 55
   Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight := nBottom * DLG_CHARPIX_H

   Local oCursorBtn :=TCursor():New(,'HAND')
 Local oFont := TFont():New( GetDefaultFontName(), 0, GetDefaultFontHeight(),, )

 DEFINE DIALOG oDlg        ;
   TITLE  TXT_APPLICAZIONE  ;
   SIZE nWidth, nHeight   PIXEL               ;
   GRADIENT { { 1,LIGHTCYAN, LIGHTCYAN } } TRANSPARENT ;
   FONT oFont      STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )  ICON oIcon

 @    ROW_BTN, 90 BTNBMP oBtnOK PROMPT "&Conferma" RESOURCE "DLG_OK" SIZE 55, 12 ROUND 2007;
       ACTION ( oDlg:end( IDOK ) )
      oBtnOK:bClrGrad = bClrGrad
      oBtnOK:oCursor := oCursorBtn
      oBtnOK:nLayout := 2
      oBtnOK:cTooltip := i18n("Attiva l'aggiornamento")

   @ ROW_BTN, 152 BTNBMP oBtnCan PROMPT "&Annulla" RESOURCE "DLG_NO" SIZE 55, 12 ROUND 2007;
       ACTION  ( oDlg:end( IDCANCEL ) )
      oBtnCan:bClrGrad = bClrGrad
      oBtnCan:oCursor := oCursorBtn
      oBtnCan:nLayout := 2
      oBtnCan:cTooltip := i18n("Annulla ed esci")


ACTIVATE DIALOG oDlg


retu nil


I must insert oBtnOK:nLayout := 2
instead of LEFT command

Re: btnbmp error on 15.01

PostPosted: Sat Jan 24, 2015 11:18 am
by nageswaragunupudi
There is no ROUND clause.
Your statements are syntactically wrong
You do not know because you are compiling unsafely.
Please use flags -w1 -es2
You can also check the preprocessed PPO.
When you have such problems please check your syntax. Please read again the command syntax in the fivewin.ch

Re: btnbmp error on 15.01

PostPosted: Sat Jan 24, 2015 12:19 pm
by Silvio.Falconi
Nages,
I modify the test.prg

Code: Select all  Expand view
#include "fivewin.ch"
#include "constant.ch"



#define TXT_APPLICAZIONE  "test"
#define LIGHTCYAN        nRGB( 203, 225, 252 )

Function Main()

   Local oDlg,oBtnok,oBtnCan,oIcon

   Local  nBottom   := 26
   Local  nRight    := 55
   Local  nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local  nHeight := nBottom * DLG_CHARPIX_H

   Local oCursorBtn :=TCursor():New(,'HAND')
   Local oFont := TFont():New( "tahoma", 0, -12,, )

   Local ROW_BTN := 180

   Local bClrGrad := { | lPressed | If( ! lPressed,;
                           { { 1, nRGB( 253, 254, 255 ), nRGB( 179, 217, 255 ) } },;
                           { { 1, nRGB( 179, 217, 255 ), nRGB( 253, 254, 255 ) } } ) }

 DEFINE ICON oIcon FILENAME "ICON1"

 DEFINE DIALOG oDlg        ;
   TITLE  TXT_APPLICAZIONE  ;
   SIZE nWidth, nHeight   PIXEL               ;
   GRADIENT { { 1,LIGHTCYAN, LIGHTCYAN } } TRANSPARENT ;
   FONT oFont      STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION,  4 )  ICON oIcon

 @    ROW_BTN, 90 BTNBMP oBtnOK PROMPT "&Conferma" FILENAME "DLG_OK.BMP" SIZE 55, 12  2007;
      LEFT  ACTION ( oDlg:end( IDOK ) )
      oBtnOK:bClrGrad = bClrGrad
      oBtnOK:oCursor := oCursorBtn
    *  oBtnOK:nLayout := 2
      oBtnOK:cTooltip := i18n("Attiva l'aggiornamento")

   @ ROW_BTN, 152 BTNBMP oBtnCan PROMPT "&Annulla" FILENAME "DLG_NO.BMP" SIZE 55, 12 2007;
      LEFT  ACTION  ( oDlg:end( IDCANCEL ) )
      oBtnCan:bClrGrad = bClrGrad
      oBtnCan:oCursor := oCursorBtn
     * oBtnCan:nLayout := 2
      oBtnCan:cTooltip := i18n("Annulla ed esci")


ACTIVATE DIALOG oDlg


retu nil



I erase ROUND command as you sad me and there are not "of odlg" command and the dialog run the same

before the btnbmp class not was as now ( or perhaps I remember bad ...this week... I must see oldest app compiled)

I compile allways my apps with es2 and w1 as you can see in this picture

Image

Re: btnbmp error on 15.01

PostPosted: Sat Jan 24, 2015 12:23 pm
by nageswaragunupudi
I compile allways my apps with es2 and w1 as you can see in this picture

Good.
This is always safe and avoids many problems.