a folder into a dialog

a folder into a dialog

Postby Silvio.Falconi » Sat Jun 08, 2024 3:56 pm

I have a folder into a dialog

at the bottom of the dialog there is a buttonbar,

the dialogs (tabs) of the folder are not all of the same height, that is, some dialogs (tabs) are filled with several controls, others with just a few controls

I would like the dialog to change the height depending on the selected forder, can this be done in fivewin?

or do all the dialogs in the folder have to be the same size?
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: a folder into a dialog

Postby Otto » Sat Jun 08, 2024 5:23 pm

Silvio, Have I understood your function description correctly?
Should it look something like this?
Regards,
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: a folder into a dialog

Postby Antonio Linares » Sun Jun 09, 2024 5:39 pm

Dear Silvio,

Please provide an example PRG to test it, thanks
regards, saludos

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

Re: a folder into a dialog

Postby Silvio.Falconi » Mon Jun 10, 2024 10:23 am

Antonio Linares wrote:Dear Silvio,

Please provide an example PRG to test it, thanks



here a small test

Code: Select all  Expand view
#include "FiveWin.ch"
#include "Constant.ch"



 #define DLG_nColorDlg     RGB(245,245,235)
 #define DLG_nColortitle1  RGB(219,230,244)
 #define DLG_nColortitle2  RGB(207,221,239)
 #define DLG_nColorBar1    RGB(250,250,245)
 #define DLG_nColorBar2    RGB(245,245,235)
 #define DLG_nColorBtn1    RGB(245,245,235)
 #define DLG_nColorBtn2    RGB(250,250,245)
 #define DLG_nColorBtnB    RGB(195,195,185)





Function Test()
local oDlg,oFld,oFont,oBold
local oBar,oBtnAnnulla,oBtnAiuto,oBtnConferma
local aFolder := {"Menu1","Menu2","Menu3","Menu4","Menu5","Menu6"}
local aCooDlg := {0,0}

          local nBottom:= 41
          local nRight := 94.6
          local nHt       := nBottom * DLG_CHARPIX_H
          local nWd       := Max( nRight * DLG_CHARPIX_W, 180 )

        aCooDlg[1]:=nWd
        aCooDlg[2]:=nHt


        oFont := TFont():New( "TAHOMA", 0, 18,, )
        oBold := TFont():New( "TAHOMA", 0, 14,,.t. )


       DEFINE DIALOG oDlg SIZE aCooDlg[1], aCooDlg[2] PIXEL TRUEPIXEL;
       FONT oFont  title "test folder" COLOR CLR_BLACK, DLG_nColorDlg  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)


      //-------------------------------------------------ButtonBar
      DEFINE BUTTONBAR oBar OF oDlg SIZE 84, 70  2015   BOTTOM NOBORDER
      DEFINE BUTTON oBtnAnnulla OF oBar ;
      FILENAME "DLG_NO";
      PROMPT "Annulla" TOOLTIP "Esci" ;
      ACTION   ( oDlg:end( IDCANCEL ) )
      DEFINE BUTTON oBtnAiuto OF oBar  ;
      FILENAME "HLP_DLG";
      PROMPT "Aiuto" TOOLTIP "Aiuto" ;
      ACTION NIL   GROUP
      DEFINE BUTTON oBtnConferma OF oBar  BTNRIGHT  ;
      FILENAME "DLG_OK";
      PROMPT "Conferma" ;
      TOOLTIP "Conferma i dati" ;
      ACTION   ( oDlg:end( IDOK ) )
      oBar:bClrGrad := { | lPressed | If( ! lPressed,;
                 { { 1, DLG_nColorBar1, DLG_nColorBar1} },;
                 { { 1, DLG_nColorBar2, DLG_nColorBar2} } ) }
     //-----------------------------------------------------------------//





 @100,0 FOLDEREX oFld PROMPTS aFolder ;
   SIZE oDlg:nWidth,oDlg:nHeight-200  PIXEL   ;
   FONT oFont  ;
   COLOR nRgb( 245,244,234) ROUND 0


       oFld:bAction:= { || change_size(oFld:nOption,aCooDlg,oDlg,oFld,oBar)   }

                    oDlg:bResized  := <||
                    local oRect         := oDlg:GetCliRect()
                     oFld:nbottom   := oRect:nBottom-100
                       RETURN nil
                                     >

ACTIVATE DIALOG oDlg  CENTER  ;
ON INIT (oDlg:resize(), ChangeButtons( oBar )  )
RETURN NIL
//-----------------------------------------------------------------//
Function change_size(n,aCooDlg,oDlg,oFld,obar)
   local nBottom,nHt
   Do case

   case n= 3
      nBottom:= 32.4
       nHt       := nBottom * DLG_CHARPIX_H
   case n= 6
      nBottom:= 22
      nHt       := nBottom * DLG_CHARPIX_H

     OTHERWISE
       nHt       := aCooDlg[2]

     endcase

     oDlg:setsize( aCooDlg[1],nHt)

     eval( oDlg:bResized )
     oBar:refresh()

      RETURN NIL

