ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakx_5.4.0.1/rzakxconstructvbproppgs.htm

125 lines
6.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2005" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Example: Constructing Visual Basic property pages for a property sheet handler" />
<meta name="abstract" content="Property pages that are implemented by iSeries Navigator Visual Basic plug-ins can not use a registry key to specify property pages. You must add a specific property page context menu item in your ListManager class to implement a property page. You can not add a property page to any existing property sheet objects." />
<meta name="description" content="Property pages that are implemented by iSeries Navigator Visual Basic plug-ins can not use a registry key to specify property pages. You must add a specific property page context menu item in your ListManager class to implement a property page. You can not add a property page to any existing property sheet objects." />
<meta name="DC.Relation" scheme="URI" content="rzakxcreateplugin.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzakxconstructvbproppgs" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Example: Constructing Visual Basic property pages for a property sheet handler</title>
</head>
<body id="rzakxconstructvbproppgs"><a name="rzakxconstructvbproppgs"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Constructing Visual Basic property pages for a property sheet handler</h1>
<div><p>Property pages that are implemented by iSeries™ Navigator Visual Basic plug-ins can not use a registry key to specify
property pages. You must add a specific property page context menu item in your ListManager class to implement a property page. You can not add a property page to any existing property sheet objects.</p>
<div class="section">In the Visual Basic Sample plug-in, a property page is supported for Libraries in the iSeries Navigator
List. This is done with the following steps:</div>
<ol><li class="stepexpand"><span>In listman.cls, the Library object type specifies a properties page in the getAttributes method:</span> <pre>' Returns the attributes of an object in the list.
Public Function ListManager_getAttributes(ByVal item As Object) As Long
Dim uItem As ItemIdentifier
Dim nAttributes As ObjectTypeConstants
If Not IsEmpty(item) Then
Set uItem = item
End If
If uItem.getType = "SampleVBFolder" Then
nAttributes = OBJECT_ISCONTAINER
ElseIf item.getType = "SampleLibrary" Then
nAttributes = OBJECT_IMPLEMENTSPROPERTIES
Else
nAttributes = 0
End If
ListManager_getAttributes = nAttributes
End Function</pre>
</li>
<li class="stepexpand"><span>In actnman.cls, the queryActions method specifies that properties should be shown on the Library object context menu.</span> <pre>Public Function ActionsManager_queryActions(ByVal flags As Long) As Variant
.
.
' Add menu items to a Sample Library
If selectedFolderType = "SampleLibrary" Then
' Standard Actions
If (flags And STANDARD_ACTIONS) = STANDARD_ACTIONS Then
ReDim actions(0)
' Properties
Set actions(0) = New ActionDescriptor
With actions(0)
.Create
.setID IDPROPERTIES
.SetText m_uLoader.getString(IDS_ACTIONTEXT_PROPERTIES)
.setHelpText m_uLoader.getString(IDS_ACTIONHELP_PROPERTIES)
.setVerb "PROPERTIES"
.setEnabled True
.setDefault True
End With
' Properties is only selectable if there is ONLY 1 object selected
If Not IsEmpty(m_ObjectNames) Then
If UBound(m_ObjectNames) &gt; 0 Then
actions(2).setEnabled False
End If
End If
End If
End If
.
.
End Function</pre>
</li>
<li class="stepexpand"><span>In actnman.cls, the actionsSelected method displays a properties form when the properties context menu is selected.</span> <pre>Public Sub ActionsManager_actionSelected(ByVal action As Integer, ByVal owner As Long)
.
.
Select Case action
.
.
Case IDPROPERTIES
If (Not IsEmpty(m_ObjectNames)) Then
' Pass the System Name into a hidden field on the form for later use
frmProperties.lblSystemName = m_ObjectNames(0).getSystemName
' Pass the Display Name of the selected object into a hidden field on the form
frmProperties.lblLibName = m_ObjectNames(0).getDisplayName
' Show the properties
frmProperties.Show vbModal
End If
.
.
Case Else
'Do Nothing
End Select
.
End Sub </pre>
</li>
</ol>
<div class="section"><div class="note"><span class="notetitle">Note:</span> The code to create and display the property sheet can be seen in <span class="uicontrol">propsht.frm</span></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakxcreateplugin.htm" title="After modifying the sample plug-ins, you'll need to make some modifications to the registry files. This topic provides a walk-through of the registry files for each type of plug-in, and recommends some modifications.">Customize the plug-in registry files</a></div>
</div>
</div>
</body>
</html>