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
#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 March-April 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