[SOLVED] Ini file editor: use of synmemo lazarus / 31-LCL ---------------------------------------------------------------------- BigChimp · 2012-12-13 07:45 Thanks to Typo's code [1], I've created a modal ini file editor with support for profiles. See the attached code, which includes an example project and a demo ini file (although it's called database.ini.txt) You can choose one of the ini file sections in the combobox and the value for the [Database] type= .... key will be changed. You can also use the synmemo to edit things. I think it's coming along well now... just one fairly big thing: a user can e.g. remove sections and manually update the selected profile (which is after all in the same ini file). I would like to respond to some kind of synmemo event to update the combobox. What is the most efficient event (I'm a complete synmemo newb, so any obvious pointers welcome!). Also, as usual, comments for code improvements are very welcome. Thanks. PS: Oh, I still keep the code in my smalltools repository (see sig) Edit: the code in the repository has been updated with some fixes. [1] http://lazarus.freepascal.org/index.php/topic,19157.0.html ---------------------------------------------------------------------- howardpc · 2012-12-13 13:34 Quote from: BigChimp on December 13, 2012, 08:45:57 amI would like to respond to some kind of synmemo event to update the combobox. What is the most efficient event (I'm a complete synmemo newb, so any obvious pointers welcome!). Really Martin F is the one to respond to this. But in case he doesn't, my guess would be the OnStatusChange event, which passes a set of Changes (TSysStstusChanges) as an argument. One potential element in this is scModified. So if you checked for that ...? Howard ---------------------------------------------------------------------- BigChimp · 2012-12-13 13:38 Thanks Howard, I'll have a look. ---------------------------------------------------------------------- BigChimp · 2012-12-17 17:12 Ok, got that event working. I use a timer and a "must save" flag in order to not slow down the program. Patches/comments welcome of course Code is in my smalltools repository, iniedit directory. It's also been committed to the FPC database tests: $(fpcdirectory)\packages\fcl-db\tests\dbtestframework_gui.lpi