Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Sebastian Barthel Newsgroups: comp.sys.acorn.programmer Subject: Re: Text in a wimp window Date: Thu, 14 Aug 2025 14:37:12 -0000 (UTC) Message-ID: <107ksao$15e1$1@solani.org> References: <5c4be2e7bbbob@sick-of-spam.invalid> <107k73u$cbd1$1@dont-email.me> <5c4c324030bob@sick-of-spam.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 14 Aug 2025 14:37:12 -0000 (UTC) Injection-Info: solani.org; logging-data="38337"; mail-complaints-to="abuse@news.solani.org" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:TOC/iU0eH70fvFO1ksz+Ic0dAcc= X-User-ID: eJwVx8kRwDAIBLCWOMwC5RDi7b+ETPRTOBSbB4ETDCa5Pn0Be9NX/JaiuP9jixpjJvKYebdyPh96ENQ= Xref: csiph.com comp.sys.acorn.programmer:6542 Am Thu, 14 Aug 2025 10:45:28 +0100 schrieb der Meister Bob Latham: > In article , > Theo wrote: > >> Another option is to have an icon which is a sprite and occupies all of >> your window. Then, using VDU commands, redirect your OS_Plot, >> Font_Paint, etc drawing to the sprite instead of the screen. Thats an good and easy variant. Try this for an start. Otherwise You should try to find out more about whats meant with "window area" and espacially how the scrollbars are calculated into the position oft this area. The real intersting thing is the "Wimp_UpdateWindow" call. This works together with the "Wimp_GetRectangle" call and can be done in the form of nullevent for the whole window (dirty, without doing some extra calculations for the area rectangles) DIM text% 256 $text% = "this is the text for demonstrating the fontplot !"+CHR$(0) DIM b% 256 bitmask% = %0001100100110010 finished%= FALSE REPEAT SYS "Wimp_Poll",bitmask%,b% TO pollevent%,b% CASE pollevent% OF WHEN 0 : PROCtextplot ENDCASE UNTIL finished% END DEF PROCtextplot winblock!0 = windowhandle% winblock!4 = 8 : REM left - delta x as normal (0 is area left) winblock!8 = -512 : REM lower - delta y but in (-) area coordinates winblock!12= 640-8: REM right - delta x as normal winblock!16= -8 : REM upper - delta y in (-) area coordinates SYS "Wimp_UpdateWindow",,winblock% TO update% WHILE update% scrollx% = winblock%!20 scrolly% = winblock%!24 SYS "Wimp_SetColour",1 RECTANGLE FILL winblock%!4-scrollx%,winblock%!16-234-scrolly%,256,256 SYS "Wimp_SetColour",6 LINE X0%-scrollx%,Y0%-scrolly%,X1-scrollx%,Y1-scrolly% SYS "Wimp_TextOp",0,&1122dd00,&334455 SYS "Wimp_TextOp",2,text%,-1,-1,256+winblock%!4-scrollx%,-256+winblock%! 16-scrolly% SYS "Wimp_GetRectangle",, windowblock% TO update% ENDWHILE ENDPROC This should point You in a manageable direction. Every String has to be limted by an "0" Symbol - that the CHR$(0). Otherwise the Wimp_TextOp will do strange things. TextOp with Reason Code 0 colours the text - &1122dd00 is RED (&BBGGRR00). TextOp with Reason Code 2 prints the text of the stringbuffer onto the screen. Positon is (256,-256) into the Area and the scrollcoordinates are calculated too. To print more than one line of text You could read every line into the text% buffer and print them in loop. To calculate the maximum length of text possible, TextOp Reasond Code 1 allows to ask the Wimp how many characters are the length of the (visible) window area. The MID$ or LEFT$ operations in a loop are handy to find this length. Then the buffer has to be CHR$(0) coded at the calculated position. RECTANGLE FILL and LINE commands are here to demonstrate how graphics can be plotted the same way. The RECTANGLE FILL also allows to clean up an portion of the window in a "rude" way too. SBn