Skip to content

FCoreModule_Popup.Designer.vb

Naming convention

The file uses the .Designer.vb extension (with a dot, not an underscore). This is the convention recognized by Visual Studio's <DependentUpon> element in the project's .vbproj, which links the designer file to the form's partial class. An earlier draft of this work used the _Designer.vb (underscore) form by mistake — it caused the new bar item declarations to be silently ignored and produced a Handles clause requires a WithEvents variable... compile error on the click handler.

If you create a new partial form file, use the dot

FormName.Designer.vbFormName_Designer.vb ❌ (won't be linked to the form)

Changes made

New bar buttons declared

Me.btnResetToDefault = New DevExpress.XtraBars.BarButtonItem()
Me.btnLoadFromFile = New DevExpress.XtraBars.BarButtonItem()

Previously only btnRefresh, btnSaveAndShare, btnPublish, plus a stray BarButtonItem1 (a duplicate "Publish Module..." item left from a prior iteration — left in place to avoid touching unrelated parts of the designer).

LinksPersistInfo updated

Before:

Me.PopupMenu1.LinksPersistInfo.AddRange(New DevExpress.XtraBars.LinkPersistInfo() {
    New LinkPersistInfo(Me.btnRefresh),
    New LinkPersistInfo(Me.subAddSharedBox),
    New LinkPersistInfo(Me.btnMoveLeft, True),
    New LinkPersistInfo(Me.btnMoveRight),
    New LinkPersistInfo(Me.btnSaveAndShare),
    New LinkPersistInfo(Me.btnPublish)
})

After:

Me.PopupMenu1.LinksPersistInfo.AddRange(New DevExpress.XtraBars.LinkPersistInfo() {
    New LinkPersistInfo(Me.btnRefresh),
    New LinkPersistInfo(Me.btnResetToDefault, True),
    New LinkPersistInfo(Me.btnSaveAndShare),
    New LinkPersistInfo(Me.btnPublish),
    New LinkPersistInfo(Me.btnLoadFromFile)
})

The True second argument to LinkPersistInfo(Me.btnResetToDefault, True) is the BeginGroup flag — it puts a separator above this item.

Designer LinksPersistInfo is not authoritative at runtime

This array is read by DevExpress at form construction. In practice the construction order in InitializeComponent doesn't always make this work — LinksPersistInfo references items before they're registered with the BarManager, so the popup can render empty. The runtime-side DefineContextMenu() method in the code-behind explicitly clears and re-adds links. The LinksPersistInfo here is kept correct anyway for completeness and for the Visual Studio designer view.

BarManager1.Items.AddRange updated

Before:

Me.BarManager1.Items.AddRange(New DevExpress.XtraBars.BarItem() {
    Me.btnPermanent, Me.btnRefresh, Me.subVisibility, Me.BarCheckItem1,
    Me.editTabCaption, Me.subAddNewBox, Me.btnPasteBoxes, Me.btnSaveAndShare,
    Me.btnCloneTab, Me.btnDeleteTab, Me.btnMoveLeft, Me.btnMoveRight,
    Me.subAddSharedBox, Me.btnPublish, Me.BarButtonItem1
})
Me.BarManager1.MaxItemId = 21

After:

Me.BarManager1.Items.AddRange(New DevExpress.XtraBars.BarItem() {
    Me.btnPermanent, Me.btnRefresh, Me.subVisibility, Me.BarCheckItem1,
    Me.editTabCaption, Me.subAddNewBox, Me.btnPasteBoxes, Me.btnSaveAndShare,
    Me.btnCloneTab, Me.btnDeleteTab, Me.btnMoveLeft, Me.btnMoveRight,
    Me.subAddSharedBox, Me.btnPublish, Me.BarButtonItem1,
    Me.btnResetToDefault, Me.btnLoadFromFile
})
Me.BarManager1.MaxItemId = 23

MaxItemId is bumped from 21 to 23 to cover the two new IDs (21 = btnResetToDefault, 22 = btnLoadFromFile). DevExpress uses this for serialization / deserialization compatibility.

Per-button configuration added

'btnResetToDefault
'
Me.btnResetToDefault.Caption = "Reset Module to Default Settings..."
Me.btnResetToDefault.Id = 21
Me.btnResetToDefault.ImageOptions.Image = Global.PulseDevTools.My.Resources.MainResource.Home_16x16
Me.btnResetToDefault.Name = "btnResetToDefault"
'
'btnLoadFromFile
'
Me.btnLoadFromFile.Caption = "Load Module from File..."
Me.btnLoadFromFile.Id = 22
Me.btnLoadFromFile.ImageOptions.Image = Global.PulseDevTools.My.Resources.MainResource.Folder_16x
Me.btnLoadFromFile.Name = "btnLoadFromFile"

Icons reused from existing MainResource:

  • Home_16x16 — used for "Reset Module to Default Settings..." (matches the existing per-tab reset action in FPulseTab_Popup_Designer.vb).
  • Folder_16x — used for "Load Module from File...". Found in MainResource via existing usage in CTabFilter.vb.

Friend WithEvents declarations added

Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnResetToDefault As DevExpress.XtraBars.BarButtonItem
Friend WithEvents btnLoadFromFile As DevExpress.XtraBars.BarButtonItem

Without WithEvents, the Handles btnResetToDefault.ItemClick clause in the code-behind would not compile.

What was deliberately left alone

The designer file contains several declared-but-unused items inherited from prior iterations: subAddSharedBox, btnMoveLeft, btnMoveRight, btnPermanent, subVisibility, BarCheckItem1, editTabCaption, RepositoryItemTextEdit1, subAddNewBox, btnPasteBoxes, btnCloneTab, btnDeleteTab, and the duplicate BarButtonItem1. These are still declared, still constructed in InitializeComponent, still registered with the BarManager, but no longer linked into the popup (they're absent from the new LinksPersistInfo and from DefineContextMenu).

They were left in place to keep the diff minimal and to avoid breaking any external references that may exist. They have no runtime cost beyond their construction.