Adding new icon to toolbar with script

原创 2004年10月12日 14:21:00
From LDD(,bookmark,bar)
My goal is to distribute the news entry with a button that I will send to my users.

1. The first part of the button copy the outline in the outline "UserToolBar" of the local "bookmark.nsf". This add the tool bar with the actions.

2. To import the gif I have created a public network share on which I have put the DXL exportation of my image. Then I import this file in the bookmark.nsf. (be careful of the version of the DTD used in your designer client and the one available in the target client... it should be the same)

The solution isn't smart but it works... I will improve it with time.


Sub Click(Source As Button)
' Function.....: Code permettant de déployer l'outline des dictionnaires dans un bookmark.nsf local
' Date...........: 02.03.2004
' Author........: Pierre Koerber
' Desc..........:
' Return........: Rien
Dim dbBook As NotesDatabase
Dim thisDatabase As notesdatabase
Dim db As notesdatabase
Dim se As New notessession

' --- From where Am I ?
Set thisDatabase = se.CurrentDatabase

' --- Get the local bookmark database
Set db = se.getDatabase("","bookmark.nsf")
If db Is Nothing Then
Msgbox "Impossible to locate... local bookmark "
Exit Sub
End If

' -- Importation des images, stockées sous forme DXL dans un share.
Call importDXL("//frorg06s/notes6/dxl/image.dxl", db)
Print "Images importées.... "

' --- Get the template database
Set dbBook = se.GetDatabase(thisDatabase.server,"Informatique/lotus/orgCommonDesign.nsf")
If dbBook Is Nothing Then
Msgbox "Impossible to locate... source bookmark "
Exit Sub
End If

' -- Get the source outline
Dim outlineSource As NotesOutline
Dim outlineEntrySource As NotesOutlineEntry

' -- This is the source outline
Set outlineSource = dbBook.GetOutline("OrgamolDictionnaireToolBar")

If outlineSource Is Nothing Then
Msgbox "OrgamolDictionnaireTool bar not found !"
Exit Sub
End If

Dim outlineDest As NotesOutline
Dim outlineEntryDest As NotesOutlineEntry

' -- Get the userToolbar outline
Set outlineDest = db.getoutline("UserToolbar")
' -- Get the first entry of the source
Set outlineEntrySource = outlinesource.GetFirst()

' -- Check if it exists.

' --- Create each entries in the dest.
While Not(outlineEntrySource Is Nothing)
Set outlineEntryDest = outlineDest.CreateEntryFrom(outlineEntrySource)
Set outlineEntrySource = outlineSource.GetNext(outlineEntrySource )

' --- Save the outline
Print "Toolbar importée.... "
End Sub

Function importDXL(szFileName As String, pDb As notesdatabase)
' Function.....: Fonction ouvrant un fichier DXL et important ce flux en tant que code dans la base courrante.
' Date...........: 02.03.2004
' Author........: Pierre Koerber
' Desc..........:
' Return........: Rien
Dim db As notesdatabase
Dim session As New NotesSession

If pDb Is Nothing Then
Set db = session.currentdatabase
Set db = pDb
End If

REM Open dxl file named after current database
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open(szFileName) Then
Messagebox "Cannot open " & szFileName,, "Error"
Exit Function
End If
If stream.Bytes = 0 Then
Messagebox "File did not exist or was empty",, szFileName
Exit Function
End If

REM Create new database named current database + "Copy"

REM Import DXL into new database
Dim importer As NotesDXLImporter
Set importer = session.CreateDXLImporter(stream, db)
importer.ReplaceDBProperties = True
importer.ReplicaRequiredForReplaceOrUpdate = False
importer.DesignImportOption = DXLIMPORTOPTION_CREATE
Call importer.Process

End Function


需求需要在toolbar的menu菜单里面显示icon,但是据google的解释说 已经不支持这么做了 Options menus: The icon menus do not support i...
  • longwanglidfdfdf
  • longwanglidfdfdf
  • 2016年03月10日 13:59
  • 1032


  • Major_out
  • Major_out
  • 2016年03月19日 20:50
  • 1525

Toolbar menu item 显示icon

  • soslinken
  • soslinken
  • 2016年11月28日 17:14
  • 900


  • jobine
  • jobine
  • 2005年12月06日 18:29
  • 1426

Android - toolbar 优化 title修改边距和navigation icon修改padding值

1.修改title 边距修改边距使用系统的app属性来引入使用,即: xmlns:app=""比如:...
  • 2016年04月27日 12:15
  • 11682


异常:在布局XML中设置android:navigationIcon=”@drawable/icon”或者在代码中设置都无法自定义成自己需要设置的NavigationIcon图片。 代码设置Navi...
  • zhufuing
  • zhufuing
  • 2015年10月29日 16:12
  • 9375

Toolbar NavigationIcon正确的使用姿势

  • u011125199
  • u011125199
  • 2016年10月28日 23:24
  • 3392


  • u011993368
  • u011993368
  • 2015年08月03日 12:15
  • 6482


  • bianqingzhi7793
  • bianqingzhi7793
  • 2017年01月01日 08:02
  • 1783


隐藏Icon有3种方式,在Manifest中注册Activity时改为隐式启动Icon不会显示,但不会动态显示 ...
  • a982431168
  • a982431168
  • 2013年08月12日 11:10
  • 2466
您举报文章:Adding new icon to toolbar with script