you are lacking
FldDrawField
or
FldRecalculateField
On Thu, 04 Nov 2004 13:16:00 -0700, Tony Janke
<[EMAIL PROTECTED]> wrote:
> I am using a field to report the position of a slider in my application.
> The problem I am having is that the field doesn't seem to refresh
> itself to the new value. Unless you HIGHLIGHT the field, then the new
> value will be displayed! Also, not all of the old data is erased when
> the new value is shown. I am showing a value ranging from 0 to 40.
> Example:
>
> Cursor is moved to position 10, the field is highlighted, then the
> display changes from "00" to "10". Next I move the cursor 1 position
> back (9), the display still says "10" until I highlight it, at which
> point it displays "90". I even tried writing " " (2 blanks) to the
> field before the new data.
>
> Here is my code...
>
> if(Refresh == true)
> {
> WriteNumberToField(Vehicle.CH[ActiveChannel].VOLUMELEVEL,
> 1014);
> }
> switch (pEvent->eType) {
> case ctlSelectEvent:
> switch (pEvent->data.ctlSelect.controlID)
> {
>
> case 1015:
> ControlPtr =
> FrmGetObjectPtr(pForm, FrmGetObjectIndex(pForm, 1015)); // Get slider
> position
>
> Vehicle.CH[ActiveChannel].VOLUMELEVEL = CtlGetValue(ControlPtr);
> WriteTextToField("
> ", 1014); // MAKES NO DIFFERENCE!!!!
>
> WriteNumberToField(Vehicle.CH[ActiveChannel].VOLUMELEVEL, 1014);
> break;
> }
> }
>
> The first time this form handler is called, Refresh = true so the field
> (1014) is refreshed. WriteNumberToField converts the INT (1st param) to
> a string, then displays that string in the field (1014). This function
> works fine and is shown below in case interested. Each time the slider
> (1015) is moved, its new value is stored in
> Vehicle.CH[ActiveChannel].VOLUMELEVEL and should be displayed to field
> 1014.
>
> anyone had this happen to them before?
>
> thanks,
>
> ~Tony
>
> // WRITENUMBERTOFIELD FUNCTION
>
> static void WriteNumberToField(UInt8 data, UInt16 controlID)
> {
> FormType* pForm;
> FieldType* FieldPtr;
> MemHandle h, oldHandle;
> char *p;
>
> pForm = FrmGetActiveForm();
> h = MemHandleNew(50); // allocate chunk of memory in
> heap
> p = MemHandleLock(h); // prevent the chunk from moving
> (lock) and obtain pointer to location
> StrIToA(p, data);
> MemHandleResize(h, StrLen(p)+1);
> MemHandleUnlock(h);
> FieldPtr = FrmGetObjectPtr(pForm, FrmGetObjectIndex(pForm,
> controlID));
> oldHandle = FldGetTextHandle(FieldPtr);
> FldSetTextHandle(FieldPtr, h);
> if(oldHandle)
> MemHandleFree(oldHandle);
> }
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe, please see
> http://www.palmos.com/dev/support/forums/
>
--
Chant Hare Krishna and Be Happy
Eka
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/