twinBASIC Update: October 2, 2022

Highlights include a pile of new form and control properties, a form menu designer, visual tab stop indicators in design view, and a new twinBASIC LinkedIn group.

twinBASIC Update: October 2, 2022

On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference.  I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025.  With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.

Every Sunday, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project.  If you come across items that should be included here, tweet me @NoLongerSet or email me at mike at nolongerset dot com.

Here are some links to get involved with the project:


Form and Control Improvements

Wayne was busy this week!

Listed below are all the newly implemented form and control properties, methods, and events:

  • .Parent for all controls (refers to the Form object)
  • .BorderStyle for all controls (was previously read-only at runtime)
  • Form.[_Default]
  • Form.Count
  • Form.PopupMenu
  • Form.Icon
  • [_HiddenModule].ConvertIconToBitmap
  • Menu control (partially implemented)
  • Menu.Name, .Caption, .Checked, .Enabled, .Tag, .Visible, .Picture
  • Menu.IconSizeX, .IconSizeY (for choosing which image to use in a multi-image ICO file)
  • Menu Click event
  • PictureBox.Appearance
  • Image.Appearance
  • Frame.ClipControls, .BorderStyle
  • PictureBox.GotFocus, .LostFocus, .KeyDown, .KeyPress, .KeyUp, .Change
  • DirListBox.Scroll event, DirListBox.WheelScrollEvent boolean property
  • FileListBox.Scroll event,FileListBox.WheelScrollEvent boolean property
  • PictureBox.[_Default]
  • Frame.[_Default]
  • Shape.[_Default]
  • Line.[_Default]
  • Image.[_Default]
  • Menu.[_Default]

For a full list of all the properties not yet implemented, see here: List of ALL missing / unimplemented intrinsic control properties and methods.

Integrated Menu Designer

For standard EXE projects, there is now an integrated menu designer.

The menu designer allows you to easily build a full menu system by just left-clicking on the green "+" icons to create new menu items and menu sub-items.  Right-clicking brings up a menu to rearrange the menu items and toggle their .Checked, .Enabled, and .Visible properties on and off.  

Double-clicking a menu item automatically creates a Menu_Click event handler and switches focus to the code-behind tab:

Show Control Outlines and Tab Index in Form Design View

There is now an option to show outlines of all controls in the form designer.

This is especially useful for labels and other controls with a transparent border.  When "Show Outlines" is checked, a dotted line appears around the outside of every control.  Additionally, when you hold down the [Ctrl] key, the tab index values of the controls appear in bright yellow overlaid circles to make it easier to visually identify incorrect tab ordering.  

I'm not aware of any other form designers with this feature (I'm sure they exist), but it looks like something that would be very handy.

Around the Web

twinBASIC LinkedIn Group

Mark Burns has started a LinkedIn group for twinBASIC and VBx enthusiasts.  

You can join the group here: twinBASIC/VBx Special Interest Group.

Object Browser on the Horizon

From Wayne:

I think we'll definitely be wanting an Object Browser.

I've been considering, perhaps as an (easy to implement) initial alternative, perhaps we could have the references node list each reference, and then clicking on the individual reference displays a document containing the tB equivalent definitions of each type... like the IDL source, but with tB syntax.  That could be put together pretty quickly.


Here are the updates from the past week.  You can also find this information by visiting the GitHub twinBASIC Releases page.

Releases · WaynePhillipsEA/twinbasic
Contribute to WaynePhillipsEA/twinbasic development by creating an account on GitHub.

BETA 129

  • improved: PictureBox.Appearance is now implemented [ ]
  • improved: Image.Appearance is now implemented [ ]
  • improved: Frame.ClipControls is now implemented [ ]
  • improved: Frame.BorderStyle is now implemented [ ]
  • fixed: compiler restart in some instances when there were cross-file references in Interface inheritance [ ]
  • improved: form designer; property sheet scroll position is now retained when changing a property value [ ]
  • improved: form designer; control drag points are now 1px smaller [ ]
  • improved: form designer; non-visual controls size reduced to match VBx [ ]

