Silverfrost Forums

Welcome to our forums

%ww[casts_shadow]

3 May 2018 7:24 #22067

Paul,

I wonder if you could take a quick look at the %ww option casts_shadow please. I have a clear recollection that in Windows XP it was translucent, but since Windows 7 it has been a very solid black. It's not 'mission critical'.

In Windows 10, the drop shadow disappears when you move the program window but reappears when movement stops. The Window anyway has a sort of translucent drop shadow to which the Clearwin+ shadow is an add-on. Obviously the disappear-reappear business doesn't happen if the window is volatile and has no caption.

Eddie

      WINAPP
      OPTIONS (INTL, DREAL)
      PROGRAM DS
      INCLUDE <WINDOWS.INS>
      IA=WINIO@('%ca[test drop shadow]%ww[toolwindow,casts_shadow]'//
     &   '%cn%10bt[OK]')
      END
4 May 2018 7:38 #22068

Eddie

OK. Thanks. I will take a look.

5 May 2018 7:58 #22084

John,

The change happened after XP, and when I have access to an old XP computer I'll try it again. It was originally a lot prettier than it is now, but as I said, it isn't a showstopper.

Eddie

7 May 2018 8:25 #22100

Thanks John. The disappearing shadow while moving doesn't bother me, but the dense black does - at an aesthetic level. It only crept into one of my programs when pop-up menus didn't work (now fixed), but a volatile, borderless, drop-shadowed, window allows more options than a pop up menu, and so the original workaround stayed.

I suppose XP is 'Windows classic'.

Eddie

8 May 2018 5:51 #22103

John

Just for the record, I did not write %ww nor indeed a large majority of winio@.

10 May 2018 7:32 #22110

I've had another look, and as I'm using the drop shadow with some volatile windows, I can probably draw a translucent grey box offset right and down, before the window itself (written in XOR and removed in the same way), but I still think that the effect with the standard casts_shadow is rather crude. The work-around will be subject to a lot of issues with font size (the dpi business). I may not even need to remove a self-drawn drop shadow as I can simply redraw the underlying screen contents.

In any case, the status quo can be tolerated - I did say it wasn't 'mission-critical' as a hint that I wasn't expecting Paul to drop everything or waste a lot of time on it.

Eddie

10 May 2018 8:58 #22111

Eddie

I have managed to change the colour of the shadow from black to grey. It is still rather dark so I have reduced the width of the shadow by 50%. You get the grey colour when using a white brush so that's the best I can do with the existing coding.

10 May 2018 3:15 #22112

Hi Paul,

THat's great. Thanks.

Regards

Eddie

14 May 2018 2:34 #22125

The Windows XP style is shown here:

https://www.dropbox.com/s/8bopeqlf1awxa6a/ds.bmp?dl=0

and is a sort of chequerboard pattern. This has the sense of transparency as the background shows through. My memory was broadly correct, but not perfect.

Eddie

2 Mar 2019 4:53 #23300

