how to relate a function with a button in a form?? 
following is the things i need but just dunno how to implement it...could 
someone help me out pls??it's urgent!! 
************************************************************ 
1stFormEventHandler(EventPtr event) 
{ 
FormPtr form; 
Boolean handled = false; 

switch(event->eType) 
{ 
case ctlSelectEvent: 
switch(event->data.ctlSelect.controlID) 
{ 
case button1: 
//goto 2ndform for function_1 
break; 

case button2: 
//goto 2ndform also but function_2 
break; 
. 
. //few more buttons for particular function 
. 
} 
case frmOpenEvent: 
form = FrmGetActiveForm(); 
FrmDrawForm(form); 
handled = true; 
break; 
} 
return (handled); 
} 

******************************************************************* 
2ndFormEventHandler(EventPtr event) 
{ 
FormPtr form; 
Boolean handled = false; 

switch(event->eType) 
{ 
case ctlSelectEvent: 
switch(event->data.ctlSelect.controlID) 
{ 
case yesButton: 
//respond yes for question 
break; 

case noButton: 
//respond no for question 
break; 
} 
case frmOpenEvent: 
form = FrmGetActiveForm(); 
FrmDrawForm(form); 
handled = true; 
break; 
} 
return (handled); 
} 

************************************************** 
function_1() 
{ 
FormPtr form; 
Boolean handled = false; 

form = FrmGetActiveForm(); 
FrmDrawForm(form); 

setFieldText(field," //to display a question on 2nd form// "); 
//need to get respond(yes/no button) from user 
if (respond == yes) 
{ 
setFieldText(field," //another question here// "); 
handled = true; 
. 
. //repeating few same action of question and answer 
. 
} 

*********************************************************** 
function_2 and others function is just same with function_1 which is to display 
question and capture respond from user. 
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to