//------------------------------------------------------------------------//
function ChangeButtons( oBar )
       AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
 return .T.
//----------------------------------------------//

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

Re: a folder into a dialog

Postby karinha » Mon Jun 10, 2024 3:14 pm

Based on your example, I would do it like this:

Según tu ejemplo, lo haría así:

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILVFLD2.PRG

#Include "FiveWin.ch"
#Include "Constant.ch"

#define DLG_nColorDlg    RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1   RGB(250,250,245)
#define DLG_nColorBar2   RGB(245,245,235)
#define DLG_nColorBtn1   RGB(245,245,235)
#define DLG_nColorBtn2   RGB(250,250,245)
#define DLG_nColorBtnB   RGB(195,195,185)
#Define aPubGrad {| lInvert | If( lInvert, ;
                 { { 1 / 3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
                 { 2 / 3, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) }    ;
                 },                                                         ;
                 { { 1 / 2, nRGB( 219, 230, 244 ), nRGB( 207 - 50, 221 - 25, 255 ) }, ;
                 { 1 / 2, nRGB( 201 - 50, 217 - 25, 255 ), nRGB( 231, 242, 255 ) }    ;
                 } ) }

STATIC oBtnAnnulla, oBtnAiuto, oBtnConferma

FUNCTION Test_Folder_Silvio()

   LOCAL oDlg   AS OBJECT
   LOCAL oFld   AS OBJECT
   LOCAL oFont  AS OBJECT
   LOCAL oBold  AS OBJECT
   LOCAL oBar   AS OBJECT
   LOCAL oBrush AS OBJECT
   LOCAL oImage AS OBJECT
   LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
   LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
   LOCAL nBottom := 41
   LOCAL nRight  := 94.6
   LOCAL nHt     := nBottom * DLG_CHARPIX_H
   LOCAL nWd     := Max( nRight * DLG_CHARPIX_W, 180 )

   aCooDlg[ 1 ]  := nWd
   aCooDlg[ 2 ]  := nHt

   SkinButtons()

   aGrad := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue

   DEFINE BRUSH oBrush COLOR aGrad

   oFont := TFont():New( "TAHOMA", 0, 18,, )
   oBold := TFont():New( "TAHOMA", 0, 14,, .T. )

   DEFINE DIALOG oDlg SIZE aCooDlg[ 1 ], aCooDlg[ 2 ] PIXEL TRUEPIXEL ;
      FONT oFont TITLE "Test Folder Advanced by Silvio Falconi"       ;
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,     ;
      WS_MINIMIZEBOX ) BRUSH oBrush

   DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK TOP OF oDlg 2007

   WITH OBJECT oBar  // VER: ANCHO.PRG

      oBar:bClrGrad := aPubGrad

      oBar:bRClicked := { || ( NIL ) } // Mouse Direito
      oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo

      oBar:SetFont( oBold )
      oBar:nClrText := CLR_HBLUE // BLACK
      oBar:Adjust()

   END

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT ;
      ACTION MsgInfo( "New" )                                     ;
      TOOLTIP "Creates a new document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT     ;
      ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) ) ;
      TOOLTIP "Opens a document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
      ACTION MsgInfo( Time() ) TOOLTIP "Saves this document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
      ACTION MsgInfo( "Prints this document" ) TOOLTIP "Print this document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\prop.bmp" FLAT ;
      ACTION( NIL ) TOOLTIP "Setup the printer" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\HelpInd.bmp" FLAT ;
      ACTION MsgInfo( Version() ) TOOLTIP "A multiple lines" +        ;
      Chr( 13 ) + Chr( 10 ) + "tooltip!" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Help.bmp" FLAT ;
      ACTION MsgInfo( "fivewin power!" ) TOOLTIP "fivewin power!" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
      ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP

   @ 060, 0 FOLDEREX oFld PROMPTS aFolder        ;
      SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
      FONT oFont COLOR aGrad                     ;
      TAB HEIGHT 40 ROUND 5 TOP

   WITH OBJECT oFld

      :lTransparent := .T.
      :aGradSel   := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
      :aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
      :aGradOver  := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
      :aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
      :aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
      //
      :SetOption( 1 )
      :aEnable = { .T., .T., .T., .T., .T., .T., .F. }
      :Show()
      // :DisableTab( 3 )  // idem a :aEnable
      // :oCursor := oHand
   END

   @ nLinha, 15 SAY "Código 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar )   }

   oDlg:bResized := < ||
   LOCAL oRect   := oDlg:GetCliRect()
   oFld:nbottom  := oRect:nBottom - 100

   RETURN NIL
   >

   @ 080, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )

  oBrush:End()
  oBold:End()
  oFont:End()

