Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can I stop headers click in mouseup event?
Message
 
 
À
20/08/2001 12:39:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00546254
Message ID:
00546602
Vues:
10
Hi!

In addition to what already said...

1. I have my own header class that I add to each column to replace the default header in my grid class Init method (and each time reconstruction happens). In this header I have properties OldColHeight and OldColOrder, where I store the original values of the column.Width and column.ColumnOrder. When you move header or resize it, click event fire and I compare current column properties with these stored. Something like simulation of Moved event or Resized event of the column. However, the benefit here is that I can now put all this into the grid class - so all my grids will be sortable. It is near impossible to do this using columns because some grids still require reconstruction and dynamic columns adding/removing. This is just a note. If you have only one grid that require to be sorted, you can easy use column events.

As about algorithm of calculating the right or left edge of the column (on could be determined from another just by using column width), I did made such once and it is independed from columns order and quite quick even when grid have 200+ columns. I did made it to position the sorting indicator over the header to indicate which column is sorted and in which order. This also require smart refreshing, tracking of grid scrolling etc. that is quite a big problem, I spent a lot of time and did a lot of experimenting until I reached good results.

I guess I will describe many things related to grid sorting in my next article about grids in the UT magazine (See first article to look what will be next ;).

2. I do not remember, but search here for multithreading. I remember there is a library somewhere to organize multi-threading in VFP on the processor level. With COM objects you will be able to do that, but only when you will create your own threads inside of the C++ COM object, not the instantiation of multiple COM objects. Multiple COM objects will work in a single thread - the main VFP thread. No need to use VFP structures and data inside of it, you can pass data as a variant array into the COM object function. My guess it is possible...

HTH.

>Hello Vlad
>
>i'll get more into detail ..
>1. the headers should sort the columns of the grid when clicked, but not when moved or resized, but they should be move- and resizable
>
>i've half-managed this task, i've added "left" and "right" property to my columns calculated upon the "left" value of grid and the width value of each column
>
>checking in the mousedown event of header if "nXCoord" parameter is in "resizing area"
>->
>if between(nXCoord, .parent.left, .parent.left + 3) or ;
>between(nXCoord, .parent.right -3, .parent.right)
>.doclick = .F. && own property that is checked in Click event
>endif
>(i don't know how much pixels that are .. so i just set it to -+3)
>
>and checking in the mouseup event if the "nXCoord" in not all in the "full" area of header
>
>now i get additional thoughts on considerations i have to make
>and how to workaround them :)
>(when mouseup event would return .F. cause when header is enlarged, so i think adding another property which is updated in mousedown should do the thing)
>
>in addition i must write code which updates right and left values of columns after resizing and moving (after moving is the hard part i think cause of changed columnorder)
>
>any tips on doing this are highly appreciated!
>
>2. i want to access internet game servers over Winsock Api .. so i thought i can use C++ Com Objects to add multithreading functionality to my programm ..
>for example if a user want to requery the data of 250 servers , i would create 32 COM objects and pass them the ID, IP and Port of the servers, so they could requery them at the same time (one server after another would be too slow, cause some servers may not respond at all), and when the COM object is ready with getting and parsing the data they should write it to the cursor or return it over parameters to a method of an vfp object which then updates the cursor,
>in return the object should automatically pass another ID, IP and Port to the COM object if there are any servers left in the "serverpool" .. and so on until the there are no more servers which needed to get updatet .. and then destroying all the COM Objects
>
>hope this is a realistic task
>if not serveral days of dreaming are for nothing :)
>
>Christian
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform