Groups > dBase > dBase bug reports > Re: Loss of anchored container




Re: Loss of anchored container

Re: Loss of anchored container
Sun, 17 Feb 2008 12:07:17 -060
Hi Graham,

the function below seems to work.
what dBASE version are You using ?

Hope it helps,
Rick Miller

"Graham Monk" <graham@astutesoftware.co.nz> wrote in message
news:l3o4yrTcIHA.632@news-server...
> The container at the bottom of my form goes walkabout then changing from
> maximized to normal. It also sometimes goes missing when you shorten the
> form. Any ideas or this a bug to find a work around for?
>

function form_onSize(nSizeType, nWidth, nHeight)
      if nHeight > form.container1.height
         form.editor1.height  := nHeight - form.container1.height
         form.container1.anchor  := form.container1.anchor
      endif
      return

Post Reply
Re: Loss of anchored container
Sun, 17 Feb 2008 18:41:52 -060
Hi Graham,
the re-cap helped (see below).

"Graham Monk" <graham@astutesoftware.co.nz> wrote in message
news:3o$viHacIHA.1188@news-server...
> Hi Rick,
> Just to re-cap I run the form from a one line exe 'do AnchorTest.wfm',
then
> maximize it, all is still OK, then return it to 'normal' size (all this
> using the windows controls up at the top left of the form) and the lime
> green container goes missing until you alter the size with the mouse.
----

OK.
Tested it here with win2k sp4 using PLUS 2.60 and 2.613.
Compiled and built exe with 1 line prg using both dBASE versions
and using their individual runtimes.
Saw the same as Bruce did.

When substituting the form_onSize method below the problem went away.

The line (from below)
form.container1.anchor  := form.container1.anchor
may cause a repaint that seems to correct the problem.
This may be a workaround, if DBI considers it a bug.

   function form_onSize(nSizeType, nWidth, nHeight)
      if nHeight > form.container1.height
         form.editor1.height  := nHeight - form.container1.height
         form.container1.anchor  := form.container1.anchor
      endif

Rick Miller

Post Reply
Re: Loss of anchored container
Sun, 17 Feb 2008 19:16:34 -060
Hi Graham,

"Graham Monk" <graham@astutesoftware.co.nz> wrote in message
news:bi9L9sccIHA.1340@news-server...
> Hi Rick,
>
> Many thanks that does the trick. As the same problem exists in the
> dBASE_UFLP Preview.wfm, if might be worth amending that if you use it.
----

Will leave Preview.wfm to the author(s).

Glad it helped,
Rick Miller






Post Reply
Loss of anchored container
Sun, 17 Feb 2008 20:40:53 +130
The container at the bottom of my form goes walkabout then changing from
maximized to normal. It also sometimes goes missing when you shorten the
form. Any ideas or this a bug to find a work around for?

Regards,
   Graham

** END HEADER -- do not remove this line
//
// Generated on 17/02/2008
//
parameter bModal
local f
f = new AnchorTestForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.mdi = false // ensure not MDI
   f.open()
endif

class AnchorTestForm of FORM
   with (this)
      onSize = class::FORM_ONSIZE
      height = 16.0
      left = 53.0
      top = 0.0
      width = 40.0
      text = "Anchor Test"
      autoCenter = true
   endwith

   this.EDITOR1 = new EDITOR(this)
   with (this.EDITOR1)
      height = 13.8182
      left = 0.0
      top = 0.0
      width = 40.0
      anchor = 2 // Top
      value = ''
   endwith

   this.CONTAINER1 = new CONTAINER(this)
   with (this.CONTAINER1)
      left = 0.0
      top = 14.0
      width = 40.0
      height = 2.0
      colorNormal = "lime"
      anchor = 1 // Bottom
   endwith

   function form_onSize(nSizeType, nWidth, nHeight)
      if nHeight > 2.5
         form.editor1.height:= nHeight - form.container1.height
      endif
      return
endclass

Post Reply
Re: Loss of anchored container
Sun, 17 Feb 2008 23:27:52 +000
Graham Monk wrote:
> The container at the bottom of my form goes walkabout then changing from
> maximized to normal. It also sometimes goes missing when you shorten the
> form. Any ideas or this a bug to find a work around for?

What I saw when I ran your code was that the container stayed green when 
I maximised, then when I paned down again it went to grey.   Then (a) 
when I touched the form to resize it turned green again, or (b) when I 
minimised the form (when the container was grey) and paned it up again, 
the container turned green again.



Post Reply
<< Previous 1 2 3 Next >>
( Page 1 of 3 )
about | contact