home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / handson / archive / Issue159 / files / cppwkshp / CalcUnit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-07  |  1.4 KB  |  46 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "CalcUnit.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. #pragma resource "*.dfm"
  9. TForm1 *Form1;
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.     : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16.  
  17.  
  18. void __fastcall TForm1::FormCreate (TObject *Sender)
  19. {
  20.     HexDecMode = new TLabel (Display);
  21.     HexDecMode->Parent = Display;
  22.     HexDecMode->Font->Name = "Arial";
  23.     HexDecMode->Font->Size = 7;
  24.     HexDecMode->Font->Color = Display->Font->Color;
  25.     HexDecMode->Caption = "Hex";
  26.     ShowHexDecMode();
  27. }
  28.  
  29. void __fastcall TForm1::ShowHexDecMode (void)
  30. {
  31.     HexDecMode->Left = Display->Width - HexDecMode->Width - 5;
  32.     HexDecMode->Top = Display->Height - HexDecMode->Height - 4;
  33.     HexDecMode->Invalidate();
  34. }
  35. //---------------------------------------------------------------------------
  36. void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key)
  37. {
  38.     ShowHexDecMode();
  39. }
  40. //---------------------------------------------------------------------------
  41. void __fastcall TForm1::DisplayEnter(TObject *Sender)
  42. {
  43.     ShowHexDecMode();
  44. }
  45. //---------------------------------------------------------------------------
  46.