KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Kixforms childforms give strange results for .right and .bot

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Bert
KiXforms Regular
KiXforms Regular


Joined: 06 Oct 2003
Posts: 56
Location: Netherlands

PostPosted: Sun Dec 28, 2003 8:02 pm    Post subject: Kixforms childforms give strange results for .right and .bot Reply with quote

When 2 forms are created the child form give strange results for the .right and .bottom properties. It looks like these are relative to the parent window.

The following kixlet demonstrates this:
Code:

$form = createobject ("kixtart.form")
$form.width=400
$form.height = 400
$form.center
$label1 = $form.label ("Left="+$form.left+"; Width="+$form.width+"; Right="+$form.right, 10, 0)
$label2 = $form.label ("Top="+$form.top+"; Height="+$form.height+"; Bottom="+$form.bottom, 10, 15)
$form.show

$form2 = createobject ("Kixtart.form")
$form2.width=300
$form2.height = 300
$form2.center
$label3 = $form2.label ("Left="+$form2.left+"; Width="+$form2.width+"; Right="+$form2.right, 10, 0)
$label4 = $form2.label ("Top="+$form2.top+"; Height="+$form2.height+"; Bottom="+$form2.bottom, 10, 15)
$form2.show

while ($form.visible)
   $ = execute ($form.doevents())
loop

_________________
Bert

There are 10 kinds of people. Those who can count binary and those who can't.
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Mon Dec 29, 2003 3:35 pm    Post subject: Reply with quote

Yes, that is correct, tough I don't consider it strange but the expected behavior.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Les
KiXforms Aficionado
KiXforms Aficionado


Joined: 24 Dec 2003
Posts: 317

PostPosted: Mon Dec 29, 2003 3:48 pm    Post subject: Reply with quote

Well, I'm just a kf noobie but I would not consider it expected behavior. Perhaps you could elaborate.
_________________
The Repro Man
Stealing for a living!
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Dec 29, 2003 5:06 pm    Post subject: Reply with quote

ja your right - the coordinates are relative to the parent window and they should be relative to the desktop. The reason is because secondary forms are owned by the first top-level form. Will fix this now.
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Mon Dec 29, 2003 5:19 pm    Post subject: Reply with quote

I expected this exactly because the second form is a child form, thus the coordinates for the child form are relative to the parent. The main form's coordinates are "aboslute" coordinates because they're basically the coordinates relative to the main form's parent, which is the desktop object.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Dec 29, 2003 5:29 pm    Post subject: Reply with quote

exactly. but i think it would make more sense to have the secondary forms coordinates for RIGHT and BOTTOM be relative to the desktop instead of the owner form. Currently - the LEFT and TOP properties for child forms work this way - so makes sense to fix it for RIGHT and BOTTOM as well. btw - its now fixed.
Back to top
View user's profile Send private message
Les
KiXforms Aficionado
KiXforms Aficionado


Joined: 24 Dec 2003
Posts: 317

PostPosted: Mon Dec 29, 2003 5:53 pm    Post subject: Reply with quote

Jens,
There's a difference between reasoning why it behaves that way and saying it is "expected". Expected behavior implies that it is deliberate (by design) and if that were the case, then .Top and .Left should also be relative to the parent but as Shawn said, they are not.

_________________
The Repro Man
Stealing for a living!
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Mon Dec 29, 2003 8:28 pm    Post subject: Reply with quote

Yes, that's tru. Though, I "expected" them to work that way, thus I would not have recognized it as a bug, not knowing the developer's intentions. However, if Shawn says that the child form should return the coordinates based on the desktp position and not based on the parent form's position, then yes, it's a bug Wink
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group