Warning message in IDE when running app

New to Gambas? Post your questions here. No question is too silly or too simple.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Warning message in IDE when running app

Post by BruceSteers »

If you set the main forms Persistent property to True then i think it fixes it as the windows config is not destroyed when closing it.

I edited the prog a little to make it also use the "Stop Event" command if arrow keys are pressed with Ctrl otherwise the arrow keys were also changing button focus. using "Stop Event" stops the default key press things happening if you are doing other things :)
  If Key.Control And [Key.Up, Key.Down, Key.Left, Key.Right].Exist(Key.Code) Then 
    Moveform(Key.Code)
    Stop Event 
  Endif
and condensed it to run another function..
Public Sub Moveform(KeyCode As Integer)
  
  Select KeyCode
    Case Key.Up
      Dec Me.Window.Top
    Case Key.Down
      Inc Me.Window.Top
    Case Key.Left
      Dec Me.Window.Left
    Case Key.Right
      Inc Me.Window.Left
  End Select
  
End

Ignore the fact i used Me.Window.Top and not Me.Top I was experimenting to see if it made a difference.
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Warning message in IDE when running app

Post by BruceSteers »

BruceSteers wrote: Saturday 4th December 2021 4:59pm If you set the main forms Persistent property to True then i think it fixes it as the windows config is not destroyed when closing it.
Eek sorry no it does not :(

gambas does have issues with form co-ords replacement. My desktop app will not work correctly either. if i change window border property it then gives wrong coords and when reloading the window is incorrectly positioned :(
If at first you don't succeed , try doing something differently.
BruceS
Diverod
Posts: 28
Joined: Friday 12th November 2021 1:31am
Location: North Central Florida

Re: Warning message in IDE when running app

Post by Diverod »

Just thought I’d post the final version of this utility after correcting a minor issue with displayed height. I really appreciate the help from Cogier with cleaning up the layout of the main form and general code improvement and BruceSteer for proper key code handling and his RunFree Class.

I still haven’t found a good alternative for the Wait command but eventually maybe something will come to me when I’m not thinking about it so hard. I learned a lot on this one, especially that I’ve got a lot more to learn.

Thanks to all, RodG.
Attachments
ScreenCap 0.1.8.tar.gz
(84.91 KiB) Downloaded 170 times
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Warning message in IDE when running app

Post by BruceSteers »

Diverod wrote: Saturday 11th December 2021 11:05pm Just thought I’d post the final version of this utility after correcting a minor issue with displayed height. I really appreciate the help from Cogier with cleaning up the layout of the main form and general code improvement and BruceSteer for proper key code handling and his RunFree Class.

I still haven’t found a good alternative for the Wait command but eventually maybe something will come to me when I’m not thinking about it so hard. I learned a lot on this one, especially that I’ve got a lot more to learn.

Thanks to all, RodG.
Cool app.

I have an idea about the wait issue.
Do not even hide the main form,
just capture the area inside the picturebox view.
hide the colour panel if needed and then grab the area of the PictureBox that's showing the screen beneath (as this is the area it looks like you'll get) not the entire form size area. then the main form can remain open, no more problem :)

Just a thought :)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply