home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 May / Disc 2 / PCU0503CD2.iso / Crystal / Samples / CPP / 32bit / Mycall / CURSORBX.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-18  |  2.8 KB  |  157 lines

  1. // CursorBox.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "mycall.h"
  6. #include "CursorBx.h"
  7. #include "../../crpe.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCursorBox
  16.  
  17. CCursorBox::CCursorBox()
  18. {
  19. }
  20.  
  21. CCursorBox::~CCursorBox()
  22. {
  23. }
  24.  
  25.  
  26. BEGIN_MESSAGE_MAP(CCursorBox, CComboBox)
  27.     //{{AFX_MSG_MAP(CCursorBox)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.     //}}AFX_MSG_MAP
  30. END_MESSAGE_MAP()
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CCursorBox message handlers
  34.  
  35.  
  36. /* This function will set the combobox's selected value to the 
  37. cursor ID selected.
  38. */
  39. void CCursorBox::SetItem(const short cursorID)
  40. {
  41.     
  42.     switch(cursorID){
  43.     case PE_TC_DEFAULT_CURSOR:
  44.         SetCurSel(0);
  45.         break;
  46.     case PE_TC_ARROW_CURSOR:
  47.         SetCurSel(1);
  48.         break;
  49.     case PE_TC_CROSS_CURSOR:
  50.         SetCurSel(2);
  51.         break;
  52.     case PE_TC_IBEAM_CURSOR:
  53.         SetCurSel(3);
  54.         break;
  55.     case PE_TC_UPARROW_CURSOR:
  56.         SetCurSel(4);
  57.         break;
  58.     case PE_TC_SIZEALL_CURSOR:
  59.         SetCurSel(5);
  60.         break;
  61.     case PE_TC_SIZENWSE_CURSOR:
  62.         SetCurSel(6);
  63.         break;
  64.     case PE_TC_SIZENESW_CURSOR:
  65.         SetCurSel(7);
  66.         break;
  67.     case PE_TC_SIZEWE_CURSOR:
  68.         SetCurSel(8);
  69.         break;
  70.     case PE_TC_SIZENS_CURSOR:
  71.         SetCurSel(9);
  72.         break;
  73.     case PE_TC_NO_CURSOR:
  74.         SetCurSel(10);
  75.         break;
  76.     case PE_TC_WAIT_CURSOR:
  77.         SetCurSel(11);
  78.         break;
  79.     case PE_TC_APPSTARTING_CURSOR:
  80.         SetCurSel(12);
  81.         break;
  82.     case PE_TC_HELP_CURSOR:
  83.         SetCurSel(13);
  84.         break;
  85.     case PE_TC_MAGNIFY_CURSOR:
  86.         SetCurSel(14);
  87.         break;
  88.     default:
  89.         break;
  90. }
  91. }
  92.  
  93. /*  This function will return the combobox's selected cursor value.
  94. */
  95. short CCursorBox::GetPETC()
  96. {
  97.     int result;
  98.     switch(GetCurSel()){
  99.     case 0:
  100.         result = PE_TC_DEFAULT_CURSOR;
  101.         break;
  102.     case 1:
  103.         result = PE_TC_ARROW_CURSOR;
  104.         break;
  105.     case 2:
  106.         result = PE_TC_CROSS_CURSOR ;
  107.         break;
  108.     case 3:
  109.         result = PE_TC_IBEAM_CURSOR;
  110.         break;
  111.     case 4: 
  112.         result = PE_TC_UPARROW_CURSOR;
  113.         break;
  114.     case 5:
  115.         result = PE_TC_SIZEALL_CURSOR;
  116.         break;
  117.     case 6:
  118.         result = PE_TC_SIZENWSE_CURSOR;
  119.         break;
  120.     case 7:
  121.         result = PE_TC_SIZENESW_CURSOR;
  122.         break;
  123.     case 8:
  124.         result = PE_TC_SIZEWE_CURSOR;
  125.         break;
  126.     case 9:
  127.         result = PE_TC_SIZENS_CURSOR;
  128.         break;
  129.     case 10:
  130.         result = PE_TC_NO_CURSOR;
  131.         break;
  132.     case 11:
  133.         result = PE_TC_WAIT_CURSOR;
  134.         break;
  135.     case 12: 
  136.         result = PE_TC_APPSTARTING_CURSOR;
  137.         break;
  138.     case 13:
  139.         result = PE_TC_HELP_CURSOR;
  140.         break;
  141.     case 14:
  142.         result = PE_TC_MAGNIFY_CURSOR;
  143.         break;
  144.     default:
  145.         break;
  146.     }
  147.     return result;
  148. }
  149.  
  150. // clearing the combobox and disabling the window.
  151. void CCursorBox::ClearVars()
  152. {
  153.  
  154.     SetCurSel(-1);
  155.     EnableWindow(FALSE);
  156. }
  157.