RETURN NIL

FUNCTION change_size( n, aCooDlg, oDlg, oFld, obar )

   LOCAL nBottom, nHt

   DO CASE
   CASE n = 3

      nBottom := 32.4
      nHt     := nBottom * DLG_CHARPIX_H

   CASE n = 6

      nBottom := 22

      nHt     := nBottom * DLG_CHARPIX_H

   OTHERWISE

      nHt     := aCooDlg[ 2 ]

   ENDCASE

   oDlg:Hide()

   oDlg:SetSize( aCooDlg[ 1 ], nHt )

   oDlg:Show()

   Eval( oDlg:bResized )

   oBar:Refresh()
   // oDlg:Refresh()

RETURN NIL

FUNCTION ChangeButtons( oBar )

   AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )

RETURN( .T. )

// FIN / END - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: a folder into a dialog

Postby Silvio.Falconi » Tue Jun 11, 2024 8:09 am

karinha wrote:Based on your example, I would do it like this:

Según tu ejemplo, lo haría así:

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILVFLD2.PRG

#Include "FiveWin.ch"
#Include "Constant.ch"

#define DLG_nColorDlg    RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1   RGB(250,250,245)
#define DLG_nColorBar2   RGB(245,245,235)
#define DLG_nColorBtn1   RGB(245,245,235)
#define DLG_nColorBtn2   RGB(250,250,245)
#define DLG_nColorBtnB   RGB(195,195,185)
#Define aPubGrad {| lInvert | If( lInvert, ;
                 { { 1 / 3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
                 { 2 / 3, nRGB( 255, 215,  84 ), nRGB( 255, 233, 162 ) }    ;
                 },                                                         ;
                 { { 1 / 2, nRGB( 219, 230, 244 ), nRGB( 207 - 50, 221 - 25, 255 ) }, ;
                 { 1 / 2, nRGB( 201 - 50, 217 - 25, 255 ), nRGB( 231, 242, 255 ) }    ;
                 } ) }

STATIC oBtnAnnulla, oBtnAiuto, oBtnConferma

FUNCTION Test_Folder_Silvio()

   LOCAL oDlg   AS OBJECT
   LOCAL oFld   AS OBJECT
   LOCAL oFont  AS OBJECT
   LOCAL oBold  AS OBJECT
   LOCAL oBar   AS OBJECT
   LOCAL oBrush AS OBJECT
   LOCAL oImage AS OBJECT
   LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
   LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
   LOCAL nBottom := 41
   LOCAL nRight  := 94.6
   LOCAL nHt     := nBottom * DLG_CHARPIX_H
   LOCAL nWd     := Max( nRight * DLG_CHARPIX_W, 180 )

   aCooDlg[ 1 ]  := nWd
   aCooDlg[ 2 ]  := nHt

   SkinButtons()

   aGrad := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue

   DEFINE BRUSH oBrush COLOR aGrad

   oFont := TFont():New( "TAHOMA", 0, 18,, )
   oBold := TFont():New( "TAHOMA", 0, 14,, .T. )

   DEFINE DIALOG oDlg SIZE aCooDlg[ 1 ], aCooDlg[ 2 ] PIXEL TRUEPIXEL ;
      FONT oFont TITLE "Test Folder Advanced by Silvio Falconi"       ;
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,     ;
      WS_MINIMIZEBOX ) BRUSH oBrush

   DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK TOP OF oDlg 2007

   WITH OBJECT oBar  // VER: ANCHO.PRG

      oBar:bClrGrad := aPubGrad

      oBar:bRClicked := { || ( NIL ) } // Mouse Direito
      oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo

      oBar:SetFont( oBold )
      oBar:nClrText := CLR_HBLUE // BLACK
      oBar:Adjust()

   END

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT ;
      ACTION MsgInfo( "New" )                                     ;
      TOOLTIP "Creates a new document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT     ;
      ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) ) ;
      TOOLTIP "Opens a document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
      ACTION MsgInfo( Time() ) TOOLTIP "Saves this document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
      ACTION MsgInfo( "Prints this document" ) TOOLTIP "Print this document" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\prop.bmp" FLAT ;
      ACTION( NIL ) TOOLTIP "Setup the printer" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\HelpInd.bmp" FLAT ;
      ACTION MsgInfo( Version() ) TOOLTIP "A multiple lines" +        ;
      Chr( 13 ) + Chr( 10 ) + "tooltip!" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Help.bmp" FLAT ;
      ACTION MsgInfo( "fivewin power!" ) TOOLTIP "fivewin power!" GROUP

   DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
      ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP

   @ 060, 0 FOLDEREX oFld PROMPTS aFolder        ;
      SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
      FONT oFont COLOR aGrad                     ;
      TAB HEIGHT 40 ROUND 5 TOP

   WITH OBJECT oFld

      :lTransparent := .T.
      :aGradSel   := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
      :aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
      :aGradOver  := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
      :aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
      :aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
      //
      :SetOption( 1 )
      :aEnable = { .T., .T., .T., .T., .T., .T., .F. }
      :Show()
      // :DisableTab( 3 )  // idem a :aEnable
      // :oCursor := oHand
   END

   @ nLinha, 15 SAY "Código 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "Código 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar )   }

   oDlg:bResized := < ||
   LOCAL oRect   := oDlg:GetCliRect()
   oFld:nbottom  := oRect:nBottom - 100

   RETURN NIL
   >

   @ 080, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )

  oBrush:End()
  oBold:End()
  oFont:End()

