Generated control type has been changed

Discussions related to Visual Prolog
Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Generated control type has been changed

Unread post by Roland Soltysiak » 22 Jan 2009 9:11

When I create a new control with the VDE in 7.2 I get:

Code: Select all

interface test1 supports control
and

Code: Select all

implement test1 inherits userControlSupport

In 7.1 I got:

Code: Select all

interface test1 supports userControlSupport
Is this a bug or are there any reasons for the change?

Regards
Roland

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 23 Jan 2009 22:19

The change is intentional.

Controls should just support control.

Only classes that you will inherit from in other controls need to support the userControlSupport interface. If you create such a "parent control" you can manually change the support qualification in the interface.
Regards Thomas Linder Puls
PDC

Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Unread post by Roland Soltysiak » 27 Jan 2009 8:50

Thank you Thomas, for the explanation.

But for the twoSplitControl the interface has also changed.

What do you recommend without changing the pfc file to get the predicates of userControlControl for twoSplitControl (as in 7.1)?

Regards
Roland

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 27 Jan 2009 10:05

Which userControlSupport predicates do you need on the twoSplitControl?

(My answer does not depend on that question, but maybe we have missed something).
Regards Thomas Linder Puls
PDC

Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Unread post by Roland Soltysiak » 27 Jan 2009 10:43

It is

Code: Select all

getDrawWindow setBorder
Regards

Roland

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 27 Jan 2009 21:20

I think you might be using the splitTwoControl in an unintended manner. You are not supposed to draw in the control (drawing can be done in the embedded controls), and the borders are supposed to come from the embedded controls.

If you look at the images below, you will see excessive borders and depth problems in the lower row (which is with border). The forms to the left are without manifest those to the right with manifest (which are supposed to a have a flat appearence).

Anyway:
Roland Soltysiak wrote:What do you recommend without changing the pfc file to get the predicates of userControlControl for twoSplitControl (as in 7.1)?

It is not possible without change PFC files.

For my test here I added the following code to the splitTwoControl interface:

Code: Select all

predicates from userControlSupport     setborder, getDrawWindow
Attachments
splitTwo.png
SplitTwoControl with and without border.
splitTwo.png (18.37 KiB) Viewed 4758 times
Regards Thomas Linder Puls
PDC

Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Unread post by Roland Soltysiak » 28 Jan 2009 8:30

Thank you, Thomas,

You are right:
A splitTwoControl is a containerControl and drawing activities should be done in the embedded controls.

But I have used the draw window to get the mouse events and I need the mouse events for catching a change of the split bar. In my case it is also possible to catch the size of one of the embedded windows.

Or do you have another suggestion to get a "ratio change" event?

May be a listener for changed ratio would be nice in the future (There exists already a suggstion of Steve Lympany).

I only have used the setBorder functionin twoSplitControl with an empty leftControl.
But I can easily add a control with border.

Regards
Roland

User avatar
Thomas Linder Puls
VIP Member
Posts: 2422
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 28 Jan 2009 8:59

You can attach size listeners to the embedded controls.

But means for observing and perhaps interfering with the change in the split seems like a good idea. I will pass the suggestion on to the relevant people.
Regards Thomas Linder Puls
PDC

Steve Lympany
VIP Member
Posts: 695
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 28 Jan 2009 10:48

Not entirely to the point, but maybe this is useful
http://discuss.visual-prolog.com/viewto ... 1334#31334
cheers
Steve

Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Unread post by Roland Soltysiak » 28 Jan 2009 12:23

Thank you, Steve.

Very nice work :-) .

Roland

Roland Soltysiak
Active Member
Posts: 39
Joined: 5 Jul 2000 23:01

Unread post by Roland Soltysiak » 18 Mar 2009 10:14

Thank you, PDC (as always) for this solution in 7202. :D

Regards
Roland

Post Reply