Hi All,
I have an application where a serie of button are defined at the bottom of the form.
When sizing the form I want the button to stay on the bottom of the form.
To acheive this I'm using the ON PAINT clause of the form.
If I enlarge the form, everything is ok. Buttons stays on bottom of the form whether I enlarge from the top or the bottom of the form.
But if I reduce the form, the buttons disapear from the bottom and don't show back unless I re-enlarge the form.
Here is my test code:
#include "MiniGui.ch"
//-----------------------------------------------------------------------------
#define RGB_DKGRAY {64,64,64}
#define RGB_LTGRAY {112,128,144}
//-----------------------------------------------------------------------------
static scAppPath
//-----------------------------------------------------------------------------
function Main ()
local nRow := 700
local nCol := 500
local nHeight := 300
local nWidth := 1250
SET CENTURY ON
SET DELETED ON
SET BROWSESYNC ON
SET SOFTSEEK OFF
SET LANGUAGE TO ENGLISH
SET DATE FORMAT "dd/mm/yyyy"
SET EPOCH TO Year(Date())
scAppPath := GetStartUpFolder()
define window oWndLaunch ;
at nRow, nCol ;
width nWidth height nHeight ;
title "HMG Launcher" ;
backcolor RGB_DKGRAY ;
main nominimize nomaximize ;
on init {|| Initialize()} ;
on paint {|| UpdtForm()} ;
on interactiveclose {|| Quit()}
@ (ThisWindow.Height -70), (ThisWindow.Width -120) buttonex oBtnExit ;
caption "Exit" ;
width 100 height 25 ;
action {|| Quit()} ;
font "ARIAL" size 10 ;
bold ;
fontcolor {255,255,255} ;
backcolor { 0, 0, 0} ;
gradientfill {{1, { 0, 0, 0}, {192,192,192}}} ;
noxpstyle notransparent
@ (ThisWindow.Height -70), (ThisWindow.Width -230) buttonex oBtnHelp ;
caption "Help" ;
width 100 height 25 ;
action {|| MsgInfo("Help")} ;
font "ARIAL" size 10 ;
bold ;
fontcolor {255,255,255} ;
backcolor { 0, 0, 0} ;
gradientfill {{1, { 0, 0, 0}, {192,192,192}}} ;
noxpstyle notransparent
@ (ThisWindow.Height -70), (ThisWindow.Width -340) buttonex oBtnAbout ;
caption "About" ;
width 100 height 25 ;
action {|| MsgInfo("About")} ;
font "ARIAL" size 10 ;
bold ;
fontcolor {255,255,255} ;
backcolor { 0, 0, 0} ;
gradientfill {{1, { 0, 0, 0}, {192,192,192}}} ;
noxpstyle notransparent
@ (ThisWindow.Height -70), (ThisWindow.Width -450) buttonex oBtnSetup ;
caption "Setup" ;
width 100 height 25 ;
action {|| MsgInfo("Setup")} ;
font "ARIAL" size 10 ;
bold ;
fontcolor {255,255,255} ;
backcolor { 0, 0, 0} ;
gradientfill {{1, { 0, 0, 0}, {192,192,192}}} ;
noxpstyle notransparent
_DefineHotKey("oWndLaunch", MOD_ALT, VK_X, {|| Quit()})
end window
if nRow == 0 .and. nCol == 0
oWndLaunch.Center()
endif
oWndLaunch.Activate()
Return (NIL)
//-----------------------------------------------------------------------------
function Initialize ()
Return (NIL)
//-----------------------------------------------------------------------------
function Quit ()
ReleaseAllWindows()
Return (NIL)
//-----------------------------------------------------------------------------
function UpdtForm ()
oWndLaunch.oBtnExit.Row := (ThisWindow.Height -70)
oWndLaunch.oBtnHelp.Row := (ThisWindow.Height -70)
oWndLaunch.oBtnAbout.Row := (ThisWindow.Height -70)
oWndLaunch.oBtnSetup.Row := (ThisWindow.Height -70)
Return (NIL)
// ------------------------------------------------------------------------------------
Looks like the ON PAINT clause codeblock is called when enlarging but not when reducing. Am I wrong ?
Regard
Gilbert Vaillancourt