Jump to content

VSList: Difference between revisions

From EDM2
Created page with "A class to manipulate lists for [commands.htm#C_List <tt>C_List</tt>] controls. ==Synopsis== ; '''Header:''' : <tt><v/vslist.h></tt> ; '''Class name:''' : vSList ==Definition=..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
A class to manipulate lists for [commands.htm#C_List <tt>C_List</tt>] controls.
A class to manipulate lists for [commands#C_List] <tt>C_List</tt> controls.


==Synopsis==
==Synopsis==
 
;Header: <tt><v/vslist.h></tt>
; '''Header:'''
;Class name: vSList
: <tt><v/vslist.h></tt>
; '''Class name:'''
: vSList


==Definition==
==Definition==
<font size="-2"> </font>
   class vSList
   class vSList
       {
       {
Line 31: Line 24:


==Description==
==Description==
This class is provided to make manipulation of lists used in <tt>C_List</tt> controls easier. You can find some good example code in the VIDE.
This class is provided to make manipulation of lists used in <tt>C_List</tt> controls easier. You can find some good example code in the VIDE.


==Methods==
==Methods==
 
;vSList(int maxsize=128):You can specify in the constructor the maximum size of the list you will be working with. Someday I hope to fix this class so that it will grow the list as needed.
====vSList(int maxsize=128)====
;void erase():Erases the entire list. Deletes each item on the list, but leaves the space for <tt>list</tt> intact.
 
;int size():Returns the number of items on the list.
You can specify in the constructor the maximum size of the list you will be working with. Someday I hope to fix this class so that it will grow the list as needed.
;int insert(int insAt, char* strn):Inserts the string <tt>strn</tt> into the list at the point <tt>insAt</tt>. If <tt>insAt</tt> is less than zero, the item is appended to the end of the list.
 
;int replace(int repAt, char* strn):Replaces the item at <tt>repAt</tt> with the new <tt>strn</tt>.
====void erase()====
;int deleteItem(int delAt):Deletes the item at <tt>delAt</tt>.
 
;int max:This is the maximum size of the list.
Erases the entire list. Deletes each item on the list, but leaves the space for <tt>list</tt> intact.
;char** list:This is the actual list of pointers to the list strings. I suppose it really shouldn't be directly accessible, but it is.
 
====int size()====
 
Returns the number of items on the list.
 
====int insert(int insAt, char* strn)====
 
Inserts the string <tt>strn</tt> into the list at the point <tt>insAt</tt>. If <tt>insAt</tt> is less than zero, the item is appended to the end of the list.
 
====int replace(int repAt, char* strn)====
 
Replaces the item at <tt>repAt</tt> with the new <tt>strn</tt>.
 
====int deleteItem(int delAt)====
 
Deletes the item at <tt>delAt</tt>.
 
====int max====
 
This is the maximum size of the list.
 
====char** list====
 
This is the actual list of pointers to the list strings. I suppose it really shouldn't be directly accessible, but it is.


==Comments==
==Comments==


==See Also==
==See Also==
[[vDialog#SetValue|vDialog::SetValue]], [commands#C_List|C_List]


[vdialog.htm#SetValue vDialog::SetValue], [commands.htm#C_List C_List]
[[Category:V C++ GUI Framework]]
 
[[Category:Tools Articles]]

Latest revision as of 22:41, 9 April 2020

A class to manipulate lists for [commands#C_List] C_List controls.

Synopsis

Header
<v/vslist.h>
Class name
vSList

Definition

 class vSList
      {

      public:		//---------------------------------------- public
	vSList(int maxsize = 128);
	~vSList();

	void erase();
	int size();
	int insert(int insAt, char* strn);
	int replace(int repAt, char* strn);
	int deleteItem(int delAt);

	int max;
	char** list;
      };

Description

This class is provided to make manipulation of lists used in C_List controls easier. You can find some good example code in the VIDE.

Methods

vSList(int maxsize=128)
You can specify in the constructor the maximum size of the list you will be working with. Someday I hope to fix this class so that it will grow the list as needed.
void erase()
Erases the entire list. Deletes each item on the list, but leaves the space for list intact.
int size()
Returns the number of items on the list.
int insert(int insAt, char* strn)
Inserts the string strn into the list at the point insAt. If insAt is less than zero, the item is appended to the end of the list.
int replace(int repAt, char* strn)
Replaces the item at repAt with the new strn.
int deleteItem(int delAt)
Deletes the item at delAt.
int max
This is the maximum size of the list.
char** list
This is the actual list of pointers to the list strings. I suppose it really shouldn't be directly accessible, but it is.

Comments

See Also

vDialog::SetValue, [commands#C_List|C_List]