DoMethod(txtObiekt, MUIM_Set, MUIA_Text_Contents, "tekst");
SAVEDS ULONG mChangeText(struct IClass *cl, Object *obj, Msg msg)
{
/* zamiana na wielkie litery */
return (DoSuperMethodA(cl, obj, msg));
}@Kamul, post #1
@Kamul, post #1
SAVEDS ULONG mChangeText(struct IClass *cl, Object *obj, struct opSet *msg)
{
STRPTR text;
text = (STRPTR)GetTagData(MUIA_Text_Contents, 0, msg->ops_AttrList);
if (text) ZmianaLiter(text);
return (DoSuperMethodA(cl, obj, (Msg)msg));
}@smith, post #3
@kiero, post #5
@szuler, post #6
@kiero, post #2
DISPATCHER(TestClass)
{
switch (msg->MethodID)
{
case MUIM_Set: return (mChangeText(cl, obj, (APTR) msg));
}
return (DoSuperMethodA (cl, obj, (APTR) msg));
}
DISPATCHER_ENDmccExtendedClip = MUI_CreateCustomClass(NULL, "Text.mui" /*MUIC_Text*/, NULL, 0, DISPATCHER_REF(ExtendedClipClass))
struct Data { char str[100]; };
SAVEDS ULONG mChangeText(struct IClass *cl, Object *obj, struct opSet *msg)
{
struct Data *data;
STRPTR text;
data = INST_DATA(cl, obj);
if (text = (STRPTR) GetTagData(MUIA_Text_Contents, 0, msg->ops_AttrList))
{
strcpy (data->str, "nowy_tekst");
text = data->str;
}
return (DoSuperMethodA(cl, obj, (Msg) msg));
}struct Data { STRPTR str; };
SAVEDS ULONG mNew(struct IClass *cl, Object *obj, Msg msg)
{
struct Data *data;
if (!(obj = (Object *) DoSuperMethodA(cl, obj, msg)))
return (0);
data = INST_DATA(cl, obj);
if (data->str = AllocVec(100, MEMF_ANY))
return ((ULONG) obj);
else
return (0);
}
SAVEDS ULONG mDispose (struct IClass *cl, Object *obj, Msg msg)
{
struct Data *data;
data = INST_DATA(cl, obj);
if (data->str) FreeVec(data->str);
return (DoSuperMethodA(cl, obj, msg));
} @Kamul, post #8
SAVEDS ULONG mShowExtendedText(struct IClass *cl, Object *obj, struct opSet *msg)
{
struct Data *data;
struct TagItem *tag = FindTagItem(MUIA_Text_Contents, msg->ops_AttrList);
if (tag)
{
data = INST_DATA(cl, obj);
strncpy (data->str, (STRPTR) tag->ti_Data, 90);
strcat(data->str, "->dodatek");
tag->ti_Data = (ULONG) data->str;
}
return (DoSuperMethodA(cl, obj, (Msg) msg));
}@Kamul, post #8
@Kamul, post #9
@Kamul, post #9
@Grzegorz Kraszewski, post #10
@kiero, post #11
@Kaczus, post #12
@Kamul, post #14
@asman, post #18
strncpy (data->str, (STRPTR) tag->ti_Data, 90); strcat(data->str, "->dodatek");