// C:\FWH..\SAMPLES\PICTCOLO.PRG
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL oDlg , oMenuPop, oBtnX, oBtnX2, MENU, oFont, aGrad
LOCAL nColor1 := CLR_BLACK
LOCAL nColor2 := CLR_WHITE
SET _3DLOOK ON
SetBalloon( .T. )
SkinButtons()
MENU oMenuPop POPUP 2007
MENUITEM "First " ACTION MsgInfo( "first" )
SEPARATOR
MENUITEM "Second " ACTION MsgInfo( "second" )
SEPARATOR
MENUITEM "Colores " ACTION( PicKColors( oBtnx, oDlg,, "gray" ) )
ENDMENU
aGrad := { { 0.30, CLR_WHITE, CLR_HCYAN },{ 0.50, CLR_WHITE, CLR_HCYAN } }
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 00, -16 BOLD
DEFINE DIALOG oDlg SIZE 500, 400 PIXEL TRUEPIXEL RESIZABLE ;
TITLE "Tavolozza colori numeri" GRADIENT aGrad FONT oFont
oDlg:lhelpIcon := .F.
@ 50, 50 BTNBMP oBtnx SIZE 60, 60 PIXEL OF oDlg FLAT NOBORDER ;
PROMPT "Color" FILENAME "..\bitmaps\16x16\floppy.bmp" BOTTOM ;
COLOR nColor1, nColor2 ;
ACTION( PicKColors( oBtnx, oDlg,, "gray" ) )
oDlg:aControls[ 1 ]:oPopup := oMenuPop
@ 50, 120 BTNBMP oBtnx2 SIZE 60, 60 PIXEL OF oDlg FLAT NOBORDER ;
PROMPT "Exit" FILENAME "..\bitmaps\16x16\Exit.bmp" BOTTOM ;
COLOR CLR_BLACK, nRgb( 238, 236, 219 ) ;
ACTION( oDlg:End() )
oBtnX2:lCancel := .T.
ACTIVATE DIALOG oDlg CENTERED
oFont:End()
RETURN NIL
FUNCTION PicKColors( ocontrol, oParent, lHex, cColore )
LOCAL oDlgSel, oPanel
LOCAL aColors := {}
LOCAL aReturnvalue := {}
LOCAL nSelection := 1
DEFAULT lHex := .F.
DEFINE DIALOG oDlgSel SIZE 400, 200 PIXEL
oDlgSel:nStyle = nOR( WS_CHILD, WS_BORDER, WS_VISIBLE, WS_POPUP )
ACTIVATE DIALOG oDlgSel CENTERED
RETURN NIL
// FIN / END
Silvio.Falconi wrote:Karinha
Please erase the FUNCTION AdjustWnd( oBtn, nWidth, nHeight ) we havent the autorization to publish it !!!
karinha wrote:Dear Silvio, here you made it PUBLIC as well. The moment you post a source code on FORUM, the source code belongs to all FIVEWIN users. It's the rules, if you understand that you won't be able to fit the forum rules, feel free to stay or leave honorably.
Estimado Silvio, aquí lo hiciste PÚBLICO también. En el momento en que publica un código fuente en FORUM, el código fuente pertenece a todos los usuarios de FIVEWIN. Son las reglas, si entiendes que no podrás ajustarte a las reglas del foro, siéntete libre de quedarte o irte honorablemente.
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=42263&sid=c80da79f41eccdffd408d2a6abdc50d2
Gracias, thanks.
Regards, saludos.
Antonio Linares wrote:Dear Silvio,
function AdjustWnd() is public on github posted by Jose Luis:
https://github.com/JoseluisSanchez/colossus/blob/0dcf9170fb24c33dd973520097f39a5e3d1d4780/prg/ut_common.prg
Lets try to help Maurizio here, thanks
Maurizio wrote:I often use btnBmp: oPopUp, but in the button the horizontal space reserved for the PopUp is tight.
It is possible in future versions to have a variable to fix the width directly in the btnbmp class. prg?
(Now I modified the btnbmp.prg class to enlarge it)
Maurizio
Maurizio wrote:I use April 2022 to June 2022
the changes I made are :
line 18
#define POPWIDTH 30 //12
new variable in line 129
DATA nWide_P
set variable line 325
::nWide_P := 22
and line 503
::nWide_P := 22
Line 525
If( oPopup != nil, ::nWide_P, 0 ) //// My_modi If( oPopup != nil, 13, 0 )
Line 578
//::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + 13 + 1
::oWnd:nWidth := ::oWnd:nBtnWidth + If( ::oWnd:l3D, 3, 1 ) + ::nWide_P + 1
Line 1062
//if nCol >= ::nWidth() - 13
if nCol >= ::nWidth() - ::nWide_P
Line 2079
//MoveTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), 1 )
//LineTo( hDC, nWidth - 12 + If( ::lPressed, 1, 0 ), nHeight - 1 )
MoveTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), 1 )
LineTo( hDC, nWidth - ::nWide_P - 1 + If( ::lPressed, 1, 0 ), nHeight - 1 )
SelectObject( hDC, hDarkPen )
//MoveTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), 1 )
//LineTo( hDC, nWidth - 13 + If( ::lPressed, 1, 0 ), nHeight - 1 )
MoveTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), 1 )
LineTo( hDC, nWidth - ::nWide_P + If( ::lPressed, 1, 0 ), nHeight - 1 )
Maurizio
Antonio Linares wrote:Dear Silvio,
Thats why I asked Maurizio to post the complete PRG
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 50 guests