Page 1 of 2

oPopUp in class btnbmp

Posted: Fri Oct 14, 2022 12:30 pm
by Maurizio
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

Re: oPopUp in class btnbmp

Posted: Fri Oct 14, 2022 3:15 pm
by Antonio Linares
Dear Maurizio,

Would you mind to post here your modifications ?

many thanks

Re: oPopUp in class btnbmp

Posted: Fri Oct 14, 2022 6:07 pm
by karinha
As you did? Show us, using this template, please.

¿Como tú hiciste? Muéstranos, usando esta plantilla, por favor.

Code: Select all | Expand


// 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
 


Gracias, thanks.

Regards, saludos.

Re: oPopUp in class btnbmp

Posted: Sat Oct 15, 2022 6:52 pm
by Silvio.Falconi
Karinha

Please erase the FUNCTION AdjustWnd( oBtn, nWidth, nHeight ) we havent the autorization to publish it !!!

Re: oPopUp in class btnbmp

Posted: Sat Oct 15, 2022 7:52 pm
by karinha
Silvio.Falconi wrote:Karinha

Please erase the FUNCTION AdjustWnd( oBtn, nWidth, nHeight ) we havent the autorization to publish it !!!


Dear Silvio, I didn't know that you were the owner of this function, since he is PUBLIC. But it's ok, I removed it. I don't agree with your position, but it's done.

Estimado Silvio, no sabía que eras el dueño de esta función, ya que es PÚBLICO. Pero está bien, lo eliminé. No estoy de acuerdo con tu posición, pero ya está hecho.

Look at the function here:

Mira la función aquí:

http://www.pctoledo.com.br/forum/viewtopic.php?f=2&t=1170&p=3643&hilit=+dificil+aprendizado+

Is it good for you like this?

¿Te hace bien así?

Regards, saludos.

Re: oPopUp in class btnbmp

Posted: Sat Oct 15, 2022 8:05 pm
by karinha
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=4be501ba081a38054668e56d743cf050


Gracias, thanks.

Regards, saludos.

Re: oPopUp in class btnbmp

Posted: Sat Oct 15, 2022 9:25 pm
by Silvio.Falconi
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.


I Know well the forum rules

every now and then in this forum some characters come out who believe themselves masters on earth and on the world and also professors who are experts in the rules of the fivetech software forum and we seniors have to succumb

on that topic I not see that function in my message but only on your message , you published a not mine function I sent you via private mail!!!
the function is of José Luis Sánchez of Alanit Software and integrated on Tinforme class

Re: oPopUp in class btnbmp

Posted: Sun Oct 16, 2022 7:49 am
by Antonio Linares
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

Re: oPopUp in class btnbmp

Posted: Sun Oct 16, 2022 9:06 am
by Silvio.Falconi
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


Antonio, Te expliqué en privado.
josè de alanit si bien ha publicado sus fuentes de github no ha liberado ningún tipo de licencia y eso quiere decir que en realidad no tenemos el permiso para publicarlas en un foro público

Image

Tuve un pseudo problema con btnbmp unos días (ver atrás https://forums.fivetechsupport.com/viewtopic.php?f=3&t=42263&sid=a4880c7facc5b2f5f8af8d234ff88a47), luego me di por vencido y ahora uso un control tget

Re: oPopUp in class btnbmp

Posted: Sun Oct 16, 2022 9:15 am
by Silvio.Falconi
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



Sorry Mauri,

I not understood, are you talking about space see orange arrow?

Image

I think you must modify PaintPopupSection() method

Re: oPopUp in class btnbmp

Posted: Mon Oct 17, 2022 6:55 am
by Maurizio
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

Re: oPopUp in class btnbmp

Posted: Mon Oct 17, 2022 6:58 am
by Antonio Linares
Dear Maurizio,

good morning

would you mind to post the complete PRG here ?

many thanks

Re: oPopUp in class btnbmp

Posted: Mon Oct 17, 2022 7:09 am
by Silvio.Falconi
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


I hae another release and not found th eline number you wrote

Re: oPopUp in class btnbmp

Posted: Mon Oct 17, 2022 7:19 am
by Antonio Linares
Dear Silvio,

Thats why I asked Maurizio to post the complete PRG :-)

Re: oPopUp in class btnbmp

Posted: Mon Oct 17, 2022 7:24 am
by Silvio.Falconi
Antonio Linares wrote:Dear Silvio,

Thats why I asked Maurizio to post the complete PRG :-)

I asked now via private mail ...same question