Merge branch 'a11_2_a12'

This commit is contained in:
Basile Burg 2015-02-01 16:56:04 +01:00
commit dc4f404760
10 changed files with 168 additions and 49 deletions

View File

@ -161,11 +161,13 @@ void main(string[] args)
// "TODO"
while (true) {
if (pos == text.length) break;
auto upIdent = identifier.strip.toUpper;
if (upIdent == "TODO" || upIdent == "FIXME"){
isTodoComment = true;
text = text[pos..$];
break;
if (identifier.length > 3) {
auto upIdent = identifier.strip.toUpper;
if (upIdent == "TODO" || upIdent == "FIXME"){
isTodoComment = true;
text = text[pos..$];
break;
}
}
identifier ~= text[pos++];
}

BIN
icons/arrow/arrow_pen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -52,9 +52,9 @@ type
procedure memoMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure memoCtrlClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure memoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
function getEditor(index: NativeInt): TCESynMemo;
function getEditorCount: NativeInt;
function getEditorIndex: NativeInt;
function getEditor(index: Integer): TCESynMemo;
function getEditorCount: Integer;
function getEditorIndex: Integer;
procedure getCompletionList;
procedure getSymbolLoc;
procedure focusedEditorChanged;
@ -67,9 +67,9 @@ type
constructor create(aOwner: TComponent); override;
destructor destroy; override;
//
property editor[index: NativeInt]: TCESynMemo read getEditor;
property editorCount: NativeInt read getEditorCount;
property editorIndex: NativeInt read getEditorIndex;
property editor[index: Integer]: TCESynMemo read getEditor;
property editorCount: Integer read getEditorCount;
property editorIndex: Integer read getEditorIndex;
end;
implementation
@ -186,6 +186,7 @@ end;
procedure TCEEditorWidget.docFocused(aDoc: TCESynMemo);
begin
if aDoc = fDoc then exit;
fDoc := aDoc;
focusedEditorChanged;
beginUpdateByDelay;
@ -209,12 +210,12 @@ begin
end;
{$ENDIF}
function TCEEditorWidget.getEditorCount: NativeInt;
function TCEEditorWidget.getEditorCount: Integer;
begin
result := pageControl.PageCount;
end;
function TCEEditorWidget.getEditorIndex: NativeInt;
function TCEEditorWidget.getEditorIndex: Integer;
begin
if pageControl.PageCount > 0 then
result := pageControl.PageIndex
@ -234,7 +235,6 @@ begin
macRecorder.Editor := fDoc;
fSyncEdit.Editor := fDoc;
completion.Editor := fDoc;
//TODO-cbugfix: prevent completion to steal the focus, this trigs too much updates after Ctrl+Space
if (pageControl.ActivePage.Caption = '') then
begin
fKeyChanged := true;

View File

@ -23,6 +23,51 @@ LazarusResources.Add('arrow_down','PNG',[
+#153#221#247'9'#255#19'`'#0#195#1#11#131#154#5'+'#228#0#0#0#0'IEND'#174'B`'
+#130
]);
LazarusResources.Add('arrow_pen','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#3'iiTXtXML:com.adob'
+'e.xmp'#0#0#0#0#0'<?xpacket begin="'#239#187#191'" id="W5M0MpCehiHzreSzNTczk'
+'c9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060'
+' 61.134777, 2010/02/12-17:32:00 "> <rdf:RDF xmlns:rdf="http://www.w3'
+'.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpRig'
+'hts="http://ns.adobe.com/xap/1.0/rights/" xmlns:xmpMM="http://ns.adobe.com/'
+'xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" x'
+'mlns:xmp="http://ns.adobe.com/xap/1.0/" xmpRights:Marked="False" xmpMM:Docu'
+'mentID="xmp.did:70B9FE3C038711E1ADE2CBC300AB5626" xmpMM:InstanceID="xmp.iid'
+':70B9FE3B038711E1ADE2CBC300AB5626" xmp:CreatorTool="Adobe Photoshop CS3 Win'
+'dows"> <xmpMM:DerivedFrom stRef:instanceID="uuid:AC1F2E83324ADF11AAB8C5390D'
+'85B5B3" stRef:documentID="uuid:C9D349664A3CDD11B08ABBBCFF172156"/> </rdf:De'
+'scription> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>'#31#129'@+'#0#0#2#161
+'IDATx'#218#132#146'oHSQ'#24#198#159#187#221'm'#162#166'NG'#132#17#142#20'CL'
+'#'#150#132#203#176#8#194'$'#130'B'#130'rP3PP'#168'P"'#144#164#200#213'>'#244
+'!A'#194#180#130'Z*'#154'K,cdjh'#174'2'#218#164'?8'#21#251#224#152'1'#5'm'
+#163#253#235#238#238#222#219#217#194#156'8'#235#129#195'9'#156#243#254#222
+#247'<//'#5#162#170'c'#20#162#149#148'*`W>'#133#164'M'#171'w'#143'_'#149'E'
+#246#219'Fcn'#8#168#253#9#24#230#129'Q'#17'b('#127#231'Z8J'#25#211#10'Em'#134
+'^_'#225#1#234'y'#224#208#186#4#133'j 99&'#156#197#178'l'#169#218'n'#175'`'
+#230#230#144'W^~'#216'+'#8#231#169#21#11'i'#10' ;'#27'HM'#139#129#10'8'#224
+'XT'#156#211#214#217'56'#155#13'r'#185#28#157'99'#166'm'#193'`'#3#29'~Wn'#1
+'r'#11#16'['#4'fY\'#174#174#169'+'#25'z'#177#31#219'UO'#160'V'#171'u'#233'bq'
+'g'#150'D2Ew\'#1'(J '#145#212#134#240#137'S'#250#18#142'c'#145#153#153#137
+#222#7#185#207'|>'#218'8CQS3'#18#9'h'#224#223#149#195'0'#195#248#177#176#240
+#13#19#227'OG'#179#148'h'#230'y'#209#231#149'0'#250#127#176#207#231#134#203
+#245#29#230#215']c'#164#160#206')'#217'7'#188#181#180#8'!6'#4'6'#200#196'H'
+#16#5#187#221#139#240#249'\x'#217#223'a'#150'J'#208#184'(-'#28'z.'#238'A'#250
+#17#128#9#4#224#247'x '#218#8'^Z'#178'G'#224#222'n'#195';'#142#195'u'#135'P0'
+#216#23#215#3'A'#16'Z'#201#210#172#183#16#5';'#157#179#224#249#16':'#30#26
+#198#127#196#23'\'#251'*'#169#25'tR{ &'#21'i'#169'TE'#162'U$I'#152'j'#143#252
+#128#156'w'#248'='#168#12#195#14#199'$X'#246#23#238#223'5| '#149#175#154#226
+#218#202#230#177#219#194'q'#156'%'#200'0'#150#240#183#207#28'W'#170#2'^'#239
+'E'#129#231'5'#212#189'K'#144#134'8T'#158#174#29'i'#156#157#210#165#164#145
+#137'j'#187#211#253#145#150#160#193#150#160#29#248'$'#213'Z.T'#23#169#166#201
+#240'{B'#171'n7'#203#128#190'Gf+'#237#241'S'#170'<'#181#182#140#18#137'R'#228
+'i'#26#127#211'-'#237#132'L&'#232#196'45'#240'>x'#18#2#227#181#222#212#155
+#214#180'JY^'#170#26'l5Y'#9#211'D/{pt'#239#193#179#197#253'='#205'_'#222#12
+#27#223#146#247'N'#169#12#230#191#173#225#249'*.'#244#167'4O<'#133'mL'#182't'
+'E'#224#248#196#196'v'#250#134'A'#168'_v'#23#183#144#150#244#147#152#17#178#2
+#27#205#150#199#229#10'7'#204'J'#142'c'#178#132#132#246#240#221'o'#1#6#0#177
+#145';1'#128#133#216'I'#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('arrow_redo','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#16#0#0#0#16#8#6#0#0#0#31#243#255'a'
+#0#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#2'7IDATx'#218#140

View File

@ -364,6 +364,7 @@ end;
procedure TCEMessagesWidget.projFocused(aProject: TCEProject);
begin
if fProj = aProject then exit;
fProj := aProject;
filterMessages(fCtxt);
end;
@ -394,6 +395,7 @@ end;
procedure TCEMessagesWidget.docFocused(aDoc: TCESynMemo);
begin
if fDoc = aDoc then exit;
fDoc := aDoc;
filterMessages(fCtxt);
end;

View File

@ -29,7 +29,7 @@ type
procedure cbToFindChange(Sender: TObject);
procedure chkEnableRepChange(Sender: TObject);
private
fEditor: TCESynMemo;
fDoc: TCESynMemo;
fToFind: string;
fReplaceWth: string;
fActFindNext, fActReplaceNext: TAction;
@ -187,28 +187,28 @@ end;
procedure TCESearchWidget.actFindNextExecute(sender: TObject);
begin
if fEditor = nil then exit;
if fDoc = nil then exit;
//
fSearchMru.Insert(0,fToFind);
if not chkFromCur.Checked then
begin
if chkBack.Checked then
fEditor.CaretXY := Point(high(Integer), high(Integer))
fDoc.CaretXY := Point(high(Integer), high(Integer))
else
begin
if not fHasRestarted then
fEditor.CaretXY := Point(0,0);
fDoc.CaretXY := Point(0,0);
fHasRestarted := true;
end;
end
else if fHasSearched then
begin
if chkBack.Checked then
fEditor.CaretX := fEditor.CaretX - 1
fDoc.CaretX := fDoc.CaretX - 1
else
fEditor.CaretX := fEditor.CaretX + length(fToFind);
fDoc.CaretX := fDoc.CaretX + length(fToFind);
end;
if fEditor.SearchReplace(fToFind, '', getOptions) = 0 then
if fDoc.SearchReplace(fToFind, '', getOptions) = 0 then
dlgOkInfo('the expression cannot be found')
else
begin
@ -221,29 +221,29 @@ end;
procedure TCESearchWidget.actReplaceNextExecute(sender: TObject);
begin
if fEditor = nil then exit;
if fDoc = nil then exit;
//
fSearchMru.Insert(0, fToFind);
fReplaceMru.Insert(0, fReplaceWth);
if chkPrompt.Checked then
fEditor.OnReplaceText := @replaceEvent;
fDoc.OnReplaceText := @replaceEvent;
if not chkFromCur.Checked then
begin
if chkBack.Checked then
fEditor.CaretXY := Point(high(Integer), high(Integer))
fDoc.CaretXY := Point(high(Integer), high(Integer))
else
fEditor.CaretXY := Point(0,0);
fDoc.CaretXY := Point(0,0);
end
else if fHasSearched then
begin
if chkBack.Checked then
fEditor.CaretX := fEditor.CaretX - 1
fDoc.CaretX := fDoc.CaretX - 1
else
fEditor.CaretX := fEditor.CaretX + length(fToFind);
fDoc.CaretX := fDoc.CaretX + length(fToFind);
end;
if fEditor.SearchReplace(fToFind, fReplaceWth, getOptions + [ssoReplace]) <> 0 then
if fDoc.SearchReplace(fToFind, fReplaceWth, getOptions + [ssoReplace]) <> 0 then
fHasSearched := true;
fEditor.OnReplaceText := nil;
fDoc.OnReplaceText := nil;
UpdateByEvent;
end;
@ -251,17 +251,17 @@ procedure TCESearchWidget.actReplaceAllExecute(sender: TObject);
var
opts: TSynSearchOptions;
begin
if fEditor = nil then exit;
if fDoc = nil then exit;
opts := getOptions + [ssoReplace];
opts -= [ssoBackwards];
//
fSearchMru.Insert(0, fToFind);
fReplaceMru.Insert(0, fReplaceWth);
if chkPrompt.Checked then fEditor.OnReplaceText := @replaceEvent;
fEditor.CaretXY := Point(0,0);
if chkPrompt.Checked then fDoc.OnReplaceText := @replaceEvent;
fDoc.CaretXY := Point(0,0);
while(true) do
begin
if fEditor.SearchReplace(fToFind, fReplaceWth, opts) = 0
if fDoc.SearchReplace(fToFind, fReplaceWth, opts) = 0
then break;
if fCancelAll then
begin
@ -269,7 +269,7 @@ begin
break;
end;
end;
fEditor.OnReplaceText := nil;
fDoc.OnReplaceText := nil;
UpdateByEvent;
end;
{$ENDREGION}
@ -277,19 +277,20 @@ end;
{$REGION ICEMultiDocObserver ---------------------------------------------------}
procedure TCESearchWidget.docNew(aDoc: TCESynMemo);
begin
fEditor := aDoc;
fDoc := aDoc;
UpdateByEvent;
end;
procedure TCESearchWidget.docClosing(aDoc: TCESynMemo);
begin
if fEditor = aDoc then fEditor := nil;
if fDoc = aDoc then fDoc := nil;
UpdateByEvent;
end;
procedure TCESearchWidget.docFocused(aDoc: TCESynMemo);
begin
fEditor := aDoc;
if fDoc = aDoc then exit;
fDoc := aDoc;
UpdateByEvent;
end;
@ -321,11 +322,11 @@ end;
procedure TCESearchWidget.UpdateByEvent;
begin
fActFindNext.Enabled := fEditor <> nil;
fActReplaceNext.Enabled := (fEditor <> nil) and (chkEnableRep.Checked);
fActReplaceAll.Enabled := (fEditor <> nil) and (chkEnableRep.Checked);
cbReplaceWth.Enabled := (fEditor <> nil) and (chkEnableRep.Checked);
cbToFind.Enabled := fEditor <> nil;
fActFindNext.Enabled := fDoc <> nil;
fActReplaceNext.Enabled := (fDoc <> nil) and (chkEnableRep.Checked);
fActReplaceAll.Enabled := (fDoc <> nil) and (chkEnableRep.Checked);
cbReplaceWth.Enabled := (fDoc <> nil) and (chkEnableRep.Checked);
cbToFind.Enabled := fDoc <> nil;
//
cbToFind.Items.Assign(fSearchMru);
cbReplaceWth.Items.Assign(fReplaceMru);

View File

@ -286,6 +286,7 @@ end;
procedure TCEStaticExplorerWidget.docFocused(aDoc: TCESynMemo);
begin
if fDoc = aDoc then exit;
fDoc := aDoc;
if not Visible then exit;
//

View File

@ -128,6 +128,7 @@ end;
procedure TCEStaticEditorMacro.docFocused(aDoc: TCESynMemo);
begin
if fDoc = aDoc then exit;
fDoc := aDoc;
fCompletor.Editor := fDoc;
end;

View File

@ -41,10 +41,10 @@ inherited CETodoListWidget: TCETodoListWidget
TabOrder = 0
end
object lstfilter: TListFilterEdit
Left = 38
Left = 68
Height = 23
Top = 2
Width = 513
Width = 483
ButtonWidth = 28
NumGlyphs = 1
Align = alCustom
@ -52,6 +52,19 @@ inherited CETodoListWidget: TCETodoListWidget
MaxLength = 0
TabOrder = 1
end
object btnGo: TBitBtn
Left = 32
Height = 22
Hint = 'refresh the list'
Top = 2
Width = 28
Align = alLeft
BorderSpacing.Around = 2
Layout = blGlyphBottom
OnClick = btnGoClick
Spacing = 0
TabOrder = 2
end
end
object lstItems: TListView[1]
Left = 4
@ -90,5 +103,10 @@ inherited CETodoListWidget: TCETodoListWidget
inherited contextMenu: TPopupMenu
left = 40
top = 72
object mnuAutoRefresh: TMenuItem[0]
AutoCheck = True
Caption = 'Auto resfresh'
OnClick = mnuAutoRefreshClick
end
end
end

View File

@ -56,12 +56,17 @@ type
{ TCETodoListWidget }
TCETodoListWidget = class(TCEWidget, ICEMultiDocObserver, ICEProjectObserver)
TCETodoListWidget = class(TCEWidget, ICEMultiDocObserver, ICEProjectObserver, ICESessionOptionsObserver)
btnRefresh: TBitBtn;
btnGo: TBitBtn;
lstItems: TListView;
lstfilter: TListFilterEdit;
mnuAutoRefresh: TMenuItem;
Panel1: TPanel;
procedure btnGoClick(Sender: TObject);
procedure mnuAutoRefreshClick(Sender: TObject);
private
fAutoRefresh: Boolean;
fProj: TCEProject;
fDoc: TCESynMemo;
fToolProcess: TCheckedAsyncProcess;
@ -91,6 +96,11 @@ type
procedure filterItems(sender: TObject);
protected
procedure SetVisible(Value: boolean); override;
// ICESessionOptionsObserver
procedure optset_AutoReafresh(aReader: TReader);
procedure optget_AutoReafresh(aWriter: TWriter);
procedure sesoptDeclareProperties(aFiler: TFiler); override;
procedure sesoptAfterLoad; override;
public
constructor create(aOwner: TComponent); override;
destructor destroy; override;
@ -166,7 +176,8 @@ begin
fLogMessager := TCELogMessageSubject.create;
lstItems.OnDblClick := @lstItemsDoubleClick;
btnRefresh.OnClick := @btnRefreshClick;
fAutoRefresh := true;
mnuAutoRefresh.Checked := true;
// http://bugs.freepascal.org/view.php?id=27137
// TODO-cCleanup: remove comment after next Laz release
// TODO-cfeature, try the new TListViewFilterEdit here.
@ -176,6 +187,8 @@ begin
try
png.LoadFromLazarusResource('arrow_update');
btnRefresh.Glyph.Assign(png);
png.LoadFromLazarusResource('arrow_pen');
btnGo.Glyph.Assign(png);
finally
png.Free;
end;
@ -197,6 +210,30 @@ end;
{$ENDREGION}
{$REGION ICESessionOptionsObserver --------------------------------------------}
procedure TCETodoListWidget.optset_AutoReafresh(aReader: TReader);
begin
fAutoRefresh := aReader.ReadBoolean;
end;
procedure TCETodoListWidget.optget_AutoReafresh(aWriter: TWriter);
begin
aWriter.WriteBoolean(fAutoRefresh);
end;
procedure TCETodoListWidget.sesoptDeclareProperties(aFiler: TFiler);
begin
inherited;
aFiler.DefineProperty(Name + '_AutoRefresh', @optset_AutoReafresh, @optget_AutoReafresh, true);
end;
procedure TCETodoListWidget.sesoptAfterLoad;
begin
inherited;
mnuAutoRefresh.Checked := fAutoRefresh;
end;
{$ENDREGIOn}
{$REGION ICEMultiDocObserver ---------------------------------------------------}
procedure TCETodoListWidget.docNew(aDoc: TCESynMemo);
begin
@ -204,8 +241,9 @@ end;
procedure TCETodoListWidget.docFocused(aDoc: TCESynMemo);
begin
if aDoc = fDoc then exit;
fDoc := aDoc;
if Visible then
if Visible and fAutoRefresh then
callToolProcess;
end;
@ -231,7 +269,7 @@ end;
procedure TCETodoListWidget.projChanged(aProject: TCEProject);
begin
if fProj <> aProject then exit;
if Visible then
if Visible and fAutoRefresh then
callToolProcess;
end;
@ -244,8 +282,9 @@ end;
procedure TCETodoListWidget.projFocused(aProject: TCEProject);
begin
if aProject = fProj then exit;
fProj := aProject;
if Visible then
if Visible and fAutoRefresh then
callToolProcess;
end;
@ -402,6 +441,16 @@ begin
end;
end;
procedure TCETodoListWidget.btnGoClick(Sender: TObject);
begin
lstItemsDoubleClick(nil);
end;
procedure TCETodoListWidget.mnuAutoRefreshClick(Sender: TObject);
begin
fAutoRefresh := mnuAutoRefresh.Checked;
end;
procedure TCETodoListWidget.lstItemsDoubleClick(sender: TObject);
var
itm: TTodoItem;