log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- Announcing the TIB 2024 Advent Calendar (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- RISCOSbits releases a new laptop solution (News:)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
- RISC OS London Show Report 2024 (News:1)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
Acorn Arcade forums: Programming: WIMP program
 
  WIMP program
  Hertzsprung (09:38 20/5/2002)
   (13:58 15/6/2002)
     (16:11 20/5/2002)
     (13:58 15/6/2002)
       (13:58 15/6/2002)
         (13:58 15/6/2002)
           (13:58 15/6/2002)
         (13:58 15/6/2002)
 
Hertzsprung Message #5075, posted at 09:38, 20/5/2002
Unregistered user Although I've written WIMP apps in BASIC before, I haven't done my own screen redrawing.

Could somebody post a small example of a WIMP app that draws some colour rectangles in the refresh areas, or something?

With my program, I get some very odd behaviour. When you drag a window over the top of my window, my fills rectangles seem to fill the dragged window's title bar and my window's title bar area. Why is this happening? I thought RISC OS clipped any drawing to the rectangle in question.

Sadly, I do not have my program to hand so I cannot post it here, but if someone could knock on up for me, I'd be grateful.

  ^[ Log in to reply ]
 
Phlamethrower Message #5078, posted at 16:11, 20/5/2002, in reply to message #5076
Unregistered user Calm down! It's only been 7 hours!

Although I've written WIMP apps in BASIC before, I haven't done my own screen redrawing.
Could somebody post a small example of a WIMP app that draws some colour rectangles in the refresh areas, or something?

Um, possibly. I'm not too experienced in WIMP myself, and my programs tend to be bloated C ones using my own libraries so aren't quite perfect for posting here.

With my program, I get some very odd behaviour. When you drag a window over the top of my window, my fills rectangles seem to fill the dragged window's title bar and my window's title bar area. Why is this happening? I thought RISC OS clipped any drawing to the rectangle in question.

Well if this is happening then you're not using the redraw rectangles RISC OS supplies. What should happen is that your program sits round on its backside until it gets a redraw window message from the WIMP. You then call some SWI (Probably Wimp_GetRectangle or something) to get the details of the first redraw rectangle. The graphics origin should now be set to the origin of the windows work area, IIRC. You can then do something like CIRCLE FILL 100,100,50 to get a circle at window-coords 100,100. Once your programs done drawing, it then calls another SWI (similar to the first) to get the next redraw rectangle - and then draws the window contents again, this time with it clipped by RO to a new area. This repeats for however many redraw rectangles are needed.

Sadly, I do not have my program to hand so I cannot post it here, but if someone could knock on up for me, I'd be grateful.

Here's a bit of code which probably won't work (Ripped from one of my C progs & rejigged into BASIC which I haven't really used for about two years now), but will illustrate the technique:

DEF PROCredraw
REM 'block' is the WIMP poll block
REM block!0 will contain the handle of the window to redraw
SYS "Wimp_RedrawWindow",block TO temp
WHILE tmp<>0
CIRCLE FILL 100,100,50
SYS "Wimp_GetRectangle",block TO temp
ENDWHILE
ENDPROC

Note that Wimp_RedrawWindow must be the 1st Wimp call after the Wimp_Poll that returned the redraw request (Poll code 1)

If you haven't got it already, I'd advise tracking down a StrongHelp manual - Justin Fletcher's mammoth multi-manual SWI manual would be a good idea. http://sudden.recoil.org/stronghelp/#manuals looks like it contains all of them.

Plus, a copy of EventShell wouldn't be too bad for reference purposes - http://ftp.uni-stuttgart.de/pub/systems/acorn/acornet/long/development/basic/eventshell/ looks like it should be OK

  ^[ Log in to reply ]
 
Hertzsprung Message #5076, posted at 13:58, 15/6/2002, in reply to message #5075
Unregistered user Do I take it, by people's lack of response, that no-one has the faintest idea? unhappy
  ^[ Log in to reply ]
 
rich Message #5077, posted at 13:58, 15/6/2002, in reply to message #5076
Unregistered user
Do I take it, by people's lack of response, that no-one has the faintest idea? :(
I've done redraw code in BASIC, but I'm not sure my code is a good example ;)

Take a look at http://www.houseofmabel.com/programs/fadeback/ and do a search for functions and procedures with "redraw" in them - it should show you how and when to do redraws.

[Edited by rich at 11:13, 1/8/2002. Fixed broken URL]
  ^[ Log in to reply ]
 
Hertzsprung Message #5079, posted at 13:58, 15/6/2002, in reply to message #5077
Unregistered user

Take a look at [broken URL]
Your link doesn't seem to work :(

[Edited by rich at 11:16, 1/8/2002. Broken URL]
  ^[ Log in to reply ]
 
moss Message #5080, posted at 13:58, 15/6/2002, in reply to message #5079
Unregistered user
Your link doesn't seem to work unhappy
Try http://www.houseofmabel.com/programs/archives/fadeback.arc grin
  ^[ Log in to reply ]
 
Hertzsprung Message #5081, posted at 13:58, 15/6/2002, in reply to message #5080
Unregistered user
Your link doesn't seem to work unhappy

Try http://www.houseofmabel.com/programs/archives/fadeback.arc grin

I need to get ArcFS for my Archie emulator... Hmm... It's sooooo sloooooow

  ^[ Log in to reply ]
 
rich Message #5082, posted at 13:58, 15/6/2002, in reply to message #5079
Unregistered user

Your link doesn't seem to work unhappy
Doh, I uploaded the .zip version in another directory.
  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: WIMP program