-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathROMBitSettingsFrm.cpp
More file actions
113 lines (99 loc) · 3.8 KB
/
ROMBitSettingsFrm.cpp
File metadata and controls
113 lines (99 loc) · 3.8 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
105
106
107
108
109
110
111
112
113
//---------------------------------------------------------------------------
#include <vcl.h>
#include <stdio.h>
#pragma hdrstop
#include "ROMBitSettingsFrm.h"
#include "ImageFrm.h"
#include "LogFrm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "histogrambox"
#pragma link "ievect"
#pragma link "ieview"
#pragma link "imageenview"
#pragma link "imageenproc"
#pragma resource "*.dfm"
TROMBitSettingsForm *ROMBitSettingsForm;
//---------------------------------------------------------------------------
__fastcall TROMBitSettingsForm::TROMBitSettingsForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::FormCreate(TObject *Sender)
{
// read .ini file to setup form (x/y position etc)
TIniFile *PicturizatronIni;
PicturizatronIni = new TIniFile( ChangeFileExt( Application->ExeName, ".ini" ) );
Top = PicturizatronIni->ReadInteger( "ROMBitSettingsForm", "Top", LogForm->Top+LogForm->Height );
Left = PicturizatronIni->ReadInteger( "ROMBitSettingsForm", "Left", 0 );
Width = PicturizatronIni->ReadInteger( "ROMBitSettingsForm", "Width", Width );
Height = PicturizatronIni->ReadInteger( "ROMBitSettingsForm", "Height", Height );
delete PicturizatronIni;
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::FormDestroy(TObject *Sender)
{
// write .ini file to save form setup (x/y position etc)
TIniFile *PicturizatronIni;
PicturizatronIni = new TIniFile( ChangeFileExt( Application->ExeName, ".ini" ) );
PicturizatronIni->WriteInteger( "ROMBitSettingsForm", "Top", Top ); // save top/left of form
PicturizatronIni->WriteInteger( "ROMBitSettingsForm", "Left", Left );
PicturizatronIni->WriteInteger( "ROMBitSettingsForm", "Width", Width ); // save width/height of form
PicturizatronIni->WriteInteger( "ROMBitSettingsForm", "Height", Height );
delete PicturizatronIni;
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::TabSheet1Resize(TObject *Sender)
{
if( TabSheet1->Width > 50 )
HistogramBox->Width = TabSheet1->Width-32;
if( TabSheet1->Height > 60 )
HistogramBox->Height = TabSheet1->Height-42;
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::BitHistRedCheckBoxClick(
TObject *Sender)
{
THistogramKind TempHistogramKind;
if( BitHistRedCheckBox->Checked )
TempHistogramKind << hkRed;
if( BitHistGreenCheckBox->Checked )
TempHistogramKind << hkGreen;
if( BitHistBlueCheckBox->Checked )
TempHistogramKind << hkBlue;
if( BitHistGrayCheckBox->Checked )
TempHistogramKind << hkGray;
HistogramBox->HistogramKind = TempHistogramKind;
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::BitsPerColEditKeyPress(
TObject *Sender, char &Key)
{
if( Key=='\r' )
{
ImageForm->FillROMBox1Click(NULL);
Key = 0;
}
}
//---------------------------------------------------------------------------
void __fastcall TROMBitSettingsForm::YBoxesToAnalyzeEditKeyPress(
TObject *Sender, char &Key)
{
if( Key=='\r' )
{
ImageForm->FillROMBox1Click(NULL);
Key = 0;
}
switch( Key )
{
case '\b':
case '0':
case '1':
break;
default:
Key = 0;
break;
}
}
//---------------------------------------------------------------------------