Hi Escigi/Kathinagiri and all HMG Gurus
What must I do to make a BROWSE expand automatically when one maximise a window.
In Delphi, most visual controls have an ALIGN CLIENT property. I cannot find a similar property for BROWSE
Any help will be appreciated.
CCH
http://cch4clipper.blogspot.com
Resizing of Browse
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Resizing of Browse
It can be achieved by hooking "On Size" or "On Maximize" clause of Define window command.
We can easily write a small set of codes to manipulate this.
We can easily write a small set of codes to manipulate this.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
-
- Posts: 140
- Joined: Tue Mar 03, 2009 8:59 am
Re: Resizing of Browse
Hi,
This might be like:
function sizetest
main.browse_1.width := main.width-50
main.browse_1.height := main.height-50
return nil
Regards.
Sudip
This might be like:
function sizetest
main.browse_1.width := main.width-50
main.browse_1.height := main.height-50
return nil
Regards.
Sudip
With best regards,
Sudip
Sudip
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Resizing of Browse
Thank you Sudip.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
-
- Posts: 140
- Joined: Tue Mar 03, 2009 8:59 am
Re: Resizing of Browse
Hi Sudip/Kathinagiri
Why doesn't this work ?
* MyBrowse.prg
STATIC nWidth,nHeight, brwWidth, nbrwHeight
#include "minigui.ch"
Function BrowseGLAC
nWidth := GetDesktopWidth() * 0.75
nHeight := GetDesktopHeight() * 0.75
nbrwWidth := GetDesktopWidth() * 0.75 - 20
nbrwHeight := GetDesktopHeight() * 0.75 - 75
DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH nWidth HEIGHT nHeight ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
ON INIT (OpenTables()) ;
ON RELEASE CloseTables() ;
ON MAXIMIZE ResizeMaximize()
DEFINE STATUSBAR
DATE
STATUSITEM '<Enter> / Double Click To Edit' WIDTH 190
STATUSITEM 'Alt+A: Append Record' WIDTH 140
STATUSITEM '<Del>: Delete Record' WIDTH 140
CLOCK
END STATUSBAR
@ 10,10 BROWSE Browse_1 ;
WIDTH nbrwWidth ;
HEIGHT nbrwHeight ;
HEADERS { 'GL Code' , 'GL Name' , 'GL Type', 'GL Group'} ;
WIDTHS { 80 , 320 , 80 , 80 , 120 } ;
WORKAREA GLAC ;
FIELDS { 'GLAC->GLCODE' , 'GLAC->GLNAME' , 'GLAC->GLTYPE' , 'GLAC->GLGROUP'} ;
VALUE 1 ;
EDIT ;
APPEND;
DELETE;
LOCK
END WINDOW
CENTER WINDOW BrowseGLACForm
BrowseGLACForm.Browse_1.SetFocus
ACTIVATE WINDOW BrowseGLACForm
Return Nil
Function resizeMaximize
nbrwWidth := GetDesktopWidth() - 20
nbrwHeight := GetDesktopHeight() - 75
return
CCH: On launching, it displays perfectly but on Clicking Maxiimise, the browse rectangle does not expand to fit the maximized window.
Any pointer where I have gone wrong
CCH
http://cch4clipper.blogspot.com
Why doesn't this work ?
* MyBrowse.prg
STATIC nWidth,nHeight, brwWidth, nbrwHeight
#include "minigui.ch"
Function BrowseGLAC
nWidth := GetDesktopWidth() * 0.75
nHeight := GetDesktopHeight() * 0.75
nbrwWidth := GetDesktopWidth() * 0.75 - 20
nbrwHeight := GetDesktopHeight() * 0.75 - 75
DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH nWidth HEIGHT nHeight ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
ON INIT (OpenTables()) ;
ON RELEASE CloseTables() ;
ON MAXIMIZE ResizeMaximize()
DEFINE STATUSBAR
DATE
STATUSITEM '<Enter> / Double Click To Edit' WIDTH 190
STATUSITEM 'Alt+A: Append Record' WIDTH 140
STATUSITEM '<Del>: Delete Record' WIDTH 140
CLOCK
END STATUSBAR
@ 10,10 BROWSE Browse_1 ;
WIDTH nbrwWidth ;
HEIGHT nbrwHeight ;
HEADERS { 'GL Code' , 'GL Name' , 'GL Type', 'GL Group'} ;
WIDTHS { 80 , 320 , 80 , 80 , 120 } ;
WORKAREA GLAC ;
FIELDS { 'GLAC->GLCODE' , 'GLAC->GLNAME' , 'GLAC->GLTYPE' , 'GLAC->GLGROUP'} ;
VALUE 1 ;
EDIT ;
APPEND;
DELETE;
LOCK
END WINDOW
CENTER WINDOW BrowseGLACForm
BrowseGLACForm.Browse_1.SetFocus
ACTIVATE WINDOW BrowseGLACForm
Return Nil
Function resizeMaximize
nbrwWidth := GetDesktopWidth() - 20
nbrwHeight := GetDesktopHeight() - 75
return
CCH: On launching, it displays perfectly but on Clicking Maxiimise, the browse rectangle does not expand to fit the maximized window.
Any pointer where I have gone wrong
CCH
http://cch4clipper.blogspot.com
Re: Resizing of Browse
Hi CCH,
In my opinion please add "ON SIZE ..." and your problem will be solved.
DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH nWidth HEIGHT nHeight ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
ON INIT (OpenTables()) ;
ON RELEASE CloseTables() ;
ON MAXIMIZE ResizeIt() ;
ON SIZE ResizeIt()
...
...
FUNCTION ResizeIt()
...
...
RETURN NIL
Regards.
Sudip
In my opinion please add "ON SIZE ..." and your problem will be solved.
DEFINE WINDOW BrowseGLACForm ;
AT 0,0 ;
WIDTH nWidth HEIGHT nHeight ;
TITLE 'Browse Chart of Accounts' ;
CHILD ;
ON INIT (OpenTables()) ;
ON RELEASE CloseTables() ;
ON MAXIMIZE ResizeIt() ;
ON SIZE ResizeIt()
...
...
FUNCTION ResizeIt()
...
...
RETURN NIL
Regards.
Sudip
With best regards,
Sudip
Sudip
-
- Posts: 140
- Joined: Tue Mar 03, 2009 8:59 am