RETURN NIL

FUNCTION change_size( n, aCooDlg, oDlg, oFld, obar )

   LOCAL nBottom, nHt

   DO CASE
   CASE n = 3

      nBottom := 32.4
      nHt     := nBottom * DLG_CHARPIX_H

   CASE n = 6

      nBottom := 22

      nHt     := nBottom * DLG_CHARPIX_H

   OTHERWISE

      nHt     := aCooDlg[ 2 ]

   ENDCASE

   oDlg:Hide()

   oDlg:SetSize( aCooDlg[ 1 ], nHt )

   oDlg:Show()

   Eval( oDlg:bResized )

   oBar:Refresh()
   // oDlg:Refresh()

RETURN NIL

FUNCTION ChangeButtons( oBar )

   AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )

RETURN( .T. )

// FIN / END - kapiabafwh@gmail.com
 


Regards, saludos.



Can you see that you haven't understood and that you want to force me to do what I shouldn't do?

See my sample

1) the buttonbar must be on downl not on top of the dialog
2) on the buttonbar there are only 3 buttons
3) please not change the colors
4) what is aPubGrad ?
5) what is SkinButtons() ?

I didn't ask for all those things you included in the example
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: a folder into a dialog

Postby Jimmy » Tue Jun 11, 2024 12:35 pm

hi Silvio,

as i remember right i had same Problem with height of FolderEX in a Dialog so i need to resize each FolderEX.
Sample from karinha does show a Way to resize FolderEX, but work not perfect as Body from MENU 6 is to small

i use absolute Value instead Value of Function oDlg:GetCliRect() for resize Body of FolderEX to get same height
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: a folder into a dialog

Postby karinha » Tue Jun 11, 2024 4:42 pm

Jimmy, Silvio, comprueba ahora si esto es correcto, por favor.

Jimmy, Silvio, check if this is correct now, please.

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILVFLD3.PRG

#Include "FiveWin.ch"
#Include "Constant.ch"

#define DLG_nColorDlg    RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1   RGB(250,250,245)
#define DLG_nColorBar2   RGB(245,245,235)
#define DLG_nColorBtn1   RGB(245,245,235)
#define DLG_nColorBtn2   RGB(250,250,245)
#define DLG_nColorBtnB   RGB(195,195,185)

