ArticlePanelGetSelectedIdx Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:17

Description

Returns the index of the currently selected item in the Article Panel in Fred4.

Syntax

Dim idx = Designer.ArticlePanelGetSelectedIdx

pagedesigner

Page designer, defined by Dim pagedesigner = TryCast(idesigner, IPageDesigner).

Example

 <ShellCommand()> _

Public Sub ArticleDelCurTxt()

  Dim article As Article = Fred.GetActiveArticle

 

  If article Is Nothing Then

    Return

  End If

 

  Dim userAnswer As MsgBoxResult

  Dim bSpike As Boolean = False

 

  ' globalSpikeDelElt is false if not specified, element is not spiked

  Select Case globalSpikeDelElt

    Case 1

       userAnswer = MsgBox(My.Resources.IDS_SpikeRemovedElement, vbYesNoCancel, m_Label)

 

      If userAnswer = MsgBoxResult.Cancel Then

        Return

      End If

 

       bSpike = userAnswer = MsgBoxResult.Yes

 

    Case CInt(True) : bSpike = True

    Case CInt(False) : bSpike = False

  End Select

 

  Dim bStat As Boolean = article.IsChecked 'see if article was checked out

  Dim idx = Designer.ArticlePanelGetSelectedIdx

  If Not bStat Then 'the article was not checkedout: let's checkout it

    If CBool(article.ToggleCheck(1)) Then

      'checkout failed

      Return

    End If

  End If

  Dim artiDx = article.GetCurTxtIdx

   article.DelTxt(idx, bSpike, True)

  If Not bStat Then

     article.ToggleCheck(0) ' if article was checked-in, check it back in

  End If

End Sub

See also

ArticlePanelSetSelectedIdx Method

ArticlePanelGetSelectedNode Method