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

The new $System.EventHandler method

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


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Apr 19, 2004 12:52 pm    Post subject: The new $System.EventHandler method Reply with quote

Thought I would use this space to discuss the new $System.EventHandler method ... Shane is getting close, and if Glenn is listening, we had this discussion some time ago, in regards to how to address this specific "problem" using Kixtart ...

Hint: Most GUI languages support "objects" and in fact, Forms and Controls are usually defined as objects. For example Forms ... there is usually a constructor type function that returns an instance of your custom form, and along with that ... event functions that handle all the events that your form generates .... given the way we usually construct forms and event functions today, there is an inherit limitation with their usage ... thats not found in the other languages ... this limitation is usually not too obvious unless your trying write generic and encapsulated objects ... and heres the big hint: when someone using your "object" or "form" wants to create more than one running instance of it ...

-Shawn
Back to top
View user's profile Send private message
sptomey
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 18 Mar 2003
Posts: 158

PostPosted: Mon Apr 19, 2004 4:36 pm    Post subject: Reply with quote

I would be pretty much just guessing at this point Very Happy

Will wait for someone with a lil more knowledge to explain it so I don't make a fool of myself....

_________________
-Shane
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Apr 19, 2004 4:51 pm    Post subject: Reply with quote

Kelly said:

Quote:

I have not looked at this too hard, but this looks like an updated version of DoEvents that will work with functions. If it is, I assume you will provide a way for us to run functions concurrently or at least not waiting for them to return. That would be rather cool. I hope am am close to being corrent.


man you are sooooo close it aint funny. And by concurrently I'm not suggesting "at the same time" but in some other way ... the EventHandler "method" will allow you to create one event function that can work with _____________ instances of the same ______________.
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Mon Apr 19, 2004 5:06 pm    Post subject: Reply with quote

I would assume the blanks are Classes. This is building onto your .Object object.

The question for myself is... Can I wrap my little brain around recreating my forms as objects? I have trouble with that part. I understand but have trouble finding, for what I am, real world application. Don't go after that one now. I would definatly be hihacking the thread then.

_________________
Kelly
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 Apr 19, 2004 5:23 pm    Post subject: Reply with quote

You right, there is usually no need to create Forms as objects, but I am forcing myself (for whats it worth) to view them as such. What we may want to do one day, is create custom dialogs as objects, or maybe even custom controls as objects. If you build a custom control (say) a button that does some fancy things, this mechanism would allow you to code the event functions in such a way as to handle a 1 or 100 instances of your button...

Heres a (contrived) example using forms ... it displays 10 instances of something called a "ColoredForm" on the desktop ... each form is colored differently and has a button that says "Close Me!" ... how could one code a simple OnClick event that would handle only closing the form it was attached to, or was "clicked from", say by hiding the form itself.

Code:

Break On

$System = CreateObject("Kixtart.System")

Dim $Forms[9]

For $i = 0 to 9

 $Forms[$i] = ColoredForm($i)
 $Forms[$i].Show()

Next

While $Forms[0].Visible
 $=Execute($System.Application.DoEvents)
Loop

Exit 1

Function ColoredForm($i)

 ;
 ; Creates a Form that is colored
 ; Has a button that says "Close Me!".

 dim $this

 $this = $System.Form()
 $this.Text = "My Custom Form #$i"
 $this.Left = RND($System.Screen.WorkingArea.Width)
 $this.Top = RND($System.Screen.WorkingArea.Height)
 $this.BackColor = $System.Color(RND(255),RND(255),RND(255))

 $this.Button1 = $this.Button()
 $this.Button1.Text = "Close Me!"
 $this.Button1.Center()

 $ColoredForm = $this;

EndFunction


btw - if you close form #0, it closes all the forms to save time Wink
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu Apr 29, 2004 3:30 am    Post subject: Reply with quote

Shawn

Can you give a more detailed description of the syntax for this method? I just can't quite get it from you html editor example.

Thanks

_________________
Kelly
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