Select Area
Quote from Gowtham on April 14, 2022, 9:25 amHi John,
still think that the help within Gambas3 when coding a class could be explained better
This is and has been an issue. When you understand something you can create an account and then edit the help pages yourself.
The idea is take a screenshot of the available desktop (i.e. the whole of my monitor's screen excluding the top panel (containing the Systray etc,...
You need to be careful here as I use the Cinnamon Desktop and my toolbar and System Tray is on the bottom of the screen.
When I run the app (using Debug) I get a popup stating 'Cannot Paint outside of Draw event handler'.
This is a nasty one and I don't pretend to fully understand it but if you change the DrawingArea Cached property to True I think you will find that it is OK.
I have messed about with your code. There is a lot of code that you could get rid of if you understood the way Gambas works with Forms.
For the Form that the user is going to 'draw' the rectangle, set the Form properties:-Arrangement = Vertical
Border = False
Maximized = True
Opacity = 35Put your DrawingArea on the Form and set the Expand property to True
With these settings the form and DrawingArea will expand to fill the whole screen (whatever the size). The opacity at 35 allows you to see the Desktop behind.
Have a look at the FMain form settings and layout in the attached then resize the form and you will see that you don't need to write any code to get these results.
I wrote a program to help people understand these concepts. The program is called 'ExpandingForms' and is on the Farm or is available here.Click here to download: SelectArea-CO-0.0.16.tar.gz
Hi John,
still think that the help within Gambas3 when coding a class could be explained better
This is and has been an issue. When you understand something you can create an account and then edit the help pages yourself.
The idea is take a screenshot of the available desktop (i.e. the whole of my monitor's screen excluding the top panel (containing the Systray etc,...
You need to be careful here as I use the Cinnamon Desktop and my toolbar and System Tray is on the bottom of the screen.
When I run the app (using Debug) I get a popup stating 'Cannot Paint outside of Draw event handler'.
This is a nasty one and I don't pretend to fully understand it but if you change the DrawingArea Cached property to True I think you will find that it is OK.
I have messed about with your code. There is a lot of code that you could get rid of if you understood the way Gambas works with Forms.
For the Form that the user is going to 'draw' the rectangle, set the Form properties:-
Arrangement = Vertical
Border = False
Maximized = True
Opacity = 35
Put your DrawingArea on the Form and set the Expand property to True
With these settings the form and DrawingArea will expand to fill the whole screen (whatever the size). The opacity at 35 allows you to see the Desktop behind.
Have a look at the FMain form settings and layout in the attached then resize the form and you will see that you don't need to write any code to get these results.
I wrote a program to help people understand these concepts. The program is called 'ExpandingForms' and is on the Farm or is available here.
Click here to download: SelectArea-CO-0.0.16.tar.gz