twinBASIC Update: May 13, 2024

Highlights include reduced RAM usage by the compiler and an update to fafalone's Drag & Drop Demo project.

twinBASIC Update: May 13, 2024

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 Monday, 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, please leave a comment below.

Here are some links to get involved with the project:


Highlights

Reduced RAM Usage

From Wayne Phillips via Discord:

Whilst many of you are waiting for the MDI support, I thought I'd drop a little update in the meantime.  BETA 533 offers upto 20% less RAM use by the compiler process.  e.g. PhotoDemon now opens at about 773MB rather than 932MB (about 17% reduction) in recent betas on my test machine.

Discord Chat Summary

* Auto-generated via Claude-2-100k on poe.com

General Channel

The twinBASIC Discord chat this week covered a range of topics, from celebrating BASIC's 60th anniversary to troubleshooting issues with ActiveX controls and embedding console windows in forms. Developers discussed recent releases of other BASIC dialects and explored ways to further publicize twinBASIC to reach new audiences.

Key points from the conversations:

  • smallvisualbasic suggested twinBASIC aim for a major release on May 21st to coincide with VB's 33rd birthday, but fafalone noted 1.0 likely won't be ready by then.
  • Visual Small BASIC, Chloe System, and QB64 Phoenix all released new versions to celebrate BASIC's 60th anniversary on May 1st.
  • fafalone worked with waynephillipsea to fix an issue with usercontrol icons being scaled down too small in the IDE. A CSS rule was updated to resolve it.
  • adamryan2930 had trouble getting a VB6 ActiveX usercontrol to show up in the twinBASIC toolbox after importing it. The "Use ActiveX Controls" setting needed to be enabled and the project saved before it would appear.
  • swgak asked about launching an interactive CMD shell from twinBASIC and reading/writing to it. fafalone provided a VBForums link with sample code, but it caused the twinBASIC debugger to lock up.
  • mansellan joked about the lack of a "Form Layout Window" in twinBASIC, a rarely used VB6 feature that showed a thumbnail preview of where a form would appear on screen.
  • kimpos tested loading PNG images with transparency and found the transparency was lost when loaded into a PictureBox control. gcuser99 noted that Global.LoadPicture honors transparency in some cases like COM ribbon buttons.

In summary, the week's discussions touched on twinBASIC's development progress compared to other BASICs, resolving UI glitches in the IDE, importing legacy VB6 components, and various graphics and shell interaction capabilities. While a 1.0 release is still a ways off, steady progress is being made in adding features and fixing issues as twinBASIC advances.

Around the Web

DragDropDemo v4 Released with TotalCommander Bug Fix

From fafalone as posted in the Discord show-and-tell channel:

First, if you haven't seen it before DragDropDemo was one of the first tB sample projects I released. It's a 64-bit compatible port of my cDragDrop.cls VB6 project to show modern drag-drop images on your drop target. Of some interest, this project predates WinDevLib, and was originally largely to demonstrate using tB's new interface-defining syntax to define them locally. So just the required interfaces are defined, right in the project, in ShellInterfaces.twin.

The update: Apparently quite a few people use a file explorer called TotalCommander. Something about the way it does dragdrop caused an error in the DragDropHelper object, so my class didn't work with it. But it turns out the error is unrelated to the most common way of retrieving filenames, so it will work if you just suppress the errors. The update now ignores errors in the (optional) DragDropHelper object-- if one occurs, you won't get the modern drag image, but dragdrop will still work to get file names, the most important part.
GitHub - fafalone/DragDropDemo
Contribute to fafalone/DragDropDemo development by creating an account on GitHub.

Changelog

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.

ChatGPT Changelog Summary

* Auto-generated via ChatGPT, sorted in order of ChatGPT's opinion of "most impactful changes."

  • Improved Compiler Efficiency: Achieved a 10-20% reduction in RAM consumption during compilation, enhancing performance.
  • Enhanced Form Designer Usability:
    • Forms no longer crash when using windowless controls inside ActiveX containers.
    • Anchored controls in the form designer now remain fixed unless the SHIFT key is pressed during resizing, preventing unintended repositioning.
    • Toolbox icons for User Controls/ActiveX controls in the form designer are no longer reduced, improving visibility.
  • Stabilized User Interface Components: Fixed several issues affecting the stability and functionality of User Controls and ActiveX controls, including focus and custom painting problems.
  • Refined Overload Resolution: Improved method overload resolution, now treating 'Nothing' as an exact match for any interface type, streamlining code behavior.
  • Enhanced Error Handling in Form Designer: Added informative error messages with clipboard-copy functionality when encountering bad JSON, improving debug efficiency.

WARNING: The following issues are present in BETA builds 424 - 536 (the latest build as of publication):

BETA 530

  • fixed: forms would crash if windowless controls (Label/Image/Shape/Line) were used inside ActiveX containers [ Stu, discord ]
  • improved: OS TextScaleFactor setting no longer affects the form designer (note: value is cached at IDE startup) [ sokinkeso, discord ]
  • improved: in the form designer, anchored controls do not auto reposition when a container is resized unless SHIFT key is pressed when dragging the resizers [ fafalone, discord ]
  • fixed: Attribute MemberName.VB_MemberFlags = "40" was not passing through to the generated type library like [Hidden] attribute was [ Tecman, discord ]

BETA 531

  • improved: Form designer toolbox icons for UC/AX controls now not reduced to 65% [ fafalone, discord ]

BETA 532

  • fixed: custom painting of non-client areas in WM_NCPAINT for UCs was not effective in design mode IViewObject::Draw implementation [ Tecman, discord ]
  • fixed: (regression since BETA 527) UC/ActiveX control focus issue [ vbuser, discord ]
  • fixed: (regression) Command button click not firing when inside popup PictureBox inside a UC [ fafalone, discord ]

BETA 533

  • improved: typical 10-20% reduction in compiler RAM consumption

BETA 534

  • fixed: (regression) stability issues in BETA 533

BETA 535

  • improved: form designer loading now shows a proper message with clipboard-copy ability when bad JSON is detected [ Erwin69, vbforums ]

BETA 536

  • improved: overload resolution is now refined so that 'Nothing' is accepted as an exact match for any interface type [ fafalone, discord ]

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