Система обміну зашифрованими текстовими повідомленнями (програма чат на С++ Builder)
81

Лістинг “UserPref.cpp

#include <vcl.h>

#pragma hdrstop

#include "UserPref.h"

#include "UnitChat.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TUserPrForm *UserPrForm;

extern String Nic;

//---------------------------------------------------------------------------

__fastcall TUserPrForm::TUserPrForm(TComponent* Owner)

        : TForm(Owner){}

//---------------------------------------------------------------------------

void __fastcall TUserPrForm::OkButtonClick(TObject *Sender)

//записує налаштування при їх коректному введенні

{

if (NicEdit->Text == ""){ShowMessage("Введите ник");  }

  else  {

    Nic = NicEdit->Text;

    UserPrForm->Close();  }}

               //---------------------------------------------------------------------------

void __fastcall TUserPrForm::FormShow(TObject *Sender)

{ NicEdit->Text = Nic;}

//---------------------------------------------------------------------------

void __fastcall TUserPrForm::CenButtonClick(TObject *Sender)

{ UserPrForm->Close();       }