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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Development Project - Outsider 1

Status
Not open for further replies.

benman

Programmer
May 3, 2006
35
HK
Hello All :

Currently I am developing a VFP system on my own from scratch, with a layout familiar to everyone.

What has been developed are:
1) selector
6 sections x 6 subsections, selecting 36 pages of view/filter combinations.
2) a grid control displaying database for browsing.

What I want to do next are:
1) double click the grid record to display a form for database maintenance
2) a generic print button to print exactly what it is in the grid or by selection
3) generic search field function
4) so and so and so

Any comment/advice to enlighten the project to move forward.

A bit tired for one-man programming who has to talk to himself.

Thanks all.
01.jpg

 

I'll answer the easy one: the double-click action.

You need to write code in the DblClick event of the textbox within the grid. This is not the same as the grid's own DblClick.

In the form designer, click on the grid. Then open the drop-down at the top of the Properties Window. Look for the appropriate column, then the text box within the column. That's the object whose DblClick you want.

The code in the DblClick is a simple DO FORM. Ideally, make it a modal form, so that things stay in sync. You should pass the ID or record number of the current record (that will be the one the user clicked on).

That should get you started. I'll leave it to others to answer your other questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Dear Mike Lewis :

Thanks for your involvement point#1.

I am following so ...

In the form designer, grid was clicked. Opened Properties Window and there is neither column nor text box.

That grid has its own ColumnCount being -1, and memberclass pointing to predefined Column library in a prg.

Inside Column object properties, I can define HeaderClass/HeaderClassLibrary. However, TextClass/TextClassLibrary is not available from VFP.

Wondering here now ...



 
Hi MikeLewis

can I use BINDEVENT( ) to bind DblClick of the text box within the column after its auto-creation if the ColumnCount is minus one.

where should the BINDEVENT( ) be put through ...

i tried to go through the event sequence and have no hint.
 
I think it is through:

1) Create a new Method oTextDblClick in object Grid
2) In Grid.INIT, add-in:
FOR m.nCount = 1 TO this.ColumnCount
BINDEVENT(this.Columns(m.nCount).text1, "DblClick", this, "oTextDblClick")
NEXT

I have tested it with ??Chr(7) code inside oTextDblClick and works.

Do you agree on such arrangement.

And I want to thank MikeLewis enlightened me to look onto Columns' text object. Kindly indeed.


 

Benman,

Yes, BINDEVENT() is a good way to do this, especially if you cannot create the grid's record source until after you populate the grid.

I see that no-one has answered your other questions. I suggest that you start a new thread for each question. Also, you'll probably get better results if you ask more specific questions, rather than just for "any comments / advice".

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top