|
| 1 | +//$$---- Form CPP ---- |
| 2 | +//--------------------------------------------------------------------------- |
| 3 | +#include <vcl.h> |
| 4 | +#pragma hdrstop |
| 5 | +#include "AboutForm.h" |
| 6 | +#include "DataFile.hpp" |
| 7 | +#include "ThemidaSDK.h" |
| 8 | +//--------------------------------------------------------------------------- |
| 9 | +#pragma package(smart_init) |
| 10 | +#pragma link "RzLabel" |
| 11 | +#pragma link "RzPanel" |
| 12 | +#pragma link "RzButton" |
| 13 | +#pragma link "RzTabs" |
| 14 | +#pragma link "RzEdit" |
| 15 | +#pragma resource "*.dfm" |
| 16 | +TAboutFormClass *AboutFormClass; |
| 17 | +//--------------------------------------------------------------------------- |
| 18 | +__fastcall TAboutFormClass::TAboutFormClass(TComponent* Owner) : TForm(Owner) |
| 19 | +{ |
| 20 | +} |
| 21 | +//--------------------------------------------------------------------------- |
| 22 | +void __fastcall TAboutFormClass::UniWebLabelClick(TObject *Sender) |
| 23 | +{ |
| 24 | + ShellExecute(Handle, "open", "http://www.incorex.com", 0, 0, SW_SHOW); |
| 25 | +} |
| 26 | +//--------------------------------------------------------------------------- |
| 27 | +void __fastcall TAboutFormClass::CloseLabelClick(TObject *Sender) |
| 28 | +{ |
| 29 | + Close(); |
| 30 | +} |
| 31 | +//--------------------------------------------------------------------------- |
| 32 | +void __fastcall TAboutFormClass::TopPanelMouseDown(TObject *Sender, |
| 33 | + TMouseButton Button, TShiftState Shift, int X, int Y) |
| 34 | +{ |
| 35 | + bottonPressed = true; |
| 36 | + prevX = X; |
| 37 | + prevY = Y; |
| 38 | +} |
| 39 | +//--------------------------------------------------------------------------- |
| 40 | +void __fastcall TAboutFormClass::TopPanelMouseMove(TObject *Sender, |
| 41 | + TShiftState Shift, int X, int Y) |
| 42 | +{ |
| 43 | + if (bottonPressed) { |
| 44 | + Left += X - prevX; |
| 45 | + Top += Y - prevY; |
| 46 | + } |
| 47 | +} |
| 48 | +//--------------------------------------------------------------------------- |
| 49 | +void __fastcall TAboutFormClass::TopPanelMouseUp(TObject *Sender, |
| 50 | + TMouseButton Button, TShiftState Shift, int X, int Y) |
| 51 | +{ |
| 52 | + bottonPressed = false; |
| 53 | +} |
| 54 | +//--------------------------------------------------------------------------- |
| 55 | +void __fastcall TAboutFormClass::AboutImageClick(TObject *Sender) |
| 56 | +{ |
| 57 | + InfoPanel->Visible = True; |
| 58 | + LicPanel->Visible = False; |
| 59 | +} |
| 60 | +//--------------------------------------------------------------------------- |
| 61 | +void __fastcall TAboutFormClass::LicImageClick(TObject *Sender) |
| 62 | +{ |
| 63 | + InfoPanel->Visible = False; |
| 64 | + LicPanel->Visible = True; |
| 65 | + LicenseMemo->SetFocus(); |
| 66 | +} |
| 67 | +//--------------------------------------------------------------------------- |
| 68 | +void __fastcall TAboutFormClass::SetLinkCursor(TControl *Control) |
| 69 | +{ |
| 70 | + Control->Cursor = (TCursor) 1; |
| 71 | +} |
| 72 | +//--------------------------------------------------------------------------- |
| 73 | +void TAboutFormClass::ChangeGUIStyle() |
| 74 | +{ |
| 75 | + PFont->Style = TFontStyles() << fsUnderline; |
| 76 | +} |
| 77 | +//--------------------------------------------------------------------------- |
| 78 | +void __fastcall TAboutFormClass::AboutLabelMouseEnter(TObject *Sender) |
| 79 | +{ |
| 80 | + PFont = AboutLabel->Font; |
| 81 | + ChangeGUIStyle(); |
| 82 | +} |
| 83 | +//--------------------------------------------------------------------------- |
| 84 | +void __fastcall TAboutFormClass::LicLabelMouseEnter(TObject *Sender) |
| 85 | +{ |
| 86 | + PFont = LicLabel->Font; |
| 87 | + ChangeGUIStyle(); |
| 88 | +} |
| 89 | +//--------------------------------------------------------------------------- |
| 90 | +void __fastcall TAboutFormClass::AboutImageMouseLeave(TObject *Sender) |
| 91 | +{ |
| 92 | + if (PFont != AboutLabel->Font) |
| 93 | + PFont->Style = AboutLabel->Font->Style; |
| 94 | + else |
| 95 | + PFont->Style = LicLabel->Font->Style; |
| 96 | +} |
| 97 | +//--------------------------------------------------------------------------- |
| 98 | +void __fastcall TAboutFormClass::CloseLabelMouseEnter(TObject *Sender) |
| 99 | +{ |
| 100 | + PFont = CloseLabel->Font; |
| 101 | + ChangeGUIStyle(); |
| 102 | +} |
| 103 | +//--------------------------------------------------------------------------- |
| 104 | +void __fastcall TAboutFormClass::LicenseMemoClick(TObject *Sender) |
| 105 | +{ |
| 106 | + HideCaret(LicenseMemo->Handle); |
| 107 | +} |
| 108 | +//--------------------------------------------------------------------------- |
| 109 | +void __fastcall TAboutFormClass::FormShow(TObject *Sender) |
| 110 | +{ |
| 111 | + VM_START |
| 112 | + TDataFile *lData = new TDataFile("Tilchi.ldf"); |
| 113 | + NameLabel->Caption = lData->ReadString("TilchiLic", "US_NAME", ""); |
| 114 | + LastNameLabel->Caption = lData->ReadString("TilchiLic", "US_LAST_NAME", ""); |
| 115 | + OrgLabel->Caption = lData->ReadString("TilchiLic", "US_ORG", ""); |
| 116 | + SerialLabel->Caption = lData->ReadString("TilchiLic", "US_SERIAL", ""); |
| 117 | + KeyLabel->Caption = lData->ReadString("TilchiLic", "US_KEY", ""); |
| 118 | + delete lData; |
| 119 | + VM_END |
| 120 | + |
| 121 | + SetLinkCursor(AboutImage); |
| 122 | + SetLinkCursor(LicImage); |
| 123 | + SetLinkCursor(AboutLabel); |
| 124 | + SetLinkCursor(LicLabel); |
| 125 | + SetLinkCursor(CloseImage); |
| 126 | + SetLinkCursor(CloseLabel); |
| 127 | + SetLinkCursor(UniWebLabel); |
| 128 | +} |
| 129 | +//--------------------------------------------------------------------------- |
| 130 | + |
0 commit comments