Erase btnbmp from another btnbmp, the space remains

Erase btnbmp from another btnbmp, the space remains

Postby Silvio.Falconi » Mon Mar 23, 2020 5:49 pm

I put some small btns inside a big btnbmp

when I go to delete one, the space remains

How can I go about refreshing the big btnbmp so I can't see the space created?

I realize that it is difficult to understand so I thought I would like to make you a small movie to show you what my problem is

Image

I hope you help me, so I create a small test to try
Code: Select all  Expand view  RUN

#include "fivewin.ch"

#define COLOR_PRESSED1 nRGB(255,165,0)

Function test()
  Local oDlg,aBtnBig[1],oBtnSmall[2]
  Local oInvoice // Invoice


Define Dialog oDlg size 750,400

@ 120,20  button  "Insert products" size 45,18 pixel of oDlg;
action  CreateButtonKids(aBtnBig[1],oBtnSmall)

activate dialog oDlg ;
     On init oInvoice:=CreatePanel(oDlg,aBtnBig)
return nil


//-------------------------------------------//
Function CreatePanel(oDlg,aBtnBig)
Local nRow:= 10
Local ncol:= 10
local oPanel
local k

   oPanel   := TScrollPanel():New( 10,10,180,700,oDlg, .t. )
   oPaneL:nRightMargin     := 10
   oPanel:nBottomMargin    := 60
   oPanel:WinStyle(WS_BORDER, .t.)


         For k=1 to Len(aBtnBig)


       @ nRow,ncol BTNBMP aBtnBig[k];
       SIZE 650, 120 PIXEL;
         FLAT RIGHT;
        PROMPT "BIG" of oPanel

       aBtnBig[k]:bAction    := { |aBtnBig,k| aBtnBig:Toggle()}
       aBtnBig[k]:bClrGrad := { |l,oBtn| If( oBtn:lPressed, COLOR_PRESSED1,CLR_WHITE   ) }
         nRow+=120+2
       nCol:=10
    next
     oPanel:SetRange()
   return oPanel

//-------------------------------------------//

Function CreateButtonKids(oBtnBig,oBtnSmall)
Local nRow:= 10
Local ncol:= 210

       @ nRow,ncol BTNBMP oBtnSmall[1];
       SIZE 95, 95 PIXEL;
         FLAT RIGHT;
        PROMPT "small1" of oBtnBig;
          ACTION ::ShowPopUp( { |oBtn| BtnPopMenu( oBtn,oBtnSmall[1]) } )

       ncol+=97

       @ nRow,ncol BTNBMP oBtnSmall[2];
       SIZE 95, 95 PIXEL;
         FLAT RIGHT;
        PROMPT "small2" of oBtnBig ;
           ACTION ::ShowPopUp( { |oBtn| BtnPopMenu( oBtn,oBtnSmall[1]) } )
       return nil


//----------------------------------------------------------------------------------//
 function BtnPopMenu( oBtn,oBmp )

   local oPop
   local n

   MENU oPop POPUP
        MENUITEM "Elimina" ACTION (oBtn:destroy(), oBmp:refresh())
        MENUITEM "Modifica Prezzo" action nil
   ENDMENU
   return oPop
//----------------------------------------------------------------------------------//
 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: Erase btnbmp from another btnbmp, the space remains

Postby Silvio.Falconi » Thu Mar 26, 2020 1:07 pm

Amy solution please
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], karinha, Natter and 74 guests