Under Win7 64 bit %ww[casts_shadow,... creates a nice grey window in the right size, however, in a wrong position 1,1 on screen, and only for a short moment - may be a tenth of a second.

    IX = ClearWin_Info@ ('SCREEN_WIDTH') / 2 - 270
    IY = ClearWin_Info@ ('SCREEN_DEPTH') / 3 - 50
    MA = WINIO@ ('%bm[StartBitmap]&')
    MA = WINIO@ ('%sp&', IX, IY)
!    MA = WINIO@ ('%ww[casts_shadow,no_caption,no_maxminbox,no_frame,no_border,topmost]&')
    MA = WINIO@ ('%ww[no_caption,no_maxminbox,no_frame,no_border,topmost]&')
    MA = WINIO@ ('%lw',Handle1)
2 Mar 2019 5:30 #23301

More recent versions of Windows have messed up the display for this option. I did some work on it and the result was an improvement but not a good fix. If you have the latest version of ClearWin+ that will show the result of the fix.

I am not sure that this option remains useful since more recent versions of Windows already gives you a good shadow.

3 Mar 2019 7:05 #23304

Paul, my version is 8.40; the DLLs in my directory for my programs are dated Nov. 2018. I do not need a fix; I removed cast_shadow. Erwin

3 Mar 2019 10:30 #23305

Thanks for the effort Paul.

Some differentiation is required if a window is captionless and volatile, but unnecessary for standard dialogs.

I started using drop_shadow for such things when pop-up menus didn't work with %gr areas, and stuck with them after that was fixed (partly because there wasn't much of a fanfare, but also partly because i found that you could have all sorts of extra things like data entry boxes that you couldn't with a pop-up menu).

The answer might be some other effect than a drop shadow, maybe even a different colour, but a drop shadow is effective - it needs to be denser than a Windows standard drop shadow, but the latest Windows versions render this rather crudely. Perhaps MS don't intend drop shadows to be used and this is their way of telling us.

I suppose that my solution is to experiment.

Eddie

15 May 2022 6:50 #28976

Is it just my imagination, or have drop shadows in CW+ when using Win 10 got even less useful recently?

I found this on the internet:

https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Composition.DropShadow?view=winrt-22000

but as it is dated May 24-26 2022 and today is only May 15, it left me even more confused than MSDN normally does!

Eddie

15 May 2022 7:48 #28977

Eddie

cast_shadow is no longer supported and is no longer useful in ClearWin+.

It is native to ClearWin+ and unrelated to the supplied link.

16 May 2022 9:48 #28978

Hi Paul,

I beg to differ on the* 'no longer useful', except with the reservation that 'no longer supported' certainly makes it 'no longer useful'. I'm also fascinated by the idea that 'no longer supported' *can be made retrospective, although I suppose that downloading the latest DLLs is a mechanism for that, akin to downloading the latest Windows updates.

I didn't see any mention of it in the online Revision history, and it is still mentioned in the online help for %ww*, so perhaps my not realising it was 'no longer supported' is understandable and therefore perhaps forgiveable. The contents of the link might as well be written in Egyptian hieroglyphs** as far as I am concerned, but it was what I found doing a search for 'drop shadow' when looking for an explanation as to why things were evolving. The link, incidentally, suggests that drop shadows don't need to be 'native to ClearWin+' but are native to Windows itself, in which case I impudently refer you back to an earlier statement that you made that ClearWin+ is simply a wrapper for Windows functionality (or words to that effect).

I'd already worked out that I might have to do something different in order to go forward, especially as the Windows paradigm has been to shift away from a pseudo 3D appearance towards a more flat look - but I haven't yet worked out quite what. I'd appreciate any suggestions from anyone out there who has solved the related problem for themselves. I appreciated the prompt reply as it is the necessary impetus*** to go and do the job differently rather than to put it off in the hope that somehow the issue resolved itself.

Eddie

  • Which rather means that the short, four-letter, response of RTFM cannot be used in this context.

** I'd always imagined that an understanding of MSDN's arcane language resided up there in Silverfrost's HQ. I regarded myself as a latter-day Bouchard, or perhaps Thomas Young, in recognising the significance of relevant elements in the MSDN page while using Google Search as my Rosetta Stone, but that the skills of a true Champollion to decypher it all only resided up there in Salford.

https://blog.britishmuseum.org/everything-you-ever-wanted-to-know-about-the-rosetta-stone/

*** In this respect I shall consider myself to be Bishop Brennan to your Father Ted!

16 May 2022 10:49 #28981

Eddie

The shadow is provided internally by ClearWin+ and worked quite well for a while with the early APIs. But changes in the Microsoft API has had an adverse effect on the displayed result.

I spent a long time trying to restore the original ClearWin+ shadow but with limited success. Also at that time Microsoft was providing a similar shadow by default.

If this is important to you then I can try again but I am not confident that I can provide a permanent fix (i.e. one that will not change as the APIs evolve).

Paul

16 May 2022 2:17 #28982

Hi Paul,

I hope that you were able to take my reply in the tongue in cheek manner in which it was intended. As a result of the Fr Ted - Bishop Brennan kick up the backside, I've had a look at the code, and the lack of a drop shadow is in principle compensatable by deletion of casts_shadow, and insertion of a %bg coloured appropriately.(RGB@(110, 110, 110) seems to work well instead of the previous btnface) I have noted that the current frame colour for my popup windows makes it immaterial whether or not I have no_frame, but it depends somewhat on also having thin_border. I have considered wallpaper, but there are several sizes to consider, and there is also the issue of different dpi settings.

It did seem to me that the MSDN link indicated that a drop shadow feature was being implemented in the MS Windows API, but I suspect strongly that I'm the only user with this particular interest so I wouldn't waste time on it (unless, of course, it grabbed your fancy). I'd already assumed that I was having to find a workaround.

This whole business of features being dropped (by MS, not by SF) irritates me, but then I've noticed it in numerous other contexts, including in cars (e.g. now no wash before wipe), other software like my beloved CorelDRAW, and even the stock at my local Waitrose where anything I find I like is rapidly discontinued!

Eddie

Please login to reply.