C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[72541] 콤보박스에 나온 항목들 선택이 안되네요
쿼드콥터헬기 [tatani] 3634 읽음    2015-04-17 16:01
마우스로 항목(Model)을 선택을 하면 .csv파일에 있는 선택한 Model의 세부내용만 StringGrid에 나오게끔 하고 싶은데, 
현재 csv파일에 있는 항목은 읽어와서 StringGrid에 뿌려주긴합니다.
단, 어떤 Model을 선택하여도 전체 파일만 선택이되는게 문제입니다.


void __fastcall TForm1::FormActivate(TObject *Sender)
{
        int i;

        ReadOptiondata();

        comboxModelSel->Items->Clear();

        for(i=0; i<TotalOptionCount; i++)   //반복write저장
        {
                comboxModelSel->Items->Add(OptionData[i+1][1]);
        }


}
void __fastcall TForm1::ComboBoxSelect(TObject *Sender)
{
        if( InputSelectFlag1 == 0) //마우스 입력
        {
                ComboboxSelflag = 1;
                SelectModel();
        }
        else
                ShowMessage(" 파일이 없습니다");

}
.
.
.
.
.
void __fastcall TForm1::SelectModel(void)
{
FILE    *logfile;
int     i, textpoint, k, conbuf, j, err;
char    textbuf[200];

        // SPEC DATA READ
        if( ( logfile = fopen( "D:\\test1\\Option.csv", "rt")) != NULL)
        {

         i=0;
                while(!feof(logfile))
                {
                        fgets( pszBuffer1, 10000, logfile);

                        for( k=0,textpoint=0; pszBuffer1[ textpoint]!='\n'; )
                        {
                                for(j=0; pszBuffer1[textpoint]!=',' && pszBuffer1[textpoint]!='\n' ; j++)
                                {
                                        textbuf[ j] = pszBuffer1[textpoint++];
                                }
                                textbuf[ j] = '\0';
                                strcpy(  ConditionData[ i][k], textbuf);
                                if( strlen( ConditionData[ i][k] ) == 0 && k == 0)
                                {
                                        i--;
                                        break;
                                }
                                strcpy(  TestSpec[ i][k++], textbuf);
                                if( pszBuffer1[ textpoint]=='\n')
                                        break;
                                textpoint++;
                                conbuf = k+1;
                        }
                        i++;
                }

             FullTestStepCount = i;
             TotalColCount = k;

             fclose(logfile);
        }
        else
        {
                err = 1;
                ShowMessage( AnsiString( strr )+" 화일이 없습니다");
        }

        if( FullTestActive == 1)
                GridDisplay( FullTestStepCount+1 );      
        else
                GridDisplay( step+10);

}
//----------------------------------------------------------------------------
void __fastcall TForm1::GridDisplay(int RowCount)
{
        int i,j;
        // GRID DISPLAY

        for( i=0; i<RowCount; i++)
        {
                for( j=0; j<TotalColCount; j++)
                       StringGrid1->Cells[ j][ i] = TestSpec[i][j];

        }
}

+ -

관련 글 리스트
72541 콤보박스에 나온 항목들 선택이 안되네요 쿼드콥터헬기 3634 2015/04/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.