Share My Creation BasicIDE Suite 4 - Now even further improved

Here we have (yet) another updated version of BasicIDE Suite, my on device development environment.

Basic IDE Suite has three components.


BasicIDE

An on-device development environment which uses the BasicLib B4A library to provide the language interpreter for the IDE. This latest version has a modified editor that provides syntax highlighting and auto-completion for the B4AScript language, the Basic IDE Script extensions and the variable and Sub declarations of the current program. It has error line highlighting together with search and replace. A major addition to the Script extensions are non-modal versions of the original modal user interface dialogs, and the elimination of modal dialogs from Basic IDE itself, apart from the script break and step facility which requires it. There is a discussion of modality and its implications in Basic IDE and its program in a topic in the help file for Basic IDE.

Editor.png



BasicIDE Designer

An on-device visual designer that is used to produce view layouts for use in Basic IDE programs. This version provides both landscape and portrait variants.

Designer.png



BasicIDE Launcher

An app that can quickly run a selected Basic IDE program and whose project can very easily be copied, slightly modified and recompiled by B4A to produce a stand-alone APK of a Basic IDE program that can be installed to a device and run independently as a normal B4A app.


BasicIDE Suite 4 improvements

There are some major improvements over BasicIDE Suite 3 which are as follows

1) Minor UI changes and simplified IME handling internally. InputFile now has colour and text size options.

2) GNSS now returns Galileo information if available. UK National Grid to/from GNSS lat long transformations added.

3) Breaking changes to MessageBox and InputBox (which are deprecated anyway but do work still) to better correspond with the equivalent Async functions.

4) Script module IIF function renamed to IfThenElse owing to a clash when compiling with the IIF keyword added to B4A in v11.0.

6) Script module supports #include to help modularise programs and keep file sizes in the editor down. Subs only, no global definitions in included files but equivalent persistent values available by two new functions SaveValue(valuename, value) and RestoreValue(valuename) As returnvalue.

7) The BasicIDE editor now supports 'flinging'. I'm pleased with this. It was an obvious missing feature that I tried and failed to add before because I couldn't see the wood for the trees. Thanks JesseW!

8) The size of the Autocomplete popup window is now a user variable option.

9) The BasicIDE editor now persists the values for the AutocompleteMode, AutocompleteHeight, AutocompleteThreshold, Font, FontSize, SmallFontSize and IndentSize menu options

10) Both BasicIDE and BasicIDE Designer support projects to enable the isolation of groups of related program files.

11) All the help files in the Files folder may be updated after changing the .chm help files or the Script module by running a new program, UpdateHelp.exe. BasicIDE detects when these have changed and copies them from DirAssets to the device BasicIDE Help folder when required.


Important

Read the downloaded Readme file and the Overview section of BasicIDE.chm or BasicIDE.html for both device and desktop installation instructions to achieve the correct project folder structure. These files are located in the BasicIDEHelp zip file.

Before extracting the BasicIDEHelp zip file it should be unblocked by right clicking on it in File Explorer, selecting Properties and checking Unblock at the lower right of the General tab. In particular this allows the .chm help files to be properly displayed by Windows and allows UpdateHelp.exe to run without a security warning. If the .chm files are not unblocked their content will not be available in the Windows help viewer. The files may be individually unlocked later if this step is omitted.


Minor Bug

The bug symptom is that the autocomplete popup window appears as a single line located at the top of the editor rather than being located perched on top of the IME. See Post #2 below for the explanation and fix.


Updates

BasicIDE version 6.00 posted in BasicIDE_v6.00.zip together with updated help in Help_6.00.zip. See post #5 for details


If you get the "unknown member: textsize" error when compiling BasicIDE download Dialogs2 version 1.2 from the link in post #7 below. The one included in the BasicIDELibraries archive appears to be version 1.1 which lacks the FileDialog TextSize property. Sorry, my bad!
 

Attachments

  • BasicIDEDesigner.zip
    291.1 KB · Views: 183
  • BasicIDELauncher.zip
    130.3 KB · Views: 167
  • BasicIDELibraries_4.zip
    248.6 KB · Views: 180
  • Readme.txt
    4.7 KB · Views: 184
  • BasicIDE_v6.00.zip
    475.3 KB · Views: 170
  • Help_6.00.zip
    374.7 KB · Views: 154
