Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Aug 18, 2018 12:04 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Events handling
PostPosted: Thu May 02, 2013 2:56 am 
Offline

Joined: Mon Apr 15, 2013 3:13 am
Posts: 11
Hi,

I did create a new custom class and added a new event in it.

So my problem is how to get this new event to be trigered after the MouseUp event. and it should get the mouse position the X and The Y from the MouseUp.

Pleas don't tell me to call this event from the MouseUp event as I want the MouseUp event still available for the user of the new component.

This seems not so clear Ok then here is the whole story. I create a new class from the subclass WebListBox. I added the capability of sorting data. the sorting is triggered when the headers of the list are clicked and it's Handled by the MouseUp event. My problem is the MouseUp event is no longer available for the user. so I decided to create a new event to handle the sorting. Now I want this event to be triggered automatically after the MouseUp event.

Is this possible and how to do it


Top
 Profile  
Reply with quote  
 Post subject: Re: Events handling
PostPosted: Thu May 02, 2013 6:13 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
The standard way to handle the situation is this:

* Put your code in the MouseUp event of your WebListBox subclass.

* Add an Event Definition to your class and make it identical to MouseUp. Same name and parameters.

* In the MouseUp event of your subclass, add the following line either before or after your sorting code:
RaiseEvent MouseUp(X, Y, Details)


Now when a user subclasses your new class, or drags your class to a page, MouseUp will be available.

Essentially you are consuming the MouseUp event in your class, so you need to generate another one just like it for others to use.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Events handling
PostPosted: Thu May 02, 2013 8:45 am 
Offline

Joined: Mon Apr 15, 2013 3:13 am
Posts: 11
taylor-design wrote:
The standard way to handle the situation is this:

* Put your code in the MouseUp event of your WebListBox subclass.

* Add an Event Definition to your class and make it identical to MouseUp. Same name and parameters.

* In the MouseUp event of your subclass, add the following line either before or after your sorting code:
RaiseEvent MouseUp(X, Y, Details)


Now when a user subclasses your new class, or drags your class to a page, MouseUp will be available.

Essentially you are consuming the MouseUp event in your class, so you need to generate another one just like it for others to use.



Thanks,
That was exactly what I was looking for.

One extra thing.

The result for this is two subclasses. Is there any way to merge them into on class.

For users they should add the two classes into their projects to get it working. that would be very annoying


Top
 Profile  
Reply with quote  
 Post subject: Re: Events handling
PostPosted: Thu May 02, 2013 9:46 am 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
anis2505 wrote:
The result for this is two subclasses. Is there any way to merge them into on class.


I don't understand. Why do you have two subclasses?

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Events handling
PostPosted: Thu May 02, 2013 11:33 am 
Offline

Joined: Mon Apr 15, 2013 3:13 am
Posts: 11
taylor-design wrote:
anis2505 wrote:
The result for this is two subclasses. Is there any way to merge them into on class.


I don't understand. Why do you have two subclasses?


Stupid me :oops: . that was my first attempt by subclassing the subclass forget to delete it.

Any way thanks and here is the result maybe that would be helpful for someone

it's sortable and could generate data and headers from a recordset directly
Download from here: http://www.4shared.com/zip/aiU5_lMk/AdvancedListBox.html

regards


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group