|
| Splitter settings on open |
 |
Sun, 13 Apr 2008 04:01:44 -040 |
I am using a splitter on a form. It works well, but I would like to have the
form open with the splitter set a a certain position.
That is, I would like to programmatically move the splitter up from the default
50% position depending on how many rows I have displayed in the grid in the top
container.
I have done the right math, and the splitter bar actually does appear at the
right place when the form opens, but the top and bottom container do not change
their size.
I use the following code in the form onopen:
nRecords=form.rowset.count()
IF nRecords < 11
form.HSPLITTER1.top := form.HSPLITTER1.top-((11*17)-(nRecords*17))
CLASS::moveit()
ENDIF
17 is the size of one record in the grid in the top container. As I said, this
moves the splitter to the correct position, but I cannot get the top and bottom
container to adjust their size properly.
Hope someone has done this and can give me a hand.
Thanks for any ideas,
|
| Post Reply
|
| Re: Splitter settings on open |
 |
Sun, 13 Apr 2008 10:48:05 -050 |
Hi Mark,
which version of the splitter are you using?
DBSPLITTER.CC (Jim Sare)
or
SPLITTER.CC (Elwyn Rees)
Jan
|
| Post Reply
|
| Re: Splitter settings on open |
 |
Sun, 13 Apr 2008 12:42:59 -040 |
Hi Jan,
Am using Splitter.cc, tho the notes indicate it was designed by Jim Sare, 2002.
I tried the following:
IF nRecords < 11
form.HSPLITTER1.top := form.HSPLITTER1.top-((11*17)-(nRecords*17))
class::SplitterMoving()
class::SplitterMoved()
form.HSPLITTER1.onLeftMousedown()
form.HSPLITTER1.onLeftMouseUp()
ENDIF
This seems to work, except that it coughs up an error message when the function
doRelativeMove is run in splitter.cc. If I ignore the error, the form appears
as it should and behaves fine after.
Hope you have a suggestion,
Mark
Jan Hoelterling Wrote:
> Hi Mark,
>
> which version of the splitter are you using?
>
> DBSPLITTER.CC (Jim Sare)
> or
> SPLITTER.CC (Elwyn Rees)
>
> Jan
>
>
|
| Post Reply
|
| Re: Splitter settings on open |
 |
Mon, 14 Apr 2008 01:14:39 -040 |
In article <Fy9xuVYnIHA.1088@news-server>, NOSPAM@NOSPAM.com says...
> Hi Jan,
>
> Am using Splitter.cc, tho the notes indicate it was designed by Jim Sare,
2002.
>
> I tried the following:
>
> IF nRecords < 11
> form.HSPLITTER1.top := form.HSPLITTER1.top-((11*17)-(nRecords*17))
> class::SplitterMoving()
> class::SplitterMoved()
> form.HSPLITTER1.onLeftMousedown()
> form.HSPLITTER1.onLeftMouseUp()
> ENDIF
>
> This seems to work, except that it coughs up an error message when the
function doRelativeMove is run in splitter.cc. If I ignore the error, the form
appears as it should and behaves fine after.
>
> Hope you have a suggestion,
> Mark
Mark,
And what is the error message? What does the line of code say? <g>
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|