Action = BeLogInOutEAction
Style = tbsCheck
end
+ object ToolButton8: TToolButton
+ Left = 285
+ Top = 0
+ Width = 8
+ Caption = 'ToolButton8'
+ ImageIndex = 11
+ Style = tbsSeparator
+ end
+ object ToolButton9: TToolButton
+ Left = 293
+ Top = 0
+ Action = ShowInputAssistForm
+ end
end
object MainMenu: TMainMenu
Left = 8
Left = 72
Top = 124
Bitmap = {
- 494C01010B000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+ 494C01010C000E00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000004000000001002000000000000040
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 00000000000000000000000000000000F81FFFFFFFFF0000E007FDFFF81F0000
- C003F17FF00F00008001E05FE00700008001C017C00300000000800580010000
- 0000000180010000000000018001000000008001800100000000E00180010000
- 0000F803800100008001FE07C00300008001FF8FE0070000C003FFFFF00F0000
- E007FFFFF81F0000F81FFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFE00FFFFFFFF
+ 00000000000000000000000000000000F81FFFFFFFFFFFFFE007FDFFF81FF3F9
+ C003F17FF00FF9F38001E05FE007F9F38001C017C003F80300008005800184E7
+ 000000018001CCE7000000018001CE4F000080018001CE4F0000E0018001CE4F
+ 0000F8038001CF1F8001FE07C0038F1F8001FF8FE007FFFFC003FFFFF00F8FFF
+ E007FFFFF81F8FFFF81FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFFFFFF
FE00C000F000F000FE008000F000F000FE008000F000F0008000800000000000
8000800070000000800080017000000080008001700000008001800170000000
8003800170000000800780017FDF001F807F8001001F001F80FFC003001F001F
FFF3000FFFFFF0CFFF010007FFFFF08700000003FFFFF08700010003FFF7F887
0003003FC1F7FE8F0003003FC3FBFE3F00038FFFC7FBFF7F0003FC00CBFBFE3F
0003C400DCF7FEBF0003CC00FF0FFC9F0003D400FFFFFDDF0003F800FFFFFDDF
- FFFFFC00FFFFFDDFFFFFFC00FFFFFFFF00000000000000000000000000000000
- 000000000000}
+ FFFFFC00FFFFFDDFFFFFFC00FFFFFFFF}
end
object HotToobarImageList: TImageList
Left = 104
Top = 124
Bitmap = {
- 494C01010B000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+ 494C01010C000E00040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000004000000001002000000000000040
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
- 00000000000000000000000000000000F81FFFFFFFFF0000E007FDFFF81F0000
- C003F17FF00F00008001E05FE00700008001C017C00300000000000580010000
- 0000000180010000000000018001000000008001800100000000E00180010000
- 0000F803800100008001FE07C00300008001FF8FE0070000C003FFFFF00F0000
- E007FFFFF81F0000F81FFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFE00FFFFFFFF
+ 00000000000000000000000000000000F81FFFFFFFFFFFFFE007FDFFF81FF3F9
+ C003F17FF00FF9F38001E05FE007F9F38001C017C003F80300000005800184E7
+ 000000018001CCE7000000018001CE4F000080018001CE4F0000E0018001CE4F
+ 0000F8038001CF1F8001FE07C0038F1F8001FF8FE007FFFFC003FFFFF00F8FFF
+ E007FFFFF81F8FFFF81FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE00FFFFFFFF
FE00C000F000F000FE008000F000F000FE008000F000F0008000800000000000
8000800070000000800080017000000080008001700000008001800170000000
8003800170000000800780017FDF001F807F8001001F001F80FFC003001F001F
FFF3000FFFFFF0CFFF010007FFFFF08700000003FFFFF08700010003FFE7F887
0003003FC1F3FE8F0003003FC3FBFE3F00038FFFC7FBFF7F0003FC00CBFBFE3F
0003C400DCF3FEBF0003CC00FF07FC9F0003D400FFFFFDDF0003F800FFFFFDDF
- FFFFFC00FFFFFDDFFFFFFC00FFFFFFFF00000000000000000000000000000000
- 000000000000}
+ FFFFFC00FFFFFDDFFFFFFC00FFFFFFFF}
end
object Indy: TIdHTTP
Intercept = IdLogDebug
Caption = #20837#21147#12450#12471#12473#12488
OnExecute = InputAssistActionExecute
end
+ object ShowInputAssistForm: TAction
+ Category = #32232#38598
+ Caption = #20837#21147#12450#12471#12473#12488#12501#12457#12540#12512#21628#12403#20986#12375
+ Hint = #20837#21147#12450#12471#12473#12488#12501#12457#12540#12512#12434#21628#12403#20986#12377
+ ImageIndex = 11
+ OnExecute = ShowInputAssistFormExecute
+ end
end
object IdLogDebug: TIdLogDebug
OnReceive = IdLogDebugReceive
InputAssistPopupMenu: TPopupMenu;
BodyEdit: TMemo;
ApplicationEvents1: TApplicationEvents;
+ ToolButton8: TToolButton;
+ ToolButton9: TToolButton;
+ ShowInputAssistForm: TAction;
procedure EditorPageChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure InputAssistActionExecute(Sender: TObject);
procedure ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
+ procedure ShowInputAssistFormExecute(Sender: TObject);
private
FThreadItem: TThreadItem;
FBoard: TBoard;
procedure GetCookie(Rawtext: String; ABoard: TBoard);
//! \93ü\97Í\83A\83V\83X\83g\82Ì\83|\83b\83v\83A\83b\83v\83\81\83j\83\85\81[\82Ì\83N\83\8a\83b\83N\83C\83x\83\93\83g
procedure InputAssistMenuClick(Sender: TObject);
+ //! TMemo\82Ì\83J\81[\83\\83\8b\88Ê\92u\82É\95¶\8e\9a\97ñ\91}\93ü
+ procedure InsertText(Memo: TMemo; Text: String);
protected
procedure CreateParams(var Params: TCreateParams); override;
public
- FBBSID: String;
+ FBBSID: String;
procedure SetFont;
procedure SetThreadItem(Item: TThreadItem);
procedure SetBoard(Item: TBoard);
- property BBSID: string read FBBSID write FBBSID;
+ property BBSID: string read FBBSID write FBBSID;
end;
implementation
uses
Giko, ItemDownload, MojuUtils, IdGlobal, GikoMessage, Imm,
- InputAssistDataModule;
+ InputAssistDataModule, InputAssist;
const
CAPTION_NAME_NEW: string = '\83M\83R\83i\83r \83X\83\8c\97§\82Ä\83G\83f\83B\83^';
CAPTION_NAME_RES: string = '\83M\83R\83i\83r \83\8c\83X\83G\83f\83B\83^';
procedure TEditorForm.InputAssistMenuClick(Sender: TObject);
var
- line, pos, sel : Integer;
- text, left, right : String;
+ text : String;
IMC: HIMC;
begin
if not (Sender is TMenuItem) then Exit;
FResistWords.Clear;
FInputAssistKey := '';
end;
- BodyEdit.Lines.BeginUpdate;
- line := SendMessage(BodyEdit.Handle,EM_LINEFROMCHAR,-1,0); //\8ds
- sel := BodyEdit.SelStart;
- pos := sel - SendMessage(BodyEdit.Handle, EM_LINEINDEX, -1, 0); //\8c\85
+ InsertText(BodyEdit, text);
+end;
+
+//! TMemo\82Ì\83J\81[\83\\83\8b\88Ê\92u\82É\95¶\8e\9a\97ñ\91}\93ü
+procedure TEditorForm.InsertText(Memo: TMemo; Text: String);
+var
+ line, sel, pos: Integer;
+ left, right : String;
+begin
+ Memo.Lines.BeginUpdate;
+ line := SendMessage(Memo.Handle,EM_LINEFROMCHAR,-1,0); //\8ds
+ sel := Memo.SelStart;
+ pos := sel - SendMessage(Memo.Handle, EM_LINEINDEX, -1, 0); //\8c\85
if (pos > 0) then begin
- left := Copy(BodyEdit.Lines[line], 0, pos);
+ left := Copy(Memo.Lines[line], 0, pos);
end else begin
left := '';
end;
- right := Copy(BodyEdit.Lines[line], pos + 1, Length(BodyEdit.Lines[line]));
- BodyEdit.Lines.Strings[line] := left + text + right;
- BodyEdit.Lines.EndUpdate;
+ right := Copy(Memo.Lines[line], pos + 1, Length(Memo.Lines[line]));
+ Memo.Lines.Strings[line] := left + Text + right;
+ Memo.Lines.EndUpdate;
//\81@\83L\83\83\83\8c\83b\83g\82Ì\88Ê\92u\82ð\8dX\90V\82·\82é
- BodyEdit.SelStart := sel + Length(text);
+ Memo.SelStart := sel + Length(text);
// \83L\83\83\83\8c\83b\83g\82Ì\88Ê\92u\82Ü\82Å\83X\83N\83\8d\81[\83\8b
- BodyEdit.Perform(EM_SCROLLCARET, 0, 0);
+ Memo.Perform(EM_SCROLLCARET, 0, 0);
+
end;
procedure TEditorForm.ApplicationEvents1Message(var Msg: tagMSG;
end;
end;
+procedure TEditorForm.ShowInputAssistFormExecute(Sender: TObject);
+var
+ form : TInputAssistForm;
+begin
+ form := TInputAssistForm.Create(nil);
+ try
+ if TopAction.Checked then begin // \83X\83e\83C\8fó\91Ô\82É\90Ý\92è
+ SetWindowPos(form.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE);
+ end;
+ form.SetUpFromEditor;
+ if (form.ShowModal = mrOk) then begin
+ InsertText(BodyEdit, form.GetInsertText);
+ end;
+ finally
+ form.Release;
+ end;
+end;
+
end.
begin
form := TInputAssistForm.Create(GikoForm);
try
+ form.SetUpFromMain;
form.ShowModal;
finally
form.Release;
object InputAssistForm: TInputAssistForm
- Left = 386
- Top = 153
- Width = 400
- Height = 450
+ Left = 589
+ Top = 279
+ Width = 397
+ Height = 460
Caption = #20837#21147#12450#12471#12473#12488#35373#23450
Color = clBtnFace
Font.Charset = SHIFTJIS_CHARSET
object Panel1: TPanel
Left = 0
Top = 0
- Width = 392
- Height = 177
+ Width = 389
+ Height = 200
Align = alTop
BevelOuter = bvLowered
Caption = 'Panel1'
TabOrder = 0
object Panel5: TPanel
- Left = 298
- Top = 1
+ Left = 295
+ Top = 33
Width = 93
- Height = 175
+ Height = 166
Align = alRight
TabOrder = 0
object CloseButton: TButton
end
object Panel6: TPanel
Left = 1
- Top = 1
- Width = 297
- Height = 175
+ Top = 33
+ Width = 294
+ Height = 166
Align = alClient
BevelOuter = bvNone
Caption = 'Panel6'
object GikoListView1: TGikoListView
Left = 0
Top = 0
- Width = 297
- Height = 175
+ Width = 294
+ Height = 166
Align = alClient
Columns = <>
ReadOnly = True
OnSelectItem = GikoListView1SelectItem
end
end
+ object Panel7: TPanel
+ Left = 1
+ Top = 1
+ Width = 387
+ Height = 32
+ Align = alTop
+ Caption = 'Panel7'
+ TabOrder = 2
+ object CategoryComboLabel: TLabel
+ Left = 12
+ Top = 10
+ Width = 77
+ Height = 12
+ Caption = #12459#12486#12468#12522#21517#36984#25246
+ end
+ object CategoryComboBox: TComboBox
+ Left = 105
+ Top = 6
+ Width = 176
+ Height = 20
+ ItemHeight = 12
+ TabOrder = 0
+ Text = 'CategoryComboBox'
+ OnChange = CategoryComboBoxChange
+ OnKeyPress = CategoryComboBoxKeyPress
+ end
+ object InsertButton: TButton
+ Left = 297
+ Top = 4
+ Width = 75
+ Height = 25
+ Action = InsertButtonAction
+ TabOrder = 1
+ end
+ end
end
object Panel2: TPanel
Left = 0
- Top = 177
- Width = 392
- Height = 246
+ Top = 200
+ Width = 389
+ Height = 233
Align = alClient
BevelOuter = bvNone
Caption = 'Panel2'
object Panel3: TPanel
Left = 0
Top = 0
- Width = 392
+ Width = 389
Height = 48
Align = alTop
BevelOuter = bvNone
object Panel4: TPanel
Left = 0
Top = 48
- Width = 392
- Height = 198
+ Width = 389
+ Height = 185
Align = alClient
BevelOuter = bvNone
TabOrder = 1
object GroupBox1: TGroupBox
Left = 0
Top = 0
- Width = 392
- Height = 198
+ Width = 389
+ Height = 185
Align = alClient
Caption = #25407#20837#25991#23383#21015
TabOrder = 0
object TextMemo: TMemo
Left = 2
Top = 14
- Width = 388
- Height = 182
+ Width = 385
+ Height = 169
Hint = #25407#20837#12377#12427#25991#23383#21015
Align = alClient
ScrollBars = ssBoth
ImageIndex = 5
ShortCut = 46
end
+ object InsertButtonAction: TAction
+ Category = #32232#38598
+ Caption = #25407#20837
+ OnExecute = InsertButtonActionExecute
+ OnUpdate = InsertButtonActionUpdate
+ end
+ object CloseAction: TAction
+ Category = #32232#38598
+ Caption = 'CloseAction'
+ OnExecute = CloseActionExecute
+ end
end
end
Panel3: TPanel;
KeyNameEdit: TLabeledEdit;
CategoryNameEdit: TLabeledEdit;
- Panel4: TPanel;
+ Panel4: TPanel;
TextMemo: TMemo;
ColumnImageList: TImageList;
InputAssistFormActionList: TActionList;
DeleteButton: TButton;
AddButton: TButton;
Panel6: TPanel;
+ Panel7: TPanel;
+ CategoryComboBox: TComboBox;
+ CategoryComboLabel: TLabel;
+ InsertButton: TButton;
+ InsertButtonAction: TAction;
+ CloseAction: TAction;
procedure FormCreate(Sender: TObject);
procedure GikoListView1SelectItem(Sender: TObject; Item: TListItem;
Selected: Boolean);
procedure GikoListView1ColumnClick(Sender: TObject;
Column: TListColumn);
procedure CloseButtonClick(Sender: TObject);
+ procedure CategoryComboBoxKeyPress(Sender: TObject; var Key: Char);
+ procedure CategoryComboBoxChange(Sender: TObject);
+ procedure InsertButtonActionUpdate(Sender: TObject);
+ procedure InsertButtonActionExecute(Sender: TObject);
+ procedure CloseActionExecute(Sender: TObject);
private
{ Private \90é\8c¾ }
FSortColumn : Integer;
+ FInsertText : String;
procedure AddListViewItem(ResWord : TResistWord);
public
- { Public \90é\8c¾ }
+ { Public \90é\8c¾ }
+ procedure SetUpFromEditor();
+ procedure SetUpFromMain();
+ function GetInsertText(): String;
end;
var
begin
Close();
end;
+//! \83J\83e\83S\83\8a\8di\8d\9e\82Ý\83R\83\93\83{\83{\83b\83N\83X\82ð\93Ç\8eæ\90ê\97p\82É\82·\82é\82½\82ß\82Ì\83C\83x\83\93\83g\8f\88\97\9d
+procedure TInputAssistForm.CategoryComboBoxKeyPress(Sender: TObject;
+ var Key: Char);
+begin
+ Key := #0;
+end;
+//! \83J\83e\83S\83\8a\8di\8d\9e\82Ý\83R\83\93\83{\83{\83b\83N\83X\82Å\82Ì\83J\83e\83S\83\8a\95Ï\8dX\8f\88\97\9d
+procedure TInputAssistForm.CategoryComboBoxChange(Sender: TObject);
+var
+ i : Integer;
+ key : String;
+begin
+ LockWindowUpdate(GikoListView1.Handle);
+ GikoListView1.Clear;
+ if (CategoryComboBox.ItemIndex <= 0) then begin
+ for i := 0 to InputAssistDM.ResistWordCount - 1 do begin
+ AddListViewItem(InputAssistDM.GetResistWord(i));
+ end;
+ end else begin
+ key := CategoryComboBox.Items[CategoryComboBox.ItemIndex];
+ for i := 0 to InputAssistDM.ResistWordCount - 1 do begin
+ if (key = InputAssistDM.GetResistWord(i).GetCategory) then begin
+ AddListViewItem(InputAssistDM.GetResistWord(i));
+ end;
+ end;
+ end;
+ LockWindowUpdate(0);
+end;
+
+procedure TInputAssistForm.SetUpFromMain();
+begin
+ Self.Caption := '\93ü\97Í\83A\83V\83X\83g\90Ý\92è';
+ Panel3.Visible := True;
+ Panel5.Visible := True;
+ Panel7.Visible := False;
+ TextMemo.ReadOnly := False;
+ FInsertText := '';
+ CloseAction.ShortCut := TShortCut(0);
+end;
+procedure TInputAssistForm.SetUpFromEditor();
+var
+ cat : TStringList;
+begin
+ Self.Caption := '\93ü\97Í\83A\83V\83X\83g';
+ Panel3.Visible := False;
+ Panel5.Visible := False;
+ Panel7.Visible := True;
+ TextMemo.ReadOnly := True;
+ FInsertText := '';
+ CloseAction.ShortCut := ShortCut(VK_ESCAPE, []);
+ // \8c\9f\8dõ\97p
+ cat := TStringList.Create;
+ try
+ InputAssistDM.GetCategoryList(cat);
+ CategoryComboBox.Items.Clear;
+ CategoryComboBox.Items.Add('');
+ CategoryComboBox.Items.AddStrings(cat);
+ CategoryComboBox.ItemIndex := 0;
+ finally
+ cat.Free;
+ end;
+end;
+function TInputAssistForm.GetInsertText(): String;
+begin
+ Result := FInsertText;
+end;
+
+procedure TInputAssistForm.InsertButtonActionUpdate(Sender: TObject);
+begin
+ InsertButtonAction.Enabled := (GikoListView1.Selected <> nil);
+end;
+
+procedure TInputAssistForm.InsertButtonActionExecute(Sender: TObject);
+begin
+ if (GikoListView1.Selected = nil) then begin
+ FInsertText := '';
+ Self.ModalResult := mrNone;
+ end else begin
+ FInsertText := TResistWord(GikoListView1.Selected.Data).GetText;
+ Self.ModalResult := mrOk;
+ end;
+end;
+
+procedure TInputAssistForm.CloseActionExecute(Sender: TObject);
+begin
+ Self.ModalResult := mrCancel;
+end;
end.
function GetStartWithKeyResistWords(Key: String; var list: TStringList): Integer;
//! Key\82ð\83J\83e\83S\83\8a\82É\8e\9d\82Â\93o\98^\82³\82ê\82Ä\82¢\82é\92P\8cê\82ð\8eæ\93¾
function GetStartWithCategoryResistWords(Key: String; var list: TStringList): Integer;
+ //! Key\82Ì\83J\83e\83S\83\8a\82É\93o\98^\82³\82ê\82Ä\82¢\82é\92P\8cê\82ð\8eæ\93¾
+ function GetCategoryResistWords(Key: String; var list: TStringList): Integer;
+ //! \93o\98^\8dÏ\82Ý\83L\81[\82Ì\91S\82Ä\82Ì\83J\83e\83S\83\8a\83\8a\83X\83g\8eæ\93¾
+ procedure GetCategoryList(var list: TStringList);
+
end;
TResistWord = class(TObject)
FDictionary.Sorted := Value;
end;
end;
+//! Key\82Ì\83J\83e\83S\83\8a\82É\93o\98^\82³\82ê\82Ä\82¢\82é\92P\8cê\82ð\8eæ\93¾
+function TInputAssistDM.GetCategoryResistWords(Key: String; var list: TStringList): Integer;
+var
+ i : Integer;
+ resWord : TResistWord;
+begin
+ Result := 0;
+ if (FDictionary <> nil) and (list <> nil) then begin
+ for i := 0 to FDictionary.Count - 1 do begin
+ resWord := TResistWord(FDictionary.Objects[i]);
+ if (Key = resWord.GetCategory) then begin
+ Inc(Result);
+ list.AddObject(resWord.GetKey + '(' +
+ resWord.GetCategory + ')', resWord);
+ end;
+ end;
+ list.CustomSort(CategorySort);
+ end;
+end;
+
+//! \93o\98^\8dÏ\82Ý\83L\81[\82Ì\91S\82Ä\82Ì\83J\83e\83S\83\8a\83\8a\83X\83g\8eæ\93¾
+procedure TInputAssistDM.GetCategoryList(var list: TStringList);
+var
+ i : Integer;
+begin
+ if (FDictionary <> nil) and (list <> nil) then begin
+ // \8fd\95¡\83`\83F\83b\83N\82ðTStringList\82Ì\8b@\94\\82Å\8ds\82¤
+ list.Clear;
+ list.Duplicates := dupIgnore;
+ list.Sorted := true;
+ list.BeginUpdate;
+ for i := 0 to FDictionary.Count - 1 do begin
+ list.Add(TResistWord(FDictionary.Objects[i]).GetCategory);
+ end;
+ list.EndUpdate;
+ end;
+end;
//! Key\82ð\83J\83e\83S\83\8a\82É\8e\9d\82Â\93o\98^\92P\8cê\82ð\95Ô\82·\8e\9e\82Ì\83\\81[\83g\97p\94ä\8ar\83\81\83\\83b\83h
function CategorySort(List: TStringList; Index1, Index2: Integer): Integer;