Recent

Author Topic: Transparent form  (Read 5493 times)

RAW

  • Hero Member
  • *****
  • Posts: 868
Re: Transparent form
« Reply #15 on: July 09, 2020, 10:16:36 pm »
You can create a semi transparent background ... maybe like this ...
Just in case you don't want the mouse go through ... or set AlphaBlendValue to 1 ...  :)
« Last Edit: July 10, 2020, 07:30:31 pm by RAW »
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #16 on: July 14, 2020, 10:04:33 am »
In the first post or so it was said there are 2 ways to do this... On that works on Windows and the other????


Since I use a Mac I am curious to the other way?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Transparent form
« Reply #17 on: July 14, 2020, 02:16:19 pm »
SetWindowRgn is actually available in the LCLIntf unit across platforms. Simply include "LCLIntf" and "LCLType" and the code by RAW should work...

Well at least it should compile. If it actually works depends on the Widgetset. With QT4 and QT5 it works. I think I remember that on MacOS it does not work with Carbon probably also doesn't work with cocoa.
BUT you can simply use QT5 on macOS. Back when I had a mac and I needed this I used QT4 (QT5 was unusable with lazarus back then) to archive this. (And with simply I mean it only took me around 10 hours to get it running and it looked pretty bad, like oldschool macos, but QT5 should look native)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #18 on: July 15, 2020, 11:52:13 pm »
Nope does NOT work.... :(


Or can you make me a working example?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Transparent form
« Reply #19 on: July 16, 2020, 08:41:43 am »
I dont have a mac anymore (St least none i do programming on), but it works with QT5 on linux and I remember that with QT4  this also worked on macos (even though it was 4 years ago, a lot has changed since then in macos)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #20 on: July 17, 2020, 12:20:51 am »
I am not working with QT.... I am with Cocoa
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Transparent form
« Reply #21 on: July 17, 2020, 01:57:32 am »
If it actually works depends on the Widgetset. With QT4 and QT5 it works. I think I remember that on MacOS it does not work with Carbon probably also doesn't work with cocoa.
BUT you can simply use QT5 on macOS.

I never claimes it would work with cocoa (in fact i already doubted this when I made the post). But using qt for mac is (once it is setup) rather easy because you can ship the required dependencies within the AppBundle format.

Its a common problem (or at least it was when i used a mac) that both, carbon and cocoa had some quirks that made some LCL functionality inacessible. Back then neitger gtk nor qt where an alternative (gtk2 required x11 and looked absolutely terrible and qt4 looked like macos 10.4), but if I had to support macos now, i would probably go for qt5, looks native and has a much broader LCL support than cocoa.

But long story short, i already suspected this to not work with cocoa, so either use a different WS, or you simply cant do it (well maybe via raw api acess, but i know way to little about cocoa to answer this question)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #22 on: July 17, 2020, 05:01:11 am »
to bad there is no other solution
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Transparent form
« Reply #23 on: July 17, 2020, 05:34:19 am »
Nope does NOT work.... :(

could you please specify what exactly doesn't work on Cocoa.
otherwise it's hard to assist

https://www.dropbox.com/s/hbonwecvfcd6spr/windowblend.mov?dl=0

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #24 on: July 17, 2020, 09:53:02 pm »
The form just will not be transparant.
I have this full screen form that only has to be shown the top 235 pixels.
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #25 on: July 19, 2020, 05:11:47 pm »
and that will not happen as the windows version
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: Transparent form
« Reply #26 on: July 19, 2020, 05:28:38 pm »
And this is what I want to achieve. But now it are two forms
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

 

TinyPortal © 2005-2018