Home > Archive > Getting Started with dBASE > March 2006 > Form Controls









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Form Controls
Bob McKinney

2006-03-21, 3:25 am

Have been struggling to learn since SE version. Now have 2.5. Have Ken's dbase book,excellent. Created the MyControls custom controls from the SE Tutorial and the pushbutton controls from Ken's book. I set the procedure to both MyControls and MyPushbu
tton. The custom controls from both creations appear on the Custom (Control) panel. If I drag a control listed in MyControls.cc, the control appears on the form with a very condensed appearance. In fact, on LostFocus it appears as a very thin liine tha
t is totally useless. Controls I drag from MyPushbutton.cc are OK even though all are listed on the same Custom Controls panel. Can someone tell me where I can find not only the reason for this but also the cure.
Thanks a bunch


Ronnie MacGregor

2006-03-21, 3:25 am


On Mon, 20 Mar 2006 00:50:42 -0500
Bob McKinney said :

> If I drag a control listed in MyControls.cc,
> the control appears on the form with a very condensed appearance.


I suspect that your form may have a metric of "pixels" and the custom control
may have a metric of "chars".

When you drop a control on the form, dBASE does not know the metric you used
when designing your control, and interprets the height and width according to
the parent objects metric.

I would recommend you always use pixels for anything which will display on a
screen. This allows accurate integer positioning and easy mental arithmetic to
name but two advantages.

You could base all your forms on a custom form which has its metric set to
pixels, or you could put the following line of code right at the top of your
"pixel" custom control code which will force the form's metric to pixels :

class myCustomControl

form.metric := 6 // pixels

// all my other definition code

endclass

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Bob McKinney

2006-03-21, 3:25 am

Thanks a bunch Ronnie
You had it nailed, and what a fast response. Just spent about 3 hrs cleaning up the mess and learning all the time.
Thanks again

Ronnie MacGregor

2006-03-21, 8:24 pm


On Mon, 20 Mar 2006 21:32:38 -0500
Bob McKinney said :

> Thanks a bunch Ronnie


You're welcome.

If you are interested in custom controls and coding approaches, have a look at
the site noted below.

--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com