All pastes #334443 Raw Edit

Something

public text v1 · immutable
#334443 ·published 2007-01-31 16:46 UTC
rendered paste body
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Ukol.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfrmUkol *frmUkol;
//---------------------------------------------------------------------------
__fastcall TfrmUkol::TfrmUkol(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmUkol::FormCreate(TObject *Sender)
{
  this->Caption = "Domc kol . 2";
  this->BorderStyle = bsSingle;
  this->BorderIcons = this->BorderIcons >> biMinimize >> biMaximize;
  this->KeyPreview = true;
  this->Position = poScreenCenter;
  this->Color = (TColor) 0xE8E8E8;
  lblZnak->Caption = "Znak zadan z klvesnice :";
  lblKey->Caption = "Key hodnota zadanho znaku :";
  lblDodatek->Caption = "(je to pmo ASCII kd znaku)";
  lblHex->Caption = "Key hodnota hexadecimln :";
  edtZnak->Text = "";
  edtKey->Text = "";
  edtHex->Text = "";
}
//---------------------------------------------------------------------------
void __fastcall TfrmUkol::FormKeyPress(TObject *Sender, char &Key)
{
  unsigned char znak = Key;
  edtZnak->Text = "";
  edtKey->Text = IntToStr(znak);
  edtHex->Text = IntToHex(znak,2);
  switch (znak)
  {
    case 114 : this->Color = clRed; break;
    case 82 : this->Color = clRed; break;
    case 103 : this->Color = clGreen; break;
    case 71 : this->Color = clGreen; break;
    case 98 : this->Color = clBlue; break;
    case 66 : this->Color = clBlue; break;
    default : this->Color = (TColor) 0xE8E8E8; break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TfrmUkol::edtKeyEnter(TObject *Sender)
{
  edtZnak->SetFocus();
  edtZnak->SelStart = 1;
}
//---------------------------------------------------------------------------
void __fastcall TfrmUkol::edtHexEnter(TObject *Sender)
{
  edtZnak->SetFocus();
  edtZnak->SelStart = 1;
}
//---------------------------------------------------------------------------