Commit e6fd0bcd authored by Andrew Hodgkinson's avatar Andrew Hodgkinson
Browse files

Added ScrollList_CountItems method. Supported in TextGadgets 0.15 or later...

Added ScrollList_CountItems method. Supported in TextGadgets 0.15 or later (TextGadgets is currently in Sources/Apps/Java/Gadgets).

Version 0.04. Tagged as 'Libs-0_04'
parent 00ae872f
/* (0.03) /* (0.04)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* *
*/ */
#define Module_MajorVersion_CMHG 0.03 #define Module_MajorVersion_CMHG 0.04
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Feb 1999 #define Module_Date_CMHG 26 Mar 1999
#define Module_MajorVersion "0.03" #define Module_MajorVersion "0.04"
#define Module_Version 3 #define Module_Version 4
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "16 Feb 1999" #define Module_Date "26 Mar 1999"
No preview for this file type
...@@ -53,13 +53,18 @@ ...@@ -53,13 +53,18 @@
* ScrollList Templates * * ScrollList Templates *
****************************************************************************/ ****************************************************************************/
/*-- flags --*/ /*-- gadget flags --*/
#define ScrollList_SingleSelections 0x00000000 #define ScrollList_SingleSelections 0x00000000
#define ScrollList_MultipleSelections 0x00000001 #define ScrollList_MultipleSelections 0x00000001
#define ScrollListValidFlags 0xC0000001 #define ScrollListValidFlags 0xC0000001
/*-- method flags for select_item, deselect_item, delete_items --*/
#define ScrollList_SelectionChangingMethod_SendEvent (1u<<0)
#define ScrollList_SelectionChangingMethod_OnAll (1u<<1)
/*-- templates --*/ /*-- templates --*/
typedef struct typedef struct
...@@ -89,6 +94,7 @@ typedef struct ...@@ -89,6 +94,7 @@ typedef struct
#define ScrollList_GetColour (ScrollList_Base + 9) #define ScrollList_GetColour (ScrollList_Base + 9)
#define ScrollList_SetFont (ScrollList_Base + 10) #define ScrollList_SetFont (ScrollList_Base + 10)
#define ScrollList_GetItemText (ScrollList_Base + 11) #define ScrollList_GetItemText (ScrollList_Base + 11)
#define ScrollList_CountItems (ScrollList_Base + 12)
/*-- ScrollList button events --*/ /*-- ScrollList button events --*/
...@@ -133,6 +139,18 @@ typedef struct ...@@ -133,6 +139,18 @@ typedef struct
* int index * int index
* Out : None * Out : None
* Returns : pointer to error block * Returns : pointer to error block
*
* To receive a ScrollList_Selection event indicating the item that
* was selected with any mouse button related flags cleared, set the
* ScrollList_SelectionChangingMethod_SendEvent bit of the flags.
* This will be sent even if the item you specify was already
* selected before the function call was made.
*
* To select all items, call with the flags bit
* ScrollList_SelectionChangingMethod_OnAll set. In this case, the
* value set in 'index' is irrelevant. If using the flags to get a
* ScrollList_Selection event as well (see above), the item number
* in the event will be zero.
*/ */
extern _kernel_oserror *scrolllist_select_item ( unsigned int flags, extern _kernel_oserror *scrolllist_select_item ( unsigned int flags,
...@@ -295,6 +313,12 @@ extern _kernel_oserror *scrolllist_add_item ( unsigned int flags, ...@@ -295,6 +313,12 @@ extern _kernel_oserror *scrolllist_add_item ( unsigned int flags,
* int end * int end
* Out : None * Out : None
* Returns : pointer to error block * Returns : pointer to error block
*
* To be sent a ScrollList_Selection event after the function completes,
* set the ScrollList_SelectionChangingMethod_SendEvent bit of the flags.
* The event you receive merely notifies you of completion; the actual
* selection may not have changed. Note that an item number of '-1' will
* be present in the event received.
*/ */
extern _kernel_oserror *scrolllist_delete_items ( unsigned int flags, extern _kernel_oserror *scrolllist_delete_items ( unsigned int flags,
...@@ -351,6 +375,16 @@ extern _kernel_oserror *scrolllist_make_visible ( unsigned int flags, ...@@ -351,6 +375,16 @@ extern _kernel_oserror *scrolllist_make_visible ( unsigned int flags,
* int index * int index
* Out : None * Out : None
* Returns : pointer to error block * Returns : pointer to error block
*
* To receive a ScrollList_Selection event indicating the item that
* was deselected with any mouse button related flags cleared, set the
* ScrollList_SelectionChangingMethod_SendEvent bit of the flags. This
* will be sent even if the item you specify was already deselected
* before the function call was made.
*
* To deselect all items, call with the flags bit
* ScrollList_SelectionChangingMethod_OnAll set. In this case, the value
* given in 'index' is irrelevant.
*/ */
extern _kernel_oserror *scrolllist_deselect_item ( unsigned int flags, extern _kernel_oserror *scrolllist_deselect_item ( unsigned int flags,
...@@ -360,6 +394,23 @@ extern _kernel_oserror *scrolllist_deselect_item ( unsigned int flags, ...@@ -360,6 +394,23 @@ extern _kernel_oserror *scrolllist_deselect_item ( unsigned int flags,
); );
/*
* Name : scrolllist_count_items
* Description : Returns the number of items in the scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* unsigned int *items
* Out : None
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_count_items ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int *items
);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
/* Copyright 1999 Element 14 Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/************************************************************************
* © Acorn Computers Ltd, 1994. *
* *
* It may be freely used to create executable images for saleable *
* products but cannot be sold in source form or as an object library *
* without the prior written consent of Acorn Computers Ltd. *
* *
* If this file is re-distributed (even if modified) it should retain *
* this copyright notice. *
* *
************************************************************************/
/*
* Name : countitems.c
* Purpose : Veneer for method ScrollList_CountItems
* Description : Returns the number of items in the scrolllist
*/
#include "kernel.h"
#include "toolbox.h"
#include "gadgets.h"
#include "ScrollList.h"
/*
* Name : scrolllist_count_items
* Description : Returns the number of items in the scrolllist
* In : unsigned int flags
* ObjectId window
* ComponentId scrolllist
* Out : unsigned int *items
* Returns : pointer to error block
*/
extern _kernel_oserror *scrolllist_count_items ( unsigned int flags,
ObjectId window,
ComponentId scrolllist,
unsigned int *items
)
{
_kernel_swi_regs r;
_kernel_oserror *e;
r.r[0] = flags;
r.r[1] = (int) window;
r.r[2] = ScrollList_CountItems;
r.r[3] = (int) scrolllist;
if((e = _kernel_swi(Toolbox_ObjectMiscOp,&r,&r)) == NULL)
{
if(items != NULL) *items = (unsigned int) r.r[0];
}
return(e);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment