resize browse when click maximized dialog

resize browse when click maximized dialog

Postby damianodec » Fri Mar 10, 2017 9:23 am

hi,
I would like to maximized my browse when I click maximized on my dialog but dialog maximized and browse not...
Code: Select all  Expand view

    DEFINE DIALOG oDlg2 RESOURCE "SQL" FONT oFont
       
        REDEFINE XBROWSE oBrw ALIAS "ESPCAT" ;
        COLUMNS "CDFOR" COLSIZES 70 HEADERS "CODICE" ID 200 OF oDlg2
       
        ADD oCol TO oBrw AT 2 DATA espcat->CDPAR TITLE "ARTICOLO"  SIZE 100 LEFT
        ADD oCol TO oBrw AT 3 DATA espcat->DEPAR TITLE "DESCRIZIONE"  SIZE 300 LEFT    
        ADD oCol TO oBrw AT 4 DATA espcat->UNMIS TITLE "UM"  SIZE 25 LEFT
       
        WITH OBJECT oBrw
        :nMarqueeStyle       := MARQSTYLE_HIGHLROW
        :nColDividerStyle    := LINESTYLE_BLACK
        :nRowDividerStyle    := LINESTYLE_BLACK
        :lColDividerComplete := .T.
        :lRecordSelector     := .F.
        :lHScroll            := .T.
        :lVScroll            := .T.
        :lExcelCellWise := .t.
        END
        REDEFINE BTNBMP BtnEsc ID 11 OF oDlg2            ;
            ACTION (oDlg2:End())               
        REDEFINE BTNBMP BtnEsc ID 12 OF oDlg2 RESOURCE "EXCEL"          ;
            ACTION (oBrw:ToExcel())                            

    ACTIVATE dialog oDlg2 CENTERED
 

I created my dialog by Pelles C with class name TXBROWSE and in Custom control properties "resizable dialog" I put VERT RESIZING "RESIZING and HORZ RESIZING "RESIZING"

any help?
thank you
ciao
Damiano
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: resize browse when click maximized dialog

Postby nageswaragunupudi » Fri Mar 10, 2017 2:14 pm

Code: Select all  Expand view
oBrw:nRightMargin := 20
oBrw:nBottomMargin := 40  // or whatever values in pixels
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resize browse when click maximized dialog

Postby damianodec » Fri Mar 10, 2017 2:42 pm

hi Mr Rao, it work!
now I have another problem, when I maximized the dialog, browse is ok but BTNBMP buttons remain in their posizion overlapping to the browse.

ciao
Damiano
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: resize browse when click maximized dialog

Postby nageswaragunupudi » Fri Mar 10, 2017 2:50 pm

You need to move them with code in the ON RESIZE clause of the Dialog.
Best way to have fully flexible dialogs is to create from source code and not with resources.

OT:
We recommend creating xbrowse as below and not to use ADD TO oBrw
Code: Select all  Expand view
REDEFINE XBROWSE oBrw ALIAS "ESPCAT" ;
COLUMNS "CDFOR", "CDPAR", "DEPAR", "UNIMIS" ;
HEADERS "CDFOR", "ARTICOLO", "DESCRIZIONE", "UM" ;
COLSIZES 70, 100, 300, 25  ;
ID 200 OF oDlg2
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resize browse when click maximized dialog

Postby damianodec » Fri Mar 10, 2017 2:56 pm

thank you!!!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: resize browse when click maximized dialog

Postby nageswaragunupudi » Fri Mar 10, 2017 3:04 pm

This is an example of resizable dialog with adjusting controls when resized.
Code: Select all  Expand view
function RcBrowse

   local oDlg, oBrw, oBtn1, oBtn2, oRect

   USE STATES  // use any DBF you have

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;
   STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   @ 80,20 XBROWSE oBrw SIZE -20,-80 PIXEL OF oDlg ;
      DATASOURCE "STATES" AUTOCOLS NOBORDER

   oBrw:CreateFromCode()

   @  20,500 BUTTON oBtn1 PROMPT "BtnOne" SIZE 80,30 PIXEL OF oDlg

   @ 350,500 BUTTON oBtn2 PROMPT "Close" SIZE 80,30 PIXEL OF oDlg ACTION oDlg:End()

   oDlg:bResized := { || ;
      oRect          := oDlg:GetCliRect(), ;
      oBtn2:nTop     := oRect:nBottom - 50, ;
      oBtn2:nLeft    := oRect:nRight - 100, ;
      oBtn1:nLeft    := oRect:nRight - 100  }

   ACTIVATE DIALOG oDlg CENTERED

return nil
 

Please build and run this program.
You may use this as a template
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resize browse when click maximized dialog

Postby damianodec » Fri Mar 10, 2017 4:00 pm

very good mr rao
but I have FWH 12.01 and TRUEPIXEL do not work

ciao
Damiano
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: resize browse when click maximized dialog

Postby nageswaragunupudi » Fri Mar 10, 2017 5:21 pm

Without TRUEPIXEL clause:
Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oBtn1, oBtn2, oRect

   USE STATES

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL ;
   STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   @ 40,10 XBROWSE oBrw SIZE -10,-40 PIXEL OF oDlg ;
      DATASOURCE "STATES" AUTOCOLS NOBORDER

   oBrw:CreateFromCode()

   @  10,250 BUTTON oBtn1 PROMPT "BtnOne" SIZE 40,15 PIXEL OF oDlg

   @ 175,250 BUTTON oBtn2 PROMPT "Close" SIZE 40,15 PIXEL OF oDlg ACTION oDlg:End()

   oDlg:bResized := { || ;
      oRect          := oDlg:GetCliRect(), ;
      oBtn2:nTop     := oRect:nBottom - 50, ;
      oBtn2:nLeft    := oRect:nRight - 100, ;
      oBtn1:nLeft    := oRect:nRight - 100  }

   ACTIVATE DIALOG oDlg CENTERED

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: resize browse when click maximized dialog

Postby damianodec » Sat Mar 11, 2017 8:50 am

thank you Mr Rao

ciao
Damiano
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: resize browse when click maximized dialog

Postby Silvio.Falconi » Sun Mar 12, 2017 9:26 am

nageswaragunupudi wrote:This is an example of resizable dialog with adjusting controls when resized.
Code: Select all  Expand view
function RcBrowse

   local oDlg, oBrw, oBtn1, oBtn2, oRect

   USE STATES  // use any DBF you have

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;
   STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   @ 80,20 XBROWSE oBrw SIZE -20,-80 PIXEL OF oDlg ;
      DATASOURCE "STATES" AUTOCOLS NOBORDER

   oBrw:CreateFromCode()

   @  20,500 BUTTON oBtn1 PROMPT "BtnOne" SIZE 80,30 PIXEL OF oDlg

   @ 350,500 BUTTON oBtn2 PROMPT "Close" SIZE 80,30 PIXEL OF oDlg ACTION oDlg:End()

   oDlg:bResized := { || ;
      oRect          := oDlg:GetCliRect(), ;
      oBtn2:nTop     := oRect:nBottom - 50, ;
      oBtn2:nLeft    := oRect:nRight - 100, ;
      oBtn1:nLeft    := oRect:nRight - 100  }

   ACTIVATE DIALOG oDlg CENTERED

return nil
 

Please build and run this program.
You may use this as a template





Nages,
it is very nice.
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: Carles and 104 guests