From 0c17f82e23fdde5b237cbf61a85b5a9ec4637bf9 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 7 Mar 2005 18:46:36 +0000 Subject: [PATCH] fixed unsetting ItemIndex on changing TComboBox.Text git-svn-id: trunk@6913 - --- ide/findreplacedialog.pp | 10 ++++++---- ide/main.pp | 5 ++++- ide/uniteditor.pp | 17 +++++++++++++---- lcl/include/control.inc | 5 ++++- lcl/include/customcombobox.inc | 11 ++++++++++- lcl/interfaces/gtk/gtkobject.inc | 14 +++++++++++++- 6 files changed, 50 insertions(+), 12 deletions(-) diff --git a/ide/findreplacedialog.pp b/ide/findreplacedialog.pp index dc7353a1f7..83016bf9ae 100644 --- a/ide/findreplacedialog.pp +++ b/ide/findreplacedialog.pp @@ -38,8 +38,9 @@ unit FindReplaceDialog; interface uses - Classes, SysUtils, LCLType, Controls, StdCtrls, Forms, Buttons, ExtCtrls, - LResources, Dialogs, SynEditTypes, SynRegExpr, SynEdit, LazarusIdeStrConsts; + Classes, SysUtils, LCLProc, LCLType, Controls, StdCtrls, Forms, Buttons, + ExtCtrls, LResources, Dialogs, SynEditTypes, SynRegExpr, SynEdit, + LazarusIdeStrConsts; type TFindDlgComponent = (fdcText, fdcReplace); @@ -583,11 +584,12 @@ begin Result:=TextToFindComboBox.Text; end; -procedure TLazFindReplaceDialog.SetFindText(const NewFindText:AnsiString); +procedure TLazFindReplaceDialog.SetFindText(const NewFindText: AnsiString); begin // SetComboBoxText(TextToFindComboBox,NewFindText); - TextToFindComboBox.Text:= NewFindText; + TextToFindComboBox.Text:=NewFindText; TextToFindComboBox.SelectAll; + //debugln('TLazFindReplaceDialog.SetFindText A TextToFindComboBox.SelStart=',dbgs(TextToFindComboBox.SelStart),' TextToFindComboBox.SelLength=',dbgs(TextToFindComboBox.SelLength),' TextToFindComboBox.Text="',TextToFindComboBox.Text,'" NewFindText="',DbgStr(NewFindText),'"'); end; function TLazFindReplaceDialog.GetReplaceText:AnsiString; diff --git a/ide/main.pp b/ide/main.pp index 418627cade..c11b734c07 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -7875,7 +7875,7 @@ begin end; SplitCmdLine(CommandAfter,CmdAfterExe,CmdAfterParams); if (CmdAfterExe<>'') then begin - DebugLn('TMainIDE.DoPublishModule A CmdAfterExe="',CmdAfterExe,'"'); + //DebugLn('TMainIDE.DoPublishModule A CmdAfterExe="',CmdAfterExe,'"'); CmdAfterExe:=FindDefaultExecutablePath(CmdAfterExe); if not FileIsExecutableCached(CmdAfterExe) then begin MessageDlg(lisCommandAfterInvalid, @@ -11483,6 +11483,9 @@ end. { ============================================================================= $Log$ + Revision 1.855 2005/03/07 18:46:35 mattias + fixed unsetting ItemIndex on changing TComboBox.Text + Revision 1.854 2005/03/07 17:33:54 mattias added check for overwriting source directory on ublish module diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index b82a8f65c7..f1a16cdb9f 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -793,13 +793,18 @@ begin FindReplaceDlg.ReplaceTextComboBox.Items.Assign( InputHistories.ReplaceHistory); + FindReplaceDlg.FindText := 'test'; with EditorComponent do begin if EditorOpts.FindTextAtCursor then begin - if SelAvail and (BlockBegin.Y = BlockEnd.Y) then + if SelAvail and (BlockBegin.Y = BlockEnd.Y) then begin + //debugln('TSourceEditor.StartFindAndReplace B FindTextAtCursor SelAvail'); FindReplaceDlg.FindText := SelText - else - FindReplaceDlg.FindText := GetWordAtRowCol(LogicalCaretXY); + end else begin + debugln('TSourceEditor.StartFindAndReplace B FindTextAtCursor not SelAvail'); + //FindReplaceDlg.FindText := GetWordAtRowCol(LogicalCaretXY); + end; end else begin + //debugln('TSourceEditor.StartFindAndReplace B not FindTextAtCursor'); FindReplaceDlg.FindText:=''; end; end; @@ -3490,8 +3495,12 @@ begin begin TextToFindComboBox.Items.Assign(FindHistory); if not EditorOpts.FindTextAtCursor then begin - if TextToFindComboBox.Items.Count>0 then + if TextToFindComboBox.Items.Count>0 then begin + //debugln('TSourceNotebook.LoadFindInFilesHistory A TextToFindComboBox.Text=',TextToFindComboBox.Text); TextToFindComboBox.ItemIndex:=0; + TextToFindComboBox.SelectAll; + //debugln('TSourceNotebook.LoadFindInFilesHistory B TextToFindComboBox.Text=',TextToFindComboBox.Text); + end; end; AssignToComboBox(DirectoryComboBox, FindInFilesPathHistory); AssignToComboBox(FileMaskComboBox, FindInFilesMaskHistory); diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 79f3353568..34fb8943a7 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -3128,7 +3128,7 @@ end; ------------------------------------------------------------------------------} procedure TControl.SetText(const Value: TCaption); begin - //if CompareText(ClassName,'TMEMO')=0 then + //if CompareText(Name,'TextToFindComboBox')=0 then // debugln('TControl.SetText A ',DbgSName(Self),' GetText="',GetText,'" Value="',Value,'" FCaption="',FCaption,'"'); if GetText = Value then Exit; @@ -3497,6 +3497,9 @@ end; { ============================================================================= $Log$ + Revision 1.249 2005/03/07 18:46:36 mattias + fixed unsetting ItemIndex on changing TComboBox.Text + Revision 1.248 2005/03/05 14:42:01 mattias Click events are now created after MouseUp from C Western diff --git a/lcl/include/customcombobox.inc b/lcl/include/customcombobox.inc index f6bc2593fc..604727f2e1 100644 --- a/lcl/include/customcombobox.inc +++ b/lcl/include/customcombobox.inc @@ -707,7 +707,9 @@ var begin I := FItems.IndexOf(AValue); if I >= 0 then - ItemIndex := I; + ItemIndex := I + else if (not (csLoading in ComponentState)) then + FItemIndex := -1; inherited; end; @@ -720,6 +722,8 @@ end; ------------------------------------------------------------------------------} procedure TCustomComboBox.SetItemIndex(Val : integer); begin + //if CompareText(Name,'TextToFindComboBox')=0 then + // debugln('TCustomComboBox.SetItemIndex A ',DbgSName(Self),' Text="',Text,'"'); if Val=GetItemIndex then exit; if Val>=Items.Count then exit; @@ -733,6 +737,8 @@ begin // remember text, in case one reads text without creating handle Text := FItems.Strings[FItemIndex]; end; + //if CompareText(Name,'TextToFindComboBox')=0 then + // debugln('TCustomComboBox.SetItemIndex END ',DbgSName(Self),' Text="',Text,'"'); end; {------------------------------------------------------------------------------ @@ -796,6 +802,9 @@ end; { $Log$ + Revision 1.57 2005/03/07 18:46:36 mattias + fixed unsetting ItemIndex on changing TComboBox.Text + Revision 1.56 2005/02/15 22:01:54 micha compilation fixes diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index 565c9c92b2..7ea22c8719 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -1530,8 +1530,17 @@ end; Minimizes the application ------------------------------------------------------------------------------} procedure TGtkWidgetSet.AppMinimize; +var + i: Integer; + AForm: TCustomForm; begin - // TODO: Implement me! + if Screen=nil then exit; + for i:=0 to Screen.CustomFormCount-1 do begin + AForm:=Screen.CustomForms[i]; + if (AForm.Parent=nil) and AForm.HandleAllocated then begin + ShowWindow(AForm.Handle, WS_MINIMIZE); + end; + end; end; {------------------------------------------------------------------------------ @@ -6886,6 +6895,9 @@ end; { ============================================================================= $Log$ + Revision 1.640 2005/03/07 18:46:36 mattias + fixed unsetting ItemIndex on changing TComboBox.Text + Revision 1.639 2005/03/07 16:01:06 mattias hiding secondary form from taskbar in gtk2.2 from Sergio