change size dialog selecting noption folder

change size dialog selecting noption folder

Postby Silvio.Falconi » Thu Mar 14, 2024 11:57 pm

I have a dialog
I have a folder on this dialog
I have a buttonbar at the bottom of odlg
I would like to make the dialog smaller when the end user selects tab number 3 and tab number 6

I made a small test
Problem is when press folder tab the dialog is resized but sometimes the oBar is hided or became smaller
and then I often notice a flutter, i.e. the dialog trembles

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

#define DEF_COLOR1 nRgb( 245,244,234)
 #define DEF_COLOR2 nRgb(233,229,206)
 #define DEF_COLOR3  RGB( 238,236,219 )
 #define DEF_COLOR4  nRgb(218,214,179)

Function Test()
local oDlg,oFld,oFont,oBold
local aBtnBar:=array(2)
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, RGB( 245,245,235)  ;
       STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                  WS_MINIMIZEBOX)


       DEFINE BUTTONBAR oBar OF oDlg  SIZE 80,70  BOTTOM NOBORDER  2010

       DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "Nuovo" RESOURCE "NEW_REC"  ;
                 ACTION  NIL
       DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Modifica" RESOURCE "MOD_REC"  ;
                 ACTION  NIL GROUP


 @0,0 FOLDEREX oFld PROMPTS aFolder ;
   SIZE oDlg:nWidth,oDlg:nHeight-oBar:nheight  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-40
                       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 )


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

Re: change size dialog selecting noption folder

Postby Antonio Linares » Fri Mar 15, 2024 9:46 am

Dear Silvio,

In FWH 24.02 we removed a call to ::Resize() from Class TWindow Method Activate()

We have restored it providing it the right parameters:
::Resize( 0, ::nWidth, ::nHeight )

If you are using FWH 24.02 please restore that line fixed as above, thanks

Surely we will publish a revised FWH 24.02 in the next days with these little changes
regards, saludos

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

Re: change size dialog selecting noption folder

Postby Silvio.Falconi » Fri Mar 15, 2024 9:53 am

Antonio Linares wrote:Dear Silvio,

In FWH 24.02 we removed a call to ::Resize() from Class TWindow Method Activate()

We have restored it providing it the right parameters:
::Resize( 0, ::nWidth, ::nHeight )

If you are using FWH 24.02 please restore that line fixed as above, thanks

Surely we will publish a revised FWH 24.02 in the next days with these little changes


¿lo hará automáticamente? o ¿Deberíamos darle los parámetros Ancho, Alto?
¿Existe todavía la posibilidad de insertar el bloque de código oDlg:bresized?

¿Tienes una solución para el problema de la carpeta?
Last edited by Silvio.Falconi on Fri Mar 15, 2024 10:04 am, edited 1 time 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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: change size dialog selecting noption folder

Postby Antonio Linares » Fri Mar 15, 2024 9:58 am

Dear Silvio,

I have not tested it yet

I just gave you a hint that maybe it is related :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

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