1 /**********************************************************************
2 text.datatype - (c) 2000 by Sebastian Bauer
4 This module is for testing the text.datatype engine
5 ***********************************************************************/
6 #include <datatypes/textclass.h>
8 #include <proto/exec.h>
9 #include <proto/intuition.h>
11 #include "textclass.h"
20 struct IntuiMessage
*imsg
;
21 while ((imsg
= (struct IntuiMessage
*) GetMsg(wnd
->UserPort
)))
35 ReplyMsg((struct Message
*) imsg
);
39 case IDCMP_CLOSEWINDOW
:
43 case IDCMP_VANILLAKEY
:
56 Text_SetVisibleTop(text
, Text_VisibleTop(text
) + 1);
60 Text_SetVisibleTop(text
, Text_VisibleTop(text
) - 1);
64 Text_SetVisibleLeft(text
, Text_VisibleHoriz(text
) + 1);
68 Text_SetVisibleLeft(text
, Text_VisibleHoriz(text
) - 1);
73 case IDCMP_MOUSEBUTTONS
:
74 if (code
== SELECTDOWN
)
75 Text_HandleMouse(text
, mx
, my
, SELECTDOWN
, secs
, mics
);
77 Text_HandleMouse(text
, mx
, my
, SELECTUP
, 0, 0);
81 Text_HandleMouse(text
, mx
, my
, 0, 0, 0);
90 ULONG wnd_mask
= 1L << wnd
->UserPort
->mp_SigBit
;
93 while ((ready
== FALSE
))
95 ULONG sigs
= Wait(wnd_mask
| 4096);
105 if ((scr
= LockPubScreen("Workbench")))
107 wnd
= OpenWindowTags(NULL
,
108 WA_Title
, "Textview",
109 WA_CloseGadget
, TRUE
,
111 WA_DepthGadget
, TRUE
,
114 WA_IDCMP
, IDCMP_CLOSEWINDOW
| IDCMP_RAWKEY
| IDCMP_MOUSEMOVE
| IDCMP_MOUSEBUTTONS
| IDCMP_VANILLAKEY
,
120 WA_ReportMouse
, TRUE
,
125 if ((text
= Text_Create()))
127 Text_SetFrameBox(text
, scr
, wnd
->RPort
, (LONG
) wnd
->BorderLeft
, (LONG
) wnd
->BorderTop
, wnd
->Width
- wnd
->BorderLeft
- wnd
->BorderRight
- 1, wnd
->Height
- wnd
->BorderTop
- wnd
->BorderBottom
- 1);
128 Text_Load(text
, "DH0:");
135 UnlockPubScreen(NULL
, scr
);