New BTNBMP more different

New BTNBMP more different

Postby Silvio.Falconi » Sat Feb 02, 2019 10:01 am

In the old application when a user clicked on an umbrella, the image remained the same size,
but now the image becomes smaller, how can I get back to the same configuration that I had before?

Image
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: New BTNBMP more different

Postby nageswaragunupudi » Sat Feb 02, 2019 10:32 am

Can you provide a sample using bitmaps in the fwh\bitmaps folder?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: New BTNBMP more different

Postby Silvio.Falconi » Sat Feb 02, 2019 11:09 am

Before I must say
I add on BTNBMP the string on bold

METHOD PaintPopupSection() CLASS TBtnBmp
local nWidth, nHeight, hDC
local hBlackBrush, hOldBrush
local hDarkPen, hLightPen, hOldPen
if ::oPopup != nil .and. GetClassName( GetParent( Self:hWnd ) ) = "TBAR"

this for erase the arrow on the left of btnbmp

I use this png "c:\work\fwh\bitmaps\pngs\image5.png"

this is the test you request
Code: Select all  Expand view  RUN

#include "fivewin.ch"
#include "constant.ch"

#define OMB_W 50
#define OMB_H 50
#define COLOR_BEACH nRGB(255,221,187)

Function Test()
Local oDlg
   local nBottom   := 48.6
   local nRight    :=99
   local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   local nHeight := nBottom * DLG_CHARPIX_H
   local oPanel
   Local oBrush1

   DEFINE BRUSH oBrush1 COLOR COLOR_BEACH
 DEFINE DIALOG oDlg SIZE nWidth, nHeight ;
    STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME ) ;
      TITLE "test"


ACTIVATE DIALOG oDLG ;
ON INIT (oPanel:=CreatePanelTouch2( oDlg,oBrush1),;
             Load_Btn(oPanel),;
             oPanel:SetRange()                              ,;
             oPanel:CheckResize() )



//------------------------------------------------------//
Function Load_BTN(oDlg)
Local nx:=1,ny:=1,numero:=OMB_W
Local abtn:= array(10)
Local nElemento:=1

@ ny*numero, nx*numero-20 BTNBMP aBtn[ nElemento ] ;
           RESOURCE "c:\work\fwh\bitmaps\pngs\image5.png";
           SIZE OMB_H,OMB_W PIXEL OF oDlg ;
            FLAT TOP COLOR CLR_WHITE,CLR_GREEN NOBORDER ;
            ACTION ( ::oPopup := { |oBtn| BtnPopMenu( oBtn ) }, ;
                  ::ShowPopUp(), ;
                  ::oPopup := nil )

aBtn[nElemento]:lTransparent:=.t.

return nil

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

Function CreatePanelTouch2( oDlg,oBrush)
 local oPanel,oBtn
 local nSplit:=0
                 
 oDlg:aMinMaxInfo := { nil, nil, nil, nil, 999, 570, nil, nil } //878, 570

   oPanel:= TScrollPanel():New( 45,nSplit+5,oDlg:nbottom-5,oDlg:nWidth-5,oDlg, .t. )
   oPanel:nRightMargin     := 10
   oPanel:nBottomMargin    := 10
   oPanel:SetBrush(oBrush)
                 
return oPanel
//---------------------------------------------------------------//

function BtnPopMenu( oBtn)

   MENU oPop POPUP

   MENUITEM "some info 1"
   MENUITEM " info2"
    MENUITEM "info"
    ENDMENU
 return oPop

 





I like also when the user resize the dialog, all items are on Panel must be resize, how make it ?
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: New BTNBMP more different

Postby nageswaragunupudi » Sat Feb 02, 2019 11:40 am

but now the image becomes smaller, how can I get back to the same configuration that I had before?

This does not happen if you use FWH libraries without your modifications.
The problem is created by your modifications.

Advice:
1. Do not modify btnbmp.prg. Use fwh classes without any modifications.
2. Define the btnbmp in this way:
Code: Select all  Expand view  RUN
  @ 50,50 BTNBMP FILE "\fwh\bitmaps\pngs\image5.png" ;
      SIZE 50,50 PIXEL OF oDlg FLAT NOBORDER ;
      COLOR CLR_WHITE,CLR_GREEN ;
      ACTION ::ShowPopUp( { |oBtn| BtnPopMenu( oBtn ) } )
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: New BTNBMP more different

Postby Silvio.Falconi » Sun Feb 03, 2019 8:46 am

thanks now seem run ok with stardard fwh class btnbmp.
probably before there were problems I was shown a black arrow to the right of the button with a vertical line that was not good to view an entire beach because the arrow was located at the end of the button and close to the other and was impractical use, that's why I changed the class.
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: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: New BTNBMP more different

Postby nageswaragunupudi » Sun Feb 03, 2019 9:22 am

Silvio.Falconi wrote:thanks now seem run ok with stardard fwh class btnbmp.
probably before there were problems I was shown a black arrow to the right of the button with a vertical line that was not good to view an entire beach because the arrow was located at the end of the button and close to the other and was impractical use, that's why I changed the class.

There were never any problems.
It is just that you overlooked the simple solutions and adopted a complex approach and that too incomplete.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests