Header file for Listview: Difference between revisions
No edit summary |
|||
Line 7: | Line 7: | ||
<attach>ListView.zip</attach> | <attach>ListView.zip</attach> | ||
There are some | There are some macro commands in this file: | ||
* <highlight-nsis>${NSD_RemoveStyle} control_HWND style</highlight-nsis> | * <highlight-nsis>${NSD_RemoveStyle} control_HWND style</highlight-nsis> | ||
Removes one or more window style from a control. | Removes one or more window style from a control. | ||
* ${NSD_RemoveExStyle} control_HWND style | * <highlight-nsis>${NSD_RemoveExStyle} control_HWND style</highlight-nsis> | ||
Removes one or more extended window style from a control. | Removes one or more extended window style from a control. | ||
* ${NSD_CB_DelString} combo_HWND string | * <highlight-nsis>${NSD_CB_DelString} combo_HWND string</highlight-nsis> | ||
Deletes the specified string from a combobox. | Deletes the specified string from a combobox. | ||
* ${NSD_CB_Clear} combo_HWND | * <highlight-nsis>${NSD_CB_Clear} combo_HWND</highlight-nsis> | ||
Deletes all strings from a combobox (no return value). | Deletes all strings from a combobox (no return value). | ||
* ${NSD_CB_GetCount} combo_HWND | * <highlight-nsis>${NSD_CB_GetCount} combo_HWND output_var</highlight-nsis> | ||
Retrieves the number of strings from a combobox. | Retrieves the number of strings from a combobox. | ||
* ${NSD_CB_GetSelection} combo_HWND output_var | * <highlight-nsis>${NSD_CB_GetSelection} combo_HWND output_var</highlight-nsis> | ||
Retrieves the selected string from a combobox. | Retrieves the selected string from a combobox. | ||
* ${NSD_LB_DelString} listbox_HWND string # the redefined one | * <highlight-nsis>${NSD_LB_DelString} listbox_HWND string # the redefined one</highlight-nsis> | ||
Deletes the specified string from a list box. | Deletes the specified string from a list box. | ||
The macro command NSD_LB_DelString in nsDialogs.nsh always deletes the first string but not the specified one. I write a new macro to replace it, and undefine the original one in this file. | The macro command NSD_LB_DelString in nsDialogs.nsh always deletes the first string but not the specified one. I write a new macro to replace it, and undefine the original one in this file. | ||
* ${NSD_LB_Clear} listbox_HWND # the redefined one | * <highlight-nsis>${NSD_LB_Clear} listbox_HWND # the redefined one</highlight-nsis> | ||
Deletes all strings from a list box (no return value). | Deletes all strings from a list box (no return value). | ||
The macro command NSD_LB_Clear in nsDialogs.nsh needs two parameters, but the readme file of nsDialogs said the macro needs only one parameter, it is exactly the handle of the listbox. This macro is redefined as the above one, it doesn't return a value. | |||
* ${NSD_LV_InsertColumn} listview_HWND col_idx col_w text | * <highlight-nsis>${NSD_LV_InsertColumn} listview_HWND col_idx col_w text</highlight-nsis> | ||
Inserts a new column to a listview (report view). | Inserts a new column to a listview (report view). | ||
* ${NSD_LV_InsertItem} listview_HWND item_idx text | * <highlight-nsis>${NSD_LV_InsertItem} listview_HWND item_idx text</highlight-nsis> | ||
Inserts a new item to a listview (report view). | Inserts a new item to a listview (report view). | ||
* ${NSD_LV_SetSubItem} listview_HWND item_idx subitem_idx text | * <highlight-nsis>${NSD_LV_SetSubItem} listview_HWND item_idx subitem_idx text</highlight-nsis> | ||
Inserts a new subitem to an item of listview (report view). | Inserts a new subitem to an item of listview (report view). | ||
* ${NSD_LV_SetItemIcon} listview_HWND item_idx icon_idx | * <highlight-nsis>${NSD_LV_SetItemIcon} listview_HWND item_idx icon_idx</highlight-nsis> | ||
Sets the icon of an item of listview (report view). | Sets the icon of an item of listview (report view). | ||
* ${NSD_LV_SetItemChecked} listview_HWND item_idx | * <highlight-nsis>${NSD_LV_SetItemChecked} listview_HWND item_idx</highlight-nsis> | ||
Checks an item of a listview with checkboxes extended style. | Checks an item of a listview with checkboxes extended style. | ||
* ${NSD_LV_GetItemText} listview_HWND item_idx subitem_idx output_var | * <highlight-nsis>${NSD_LV_GetItemText} listview_HWND item_idx subitem_idx output_var</highlight-nsis> | ||
Retrieves the text of an item of a listview. | Retrieves the text of an item of a listview. | ||
Revision as of 08:06, 2 July 2010
Header file for creating Listview control
In an NSIS forum "dreams8.com", a member named "gfm688" writes a header file to create and handle a listview control with the report view. This header file is modified by me, I add some new macro commands.
See the attachment for details, 8 examples included.
ListView.zip (328 KB)
There are some macro commands in this file:
${NSD_RemoveStyle} control_HWND style
Removes one or more window style from a control.
${NSD_RemoveExStyle} control_HWND style
Removes one or more extended window style from a control.
${NSD_CB_DelString} combo_HWND string
Deletes the specified string from a combobox.
${NSD_CB_Clear} combo_HWND
Deletes all strings from a combobox (no return value).
${NSD_CB_GetCount} combo_HWND output_var
Retrieves the number of strings from a combobox.
${NSD_CB_GetSelection} combo_HWND output_var
Retrieves the selected string from a combobox.
${NSD_LB_DelString} listbox_HWND string # the redefined one
Deletes the specified string from a list box. The macro command NSD_LB_DelString in nsDialogs.nsh always deletes the first string but not the specified one. I write a new macro to replace it, and undefine the original one in this file.
${NSD_LB_Clear} listbox_HWND # the redefined one
Deletes all strings from a list box (no return value). The macro command NSD_LB_Clear in nsDialogs.nsh needs two parameters, but the readme file of nsDialogs said the macro needs only one parameter, it is exactly the handle of the listbox. This macro is redefined as the above one, it doesn't return a value.
${NSD_LV_InsertColumn} listview_HWND col_idx col_w text
Inserts a new column to a listview (report view).
${NSD_LV_InsertItem} listview_HWND item_idx text
Inserts a new item to a listview (report view).
${NSD_LV_SetSubItem} listview_HWND item_idx subitem_idx text
Inserts a new subitem to an item of listview (report view).
${NSD_LV_SetItemIcon} listview_HWND item_idx icon_idx
Sets the icon of an item of listview (report view).
${NSD_LV_SetItemChecked} listview_HWND item_idx
Checks an item of a listview with checkboxes extended style.
${NSD_LV_GetItemText} listview_HWND item_idx subitem_idx output_var
Retrieves the text of an item of a listview.