-
Jul 29th, 2024, 01:18 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Making desktop gadgets with RC5 - RC6
I ask Olaf how to have a text such as time or date transparently in the background.
Like this picture
Can you send a simple example ?
-
Jul 29th, 2024, 02:32 PM
#2
Re: Making desktop gadgets with RC5 - RC6
Olaf will turn up soon with a simple answer or an easy example but if you want a more convoluted example you could look here: https://github.com/yereverluvinuncle...me-Control-VB6
You'll see that it has some transparent text above the volume control
If you look inside cwOverlay.cls you will see:
Code:
Private Sub Class_Initialize()
Dim intervalValue As Integer: intervalValue = 0
On Error GoTo Class_Initialize_Error
Set W = Cairo.WidgetBase
W.BackColor = -1 'we don't use any BackColor here, transparent
Code:
cream = RGB(235, 217, 179) ' cannot create a constant from an RGB value
'set some Font- and ForeColor-Properties and draw some Text on the Widget
With W
.FontSize = 38
.FontName = "times new roman"
.FontBold = True
.ForeColor = vbBlack
.BackColor = -1
.Tag = 0.01
.HoverColor = 0
.SelectFontSettingsInto CC
.Refresh
End With
thisVolumeLevel = Int(fVolume.SystemAudioLevel * 100)
and a little later:
Code:
' for specific keys perform actions &c
Select Case Key
Case "cable"
Set Pat = Cairo.ImageList(Key).CropSurface(10, 0, 140, 27).CreateSurfacePattern 'cut-out a nice (repeatable) part of the original "cable"-image (via CropSurface)
If gblNumericDisplay = "1" Then
' volume level text shadow
CC.DrawText 253, 18, 200, 200, thisVolumeLevel & "%", , , 2, True, , someOpacity
With W
.ForeColor = cream
.SelectFontSettingsInto CC
.Refresh
End With
' volume level text
CC.DrawText 250, 15, 200, 200, thisVolumeLevel & "%", , , 2, True, , someOpacity
End If
This paints text in an overlay class that also draws the cable in the dieselpunk volume UI.
There are other ways to do it but this is just an example of one method.
Last edited by yereverluvinuncleber; Jul 29th, 2024 at 02:40 PM.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jul 29th, 2024, 04:42 PM
#3
Thread Starter
Addicted Member
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by yereverluvinuncleber
Olaf will turn up soon with a simple answer or an easy example but if you want a more convoluted example you could look here: https://github.com/yereverluvinuncle...me-Control-VB6
You'll see that it has some transparent text above the volume control
If you look inside cwOverlay.cls you will see:
This paints text in an overlay class that also draws the cable in the dieselpunk volume UI.
There are other ways to do it but this is just an example of one method.
I can only say that what you did is great
Thank you for your help, but your project is very professional and complete and of course it is hard for me to understand
I just want a simple quality text on the screen with no background as a gadget that I can drag
I will look at your codes again, maybe I understood something
Last edited by Mojtaba; Jul 29th, 2024 at 05:02 PM.
-
Jul 30th, 2024, 06:16 AM
#4
Re: Making desktop gadgets with RC5 - RC6
The link I gave you is one of my simplest programs using RC. It puts a variety of images from a PSD on a transparent window. It then creates an overlay RC 'widget' with a paint event. The text is drawn at that point.
I use that project as a basis for all other desktop trinkets I create. I strip out what I don't want and add in anything new that I require. Doing the same will show you a lot of what is required behind the scenes for a RC program.
Olaf has several demonstration programs that will do the same in a more simple fashion. I advise you to find those or wait until Olaf arrives.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jul 30th, 2024, 06:38 AM
#5
Re: Making desktop gadgets with RC5 - RC6
A little later I will knock up an RC6 program with a simple clock on a transparent background, I'll let you know when it is done.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Aug 1st, 2024, 03:51 PM
#6
Re: Making desktop gadgets with RC5 - RC6
Here is a simple example for a transparent form(gadget),
you can drag around on your Desktop...
It uses a modally shown RC6.cWidgetForm (encapsulated in Class cfAlpha) -
and starts from Sub Main (in modMain.bas).
Here is a Demo-Project:
https://vbRichClient.com/Downloads/CairoAlphaForm.zip
The Cairo-Drawing of the contents of this 640x480 Alpha-Form-Gadget happens in the Event:
Private Sub Canvas_Paint(...)
... so you can "knock yourself out" within this Paint-Event (using the CC to draw anything you want on this Form).
Olaf
-
Aug 3rd, 2024, 02:32 PM
#7
Thread Starter
Addicted Member
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by yereverluvinuncleber
A little later I will knock up an RC6 program with a simple clock on a transparent background, I'll let you know when it is done.
Thank you, I am waiting for your project
-
Aug 3rd, 2024, 02:34 PM
#8
Thread Starter
Addicted Member
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by Schmidt
Here is a simple example for a transparent form(gadget),
you can drag around on your Desktop...
It uses a modally shown RC6.cWidgetForm (encapsulated in Class cfAlpha) -
and starts from Sub Main (in modMain.bas).
Here is a Demo-Project:
https://vbRichClient.com/Downloads/CairoAlphaForm.zip
The Cairo-Drawing of the contents of this 640x480 Alpha-Form-Gadget happens in the Event:
Private Sub Canvas_Paint(...)
... so you can "knock yourself out" within this Paint-Event (using the CC to draw anything you want on this Form).
Olaf
Very good, Olaf, but I mean a completely transparent background that cannot be seen and no modal window
Again, I learned a few things from this code
-
Aug 3rd, 2024, 05:47 PM
#9
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by Mojtaba
I mean a completely transparent background that cannot be seen -
and no modal window
You can do both:
- switch off the blurred background
- and show the Form non-modally
in Sub Main() of modMain.bas...
Code:
Sub Main()
Cairo.SetDPIAwareness
Cairo.ImageList.AddIconFromResourceFile "frmIco", "shell32", 167 'load an image-resource into the global ImageList (under a given Key)
' SwitchBlurredBackDrop fMain.Form.hWnd, True 'comment out, or set to false to disable the blurred backdrop
fMain.Form.Show
Cairo.WidgetForms.EnterMessageLoop
End Sub
Olaf
-
Aug 4th, 2024, 03:25 AM
#10
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by Mojtaba
Thank you, I am waiting for your project
Don't wait for me, my new laptop just died (fried) so I will be a while before I am up and running again. Olaf will guide you.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Aug 4th, 2024, 04:05 AM
#11
Hyperactive Member
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by yereverluvinuncleber
don't wait for me, my new laptop just died (fried) so i will be a while before i am up and running again. Olaf will guide you.
rip
-
Aug 4th, 2024, 04:31 AM
#12
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by Mojtaba
Thank you, I am waiting for your project
This forum is not à la carte restaurant where you can order from a menu and then wait on your order while swiping on your phone.
The principles here are based on receiving guidelines and most of the effort is expected to come from you. You have to write the actual code and everyone else might comment on it if they have something useful to say.
This is not the first time I get the impression you are not aware of the basic netiquette of every public forum in general so trying to clear things up for you and explain why you might not get quite as many replies to your threads if you keep posting these as drive-in orders.
cheers,
</wqw>
-
Aug 4th, 2024, 05:26 AM
#13
Thread Starter
Addicted Member
Re: Making desktop gadgets with RC5 - RC6
Originally Posted by Schmidt
You can do both:
- switch off the blurred background
- and show the Form non-modally
in Sub Main() of modMain.bas...
Code:
Sub Main()
Cairo.SetDPIAwareness
Cairo.ImageList.AddIconFromResourceFile "frmIco", "shell32", 167 'load an image-resource into the global ImageList (under a given Key)
' SwitchBlurredBackDrop fMain.Form.hWnd, True 'comment out, or set to false to disable the blurred backdrop
fMain.Form.Show
Cairo.WidgetForms.EnterMessageLoop
End Sub
Olaf
This is good
I need to read more about Cairo because I use it in all programs
Olaf, if you have time, give more up-to-date examples for teaching. Anyway, I appreciate your Help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|