Page 3 of 10

Re: Did you know?

Posted: Friday 22nd September 2017 9:25am
by stevedee
In Form view:-
- If you select the width property of a control, the up/down arrows increase/reduce the width.
- If you select the height property of a control, the up/down arrows increase/reduce the height.
- If you select the X property of a control, the up/down arrows move the control right/left.
- If you select the Y property of a control, the up/down arrows move the control down/up.

Re: Did you know?

Posted: Friday 22nd September 2017 2:19pm
by cogier
So it does. Interestng. I knew that using the mouse wheel had that effect.

Re: Did you know?

Posted: Friday 22nd September 2017 2:38pm
by cogier
This does not work with the Cinnamon Desktop as the key stroke is reserved for showing all Virtual Desktops. In the Gambas IDE put the cursor on a line and press [Ctrl]+[Alt]+[Up Arrow]. This will move the whole line up and will jump over other lines. [Ctrl]+[Alt]+[Down Arrow] will move it down. This also works in Writer (for the whole paragraph).

Re: Did you know?

Posted: Wednesday 16th May 2018 1:46pm
by stevedee
Something I don't do very often is set the "tab" order for controls on a Gambas form. Consequently I struggle to remember how its done.

In Visual Basic it was straightforward, you just gave the "TabIndex" property a suitable integer value. If "TabStop" for a control was set to false, then that control would not respond to Tab.

In Gambas it is a little obscure; go to the Properties view, select Hierarchy and move items in the list via up/down arrows so they tab in the required order. The property "NoTabFocus" determines whether or not a control responds to Tab.

Re: Did you know?

Posted: Thursday 17th May 2018 9:43am
by didier18
Hello

Very good idea this "Did you know?" section. initiated by cogier. Thank you.

So, did you know? It is possible to compare values, see which routine is called by which routine and optimize its code. To see the execution time of a command, a routine and even a complete program. This tool can be found in the menu /Debug/Activate profiling.
Once this menu is selected, launch the program to be tested as you would normally do... Then close your program. A window will open (as in the example) and you can view the profiling.
Even louder... It is possible to save the profiles, which allows you to compare the evolution with the different versions of your program.
But of course you already knew...

Have a nice day.

Re: Did you know?

Posted: Tuesday 26th June 2018 3:02pm
by cogier
Did you know you can easily move a line, or multiple lines, of code up or down in the editor. Just place the cursor on the line, or highlight the lines, you want to move and press [Alt]+[Up Arrow] (or [Down Arrow]). 8-)

Re: Did you know?

Posted: Wednesday 27th June 2018 3:35pm
by jornmo
I doo :lol:

Re: Did you know?

Posted: Tuesday 25th September 2018 2:42pm
by cogier
Here's one I didn't know:-
Dim siRand1, siRand2, siRand3, siRand4 As Short = Rand(0, 9)
This generates random numbers for each variable.

Try this: -
Public Sub Form_Open()
Dim siCount As Short

For siCount = 1 To 10
  Print Generate()
Next

End

Public Sub Generate() As String
Dim siRand1, siRand2, siRand3, siRand4 As Short = Rand(0, 9)

Return Str(siRand1) & Str(siRand2) & Str(siRand3) & Str(siRand4)

End
Result: -
8752
9344
1387
3623
2006
9061
9834
3499
8392
4388

Re: Did you know?

Posted: Thursday 27th September 2018 5:05pm
by jornmo
Remember to use this first:

http://gambaswiki.org/wiki/lang/randomize

Re: Did you know?

Posted: Saturday 29th September 2018 2:27am
by Quincunxian
While in form design view, if you right click on any control in the bottom right hand corner...
ie a button control, it will open the help about that control.