Folder different size

Folder different size

Postby Silvio.Falconi » Thu Nov 04, 2021 11:37 am

It possible have a different size for each tabs of folder ?
the dialog where the folder is located will shrink depending on whether the end user selects a folder tab, obviously this must be an option

Image

I needed this because in some tabs I have to put a lot of information while in others the information is less and you risk inserting some space that is ugly to see

for now I resolve in this mode but I don't know if it's a right solution :D

Code: Select all  Expand view

#include "fivewin.ch"

Function test()
   local oDlg,oFolder
   local oFontDialog,oFontBold
   local oBarDialog
   local nHeight:= 600

DEFINE FONT oFontDialog NAME 'Tahoma' SIZE 0, -16
DEFINE FONT oFontBold NAME 'Tahoma' SIZE 0, -14  BOLD

DEFINE DIALOG oDlg        ;
   TITLE "test folder size"    ;
   SIZE  960,nHeight PIXEL TRUEPIXEL               ; //  RESIZABLE
   COLOR CLR_BLACK,  nRgb( 245,244,234)

  DEFINE BUTTONBAR oBarDialog OF oDlg SIZE 80, 80  2015   BOTTOM NOBORDER

      DEFINE BUTTON oBtnAnnulla OF oBarDialog  ;
      FILENAME "no.png";
      PROMPT "Annulla" TOOLTIP "Esci" ;
      ACTION   ( oDlg:end( IDCANCEL ) )


      DEFINE BUTTON oBtnAiuto OF oBarDialog  ;
      FILENAME "Aiuto.png";
      PROMPT "Aiuto" TOOLTIP "Aiuto" ;
      ACTION NIL   GROUP

      DEFINE BUTTON oBtnConferma OF oBarDialog  BTNRIGHT  ;
      FILENAME "ok.png";
      PROMPT "Conferma" ;
      TOOLTIP "Conferma i dati" ;
      ACTION   ( oDlg:end( IDOK ) )

      oBarDialog:bClrGrad := { | lPressed | If( ! lPressed,;
                 { { 1, nRgb(233,229,206),nRgb(233,229,206) } },;
                 { { 1, nRgb( 245,244,234), nRgb( 245,244,234) } } ) }




   @3,0 FOLDEREX oFolder PROMPTS "Azienda","Generale","Contabilità","Articoli e Documenti","Vendita touch","Riparazioni" ;
   SIZE oDlg:nWidth,oDlg:nHeight-oBarDialog:nheight  PIXEL   ;
   FONT oFontDialog  ;
   COLOR nRgb( 245,244,234)


     oFolder:bAction := { || IF(oFolder:nOption=3 .or. oFolder:nOption=6 ,oDlg:nHeight:=400,oDlg:nHeight:=nHeight) }

           oDlg:bResized  := <||
              local oRect    := oDlg:GetCliRect()
              oFolder:nTop := oRect:ntop+10
              oFolder:nHeight := oRect:nbottom-110
              oFolder:nWidth  := oRect:nWidth
              oBarDialog:GoDown()
              oBarDialog:refresh()
              return nil
             >

   ACTIVATE DIALOG oDlg CENTER ;
   ON INIT (  EVAL(  oDlg:bResized),;
                 ChangeButtons( oBarDialog ),oBarDialog:refresh())
RETURN NIL
//-------------------------------------------------------------------------//

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


If I press the folder 6
Image


PROBLEM
the problem I have on init is I not see the buttonbar down
If I select a tab then I see the buttonbar
how I can resolve ?
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: 6868
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: byron.hopp, Google [Bot] and 129 guests