Skip to content

Commit a6771ef

Browse files
committed
Torry Commit
Some free components from Torry's Delphi Page have been added
1 parent 9cd98d7 commit a6771ef

File tree

710 files changed

+181313
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

710 files changed

+181313
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//---------------------------------------------------------------------------
2+
#include <vcl\vcl.h>
3+
#pragma hdrstop
4+
5+
#include "About.h"
6+
#include "LinkUnit.h"
7+
//---------------------------------------------------------------------------
8+
#pragma link "RXCtrls"
9+
#pragma link "RXConst"
10+
#pragma resource "*.dfm"
11+
TAboutForm *AboutForm;
12+
//---------------------------------------------------------------------------
13+
__fastcall TAboutForm::TAboutForm(TComponent* Owner)
14+
: TForm(Owner)
15+
{
16+
}
17+
//---------------------------------------------------------------------------
18+
void __fastcall TAboutForm::FormCreate(TObject *Sender)
19+
{
20+
AppIcon->Picture->Icon = Application->Icon;
21+
AppIcon->Cursor = (TCursor)crHand;
22+
WebLabel->Cursor = (TCursor)crHand;
23+
}
24+
//---------------------------------------------------------------------------
25+
void __fastcall TAboutForm::AppIconDblClick(TObject *Sender)
26+
{
27+
SecretPanel1->Active = true;
28+
}
29+
//---------------------------------------------------------------------------
30+
void __fastcall TAboutForm::SecretPanel1DblClick(TObject *Sender)
31+
{
32+
SecretPanel1->Active = false;
33+
}
34+
//---------------------------------------------------------------------------
35+
void __fastcall TAboutForm::WebLabelClick(TObject *Sender)
36+
{
37+
RxWebSite();
38+
}
39+
//---------------------------------------------------------------------------
40+
void __fastcall TAboutForm::WebLabelActivate(TObject *Sender)
41+
{
42+
if (WebLabel->MouseInControl) {
43+
WebLabel->Font->Color = clHighlight;
44+
}
45+
else {
46+
WebLabel->Font->Color = clWindowText;
47+
}
48+
49+
}
50+
//---------------------------------------------------------------------------
Binary file not shown.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//---------------------------------------------------------------------------
2+
#ifndef AboutH
3+
#define AboutH
4+
//---------------------------------------------------------------------------
5+
#include <vcl\Classes.hpp>
6+
#include <vcl\Controls.hpp>
7+
#include <vcl\StdCtrls.hpp>
8+
#include <vcl\Forms.hpp>
9+
#include <vcl\ExtCtrls.hpp>
10+
#include <vcl\Buttons.hpp>
11+
#include <vcl\ShellApi.hpp>
12+
#include "RXCtrls.hpp"
13+
#include "RXConst.hpp"
14+
//---------------------------------------------------------------------------
15+
class TAboutForm : public TForm
16+
{
17+
__published:// IDE-managed Components
18+
TSecretPanel *SecretPanel1;
19+
TImage *AppIcon;
20+
TRxLabel *WebLabel;
21+
TLabel *Label1;
22+
TLabel *Label2;
23+
TLabel *Label3;
24+
TBitBtn *OkBtn;
25+
void __fastcall FormCreate(TObject *Sender);
26+
void __fastcall AppIconDblClick(TObject *Sender);
27+
void __fastcall SecretPanel1DblClick(TObject *Sender);
28+
void __fastcall WebLabelClick(TObject *Sender);
29+
void __fastcall WebLabelActivate(TObject *Sender);
30+
private:// User declarations
31+
public:// User declarations
32+
__fastcall TAboutForm(TComponent* Owner);
33+
};
34+
//---------------------------------------------------------------------------
35+
extern TAboutForm *AboutForm;
36+
//---------------------------------------------------------------------------
37+
#endif
Binary file not shown.
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
//---------------------------------------------------------------------------
2+
#include <vcl\vcl.h>
3+
#pragma hdrstop
4+
5+
#include "DBAware.h"
6+
//---------------------------------------------------------------------------
7+
#pragma link "Placemnt"
8+
#pragma link "PicClip"
9+
#pragma link "RxQuery"
10+
#pragma link "DBFilter"
11+
#pragma link "DBQBE"
12+
#pragma link "RXDBCtrl"
13+
#pragma link "Grids"
14+
#pragma link "RXLookup"
15+
#pragma link "DBIndex"
16+
#pragma link "DBUtils"
17+
#pragma link "BdeUtils"
18+
#pragma link "RXCtrls"
19+
#pragma resource "*.dfm"
20+
TDBAwareForm *DBAwareForm;
21+
//---------------------------------------------------------------------------
22+
__fastcall TDBAwareForm::TDBAwareForm(TComponent* Owner)
23+
: TForm(Owner)
24+
{
25+
}
26+
//---------------------------------------------------------------------------
27+
void __fastcall TDBAwareForm::SetMacro(const AnsiString MacroName,
28+
const AnsiString AValue)
29+
{
30+
rxQuery1->MacroByName(MacroName)->AsString = AValue;
31+
rxQuery1->DisableControls();
32+
try {
33+
rxQuery1->Close();
34+
rxQuery1->Open();
35+
}
36+
catch(...) {
37+
rxQuery1->EnableControls();
38+
throw;
39+
}
40+
rxQuery1->EnableControls();
41+
}
42+
//---------------------------------------------------------------------------
43+
void __fastcall TDBAwareForm::FormCreate(TObject *Sender)
44+
{
45+
ComboBox2->ItemIndex = 1;
46+
}
47+
//---------------------------------------------------------------------------
48+
void __fastcall TDBAwareForm::FormClose(TObject *Sender, TCloseAction &Action)
49+
{
50+
Action = caFree;
51+
}
52+
//---------------------------------------------------------------------------
53+
void __fastcall TDBAwareForm::CheckBox1Click(TObject *Sender)
54+
{
55+
rxDBGrid1->ShowGlyphs = CheckBox1->Checked;
56+
}
57+
//---------------------------------------------------------------------------
58+
void __fastcall TDBAwareForm::rxDBLookupCombo1Change(TObject *Sender)
59+
{
60+
Edit1->Text = rxDBLookupCombo1->Value;
61+
}
62+
//---------------------------------------------------------------------------
63+
void __fastcall TDBAwareForm::EnterQueryClick(TObject *Sender)
64+
{
65+
DBFilter1->SetCapture();
66+
}
67+
//---------------------------------------------------------------------------
68+
void __fastcall TDBAwareForm::ExecQueryClick(TObject *Sender)
69+
{
70+
DBFilter1->ReadCaptureControls();
71+
DBFilter1->ReleaseCapture();
72+
DBFilter1->Activate();
73+
}
74+
//---------------------------------------------------------------------------
75+
void __fastcall TDBAwareForm::CancelQueryClick(TObject *Sender)
76+
{
77+
DBFilter1->ReleaseCapture();
78+
DBFilter1->Deactivate();
79+
}
80+
//---------------------------------------------------------------------------
81+
void __fastcall TDBAwareForm::RadioGroup1Click(TObject *Sender)
82+
{
83+
DBFilter1->LogicCond = (TFilterLogicCond)RadioGroup1->ItemIndex;
84+
}
85+
//---------------------------------------------------------------------------
86+
void __fastcall TDBAwareForm::DBFilter1Change(TObject *Sender)
87+
{
88+
ExecQuery->Enabled = DBFilter1->Captured;
89+
CancelQuery->Enabled = (DBFilter1->Active || DBFilter1->Captured);
90+
EnterQuery->Enabled = true;
91+
}
92+
//---------------------------------------------------------------------------
93+
void __fastcall TDBAwareForm::ComboBox2Change(TObject *Sender)
94+
{
95+
AnsiString order;
96+
97+
switch (ComboBox2->ItemIndex) {
98+
case 0: {
99+
order = "ORDERS.\"SaleDate\"";
100+
break;
101+
}
102+
case 1: {
103+
order = "ORDERS.\"ShipDate\"";
104+
break;
105+
}
106+
case 2: {
107+
order = "ORDERS.\"CustNo\"";
108+
break;
109+
}
110+
case 3: {
111+
order = "ORDERS.\"EmpNo\"";
112+
break;
113+
}
114+
default: return;
115+
}
116+
SetMacro("ORDER", order);
117+
}
118+
//---------------------------------------------------------------------------
119+
void __fastcall TDBAwareForm::rxDBLookupCombo2Change(TObject *Sender)
120+
{
121+
AnsiString s;
122+
123+
s = "0=0";
124+
if (rxDBLookupCombo2->Value != "") {
125+
s = "ORDERS.\"CustNo\"=" + rxDBLookupCombo2->Value;
126+
}
127+
SetMacro("CUSTOMER", s);
128+
}
129+
//---------------------------------------------------------------------------
130+
void __fastcall TDBAwareForm::rxDBLookupCombo1GetImage(TObject *Sender,
131+
bool IsEmpty, TGraphic *&Graphic, int &TextMargin)
132+
{
133+
AnsiString PhoneExt;
134+
135+
TextMargin = PicClip->Width + 2;
136+
if (!IsEmpty) {
137+
PhoneExt = QBEQuery1->FieldByName("PhoneExt")->AsString;
138+
Graphic = PicClip->GraphicCell[3];
139+
if (PhoneExt == "") {
140+
Graphic = PicClip->GraphicCell[4];
141+
}
142+
}
143+
else {
144+
Graphic = PicClip->GraphicCell[5];
145+
}
146+
}
147+
//---------------------------------------------------------------------------
148+
void __fastcall TDBAwareForm::DBGrid1CheckButton(TObject *Sender, long ACol,
149+
TField *Field, bool &Enabled)
150+
{
151+
Enabled = (Field != NULL) && (dynamic_cast<TBlobField*>(Field) == 0);
152+
}
153+
//---------------------------------------------------------------------------
154+
void __fastcall TDBAwareForm::DBGrid1TitleBtnClick(TObject *Sender, long ACol,
155+
TField *Field)
156+
{
157+
if (Field != NULL) {
158+
SetMacro("ORDER", Field->FieldName);
159+
ComboBox2->ItemIndex = -1;
160+
}
161+
}
162+
//---------------------------------------------------------------------------
163+
void __fastcall TDBAwareForm::CheckBox2Click(TObject *Sender)
164+
{
165+
rxDBGrid1->MultiSelect = CheckBox2->Checked;
166+
}
167+
//---------------------------------------------------------------------------
168+
void __fastcall TDBAwareForm::rxDBGrid1GetCellParams(TObject *Sender,
169+
TField *Field, TFont *AFont, TColor &Background, bool Highlight)
170+
{
171+
if (Field->FieldName == "Category") {
172+
AFont->Style = AFont->Style << fsBold;
173+
}
174+
else if (Field->FieldName == "Length (cm)") {
175+
Background = clYellow;
176+
};
177+
int Len = ((TRxDBGrid *)Sender)->DataSource->DataSet->FieldByName("Length (cm)")->AsInteger;
178+
if ((Len <= 30) && (Len > 0)) {
179+
Background = clLime; // shortest
180+
}
181+
else if (Len >= 150) {
182+
AFont->Color = clRed; // longest
183+
};
184+
if (Highlight) {
185+
AFont->Color = clHighlightText;
186+
Background = clHighlight;
187+
}
188+
}
189+
//---------------------------------------------------------------------------
190+
191+
Binary file not shown.

0 commit comments

Comments
 (0)