Resizing a Window

Resizing a Window

Postby Silvio.Falconi » Sun Feb 03, 2013 8:14 pm

I wish remake a window I saw on a application (Espress Invoice)

It use a easy window with some controls can be resize no problems and all control are resized!!!!!

When the window is on initial coordinates

Image

When the user resize the window ( it run ok id the window is maximized)

Image



I tried to remake the same with our fwh and xharbour but I not Know How we can make it

to try I build a small test sample : 3 folder, 1 xbrowse , 3 buttons

and I tried to resize the window with the function RESIZECONTROLS(nSizeType,nWidth,nHeight,oWnd )

when I resize the window all controls are resized but it is not good !!!


Have You some prupose ?

this is the test sample :


Code: Select all  Expand view
#include 'fivewin.ch'
#include 'xbrowse.ch'


FUNCTION MAIN()

 LOCAL oWnd
 Local oBtn[10]
Local oFld1
Local oFld2
Local oFld3
Local oBrw




 USE CUSTOMER ALIAS CUST


    DEFINE WINDOW oWnd  from 1,1 to 35,104


      @ 3, 4  FOLDER oFld1 PIXEL   ;
         ITEMS "&Billing","Shipping";
         SIZE 400,100

      @ 3, 500  FOLDER oFld2 PIXEL   ;
         ITEMS "&Invoice";
         SIZE 250,100



      @ 201,20 XBROWSE oBrw OF oWnd SIZE 750,200 PIXEL ;
      COLUMNS "First", "State", "Age", "HireDate", "Salary" ;
      ALIAS 'CUST' NOBORDER

      oBrw:lRecordSelector := .f.
      oBrw:nMarqueeStyle   := MARQSTYLE_HIGHLWIN7
      oBrw:CreateFromCode()



                        @ oBrw:nbottom+10, 2 BUTTON oBtn PROMPT "&Nuovo articolo" ;
                         SIZE 55, 20 PIXEL OF oWnd ACTION nil
                        @ oBrw:nbottom+10, 62 BUTTON oBtn PROMPT "&Modifica articolo" ;
                         SIZE 55, 20 PIXEL OF oWnd ACTION nil
                        @ oBrw:nbottom+10, 120 BUTTON oBtn PROMPT "&Cancella articolo" ;
                         SIZE 55, 20 PIXEL OF oWnd ACTION nil



        @ oBrw:nbottom+60, 4  FOLDER oFld3 PIXEL   ;
         ITEMS "&Comments","Private comments";
         SIZE 200,50






    ACTIVATE WINDOW oWnd;
             ON RESIZE RESIZECONTROLS(nSizeType,nWidth,nHeight,oWnd );

    RETURN NIL








STATIC FUNCTION RESIZECONTROLS(nSizeType,nWidth,nHeight, oWnd )
LOCAL oCtl

LOCAL i

STATIC aWidth  := {}
STATIC aHeight := {}

STATIC StartWidth , StartHeight

IF EMPTY( aWidth )
   FOR EACH oCtl IN oWnd:aControls
      AADD( aWidth , oCtl:nWidth() )
      AADD( aHeight , oCtl:nHeight() )
   NEXT
   StartWidth  := oWnd:nWidth()
   StartHeight := oWnd:nHeight()
ENDIF
FOR EACH oCtl IN oWnd:aControls
  i := Hb_EnumIndex()
  oCtl:Move( oCtl:nTop, oCtl:nLeft, aWidth[i]* oWnd:nWidth()/StartWidth , aHeight[i] * oWnd:nHeight()/StartHeight , .T. )
NEXT

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

Re: Resizing a Window

Postby Patrizio » Mon Feb 04, 2013 9:11 am

Silvio, try this

Code: Select all  Expand view
oCtl:Move( oCtl:nTop, oCtl:nLeft, aWidth[i] + oWnd:nWidth() - StartWidth , aHeight[i] + oWnd:nHeight() - StartHeight , .T. )
Patrizio
 
Posts: 90
Joined: Wed Nov 07, 2007 8:56 am
Location: Italy

Re: Resizing a Window

Postby Silvio.Falconi » Mon Feb 04, 2013 9:15 am

No Patrizio not run good ( can you send me a message to private email I want ask a question )


To see what I mean you try modest.prg on Minigui samples/applications you can see a window with controls resize good!!!

Any solution for fivewin for xharbour ?
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: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Resizing a Window

Postby Silvio.Falconi » Mon Feb 04, 2013 12:25 pm

Perhaps I resolved ....


I would like to size the window to the initial coordinates.
if the user tries to tighten the window, the window must remain with the initial coordinates
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: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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