FUNCTION Test_Folder_Silvio()

   LOCAL oNew   AS OBJECT
   LOCAL oOpen  AS OBJECT
   LOCAL oExit  AS OBJECT
   LOCAL oDlg   AS OBJECT
   LOCAL oFld   AS OBJECT
   LOCAL oFont  AS OBJECT
   LOCAL oBold  AS OBJECT
   LOCAL oBar   AS OBJECT
   LOCAL oBrush AS OBJECT
   LOCAL oImage AS OBJECT
   LOCAL oCursorBtn := TCursor():New(, 'HAND' )
   LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
   LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
   LOCAL nBottom := 41
   LOCAL nRight  := 94.6
   LOCAL nHt     := nBottom * DLG_CHARPIX_H
   LOCAL nWd     := Max( nRight * DLG_CHARPIX_W, 180 )

   aCooDlg[ 1 ]  := nWd
   aCooDlg[ 2 ]  := nHt

   oFont := TFont():New( "TAHOMA", 0, 18,, )
   oBold := TFont():New( "TAHOMA", 0, 14,, .T. )

   DEFINE DIALOG oDlg SIZE aCooDlg[1], aCooDlg[2] PIXEL TRUEPIXEL     ;
      FONT oFont TITLE "Test Folderex" COLOR CLR_BLACK, DLG_nColorDlg ;
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,     ;
                 WS_MINIMIZEBOX)

   DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK OF oDlg 2015 BOTTOM GDIPLUS

   WITH OBJECT oBar

      oBar:bClrGrad := { | lPressed | If( ! lPressed,            ;
                       { { 1, DLG_nColorBar1, DLG_nColorBar1} }, ;
                       { { 1, DLG_nColorBar2, DLG_nColorBar2} } ) }

      oBar:bRClicked := { || ( NIL ) } // Mouse Direito
      oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo

      oBar:SetFont( oFont )

      oBar:nClrText := CLR_HBLUE
      oBar:Adjust()

   END

   DEFINE BUTTON oNew OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT   ;
      PROMPT "&New" ACTION MsgInfo( "New" )                              ;
      TOOLTIP "Creates a new document" GROUP

   DEFINE BUTTON oOpen OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
      PROMPT "&Open"                                                     ;
      ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) )   ;
      TOOLTIP "Opens a document" GROUP

   DEFINE BUTTON oExit OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
      PROMPT "&Exit" ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP

   @ 005, 000 FOLDEREX oFld PROMPTS aFolder      ;
      SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
      FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 5 TOP

   WITH OBJECT oFld

      :lTransparent := .T.
      :aGradSel   := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
      :aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
      :aGradOver  := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
      :aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
      :aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
      //
      :SetOption( 1 )
      :aEnable = { .T., .T., .T., .T., .T., .T., .F. }
      :Show()
      // :DisableTab( 3 )  // idem a :aEnable
      :oCursor := oCursorBtn
   END

   @ nLinha, 15 SAY "FOLDER 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar )   }

   oDlg:bResized := < ||
   LOCAL oRect   := oDlg:GetCliRect()
   oFld:nbottom  := oRect:nBottom - 100

   RETURN NIL
   >

   // only test

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 1 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 2 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 3 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 4 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 5 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 170, 90 SAY OemToAnsi( "Silvio Falconi, Este es un Show de Folderex." )    ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS METRO_VIOLET, CLR_WHITE FONT oBold ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   ACTIVATE DIALOG oDlg CENTERED ;
     ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )

  oBold:End()
  oFont:End()

RETURN NIL

FUNCTION Change_Size( n, aCooDlg, oDlg, oFld, oBar )

   LOCAL nBottom, nHt

   DO CASE
   CASE n = 3

      nBottom := 32.4

      nHt     := nBottom * DLG_CHARPIX_H + 28  // For Buttons in Dialog

   CASE n = 6

      nBottom := 22

      nHt     := nBottom * DLG_CHARPIX_H + 184 // For Buttons in Dialog

   OTHERWISE

      nHt     := aCooDlg[ 2 ] // - 50  // Only test Silvio.

   ENDCASE

   oDlg:Hide()

   oDlg:SetSize( aCooDlg[ 1 ], nHt )

   oDlg:Show()

   Eval( oDlg:bResized )

RETURN NIL

FUNCTION ChangeButtons( oBar ) // No comprendo esto. ??

   AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )

RETURN( .T. )

// FIN / END - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: a folder into a dialog

Postby Jimmy » Wed Jun 12, 2024 5:25 am

hi.
karinha wrote:Jimmy, Silvio, comprueba ahora si esto es correcto, por favor.
Jimmy, Silvio, check if this is correct now, please.

Body height of FolderEX is OK, but DIalog changed height which seems me wrong
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: a folder into a dialog

Postby karinha » Wed Jun 12, 2024 11:26 am

Good morning Jimmy, there is not enough height in the DIALOG, in options 3 and 6 to place the Button Bar.

Buenos días Jimmy, no hay suficiente altura en el DIALOG, en las opciones 3 y 6 para colocar la Button Bar.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: a folder into a dialog

Postby Silvio.Falconi » Wed Jun 12, 2024 11:41 am

karinha wrote:Good morning Jimmy, there is not enough height in the DIALOG, in options 3 and 6 to place the Button Bar.

Buenos días Jimmy, no hay suficiente altura en el DIALOG, en las opciones 3 y 6 para colocar la Button Bar.

Regards, saludos.


I had no doubt that you would answer in this way, can you see that you didn't understand anything? if you look at the change_size function perhaps you would see that I change the dimensions of the dialog and the folder but you always want to impose your own changes while also making unsolicited additions
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: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: a folder into a dialog

Postby karinha » Wed Jun 12, 2024 11:52 am

hahaha, Silvio, you're not boring. If it works for you, use it. If it doesn't work for you, don't use it. your model does not work. Mine works. Although, I don't see any use in this FOLDEREX model that you created. Crazy thing like you. Have a good day.

