From: Andreas H. <ah...@us...> - 2005-01-20 23:09:31
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28864/run Modified Files: JvEditor.pas JvEditorCommon.pas Log Message: Fixed bugs Added PostBeginCompound and PostEndBeginCompound to allow PostCommand to be encapsulated by a compound Index: JvEditorCommon.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvEditorCommon.pas,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** JvEditorCommon.pas 4 Jan 2005 23:23:42 -0000 1.30 --- JvEditorCommon.pas 20 Jan 2005 23:09:22 -0000 1.31 *************** *** 215,221 **** --- 215,223 ---- {$IFDEF VCL} WM_EDITCOMMAND = WM_USER + $101; + WM_COMPOUND = WM_USER + $102; {$ENDIF VCL} {$IFDEF VisualCLX} WM_EDITCOMMAND = CM_BASE + $101; + WM_COMPOUND = CM_BASE + $102; {$ENDIF VisualCLX} *************** *** 666,669 **** --- 668,672 ---- { internal message processing } procedure WMEditCommand(var Msg: TMessage); message WM_EDITCOMMAND; + procedure WMCompound(var Msg: TMessage); message WM_COMPOUND; procedure WMHScroll(var Msg: TWMHScroll); message WM_HSCROLL; *************** *** 893,896 **** --- 896,901 ---- procedure BeginCompound; procedure EndCompound; + procedure PostBeginCompound; + procedure PostEndCompound; property LeftCol: Integer read FLeftCol; *************** *** 2451,2454 **** --- 2456,2468 ---- end; + procedure TJvCustomEditorBase.WMCompound(var Msg: TMessage); + begin + if Msg.WParam = 0 then + BeginCompound + else + EndCompound; + Msg.Result := Ord(True); + end; + procedure TJvCustomEditorBase.WMHScroll(var Msg: TWMHScroll); begin *************** *** 5236,5239 **** --- 5250,5263 ---- end; + procedure TJvCustomEditorBase.PostBeginCompound; + begin + PostMessage(Handle, WM_COMPOUND, 0, 0); + end; + + procedure TJvCustomEditorBase.PostEndCompound; + begin + PostMessage(Handle, WM_COMPOUND, 1, 0); + end; + procedure TJvCustomEditorBase.SetBracketHighlighting(Value: TJvBracketHighlighting); begin Index: JvEditor.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvEditor.pas,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** JvEditor.pas 11 Dec 2004 01:20:15 -0000 1.62 --- JvEditor.pas 20 Jan 2005 23:09:21 -0000 1.63 *************** *** 1156,1159 **** --- 1156,1161 ---- if (ACommand = ecSelPrevWord) and IsNewSelection then SetSel1(CaretX, CaretY); + if Y >= FLines.Count then + Exit; S := FLines[Y]; *************** *** 1211,1214 **** --- 1213,1218 ---- begin Y := FLines.Count - 1; + if Y < 0 then + Exit; X := Length(FLines[Y]); end; |