Skip to content

Commit

Permalink
version update
Browse files Browse the repository at this point in the history
Added custom border options for Label control
Replaced Krool's VBCCR with new FileDialog class
Refactored Toggle Button processing
Modified JsonConverter to correctly handle system decimal separators other than "," and "."
Fixed bug caused by accessing/modifying VBE command bar in non-English language systems
  • Loading branch information
GCuser99 committed Dec 21, 2024
1 parent 551f88c commit 7c8f50c
Show file tree
Hide file tree
Showing 22 changed files with 873 additions and 137 deletions.
36 changes: 17 additions & 19 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# modified from https://github.com/DecimalTurn/VBA-on-GitHub/tree/main
# modified from https://github.com/DecimalTurn/VBA-on-GitHub
# read the excellent writeup there!

# By default, auto detect text files and perform LF normalization
* text=auto eol=lf
# VBA code (bas, cls, frm) - prevent LF normalization
*.[bB][aA][sS] -text diff
*.[cC][lL][sS] -text diff
*.[fF][rR][mM] -text diff

# VBA code (bas, cls, frm) - Prevent LF normalization
*.[bB][aA][sS] -text diff linguist-language=VBA
*.[cC][lL][sS] -text diff linguist-language=VBA
*.[fF][rR][mM] -text diff linguist-language=VBA

# VBA form (frx) - Mark as binary
# VBA UserForm (frx)
*.[fF][rR][xX] binary

# VBS - Prevent LF normalization
*.[vV][bB][sS] -text diff linguist-language=VBScript

# twinBASIC code (twin) - Prevent LF normalization
# twinBASIC native class/module (twin) - prevent LF normalization
*.[tT][wW][iI][nN] -text diff linguist-language=VBA

# twinBASIC form (tbform) - Prevent LF normalization
# twinBASIC native form (tbform) - prevent LF normalization
*.[tT][bB][fF][oO][rR][mM] -text diff linguist-language=JSON

# twinBASIC Resources (json, xml) - Prevent LF normalization
# twinBASIC resources (json, xml) - prevent LF normalization
*.[jJ][sS][oO][nN] -text diff
*.[xX][mM][lL] -text diff

# twinBASIC Project (twinproject) - Mark as binary
*.[tT][wW][iI][nN][pP][rR][oO][jJ] binary
# twinBASIC project (twinproj)
*.[tT][wW][iI][nN][pP][rR][oO][jJ] binary

# VBS - prevent LF normalization
*.[vV][bB][sS] -text diff linguist-language=VBScript

# Inno Setup (iss) - Prevent LF normalization
# Inno Setup (iss) - prevent LF normalization
*.[iI][sS][sS] -text diff

# Ini file - Prevent LF normalization
# Ini file - prevent LF normalization
*.[iI][nN][iI] -text diff

# Excel documents (xlam, xlsm)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A VBIDE add-in that converts VBA UserForms for use in [twinBASIC](https://twinba

***

