PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jonathan Bristow on March 28, 2007, 12:15:52 PM

Title: inconsistency between control function naming
Post by: Jonathan Bristow on March 28, 2007, 12:15:52 PM
ff_listbox_resetcontent
ff_combobox_resetcontent
ff_listview_deleteallitems
ff_treeview_deleteallitems

Surely all 4 perform the same action within each control, so why the different names?
Title: Re: inconsistency between control function naming
Post by: TechSupport on March 28, 2007, 01:55:37 PM
They are named differently because they kind of mirror the underlying Win32 API calls that are made. Listbox/Combobox call %LB_RESETCONTENT and %CB_RESETCONTENT, and ListView calls %LVM_DELETEALLITEMS and TreeView %TVM_DELETEITEM (%TVI_ROOT).

Looking back on it, when I first wrote the wrappers it probably would have made more sense to use a common naming convention for all the controls (standard and common controls).

:)

Title: Re: inconsistency between control function naming
Post by: Roger Garstang on March 30, 2007, 04:17:34 PM
I don't see anything wrong with the different names.  The only enhancements I see is the InsertItem and SetItem for Listviews, etc.  In the Insert Item it automatically uses SetItem internally if not the 0 column, so why not combine them into one, and only have one function?  Perhaps making the other call the new version for backwards compat.