Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generic combobox class creation

Status
Not open for further replies.

jozerc

Programmer
Oct 10, 2004
6
CA
Hi,

I'm in the process of creating a generic combobox class usable anywhere and especialy in a GRID.

The class will be composed as this

A container class containing a textbox and a button object.
When the button is clicked a small form containg the proper value slection UI object will be diaplayed (Ex.(calendar, treeview, listbox, calculator, etc...).

I have yet one problem remaining.

I has to do with grid row or column sizing.

I would like to resize the textbox and button to fill the container on any row resize or column resize.

I was succesfull with column resize using the resize method of the column.
But the rowheight resize does not work

I have tried using the containers height_assign and width_assign method but no success.

If at all possible I would like to avoid putting code in the grid or column object.

What I don't understand is that the container gets resized properly but nothing get triggered inside of it seems.

To see what I mean create a class from a container
add a text box and button. the container will get resized but not the textbox. activate the assign and access meth for the container and see that they are not triggered by any row or column rsize. Even the grid's rowHeight_assign or access does not get triggered.

Anybody please help


How can this be done


 
What version of VFP are you using? This is important in answering this question.

boyd.gif

 
jozerc,

You are correct that the column resize only fires when the width is changed by the user and there doesn't seem to be any resize event firing when the rowheight is changed. This makes the job a bit more difficult, but I do not feel it's impossible. One of the first things to do is set up a dummy form with just your grid with one column and your class as the control for that column. Then put Set Step On in the form init or otherwise effect opening the debugger. You'll see in your debugger under the Tools menu an item called "Event Tracking" and you can turn this on while your form is runing and then go drag the rowheight and the column widths and then come back into the debugger and see what events fired. At first add every event possible to the event tracking and then narrow it down to weed out unwanted ones. The results can either be dumped to the debug window or a file, whichever your preference is. I find the debug window the easiest as I can just move back and forth between the main IDE and the debug window to see the results.

I believe that you will more than likely end up not being able to create this effect without some code in the grid or columns. It may be possible but I doubt it using VFP 7, in VFP 8 you could take advantage of EventBinding, though there are some undocumented ways to do this sort of thing in VFP 7 it's just not very stable and as I say it is undocumented. So you will probably have to use the mousedown and mousemove events of the grid as well as perhaps the grid's gridhittest. That having been said, the column object already gives you the width ability, it is just the rowheight that is lacking.

I do agree however that since the container appears to be dynamically sizing in the cell, that these other events for the container should be firing. But since they aren't, give that event tracking a go and see if that doesn't lead you to some possible events that you could perhaps you in lieu of an actual row resize event.

boyd.gif

 
I have tried all that you suggest

nothing other than mouve events occur for grid row resize.

There must be some way... I don't want to upgrade to version 8.

And by the way if rowheight_Access or _assign don't get triggered then eventbinding will not give any results

what else could I try

Regards
 
I would think that MouseMove will work since it give you the state of the mouse buttons...if my memory serves me, parameter nButton = 1 when the left-mouse button is down. As long as the Rowheight actually returns the height of the row...you should be in business. It's not a quick solution, but if you have to have it this is the way to go I think, I can't think of another way to acheive what you want. Maybe another member has an idea...but given that only these events are raised I believe that you will either have to implement it using the mousemove or just restrict the use of row resizing when using your class.

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top