jajaja, Silvio, no eres aburrido. Si te funciona, úsalo. Si no te funciona, no lo uses. tu modelo no funciona. El mío funciona. Aunque no veo ningún uso en este modelo FOLDEREX que creaste. Una cosa de loco como tú. Tenga un buen día.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: a folder into a dialog

Postby Jimmy » Wed Jun 12, 2024 1:30 pm

hi Silvio,

why you made it complicate instead of using FIX value
Code: Select all  Expand view
   // C:\FWH\SAMPLES\SILVFLD3.PRG

    #Include "FiveWin.ch"
    #Include "Constant.ch"

    #define DLG_nColorDlg    RGB(245,245,235)
    #define DLG_nColortitle1 RGB(219,230,244)
    #define DLG_nColortitle2 RGB(207,221,239)
    #define DLG_nColorBar1   RGB(250,250,245)
    #define DLG_nColorBar2   RGB(245,245,235)
    #define DLG_nColorBtn1   RGB(245,245,235)
    #define DLG_nColorBtn2   RGB(250,250,245)
    #define DLG_nColorBtnB   RGB(195,195,185)

    FUNCTION Test_Folder_Silvio()

       LOCAL oNew   AS OBJECT
       LOCAL oOpen  AS OBJECT
       LOCAL oExit  AS OBJECT
       LOCAL oDlg   AS OBJECT
       LOCAL oFld   AS OBJECT
       LOCAL oFont  AS OBJECT
       LOCAL oBold  AS OBJECT
       LOCAL oBar   AS OBJECT
       LOCAL oBrush AS OBJECT
       LOCAL oImage AS OBJECT
       LOCAL oCursorBtn := TCursor():New(, 'HAND' )
       LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
       LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
       LOCAL nBottom := 41
       LOCAL nRight  := 94.6
       LOCAL nHt     := nBottom * DLG_CHARPIX_H
       LOCAL nWd     := Max( nRight * DLG_CHARPIX_W, 180 )

       aCooDlg[ 1 ]  := nWd
       aCooDlg[ 2 ]  := nHt

       oFont := TFont():New( "TAHOMA", 0, 18,, )
       oBold := TFont():New( "TAHOMA", 0, 14,, .T. )

       DEFINE DIALOG oDlg SIZE aCooDlg[1], aCooDlg[2] PIXEL TRUEPIXEL     ;
          FONT oFont TITLE "Test Folderex" COLOR CLR_BLACK, DLG_nColorDlg ;
          STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,     ;
                     WS_MINIMIZEBOX)

       DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK OF oDlg 2015 BOTTOM GDIPLUS

       WITH OBJECT oBar

          oBar:bClrGrad := { | lPressed | If( ! lPressed,            ;
                           { { 1, DLG_nColorBar1, DLG_nColorBar1} }, ;
                           { { 1, DLG_nColorBar2, DLG_nColorBar2} } ) }

          oBar:bRClicked := { || ( NIL ) } // Mouse Direito
          oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo

          oBar:SetFont( oFont )

          oBar:nClrText := CLR_HBLUE
          oBar:Adjust()

       END

       DEFINE BUTTON oNew OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT   ;
          PROMPT "&New" ACTION MsgInfo( "New" )                              ;
          TOOLTIP "Creates a new document" GROUP

       DEFINE BUTTON oOpen OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
          PROMPT "&Open"                                                     ;
          ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) )   ;
          TOOLTIP "Opens a document" GROUP

       DEFINE BUTTON oExit OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
          PROMPT "&Exit" ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP

       @ 005, 000 FOLDEREX oFld PROMPTS aFolder      ;
          SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
          FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 5 TOP

       WITH OBJECT oFld

          :lTransparent := .T.
          :aGradSel   := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
          :aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
          :aGradOver  := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
          :aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
          :aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
          //
          :SetOption( 1 )
          :aEnable = { .T., .T., .T., .T., .T., .T., .F. }
          :Show()
          // :DisableTab( 3 )  // idem a :aEnable
          :oCursor := oCursorBtn
       END

       @ nLinha, 15 SAY "FOLDER 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       @ nLinha, 15 SAY "FOLDER 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       @ nLinha, 15 SAY "FOLDER 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       @ nLinha, 15 SAY "FOLDER 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       @ nLinha, 15 SAY "FOLDER 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       @ nLinha, 15 SAY "FOLDER 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
          COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

       oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar )   }

       oDlg:bResized := < ||
       LOCAL oRect   := {0,0,645,740} // USE fix value instead of Function oDlg:GetCliRect()
           oFld:nbottom  := 550 // oRect:nBottom - 100

       RETURN NIL
       >

       // only test

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 1 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 2 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 3 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 4 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 5 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 170, 90 SAY OemToAnsi( "Silvio Falconi, Este es un Show de Folderex." )    ;
          OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS METRO_VIOLET, CLR_WHITE FONT oBold ;
          TRANSPARENT UPDATE CENTER PIXEL

       @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
          OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
          TRANSPARENT UPDATE CENTER PIXEL

       ACTIVATE DIALOG oDlg CENTERED ;
         ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )

      oBold:End()
      oFont:End()

    RETURN NIL

    FUNCTION Change_Size( n, aCooDlg, oDlg, oFld, oBar )
       LOCAL nBottom, nHt

