home *** CD-ROM | disk | FTP | other *** search
/ CICA 1994 September / CICA_Shareware_for_Windows_Walnut_Creek_September_1994.iso / win3 / programr / atre27.exe / ATREE_27 / OCRDEMO2 / EDITLETT.CPP < prev    next >
C/C++ Source or Header  |  1992-08-01  |  5KB  |  117 lines

  1. /*****************************************************************************
  2.  ****                                                                     ****
  3.  **** editlett.cpp                                                        ****
  4.  ****                                                                     ****
  5.  **** atree release 2.7 for Windows                                       ****
  6.  **** Adaptive Logic Network (ALN) simulation program.                    ****
  7.  **** Copyright (C) M. Thomas, N. Sanche, W.W. Armstrong 1991, 1992       ****
  8.  ****                                                                                       ****
  9.  **** License:                                                            ****
  10.  **** A royalty-free license is granted for the use of this software for  ****
  11.  **** NON_COMMERCIAL PURPOSES ONLY. The software may be copied and/or     ****
  12.  **** modified provided this notice appears in its entirety and unchanged ****
  13.  **** in all derived source programs.  Persons modifying the code are     ****
  14.  **** requested to state the date, the changes made and who made them     ****
  15.  **** in the modification history.                                        ****
  16.  ****                                                                     ****
  17.  **** Patent License:                                                     ****
  18.  **** The use of a digital circuit which transmits a signal indicating    ****
  19.  **** heuristic responsibility is protected by U. S. Patent 3,934,231     ****
  20.  **** and others assigned to Dendronic Decisions Limited of Edmonton,     ****
  21.  **** W. W. Armstrong, President.  A royalty-free license is granted      ****
  22.  **** by the company to use this patent for NON_COMMERCIAL PURPOSES to    ****
  23.  **** adapt logic trees using this program and its modifications.         ****
  24.  ****                                                                     ****
  25.  **** Limited Warranty:                                                   ****
  26.  **** This software is provided "as is" without warranty of any kind,     ****
  27.  **** either expressed or implied, including, but not limited to, the     ****
  28.  **** implied warrantees of merchantability and fitness for a particular  ****
  29.  **** purpose.  The entire risk as to the quality and performance of the  ****
  30.  **** program is with the user.  Neither the authors, nor the             ****
  31.  **** University of Alberta, its officers, agents, servants or employees  ****
  32.  **** shall be liable or responsible in any way for any damage to         ****
  33.  **** property or direct personal or consequential injury of any nature   ****
  34.  **** whatsoever that may be suffered or sustained by any licensee, user  ****
  35.  **** or any other party as a consequence of the use or disposition of    ****
  36.  **** this software.                                                      ****
  37.  **** Modification history:                                               ****
  38.  ****                                                                     ****
  39.  **** 92.04.27 atree v2.5 for Windows, M. Thomas                          ****
  40.  **** 92.03.07 Release 2.6, Monroe Thomas, Neal Sanche                    ****
  41.  **** 92.01.08 Release 2.7, Monroe Thomas, Neal Sanche                    ****
  42.  ****                                                                     ****
  43.  *****************************************************************************/
  44.  
  45. #include "ocr.h"
  46. #include "editlett.h"
  47. //
  48. // Letter Editing Dialog object implementation code
  49. //
  50.  
  51. TEditDlg::TEditDlg(PTWindowsObject AParent, PTBitmapControl ABitmap)
  52.     : TDialog(AParent, OCR_EDITCHAR)
  53. {
  54.     OrigBitmap = ABitmap;
  55.     EditChar = new TBitmapDrawControl(this, OCR_DRAWCHAR,
  56.         OrigBitmap->GetBitmap());
  57.         Rotate = new TEditScroll(this, ID_EDITSCRL, 0, 360, 0, 10);
  58. }
  59.  
  60. void TEditDlg::SetupWindow()
  61. {
  62.     EditChar->SetDrawColor(RGB(0,0,255));
  63.     EditChar->SetEraseColor(RGB(192,192,192));
  64.     SetDlgItemInt(HWindow, ID_COORDX, 0, TRUE);
  65.     SetDlgItemInt(HWindow, ID_COORDY, 0, TRUE);
  66. }
  67.  
  68. void TEditDlg::Ok(RTMessage Msg)
  69. {
  70.     OrigBitmap->Init(EditChar->GetBitmap());
  71.     OrigBitmap->SetDrawColor(RGB(0,0,255));
  72.     OrigBitmap->SetEraseColor(RGB(192,192,192));
  73.     OrigBitmap->Refresh();
  74.     TDialog::Ok(Msg);
  75. }
  76.  
  77. void TEditDlg::IDCounter(RTMessage)
  78. {
  79.     char Buffer[10];
  80.     int Angle;
  81.  
  82.     Rotate->GetText(Buffer, 10);
  83.     Angle = atoi(Buffer);
  84. //    EnableWindow(GetDlgItem(HWindow, IDCOUNTER), FALSE);
  85.     EditChar->Rotate(Angle);
  86. //    EnableWindow(GetDlgItem(HWindow, IDCOUNTER), TRUE);
  87.     EditChar->Refresh();
  88. }
  89.  
  90. void TEditDlg::IDClockwise(RTMessage)
  91. {
  92.     char Buffer[10];
  93.     int Angle;
  94.  
  95.     Rotate->GetText(Buffer, 10);
  96.     Angle = atoi(Buffer);
  97. //    EnableWindow(GetDlgItem(HWindow, IDCLOCKWISE), FALSE);
  98.     EditChar->Rotate(-Angle);
  99. //    EnableWindow(GetDlgItem(HWindow, IDCLOCKWISE), TRUE);
  100.     EditChar->Refresh();
  101. }
  102.  
  103. void TEditDlg::IDHelp(RTMessage)
  104. {
  105.     PTDialog D;
  106.  
  107.         D = new TDialog(this, OCR_DRAWHELP);
  108.     GetApplication()->ExecDialog(D);
  109. }
  110.  
  111. void TEditDlg::TBDCCoordChange(RTMessage Msg)
  112. {
  113.         char szBuffer[6];
  114.         SetDlgItemInt(HWindow, ID_COORDY, Msg.LP.Hi, TRUE);
  115.     SetDlgItemInt(HWindow, ID_COORDX, Msg.LP.Lo, TRUE);
  116. }
  117.