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 - Ccontrols Menu with PToolboxLib Forms
Page 1 of 1

PostPosted: Tue Mar 15, 2005 3:04 pm
by ilvmegs
Has anyone used Ccontrols to opperate a menu from within PToolboxLib forms?

How do you trap for a pen down outside of the menu?

The Ccontrols menu works as long as I select an option from the menu. If I don't select an option from the menu and tap back on the form the menu seems to remain active because I can not use the form until I access the menu again and select an option. I can't figure out how or where to give control back to the form to make it active again. The default case would seem logical but it doesn't seem to work. How do I set control back to the form if no option is selected?

The following code has one button on a PToolboxLib form and a Ccontrols menu. This is really just a combination of two of the sample codes from the Ccontrols and PTL

Thanks, Nick



//Menu Demo
//Trying to use PToolboxLib forms and Ccontrols Menu but it isn't working


library "PToolboxLib"
#include "Fctl.h"
#include "Ccontrols.c"

#define FORM1 5000
#define btnExit 5010

Chandle mnbMain;
Chandle mnuDemo, mnuProgram;

init(){

//set up menu bars
mnbMain = Cmenubar();

//Demo menu
mnuDemo = Cmenu(5, 40, 40);
Csettopic(mnuDemo, "Demo");
Cadditem(mnuDemo, "One");
Cadditem(mnuDemo, "Two");
Cadditem(mnuDemo, "Three");
Caddmenu(mnbMain, mnuDemo);

//program
mnuProgram = Cmenu(45, 40, 50);
Csettopic(mnuProgram, "Program");
Cadditem(mnuProgram, "About");
Cadditem(mnuProgram, "Quit");
Caddmenu(mnbMain, mnuProgram);

} // end init

main(){
int keepGoing = true;
int evt;
string command;
int font_height;

Fctl(HOOKMENU, 1);



Form(FORM1,"Celestial Heir Trivia");
Button(btnExit,0,107,145,50,font_height, "Exit");
Fctl(DRAW,FORM1);
init();


while(keepGoing){
evt = Fevent(1);
if(evt==btnExit){
exit();
} else if(evt==11){
saveg();
Fctl(HOOKFORM, 1);
if(Cevent(mnbMain,evt)){
if(Cgetcursel(mnuDemo)!= -1){
command = Cgetcontent(mnuDemo);
} else if (Cgetcursel(mnuProgram) != -1){
command = Cgetcontent(mnuProgram);
} // end if
switch (command){

case "One":
restoreg();
Fctl(HOOKFORM, 0);
alert("Ichi");
break;
case "Two":
restoreg();
Fctl(HOOKFORM, 0);
alert("Ni");
break;
case "Three":
restoreg();
Fctl(HOOKFORM, 0);
alert("San");
break;
case "About":
restoreg();
Fctl(HOOKFORM, 0);
alert("Menu Demo");
break;
case "Quit":
restoreg();
Fctl(HOOKFORM, 0);
keepGoing = false;
break;
default:
restoreg();
Fctl(HOOKFORM, 0);
alert(command);
} // end switch
}
} // end menu if
} // end while loop
} // end main

ilvmegs

PostPosted: Fri Mar 18, 2005 4:06 pm
by ilvmegs
Well, I couldn't figure this one out so I just used resource menus in PToolboxLib(using pilrc and par). That actually proved to be easier.

Nick

ilvmegs