SmallBasic : List of Fremy's bugs and suggesions
Here's a maintained list of bugs and suggestion for Small Basic
If you have suggestions or bugs to repport, you can put comment on this page or use the forum of SmallBasic (when it will work, because he's down at this time).
[0.2-all] Bad Mouse.HideCursor / Mouse.ShowCursor gesture
The cursor doesn't always appear/dispear on demand. Sometimes, we need a lot of try to do the job.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
' Variables SMouse = 0 XMouse = 0 YMouse = 0 DeltaMouseX = 0 DeltaMouseY = 0 IsMouseVisible = 0
' Init window InitWindow()
Sub InitWindow GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown= OnMouseDown SMouse = GraphicsWindow.AddRectangle(10,10) GraphicsWindow.FillRectangle(GraphicsWindow.Width-10,0, 10, GraphicsWindow.Height) GraphicsWindow.FillRectangle(0,0, 10, GraphicsWindow.Height) GraphicsWindow.FillRectangle(0,0, GraphicsWindow.Width, 10) GraphicsWindow.FillRectangle(0,GraphicsWindow.Height-10, GraphicsWindow.Width, 10) GraphicsWindow.Show() EndSub
Sub OnMouseDown GraphicsWindow.ShowMessage(IsMouseVisible,"") EndSub
Sub OnMouseMove CalcMousePos() DetermineIfMouseIsVisible() If IsMouseVisible = "True" Then For x = 0 To 10000 Mouse.HideCursor() EndFor GraphicsWindow.MoveShape(SMouse, XMouse, YMouse) Else For x = 0 To 10000 Mouse.ShowCursor() EndFor GraphicsWindow.MoveShape(SMouse, -20, -20) EndIf EndSub
Sub CalcMousePos XMouse = GraphicsWindow.MouseX YMouse = GraphicsWindow.MouseY DeltaMouseX = Mouse.MouseX - GraphicsWindow.MouseX DeltaMouseY = Mouse.MouseY - GraphicsWindow.MouseY EndSub
Sub DetermineIfMouseIsVisible IsMouseVisible = "False" If Mouse.MouseX-10 > DeltaMouseX Then If Mouse.MouseX+10 < DeltaMouseX+GraphicsWindow.Width Then If Mouse.MouseY-10 > DeltaMouseY Then If Mouse.MouseY+10 < DeltaMouseY+GraphicsWindow.Height Then IsMouseVisible = "True" EndIf EndIf EndIf EndIf EndSub |
[0.2-all] It's not possible to follow the mouse outside the window's workarea
There's no 'Mouse.*' events that apply to the whole screen, and the GWin's events are called not quickly enough, so the mouse can leave the form form a non-border position (the last onmousemove event that get called is not the last real move on the form)
Workaround :
Use a loop and watch for Mouse.MouseX/Y change
'' Endless Main Loop
' While "True"="True"
' DetermineIfMouseIsVisible()
' If (IsMouseVisible="False") Then
' Mouse.ShowCursor()
' Else
' Mouse.HideCursor()
' EndIf
' Program.Delay(250)
' EndWhile
' GraphicsWindow.ShowMessage("I will never be reached","")
[0.2-all] The GraphicWindow is auto-shown when we first set a property, even if Hide() was called just before
' We ask to don't show the window
GraphicWindow.Hide()
' We make the interface ready to be shown
' PROBLEM : THE WINDOW IS SHOWN AT THE FIRST INIT THING
InitWindow()
' We ask to show the window, but the window is already shown
GraphicWindow.Show()
[0.2-all] It's not possible to add events to shapes or know which element is hovered
We have no easy way to know when the user clicked on a shape, we need to compute it manually with the coordinates of the mouse and of the shape; it's even more difficult if we're playing with ellipses...
[0.2-all] It's not possible to do actions on images
There's no way to consider an image as a shape (and then get the ability to move them, ...)
[hided function] It's not possible to compile the code in a *.exe
It would be great to have an option in saving : *.sb or *.exe (the *.exe can be easily reopened later if you put the .sb code in a resource of the .exe) EDIT : The *.exe is automatically created when you click on the 'Run' button
Ce post vous a plu ? Ajoutez le dans vos favoris pour ne pas perdre de temps à le retrouver le jour où vous en aurez besoin :
François REMY est un jeune développeur belge plein d'entrain qui traite surtout des technologies du web et de DotNet dans ses articles.