|
スペルチェックメッセージスペルチェックの処理概要 0.初期化 //Aspellの使用を開始する。 AspellConfig* spell_config = new_aspell_config(); aspell_config_replace(spell_config, "lang", "en_US"); //Aspellを配置しているフォルダを指定する。 aspell_config_replace(spell_config, "prefix", "C:/Program Files/Aspell/"); AspellCanHaveError* possible_err = new_aspell_speller(spell_config); AspellSpeller* spell_checker = 0; if (aspell_error_number(possible_err) != 0) puts(aspell_error_message(possible_err)); else spell_checker = to_aspell_speller(possible_err); 0a.ダイアログで、ファイル先頭からチェック、カーソル位置からチェック、キャンセルのいずれかを選択する。 //単語の候補リストを取得する。 AspellWordList* suggestions = aspell_speller_suggest(spell_checker, word, size); AspellStringEnumeration* elements = aspell_word_list_elements(suggestions); const char* word; while ( (word = aspell_string_enumeration_next(aspell_elements)) != NULL ){ //候補リストに追加する。 } delete_aspell_string_enumeration(elements); 4.候補が1個の場合は1に戻る。 Label: 元単語 TextBox: 新単語 ListBox: 単語候補 Button: 無視 Button: すべて無視 Button: 置換 Button: すべて置換 Button: 登録 Button: 中止 6.「無視」を選択した場合、1に戻る。 //新しい単語を辞書に登録する。 if(personal){ aspell_speller_add_to_personal(spell_checker, word, size); }else{ aspell_speller_add_to_session(spell_checker, word, size); } 11.「終了」を選択した場合、スペルチェックを中止する。 //オブジェクトを削除する。 delete_aspell_speller(spell_checker); 削除(possible_err); 削除(spell_config);
CAspell.cpp/.h CDllHandlerを継承した作成するapsell.dllにアクセスするクラス CDlgAspell.cpp/.h CDialogを継承したスペルチェックの動作を選択するダイアログ 設定画面 apsell.dllのパスを指定する項目 apsellのインストールパス(辞書を探すために必要) (通常はdllの場所がわかれば../を指定すればよいので、1個目のみでもよい)
|