Ok, here are partes of the Form2 Event handler.  I am trying
to figure out why my list is not being updated properly.

If I backspace, deleting characters, in Form2 Edit field,
the list is not updated to show those deletions.  If I 
backspace, then add a char, those added chars are shown
in the correct location.

If I backspace twice and add one character ('6') only the single
character position is affected (ie. was: 1234, is: 1264)

The deleted characters 'are' deleted in the listArray.

// listchoices are setup correctly in Form1 OpenForm event
// code fragment for Form2 Event handler
case frmOpenEvent:
    FrmDrawForm(frm2Ptr);
    // gets string from list Array and puts in edit field on Form2
    PutFieldText(fldEdit, listArrayPtr[index]); // my function
    FrmSetFocus(frm2Ptr, FrmGetObjectIndex(frm2Ptr, fldEdit));
    handled = 1;
    break;

case ctlSelectEvent:
    if(event->data.ctlEnter.controlID == btnOK) {
        // gets string from edit field and puts in listArray.
        GetFieldText(listArrayPtr[index], fldEdit);  // my function
        FrmReturnToForm(Form1);
        form = FrmGetFormPtr(Form1);  // form declared elsewhere
        listP = FrmGetObjectPtr(form, FrmGetObjectIndex(form, lstEdit));
        LstDrawList(listP);
        handled = 1;
        break;
    }

Any clue why the list is only updated when chars are added but
not deleted?  Hope I havn't made any typos.  It acts as though
the list element is not erased but rather just overwritten,
with new data, less the '\0'.


On Mon, 3 May 1999, Michael S. Davis wrote:

> 
> This is a similar question to the FrmReturnToForm questions
> recently posted.
> 
> I have a Form (Form1) that contains a list.  That list's
> choices are set in the FormOpenEvent for Form1.
> 
> I then click on the list and another PopupForm (Form2) pops up
> alowing me to edit the item from Form 1 list.
> 
> After I am through editing that item, I click OK and the
> data from that field is copied with StrCopy back to the
> listItemArray.  Then I do, from within Form2 Event Handler,
> a FrmReturnToForm followed by a LstDrawList for the list on Form1.
> 
> It seems to work ok but for a couple of odd thing.  So, I'm wondering
> if there is a better way of doing this.  
> 
> Also:
> 1) Are there any events queued as the result of the FrmReturnToForm
> function?
> 2) Which ones?
> 3) what is the best way to transfer data from a field, in Form2, to
> a list element in Form1?
> 
> thanks
> 
> 
> ----------------------------------------------------
> Shoot-to-Win
> 
> Protect the 2nd Amendment
> ----------------------------------------------------
> 
> 
> 

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to