안녕하세요....
우선 밑에 질문에 답변해 주신것에 대해 감사드립니다
밑에 말씀하신대로...해 보니...잘되더군요..첨엔..헬프보고 해석하는데..무지 헤매서리....
그리고..이번 질문은 무식하게 시리..API 함수 사용법을 몰라서 이렇게 질문을 드리네요..
void __fastcall TForm1::Button1Click(TObject *Sender)
{
String temp;
do {
pos = RichEdit1->Perform(EM_FINDWORDBREAK, WB_MOVEWORDRIGHT, pos);
temp += IntToStr(pos) + ", ";
}while (pos <= RichEdit1->Text.Length());
RichEdit1->Lines->Add(temp);
pos = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
FontDialog1->Font->Assign(RichEdit1->SelAttributes);
if (FontDialog1->Execute()) CurrText()->Assign(FontDialog1->Font);
RichEdit1->SetFocus();
}
//---------------------------------------------------------------------------
TTextAttributes *__fastcall TForm1::CurrText(void)
{
return RichEdit1->SelAttributes;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
RichEdit1->Lines->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
int i = EDITWORDBREAKPROC(RichEdit1->Lines, 0, RichEdit1->Text.Length(), WB_RIGHT);
RichEdit1->Perform(EM_SETWORDBREAKPROC, 0, i);
}
//---------------------------------------------------------------------------
우선 요런식으로 테스트하기 위해 코딩을 했습니다.
그런데 바로위 버튼3 이벤트의......EDITWORDBREAKPROC 에서 에러가 납니다..
Cannot convert 'int (__stdcall *)()' to 'int'.
어디서 나는 에러인지...EDITWORDBREAKPROC 리턴 값 자체가 int 형이던데...
그리고 버튼3 이벤트로 하려는게..리치에디트 워드랩이 영어..그러니깐 단어기준으로 워드랩이 되더군요..윈도의 워드패드도 마찮가지 구요..
|동해물과 백두산이 마르고 달토록 보우하사 |
|하나님이 |
| |
요런식으로요...
제가 하고자 하는건..
|동해물과 백두산이 마르고 달토록 보우하사 하 |
|나님이 |
| |
이런식으로 정렬이 되게끔 하려구요..
버튼3의 이벤트가 맞게 코딩된건지..틀렸다면 바로잡아 주셨으면 합니다..
그럼 미리 감사드리겠습니다..
|