home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / ADDON.PAK / IDEUITST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.8 KB  |  99 lines

  1. #ifndef __AOEXPCH_H
  2.   #include "aoexpch.h"
  3. #endif
  4. #pragma hdrstop
  5.  
  6. #include <ideaddon\iidewin.h>
  7. #include "ideuitst.h"
  8.  
  9.  
  10.  
  11. ///////////////////////////
  12. // IdeUITest Implementation
  13. ///////////////////////////
  14.  
  15.  
  16. IdeUITest::IdeUITest() 
  17.           : ideui( 0 )
  18. {
  19. }
  20.  
  21.  
  22. IdeUITest::~IdeUITest()
  23. {
  24.   if( ideui )
  25.       ideui->Release();
  26. }
  27.  
  28.  
  29. BOOL IdeUITest::Init()
  30. {
  31.    OutStr( "IdeUITest::Init()" );
  32.    ideui = GET_INTERFACE( IIdeUI );
  33.    if( !ideui )  {
  34.      OutStr( "Couldn't get IdeUI interface" );
  35.      return FALSE;
  36.    }
  37.      
  38.    return TRUE;
  39. }
  40.  
  41.  
  42. void IdeUITest::UnInit()
  43. {
  44.   OutStr( "IdeUITest::UnInit()" );
  45. }
  46.  
  47.  
  48. const char* IdeUITest::GetName()
  49. {
  50.    return "IdeUI Test";
  51. }
  52.  
  53.  
  54. const char* IdeUITest::GetTestDescription(int testNum)
  55. {
  56.     switch(testNum)  {
  57.         case 1:
  58.           return "Start Hourglass Cursor for a few seconds";
  59.         case 2:
  60.           return "Display IDE MessageBoxes";
  61.         default: 
  62.           return "Test Not Implemented";
  63.     }
  64. }
  65.  
  66.  
  67. void IdeUITest::DoTest(int testNum)
  68. {
  69.     switch(testNum)  {
  70.         case 1:  {
  71.           ideui->StartWait();
  72.           OutStr( "Waiting for a few seconds" );
  73.           Sleep( 4000 );
  74.           OutStr( "Done Waiting" );
  75.           ideui->StopWait();
  76.           break;
  77.         }  
  78.         case 2:
  79.           RunMessageBoxes();
  80.           break;
  81.         default:
  82.           OutStr( "Test not implemented." );
  83.     }
  84. }
  85.  
  86.  
  87. void IdeUITest::RunMessageBoxes()
  88. {
  89.    IIdeWindow* idewin = GET_INTERFACE( IIdeWindow );
  90.    HWND parent = idewin->GetHwnd();
  91.    idewin->Release();
  92.    
  93.    ideui->InfoBox( parent, "InfoBox" );
  94.    ideui->GetYesNoBox( parent, "YesNoBox" );
  95.    ideui->DoOkCancelBox( parent, "OkCancelBox" );
  96.    ideui->ErrorBox( parent, "ErrorBox" );
  97. }
  98.  
  99.