Edittable utility create (None Specified)
At 15 MAY 1999 02:13:27PM Jim Vaughan wrote:
Someone recently asked the following question:
Is it possible to create an event script for a control that was created (on the fly) using the Utility("CREATE") function?
You replied
Yes. That functionality requires a development license to run.
I have a problem with this. I am trying to insert columns into a edittable, that has ]64K of data. I can not use
Call Send_Message(CtrlEntId,"INSERTCOL",pos,desc)
as it does not work with edittables that have ]64k of data. I have tried the following as I believe the edittable restriction is actually "This message cannot be used with a large memory DataTable if the table contains row information."
Handle=Get_Pproperty(CtrlEntId,"HANDLE")RetVal=SendMessage(Handle,DTM_RESETDATA,0,0)RetVal=SendMessage(Handle,DTM_SETACCESSPOS,Pos,0)RetVal=SendMessage(Handle,DTM_INSERTCOLEXT,DTA_ACCESS,"")This doesn't seem to work either, although I could get this code to delete a col.
Handle=Get_Pproperty(CtrlEntId,"HANDLE")RetVal=SendMessage(Handle,DTM_RESETDATA,0,0)RetVal=SendMessage(Handle,DTM_SETACCESSPOS,Pos,0)RetVal=SendMessage(Handle,DTM_DELETECOL,DTA_ACCESS,"")Now my only solution it seems is to use UTILITY, CREATE. However I will need to recreate the events that exist on this edittable. That would require a development license.
Any other solution?
This message has been posted on the OI formum and emailed to Cameron.
Jim Vaughan
Redondo Beach, CA
ICQ 4493332
At 15 MAY 1999 02:39PM Donald Bakke wrote:
Jim,
Are you sure that your existing events won't fire for your re-created edittable? I thought the question you were referring to had to do with controls that never existed before in design mode. You are taking an existing edittable, destroying it, and then re-creating it - presumably with the same CtrlEntId.
I can't say I've tried this (at least I don't remember doing it) but I would assume that your events would still work.
At 15 MAY 1999 02:46PM Jim Vaughan wrote:
OK, I thought they would get destroyed as well.
Let me give UTILITY CREATE a try.
At 15 MAY 1999 03:04PM Jim Vaughan wrote:
How do I get the existing values for the PS_EQUATES record. Can I read it from SYSREPOSWINEXES or SYSREPOSWINS?
At 17 MAY 1999 08:11AM Cameron Purdy wrote:
Jim,
See the POPUP_SUB code for details on what you are trying to do (DESTROY/CREATE).
Cameron Purdy
Revelation Software
At 17 MAY 1999 12:18PM Jim Vaughan wrote:
In your email you said "The struct gets returned from DESTROY … alter it and reCREATE."
This, unless I am missing something, seems not to be the case. The destroy code just returns 1 for success 0 for failure.
How do I get the current settings, can I read them from the full record in SYSREPOSWINEXES or SYSREPOSWINS and then loop until I find a control with the correct id? Is this data in the same format? If so which one should be used SYSREPOSWINEXES or SYSREPOSWINS.
I could spend the time and figure this out, but why on earth should I have to? This should be documented.
At 17 MAY 1999 01:26PM Cameron Purdy wrote:
Jim,
Yes, you are correct. In POPUP_SUB it creates the table in its entirety (it fills in all details).
You do have ORIG_STRUCT, which is what you would get (AFAIK) by reading the SYSREPOSWINEXES record. There is no STRUCT property, unfortunately, which gives you the current structure. In addition to the actual contents of the edit table, the things that typically change in an edit table are:
PSPOS_WIDE$ - if resize width on (use SIZE property)
PSPOS_HIGH$ - if resize height on (use SIZE property)
PSPOS_COLWIDE$ - if user resizes a column (use COLWIDTH message with column number 0 to get all)
If you are expecting to make multiple changes, store off the struct each time in an @ property.
Cameron Purdy
Revelation Software
At 17 MAY 1999 05:06PM Jim Vaughan wrote:
OK, I'll read the data from RESPOSWINEXES, use UTILITY DESTROY, modify the data and then use UTILITY CREATE to put it back.
Your help is appreciated.
At 17 MAY 1999 07:29PM Jim Vaughan wrote:
That worked.
At 17 MAY 1999 08:24PM Jim Vaughan wrote:
Well almost worked. All the events on the new edittable do not work. What might I be missing?
At 17 MAY 1999 08:55PM Jim Vaughan wrote:
Skip that, it works. I was turning the REDRAW off.
At 17 MAY 1999 11:53PM Donald Bakke wrote:
Nice conversation you were having with yourself .
At 18 MAY 1999 02:54AM Jim Vaughan wrote:
I do it all the time!
At 18 MAY 1999 09:49AM Cameron Purdy wrote:
Hi Jim,
My point was you should be able to use ORIG_STRUCT instead of doing a READ.
Oh, and quit talking to yourself.
Cameron Purdy
Revelation Software
At 18 MAY 1999 01:34PM Jim Vaughan wrote:
I see. OK, I'll give it a try. The read seems quick, but code can always be faster.