list.c File Reference

Implementation of the List functions. More...

#include "list.h"
#include "component.h"

Include dependency graph for list.c:

Go to the source code of this file.

Functions

void addListItem (List *list, const char *item, jint pos)
 Adds an item to the List.
ItemListener addListItemListener (List *list, void(*func)(Component, jboolean, const char *))
 Adds an ItemListener for the List to call back the specified function.
void createList_ (List *list, jint rows)
 Creates the List by getting the Java List-Class, the method ids and createing a new Java List-Object.
void createListC (List_ *list, jint rows)
 Function is called when working with C and calling the function createList.
void createListCPP (ListCPP_ *list, jint rows)
 Function is called when working with C++ and calling the function createList.
void deleteList_ (List *list)
 Deletes the List by deleting the global references.
void deleteListC (List_ *list)
 Function is called when working with C and calling the function deleteList.
void deleteListCPP (ListCPP_ *list)
 Function is called when working with C++ and calling the function deleteList.
void deselectListItem (List *list, jint item)
 Deselects the item at the specified position from the List.
jint getListHeight (List *list)
 Gets the height of the List.
char * getListItem (List *list, jint pos)
 Gets rows of the List.
jint getListItemCount (List *list)
 Gets the number of items in the List.
jobject getListObject (List *list)
 Gets the reference to the java list object.
jint getListRows (List *list)
 Gets rows of the List.
jint getListSelectedIndex (List *list)
 Gets index of the selected item in the List, if the list is not in mulpitple mode.
jint getListWidth (List *list)
 Gets the width of the List.
jint getListX (List *list)
 Gets the X-Pos of the List.
jint getListY (List *list)
 Gets the Y-Pos of the List.
void initList_ (List_ *list)
 Initializes the List_ structure by setting the function pointers.
jboolean isListMultipleMode (List *list)
 Gets if multiple selection is allowed or not for the List.
jboolean isListSelected (List *list, jint item)
 Gets if the item at the specified position of the List is selected.
void removeListAll (List *list)
 Removes the item at the specified position from the List.
void removeListItem (List *list, const char *item)
 Removes the first occurence of the item from the List.
void removeListItemAtPos (List *list, jint pos)
 Removes the item at the specified position from the List.
void removeListItemListener (List *list, ItemListener il)
 Removes an ItemListener from the List and deletes the global reference to the ItemListener.
void replaceListItem (List *list, const char *item, jint pos)
 Replaces an item in the List.
void selectListItem (List *list, jint item)
 Selects the item at the specified position from the List.
void setListLocation (List *list, jint x, jint y)
 Sets the location of the List.
void setListMultipleMode (List *list, jboolean multiple)
 Sets if multiple selection is allowed or not for the List.
void setListSize (List *list, jint width, jint height)
 Sets Size of the List.


Detailed Description

Implementation of the List functions.

A List represents a list of values where the user can either choose only one or multiple values.

Author:
Stefan Gruber
Date:
03.02.2005

Definition in file list.c.


Function Documentation

void addListItem List list,
const char *  item,
jint  pos
 

Adds an item to the List.

Parameters:
list - Pointer to the list.
item - The item to add.
pos - The position to add the item to. Smaller than zero means at the end!
See also:
removeListItem(List* list, const char* item)

removeListItemAtPos(List* list, jint pos)

Definition at line 151 of file list.c.

ItemListener addListItemListener List list,
void(*)(Component, jboolean, const char *)  func
 

Adds an ItemListener for the List to call back the specified function.

For more information see: addItemListener

Parameters:
list - The List to add the listener to.
func - The function to call back.
Returns:
the created ItemListener object.
See also:
removeListItemListener(List* list, ItemListener il)

Definition at line 246 of file list.c.

void createList_ List list,
jint  rows
 

Creates the List by getting the Java List-Class, the method ids and createing a new Java List-Object.

Parameters:
list - The List to create.
rows - The number of rows to be visible.

Definition at line 362 of file list.c.

void createListC List_ list,
jint  rows
 

Function is called when working with C and calling the function createList.

It initializes the List_ structure.

Parameters:
list - A pointer to a List_ structure.
rows - The number of rows to be visible.

Definition at line 402 of file list.c.

void createListCPP ListCPP_ list,
jint  rows
 

Function is called when working with C++ and calling the function createList.

It initializes the ListCPP_ structure.

Parameters:
list - A pointer to a ListCPP_ structure.
rows - The number of rows to be visible.

Definition at line 389 of file list.c.

void deleteList_ List list  ) 
 

Deletes the List by deleting the global references.

Parameters:
list - A pointer to a list.

Definition at line 412 of file list.c.

void deleteListC List_ list  ) 
 

Function is called when working with C and calling the function deleteList.

Parameters:
list - A pointer to a List_ structure.

Definition at line 432 of file list.c.

void deleteListCPP ListCPP_ list  ) 
 

Function is called when working with C++ and calling the function deleteList.

Parameters:
list - A pointer to a ListCPP_ structure.

Definition at line 422 of file list.c.

void deselectListItem List list,
jint  item
 

Deselects the item at the specified position from the List.

Parameters:
list - Pointer to the list.
item - The index of the item to deselect.
See also:
selectListItem(List* list, jint item)

Definition at line 283 of file list.c.

jint getListHeight List list  ) 
 

Gets the height of the List.

Parameters:
list - Pointer to the list.
Returns:
the current height of the List.
See also:
setListSize(List* list, jint width, jint height)

getListWidth(List* list)

Definition at line 67 of file list.c.

char* getListItem List list,
jint  pos
 

Gets rows of the List.

Parameters:
list - Pointer to the list.
pos - Position of the item to return.
Returns:
the item at the position.

Definition at line 134 of file list.c.

jint getListItemCount List list  ) 
 

Gets the number of items in the List.

Parameters:
list - Pointer to the list.
Returns:
the number of items.

Definition at line 220 of file list.c.

jobject getListObject List list  ) 
 

Gets the reference to the java list object.

Parameters:
list - Pointer to the list.
Returns:
the list object reference.

Definition at line 25 of file list.c.

jint getListRows List list  ) 
 

Gets rows of the List.

Parameters:
list - Pointer to the list.
Returns:
the current count of columns of the list.
See also:
void setListRows(List* list, jint rows)

Definition at line 122 of file list.c.

jint getListSelectedIndex List list  ) 
 

Gets index of the selected item in the List, if the list is not in mulpitple mode.

Parameters:
list - Pointer to the list.
Returns:
the index of the selcted item, if no item is selected or in multiple mode -1.

Definition at line 231 of file list.c.

jint getListWidth List list  ) 
 

Gets the width of the List.

Parameters:
list - Pointer to the list.
Returns:
the current width of the List.
See also:
setListSize(List* list, jint width, jint height)

getListHeight(List* list)

Definition at line 53 of file list.c.

jint getListX List list  ) 
 

Gets the X-Pos of the List.

Parameters:
list - Pointer to the list.
Returns:
the current X-Pos of the list.
See also:
setListLocation(List* list, jint x, jint y)

getListY(List* list)

Definition at line 95 of file list.c.

jint getListY List list  ) 
 

Gets the Y-Pos of the List.

Parameters:
list - Pointer to the list.
Returns:
the current Y-Pos of the list.
See also:
setListLocation(List* list, jint x, jint y)

getListX(List* list)

Definition at line 109 of file list.c.

void initList_ List_ list  ) 
 

Initializes the List_ structure by setting the function pointers.

Parameters:
list - A pointer to a List_ structure.

Definition at line 329 of file list.c.

jboolean isListMultipleMode List list  ) 
 

Gets if multiple selection is allowed or not for the List.

Parameters:
list - Pointer to the list.
Returns:
JNI_TRUE if multiple selection is allowed, otherwies JNI_FALSE.
See also:
setListMultipleMode(List* list, jboolean multiple)

Definition at line 320 of file list.c.

jboolean isListSelected List list,
jint  item
 

Gets if the item at the specified position of the List is selected.

Parameters:
list - Pointer to the list.
item - The index of the item to deselect.
Returns:
JNI_TRUE if the item is selected, otherwise JNI_FALSE.

Definition at line 295 of file list.c.

void removeListAll List list  ) 
 

Removes the item at the specified position from the List.

Parameters:
list - Pointer to the list.
See also:
removeListItem(List* list, const char* item)

removeListItemAtPos(List* list, jint pos)

Definition at line 195 of file list.c.

void removeListItem List list,
const char *  item
 

Removes the first occurence of the item from the List.

Parameters:
list - Pointer to the list.
item - The item to remove.
See also:
removeListItem(List* list, const char* item)

addListItem(List* list, const char* item, jint pos)

Definition at line 166 of file list.c.

void removeListItemAtPos List list,
jint  pos
 

Removes the item at the specified position from the List.

Parameters:
list - Pointer to the list.
pos - The position of the item to remove.
See also:
removeListItem(List* list, const char* item)

addListItem(List* list, const char* item, jint pos)

Definition at line 182 of file list.c.

void removeListItemListener List list,
ItemListener  il
 

Removes an ItemListener from the List and deletes the global reference to the ItemListener.

Parameters:
list - The List to remove the listener from.
il - The ItemListener to remove.
See also:
addListItemListener(List* list, void (*func)(Component, jboolean, const char*))

Definition at line 259 of file list.c.

void replaceListItem List list,
const char *  item,
jint  pos
 

Replaces an item in the List.

Parameters:
list - Pointer to the list.
item - The new item.
pos - The position of the old item!

Definition at line 206 of file list.c.

void selectListItem List list,
jint  item
 

Selects the item at the specified position from the List.

Parameters:
list - Pointer to the list.
item - The index of the item to select.
See also:
deselectListItem(List* list, jint item)

Definition at line 271 of file list.c.

void setListLocation List list,
jint  x,
jint  y
 

Sets the location of the List.

Parameters:
list - Pointer to the list.
x - New X-Pos.
y - New Y-Pos.
See also:
getListX(List* list)

getListY(List* list)

Definition at line 81 of file list.c.

void setListMultipleMode List list,
jboolean  multiple
 

Sets if multiple selection is allowed or not for the List.

Parameters:
list - Pointer to the list.
multiple - JNI_TRUE or JNI_FALSE.
See also:
isListMultipleMode(List* list)

Definition at line 307 of file list.c.

void setListSize List list,
jint  width,
jint  height
 

Sets Size of the List.

Parameters:
list - Pointer to the list.
width - New width.
height - New height.
See also:
getListWidth(List* list)

getListHeight(List* list)

Definition at line 39 of file list.c.


Generated on Sat Nov 19 14:11:13 2005 for GrubC by  doxygen 1.4.4