Added patch to enable OnChange support for CDEdit and CDComboBox lazarus / 43-Android ---------------------------------------------------------------------- stab · 2012-11-20 09:29 Hi, Added following changes to enable OnChange support for CDEdit and CDComboBox. If this is OK, it could perhaps be added to Custom Drawn Components package. procedure TCDComboBox.SetItemIndex(AValue: Integer); var   lValue : Integer;   lText: String; begin   lValue := AValue;   // First basic check   if lValue >= FItems.Count then lValue := FItems.Count - 1;   if lValue < -1 then lValue := -1;   // Check if the text changed too, because it might differ from the choosen item   FItemIndex:=lValue;   if (lValue >= 0) and (lValue < FItems.Count)then   begin     lText := FItems.Strings[lValue];     if Lines.Text = lText then Exit; // MyChanges **************************************************     if FItems.Count > 1 then     begin       Lines.Text := FItems.Text;       if lValue < Lines.Count then         DoChange;     end; // MyChanges **************************************************     Text := lText;   end;   Invalidate; end; procedure TCDEdit.SetCurrentLine(AStr: string); var   oldStr : string; begin   if (FEditState.Lines.Count = 0) or (FEditState.CaretPos.Y >= FEditState.Lines.Count) then   begin     FEditState.Lines.Text := AStr;     FEditState.VisibleTextStart.X := 1;     FEditState.VisibleTextStart.Y := 0;     FEditState.CaretPos.X := 0;     FEditState.CaretPos.Y := 0;   end   else   begin     oldStr := FLines.Strings[FEditState.CaretPos.Y]; // MyChanges **************     FLines.Strings[FEditState.CaretPos.Y] := AStr;     if oldStr <> AStr then                           // MyChanges **************       DoChange;                                      // MyChanges **************   end; end; Regards stab ---------------------------------------------------------------------- stab · 2012-11-20 09:34 Added also    property OnChange : TNotifyEvent read FOnChange write FOnChange to TCDEdit /stab ---------------------------------------------------------------------- felipemdc · 2012-11-20 10:55 Hello, Please create a patch in our standard format, as explained in the wiki: http://wiki.freepascal.org/Creating_A_Patch thanks, ---------------------------------------------------------------------- stab · 2012-11-20 18:37 Hi Felipemdc, I'll gladly do so, but I don't understand the instructions. Platform:      Windows 7/64 Lazarus:       ver. 1.1 FPC:              ver.2.7.1 SVN Rev: 39275 Am I supposed to download "Lazarus SVN development version",  i.e all within the trunk at http://svn.freepascal.org/svn/lazarus/trunk, over the oversion I already have??? Creating the patch using SVN svn diff > mypatch.diff Where do I find svn? This includes all changed files in the whole SVN repository. You can also define the individual files, to make sure no garbage is included, eg. : svn diff ide/main.pp ideintf/objectinspector.pp > mypatch.diff Regards and thank you for a good work stab ---------------------------------------------------------------------- JuhaManninen · 2012-11-20 19:02 Quote from: stab on November 20, 2012, 07:37:35 pmAm I supposed to download "Lazarus SVN development version",  i.e all within the trunk at http://svn.freepascal.org/svn/lazarus/trunk, over the oversion I already have??? No, download it into a new directory. QuoteWhere do I find svn? You could try TortoiseSVN. Remember to include cmd line tools during the installation. Quotesvn diff ide/main.pp ideintf/objectinspector.pp > mypatch.diff In your case it would be :  svn diff lcl/customdrawncontrols.pas > mypatch.diff [edit: the file ending does not really matter, can be .patch or .diff] Juha ---------------------------------------------------------------------- stab · 2012-11-21 20:14 OK, I managed to get Lazarus SVN development version via Tortoise to a new directory.  Changed to the directory where the development version was downloaded and issued:  svn diff lcl/customdrawncontrols.pas > stab.patch stab.patch sure got created but it is empty. I guess I'm supposed to specify where the file with my changes is but where do I do that? Regards stab ---------------------------------------------------------------------- felipemdc · 2012-12-21 10:35 You made a wrong command, it should be like this: cd lazarus svn diff > stab.patch And then you can delete parts that you don't want manually from the file stab.patch if you only want some files. Anyway, via TortoiseSVN in Windows you can just right click the lazarus folder and select "Create a patch" ---------------------------------------------------------------------- JuhaManninen · 2012-12-21 19:16 Quote from: felipemdc on December 21, 2012, 11:35:00 amYou made a wrong command, it should be like this: cd lazarus svn diff > stab.patch stab's command :  svn diff lcl/customdrawncontrols.pas > stab.patch is perfectly valid. I guess he didn't have changes in customdrawncontrols.pas and thus the resulting file was empty. Yes,  TortoiseSVN's "Create a patch" is maybe the best way for people who are not familiar with cmd line. Juha