This repository was archived by the owner on Sep 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImgConf.cpp
More file actions
105 lines (99 loc) · 3.02 KB
/
ImgConf.cpp
File metadata and controls
105 lines (99 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
#include "ImgConf.h"
#include "Principal.h"
#include "Codigo.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TfrmImgConf *frmImgConf;
//---------------------------------------------------------------------------
int Transp;
//---------------------------------------------------------------------------
__fastcall TfrmImgConf::TfrmImgConf(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::btSalvarClick(TObject *Sender)
{
SalvarDepend();
}
//---------------------------------------------------------------------------
void TfrmImgConf::CarregarDadosVar (int transp)
{
Transp = transp;
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::edtImgLegKeyDown(TObject *Sender, WORD &Key, System::WideChar &KeyChar,
TShiftState Shift)
{
if (Key == VK_RETURN) {
SalvarDepend();
}
}
//---------------------------------------------------------------------------
void TfrmImgConf::SalvarDepend ()
{
if (edtImgLeg->Text.IsEmpty()) {
frmPrincipal->lblImgLeg->Text = "";
frmPrincipal->lblImgLeg->Visible = false;
frmImgConf->Close();
}
else {
frmPrincipal->lblImgLeg->Text = edtImgLeg->Text;
frmPrincipal->lblImgLeg->Visible = true;
if (Transp == 0) {
int loc, pos = 0, tam = frmCodigo->mmCodigo->Lines->Count;
for (int i = 0; i < tam; i++) {
if (frmCodigo->mmCodigo->Lines->Strings[i] == "$CAPA") {
loc = i + 1;
i = tam;
}
}
do {
while (frmPrincipal->comentario(frmCodigo->mmCodigo->Lines->Strings[loc])){
loc++;
}
if (pos == 0) {
loc++;
pos++;
}
else if (pos == 1) {
frmCodigo->mmCodigo->Lines->Strings[loc] = edtImgLeg->Text;
pos++;
loc++;
}
else {
loc++;
}
} while (frmCodigo->mmCodigo->Lines->Strings[loc] != "!(FDT)");
}
else frmPrincipal->lblImgLeg->Text = edtImgLeg->Text;
frmImgConf->Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::FormShow(TObject *Sender)
{
edtImgLeg->GoToTextEnd();
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::btSalvarMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, float X, float Y)
{
btSalvar->Fill->Color = -12525360;
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::btSalvarMouseLeave(TObject *Sender)
{
btSalvar->Fill->Color = -16777011;
}
//---------------------------------------------------------------------------
void __fastcall TfrmImgConf::btSalvarMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, float X, float Y)
{
btSalvar->Fill->Color = -16777011;
}
//---------------------------------------------------------------------------