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

Change default behavior of closing a form
Goto page 1, 2  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Oct 25, 2005 2:54 pm    Post subject: Change default behavior of closing a form Reply with quote

I'm thinking about changing the default behavior of "closing" a form in kf.net. Currently if one clicks the x box, or issues a scripted close, .net will actually dispose of the form - which renders it unusable.

Thinking about changing this behavior to HIDE the form on close, by default - kinda like the way it is in kf2.

Any comments or feedback welcome.

-Shawn
Back to top
View user's profile Send private message
Rod
KiXforms Webmaster
KiXforms Webmaster


Joined: 22 Feb 2003
Posts: 202
Location: United Kingdom

PostPosted: Tue Oct 25, 2005 5:17 pm    Post subject: Reply with quote

Hiding makes more sense to me.

Rod.

_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Tue Oct 25, 2005 5:50 pm    Post subject: Reply with quote

When hiding first thing that comes to mind is that it's still there somewhere but it just does not show. IMHO my logon script or an app should be realy closed and not just hidden when done.
How about adding a hide option like in the "old kf" so you can close and destroy if you want or just hide it when it's needed later on.

_________________
Mart

- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Oct 25, 2005 6:09 pm    Post subject: Reply with quote

The form would still persist (your right), but when the script finishes - the form would still be disposed of (memory release etc). The problem really is that in kf.net - to hide the form on closing, you have to trap the closing event, then cancel the event, then call the Hide method.

I'm just saying lets make it just like kf2 - hide the form when x'ed. So that the form can be re-used (think of an Options dialog box, you would want to reuse that over-and-over). and this would only be the default behavior - I suggest we add a property called DefaultCloseOperation (which is what they have done in Java swing), to over-ride this default behavior as required.
Back to top
View user's profile Send private message
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Tue Oct 25, 2005 6:38 pm    Post subject: Reply with quote

Ok. In that case I vote for hide.
_________________
Mart

- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Oct 25, 2005 11:45 pm    Post subject: Reply with quote

Mart, I think you have a valid point. Just thinking about whether I should make this HIDE feature the DEFAULT behavior, or one that you have to explicitly turn on.
Back to top
View user's profile Send private message
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Wed Oct 26, 2005 5:42 pm    Post subject: Reply with quote

Yeah, hard one to crack I think.
Depends on what people use KF for. Login script or an app running on KF.

Login script:
Closing (and thereby destroying) the form would be my preferred choice cause the script is done and not needed again until some user logs on again. The form is destroyed anyway when the user logs off so no need to keep it when script is done. Right?

App:
Hiding the form and keeping it at hand for later use and building a button or something in the form or a condition that when matches or when the button is clicked closes (and thereby destroying) the form would be the way to go for this example.

Hmmm... difficult one Confused

_________________
Mart

- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd.
Back to top
View user's profile Send private message
ntdoc
KiXforms Supporter
KiXforms Supporter


Joined: 05 Mar 2003
Posts: 77
Location: Mouse Country

PostPosted: Wed Nov 09, 2005 9:54 am    Post subject: Reply with quote

Hmmm.... Shawn, are you meaning more so for like multi-window forms? i.e. Don't want the "x" to close the entire application if you only meant to close one of the forms of the application. On the othe hand though if it's a single form application then the default should be to close it all down like other main Win32 applications do such as MS Office applications.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Nov 09, 2005 1:22 pm    Post subject: Reply with quote

Its just certain forms that this would be usefull for ... forms that get displayed then dis-missed multiple times, like an Options dialog box ... clicking the close button (x-box) destroys the form, so it cant be used again. So unless one wants to keep re-building the form from scratch everytime (which is an option), being able to control the x-box destuction would be a nice option to have.

I haven't changed the default behavior yet btw - will prolly be keeping the default (to destroy), but add a new option that will hide on close.
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Wed Nov 09, 2005 2:24 pm    Post subject: Reply with quote

when the X is clicked, form should be closed, that is destroyed, unless the close event is interrupted.

ja, default should be destroy.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Wed Nov 09, 2005 2:28 pm    Post subject: Reply with quote

Shawn wrote:
... but add a new option that will hide on close.


think I can live with that

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Wed Nov 09, 2005 10:20 pm    Post subject: Reply with quote

If the script lives but the form doesn't, hiding would be an option I guess...
Back to top
View user's profile Send private message MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Nov 10, 2005 12:12 am    Post subject: Reply with quote

ja, option.
having it default is unexpected though.

simple event handling for onClose = "" would make it not do anything and accordingly:
onClose = "form.hide"

or
onclose = "form = 0"

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Jan 05, 2006 3:07 am    Post subject: Reply with quote

so, shawn.
you have the closing event there now.
how do I stop the closing?

I do have a settings form and I really don't want to keep calling on the GUI create and settings Load UDFs all the time.

well, the gui I could reload but reloading the settings all the time doesn't feel right to me.

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Jan 05, 2006 3:14 am    Post subject: Reply with quote

k, so it's:
$SomeForm.Closing = "$SomeForm.ClosingEventArgs.Cancel = 1 $SomeForm.Visible = 0"

_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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