//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
int x, xpos;
int y;
F_list = new TStringList;
y = Image1->Height / 2;
x = Image1->Width;
Image1->Canvas->MoveTo(0, y);
Image1->Canvas->LineTo(x, y);
xpos = Image1->Width / 5;
y = Image1->Height;
x = xpos;
Image1->Canvas->MoveTo(x, 0);
Image1->Canvas->LineTo(x, y);
for(int i=1; i<5; i++){
Image1->Canvas->MoveTo(x = x+xpos, 0);
Image1->Canvas->LineTo(x, y);
}
}
//---------------------------------------------------------------------------
//ファイルのオープン
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AnsiString str;
if(OpenDialog1->Execute())
{
str = OpenDialog1->FileName;
F_list->LoadFromFile(str);
ListBox1->Items->Assign(F_list);
}
}
//---------------------------------------------------------------------------
//列名データ確保
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TStrings *buff = new TStringList;
buff->CommaText = F_list->Strings[0];
ComboBox1->Items->Assign(buff);
delete buff;
}
//---------------------------------------------------------------------------
//列データ確保
void __fastcall TForm1::Button3Click(TObject *Sender)
{
TStrings *buff = new TStringList;
int i;
for(i=1; i<F_list->Count; i++){
buff->CommaText = F_list->Strings[i];
ComboBox2->Items->Add(buff->Strings[0]);
}
delete buff;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
TString *buff = new TStringList;
int i;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
ComboBox1->ItemIndex;
}
//---------------------------------------------------------------------------
最終更新:2008年05月27日 00:46