oPopUp in class btnbmp

oPopUp in class btnbmp

Postby Maurizio » Fri Oct 14, 2022 12:30 pm

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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: oPopUp in class btnbmp

Postby Antonio Linares » Fri Oct 14, 2022 3:15 pm

Dear Maurizio,

Would you mind to post here your modifications ?

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: oPopUp in class btnbmp

Postby karinha » Fri Oct 14, 2022 6:07 pm

As you did? Show us, using this template, please.

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

Code: Select all  Expand view

// 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Sat Oct 15, 2022 6:52 pm

Karinha

Please erase the FUNCTION AdjustWnd( oBtn, nWidth, nHeight ) we havent the autorization to publish 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: oPopUp in class btnbmp

Postby karinha » Sat Oct 15, 2022 7:52 pm

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPopUp in class btnbmp

Postby karinha » Sat Oct 15, 2022 8:05 pm

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Sat Oct 15, 2022 9:25 pm

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

Re: oPopUp in class btnbmp

Postby Antonio Linares » Sun Oct 16, 2022 7:49 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Sun Oct 16, 2022 9:06 am

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
Last edited by Silvio.Falconi on Sun Oct 16, 2022 9:29 am, edited 2 times in total.
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Sun Oct 16, 2022 9:15 am

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

Re: oPopUp in class btnbmp

Postby Maurizio » Mon Oct 17, 2022 6:55 am

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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: oPopUp in class btnbmp

Postby Antonio Linares » Mon Oct 17, 2022 6:58 am

Dear Maurizio,

good morning

would you mind to post the complete PRG here ?

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Mon Oct 17, 2022 7:09 am

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

Re: oPopUp in class btnbmp

Postby Antonio Linares » Mon Oct 17, 2022 7:19 am

Dear Silvio,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: oPopUp in class btnbmp

Postby Silvio.Falconi » Mon Oct 17, 2022 7:24 am

Antonio Linares wrote:Dear Silvio,

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

I asked now via private mail ...same question
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 94 guests