Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Menu Locking up

Menu Locking up

A PocketC native palm library offering native forms and assorted utilities

Postby Eli on Sun Dec 21, 2003 5:38 pm

Hi all,
I am working on my second app and came a interesting problem.
I am just trying to put an "about" menu on my program. I was successful in getting the menu and opening the dialog form. My problem is that when i close the form and return to the original form the buttons on that form only works one more time and the program locks up, except the menu of course.

Here is my event capture function for both forms.

Thanks for your help.

Eli

// Main Form Events capture
FormParkingEvents()
{
int e;
while(1)
{
e=Fevent(1);
switch(e)
{
case BT_PREVIOUS:
current_rec = current_rec-1;
Draw_Form_Parking();
case TODAY:
Todays_Code();
break;
case BT_NEXT:
current_rec = current_rec+1;
Draw_Form_Parking();
break;
case 11: //MENU
Menu();
break;
default :
break;
} //switch
} //while
return;
}
/////////////////////////////////////////////////////////////////////
// menu capture
Menu()
{
int i;
i=Fctl(POPLIST,LIST1);
switch(i)
{
case 0: Draw_About();
break;
default:
break;
}
FsetState(LIST1,-1); //undo the list selection
}
/////////////////////////////////////////////////////////////////////
// About dialog event capture
DialogAboutEvents()
{
int e;
while(1){
e=Fevent(1);
switch(e)
{
case BT_CANCEL:
Setup(); // takes me back to start form
break;
} //switch
} //while
return;
}

Eli
Eli
 
Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby jstadolnik on Sun Dec 21, 2003 6:27 pm

My guess is that when you are returning back to the parking form from the about dialog that the parking form is not getting reset at the active form.

How are you popping and cleaning up the about dialog?

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Eli on Sun Dec 21, 2003 11:31 pm

I think i am doing it the way i did before (code follows). You got me on the cleaning up part???

Thanks again for taking the time. Let me know if you need to see more (not that there is much more :).
Eli


Draw_About()
{
Fctl(DRAW,DB_ABOUT);
DialogAboutEvents();
return;
}

Dialog_About()
{
Dialog(DB_ABOUT,1,15,158,144,"About");
{
textattr(7,1,0);
Label(LB_ABOUT1,25,15,"Parking Codes V1.0");
textattr(1,1,0);
Label(LB_ABOUT2,25,30,"");
//.....
Label(LB_ABOUT10,25,107,"database.");
Button(BT_CANCEL,0x000,60,129,0,0,"OK");
textattr(0,1,0);
Label(LB_ABOUT11,1,134,"12.19.03");
}
}

Eli
Eli
 
Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby jstadolnik on Mon Dec 22, 2003 12:17 am

You need to call Fctl DRAW on the parking form after you are done with the about dialog. If you don't, the about dialog will remain the active form.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Eli on Mon Dec 22, 2003 11:01 am

Hi Joe, got that covered. Thats one of the first lines in the Draw_Form_Parking function. I also call the Parkin FormParkingEvents(); function at the end. I am still stumped. Here is a snippet of the other functions. The program is quite simple, what i think is happening is that since i only have one option on the menu it is not clearing the event after it occurs.

Thanks again.

Setup()
{
DBopen("ParkingCodesDB");
current_rec = current_rec-1;
//...
Draw_Form_Parking();
}
Draw_Form_Parking()
{
string first,second,third,fourth;
Fctl(DRAW,FORM_PARKING);
FsetText(STARTDATE,DateConv(DBgetfield(current_rec,0),17));
//...
FormParkingEvents();
return;


Eli
Eli
 
Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby jstadolnik on Mon Dec 22, 2003 1:49 pm

1) Your while loop in DialogAboutEvents() never exits and you should not be calling Setup() from inside the DialogAboutEvents() function, but rather after the DialogAboutEvents() call finishes.

2) In the FormParkingEvents() call the BT_PREVIOUS case seems that it may be missing a break statement (though this may be intentional on your part?).

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Eli on Mon Dec 22, 2003 3:25 pm

Joe, you are right the problem is with the while loop. I have tried almost all combinations i can think of. I replaced the setup() with

Fctl(DRAW,FORM_PARKING);
FormParkingEvents();

and several other combinations with no success. Is there a way i can force out of the Fevent?



Eli
Eli
 
Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA

Postby jstadolnik on Mon Dec 22, 2003 4:32 pm

1) Your DialogAboutEvents() function should be calling return rather than Setup() in the BT_CANCEL case.

2) Call Setup() immediately after Draw_About() to re-enable the parking form.

In general, it's a good idea to keep the functions for each form separate from each other as much as possible. In this case, not calling any parking form functions from inside the about dialog functions. This keeps things more "modular".

For simple forms like your about dialog, it's often easiest to create, use, and free them on the fly rather then the keep them resident in memory. A Fctl FREE call will automatically turn control back to the previous form. So your Draw_About() function could internally call Dialog_About(), DialogAboutEvents(), and finally Fctl FREE. Forms containing many object take longer to build. It is often best to not free these forms, but rather keep them resident in memory especially if they are used frequently.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Eli on Mon Dec 22, 2003 6:09 pm

THANKS! It makes sense now. I'm going to fix the old program the same way.

Thanks for taking the time.

Eli

Eli
Eli
 
Posts: 42
Joined: Fri Oct 11, 2002 10:57 pm
Location: USA


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 2 guests

cron