From ad359e8ac553de1fea783e8d01020e85ba3dbeda Mon Sep 17 00:00:00 2001 From: mazze Date: Wed, 10 Sep 2014 21:58:53 +0000 Subject: [PATCH] Floattext.mui: implemented MUI4 method MUIM_Floattext_Append. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@49607 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/libs/muimaster/classes/floattext.c | 35 +++++++++++++++++++++++++ workbench/libs/muimaster/classes/floattext.conf | 5 ++-- workbench/libs/muimaster/classes/floattext.h | 12 ++++++++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/workbench/libs/muimaster/classes/floattext.c b/workbench/libs/muimaster/classes/floattext.c index 946c74563b..1b77ff114c 100644 --- a/workbench/libs/muimaster/classes/floattext.c +++ b/workbench/libs/muimaster/classes/floattext.c @@ -552,6 +552,39 @@ IPTR Floattext__MUIM_Draw(struct IClass *cl, Object *obj, return 0; } +/************************************************************************** + MUIM_Floattext_Append +**************************************************************************/ +IPTR Floattext__MUIM_Floattext_Append(struct IClass *cl, Object *obj, + struct MUIP_Floattext_Append *msg) +{ + struct Floattext_DATA *data = INST_DATA(cl, obj); + + if (msg->Text) + { + ULONG newlen = strlen(msg->Text) + 1; + if (data->text) + { + newlen += strlen(data->text); + } + TEXT *newtext = AllocVec(newlen, MEMF_ANY); + if (newtext) + { + newtext[0] = '\0'; + if (data->text) + { + strcpy(newtext, data->text); + } + strcat(newtext, msg->Text); + FreeVec(data->text); + data->text = newtext; + SetText(obj, data); + } + } + + return 0; +} + #if ZUNE_BUILTIN_FLOATTEXT BOOPSI_DISPATCHER(IPTR, Floattext_Dispatcher, cl, obj, msg) { @@ -567,6 +600,8 @@ BOOPSI_DISPATCHER(IPTR, Floattext_Dispatcher, cl, obj, msg) return Floattext__OM_SET(cl, obj, msg); case MUIM_Draw: return Floattext__MUIM_Draw(cl, obj, (struct MUIP_Draw *)msg); + case MUIM_Floattext_Append: + return Floattext__MUIM_Floattext_Append(cl, obj, (struct MUIP_Floattext_Append *)msg); default: return DoSuperMethodA(cl, obj, msg); diff --git a/workbench/libs/muimaster/classes/floattext.conf b/workbench/libs/muimaster/classes/floattext.conf index b08bc5e01d..e33498599a 100644 --- a/workbench/libs/muimaster/classes/floattext.conf +++ b/workbench/libs/muimaster/classes/floattext.conf @@ -1,7 +1,7 @@ ##begin config basename Floattext -version 0.4 -date 17.4.2013 +version 0.5 +date 10.9.2014 superclass MUIC_List classdatatype struct Floattext_DATA ##end config @@ -20,4 +20,5 @@ OM_DISPOSE OM_GET OM_SET MUIM_Draw +MUIM_Floattext_Append ##end methodlist diff --git a/workbench/libs/muimaster/classes/floattext.h b/workbench/libs/muimaster/classes/floattext.h index bb43e960b1..71d54e65a7 100644 --- a/workbench/libs/muimaster/classes/floattext.h +++ b/workbench/libs/muimaster/classes/floattext.h @@ -2,7 +2,7 @@ #define _MUI_CLASSES_FLOATTEXT_H /* - Copyright © 2002-2013, The AROS Development Team. All rights reserved. + Copyright © 2002-2014, The AROS Development Team. All rights reserved. $Id$ */ @@ -12,6 +12,16 @@ /*** Identifier base (for Zune extensions) **********************************/ #define MUIB_Floattext (MUIB_ZUNE | 0x00001500) +/*** Methods ****************************************************************/ +#define MUIM_Floattext_Append \ + (MUIB_MUI | 0x0042a221) /* MUI: V20 */ + +struct MUIP_Floattext_Append +{ + STACKED ULONG MethodID; + STACKED CONST_STRPTR Text; +}; + /*** Attributes *************************************************************/ #define MUIA_Floattext_Justify \ (MUIB_MUI | 0x0042dc03) /* MUI: V4 isg BOOL */ -- 2.11.4.GIT