The [twinBASIC](https://twinbasic.com/preview.html) (in Beta) does not yet support VBA UserForms. It does however have its own excellent (VB6 compatible) native Form designer and associated controls. This simple VBIDE add-in for MS Office applications converts a UserForm, its controls, images, and code into a twinBASIC form that can be imported directly into twinBASIC.
The [twinBASIC](https://twinbasic.com/preview.html) (in Beta) does not yet support VBA UserForms. It does however have its own excellent VB6-compatible native Form designer and associated controls. This simple VBIDE add-in for MS Office applications converts a UserForm, its controls, images, and code into a twinBASIC form that can be imported directly into twinBASIC.

This tool, compiled in twinBASIC, queries the state of the UserForm and each of its child controls at design time and builds the closest twinBASIC equivalent. For non-MS Forms controls or MS Forms controls not supported (see below), a twinBASIC Label or Frame control is substituted to flag the missing control. UserForm code is translated and exported in a format that can be imported into twinBASIC, along with the form.

Expand Down Expand Up @@ -54,6 +54,6 @@ The resulting imported form and code may have to be tweaked in twinBASIC to work

- Wayne Phillips' [twinBASIC](https://twinbasic.com/preview.html) and Sample 4: MyVBEAddin
- Tim Hall's [JsonConverter](https://github.com/VBA-tools/VBA-JSON/tree/master)
- Krool's [VBCCR](https://github.com/Kr00l/VBCCR) twinBASIC package
- Jon Johnson's [Windows Development Lib](https://github.com/fafalone/WinDevLib) twinBASIC package
- R. Beltran's [ArrayList](https://github.com/Theadd/ArrayList) twinBASIC package
- Jordan Russell's [Inno Setup](https://jrsoftware.org/isinfo.php) and Bill Stewart's [UninsIS](https://github.com/Bill-Stewart/UninsIS)
Binary file removed dist/tBUserFormConverter_win32.dll
Binary file not shown.
Binary file removed dist/tBUserFormConverter_win64.dll
Binary file not shown.
Binary file modified dist/tBUserformConverterSetup.exe
Binary file not shown.
Binary file added src/Build/tBUserFormConverter_win32.dll
Binary file not shown.
Binary file added src/Build/tBUserFormConverter_win64.dll
Binary file not shown.
17 changes: 10 additions & 7 deletions src/Resources/CONTROLS/Image.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,36 @@
"_className": "Anchors",
"_clsid": "{8524D4B5-72A9-40A9-A189-29E7905C40CA}"
},
"Angle": 0,
"Appearance": "vbAppear3d",
"BorderStyle": "vbNoBorder",
"DataField": null,
"DataFormat": null,
"DataMember": null,
"DataSource": null,
"Dock": "vbDockNone",
"DragIcon": [],
"DragIcon": "",
"DragMode": "vbManual",
"Enabled": true,
"Height": 94,
"Height": 26,
"Index": -1,
"Left": 66,
"MouseIcon": [],
"InternalSectionId": -1,
"Left": 25,
"MouseIcon": "",
"MousePointer": "vbDefault",
"Name": "Image1",
"OLEDragMode": "vbOLEDragManual",
"OLEDropMode": "vbOLEDropNone",
"Picture": [],
"Picture": "",
"PictureDpiScaling": true,
"Stretch": false,
"StretchMode": "vbStretchHalftone",
"Tag": null,
"ToolTipText": null,
"Top": 51,
"Top": 116,
"Visible": true,
"WhatsThisHelpID": 0,
"Width": 146,
"Width": 39,
"_className": "Image",
"_clsid": "{33AD4F90-6699-11CF-B70C-00AA0060D393}",
"_paintedByParent": true
Expand Down
43 changes: 35 additions & 8 deletions src/Resources/CONTROLS/Label.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,42 @@
"_className": "Anchors",
"_clsid": "{8524D4B5-72A9-40A9-A189-29E7905C40CA}"
},
"Angle": 0,
"Appearance": "vbAppear3d",
"AutoSize": false,
"BackColor": -2147483633,
"BackStyle": "vbBFOpaque",
"BorderCustomOptions": {
"Bottom": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Left": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Right": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Top": {
"Color": 0,
"Padding": 0,
"Size": 0
}
},
"BorderStyle": "vbNoBorder",
"Caption": "Label",
"DataField": null,
"DataFieldAggregate": "vbAggregateNone",
"DataFormat": null,
"DataMember": null,
"DataSource": null,
"Dock": "vbDockNone",
"DragIcon": [],
"DragIcon": "",
"DragMode": "vbManual",
"Enabled": true,
"FontBold": false,
Expand All @@ -29,26 +53,29 @@
"FontStrikethru": false,
"FontUnderline": false,
"ForeColor": -2147483630,
"Height": 27,
"Height": 68,
"Index": -1,
"Left": 20,
"InternalSectionId": -1,
"Left": 13,
"LineSpacing": 0,
"LinkItem": null,
"LinkMode": "vbLinkNone",
"LinkTimeout": 50,
"LinkTopic": null,
"MouseIcon": [],
"MouseIcon": "",
"MousePointer": "vbDefault",
"Name": "Label1",
"Name": "label1",
"OLEDropMode": "vbOLEDropNone",
"RightToLeft": false,
"TabIndex": 2,
"TabIndex": 1,
"Tag": null,
"ToolTipText": null,
"Top": 15,
"Top": 18,
"UseMnemonic": true,
"VerticalAlignment": "vbVerticalAlignTop",
"Visible": true,
"WhatsThisHelpID": 0,
"Width": 82,
"Width": 273,
"WordWrap": false,
"_className": "Label",
"_clsid": "{33AD4ED8-6699-11CF-B70C-00AA0060D393}",
Expand Down
109 changes: 104 additions & 5 deletions src/Sources/About.tbform
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"Height": 152,
"HelpContextID": 0,
"Icon": "",
"Index": -1,
"KeyPreview": false,
"Left": 0,
"LinkMode": "vbLinkNone",
Expand Down Expand Up @@ -77,7 +76,7 @@
"showGrid": true,
"showOutlines": false
},
"__lastUpdateMarker": 621404605,
"__lastUpdateMarker": 2724409468,
"_children": [
{
"Alignment": "vbLeftJustify",
Expand All @@ -89,13 +88,37 @@
"_className": "Anchors",
"_clsid": "{8524D4B5-72A9-40A9-A189-29E7905C40CA}"
},
"Angle": 0,
"Appearance": "vbAppear3d",
"AutoSize": false,
"BackColor": -2147483633,
"BackStyle": "vbBFOpaque",
"BorderCustomOptions": {
"Bottom": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Left": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Right": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Top": {
"Color": 0,
"Padding": 0,
"Size": 0
}
},
"BorderStyle": "vbNoBorder",
"Caption": "Info Label",
"DataField": null,
"DataFieldAggregate": "vbAggregateNone",
"DataFormat": null,
"DataMember": null,
"DataSource": null,
Expand All @@ -112,7 +135,9 @@
"ForeColor": -2147483630,
"Height": 68,
"Index": -1,
"Left": 13,
"InternalSectionId": -1,
"Left": 14,
"LineSpacing": 0,
"LinkItem": null,
"LinkMode": "vbLinkNone",
"LinkTimeout": 50,
Expand All @@ -125,8 +150,9 @@
"TabIndex": 1,
"Tag": null,
"ToolTipText": null,
"Top": 18,
"Top": 17,
"UseMnemonic": true,
"VerticalAlignment": "vbVerticalAlignTop",
"Visible": true,
"WhatsThisHelpID": 0,
"Width": 273,
Expand Down Expand Up @@ -190,8 +216,11 @@
"VisualStyles": true,
"WhatsThisHelpID": 0,
"Width": 89,
"_Default": false,
"_className": "CommandButton",
"_clsid": "{33AD4EF0-6699-11CF-B70C-00AA0060D393}"
"_clsid": "{33AD4EF0-6699-11CF-B70C-00AA0060D393}",
"_hasExclusiveCancelProp": true,
"_hasExclusiveDefaultProp": true
},
{
"Alignment": "vbLeftJustify",
Expand All @@ -203,13 +232,37 @@
"_className": "Anchors",
"_clsid": "{8524D4B5-72A9-40A9-A189-29E7905C40CA}"
},
"Angle": 0,
"Appearance": "vbAppear3d",
"AutoSize": false,
"BackColor": -2147483633,
"BackStyle": "vbBFOpaque",
"BorderCustomOptions": {
"Bottom": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Left": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Right": {
"Color": 0,
"Padding": 0,
"Size": 0
},
"Top": {
"Color": 0,
"Padding": 0,
"Size": 0
}
},
"BorderStyle": "vbNoBorder",
"Caption": "Website Label",
"DataField": null,
"DataFieldAggregate": "vbAggregateNone",
"DataFormat": null,
"DataMember": null,
"DataSource": null,
Expand All @@ -226,7 +279,9 @@
"ForeColor": -2147483630,
"Height": 18,
"Index": -1,
"InternalSectionId": -1,
"Left": 14,
"LineSpacing": 0,
"LinkItem": null,
"LinkMode": "vbLinkNone",
"LinkTimeout": 50,
Expand All @@ -241,13 +296,57 @@
"ToolTipText": null,
"Top": 92,
"UseMnemonic": true,
"VerticalAlignment": "vbVerticalAlignTop",
"Visible": true,
"WhatsThisHelpID": 0,
"Width": 287,
"WordWrap": false,
"_className": "Label",
"_clsid": "{33AD4ED8-6699-11CF-B70C-00AA0060D393}",
"_paintedByParent": true
},
{
"Anchors": {
"Bottom": false,
"Left": true,
"Right": false,
"Top": true,
"_className": "Anchors",
"_clsid": "{8524D4B5-72A9-40A9-A189-29E7905C40CA}"
},
"Angle": 0,
"Appearance": "vbAppear3d",
"BorderStyle": "vbNoBorder",
"DataField": null,
"DataFormat": null,
"DataMember": null,
"DataSource": null,
"Dock": "vbDockNone",
"DragIcon": "",
"DragMode": "vbManual",
"Enabled": true,
"Height": 26,
"Index": -1,
"InternalSectionId": -1,
"Left": 25,
"MouseIcon": "",
"MousePointer": "vbDefault",
"Name": "Image1",
"OLEDragMode": "vbOLEDragManual",
"OLEDropMode": "vbOLEDropNone",
"Picture": "",
"PictureDpiScaling": true,
"Stretch": false,
"StretchMode": "vbStretchHalftone",
"Tag": null,
"ToolTipText": null,
"Top": 116,
"Visible": true,
"WhatsThisHelpID": 0,
"Width": 39,
"_className": "Image",
"_clsid": "{33AD4F90-6699-11CF-B70C-00AA0060D393}",
"_paintedByParent": true
}
],
"_className": "Form",
Expand Down
Loading

0 comments on commit 7c8f50c

Please sign in to comment.