"Helmut A. Bender" <[EMAIL PROTECTED]> wrote ..
> Am Freitag, 15. Juli 2005 14:44 schrieb [EMAIL PROTECTED]:
> > "Helmut A. Bender" <[EMAIL PROTECTED]> wrote ..
> >
> > > Am Freitag, 15. Juli 2005 04:42 schrieb druid:
> > > > because no matter what I do, it still crashes
> > > > I think it's a bug with the SysKeyboardDialog(kbdDefault);
> > > > Someone resolve this please, because I really need to be able
> > > > to use the call
> > > > Of course I will compensate you for your time
> > > > have attached the zip of my sinple project
> > > >
> > > > Thanks
> > > > [EMAIL PROTECTED]
> >
> > Im not sure what your refering to here about rebuilding the event handling
>
> If you return false in your event handling function the os takes the
> appropriate actions for this event. You try to handle the fldEnterEvent
> yourself with setting the focus and starting SysKeyboardDialog.
>
> I don't know what the system would do exactly with this event. My suggestion
> would be to let it do what it wants to and additionaly enqueue the event that
> opens the keyboard:
>
Doing this does two things
one, when I click on DONE on the keyboard it closes
but the fielddraw is not updated
two if i use the arrow key to move to the right or try to update
the field, again it will crash
see code below
/************************************************************************
*
* File : frmMain.c
*
* Description :
*
* History:
* Name Date
Description
* ---- ----
-----------
* Don 7/8/05 12:49:58 AM Created
*
***********************************************************************/
#include <PalmOS.h>
#include "testdb.h"
#include "testdb_res.h"
#define DB_NAME "testDB"
#define DB_CARDNO 0
#define DB_CREATOR 'DPDc'
#define DB_TYPE 'DATA'
MemHandle h;
UInt16 index;
UInt32 size, Offset;
Char *ptr;
Err err;
static DmOpenRef dbPtr = NULL;
static Boolean frmMain_fldNewDesc_OnfldEnter(EventPtr event)
{
Boolean handled = false;
EvtEnqueueKey(vchrKeyboardNumeric, 0, commandKeyMask);
return true;
}
static Boolean frmMain_exitButton_OnSelect(EventPtr event)
{
// Insert code for exitButton
EventType e;
e.eType = appStopEvent;
EvtAddEventToQueue(&e);
return true;
}
/***********************************************************************
*
* FUNCTION: frmMain_HandleEvent
*
* DESCRIPTION: Handles a Form event
*
* PARAMETERS: event pointer to an event structure
*
* RETURNED: returns handled/not handled
*
* REVISION HISTORY:
* Name Date
Description
* ---- ----
-----------
* Don 7/8/05 12:49:58 AM Created
*
***********************************************************************/
Boolean frmMain_HandleEvent(EventPtr event)
{
FormPtr form;
Boolean handled = false;
switch (event->eType)
{
case fldEnterEvent:
switch (event->data.fldEnter.fieldID)
{
// fldNewDesc receives an event
case fldNewDesc:
handled =
frmMain_fldNewDesc_OnfldEnter(event);
break;
// fldNewDesc receives an event
}
break;
case ctlSelectEvent:
switch (event->data.ctlSelect.controlID)
{
// exitButton receives an event
case exitButton:
handled =
frmMain_exitButton_OnSelect(event);
break;
}
break;
case frmOpenEvent:
// Repaint form on open
form = FrmGetActiveForm();
FrmDrawForm(form);
handled = true;
break;
default:
break;
}
return handled;
}
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/