choice.c File Reference

Implementation of the Choice functions. More...

#include "choice.h"
#include "component.h"

Include dependency graph for choice.c:

Go to the source code of this file.

Functions

void addChoiceItem (Choice *choice, const char *item)
 Adds an item to the Choice.
ItemListener addChoiceItemListener (Choice *choice, void(*func)(Component, jboolean, const char *))
 Adds an ItemListener for the Choice to call back the specified function.
void createChoice_ (Choice *choice)
 Creates the Choice by getting the Java Choice-Class, the method ids and createing a new Java Choice-Object.
void createChoiceC (Choice_ *choice)
 Function is called when working with C and calling the function createChoice.
void createChoiceCPP (ChoiceCPP_ *choice)
 Function is called when working with C++ and calling the function createChoice.
void deleteChoice_ (Choice *choice)
 Deletes the Choice by deleting the global references.
void deleteChoiceC (Choice_ *choice)
 Function is called when working with C and calling the function deleteChoice.
void deleteChoiceCPP (ChoiceCPP_ *choice)
 Function is called when working with C++ and calling the function deleteChoice.
jint getChoiceHeight (Choice *choice)
 Gets the height of the Choice.
char * getChoiceItem (Choice *choice, jint pos)
 Gets the item at the position of the Choice.
jint getChoiceItemCount (Choice *choice)
 Gets the number of items in the Choice.
jobject getChoiceObject (Choice *choice)
 Gets the reference to the java choice object.
jint getChoiceSelectedIndex (Choice *choice)
 Gets index of the selected item in the Choice, if the choice is not in mulpitple mode.
jint getChoiceWidth (Choice *choice)
 Gets the width of the Choice.
jint getChoiceX (Choice *choice)
 Gets the X-Pos of the Choice.
jint getChoiceY (Choice *choice)
 Gets the Y-Pos of the Choice.
void initChoice_ (Choice_ *choice)
 Initializes the Choice_ structure by setting the function pointers.
void removeChoiceAll (Choice *choice)
 Removes the item at the specified position from the Choice.
void removeChoiceItem (Choice *choice, const char *item)
 Removes the first occurence of the item from the Choice.
void removeChoiceItemAtPos (Choice *choice, jint pos)
 Removes the item at the specified position from the Choice.
void removeChoiceItemListener (Choice *choice, ItemListener il)
 Removes an ItemListener from the Choice and deletes the global reference to the ItemListener.
void selectChoiceItem (Choice *choice, jint item)
 Selects the item at the specified position from the Choice.
void setChoiceLocation (Choice *choice, jint x, jint y)
 Sets the location of the Choice.
void setChoiceSize (Choice *choice, jint width, jint height)
 Sets Size of the Choice.


Detailed Description

Implementation of the Choice functions.

A Choice represents a popup-menu of values. You can choose only one of these values which will be displayed permanently.

Author:
Stefan Gruber
Date:
18.02.2005

Definition in file choice.c.


Function Documentation

void addChoiceItem Choice choice,
const char *  item
 

Adds an item to the Choice.

Parameters:
choice - Pointer to the choice.
item - The item to add.
See also:
removeChoiceItem(Choice* choice, const char* item)

removeChoiceItemAtPos(Choice* choice, jint pos)

Definition at line 137 of file choice.c.

ItemListener addChoiceItemListener Choice choice,
void(*)(Component, jboolean, const char *)  func
 

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

For more information see: addItemListener

Parameters:
choice - The Choice to add the choiceener to.
func - The function to call back.
Returns:
the created ItemListener object.
See also:
removeChoiceItemListener(Choice* choice, ItemListener il)

Definition at line 218 of file choice.c.

void createChoice_ Choice choice  ) 
 

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

Parameters:
choice - The Choice to create.

Definition at line 278 of file choice.c.

void createChoiceC Choice_ choice  ) 
 

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

It initializes the Choice_ structure.

Parameters:
choice - A pointer to a Choice_ structure.

Definition at line 310 of file choice.c.

void createChoiceCPP ChoiceCPP_ choice  ) 
 

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

It initializes the ChoiceCPP_ structure.

Parameters:
choice - A pointer to a ChoiceCPP_ structure.

Definition at line 298 of file choice.c.

void deleteChoice_ Choice choice  ) 
 

Deletes the Choice by deleting the global references.

Parameters:
choice - A pointer to a choice.

Definition at line 320 of file choice.c.

void deleteChoiceC Choice_ choice  ) 
 

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

Parameters:
choice - A pointer to a Choice_ structure.

Definition at line 340 of file choice.c.