Last edited:

agraham

Expert
Licensed User
Longtime User
I have found a minor bug that I overlooked when adding the fling capability to the editor. It only occurs on one of my five testing devices, a Galaxy Tab A 8, which is why I have only just found it. The bug symptom is that the autocomplete popup window appears as a single line located at the top of the editor rather than being located perched on top of the IME. This is because in the IME HeightChanged event I overlooked changing the position of the popup from the edtSource height to the svFling height. The new code should look as below.
B4X:
Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int)
  ...      
  ' this will sit the dropdown above the IME
  'edtSource.AutoVerticalOffset = edtSource.Height  -  Commented out old line
  edtSource.AutoVerticalOffset = svFling.Height ' new corrected setting
  ...
End Sub
It's odd that most devices don't need this but I guess there is something a bit different in the Samsung but as it's the only Samsung device I have I don't know if it just a quirk of that particular model.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
It uses my CodeEditorView control which is a wrap of this project

which in turn is a thin veneer on top of
android.widget.MultiAutoCompleteTextView;

It's keyword tokeniser was a bit limited so I rewrote it but its only a few lines of code. I haven't posted it as a library but the XML should be reasonably well commented to use elsewhere if required. The jar and xml are in the BasicIDELIbraries zip file. You are welcome to my source codes if you did want a play with it.
 

agraham

Expert
Licensed User
Longtime User
In adding KVS to BasicIDE to persist some IDE values I overlooked the case for a fresh install without installing over a previous install that already has file permissions. Because of the way that Resumable Subs work waiting for the permission causes both Activity_Resume to run as the wait returns from Activity_Create and then Activity_Pause runs as the permission dialog is shown. As Resume tries to read the KVS values and Pause tries to save them the lack of file permissions causes errors that prevent operation of the BasicIDE. This is now fixed. I'm surprised that apparently none of the down-loaders have encountered this as it is a show stopper for new installs.

A continual problem with BasicIDE over the years has been the poor API to the IME and inexplicable variations in behaviour between different device and soft keyboard combinations when an Activity is paused and resumed with the keyboard open. I have finally thrown in the towel and locked the editor into portrait orientation, though scripts can still support device rotation if required. This allows predictable behaviour on Resume. There are further comments in the Main activity code in the version history and the IME_HeightChanged event.

The Autocomplete Height menu option now has an Auto option that will auto-size the popup window to accommodate the available options, and is scrollable if the number of options exceeds the maximum height available for the popup window.
 

JesseW

Active Member
Licensed User
Longtime User
Upon loading the project, I have an "unknown member: textsize" error on line 5952, shown as line 6 below, in the Script module
B4X:
Sub AsyncInputFile(filepath As String, filename As String, filefilter As String, title As String, Positive As String, Cancel As String, Negative As String, _
            cancellable As String, callback As String, paramsarrayname As String)
    Dim params() As String = BlibGetAsyncArray(paramsarrayname)
    Dim F As FileDialog
    F.TextColor = InputFileColor
    If InputFileTextSize > 0 Then F.TextSize = InputFileTextSize
    F.filepath = filepath
    F.ChosenName = filename
    F.filefilter = filefilter
    Try
        Dim o As Object = F.ShowAsync(title, Positive, Cancel, Negative, Null, cancellable)
        Wait For (o) Dialog_Result(response As Int)   
        input = F.filepath & "," & F.ChosenName
        params(0) = response
    Catch
        params(0) = DialogResponse_Cancel
        input = LastException.Message       
    End Try
    If Blib.CanCall(callback) Then
        Blib.Call(callback, params)
    End If
End Sub
 

agraham

Expert
Licensed User
Longtime User
Looks like you have an out of date Dialogs2 library
 

tech2k

