Page 1 of 1

error on btnbmp with fwh 21.04

Posted: Thu Jun 03, 2021 7:07 pm
by Silvio.Falconi

Code: Select all | Expand

@ oBrw:nBottom+2, oBrw:nWidth-20 BTNBMP aBtnBrow[4] ;
                        FLAT  SIZE 30, 30  OF oDlg   PIXEL ;
                        COLOR  nRgb(238,236,219),nRgb(238,236,219) ;
                        BITMAP ".\bitmaps\impostazioni.bmp" NOROUND;
                        ACTION ::ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf)  } )


the error

Code: Select all | Expand

Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 21.04
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 0 mins 45 secs
   Error occurred at: 06/03/21, 13:55:54
   Error description: Error BASE/1004  No exported method: END
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => END( 0 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:SHOWPOPUP( 2091 )
   Called from: James.prg => (b)TESTTDATABASE( 154 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 713 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 999 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1817 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2051 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
   Called from: James.prg => TESTTDATABASE( 202 )



it seems to be an old error already fixed or an old version of tbtnbmp has been linked

Re: error on btnbmp with fwh 21.04

Posted: Fri Jun 04, 2021 5:53 am
by nageswaragunupudi
ACTION ::ShowPopUp(...) is working here.
Please make sure the codeblock returns PopupMenu object

Re: error on btnbmp with fwh 21.04

Posted: Fri Jun 04, 2021 1:32 pm
by Horizon
Thank you Silvio,

This is what I was looking for BtnBmp class.

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 10:42 am
by cnavarro
Silvio, for ACTIONS in BUTTONS, try with

Code: Select all | Expand


local oThis    := Self

@ oBrw:nBottom+2, oBrw:nWidth-20 BTNBMP aBtnBrow[4] ;
                        FLAT  SIZE 30, 30  OF oDlg   PIXEL ;
                        COLOR  nRgb(238,236,219),nRgb(238,236,219) ;
                        BITMAP ".\bitmaps\impostazioni.bmp" NOROUND;
                        ACTION oThis:ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf)  } )
 

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 11:00 am
by nageswaragunupudi
cnavarro wrote:Silvio, for ACTIONS in BUTTONS, try with

Code: Select all | Expand


local oThis    := Self

@ oBrw:nBottom+2, oBrw:nWidth-20 BTNBMP aBtnBrow[4] ;
                        FLAT  SIZE 30, 30  OF oDlg   PIXEL ;
                        COLOR  nRgb(238,236,219),nRgb(238,236,219) ;
                        BITMAP ".\bitmaps\impostazioni.bmp" NOROUND;
                        ACTION oThis:ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf)  } )
 

Sorry please. Not correct.

In the clause "ACTION ::ShowPopup", Self is the button object. not the local Self

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 1:32 pm
by Silvio.Falconi
sometimes is go out the error , I'am trying many times
the function return omenu obj

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 1:33 pm
by cnavarro
nageswaragunupudi wrote:
cnavarro wrote:Silvio, for ACTIONS in BUTTONS, try with

Code: Select all | Expand


local oThis    := Self

@ oBrw:nBottom+2, oBrw:nWidth-20 BTNBMP aBtnBrow[4] ;
                        FLAT  SIZE 30, 30  OF oDlg   PIXEL ;
                        COLOR  nRgb(238,236,219),nRgb(238,236,219) ;
                        BITMAP ".\bitmaps\impostazioni.bmp" NOROUND;
                        ACTION oThis:ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf)  } )
 

Sorry please. Not correct.

In the clause "ACTION ::ShowPopup", Self is the button object. not the local Self


Excuse me, that goes without saying
What I mean is that if the method you are calling is from the user class you are using, in the call in the ACTION of the buttons, it must expressly refer to the SELF of your class, because if not the ACTION understands which is a method of the class TBUTTON, TBTNBMP, etc.
In this case, if the method, you are calling ( ::ShowPopUp ) belongs to its class and not to TBTNBMP, my assessment is correct.

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 6:24 pm
by nageswaragunupudi
He is calling BtnBmp's ShowPopup method only. It should work if using unmodified libraries and the codeblock returns a popup menu object.

Re: error on btnbmp with fwh 21.04

Posted: Sun Jun 06, 2021 8:27 pm
by Silvio.Falconi
Nages, Cristobal, this is very strange !!!!

I am trying to intercept the error again but it does not always come out and then this evening
a strange very strange thing happened because I called a function which is on line 128
and instead made a mistake in another function which is on line 154

I'll explain with more details

the error

Code: Select all | Expand

Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 21.04
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 1 mins 18 secs
   Error occurred at: 06/06/21, 19:17:33
   Error description: Error BASE/1004  No exported method: END
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => END( 0 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:SHOWPOPUP( 2091 )
   Called from: James.prg => (b)TESTTDATABASE( 154 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 713 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 999 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1817 )
   Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2051 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3560 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
   Called from: James.prg => TESTTDATABASE( 202 )







I explain you

I have on line 128 of my procedure this line

oBrw:bRClicked := {|nRow,nCol| CLDisp_Men(nRow,nCol,oBrw,cPrefixState+"Aux",oDbf,oDlg)}

CLDisp_Men function open a menu

Code: Select all | Expand



Function  CLDisp_Men(nRow,nCol,oBrw,cIniEntry,oDbf,oDlg)
           local oMenu

      MENU oMenu POPUP
        MENUITEM "Esporta" ACTION ExportToExcel( oBrw )
         SEPARATOR
        MENUITEM "Colonne" ACTION Ut_BrwColConfig( oBrw, cIniEntry )
           SEPARATOR
           MENUITEM "al primo record  " +space(6)+ CHR(VK_TAB) + "Ctrl+Home";
              MESSAGE "Mostra la lista dal primo record";
              RESOURCE "GRID_TOP";
              ACTION oBrw:KeyDown(VK_HOME, 0)  WHEN (oDbf:KeyCount()) > 0
 .......
 ENDMENU
         ACTIVATE POPUP oMenu OF oDlg AT  oBrw:nTop+nRow, oBrw:nLeft+nCol
         return NIL


 


and this evening I 'm using this menu when is go out the error

But the error is go out to another line 154 where I have this

@ oBrw:nBottom+2, oBrw:nWidth-20 BTNBMP aBtnBrow[4] ;
FLAT SIZE 30, 30 OF oDlg PIXEL ;
COLOR nRgb(238,236,219),nRgb(238,236,219) ;
BITMAP ".\bitmaps\impostazioni.bmp" NOROUND;
ACTION ::ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf) } )


MenuContextual(oBtn,oBrw,cPrefixState+"Aux",oDbf) is a copy of CLDisp_Men function but return oMenu object


Code: Select all | Expand

Function MenuContextual(oControl,oBrw,cIniEntry,oDbf)
           local oMenu

    MENU oMenu POPUP
        MENUITEM "Esporta" ACTION ExportToExcel( oBrw )
         SEPARATOR
        MENUITEM "Colonne" ACTION Ut_BrwColConfig( oBrw, cIniEntry )
           SEPARATOR
           MENUITEM "al primo record  " +space(6)+ CHR(VK_TAB) + "Ctrl+Home";
              MESSAGE "Mostra la lista dal primo record";
              RESOURCE "GRID_TOP";
              ACTION oBrw:KeyDown(VK_HOME, 0)  WHEN (oDbf:KeyCount()) > 0
.....
  ENDMENU

         return oMenu