PHP Classes
Icontem

File: examples.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of John Smith  >  nDialog  >  examples.php  
File: examples.php
Role: Example script
Content type: text/plain
Description: Shows how to use the nDialog object
Class: nDialog
Display dialog windows in text consoles
 

Contents

Class file image Download
#!/usr/local/bin/php
<?
require_once("nDialog.class.php");



$Dialog = new nDialog();

// Set a top title bar
$Dialog->set("title_page_header"" Example v.1.1.0 ");





// ********** Example: Checklist
$Dialog->mode("checklist","18x52");
$Dialog->set("text","This is a checkbox selection.\nWe are testing the checkboxes.");
$Dialog->addChecklist("field-a","Apples","A""Red & Green Apples",1,true);
$Dialog->addChecklist("field-b","Meats","M""Beef, Pork",2,false);
$Dialog->addChecklist("field-c","Seafood","f""Fish, Shrimp",3,true);
$Dialog->addChecklist("field-d","Vegi","V""Garden Greens",4,true);
$Dialog->addChecklist("field-e","Grains","G""Flour, Nuts",5,false);
$Dialog->set("title_dialog_header"" Food List ");
// Show dialog box & get user input
$result $Dialog->stroke();
// Properly cleanup the screen
$Dialog->distroy();
// Show what results we got back
print"Return value:\n";var_dump($result);






/*
// ********** Example: Menu
$Dialog->mode("menu","18x62");
$Dialog->set("text","This is a menu test.\nWe are testing the menu.\nHit go");
$Dialog->set("title_dialog_header", " Main Menu ");
$Dialog->addMenu("Standard","S", "Begin standard installation",1);
$Dialog->addMenu("Express","E", "Express installation",2);
$Dialog->addMenu("Keymap","K", "Define Keymaps",3);
$Dialog->addMenu("Options","O", "View/Set Options",4);
$Dialog->addMenu("Run","R", "Start the process",5);
// Show dialog box & get user input
$result = $Dialog->stroke();
// Properly cleanup the screen
$Dialog->distroy();
// Show what results we got back
print"Return value:\n";var_dump($result);
*/





/*
// ********** Example: Notice
$Dialog->mode("notice","");
$Dialog->set("text","\nA notice box is great\nfor informing people while\na proccess continues...\n");
$Dialog->set("title_dialog_header", " Please Wait ");
// Show dialog box & get user input
$result = $Dialog->stroke();
// keep going - do work...
sleep(3);
// Properly cleanup the screen
$Dialog->distroy();
*/




/*
// ********** Example: Message Dialog
$Dialog->mode("msgbox","8x40");
$Dialog->set("text","This is a simple message box. Please press <enter> to continue.");
// Show dialog box & get user input
$result = $Dialog->stroke();
// Properly cleanup the screen
$Dialog->distroy();
// Show what results we got back
print"Return value:\n";var_dump($result);
*/




/*
// ********** Example: Yes/No box
$Dialog->mode("yesno","7x35");
$Dialog->set("text","\nContinue?");
$Dialog->set("title_dialog_header", "");
// Show dialog box & get user input
$result = $Dialog->stroke();
// Properly cleanup the screen
$Dialog->distroy();
// Show what results we got back
print"Return value:\n";var_dump($result);
*/







/*
// ********** Example: Inputbox
$Dialog->mode("inputbox","10x40");
$Dialog->set("title_dialog_header", " Age Check ");
$Dialog->set("text","\nPlease enter your current age:");
$Dialog->set("length",10);
$Dialog->set("default_val","34");
// Show dialog box & get user input
$result = $Dialog->stroke();
// Properly cleanup the screen
$Dialog->distroy();
// Show what results we got back
print"Return value:\n";var_dump($result);
*/











exit;
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products