BETA 130

  • improved: Menu control is now partially implemented [ ]
  • improved: an integrated menu designer is now integrated into the form designer
  • improved: Form.PopupMenu is now implemented [ ]
  • added: Menu.Picture property (new to tB)
  • improved: Menu.Name / Caption / Checked / Enabled / Tag / Visible properties and Click event are now implemented
  • fixed: corrected use of 'Control' as an implemented interface for all controls, now allowing for IDispatch calls to pass through to the outer class
  • fixed: Form.Controls collection was not working in compiled EXEs/DLLs
  • fixed: (regression) Sample 8 (FilePropertyViewer) had broken due to recent changes in package exposure

BETA 131

  • fixed: Menu.Picture now supports images in ICO format
  • added: Menu.IconSizeX and Menu.IconSizeY for choosing which image to use in a multi-image ICO file
  • added: [_HiddenModule].ConvertIconToBitmap for converting StdPicture Icons to StdPicture 32-bit RGBA Bitmaps (temporary API location)
  • fixed: Form.PopupMenu was treating X/Y values as screen coordinates, not client coordinates [ ]
  • fixed: Picture properties could not be removed from within the form designer; new red-X button to remove the set picture [ AlienSoft, discord ]
  • fixed: ReadOnly is now allowed as class field name [ kimpos, private ]

BETA 132

  • added: (EXPERIMENTAL) holding the Ctrl key in the form designer now gives a faint outline on all controls, and shows the TabIndex for controls with TabStop = True [ ]
  • fixed: Form class extensibility is now allowed so that you can access public members of forms via the general Form class [ ]
  • fixed: passing a non-Object variable to ByRef-Object error in tB, where VBx allowed it [ ]
  • added: project setting Project: Application Title (and associated VBP import facility)
  • improved: App.Title property is now implemented [ ]
  • added: IDE setting of IDE: Use new Handles/Implements syntax (default OFF) to choose between syntax for newly added events and implementations
  • added: Interface XYZ Extends Nothing special syntax for allowing own, unrestricted, definitions of IUnknown [ fafalone, discord ]
  • added: {ALL_CONTROLS}.Parent property (Form) [ ]
  • added: implemented PictureBox.GotFocus/LostFocus/KeyDown/KeyPress/KeyUp events [ ]
  • fixed: (regression) Control class was not being exposed [ ]
  • added: {ALL_CONTROLS}.BorderStyle property was ReadOnly at runtime [ ]

BETA 133

  • added: form designer option "Show Outlines" under the grid options (hover over the grid icon) [ ]
  • fixed: TextBox.Change event was wrongly marked as Unimplemented
  • fixed: ComboBox.Change/DblClick/DropDown events were wrongly marked as Unimplemented
  • fixed: Form.Picture/PictureBox.Picture/Image.Picture/Menu.Picture can also now be changed without the Set keyword (prop-put is now implemented, as per VBx) [ vbforums ]
  • added: PictureBox.Change event is now implemented [ ]
  • added: DirListBox.Scroll event is now implemented [ ]
  • added: DirListBox.WheelScrollEvent boolean property is now implemented
  • added: FileListBox.Scroll event is now implemented [ ]
  • added: FileListBox.WheelScrollEvent boolean property is now implemented
  • added: Form.[_Default] property is now implemented [ ]
  • added: Form.Count property is now implemented [ ]
  • added: PictureBox.[_Default] property is now implemented [ ]
  • added: Frame.[_Default] property is now implemented [ ]
  • added: Shape.[_Default] property is now implemented [ ]
  • added: Line.[_Default] property is now implemented [ ]
  • added: Image.[_Default] property is now implemented [ ]
  • added: Menu.[_Default] property is now implemented [ ]
  • fixed: TextBox.Change event was incorrectly firing during initialization

BETA 134

  • improved: ReadOnly field name support [ kimpos, private ]
  • fixed: type library parser crash on encountering alias/typedef to external coclass [ wqweto, discord ]

BETA 135

  • fixed: overload parameter resolution algo could potentially lead to a crash (even with no overload usage) [ wqweto, private ]
  • improved: import VBP now shows the current line of the IMPORT_LOG in case the import gets stuck [ wqweto, discord ]
  • fixed: Form.Icon is now implemented [ ]
  • fixed: some issues regarding the debugged process forms not always appearing in front of the IDE window

All original code samples by Mike Wolfe are licensed under CC BY 4.0