Commit b9a1e9f1 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

* Event generation for ScrollList fixed - you no longer get spurious events...

* Event generation for ScrollList fixed - you no longer get spurious events for a phantom extra item on the list.

* Flag added to ScrollList_Selection event to indicate adjust click.
* Fixed un-initialised base_line variable causing text of ScrollList
  items to disappear when the desktop font was the System font.

Version 0.10, 1.1.2.2. Tagged as 'Gadgets-0_10-1_1_2_2'
parent 418b7076
| Copyright 1997 Acorn Computers 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.
|
Dir <Obey$Dir>
amu_machine clean
| Copyright 1998 Acorn Computers 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.
|
Dir <Obey$Dir>
amu_machine all
| Copyright 1997 Acorn Computers 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.
|
Dir <Obey$Dir>
amu_machine rom
# Makefile for TextGadget
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 12/5/97 RLougher Created
#
#
# Component specific options:
#
COMPONENT = TextGadget
RAM_MODULE = ${COMPONENT}
#
# Generic options:
#
MKDIR = cdir
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
WIPE = -wipe
ASM = objasm
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c ${INCLUDES} -zM -fnah
INCLUDES = -Itbox:,C:
#
# Libraries
#
ANSILIB = CLib:o.ansilib
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.c_abssym
TBOXLIB = tbox:o.toolboxlib
WIMPLIB = tbox:o.wimplib
OBJS =\
o.Modhdr \
o.TextGadget \
o.TextArea \
o.ScrollList \
o.Scrollbar \
o.riscos_uti \
o.riscos_gra \
o.Font \
o.debug \
o.TextMan \
o.MemMan \
o.Text \
o.ScrollLisS \
o.Utils \
o.TAsel_ven \
o.glib \
o.glib3 \
o.rmensure \
o.string32
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -o $@ $<
.s.o:; $(ASM) $< $@
#
# Main rules:
#
#
ram: ${RAM_MODULE}
@echo ${COMPONENT}: Module built (RAM)
${RAM_MODULE}: ${OBJS} ${TBOXLIB} $(WIMPLIB) C:o.stubs
${LD} -rmf -o $@ -via objs ${TBOXLIB} $(WIMPLIB) C:o.stubs
#---------------------------------------------------------------------------
# Dynamic dependencies:
......@@ -19,14 +19,21 @@
# ***********************************
# Date Name Description
# ---- ---- -----------
# 12/5/97 RLougher Created
# 12/05/97 RLougher Created
# 04/06/98 SBrodie Added RAM build into same Makefile
#
#
# Component specific options:
#
COMPONENT = JavaGadget
COMPONENT = TextGadget
ROM_MODULE = aof.${COMPONENT}
RAM_MODULE = rm.${COMPONENT}
#
# Export Paths for Messages module
#
RESDIR = <resource$dir>.Resources2.${COMPONENT}
#
# Generic options:
......@@ -43,8 +50,8 @@ ASM = objasm
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
CFLAGS = -c ${INCLUDES} -zM -ffah -zps1
INCLUDES = -Itbox:,C:
CFLAGS = -c -depend !Depend ${INCLUDES} -zM -ffah -zps1 ${DFLAGS}
INCLUDES = -IC:tboxlibint,C:tboxlibs,C:
#
# Libraries
......@@ -54,8 +61,8 @@ CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.c_abssym
TBOXLIB = tbox:o.toolboxlib
WIMPLIB = tbox:o.wimplib
TBOXLIB = c:tboxlibs.o.toolboxlib
WIMPLIB = c:tboxlibs.o.wimplib
OBJS =\
o.Modhdr \
......@@ -77,17 +84,42 @@ OBJS =\
o.glib3 \
o.rmensure \
o.string32
RAM_OBJS =\
o.Modhdr \
o.TextGadget \
o.TextArea \
o.ScrollList \
o.Scrollbar \
o.riscos_uti \
o.riscos_gra \
o.Font \
o.debug \
o.TextMan \
o.MemMan \
o.Text \
o.ScrollLisS \
o.Utils \
o.TAsel_ven \
o.glib \
o.glib3 \
o.rmensure \
o.string32
#
# Rule patterns
#
.c.o:; ${CC} ${CFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -o $@ $<
.cmhg.o:; ${CMHG} -p -o $@ $<
.s.o:; $(ASM) $< $@
#
# Main rules:
#
#
all: ${RAM_MODULE}
@echo ${COMPONENT}: Module built (RAM)
rom: ${ROM_MODULE}
@echo ${COMPONENT}: Module built (ROM)
......@@ -106,6 +138,12 @@ ${ROM_MODULE}: ${OBJS} ${TBOXLIB} $(WIMPLIB) ${ROMCSTUBS}
${MKDIR} aof
${LD} -o $@ -aof ${OBJS} ${TBOXLIB} $(WIMPLIB) ${ROMCSTUBS}
${RAM_MODULE}: ${RAM_OBJS} ${TBOXLIB} ${WIMPLIB} ${CLIB}
${mkdir} rm
${LD} -o $@ -module ${RAM_OBJS} ${TBOXLIB} ${WIMPLIB} ${CLIB}
Access $@ RW/R
# final link for ROM Image (using given base address)
rom_link:
${MKDIR} linked
......
/* (0.09)
/* (0.10)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.09
#define Module_MinorVersion_CMHG $Revision$
#define Module_MajorVersion_CMHG 0.10
#define Module_MinorVersion_CMHG 1.1.2.2
#define Module_Date_CMHG 18 Jun 1998
#define Module_MajorVersion "0.09"
#define Module_Version 9
#define Module_MinorVersion "$Revision$"
#define Module_MajorVersion "0.10"
#define Module_Version 10
#define Module_MinorVersion "1.1.2.2"
#define Module_Date "18 Jun 1998"
......@@ -237,8 +237,14 @@ static unsigned int _get_height_of_entry(const PrivateScrollList *sdata,
return 0;
}
if (!font_handle)
if (!font_handle) {
// bug fix. SNB - 19980618: Must zero base_line otherwise when desktop font
// is the system font, all the text disappears because base_line remains
// uninitialised.
if (base_line)
*base_line = 0;
return 32;
}
_swix(Font_ReadInfo, _IN(0)|_OUT(2)|_OUT(4),
font_handle, &min, &max);
......@@ -1113,8 +1119,8 @@ _kernel_oserror *_scrolllist_redraw(const PrivateScrollList *sdata,
// Plot the text
_swix(Wimp_TextOp, _INR(0,5), 2 | 1<<30, sdata->entries[i].text,
-1, -1, block->visible_area.xmin + sprite_width +12,
y - base_line);
-1, -1, block->visible_area.xmin + sprite_width +12,
y - base_line);
}
else
{
......@@ -1182,9 +1188,10 @@ static _kernel_oserror *scrolllist_mclick(const PrivateScrollList *sdata,
}
}
// Send event
// Send event -
/* SNB: 19980518: changed condition to >= to stop "extra item" events. */
if (event.item > sdata->no_entries)
if (event.item >= sdata->no_entries)
return NULL;
event.hdr.size = sizeof(ScrollListSelectionEvent);
......@@ -1199,6 +1206,11 @@ static _kernel_oserror *scrolllist_mclick(const PrivateScrollList *sdata,
event.flags |= ScrollList_Selection_Flags_DoubleClick;
}
/* SNB: 19980618: added flagging of adjust clicks */
if (click->buttons & (1 | 256)) {
event.flags |= ScrollList_Selection_Flags_AdjustClick;
}
toolbox_raise_toolbox_event(0, sdata->parent_id, sdata->component_id,
(ToolboxEvent *) &event);
......
......@@ -22,9 +22,14 @@
; and force window to scroll. Changes to set_caret to
; allow invisibility.
; piers 30-01-98 0.09 Fixed dragging scrollbars (occasional div. by zero)
; sbrodie 04-06-98 0.10 Added extra flag to ScrollList selection event for adjust clicks
; plus switched to srccommit format.
#include "VersionNum"
; Copyright 1997 Acorn Computers Ltd
help-string: TextGadgets 0.09
help-string: TextGadgets Module_MajorVersion_CMHG Module_MinorVersion_CMHG
date-string: Module_Date_CMHG
; 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
......
......@@ -61,6 +61,8 @@ typedef struct
#define ScrollList_Selection_Flags_Set (1<<0)
#define ScrollList_Selection_Flags_DoubleClick (1<<1)
#define ScrollList_Selection_Flags_AdjustClick (1<<2)
typedef struct
{
ToolboxEventHeader hdr;
......
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