void deleteChoiceCPP ChoiceCPP_ choice  ) 
 

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

Parameters:
choice - A pointer to a ChoiceCPP_ structure.

Definition at line 330 of file choice.c.

jint getChoiceHeight Choice choice  ) 
 

Gets the height of the Choice.

Parameters:
choice - Pointer to the choice.
Returns:
the current height of the Choice.
See also:
setChoiceSize(Choice* choice, jint width, jint height)

getChoiceWidth(Choice* choice)

Definition at line 67 of file choice.c.

char* getChoiceItem Choice choice,
jint  pos
 

Gets the item at the position of the Choice.

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

Definition at line 121 of file choice.c.

jint getChoiceItemCount Choice choice  ) 
 

Gets the number of items in the Choice.

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

Definition at line 192 of file choice.c.

jobject getChoiceObject Choice choice  ) 
 

Gets the reference to the java choice object.

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

Definition at line 25 of file choice.c.

jint getChoiceSelectedIndex Choice choice  ) 
 

Gets index of the selected item in the Choice, if the choice is not in mulpitple mode.

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

Definition at line 203 of file choice.c.

jint getChoiceWidth Choice choice  ) 
 

Gets the width of the Choice.

Parameters:
choice - Pointer to the choice.
Returns:
the current width of the Choice.
See also:
setChoiceSize(Choice* choice, jint width, jint height)

getChoiceHeight(Choice* choice)

Definition at line 53 of file choice.c.

jint getChoiceX Choice choice  ) 
 

Gets the X-Pos of the Choice.

Parameters:
choice - Pointer to the choice.
Returns:
the current X-Pos of the choice.
See also:
setChoiceLocation(Choice* choice, jint x, jint y)

getChoiceY(Choice* choice)

Definition at line 95 of file choice.c.

jint getChoiceY Choice choice  ) 
 

Gets the Y-Pos of the Choice.

Parameters:
choice - Pointer to the choice.
Returns:
the current Y-Pos of the choice.
See also:
setChoiceLocation(Choice* choice, jint x, jint y)

getChoiceX(Choice* choice)

Definition at line 109 of file choice.c.

void initChoice_ Choice_ choice  ) 
 

Initializes the Choice_ structure by setting the function pointers.

Parameters:
choice - A pointer to a Choice_ structure.

Definition at line 252 of file choice.c.

void removeChoiceAll Choice choice  ) 
 

Removes the item at the specified position from the Choice.

Parameters:
choice - Pointer to the choice.
See also:
removeChoiceItem(Choice* choice, const char* item)

removeChoiceItemAtPos(Choice* choice, jint pos)

Definition at line 181 of file choice.c.

void removeChoiceItem Choice choice,
const char *  item
 

Removes the first occurence of the item from the Choice.

Parameters:
choice - Pointer to the choice.
item - The item to remove.
See also:
removeChoiceItem(Choice* choice, const char* item)

addChoiceItem(Choice* choice, const char* item, jint pos)

Definition at line 152 of file choice.c.

void removeChoiceItemAtPos Choice choice,
jint  pos
 

Removes the item at the specified position from the Choice.

Parameters:
choice - Pointer to the choice.
pos - The position of the item to remove.
See also:
removeChoiceItem(Choice* choice, const char* item)

addChoiceItem(Choice* choice, const char* item, jint pos)

Definition at line 168 of file choice.c.

void removeChoiceItemListener Choice choice,
ItemListener  il
 

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

Parameters:
choice - The Button to remove the choiceener from.
il - The ItemListener to remove.
See also:
addChoiceItemListener(Choice* choice, void (*func)(Component, jboolean, const char*))

Definition at line 231 of file choice.c.

void selectChoiceItem Choice choice,
jint  item
 

Selects the item at the specified position from the Choice.

Parameters:
choice - Pointer to the choice.
item - The index of the item to select.
See also:
deselectChoiceItem(Choice* choice, jint item)

Definition at line 243 of file choice.c.

void setChoiceLocation Choice choice,
jint  x,
jint  y
 

Sets the location of the Choice.

Parameters:
choice - Pointer to the choice.
x - New X-Pos.
y - New Y-Pos.
See also:
getChoiceX(Choice* choice)

getChoiceY(Choice* choice)

Definition at line 81 of file choice.c.

void setChoiceSize Choice choice,
jint  width,
jint  height
 

Sets Size of the Choice.

Parameters:
choice - Pointer to the choice.
width - New width.
height - New height.
See also:
getChoiceWidth(Choice* choice)

getChoiceHeight(Choice* choice)

Definition at line 39 of file choice.c.


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