Member
Licensed User
Longtime User
Upon loading the project, I have an "unknown member: textsize" error on line 5952, shown as line 6 below, in the Script module
B4X:
Sub AsyncInputFile(filepath As String, filename As String, filefilter As String, title As String, Positive As String, Cancel As String, Negative As String, _
            cancellable As String, callback As String, paramsarrayname As String)
    Dim params() As String = BlibGetAsyncArray(paramsarrayname)
    Dim F As FileDialog
    F.TextColor = InputFileColor
    If InputFileTextSize > 0 Then F.TextSize = InputFileTextSize
    F.filepath = filepath
    F.ChosenName = filename
    F.filefilter = filefilter
    Try
        Dim o As Object = F.ShowAsync(title, Positive, Cancel, Negative, Null, cancellable)
        Wait For (o) Dialog_Result(response As Int)  
        input = F.filepath & "," & F.ChosenName
        params(0) = response
    Catch
        params(0) = DialogResponse_Cancel
        input = LastException.Message      
    End Try
    If Blib.CanCall(callback) Then
        Blib.Call(callback, params)
    End If
End Sub
Did you ever get yours working? I had the same error as you when the IDE opened, updated the library and solved that but I still get the same error about 2/3 of the way through the option to compile and run.
 

agraham

Expert
Licensed User
Longtime User
I had the same error as you when the IDE opened,
What error when the IDE was opened and which IDE, the B4A IDE or BasicIDE?

If the error is "unknown member: textsize" when trying to compile BasicIDE see post #7 above. You haven't got Dialogs2 whose FileDialog has a TextSize property. Download Dialogs2 version 1.2 from the link in post #7 below. The one included in the BasicIDELibraries archive appears to be version 1.1 which lacks the FileDialog TextSize property. Sorry, my bad!
 
Last edited:

tech2k

Member
Licensed User
Longtime User
What error when the IDE was opened and which IDE, the B4A IDE or BasicIDE?

If the error is "unknown member: textsize" when trying to compile BasicIDE see post #7 above. You haven't got Dialogs2 whose FileDialog has a TextSize property. Download Dialogs2 version 1.2 from the link in post #7 below. The one included in the BasicIDELibraries archive appears to be version 1.1 which lacks the FileDialog TextSize property. Sorry, my bad!
Abraham,

Thank you so so much for that fast reply. Of course it was user error on my part but you pointed me in the right direction. I had previously updated the dialogs2 but somehow missed the jar file when overwriting the old version (only had the correct XML when checking the date modified).

I now have everything compiled and installed on Android 12 pixel 3A XL. A quick check in the designer I could add a panel and stretch it horizontal but could not get it to size vertical. This is also probably a error on my part and I will look at everything close this weekend.

When trying to open a help file from within the app it tells me I need a version of Microsoft edge installed to view. I am able to use my files app and open them in Chrome so I will read through those as well.

I am using b4a v11.2 and my target platform is 30 and think I read something last weekend about needing 28 or 31. I'll look into that some more. I've had success with previous versions of your work that needed the separate help folder and whatnot but you've made many changes in improvements.

Thanks 👍👍

Edit to add : still fiddling with it, it's addictive. Haven't solved the Microsoft edge error for viewing the help within the app but I can resize the panels and it looks like I need to use API 28. I've copied in your scripts after reading more of the new and greatly expanded help files and they are working. Both you and Earl are genius :)
 
Last edited:

agraham

Expert
Licensed User
Longtime User
I need a version of Microsoft edge installed to view.
I did that as automatically opening a browser for help saves the user some steps to select it and I chose Edge as it seems to give the best default rendering for the help. As you have the source then make it open Chrome instead.

looks like I need to use API 28.
You can switch to MANAGE_EXTERNAL_STORAGE permission. There is already some code commented out in Main.Activity_Create but I would now use my ManageExternalStorage class from the project in this link. The project also has the conditonal code in Main.Activity_Create to select the appropriate permission according to the API of the device.
 

tech2k

Member
Licensed User
Longtime User
I did that as automatically opening a browser for help saves the user some steps to select it and I chose Edge as it seems to give the best default rendering for the help. As you have the source then make it open Chrome instead.


You can switch to MANAGE_EXTERNAL_STORAGE permission. There is already some code commented out in Main.Activity_Create but I would now use my ManageExternalStorage class from the project in this link. The project also has the conditonal code in Main.Activity_Create to select the appropriate permission according to the API of the device.
I changed back to API 28 for the designer, edited source for Chrome to view help and installed A-CHM on my device as well.

Everything seems to be working perfectly now 👍

Thanks!!! :) :)
 
Top