/* not need when using FIX value

       DO CASE
       CASE n = 3

          nBottom := 32.4

          nHt     := nBottom * DLG_CHARPIX_H + 28  // For Buttons in Dialog

       CASE n = 6

          nBottom := 22

          nHt     := nBottom * DLG_CHARPIX_H + 184 // For Buttons in Dialog

       OTHERWISE

          nHt     := aCooDlg[ 2 ] // - 50  // Only test Silvio.

       ENDCASE
*/

// USE fix value
       nHt := 645
       oDlg:Hide()
       oDlg:SetSize( aCooDlg[ 1 ], nHt )

       oDlg:Show()

       Eval( oDlg:bResized )
RETURN NIL

FUNCTION ChangeButtons( oBar ) // No comprendo esto. ??
       AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
RETURN( .T. )
   
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: a folder into a dialog

Postby karinha » Wed Jun 12, 2024 2:19 pm

Perfect Jimmy, but even so, I would never use this model. It doesn't make sense in a SIMPLE FOLDEREX.

Perfecto Jimmy, pero aun así nunca usaría este modelo. No tiene sentido en una SIMPLE FOLDEREX.

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILVFLD4.PRG

#include "FiveWin.ch"
#include "Constant.ch"

#define DLG_nColorDlg    RGB(245,245,235)
#define DLG_nColortitle1 RGB(219,230,244)
#define DLG_nColortitle2 RGB(207,221,239)
#define DLG_nColorBar1   RGB(250,250,245)
#define DLG_nColorBar2   RGB(245,245,235)
#define DLG_nColorBtn1   RGB(245,245,235)
#define DLG_nColorBtn2   RGB(250,250,245)
#define DLG_nColorBtnB   RGB(195,195,185)

