home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / notebook / smrtguid / training.cpp < prev   
C/C++ Source or Header  |  1996-10-29  |  2KB  |  83 lines

  1. //************************************************************
  2. // Notebook Control - Smart Guide Notebook            
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //************************************************************
  8. #include <iapp.hpp>
  9. #include <iostream.h>
  10. #include "smrtguid.hpp"
  11.  
  12.  
  13. void main ( )
  14. {
  15.   SmartGuide smartGuide("PowerGui SmartGuide Sample");
  16.   TextSmartPage  introPage;
  17.   introPage
  18.    .setPageLabel("What is a Smart Guide?")
  19.    .setPageTextFile("smrtpag1.txt")
  20.    .setTabText("Introduction");
  21.  
  22.   SingleChoiceSmartPage  logFile;
  23.   logFile
  24.    .addChoice("Yes")
  25.    .addChoice("No")
  26.    .setSelectedChoice(0)
  27.    .setPageLabel("Specify whether you want to keep a log file.")
  28.    .setPageTextFile("smrtpag2.txt")
  29.    .setTabText("Logging");
  30.  
  31.   SingleChoiceSmartPage  logFileLocation;
  32.   logFileLocation
  33.    .addChoice("Current Path")
  34.    .addChoice("Root directory")
  35.    .setSelectedChoice(0)
  36.    .setPageLabel("Choose a log file location.")
  37.    .setPageTextFile("smrtpag3.txt")
  38.    .setTabText("Log File Location");
  39.  
  40.   TextSmartPage  submitPage;
  41.   submitPage
  42.    .setPageLabel("Press \"Done\" to Finish.")
  43.    .setPageText("")
  44.    .setTabText("Submit");
  45.  
  46.   TextSmartPage  donePage;
  47.   donePage
  48.    .setPageLabel("SmartGuide Complete.")
  49.    .setPageText("Ok. Thanks.")
  50.    .setTabText("Done");
  51.  
  52.  
  53.   unsigned long introHandle, logFileHandle, logFileLocationHandle,
  54.         submit1Handle, submit2Handle, done1Handle, done2Handle;
  55.  
  56.   // 1=introHandle    2=logFileHandle  3=logFileLocationHandle
  57.   // 4=submit1Handle  5=done1Handle                  
  58.   // 6=submit2Handle  7=done2Handle
  59.   //      intro 1
  60.   //    logFile 2 
  61.   //           / \ 
  62.   // logFileL 3   6 submit
  63.   //  submit  4   7 done
  64.   //  done    5
  65.   introHandle = smartGuide.addPage(&introPage);
  66.   logFileHandle = smartGuide.addPage(&logFile, introHandle);
  67.   logFileLocationHandle = smartGuide.addPage(&logFileLocation, logFileHandle);
  68.   submit1Handle = smartGuide.addPage(&submitPage, logFileLocationHandle);
  69.   done1Handle   = smartGuide.addPage(&donePage, submit1Handle);
  70.  
  71.   submit2Handle = smartGuide.addPage(&submitPage, logFileHandle);
  72.   done2Handle   = smartGuide.addPage(&donePage, submit2Handle);
  73.  
  74.   cout << smartGuide.asDebugInfo();
  75.  
  76.  
  77.   smartGuide.show();
  78.  
  79.   cout << smartGuide.asDebugInfo();
  80.  
  81.   IApplication::current().run();
  82. }    
  83.