inconsistency between control function naming

Started by Jonathan Bristow, March 28, 2007, 12:15:52 PM

Previous topic - Next topic

Jonathan Bristow

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?

TechSupport

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).

:)


Roger Garstang

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.