FUNCTION Test_Folder_Silvio()

   LOCAL oNew   AS OBJECT
   LOCAL oOpen  AS OBJECT
   LOCAL oExit  AS OBJECT
   LOCAL oDlg   AS OBJECT
   LOCAL oFld   AS OBJECT
   LOCAL oFont  AS OBJECT
   LOCAL oBold  AS OBJECT
   LOCAL oBar   AS OBJECT
   LOCAL oBrush AS OBJECT
   LOCAL oImage AS OBJECT
   LOCAL oCursorBtn := TCursor():New(, 'HAND' )
   LOCAL aFolder := { "Menu1", "Menu2", "Menu3", "Menu4", "Menu5", "Menu6" }
   LOCAL aCooDlg := { 0, 0 }, aGrad, nLinha := 14
   LOCAL nBottom := 41
   LOCAL nRight  := 94.6
   LOCAL nHt     := nBottom * DLG_CHARPIX_H
   LOCAL nWd     := Max( nRight * DLG_CHARPIX_W, 180 )

   aCooDlg[ 1 ]  := nWd
   aCooDlg[ 2 ]  := nHt

   oFont := TFont():New( "TAHOMA", 0, 18,, )
   oBold := TFont():New( "TAHOMA", 0, 14,, .T. )

   DEFINE DIALOG oDlg SIZE aCooDlg[ 1 ], aCooDlg[ 2 ] PIXEL TRUEPIXEL ;
      FONT oFont TITLE "Test Folderex" COLOR CLR_BLACK, DLG_nColorDlg ;
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,     ;
      WS_MINIMIZEBOX )

   DEFINE BUTTONBAR oBar BUTTONSIZE 40, 50 _3DLOOK OF oDlg 2015 BOTTOM GDIPLUS

   WITH OBJECT oBar

      oBar:bClrGrad := {| lPressed | If( ! lPressed,            ;
         { { 1, DLG_nColorBar1, DLG_nColorBar1 } }, ;
         { { 1, DLG_nColorBar2, DLG_nColorBar2 } } ) }

      oBar:bRClicked := {|| ( NIL ) } // Mouse Direito
      oBar:bLClicked := {|| ( NIL ) } // Mouse Esquerdo

      oBar:SetFont( oFont )

      oBar:nClrText := CLR_HBLUE
      oBar:Adjust()

   END

   DEFINE BUTTON oNew OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT   ;
      PROMPT "&New" ACTION MsgInfo( "New" )                              ;
      TOOLTIP "Creates a new document" GROUP

   DEFINE BUTTON oOpen OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
      PROMPT "&Open"                                                     ;
      ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) )   ;
      TOOLTIP "Opens a document" GROUP

   DEFINE BUTTON oExit OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
      PROMPT "&Exit" ACTION( oDlg:End() ) TOOLTIP "Exit this app" GROUP

   /*
   @ 005, 000 FOLDEREX oFld PROMPTS aFolder      ;
      SIZE oDlg:nWidth, oDlg:nHeight - 200 PIXEL ;
      FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 5 TOP
   */


   // 12/06/2024 - Joao
   @ 005, 018 FOLDEREX oFld PROMPTS aFolder SIZE 700, 540 PIXEL ;
      FONT oFont COLOR aGrad TAB HEIGHT 30 ROUND 0 TOP

   WITH OBJECT oFld

      :lTransparent := .T.
      :aGradSel   := { { 1.0, 3926784, 16777215 }, { 0.1, 3926784, 16777215 } } // Green
      :aGradUnSel := { { 1.0, 16744448, 16777215 }, { 0.1, 16744448, 16777215 } } // Blue
      :aGradOver  := { { 1.0, 255, 16777215 }, { 0.1, 255, 16777215 } } // Red
      :aGradOverUnSel := { { 1.0, 12824535, 16777215 }, { 0.1, 12824535, 16777215 } } // Purple
      :aGradDis := { { 1.0, 15790320, 16777215 }, { 0.1, 15790320, 167772 } }
      //
      :SetOption( 1 )
      :aEnable = { .T., .T., .T., .T., .T., .T., .F. }
      :Show()
      // :DisableTab( 3 )  // idem a :aEnable
      :oCursor := oCursorBtn

   END

   @ nLinha, 15 SAY "FOLDER 1:" OF oFld:aDialogs[ 1 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 2:" OF oFld:aDialogs[ 2 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 3:" OF oFld:aDialogs[ 3 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 4:" OF oFld:aDialogs[ 4 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 5:" OF oFld:aDialogs[ 5 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   @ nLinha, 15 SAY "FOLDER 6:" OF oFld:aDialogs[ 6 ] FONT oFont UPDATE ;
      COLORS CLR_BLACK, CLR_WHITE TRANSPARENT SIZE 050, 12 PIXEL

   oFld:bAction := {|| Change_Size( oFld:nOption, aCooDlg, oDlg, oFld, oBar )   }

   oDlg:bResized := < ||
   LOCAL oRect   := { 0, 0, 645, 740 } // USE fix value instead of Function oDlg:GetCliRect()
   oFld:nbottom  := 550 // oRect:nBottom - 100

   RETURN NIL
   >

   // only test

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 1 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 2 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 3 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 4 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 5 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 170, 90 SAY OemToAnsi( "Silvio Falconi, Este ‚s un Show de Folderex." )    ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS METRO_VIOLET, CLR_WHITE FONT oBold ;
      TRANSPARENT UPDATE CENTER PIXEL

   @ 178, 90 SAY OemToAnsi( "©Silvio Falconi Developer. All rights reserved." ) ;
      OF oFld:aDialogs[ 6 ] SIZE 370, 18 COLORS CLR_BLACK, CLR_WHITE FONT oFont ;
      TRANSPARENT UPDATE CENTER PIXEL

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oDlg:Resize(), ChangeButtons( oBar ) )

   oBold:End()
   oFont:End()

RETURN NIL

FUNCTION Change_Size( n, aCooDlg, oDlg, oFld, oBar )

   LOCAL nBottom, nHt

   /* not need when using FIX value
   DO CASE
   CASE n = 3

      nBottom := 32.4

      nHt     := nBottom * DLG_CHARPIX_H + 28  // For Buttons in Dialog

   CASE n = 6

      nBottom := 22

      nHt     := nBottom * DLG_CHARPIX_H + 184 // For Buttons in Dialog

   OTHERWISE

      nHt     := aCooDlg[ 2 ] // - 50  // Only test Silvio.

   ENDCASE
   */


   // USE fix value
   nHt := 645

   oDlg:Hide()
   oDlg:SetSize( aCooDlg[ 1 ], nHt )

   oDlg:Show()

   Eval( oDlg:bResized )

RETURN NIL

FUNCTION ChangeButtons( oBar ) // No comprendo esto. ??

   AEval( oBar:aControls, {| oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )

RETURN( .T. )

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: a folder into a dialog

Postby karinha » Wed Jun 12, 2024 2:27 pm

Siempre prefiero el RESOURCE WORKSHOP de Borland. FOLDEREX siempre nota 1000. hahahahahaha,

I always prefer Borland RESOURCE WORKSHOP. Note 1000

https://imgur.com/JTt0C4t

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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