|
Windows without outlines |
|
ksattic (22:40 26/2/2003) Phlamethrower (23:09 26/2/2003) ksattic (23:12 26/2/2003) Phlamethrower (23:20 26/2/2003) ksattic (23:18 26/2/2003) Phlamethrower (23:20 26/2/2003) ksattic (23:23 26/2/2003) Phlamethrower (23:25 26/2/2003) ksattic (08:59 27/2/2003) johnstlr (10:02 27/2/2003) ksattic (14:08 27/2/2003) ksattic (08:35 28/2/2003) ksattic (08:56 28/2/2003) john (09:22 27/2/2003)
|
|
Simon Wilson |
Message #34516, posted by ksattic at 22:40, 26/2/2003 |
Finally, an avatar!
Posts: 1291
|
Does anyone know how to draw a window without an outline?
What I want to do is plot a sprite over the entire window, but the window outline must not be visible. Changing the colour of the outline doesn't help because I still can't draw over it.
I've set the window flags so that my program has to redraw the window manually, and in that time it plots the sprite.
Any ideas?
Also, I'm thinking of trying out an idea for a non-rectangular window. I'm thinking that if I plot a sprite (with mask) over the desktop and then call Wimp_ForceRedraw on a rectangular area around the sprite's position, I can get it to work. Thoughts?
[Edited by ksattic at 22:41, 26/2/2003] |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #34529, posted by Phlamethrower at 23:09, 26/2/2003, in reply to message #34516 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Does anyone know how to draw a window without an outline? I think this is possible; have you checked the StrongHelp manuals or anything?
Also, I'm thinking of trying out an idea for a non-rectangular window. Hmm, this could be tricky. Getting it to draw a nonrectangular window is easy (Just make one with a transparent background & only redraw the bits you need), but I'm not too sure about how to handle the user dragging the window; the transparent bits inside the bounds of the window wouldn't get redrawn and so the image would smear. A work-around to this would be to actually close the window, redraw the stuff behind it, and then re-open it, but that would take several poll cycles and so be a load of rubbish.
*has a think*
If the contents of the window is entirely generated by you (i.e. no WIMP icons) then you could use the dragasprite module to let the user move the window round. Apart from that, or shrinking the window to a rectangle, I can't think of any good way of allowing drags. |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34531, posted by ksattic at 23:12, 26/2/2003, in reply to message #34529 |
Finally, an avatar!
Posts: 1291
|
I think this is possible; have you checked the StrongHelp manuals or anything? I do have them, but I really don't know what to look for. I'll have another search.
If the contents of the window is entirely generated by you (i.e. no WIMP icons) then you could use the dragasprite module to let the user move the window round. My idea was to not have a window at all, but then again that would mess things up when the user tries to drag the non-existant window!
I'll think about this more too. |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34533, posted by ksattic at 23:18, 26/2/2003, in reply to message #34529 |
Finally, an avatar!
Posts: 1291
|
Wimp StrongHelp manual->Wimp_CreateWindow->window block->special value.
|
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #34534, posted by Phlamethrower at 23:20, 26/2/2003, in reply to message #34531 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
I think this is possible; have you checked the StrongHelp manuals or anything? I do have them, but I really don't know what to look for. I'll have another search. According to the WIMP manual, if you specify the title/frame foreground colour as &FF then:
* On pre-3.80 the window will have no furniture * On post-3.80 the window will have no frame, but furniture can still be present
I haven't tried it, but I'd guess that this is what you're after. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #34535, posted by Phlamethrower at 23:20, 26/2/2003, in reply to message #34533 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Wimp StrongHelp manual->Wimp_CreateWindow->window block->special value.
Tsk. You took the shortcut, while I went and explained it all |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34536, posted by ksattic at 23:23, 26/2/2003, in reply to message #34535 |
Finally, an avatar!
Posts: 1291
|
Sorry to post a question before I'd tried to look for the answer myself - but I wouldn't have even thought it was in the StrongHelp manuals. They really are excellent!
BTW. it works! Thanks! |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #34537, posted by Phlamethrower at 23:25, 26/2/2003, in reply to message #34536 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
No, it's OK. I'm sure I do it myself some times |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34544, posted by ksattic at 08:59, 27/2/2003, in reply to message #34537 |
Finally, an avatar!
Posts: 1291
|
The next thing I wanted was a plot-sprite-clipped routine, and it exists in the form of OS_SpriteOp 56. It works, but I have a feeling it's quite slow as it does transformations too. Do you know how I can set the graphics window in C? I need the equivalent of a BASIC VDU call. I can't find it anywhere in the StrongHelp manuals.
My other option is to do all my clipping at the initialisation stage and put the clipped sprites into new (smaller) sprites. |
|
[ Log in to reply ] |
|
John D |
Message #34545, posted by john at 09:22, 27/2/2003, in reply to message #34529 |
Member
Posts: 261
|
[quoteIf the contents of the window is entirely generated by you (i.e. no WIMP icons) then you could use the dragasprite module to let the user move the window round. Apart from that, or shrinking the window to a rectangle, I can't think of any good way of allowing drags.I tried this once, it works quite well but it uses a lot of memory (since it copies your sprite into its own memory. |
|
[ Log in to reply ] |
|
Lee Johnston |
Message #34564, posted by johnstlr at 10:02, 27/2/2003, in reply to message #34544 |
Member
Posts: 193
|
The next thing I wanted was a plot-sprite-clipped routine, and it exists in the form of OS_SpriteOp 56. It works, but I have a feeling it's quite slow as it does transformations too. Do you know how I can set the graphics window in C? I need the equivalent of a BASIC VDU call. I can't find it anywhere in the StrongHelp manuals. IIRC you just send each byte of the VDU command to OS_WriteC, ie to set the screen mode on pre-RISC OS 3.5. The following is from an old project.
/* Calling OS_WriteC is same as VDU num, and */ /* VDU 22, VDU x changes the screen mode to */ /* mode x */
_kernel_swi_regs regs;
regs.r[0] = 22; _kernel_swi(OS_WriteC, ®s, ®s);
regs.r[0] = privateInformation.screenModeNumber; _kernel_swi(OS_WriteC, ®s, ®s);
In your case you just want to swap in the parameters of the VDU call in question.
[Edited by johnstlr at 10:03, 27/2/2003] |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34717, posted by ksattic at 14:08, 27/2/2003, in reply to message #34564 |
Finally, an avatar!
Posts: 1291
|
Thanks! |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34842, posted by ksattic at 08:35, 28/2/2003, in reply to message #34564 |
Finally, an avatar!
Posts: 1291
|
It doesn't seem to work very well in Wimp code. The window draws all its elements fine initially, but if the window is taken partially off-screen or covered, the elements will start to draw wrong, as if the clipping rectangle (graphics window) is being altered. Perhaps VDUs can't be used during the Wimp redraw phase?
Oh well. I'll just use SpriteOp 56. |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #34843, posted by ksattic at 08:56, 28/2/2003, in reply to message #34842 |
Finally, an avatar!
Posts: 1291
|
I feel silly for (possibly) answering my own question. I seem to remember from my BBC programming days that defining a graphics window with VDU 24 outside of the maximum screen dimensions will cause the graphics window to be set to the full screen. That's why my clipping ain't working.
Plus, it's a very bad idea to alter the graphics window that Wimp_GetRectangle has just set - otherwise other windows can be drawn over! Oops!! |
|
[ Log in to reply ] |
|
|