12669 <P>
And an example of XCommand definition is shown below. </P>
12673 {
"DrawingAids.Locks.Axis",
12674 {CMD_LOCK_AXIS_TOGGLE,
MTASKID,
""},
12676 TXT6_SettingsSubLockAxis,
12678 "DrawingAids.Locks.Axis",
"",
"",
"[ActiveLock]ActiveLock.AxisLockEnabled()",
"",
NOACCEL,
12679 PP_ID_FeatureAspects_DrawingAids_Locks_Axis},
12681 {
"DrawingAids.Locks.ConstructSnap",
12682 {CMD_LOCK_SNAP_ACS_TOGGLE,
MTASKID,
""},
12684 TXT6_SettingsSubLockConstructSnap,
12686 "DrawingAids.Locks.ConstructSnap",
"",
"",
"[ActiveLock]ActiveLock.ConstructionPlaneLockEnabled()",
"",
NOACCEL,
12687 PP_ID_FeatureAspects_DrawingAids_Locks_SettingsMenu},
12693 <H4>
User Defined XCommands</H4>
12695 <P>
User defined XCommands are defined
in XML files.
Below is an example of XML defined commands. </P>
12698 <UserNamedCommands>
12700 <
Name>GeneralExample.PlaceThickCircle</
Name>
12701 <Label>Thick Circle</Label>
12703 <Keyin>[CONSGEOM]PLACE CIRCLE ICON;co=4;wt=4;lc=0</Keyin>
12704 <IconName>PlaceCircle</IconName>
12705 </UserNamedCommand>
12707 <
Name>GeneralExample.ToolWithNoIcon</
Name>
12708 <Label>Place Line</Label>
12710 <Keyin>PLACE LINE;co=4;wt=4;lc=0</Keyin>
12711 </UserNamedCommand>
12713 <
Name>GeneralExample.PlaceThinShape</
Name>
12714 <Label>Thin Shape</Label>
12716 <Keyin>[CONSGEOM]PLACE SHAPE CONSTRAINED;co=1;wt=0;lc=0</Keyin>
12717 <IconName>PlaceShape</IconName>
12718 </UserNamedCommand>
12720 <
Name>GeneralExample.PlaceSolidSlab</
Name>
12721 <Label>Place Slab</Label>
12723 <Keyin>[SOLIDMODELING]PLACE SLAB ICON;co=5;wt=2;lc=0</Keyin>
12724 <IconName>PlaceSlab</IconName>
12725 <VisibilityExpression>[Session]Session.TreatActiveModelAs3D()</VisibilityExpression>
12726 </UserNamedCommand>
12727 </UserNamedCommands>
12730 <H3>Example <CommandData> Specifications</H3>
12731 <P>The XML format supports multiple types of Command specification. The recommended Command
Type is NamedCommand.</P>
12733 <H4>NamedCommand </H4>
12734 <P>The example below shows that
in addition to specifying the name of the XCommand, the XML can also define Command Parameters and supply an icon to
override the one defined
in the XCommand resource. </P>
12738 <CommandData
Type=
"NamedCommand">
12739 <NamedCommand>Mstn.Cells.CellSelector
12740 <CmdParameters>CELLSEL DIALOG CELLSEL</CmdParameters>
12741 <Icon Type=
"NamedIcon">
12742 <NamedIcon>
Cell</NamedIcon>
12749 <H4>UserKeyinCommand </H4>
12750 <P>The example below shows the definition of the key-
in to queue, the icon to use, and the label and desciption to use
for the Button Label and ToolTip text. </P>
12754 <CommandData Type=
"UserKeyinCommand">
12756 <Label>Database Disconnect</Label>
12759 <Icon Type=
"NamedIcon">
12760 <NamedIcon>Database-Disconnect</NamedIcon>
12762 </UserKeyinCommand>
12766 <H3>Example <Icon> Specifications </H3>
12768 <P>Named Ico - Ico is either
in ustnicons.rsc or
in a DGNLIB. </P>
12772 <Icon Type=
"NamedIcon">
12773 <NamedIcon>Circle</NamedIcon>
12781 <Icon Type=
"RscIcon">
12785 <TaskId>USTN</TaskId>
12792 <P>The
Visibility element can contain multiple ShowExpressions and FeatureAspect elements. During a refresh
event the expressions are evaluated to determine
if the item should be visible. If any Show Expression returns
false, the item is hidden. If the command specifies a ShowExpression it will be appended to any user defined entries. If the FeatureAspect is specified it is evaluated to determine
if the item should be allowed. If the item specifies a named command (XCommand) and that command specifies a FeatureAspect then the Ribbon Component must also specify the same FeatureAspect. </P>
12797 <ShowExpression>[Session]not(Session.TreatActiveModelAs3D())</ShowExpression>
12798 <FeatureAspect>Surfaces_Modify</FeatureAspect>
12803 <H2> UI Synchronization Event System </H2>
12804 <P>One of the major needs in adding a
new UI to an existing CAD engine is keeping the UI in sync with the actual settings/parameters used by the engine. The
UISyncManager has been added in MstnPlatform to satisfy
this need. This manager will maintain a list of all available registered sync event types. These event types are defined in MicroStation resources and can be referenced by SyncGroupRscId and SyncItemId or by name. The name is in the format
"[SyncGroupName].[SyncItemName]",
for example:
" ActiveLock.Snap" and
"SystemEvent.ActiveModelChanged". The native
DialogManager uses the
UISyncManager to validate and look up available sync events. Native applications can trigger a sync event by calling the following method: </P>
12811 <P>From a managed application a caller would use the following method.</P>
12814 UMDialogManager::SendUISyncMessage (System::String^ synchItemString);
12818 <P>When the SendUISyncMessage method is called, the message will be passed along to all ribbon components that specify interest
in that
event. When
this occurs the ViewModel that is associated with the component will have its Refresh method called. The Refresh method will reevaluate any visibility or enable expression that are defined
for the components. Typically the Ribbon
's XML will have a SyncItemEvent tag anytime a ShowExpression or EnableExpression is defined. In the example below, any time the active model changes sync event, the system processes the following call. </P>
12819 <P>DialogManager::SendUISyncMessage (SYNCGROUPID_SystemEvent, NULL, SYNCITEM_SystemEvent_ActiveModelChanged); </P>
12820 <P>This in turn tells every component that has specified interest in the ActiveModelChanged event. </P>
12824 <SplitButtonRef Name="Mstn.Placement.CreateCurves3D" Priority="500000">
12825 <SplitButtonParams Size="Small">
12826 <AccessText>PU</AccessText>
12827 <PopupAccessText>U</PopupAccessText>
12828 <ApplicationParams>
12830 <Name>MatchingKeyTipItems</Name>
12831 <Value>Mstn.Placement.CreateCurves2D</Value>
12832 </ApplicationParam>
12833 </ApplicationParams>
12834 <SyncItemEvent>SystemEvent.ActiveModelChanged</SyncItemEvent>
12836 <ShowExpression>[Session]Session.TreatActiveModelAs3D()</ShowExpression>
12839 </SplitButtonParams>
12844 <P>The Sync Resources are loaded into MicroStation as it starts in the function guiDialog_startupInit (mstn/mscore/gui/guidlog.cpp). <P>
12846 <H3>Sync Group Resource Specification </H3>
12848 <P>The following list of sync events are available for R1 of MicroStation CONNECT:</P>
12852 // Maximum of 32 SyncItems per group
12853 SyncGroupRsc SYNCGROUPID_ActiveLock =
12857 {SYNCITEM_ActiveLock_Association, "Association"},
12858 {SYNCITEM_ActiveLock_Snap, "Snap"},
12859 {SYNCITEM_ActiveLock_Grid, "Grid"},
12860 {SYNCITEM_ActiveLock_Unit, "Unit"},
12861 {SYNCITEM_ActiveLock_Angle, "Angle"},
12862 {SYNCITEM_ActiveLock_Textnode, "Textnode"},
12863 {SYNCITEM_ActiveLock_Axis, "Axis"},
12864 {SYNCITEM_ActiveLock_Scale, "Scale"},
12865 {SYNCITEM_ActiveLock_GraphGroup, "GraphGroup"},
12866 {SYNCITEM_ActiveLock_Level, "Level"},
12867 {SYNCITEM_ActiveLock_FenceMode, "FenceMode"},
12868 {SYNCITEM_ActiveLock_CellStretch, "CellStretch"},
12869 {SYNCITEM_ActiveLock_Construction, "Construction"},
12870 {SYNCITEM_ActiveLock_Isometric, "Isometric"},
12871 {SYNCITEM_ActiveLock_Depth, "Depth"},
12872 {SYNCITEM_ActiveLock_Isoplane, "Isoplane"},
12873 {SYNCITEM_ActiveLock_UseAnnotationScale, "UseAnnotationScale"},
12874 {SYNCITEM_ActiveLock_ConstructionSnap, "ConstructionSnap"},
12875 {SYNCITEM_ActiveLock_ElementTemplateAssociation, "ElementTemplateAssociation"},
12876 {SYNCITEM_ActiveLock_AccuSnap, "AccuSnap"},
12879 // Maximum of 32 SyncItems per group
12880 SyncGroupRsc SYNCGROUPID_SystemEvent =
12884 {SYNCITEM_SystemEvent_ActiveModelChanged, "ActiveModelChanged"},
12885 {SYNCITEM_SystemEvent_AvailableModelsChanged, "AvailableModelsChanged"},
12886 {SYNCITEM_SystemEvent_ModelPropertiesChanged, "ModelPropertiesChanged"},
12887 {SYNCITEM_SystemEvent_FileClose, "FileClose"},
12888 {SYNCITEM_SystemEvent_FileOpen, "FileOpen"},
12889 {SYNCITEM_SystemEvent_ActiveViewChanged, "ActiveViewChanged"},
12890 {SYNCITEM_SystemEvent_AvailableViewsChanged, "AvailableViewsChanged"},
12891 {SYNCITEM_SystemEvent_ClipboardUpdated, "ClipboardUpdated"},
12892 {SYNCITEM_SystemEvent_AvailableLevelsChanged, "AvailableLevelsChanged"},
12893 {SYNCITEM_SystemEvent_PopSetStateChanged, "PopSetStateChanged"},
12894 {SYNCITEM_SystemEvent_ColorMapChanged, "ColorMapChanged"},
12895 {SYNCITEM_SystemEvent_UndoRedoFinished, "UndoRedoFinished"},
12896 {SYNCITEM_SystemEvent_UndoMarkSet, "UndoMarkSet"},
12897 {SYNCITEM_SystemEvent_InitializeUI, "InitializeUI"},
12898 {SYNCITEM_SystemEvent_SelectionSetChanged, "SelectionSetChanged"},
12899 {SYNCITEM_SystemEvent_ContextualTabSetKeyChanged, "ContextualTabSetKeyChanged"},
12900 {SYNCITEM_SystemEvent_TableCellSelectionChanged, "TableCellSelectionChanged"},
12901 {SYNCITEM_SystemEvent_LuxologyRenderStateChanged, "LuxologyRenderStateChanged"},
12902 {SYNCITEM_SystemEvent_ApplicationSyncUIItem, "ApplicationSyncUIItem"},
12903 {SYNCITEM_SystemEvent_AnimationPreviewStateChanged, "AnimationPreviewStateChanged"},
12904 {SYNCITEM_SystemEvent_DgnHistoryStateChange, "DgnHistoryStateChange"},
12905 {SYNCITEM_SystemEvent_AvailableLineStylesChanged, "AvailableLineStylesChanged"},
12906 {SYNCITEM_SystemEvent_ImmediateLineStylesRefreshRequired, "ImmediateLineStylesRefreshRequired"},
12907 {SYNCITEM_SystemEvent_ACSOperationProcessed, "ACSOperationProcessed"},
12908 {SYNCITEM_SystemEvent_RefreshAvailableViewGroupList, "RefreshAvailableViewGroupList"},
12909 {SYNCITEM_SystemEvent_ViewGroupHistoryStateChange, "ViewGroupHistoryStateChange"},
12910 {SYNCITEM_SystemEvent_ContextualTabActivated, "ContextualTabActivated"},
12911 {SYNCITEM_SystemEvent_UserSigninStateChanged, "UserSigninStateChanged"},
12914 // Maximum of 32 SyncItems per group
12915 SyncGroupRsc SYNCGROUPID_SessionEvent =
12919 {SYNCITEM_SessionEvent_BeforeProjectChange, "BeforeProjectChange"},
12920 {SYNCITEM_SessionEvent_AfterProjectChange, "AfterProjectChange"},
12921 {SYNCITEM_SessionEvent_RibbonDefinitionCfgVarChanged, "RibbonDefinitionCfgVarChanged"},
12922 {SYNCITEM_SessionEvent_RibbonTabActivated, "RibbonTabActivated"},
12923 {SYNCITEM_SessionEvent_RibbonQATToolListChanged, "RibbonQATToolListChanged"},
12924 {SYNCITEM_SessionEvent_RibbonWorkflowChanged, "RibbonWorkflowChanged"},
12927 // Maximum of 32 SyncItems per group
12928 SyncGroupRsc SYNCGROUPID_CustomizationChanged =
12930 "CustomizationChanged",
12932 {SYNCITEM_CustomizationChanged_AvailableTasksChanged, "AvailableTasksChanged"},
12933 {SYNCITEM_CustomizationChanged_AvailableMainTasksChanged, "AvailableMainTasksChanged"},
12934 {SYNCITEM_CustomizationChanged_AvailableNameToolboxesChanged, "AvailableNamedToolboxesChanged"},
12935 {SYNCITEM_CustomizationChanged_AvailableElementTemplatesChanged, "AvailableElementTemplatesChanged"},
12936 {SYNCITEM_CustomizationChanged_KeyboardShortcutsChanged, "KeyboardShortcutsChanged"},
12937 {SYNCITEM_CustomizationChanged_TaskNavigationTaskChanged, "TaskNavigationTaskChanged"},
12938 {SYNCITEM_CustomizationChanged_AvailableColorBookColorsChanged, "AvailableColorBookColorsChanged"},
12941 // Maximum of 32 SyncItems per group
12942 SyncGroupRsc SYNCGROUPID_SymbologyChanged =
12944 "SymbologyChanged",
12946 {SYNCITEM_SymbologyChanged_AreaMode, "AreaMode"},
12947 {SYNCITEM_SymbologyChanged_CapMode, "CapMode"},
12948 {SYNCITEM_SymbologyChanged_Color, "Color"},
12949 {SYNCITEM_SymbologyChanged_LineWeight, "LineWeight"},
12950 {SYNCITEM_SymbologyChanged_Level, "Level"},
12951 {SYNCITEM_SymbologyChanged_Class, "Class"},
12952 {SYNCITEM_SymbologyChanged_FillMode, "FillMode"},
12953 {SYNCITEM_SymbologyChanged_FillColor, "FillColor"},
12954 {SYNCITEM_SymbologyChanged_LineStyle, "LineStyle"},
12955 {SYNCITEM_SymbologyChanged_DisplayPriority, "DisplayPriority"},
12956 {SYNCITEM_SymbologyChanged_CellName, "CellName"},
12957 {SYNCITEM_SymbologyChanged_Terminator, "Terminator"},
12958 {SYNCITEM_SymbologyChanged_Point, "Point"},
12959 {SYNCITEM_SymbologyChanged_PatternCell, "PatternCell"},
12960 {SYNCITEM_SymbologyChanged_PatternDelta, "PatternDelta"},
12961 {SYNCITEM_SymbologyChanged_PatternAngle, "PatternAngle"},
12962 {SYNCITEM_SymbologyChanged_Scale, "Scale"},
12963 {SYNCITEM_SymbologyChanged_AreaPatternDelta, "AreaPatternDelta"},
12964 {SYNCITEM_SymbologyChanged_AreaPatternAngle, "AreaPatternAngle"},
12965 {SYNCITEM_SymbologyChanged_PatternScale, "PatternScale"},
12966 {SYNCITEM_SymbologyChanged_TerminatorScale, "TerminatorScale"},
12967 {SYNCITEM_SymbologyChanged_Transparency, "Transparency"},
12968 {SYNCITEM_SymbologyChanged_Angle, "Angle"},
12969 {SYNCITEM_SymbologyChanged_LineStyleParams, "LineStyleParams"},
12970 {SYNCITEM_SymbologyChanged_ElementTemplate, "ElementTemplate"},
12973 // Maximum of 32 SyncItems per group
12974 SyncGroupRsc SYNCGROUPID_ActiveParamChanged =
12976 "ActiveParamChanged",
12978 {SYNCITEM_ActiveParamChanged_GridMode, "GridMode"},
12979 {SYNCITEM_ActiveParamChanged_ScaleDimValues, "ScaleDimValues"},
12980 {SYNCITEM_ActiveParamChanged_ScaleAnnotations, "ScaleAnnotations"},
12981 {SYNCITEM_ActiveParamChanged_ScaleMlineOffsets, "ScaleMlineOffsets"},
12982 {SYNCITEM_ActiveParamChanged_GridRef, "GridRef"},
12983 {SYNCITEM_ActiveParamChanged_TagIncrement, "TagIncrement"},
12984 {SYNCITEM_ActiveParamChanged_KeyPoint, "KeyPoint"},
12985 {SYNCITEM_ActiveParamChanged_SnapOverride, "SnapOverride"},
12986 {SYNCITEM_ActiveParamChanged_Nextggroup, "Nextggroup"},
12987 {SYNCITEM_ActiveParamChanged_Numscreens, "Numscreens"},
12988 {SYNCITEM_ActiveParamChanged_Fence, "Fence"},
12989 {SYNCITEM_ActiveParamChanged_FenceView, "FenceView"},
12990 {SYNCITEM_ActiveParamChanged_GridOrientation, "GridOrientation"},
12991 {SYNCITEM_ActiveParamChanged_SnapMode, "SnapMode"},
12992 {SYNCITEM_ActiveParamChanged_CelllibFilename, "CelllibFilename"},
12993 {SYNCITEM_ActiveParamChanged_LevelFilter, "LevelFilter"},
12994 {SYNCITEM_ActiveParamChanged_GridUnits, "GridUnits"},
12995 {SYNCITEM_ActiveParamChanged_UnitRoundoff, "UnitRoundoff"},
12996 {SYNCITEM_ActiveParamChanged_StreamDelta, "StreamDelta"},
12997 {SYNCITEM_ActiveParamChanged_StreamTolerance, "StreamTolerance"},
12998 {SYNCITEM_ActiveParamChanged_StreamAngle, "StreamAngle"},
12999 {SYNCITEM_ActiveParamChanged_StreamArea, "StreamArea"},
13000 {SYNCITEM_ActiveParamChanged_AxisAngle, "AxisAngle"},
13001 {SYNCITEM_ActiveParamChanged_AxisOrigin, "AxisOrigin"},
13002 {SYNCITEM_ActiveParamChanged_GridAngle, "GridAngle"},
13003 {SYNCITEM_ActiveParamChanged_DimCompat, "DimCompatibility"},
13004 {SYNCITEM_ActiveParamChanged_MlineCompat, "MlineCompatibility"},
13005 {SYNCITEM_ActiveParamChanged_LevelUsage, "LevelUsage"},
13008 // Maximum of 32 SyncItems per group
13009 SyncGroupRsc SYNCGROUPID_ModelParamChanged =
13011 "ModelParamChanged",
13013 {SYNCITEM_ModelParamChanged_UnitRoundRatio, "UnitRoundRatio"},
13014 {SYNCITEM_ModelParamChanged_SubPerMaster, "SubPerMaster"},
13015 {SYNCITEM_ModelParamChanged_UorPerSub, "UorPerSub"},
13016 {SYNCITEM_ModelParamChanged_MasterUnitLabel, "MasterUnitLabel"},
13017 {SYNCITEM_ModelParamChanged_SubUnitLabel, "SubUnitLabel"},
13018 {SYNCITEM_ModelParamChanged_UorPerMaster, "UorPerMaster"},
13019 {SYNCITEM_ModelParamChanged_GlobalOrigin, "GlobalOrigin"},
13020 {SYNCITEM_ModelParamChanged_GridRatio, "GridRatio"},
13023 SyncGroupRsc SYNCGROUPID_TextParamChanged =
13025 "TextParamChanged",
13027 {SYNCITEM_TextParamChanged_Font, "Font"},
13028 {SYNCITEM_TextParamChanged_TextJust, "TextJust"},
13029 {SYNCITEM_TextParamChanged_NodeJust, "NodeJust"},
13030 {SYNCITEM_TextParamChanged_LineLength, "LineLength"},
13031 {SYNCITEM_TextParamChanged_Tab, "Tab"},
13032 {SYNCITEM_TextParamChanged_NextTextnode, "NextTextnode"},
13033 {SYNCITEM_TextParamChanged_FontName, "FontName"},
13034 {SYNCITEM_TextParamChanged_TextStyle, "TextStyle"},
13035 {SYNCITEM_TextParamChanged_TextHeight, "TextHeight"},
13036 {SYNCITEM_TextParamChanged_TextWidth, "TextWidth"},
13037 {SYNCITEM_TextParamChanged_LineSpacing, "LineSpacing"},
13038 {SYNCITEM_TextParamChanged_TextSlant, "TextSlant"},
13044 <H3>Using Sync Events in your WPF ViewModels</H3>
13045 <P>Example of a ViewModel that is interested in monitoring ActiveModelChanges in MicroStation. </P>
13048 internal class ExampleViewModel : Bentley.MstnPlatformNET.Ribbon.ViewModels.RibbonItemViewModel
13050 UISyncInterest m_ActiveModelChangedInterests;
13051 public ExampleViewModel()
13053 UISyncInterestList refreshMasks = new UISyncInterestList ();
13054 refreshMasks.AddSyncInterest (m_ActiveModelChangedInterests = UMDialogManager.GetSyncInterest ("SystemEvent.ActiveModelChanged"));
13055 SyncInterestList = refreshMasks;
13058 public override void OnUserInterfaceSyncEvent (System.UInt32[] eventMasks)
13060 if (m_ActiveModelChangedInterests.IsSpecifiedInEventMasks (eventMasks))
13063 public override void Refresh ()
13065 if (null != VisibilitySpec)
13066 Visibility = VisibilitySpec.IsVisible () ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
13068 Visibility = System.Windows.Visibility.Visible;
13069 if (this is ISupportsEnableExpression)
13071 ISupportsEnableExpression supportsEnableExpression = this as ISupportsEnableExpression;
13072 if (!String.IsNullOrWhiteSpace (supportsEnableExpression.EnableExpression))
13073 IsEnabled = Bentley.Internal.MstnPlatformNET.NamedExpressionManager.EvaluateAsCriteria (supportsEnableExpression.EnableExpression, null, false);
13080 <H3>Application Provided Sync Group Resources </H3>
13081 <P>Applications that want to add their own sync events can do so. The steps involved are the following:</P>
13083 <OL> <LI>Create a .r file that defines your own SyncGroupRsc. If your application contains a cmd.r file you can simply add the SyncGroupRsc in the same .r file. </LI>
13084 <LI>Ensure the application containing the SyncGroupRsc is specified in the configuration variable MS_SYNCGROUP_APPS so the resource is loaded prior to the Ribbon. An easy way to do this is by using the <LoadConfig> tag in the part building the application. See the example part definition below.</LI>
13088 <Part Name="myapp" BMakeFile="apps\myapp.mke">
13090 <Files ProductDirectoryName="MdlsysAsneeded">
13092 <TransKit SourceDirectory="Delivery\TransKit\MdlApps\myapp" />
13093 <LoadConfig AppName="myapp" ConfigVars="MS_CMDTABLE_LOAD,MS_SYNCGROUP_APPS" />
13100 <Li>See test application ..\MstnPlatform\mstn\testapps\RibbonTestApp for example of setting up and firing Application provided Sync Events. </LI>
13104 <H3>ContextualTabSet definition </H3>
13106 <P>The following shows two example definitions. The first shows a TabSet to activate when a single element type is selected. The second definition shows how to set up a contextual tab to activate or deactivate used API calls. This second type of activation would allow placement or edit tools to display contextual tabs. </P>
13111 <ContextualTabSets>
13112 <!?Example that activates/deactivates a contextual tab based on the selected element -->
13113 <ContextualTabSet Name="Mstn.TabSet.Table" Color="Coral" SelectFirstTabOnActivation="false">
13114 <Label>Table Tools</Label>
13116 <SyncItemEvent>SystemEvent.SelectionSetChanged</SyncItemEvent>
13118 <ShowExpression>[Selection](Selection.ContainsSingleElement() AND Selection.ContainsText() AND Selection.OnlyContainsActiveModelElements())</ShowExpression>
13119 <FeatureAspect></FeatureAspect>
13123 <TabRef Name="DrawingTasks" Priority="10">
13125 <AccessText>TD</AccessText>
13129 </ContextualTabSet>
13131 <!?Example that activates/deactivates a contextual tab based on a key. This would be useful during tool processing -->
13132 <ContextualTabSet Name="Mstn.Context.Drawing" Color="Coral" SelectFirstTabOnActivation="false">
13133 <Label>Drawing Tools</Label>
13135 <SyncItemEvent>SystemEvent.ContextualTabKeyChanged</SyncItemEvent>
13137 <ShowExpression>[Session](Session.IsContextualTabKeyActive("DrawingTest"))</ShowExpression>
13138 <FeatureAspect></FeatureAspect>
13142 <TabRef Name="DrawingTasks" Priority="10">
13144 <AccessText>TD</AccessText>
13148 </ContextualTabSet>
13149 </ContextualTabSets>
13153 <P><B>Native API</B> - The following native calls will add or remove keys into a vector of active ContextualTabSet keys. It then triggers the ContextualTabKeyChanged synch event. </P>
13155 <UL> <LI>The following native calls will add or remove keys into a vector of active ContextualTabSet keys. It then triggers the ContextualTabKeyChanged synch event.</LI>
13156 <LI>DialogManager::DeactivateContextualTabSet (WCharCP key).</LI>
13157 <LI>DialogManager::ClearAllContextualTabSetKeys () </LI>
13160 <P><B>Managed API</B> - wrapper around native methods shown above. </P>
13162 <UL> <LI>ActivateContextualTabSet (string key);</LI>
13163 <LI>DeactivateContextualTabSet (string key);</LI>
13164 <LI>ClearAllContextualTabSetKeys (); </LI>
13166 <H2>Telerik RadRibbonView</H2>
13167 <H3>RadRibbonView Features </H3>
13169 <P>The RadRibbonView control has these key features: </P>
13172 <LI>MS Office 2010 Interface </LI>
13173 <LI>Automatic Resizing & Minimization </LI>
13174 <LI>Tabs, Groups, Galleries, Popups, Dialog Launcher </LI>
13175 <LI>Backstage Menu & Application Menu </LI>
13176 <LI>Buttons - Combo, Split, DropDown, Radio, Toggle </LI>
13177 <LI>Screen Tips </LI>
13179 <LI>Styling and Appearance </LI>
13180 <LI>Expression Blend Support </LI>
13183 <H3>More Ribbon Related Controls </H3>
13185 <P>The "RadControls for WPF" suite contains several class related to the Ribbon: </P>
13188 <LI>RadRibbonWindow </LI>
13189 <LI>RadRibbonView </LI>
13190 <LI>Classes with the RadRibbon prefix
13196 <LI>DropDownButton </LI>
13197 <LI>SplitButton </LI>
13198 <LI>RadioButton </LI>
13199 <LI>ToggleButton </LI></UL>
13201 <Li>Other Classes used with the Ribbon
13202 <UL><LI>ApplicationMenu </LI>
13203 <LI>QuickAccessToolbar </LI>
13204 <LI>StackPanel </LI>
13205 <LI>Separator </LI></UL>
13207 <LI>Layout Classes for the Ribbon
13208 <UL><LI>RadOrderedWrapPanel </LI>
13209 <LI>RadCollapsiblePanel </LI></UL>
13211 <LI>RadRibbonBar (deprecated) - superseded by RadRibbonView </LI>
13214 <H3>Ribbon Events </H3>
13218 <UL><LI>ApplicationButtonDoubleClick </LI>
13219 <LI>ApplicationMenuOpenStateChanged </LI>
13220 <LI>ToolBarPositionChanged </LI>
13221 <LI>HelpRequested </LI>
13222 <LI>CollapsedChanged </LI></UL>
13225 <UL><LI>PreviewSelectionChanged </LI>
13226 <LI>SelectionChanged </LI></UL>
13229 <UL><LI>MinimizedChanged</LI>
13230 <LI>MinimizedPopupOpenStateChanged </LI>
13231 <LI>PreviewPopupOpened </LI>
13232 <LI>PopupOpened </LI></UL>
13235 <UL><LI>ActionPreview </LI>
13236 <LI>DeactivatePreview </LI></UL>
13239 <UL><LI>LauchDialog </LI></UL>
13243 <P>You can find more information about the Telerik RadRibbonView at the <a HREF="http://www.telerik.com/help/wpf/radribbonview-overview.html"> Telerik Page</a>.</P>
13249 @addtogroup CommandFrameworkAndXCommands
13251 @note XCommands are Cross-UI-Platform Command definitions that can be used by the Ribbon, Menus and XCmdButtons.
13253 <P>User Interface Development Index: BSWUserInterfaceDevelopment
13255 <H2>Legacy Command Support </H2>
13257 <P>The Command is one of the most basic building blocks in PowerPlatform. Without Commands, you couldn't open a file, save a file, start the
Element Selection tool, etc. Commands are identified by two pieces of information: 1) an ID number (64-bits) and 2) the ID/Name of the Task owning that Command. When used in context, there is an additional command parameter
string, or
"unparsed" string, passed to the command
's function. So in effect, these 3 pieces of information together form a unique command. </P>
13260 <H3>Command Tables</H3>
13262 <P>For the PowerPlatform core and MDL applications, Commands are defined in a CommandTable resource in a .r file that is compiled using the Bentley Resource Compiler. For .NET AddIns, Commands are defined in XML files.</P>
13264 <P>This is an example command definition from cmdtable.r in the PowerPlatform core: </P>
13270 #define CT_DIALOG 228
13273 CommandTable CT_MAIN =
13276 {119, CT_DIALOG, DIALOGOPEN, TRY|IMM, "DIALOG" },
13279 CommandTable CT_DIALOG =
13282 { 68, CT_NONE, INHERIT, NONE, "OPENFILE", 580, },
13287 <P>In the CommandTable definition above, notice the string "DIALOG". This is used as the first part of the generated C #define identifier for the CommandNumber. 119 is in the first column and it will be used in the actual numeric CommandNumber. CT_DIALOG ID is in second column on that same line. That ID is used for a subsequent CommandTable definition, which contains an entry with the string "OPENFILE", a 68 and CT_NONE.
13288 68 will be used in the CommandNumber, and the CT_NONE indicates there are no more CommandTables to use when generating the CommandNumber. The following example shows how the hexidecimal represtations of the previous numbers are concatenated together to form the numeric CommandNumber.</P>
13290 <P>Example CommandNumbers from the generated cmdlist.r.h command number header file: </P>
13294 #define CMD_DIALOG_OPENFILE 0x7744000000000000UI64 /* DIALOGOPEN CmdString = 580 */
13297 <P>Example command function setup: </P>
13300 static void myapp_openFile (WCharCP unparsedCP)
13304 static MdlCommandNumber commandNumber[] =
13306 {myapp_openFile, CMD_DIALOG_OPENFILE },
13310 extern "C" void MdlMain (int argc, WCharCP argv[])
13312 mdlSystem_registerCommandNumbers (commandNumber);
13316 <P>To be thorough and not short change .NET AddIns, here is an example setup for AddIn commands:</P>
13322 <?xml version="1.0" encoding="utf-8" ?>
13323 <KeyinTree xmlns="http://www.bentley.com/schemas/1.0/MicroStation/AddIn/KeyinTree.xsd">
13324 <RootKeyinTable ID="root">
13325 <Keyword SubtableRef="props" CommandClass="MacroCommand" CommandWord="MSGCENTER">
13326 <Options Required="true"/>
13331 <KeyinTable ID="props">
13332 <Keyword CommandWord="OPEN" />
13338 <KeyinHandler Keyin="MSGCENTER OPEN" Function="MsgCenter.MessageCenterApp.Open" />
13345 namespace MsgCenter
13347 [Bentley.MstnPlatformNET.AddInAttribute(MdlTaskID = "MsgCenter")]
13348 public sealed class MessageCenterApp : Bentley.MstnPlatformNET.AddIn
13351 /*------------------------------------------------------------------------------------**/
13353 /*--------------+---------------+---------------+---------------+---------------+------*/
13354 public static void Open
13359 MainWindow.OpenWindow();
13363 <H3>IconCmds and Menus</H3>
13365 <P>IconCmds and Menus are two types of "entry points" that activate commands using CommandNumbers. IconCmds are actually made up of 3 separate resources. They contain the following: </P>
13367 <UL> <LI>CommandNumber </LI>
13369 <LI>Unparsed string containing command parameters </LI>
13370 <LI>Attributes</LI>
13371 <LI>Balloon (tooltip) text</LI>
13372 <LI>Flyover text, which is more descriptive than the tooltip text and is displayed in the Status Bar on hover</LI>
13373 <LI>Small and Large icon information</LI>
13376 <P>An example of an IconCmd using the CMD_DIALOG_OPENFILE CommandNumber: </P>
13379 DItem_IconCmdRsc ICONCMDID_OpenFile =
13381 NOHELP, MHELPTASKIDCMD, 0,
13382 CMD_DIALOG_OPENFILE, MTASKID, "",
13387 {EXTATTR_FLYTEXT, TXT_Flyover_OpenFile},
13388 {EXTATTR_BALLOON, TXT_Balloon_OpenFile}
13391 IconCmdSmallRsc ICONCMDID_OpenFile =
13393 24, 24, ICONFORMAT_WINDOWS, BLACK_INDEX, "Open File", "FileOpen"
13396 IconCmdLargeRsc ICONCMDID_OpenFile =
13398 32, 32, ICONFORMAT_WINDOWS, BLACK_INDEX, "Open File", "FileOpen"
13403 <P>Menu items contain information similar to IconCmds, but with a few additions: </P>
13405 <UL><LI>Label </LI>
13406 <LI>Accelerator key combination</LI>
13407 <LI>Hook information </LI>
13408 <LI>Search Id </LI>
13409 <LI>CommandNumber </LI>
13411 <LI>Unparsed string containing command parameters </LI>
13412 <LI>A reference to an IconCmd to get the icon information</LI>
13416 <P>In addition, a Feature Aspect ID check can surround the menu item definition to include or exclude the menu item for Power Products. </P>
13418 <P>An example of a menu item using the CMD_DIALOG_OPENFILE CommandNumber: </P>
13422 @if (FeatureAspect (PP_ID_FeatureAspects_File_Open)) // @fadoc File | Open menu item
13423 {TXT2_FileOpenOption, 'O
'|VBIT_CTRL, ON, NOMARK, 0, NOSUBMENU,
13424 HELPID_PULLDOWN_FileOpen, MHELPTASKIDTOPIC,
13425 NOHOOK, MENUSEARCHID_File_Open,
13426 CMD_DIALOG_OPENFILE, MTASKID, "",
13427 ICONCMDID_OpenFile, Icon, MTASKID},
13432 <P>In CONNECT edition, the Ribbon interface has been introduced. We're
using the Telerik WPF RadRibbonView as the implementation of the ribbon control. To activate commands from the ribbon, we needed a new .NET-friendly way to
get to PowerPlatform command information. IconCmds and Menu items already had duplicate information, and Ribbon Buttons would also need that same information. Instead of gathering the information from those existing resources, we decided to create a
new resource that consolidates the duplicate information. The identifier
for the
new common resource is a name
string. This
new resource is called an XCommand because it
's a common way of defining Cross-UI-Platform command information. The information includes: </P>
13434 <UL><LI>Name / Id </LI>
13435 <LI>CommandNumber </LI>
13437 <LI>Unparsed string containing command parameters </LI>
13439 <LI>Title / Label </LI>
13440 <LI>Description </LI>
13441 <LI>Feature Tracking Id (cross-referenced to Help Id)</LI>
13442 <LI>Show/Hide Expression </LI>
13443 <LI>Enable/Disable Expression </LI>
13444 <LI>Toggle Expression </LI>
13445 <LI>Menu Mark Expression </LI>
13446 <LI>Accelerator </LI>
13447 <LI>Feature Aspect Id </LI>
13450 <P>The "Name / Id" is used to uniquely identify the XCommand and is used throughout PowerPlatform. Multiple XCommands are listed in a XCommandListRsc, which can be in core or in an application. The XCommands are quickly loaded during PowerPlatform 's start up and are cached. </P>
13452 <P>The XCommand structures in dialogbox.r.h: </P>
13456 typedef struct xcommandrsc
13463 char featureTrackingId[];
13464 char showExpression[];
13465 char enableExpression[];
13466 char toggleExpression[];
13467 char markExpression[];
13468 char uiSynchEvents[];
13473 typedef struct commandrsc
13476 char commandTaskId[];
13482 <P>An example XCommand
Name is
"Mstn.File.Open".
"Mstn.File.Open" is given the
CommandNumber of CMD_DIALOG_OPENFILE from the
"Ustn" task (
MTASKID), which opens the file open dialog. The following is an example of an XCommand
in a .r file: </P>
13491 {CMD_DIALOG_OPENFILE,
MTASKID,
""},
13493 TXT_Balloon_OpenFile,
13494 TXT_Flyover_OpenFile,
13495 "ec375142-3726-11e3-bf6e-6894231a2840",
13496 "",
"",
"",
"",
"",
13498 PP_ID_FeatureAspects_File_Open},
13504 @note The Feature Tracking Id is a GUID and must be unique.
13506 <H3>XCmdButton</H3>
13507 <P>The XCmdButton item is similar to an IconCmd or IconCmdX, which adds an item hook capability, but the XCmdButton refers to an XCommand. In a ToolBox or DialogItemList, use the XCmdButton item type instead of IconCmd. </P>
13509 <P>The XCmdButton structures
in dlogbox.r.h: </P>
13513 typedef struct ditem_xcmdbuttonrsc
13514 char xCommandName[];
13521 <P>An example of an XCmdButton
in a .r file: </P>
13528 "Mstn.File.Open", 0, 0, 0
13532 {{ 0, 0, 0, 0}, XCmdButton,
ICONCMDID_OpenFile,
ON, 0,
"",
""},
13536 <H3>PartFile and MS_XCOMMAND_APPS </H3>
13538 <P>
Any application that contains XCommand resources should add itself to the MS_XCOMMAND_APPS configuration variable, which goes
in the applicationload.cfg configuration file. This is accomplished by adding an entry into the <Part>
for the application
in its PartFile. The specific entry goes
in this element hierarchy: <Part>, <Bindings>, <Files>, <LoadConfig>, ConfigVars =
"...,MS_XCOMMAND_APPS" attribute. </P>
13540 <P>An example of including MX_XCOMMAND_APPS
in the ConfigVars attribute of the <LoadConfig> element: </P>
13544 <Part
Name=
"MdlApp-2ddraw" BMakeFile=
"apps\2ddraw\2ddraw.mke">
13545 <SubPart PartName=
"2dModelingDll" />
13547 <Files ProductDirectoryName=
"MdlsysAsneeded" FeatureAspect=
"PP_ID_FeatureAspects_BaseGeometry">
13549 <TransKit SourceDirectory=
"Delivery\TransKit\MdlApps\2dModeling\2ddraw" />
13550 <LoadConfig AppName=
"2ddraw" ConfigVars=
"MS_CMDTABLE_LOAD,MS_XCOMMAND_APPS" />
13557 <H3>Native API </H3>
13559 <P>The native API
for XCommands is
in the following
interface and classes: </P>
13561 <UL><LI>IXCommand - native interface for Cross UI Framework PowerPlatform Command </LI>
13562 <LI>XCommand - native class and implementation of IXCommand </LI>
13566 <P>The following is an example of using the native XCommand API to activate/execute a command: </P>
13577 if (
NULL != xCommandP)
13578 xCommand->ExecuteCmd (
NULL,
NULL);
13582 <H2>The Ribbon and XCommands </H2>
13584 <P>The PowerPlatform Ribbon uses the RadRibbonView from Telerik and is
WPF based.
Any discussion of
WPF commands starts with an introduction to Microsoft
's ICommand interface. </P>
13586 <H3>ICommand and RelayCommand </H3>
13588 <P>ICommand is in the System.Windows.Input namespace. It is in PresentationCore.dll in .NET 4 and earlier and in System.dll starting with .NET 4.5. ICommand contains the CanExecute and Execute methods and the CanExecuteChanged event. The CanExecute method controls whether a WPF button or menu item is enabled or disabled. The Execute method fires off the method associated with the command. The CanExecuteChanged event is fired when changes occur that affect whether or not the command can execute.<a href="http://msdn.microsoft.com/en-us/library/system.windows.input.icommand(v=vs.110).aspx">ICommand Interface</a>.</P>
13590 <P>The RelayCommand class in Bentley.UI.Mvvm is an implementation of the ICommand interface. The RelayCommand 's sole purpose is to relay its functionality to another
object by invoking delegates. Our RelayCommand implementation came from Josh Smith
's library of MVVM classes. </P>
13592 <H3>IMstnCommand and NamedMstnCommand </H3>
13594 <P>The IMstnCommand interface is a managed interface for PowerPlatform commands. IMstnCommand is UI technology neutral. IMstnCommand, and several of its implementations, are in the MstnPlatformNET.Commands namespace in MicroStation.dll. IMstnCommand contains these properties: </P>
13596 <UL><LI>bool CanExecute</LI>
13597 <LI>bool CanDisplay </LI>
13598 <LI>String IconName </LI>
13599 <LI>BMG::RscIconSpec IconSpec </LI>
13600 <LI>String Label </LI>
13601 <LI>String Description </LI>
13602 <LI>String AcceleratorString </LI>
13605 <P>The CanExecute property is all that overlaps with something in the ICommand interface. Everything else is unique to PowerPlatform. The MstnCommand class is an abstract base class that adds Named Expressions for Show, Enable, Toggle and Menu Mark. The NamedMstnCommand class is a subclass of MstnCommand and is the managed wrapper around the native XCommand. </P>
13607 <H3>MstnRelayCommand </H3>
13609 <P>The MstnRelayCommand class is a subclass of RelayCommand. It is WPF specific and is in the Bentley.MicroStation.WPF.dll assembly. It forms the connection between the Microsoft ICommand interface and the Bentley IMstnCommand interface introduced above. MstnRelayCommand contains: </P>
13611 <UL><LI>MstnRelayCommand ( BM.Commands.IMstnCommand)</LI>
13612 <LI>bool CanDisplay </LI>
13613 <LI>SW.Visibility Visibility</LI>
13614 <LI>ImageSource SmallImage </LI>
13615 <LI>ImageSource LargeImage </LI>
13616 <LI>String Label </LI>
13617 <LI>String Description </LI>
13618 <LI>String AcceleratorString</LI>
13619 <LI>BMC::IMstnCommand Command </LI>
13620 <LI>bool CanExecute () (from ICommand)</LI>
13621 <LI>Execute() (from ICommand)</LI>
13622 <LI>CanExecuteChanged event (from ICommand)</LI>
13625 <H3>Ribbon Definitions </H3>
13627 <P>To include anything in the PowerPlatform ribbon, it needs to be defined in a "Ribbon Definition". Ribbon Definitions are specified in an XML file conforming to the RibbonDefinitions.xsd file. There are definitions for numerous objects making up the ribbon, including Buttons, DropDownButtons, SplitButtons, Groups, Tabs, etc. Buttons, DropDownButtons, SplitButtons definitions may contain "Command Data" that refers to a "Named Command", which is really a reference to a NamedMstnCommand instance. </P>
13629 <P>An example of a <Button> element in an XML file: </P>
13634 <Button Name="Mstn.File.Open" Priority="0">
13636 <CommandData Type="NamedCommand">
13637 <NamedCommand>Mstn.File.Open</NamedCommand>
13646 <P>An example of a <ButtonRef> element referring to a Named <Button> in an XML file: </P>
13650 <QuickAccessCollections>
13651 <QuickAccessCollection Name="Mstn.QuickAccessItems" . . .
13653 <ButtonRef Name="Mstn.File.Open" Priority="5">
13654 <ButtonParams Size="Small" CollapseToSmall="Never" CollapseToMedium="Never">
13655 <AccessText>2</AccessText>
13661 <H3>Using NamedMstnCommands and MstnRelayCommands in C# and XAML </H3>
13663 <P>An example of exposing an XCommand to C# or XAML via the NamedMstnCommand and MstnRelayCommand classes: </P>
13666 -- MyCommands.cs --
13668 using BM = Bentley.MstnPlatformNET;
13672 private MstnRelayCommand m_FileOpen;
13673 public MstnRelayCommand FileOpen
13677 if (m_FileOpen == null)
13678 m_FileOpen = new MstnRelayCommand(new BM.Commands.NamedMstnCommand ("Mstn.File.Open"));
13683 -- MyViewModel.cs --
13685 public MyCommands MyCommands;
13689 <P>An example of referencing an MstnRelayCommand in XAML for the Backstage: </P>
13694 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
13696 <telerik:RadRibbonBackstageItem Header="{x:Static props:Resources.Open_Label}"
13697 IsSelectable="False"
13698 CloseOnClick="True"
13699 Command="{Binding MyCommands.FileOpen}"
13700 Visibility="{Binding MyCommands.FileOpen.Visibility}"
13701 telerik:KeyTipService.AccessText="O"/>
13706 <H3>XCommands for .NET AddIns </H3>
13708 <P>We have implemented a way for managed applications to supply XCommandRsc Â’s using a Bentley resource manager resource (.r) file. Here are the steps for using this capability. </P>
13711 <LI><B>Create resource file containing an XCommandRscList with the same name as your managed assembly.</B>For example, if your assembly is Bentley.ECUISupport.dll, then your resource file should be Bentley.ECUISupport.r. See Bentley.ECUISupport.r for an example XCommand resource file. Here is a section of the Bentley.ECUISupport.r file:
13714 #include <Mstn\MicroStation.r.h>
13715 #include <Mstn\MdlApi\dlogbox.r.h>
13717 #include <ribbontext.h>
13718 #include <rsrctxt2.h>
13720 #include <TransKitGenSrc\bentley.ecuisupportcmd.h>
13721 #include <TransKitGenSrc\PowerPlatform.FeatureAspects.h>
13723 XCommandListRsc 1 =
13726 {"Mstn.File.Properties",
13727 {CMD_ELEMENT_INFO_FILEPROPERTIES, "Bentley.ECUISupport", ""},
13729 TXT_RibbonLabel_FileProperties,
13730 TXT_RibbonDesc_FileProperties,
13731 "ec383b8d-3726-11e3-8f85-6894231a2840", "", "", "", "", "", NOACCEL,
13732 PP_ID_FeatureAspects_File_Properties}, // @fadoc File.Properties XCommand
13733 {"Mstn.ProjectNavigation.Explorer",
13734 {CMD_DIALOG_EXPLORER_TOGGLE, "Bentley.ECUISupport", ""},
13736 TXT2_FileProjectOption,
13737 TXT_RibbonDesc_Explorer,
13738 "ec3a104e-3726-11e3-a7ad-6894231a2840", "", "", "", "", "", NOACCEL,
13739 PP_ID_FeatureAspects_Properties_ECBrowser}, // @fadoc ProjectNavigation.Explorer XCommand
13746 <P>Note that the XCommandListRsc ’s in MicroStation ’s source files use defined constants such as “TXT_RibbonLabel_FileProperties” because those text strings are also used in other places. It is not necessary to do that (you can just put the English strings directly into the resource) because a .rsc.mui.xliff file is generated from this file for localization purposes. </P>
13747 <P>The field following the CMD_xxx entry must be the Add-inÂ’s TaskId. You can find out what that is by looking in the application dropdown in MicroStation Â’s keyin browser. For XCommandRsc Â’s added through the mechanism described here, it must be filled in. </P>
13748 <P>The "#include <TransKitGenSrc\bentley.ecuisupportcmd.h>" and CMD_ELEMENT_INFO_FILEPROPERTIES sections are related to step 4 below.</P></LI>
13750 <LI><B>Modify your transkit.xml file to specify that the XCommands resource file specified above is included in your translatable resources.</B> For example, the <BentleyRsc> element was added to the ECUISupport transkit.xml file:
13754 <?xml version="1.0" encoding="utf-8"?>
13758 <SatelliteAssembly DllName="Bentley.ECUISupport" DeliverEnglish="False" RightsCompliant="True">
13759 <ResxFile ResourceName="Bentley.ECUISupport" FileName="ECUISupport.resx" />
13760 </SatelliteAssembly>
13762 <BentleyRsc Name="Bentley.ECUISupport.rsc.mui" >
13763 <ResourceSource>Bentley.ECUISupport.r</ResourceSource>
13770 <LI><B>Modify the part in your xxx.PartFile.xml file to tell BentleyBuild that you want to deliver the compiled XCommand resource file alongside your assembly.</B> You also need to add your .rsc file to the MS_XCOMMAND_RSRCS configuration file. If you are working with a MicroStation part, that can be done in the part file. The "Delivery\Bentley.ECUISupport.rsc" and "MS_XCOMMAND_RSCS" additions were made to the Bentley.ECUISupport part in PowerPlatform.Partfile.xml: </LI>
13774 <Part Name="ClrApp-ECUISupport" BMakeFile="mstn\clrapps\ECUISupport\ECUISupport.mke">
13775 <SubPart PartName="DgnDisplayNet" PartFile="DgnDisplayNet" Repository="DgnDisplayNet" />
13776 <SubPart PartName="ClrApp-propertymanager" />
13777 <SubPart PartName="Componentsets" PartFile="PPModules\Componentsets\Componentsets" />
13779 <Assemblies ProductDirectoryName="PPManagedAssemblies">
13780 Delivery\Bentley.ECUISupport.dll
13781 Delivery\Bentley.ECUISupport.rsc
13782 <TransKit SourceDirectory="Delivery\TransKit\clrapps\Bentley.ECUISupport" />
13783 <LoadConfig AppName="Bentley.ECUISupport" ConfigVars="MS_CMDTABLE_LOAD,MS_XCOMMAND_RSCS" />
13790 <LI><B>In your bmake file, make sure you are generating the .h file that specifies the CMD_xxx constants from your command table.</B>If you are interested in making XCommand resources, that means you have specified the command structure of your application in an xml file, usually in a file named something like <appname>.commands.xml. You need to generate an include file that defines constants that you can use in the XCommands resource. In ECUISupport.mke, this was added:
13794 #----------------------------------------------------------------------
13795 # Create the command table include file.
13796 #----------------------------------------------------------------------
13797 $(gensrcTransKit)$(appName)cmd.h : $(baseDir)src/Resources/ECUISupport.commands.xml
13801 <P>If you look back at Step 1, you will see where the generated header file is #included, and where the constants are used in the XCommand specification. </P>
13804 <LI><B>Modify your bmake file to set up processing of the BentleyRsc section of the transkit.xml file.</B> The following is in a new section that was added near the end of ECUISupport.mke.
13808 #----------------------------------------------------------------------
13809 # Create and SymLink the XCommand .rsc file
13810 #----------------------------------------------------------------------
13811 MuiBaseName = $(appName).rsc
13812 MuiTranskitDeliveryDir = $(ContextDeliveryDir)TransKit/clrapps/$(appName)/
13813 MuiAdditionalIncludes = $(MSCore)TransKit/SharedInc/ $(gensrc)
13814 MuiTranskitSourceDir = $(baseDir)src/Resources/
13816 # This tells CreateAndSymLinkMui to symlink the resource file itself
13817 ForClrAppXCommand = 1>
13819 # This tells CreateAndSymLinkMui to avoid symlinking the transkit.xml file - SymLinkResxTrankitFiles.py does that.
13820 DontSymLinkTranskitXml = 1
13822 %include $(SharedMki)CreateAndSymlinkMui.mki
13826 <P>Since this new section uses only bmake variables that are usually defined in every bmake file (e.g., appName, ContextDeliveryDir, baseDir), you can pretty much copy that section. If you are not working in the MicroStation source, you probably need to change the definition of MuiAdditionalIncludes, often to just $(gensrc). In the example, $(MSCORE)Transkit/SharedInc/ is there so that ribbontext.h is found to resolve the constants like TXT_RibbonLable_FileProperties.</P>
13829 <P>If you follow the steps above, you should find the <appName>.rsc file delivered in the same directory as your <appName>.dll file. In the en subdirectory, there should be an <appName>.rsc.mui file, and an <appName>.rsc.mui.xliff file is created to be added to the transkit. </P>
13833 @addtogroup IRibbonComponentProviders
13835 @note IRibbonComponentProviders provide component that can be placed on the Ribbon in MicroStation
13837 <H2>IRibbonComponentProviders </H2>
13839 <P>Managed applications can provide their own components for the Ribbon by implementing the IRibbonComponentProvider interface and registering it with the RibbonComponentManager. This interface allows application provided to properly work with standard ribbon features such as ribbon search, popup groups, and Hidden Tool resources. The following shows an example of registering a provider: </P>
13843 RibbonComponentManager.Manager.RegisterRibbonComponentProvider (new RibbonComponentProvider ());
13847 <P>A RibbonComponent has three basic requirements. It must supply/register a definition of itself. It must create a viewmodel that will serve as a data context for actual WPF control. It must create the WPF control that will be inserted into the ribbon. </P>
13848 <P>The definition must supply a name and that name must be unique for the component type. For example two button definitions should not have the same name. A list of the primary component types are shown below.</P>
13852 <th>Component Type</th> <th>Definition Type</th> <th>ViewModel Type</th> <th>Control Type</th>
13855 <td>Tab</td> <td>RibbonTabDefinition</td> <td>RibbonTabViewModel</td> <td>RadRibbonTab</td>
13858 <td>Group </td> <td>RibbonGroupDefinition </td> <td>RibbonGroupViewModel </td> <td>RadRibbonGroup</td>
13861 <td>Panel </td> <td>RibbonGroupPanelDefinition </td> <td>RibbonGroupPanelViewModel </td> <td>StackPanel,RadCollapsiblePanel, or RadOrderedWrapPanel </td>
13864 <td>ButtonGroup </td> <td>RibbonButtonGroupDefinition </td> <td>RibbonButtonGroupViewModel</td> <td>RadButtonGroup </td>
13867 <td>Button </td> <td>RibbonButtonDefinition </td> <td>RibbonButtonViewModel </td> <td>RadRibbonButton </td>
13870 <td>DropDownButton </td> <td>RibbonDropDownButtonDefinition </td> <td> RibbonDropDownButtonViewModel </td> <td>RadRibbonDropDownButton </td>
13873 <td>SplitButton </td> <td>RibbonSplitButtonDefinition </td> <td> RibbonSplitButtonViewModel </td> <td>RadRibbonSplitButton </td>
13876 <td>ToggleButton </td> <td>RibbonToggleButtonDefinition </td> <td> RibbonToggleButtonViewModel </td> <td>RadRibbonToggleButton </td>
13879 <td>RadioButton </td> <td>RibbonRadioButtonDefinition </td> <td> RibbonRadioButtonViewModel </td> <td>RadRibbonRadioButton </td>
13882 <td>ComboBox </td> <td>RibbonComboBoxDefinition </td> <td> RibbonComboBoxViewModel </td> <td>RadRibbonComboBox </td>
13885 <td>Gallery </td> <td>RibbonGalleryDefinition </td> <td> RibbonGalleryViewModel </td> <td>RadRibbonGallery </td>
13889 <P>The names of the definitions are used to configure the presentation of the Ribbon. To see example configurations look at the XML files in MstnPlatform \mstn\clrapps\RibbonView\RibbonXML. </P>
13890 <P>The Bentley.MstnPlatformNET.Ribbon.IRibbonComponentProvider interface definition is shown below: </P>
13894 public interface IRibbonComponentProvider
13897 String ProviderKey {get;}
13900 IList<RibbonTabCollectionDefinition> RegisterTabCollectionDefinitions ();
13901 IList<ContextualTabSetDefinition> RegisterContextualTabSetDefinitions ();
13902 IList<QuickAccessCollectionDefinition> RegisterQuickAccessCollectionDefinitions ();
13903 IList<RibbonButtonGroupDefinition> RegisterButtonGroupDefinitions ();
13904 IList<RibbonButtonDefinition> RegisterButtonDefinitions ();
13905 IList<RibbonDropDownButtonDefinition> RegisterDropDownButtonDefinitions ();
13906 IList<RibbonSplitButtonDefinition> RegisterSplitButtonDefinitions ();
13907 IList<RibbonToggleButtonDefinition> RegisterToggleButtonDefinitions ();
13908 IList<RibbonRadioButtonDefinition> RegisterRadioButtonDefinitions ();
13909 IList<RibbonComboBoxDefinition> RegisterComboBoxDefinitions ();
13910 IList<RibbonTabDefinition> RegisterTabDefinitions ();
13911 IList<RibbonMenuItemCollectionDefinition> RegisterMenuItemCollectionDefinitions ();
13912 IList<RibbonGroupPanelDefinition> RegisterGroupPanelDefinitions ();
13913 IList<RibbonGroupDefinition> RegisterGroupDefinitions ();
13914 IList<RibbonGalleryDefinition> RegisterGalleryDefinitions ();
13915 IList<WorkflowDefinition> RegisterWorkflowDefinitions ();
13916 IList<RibbonDropDownPanelDefinition> RegisterDropDownPanelDefinitions ();
13917 IList<BackstageItemDefinition> RegisterBackstageItemDefinitions ();
13922 ContextualTabSetViewModel CreateContextualTabSetViewModelFromDefinition (ContextualTabSetDefinition def);
13923 TabCollectionViewModel CreateTabCollectionViewModelFromDefinition (RibbonTabCollectionDefinition def);
13924 QuickAccessToolbarViewModel CreateQuickAccessCollectioniewModelFromDefinition (QuickAccessCollectionDefinition def);
13925 IRibbonItemViewModel CreateButtonGroupViewModelFromDefinition (RibbonButtonGroupDefinition def);
13926 IRibbonItemViewModel CreateButtonViewModelFromDefinition (RibbonButtonDefinition def);
13927 IRibbonItemViewModel CreateDropDownButtonViewModelFromDefinition (RibbonDropDownButtonDefinition def);
13928 IRibbonItemViewModel CreateSplitButtonViewModelFromDefinition (RibbonSplitButtonDefinition def);
13929 IRibbonItemViewModel CreateToggleButtonViewModelFromDefinition (RibbonToggleButtonDefinition def);
13930 IRibbonItemViewModel CreateRadioButtonViewModelFromDefinition (RibbonRadioButtonDefinition def);
13931 IRibbonItemViewModel CreateComboBoxViewModelFromDefinition (RibbonComboBoxDefinition def);
13932 IRibbonItemViewModel CreateTabViewModelFromDefinition (RibbonTabDefinition def);
13933 RibbonMenuItemCollectionViewModel CreateMenuItemCollectionViewModelFromDefinition (RibbonMenuItemCollectionDefinition def);
13934 IRibbonItemViewModel CreateGroupPanelViewModelFromDefinition (RibbonGroupPanelDefinition def);
13935 IRibbonItemViewModel CreateGroupViewModelFromDefinition (RibbonGroupDefinition def);
13936 IRibbonItemViewModel CreateGalleryViewModelFromDefinition (RibbonGalleryDefinition def);
13937 IRibbonItemViewModel CreateBackstageItemViewModelFromDefinition (BackstageItemDefinition def, ViewModelContext context);
13940 RadButtonGroup CreateButtonGroupFromViewModel (IRibbonItemViewModel item);
13941 RadRibbonButton CreateButtonFromViewModel (IRibbonItemViewModel item);
13942 RadDropDownButton CreateDropDownButtonFromViewModel (IRibbonItemViewModel item);
13943 RadRibbonSplitButton CreateSplitButtonFromViewModel (IRibbonItemViewModel item);
13944 RadRibbonToggleButton CreateToggleButtonFromViewModel (IRibbonItemViewModel item);
13945 RadRibbonRadioButton CreateRadioButtonFromViewModel (IRibbonItemViewModel item);
13946 RadRibbonComboBox CreateComboBoxFromViewModel (IRibbonItemViewModel item);
13947 RadRibbonTab CreateTabFromViewModel (IRibbonItemViewModel item);
13948 Object CreatePanelFromViewModel (IRibbonItemViewModel item);
13949 RadRibbonGroup CreateGroupFromViewModel (IRibbonItemViewModel item);
13950 RadRibbonGallery CreateGalleryFromViewModel (IRibbonItemViewModel item);
13951 RadRibbonBackstageItem CreateBackstageItemFromViewModel (IRibbonItemViewModel itemVm);
13955 <P>The class Bentley.MstnPlatformNET.Ribbon.BaseRibbonComponentProvider is provided to allow users to easily implement RibbonComponentProviders which only provide a subset of possible component types. For an example implementation of an IRibbonComponentProvider, see the file MstnPlatform \mstn\clrapps\RibbonView\RibbonComponentProvider.cs which provides Tab, DropDownButton, and ComboBox components current seen in the Ribbon. </P>
13957 <H3>Specifying Ribbon Component Providers</H3>
13959 <P>The variable MS_RIBBONCOMPONENTPROVIDERS is used to specify ribbon component providers. The RibbonView application will load the specified provider dll and create the class that is specified by the InstanceOnLoad attribute. </P>
13961 <H3>Example - Setting up a component provider </H3>
13966 MyComponentProvider.dll
13968 MS_RIBBONCOMPONENTPROVIDERS < MyComponentProvider
13970 [Bentley.MstnPlatformNET.Ribbon.InstanceOnLoad]
13971 public class MyComponentProvider : Bentley.MstnPlatformNET.Ribbon.BaseRibbonComponentProvider
13973 /*------------------------------------------------------------------------------------**/
13975 /*--------------+---------------+---------------+---------------+---------------+------*/
13976 public MyComponentProvider
13980 RibbonComponentManager.Manager.RegisterRibbonComponentProvider (this)
13983 /*------------------------------------------------------------------------------------**/
13985 /*--------------+---------------+---------------+---------------+---------------+------*/
13986 public override string ProviderKey
13988 get {return "MyComponentProvider.RibbonComponentProvider"; }
13991 /*------------------------------------------------------------------------------------**/
13993 /*--------------+---------------+---------------+---------------+---------------+------*/
13994 ~ MyComponentProvider() // destructor
13996 RibbonComponentManager.Manager.UnRegisterRibbonComponentProvider (this.Name)
13999 /*------------------------------------------------------------------------------------**/
14001 /*--------------+---------------+---------------+---------------+---------------+------*/
14002 public override IList<RibbonDropDownButtonDefinition> RegisterDropDownButtonDefinitions ()
14007 /*------------------------------------------------------------------------------------**/
14009 /*--------------+---------------+---------------+---------------+---------------+------*/
14010 public override IRibbonItemViewModel CreateDropDownButtonViewModelFromDefinition (RibbonDropDownButtonDefinition def)
14014 case "MyDropDownItem":
14016 MyIRibbonItemVeiwModelBasedViewModel vm = new ....
14018 // set any specific property overrides from definition, like AccessText
14019 RibbonViewModelHelper.CopyPropertiesFromDefinition (vm, def);
14027 /*------------------------------------------------------------------------------------**/
14029 /*--------------+---------------+---------------+---------------+---------------+------*/
14030 public override RadDropDownButton CreateDropDownButtonFromViewModel (IRibbonItemViewModel itemVm)
14034 case "MyDropDownItem":
14036 MyIRibbonItemVeiwModelBasedViewModel myVm = itemVm as MyIRibbonItemVeiwModelBasedViewModel;
14038 RadDropDownButton button = new MyDropDownButton (myVm); // button.DataContext should be set to your ViewModel (myVm)
14040 // set any specific overrides from definition, like AccessText and ToolTips
14041 RibbonComponentHelper.SetRadDropDownButtonPropertiesFromVM(button, itemVm);
14050 <H3>Setting style to make Sure Your xaml supplied Tab, Groups and Buttons display </H3>
14051 <P>Step 1. Ensure your addin is subclassed from WpfAddin and make sure to define a ThemStyle attribute that specifies where the style resources are located.</P>
14055 [Bentley.MstnPlatformNET.AddInAttribute(MdlTaskID = "TableUI")]
14056 [ThemeStyle ("Bentley.TableUI", "Themes/Common.xaml")]
14057 public classTableUIApp : WpfAddIn
14062 <P>Step 2. Define your styles in Common.xaml, below is an example.</P>
14065 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"xmlns:local="clr-namespace:Bentley.MstnPlatformNET.TableUI.Views">
14066 <Style BasedOn="{StaticResource RadRibbonButtonStyle}" TargetType="{x:Type local:DistributeColumnsButton}"/>
14067 <Style BasedOn="{StaticResource RadRibbonButtonStyle}" TargetType="{x:Type local:DistributeRowsButton}"/>
14068 <Style BasedOn="{StaticResource RadRibbonGroupStyle}" TargetType="{x:Type local:TableSymbologyGroup}"/>
14069 <Style BasedOn="{StaticResource RadRibbonGroupStyle}" TargetType="{x:Type local:TableOptionsGroup}"/>
14070 <Style BasedOn="{StaticResource RadRibbonDropDownButtonStyle}" TargetType="{x:Type local:ShadingDropDownButton}"/>
14071 <Style BasedOn="{StaticResource BentleyRibbonDropDownButtonStyle}" TargetType="{x:Type local:TableColorDropDownButton}" >
14072 <Setter Property="DropDownHeight"Value="450" /><Setter Property="DropDownWidth"Value="500" />
14074 <Style BasedOn="{StaticResource BentleyRibbonDropDownButtonStyle}" TargetType="{x:Type local:TableLineStyleDropDownButton}" >
14075 <Setter Property="DropDownHeight"Value="500" /><Setter Property="DropDownWidth"Value="180" />
14077 <Style BasedOn="{StaticResource BentleyRibbonDropDownButtonStyle}" TargetType="{x:Type local:TableLineWeightDropDownButton}" >
14078 <Setter Property="DropDownHeight"Value="400" /><Setter Property="DropDownWidth"Value="170" />
14080 <Style BasedOn="{StaticResource RadRibbonSplitButtonStyle}" TargetType="{x:Type local:TableBordersSplitButton}"/>
14081 <Style BasedOn="{StaticResource RadRibbonGroupStyle}" TargetType="{x:Type local:CellSizeGroup}"/>
14082 <Style BasedOn="{StaticResource RadRibbonGroupStyle}" TargetType="{x:Type local:TableSizeGroup}"/>
14083 </ResourceDictionary>
14086 <H3>Supporting RightClick HiddenTool Processing (and RibbonSearch support) </H3>
14088 <P>If you want the Ribbon to see your components when it collects up a list of items to display the Show/Hide right click menu, the ViewModel set as the DataContext of your component must implement the ISupportsHidingViaUserPrefs interface and provide a non-null UniqueOccurrenceName, UniqueOccurrenceLabel, ParentOccurence, and ItemType. This Interface includes the interface ISupportUniqueOccurrence which is used to add entries into the Ribbon Search box. So if you implement ISupportsHidingViaUserPrefs your component is compatible with both features. These interfaces are also implemented in IRibbonItemViewModel. Since the RibbonComponentManager uses IRibbonItemViewModel, your viewmodels should automatically work with both features. Note, that currently only components that implement ISupportsMstnRelayCommand will be shown in Ribbon Search. </P>
14089 <P>If your component provider is providing a RadRibbonGroup, the ViewModel that serves as the DataContext for the group must implement ISupportsRibbonItems. Each object in the "Items" collection, must have their DataContext set to an IRibbonItemViewModel or at a minimum implement ISupportsHidingViaUserPrefs. </P>
14091 <H3>Storing State Data for Ribbon Components </H3>
14093 <P>State data is data that you want to save between MicroStation design sessions. To store the state data of ribbon components into the common ribbon state file typically named "MstnRibbonState.xml" if not overridden by variable MS_RIBBONPREFS the following procedure can be followed:</P>
14095 <LI>Define a class to get/set your state data properties. </LI>
14096 <LI>Define ECProperties within an ECClass that is uniquely named for your provider.</LI>
14097 <LI>Add the ECClass to the ECSchema that is provided by Bentley.MicroStation.Ribbon.dll in the static property Bentley.MstnPlatformNET.Ribbon.RibbonState.Schema</LI>
14098 <LI>Set up C# Properties that get and set values in the instance specific to your provider.</LI>
14099 <LI>If a property value is changed call RibbonState.RibbonStateData.Dirty = true; to force the state file to be rewritten when the MicroStation session is closed.</LI>
14102 <H3>Example - Defining Ribbon Component Provider State Data </H3>
14104 The following code is an example implementate of a ViewGroupHistoryState class for the ViewGroupHistory Ribbon Component provider. This can serve as a template for other RibbonComponentProviders. </P>
14109 /*--------------------------------------------------------------------------------------+
14111 | $Source: docs/Articles/APIIntroductionMDL.h $
14113 | $Copyright: (c) 2017 Bentley Systems, Incorporated. All rights reserved. $
14115 +--------------------------------------------------------------------------------------*/
14116 namespace Bentley.ViewGroupHistory
14119 using Bentley.ECObjects;
14120 using Bentley.ECObjects.XML;
14121 using Bentley.ECObjects.Schema;
14122 using Bentley.ECObjects.Instance;
14125 using Bentley.DgnPlatformNET;
14126 using System.Collections.Generic;
14127 using Bentley.MstnPlatformNET.Ribbon;
14129 /*====================================================================================**/
14132 /*==============+===============+===============+===============+===============+======*/
14133 public sealed class ViewGroupHistoryState
14135 private static ViewGroupHistoryState s_state;
14137 // Name of Class to be added to the RibbonState schema. This must be unique across all RibbonComponent Providers
14138 private const string s_StateClassName = @"ViewGroupHistoryState";
14140 // Set up const strings for all the name of all ECProperties that will be needed to hold out state data
14141 private const string s_propname_AllDropDownWidth = @"AllDropDownWidth";
14142 private const string s_propname_AllDropDownHeight = @"AllDropDownHeight";
14143 private const string s_propname_PreviousDropDownWidth = @"PrevDropDownWidth";
14144 private const string s_propname_PreviousDropDownHeight = @"PrevDropDownHeight";
14145 private const string s_propname_NextDropDownWidth = @"NextDropDownWidth";
14146 private const string s_propname_NextDropDownHeight = @"NextDropDownHeight";
14151 /*------------------------------------------------------------------------------------**/
14154 /*--------------+---------------+---------------+---------------+---------------+------*/
14155 private ViewGroupHistoryState ()
14157 // Get the default RibbonState schema and define the class the will hold the state
14158 // values for the component this assemble provides.
14159 ECSchema schema = RibbonState.Schema;
14160 if (null != schema)
14161 LoadViewGroupHistoryStateClass (schema);
14164 /*------------------------------------------------------------------------------------**/
14166 /*--------------+---------------+---------------+---------------+---------------+------*/
14167 private void RegisterProperty (IECClass stateClass, string name, IECPrimitiveType type)
14169 stateClass.Add (new ECProperty (name, type));
14172 /*------------------------------------------------------------------------------------**/
14175 /*--------------+---------------+---------------+---------------+---------------+------*/
14176 private void LoadViewGroupHistoryStateClass (ECSchema schema)
14178 ECClass stateClass = new ECClass (s_StateClassName);
14180 RegisterProperty (stateClass, s_propname_AllDropDownWidth, ECObjects.DoubleType);
14181 RegisterProperty (stateClass, s_propname_AllDropDownHeight, ECObjects.DoubleType);
14183 RegisterProperty (stateClass, s_propname_PreviousDropDownWidth, ECObjects.DoubleType);
14184 RegisterProperty (stateClass, s_propname_PreviousDropDownHeight, ECObjects.DoubleType);
14186 RegisterProperty (stateClass, s_propname_NextDropDownWidth, ECObjects.DoubleType);
14187 RegisterProperty (stateClass, s_propname_NextDropDownHeight, ECObjects.DoubleType);
14189 schema.AddClass (stateClass);
14190 schema.TrimToSize ();
14193 /*------------------------------------------------------------------------------------**/
14198 /*--------------+---------------+---------------+---------------+---------------+------*/
14199 private IECInstance StateInstance
14203 return RibbonState.RibbonStateData.GetOrCreateInstanceByClassName (s_StateClassName);
14207 /*------------------------------------------------------------------------------------**/
14213 /*--------------+---------------+---------------+---------------+---------------+------*/
14214 private string GetPropertyAsString (string name, string defaultValue="")
14216 return ECInstanceHelper.GetInstanceStringValue (StateInstance, name, defaultValue);
14219 /*------------------------------------------------------------------------------------**/
14224 /*--------------+---------------+---------------+---------------+---------------+------*/
14225 private void SetPropertyString (string name, string value)
14227 IECInstance instance = StateInstance;
14228 IECPropertyValue propVal = instance[name];
14230 if (propVal.IsNull || value != propVal.StringValue)
14232 instance[name].StringValue = value;
14233 RibbonState.RibbonStateData.Dirty = true;
14237 /*------------------------------------------------------------------------------------**/
14243 /*--------------+---------------+---------------+---------------+---------------+------*/
14244 private double GetPropertyAsDouble(string name, double defaultValue=0.0)
14246 return ECInstanceHelper.GetInstanceDoubleValue (StateInstance, name, defaultValue);
14249 /*------------------------------------------------------------------------------------**/
14254 /*--------------+---------------+---------------+---------------+---------------+------*/
14255 private void SetPropertyDouble (string name, double value)
14257 IECInstance instance = StateInstance;
14258 IECPropertyValue propVal = instance[name];
14260 if (propVal.IsNull || value != propVal.DoubleValue)
14262 instance[name].DoubleValue = value;
14263 RibbonState.RibbonStateData.Dirty = true;
14267 /*------------------------------------------------------------------------------------**/
14273 /*--------------+---------------+---------------+---------------+---------------+------*/
14274 private double GetPropertyAsInt (string name, int defaultValue=0)
14276 return ECInstanceHelper.GetInstanceIntValue (StateInstance, name, defaultValue);
14279 /*------------------------------------------------------------------------------------**/
14284 /*--------------+---------------+---------------+---------------+---------------+------*/
14285 private void SetPropertyInt (string name, int value)
14287 IECInstance instance = StateInstance;
14288 IECPropertyValue propVal = instance[name];
14290 if (propVal.IsNull || value != propVal.IntValue)
14292 instance[name].IntValue = value;
14293 RibbonState.RibbonStateData.Dirty = true;
14297 /*------------------------------------------------------------------------------------**/
14303 /*--------------+---------------+---------------+---------------+---------------+------*/
14304 private bool GetPropertyAsBool (string name, bool defaultValue=false)
14306 return ECInstanceHelper.GetInstanceBoolValue (StateInstance, name, defaultValue);
14309 /*------------------------------------------------------------------------------------**/
14314 /*--------------+---------------+---------------+---------------+---------------+------*/
14315 private void SetPropertyBool (string name, bool value)
14317 IECInstance instance = StateInstance;
14318 IECPropertyValue propVal = instance[name];
14320 if (propVal.IsNull || value != (bool)propVal.NativeValue)
14322 instance[name].NativeValue = value;
14323 RibbonState.RibbonStateData.Dirty = true;
14328 // Public methods and properties
14330 /*------------------------------------------------------------------------------------**/
14333 /*--------------+---------------+---------------+---------------+---------------+------*/
14334 public static ViewGroupHistoryState StateData
14338 if (null == s_state)
14339 s_state = new ViewGroupHistoryState ();
14345 /*------------------------------------------------------------------------------------**/
14348 /*--------------+---------------+---------------+---------------+---------------+------*/
14349 public double AllDropDownWidth
14353 return GetPropertyAsDouble (s_propname_AllDropDownWidth, 200);
14357 SetPropertyDouble (s_propname_AllDropDownWidth, value);
14361 /*------------------------------------------------------------------------------------**/
14364 /*--------------+---------------+---------------+---------------+---------------+------*/
14365 public double AllDropDownHeight
14369 return GetPropertyAsDouble (s_propname_AllDropDownHeight, 180);
14373 SetPropertyDouble (s_propname_AllDropDownHeight, value);
14377 /*------------------------------------------------------------------------------------**/
14380 /*--------------+---------------+---------------+---------------+---------------+------*/
14381 public double PreviousDropDownWidth
14385 return GetPropertyAsDouble (s_propname_PreviousDropDownWidth, 200);
14389 SetPropertyDouble (s_propname_PreviousDropDownWidth, value);
14393 /*------------------------------------------------------------------------------------**/
14396 /*--------------+---------------+---------------+---------------+---------------+------*/
14397 public double PreviousDropDownHeight
14401 return GetPropertyAsDouble (s_propname_PreviousDropDownHeight, 180);
14405 SetPropertyDouble (s_propname_PreviousDropDownHeight, value);
14409 /*------------------------------------------------------------------------------------**/
14412 /*--------------+---------------+---------------+---------------+---------------+------*/
14413 public double NextDropDownWidth
14417 return GetPropertyAsDouble (s_propname_NextDropDownWidth, 200);
14421 SetPropertyDouble (s_propname_NextDropDownWidth, value);
14425 /*------------------------------------------------------------------------------------**/
14428 /*--------------+---------------+---------------+---------------+---------------+------*/
14429 public double NextDropDownHeight
14433 return GetPropertyAsDouble (s_propname_NextDropDownHeight, 180);
14437 SetPropertyDouble (s_propname_NextDropDownHeight, value);
14441 } // ViewGroupHistoryState
14442 } //namespace Bentley.ViewGroupHistory
14445 <H3>Example MstnRibbonState.xml file </H3>
14447 <P>Below is an example state xml file that contains data from two RibbonCoponent Providers. </P>
14451 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
14452 <!--Bentley MstnRibbonState Configuration File.-->
14453 <!--Modifying this file may render it invalid.-->
14455 <RibbonViewState xmlns="RibbonState.01.00">
14456 <ActiveWorkFlowName>Drawing</ActiveWorkFlowName>
14457 <RibbonMinimizedState>False</RibbonMinimizedState>
14458 <LineStylePickerShowSearch>True</LineStylePickerShowSearch>
14459 <LineStylePickerShowRecentStyles>True</LineStylePickerShowRecentStyles>
14460 <LineStylePickerDisplayMode>All</LineStylePickerDisplayMode>
14461 <LineStylePickerDropDownWidth>180</LineStylePickerDropDownWidth>
14462 <LineStylePickerDropDownHeight>500</LineStylePickerDropDownHeight>
14464 <ViewGroupHistoryState xmlns="RibbonState.01.00">
14465 <PrevDropDownWidth>200</PrevDropDownWidth>
14466 <PrevDropDownHeight>180</PrevDropDownHeight>
14467 </ViewGroupHistoryState>
14486 *****************************************************************************************/
14489 /************************************************************************************//**
14490 * @addtogroup UpdateFiveDeprecatedFunctions
14492 * <P>Below are listed a set of functions and methods deprecated in update 5, 10.05.00.xx builds </P>
14498 StatusInt Relationship::Moniker::FromAssocPoint (DgnModelRefP homeModel, DgnPlatform::AssocPoint const& ap);
14502 <H3>Replacement : </H3>
14507 Moniker m (homeModel, ap);
14515 StatusInt Relationship::Moniker::FromNonLocalElement (DgnModelRefP homeModel, DgnPlatform::ElementId elementIn, DgnModelRefP refModel);
14519 <H3>Replacement : </H3>
14524 Moniker m (homeModel, PersistentElementPath (homeModel, elementIn));
14533 StatusInt Relationship::Moniker::FromNonLocalElement (DgnModelRefP homeModel, DgnPlatform::ElementId elementIn, DgnPlatform::ElementId refAttid);
14537 <H3>Replacement : </H3>
14542 Moniker m (homeModel, PersistentElementPath (refAttid, elementIn));
14551 StatusInt Relationship::Moniker::FromNonLocalElement (DgnModelRefP homeModel, ElementRefP ref, DgnModelRefP refModel);
14555 <H3>Replacement : </H3>
14560 Moniker m (homeModel, PersistentElementPath (refModel, ref));
14568 StatusInt Relationship::Moniker::FromLocalElement (DgnModelRefP homeModel, DgnPlatform::ElementId elid);
14572 <H3> Replacement : </H3>
14577 Moniker m (homeModel, PersistentElementPath (homeModel, elid));
14585 StatusInt Relationship::Moniker::FromLocalElement (DgnModelRefP homeModel, ElementRefP ref);
14593 Moniker m (homeModel, PersistentElementPath (homeModel, ref));
14601 ElementRefP Relationship::Moniker::EvaluateElementRef ();
14610 Moniker::EvaluateElement().GetElementRef();
14618 ElementRefP Relationship::ParameterQuery::EvaluateElementRef();
14622 <H3>Replacement : </H3>
14626 ParameterQuery::GetMoniker ().EvaluateElement().GetElementRef();
14634 StatusInt DependencyManagerLinkage::AppendLinkageToMSElement (MSElementP el, DependencyLinkage const& dependencyData, size_t xtrabytes);
14638 <H3>Replacement : </H3>
14643 EditElementHandle eeh (el);
14644 DependencyManagerLinkage::AppendLinkage (eeh, dependencyData, xtrabytes);
14652 int DependencyManagerLinkage::DeleteLinkageFromMSElement (MSElementP element, UShort appID, UShort appValue);
14656 <H3>Replacement : </H3>
14660 EditElementHandle eeh (el);
14661 DependencyManagerLinkage::DeleteLinkage (eeh, appID, appValue);
14669 StatusInt DependencyManagerLinkage::GetLinkageFromMSElement (DependencyLinkageCP* ppDependencyLinkageInplace, MSElementCP element, UShort appID, UShort appValue);
14673 <H3>Replacement : </H3>
14677 ElementHandle eeh (el);
14678 DependencyManagerLinkage::DeleteLinkage (ppDependencyLinkageInplace, eh, appID, appValue);
14686 bool LxoSettings::IsSphericalCamera () const;
14690 <H3>Replacement : </H3>
14694 CAMERAPROJECTION_Spherical == LxoSettings::GetCameraProjection ()
14702 void LxoSettings::SetIsSphericalCamera (bool value);
14706 <H3>Replacement : </H3>
14711 LxoSettings::SetCameraProjection (CAMERAPROJECTION_Spherical);
14719 bool mdlAssoc_isTagged (DgnPlatform::ElementId * tagValue, MSElementCP elm);
14723 <H3>Replacement : </H3>
14727 ElementId tagId = mdlElement_getID (&elm);
14736 int mdlDependency_getDependents (DgnPlatform::ElementId *pDependents, DgnPlatform::ElementId rootElemId, DgnModelRefP rootModelRef, int maxDependents);
14740 <H3>Replacement : </H3>
14744 int mdlDependency_getDependentElementRefs (ElementRefP *pDependents, DgnPlatform::ElementId rootElemId, DgnModelRefP rootModelRef, int maxDependents);
14745 pDependents[0].GetElementId () // if an element id of a dependent element is required
14753 void DEllipse3d::Evaluate (DPoint3dR point, double theta) const;
14757 <H3>Replacement :</H3>
14761 void DEllipse3d::RadiansToPoint (DPoint3dR point, double theta) const;
14769 DPoint3d DPoint3d::FromXYZ (double x, double y, double z);
14773 <H3>Replacement :</H3>
14777 DPoint3d DPoint3d::From (double x, double y, double z);
14785 bool DoubleOps::SafeDivideDistance (double &result, double numerator, double denominator, double defaultResult = 0.0);
14789 <H3>Replacement :</H3>
14793 ValidatedDouble DoubleOps::ValidatedDivideDistance(double a, double b, double defaultResult = 0.0);
14801 PolyfaceHeaderR IPolyfaceConstruction::GetClientMeshR ();
14805 <H3>Replacement :</H3>
14809 PolyfaceHeaderPtr IPolyfaceConstruction::GetClientMeshPtr ();
14817 IPolyfaceConstructionPtr IPolyfaceConstruction::New (IFacetOptionsR options);
14821 <H3>Replacement :</H3>
14825 IPolyfaceConstructionPtr IPolyfaceConstruction::Create (IFacetOptionsR options);
14833 int MSBsplineCurve::NumberAllocatedKnots () const;
14837 <H3>Replacements :</H3>
14841 size_t MSBsplineCurve::GetNumKnots () const;
14842 int MSBsplineCurve::GetIntNumKnots () const;
14850 int MSBsplineCurve::NumberAllocatedPoles () const;
14854 <H3>Replacements :</H3>
14858 size_t MSBsplineCurve::GetNumPoles () const;
14859 int MSBsplineCurve::GetIntNumPoles () const;
14867 PolyfaceHeaderPtr PolyfaceHeader::New ();
14871 <H3>Replacement :</H3>
14875 PolyfaceHeaderPtr PolyfaceHeader::CreateVariableSizeIndexed ();
14883 PolyfaceCoordinateMapPtr PolyfaceCoordinateMap::New (PolyfaceHeaderR polyface);
14887 <H3>Replacement :</H3>
14891 PolyfaceCoordinateMapPtr PolyfaceCoordinateMap::Create (PolyfaceHeaderR polyface);
14899 void mdlRMatrix_rotatePoint (DPoint3dP pointP, RotMatrixCP matrixP);
14903 <H3>Replacement :</H3>
14907 matrixP->Mutliply (*pointP);
14915 void mdlRMatrix_unrotatePoint (DPoint3dP pointP, RotMatrixCP matrixP);
14919 <H3>Replacement :</H3>
14923 void mdlRMatrix_multiplyTransposePoint (DPoint3dP pointP, RotMatrixCP matrixP);
14927 matrixP->MutliplyTranspose (pointP);
14935 void mdlRMatrix_unrotatePointArray (DPoint3dP pointArrayP, RotMatrixCP matrixP, int numPoints);
14939 <H3>Replacement :</H3>
14943 matrixP->MultiplyTranspose (pointArrayP, pointArrayP, numPoints);
14951 void mdlTMatrix_rotateScalePoint (DPoint3dP pointP, TransformCP transformP);
14955 <H3>Replacement :</H3>
14959 transformP->MultiplyMatrixOnly (*pointP);
14967 StatusInt mdlResource_loadFromStringList (WChar *pwString, RscFileHandle rfHandle, UInt32 listId, UInt32 stringNum);
14971 <H3>Replacement :</H3>
14975 StatusInt mdlResource_loadWString (WStringR outString, RscFileHandle rfHandle, UInt32 listId, UInt32 stringNum, MdlDesc* m = NULL);
14976 StatusInt mdlResource_loadWString (WStringP, RscFileHandle rfHandle, UInt32 listId2, UInt32 stringNum, MdlDesc* m = NULL);
14984 StatusInt LoadFromStringList (WChar* pwString, RscFileHandle rfHandle, UInt32 listId2, UInt32 stringNum);
14988 <H3>Replacement :</H3>
14992 StatusInt mdlResource_loadWString (WStringR outString, RscFileHandle rfHandle, UInt32 listId, UInt32 stringNum, MdlDesc* m = NULL);
14993 StatusInt mdlResource_loadWString (WStringP, RscFileHandle rfHandle, UInt32 listId2, UInt32 stringNum, MdlDesc* m = NULL);
15001 StatusInt mdlFilterIterator_setBaseFilter (FilterIteratorP pFilterIteratorIn, FilterID iBaseFilterIdIn);
15005 <H3>Replacement :</H3>
15006 Note: the parameter iBaseFilterIdIn from above was always ignored.
15010 StatusInt mdlFilterIterator_reset (FilterIteratorP pFilterIteratorIn);
15018 int mdlView_setLevels (bool onOffFlagIn, short* v7LevelMask, bool* viewList, bool doUpdate);
15022 <H3>Replacement :</H3>
15026 int status = ERROR;
15027 BitMaskP pWorkingMask;
15029 mdlBitMask_create(&pWorkingMask, true);
15030 mdlBitMask_setFromBitArray (pWorkingMask, 64, reinterpret_cast<UShort *>(v7LevelMask));
15032 status = mdlView_changeLevelDisplayMaskMulti (MASTERFILE, viewList, pWorkingMask, onOffFlagIn ? LevelMaskOperation::On : LevelMaskOperation::Off, doUpdateIn);
15034 mdlBitMask_free(&pWorkingMask);
15042 void mdlTag_registerSet (DgnModelRefP modelRef, MSElementCP el, DgnPlatform::ElementId uniqueId);
15046 <H3>Replacement :</H3>
15048 There is no replacement the tag is registered automatically when it is added to the file.
15054 int mdlFile_createDeprecated (WCharP outname, WCharCP inname, WCharCP envvar, WCharCP iext);
15058 <H3>Replacement :</H3>
15062 BeFileName fileName;
15064 mdlFile_create (&fileName, inname, envvar, iext);
15073 int mdlFile_findDeprecated (WCharP outname, WCharCP inname, WCharCP envvar, WCharCP iext);
15077 <H3>Replacement :</H3>
15081 BeFileName fileName;
15083 mdlFile_find (&fileName, inname, envvar, iext, FINDFILEOPTION_Default);
15092 int mdlFile_findExtDeprecated (WCharP outname, WCharCP inname, WCharCP envvar, WCharCP iext, FINDFILE_Options options);
15096 <H3>Replacement :</H3>
15100 BeFileName fileName;
15102 mdlFile_find (&fileName, inname, envvar, iext, options);
15112 IPointCloudClassificationViewSettingsPtr IPointCloudClassificationViewSettings::GetPointCloudClassificationViewSettings(int viewIndex);
15116 <H3>Replacement :</H3>
15120 IPointCloudClassificationViewSettingsPtr ptr = IPointCloudClassificationViewSettings::GetPointCloudClassificationViewSettings(viewIndex, ACTIVEMODEL);
15128 bool IPointCloudClassificationViewSettings::GetClassificationState (UChar idx) const;
15132 <H3>Replacement :</H3>
15136 bool IPointCloudClassificationViewSettings::GetState (UChar idx) const;
15144 StatusInt mdlRaster_systemRasterContainerGet (DgnRasterVectorR collection);
15148 <H3>Replacement :</H3>
15152 ModelRefIterator modelItr(pRootModel, iteratorType, depth);
15153 for (DgnModelRefP modelRefP = modelItr.GetFirst (); modelRefP; modelRefP = modelItr.GetNext ())
15155 for each(DgnRasterP rasterP in DgnRasterCollection::GetRasters(modelRefP))
15157 if(NULL != rasterP)
15168 int mdlVec_linePlaneIntersect (DPoint3dP intersectPt, DPoint3dCP linePt, DPoint3dCP lineNormal, DPoint3dCP planePt, DPoint3dCP planeNormal, int perpendicular);
15172 <H3>Replacement :</H3>
15176 if (ERROR == mdlVec_linePlaneIntersect (intersectPt, linePt, lineNormal, planePt, planeNormal))
15177 // line is parallel to the plane.
15186 DgnWorkSpacePtr DgnWorkSpace::Read (DgnDocumentMonikerCR cfgMoniker);
15190 <H3>Replacement :</H3>
15194 DgnWorkSpacePtr DgnWorkSpace::Read(DgnDocumentMonikerCR cfgMoniker, DgnFolderMonikerCR configurationFolderRootPath);
15202 DgnWorkSetPtr DgnWorkSet::Create(DgnWorkSpaceR workspace, WCharCP name, WCharCP descr);
15206 <H3>Replacement :</H3>
15210 DgnWorkSetPtr DgnWorkSet::Create (DgnWorkSpaceR workspace, DgnDocumentMonikerCR cfgMoniker, DgnDocumentMonikerCR dgnwsMoniker, WStringCR name, WCharCP descr);
15218 DgnWorkSetPtr DgnWorkSet::Read (DgnWorkSpaceR workspace, DgnDocumentMonikerCR cfgMoniker);
15222 <H3>Replacement :</H3>
15226 DgnWorkSetPtr DgnWorkSet::Read (DgnWorkSpaceR workspace, DgnDocumentMonikerCR cfgMoniker, DgnDocumentMonikerCR DgnwsMoniker);
15234 StatusInt mdlLevel_getParentId (DgnPlatform::LevelId* pParentLevelIdOut, DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn);
15238 <H3>Replacement :</H3>
15240 None. Hierarchical levels are not supported anymore.
15246 StatusInt mdlLevel_getChildCount (int* pChildLevelCountOut, DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn);
15250 <H3>Replacement :</H3>
15252 None. Hierarchical levels are not supported anymore.
15258 bool mdlLevel_isParent (DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn);
15262 <H3>Replacement :</H3>
15264 None. Hierarchical levels are not supported anymore.
15270 bool mdlLevel_isChild (DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn);
15274 <H3>Replacement :</H3>
15276 None. Hierarchical levels are not supported anymore.
15282 StatusInt mdlLevel_setParentId (DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn, DgnPlatform::LevelId parentLevelIdIn);
15286 <H3>Replacement :</H3>
15288 None. Hierarchical levels are not supported anymore.
15294 WCharCP mdlLevel_getPathName (DgnModelRefP modelRefIn, DgnPlatform::LevelId levelIdIn);
15298 <H3>Replacement :</H3>
15300 None. Hierarchical levels are not supported anymore.
15306 void SheetDef::GetWindowsPrinterName (WString& windowsPrinterName) const;
15307 void SheetDef::SetWindowsPrinterName (WChar const * windowsPrinterName);
15308 void SheetDef::GetPltFileName (WString& pltFileName) const;
15309 void SheetDef::SetPltFileName (WChar const * pltFileName);
15313 <H3>Replacement :</H3>
15315 The windows printer name and the plot file names are no longer stored on SheetDef. Their use has been deprecated.
15317 *****************************************************************************************/
#define MTASKID
Definition: dlogbox.r.h:337
#define ICONCMDID_OpenFile
Definition: dlogids.r.h:4994
DialogManager is a convenience class that provides methods to obtain information about the Microstati...
Definition: DialogManager.h:38
#define VBIT_CTRL
Definition: keys.r.h:277
Definition: UISyncManager.h:19
! Singleton that manages the list of IXCommands
Definition: XCommandManager.h:24
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
uint32_t RscType
Definition: ecimagekey.h:15
Definition: MicroStation.r.h:164
static XCommandManagerR GetManager()
Gets the singleton instance of the XCommandManager.
This section contains a conversion factor for the working units of the model.
patternParams.cellId present
UInt64 CommandNumber
Definition: DgnPlatformBaseType.r.h:76
uint64_t UInt64
Definition: Bentley.r.h:131
#define XCMDLISTID_MstnPlatform
Definition: dlogids.r.h:1752
struct mdlDesc * MdlDescP
Definition: ConfigurationManager.h:13
IXCommandP FindXCommand(WCharCP commandId)
Finds an IXCommand in the list.
Command Resource for XCommands - Cross - platform / Cross UI Technology commands. ...
Definition: dlogbox.r.h:2756
#define NOACCEL
Definition: dlogbox.r.h:368
int32_t RscId
Definition: ecimagekey.h:16
#define DISCONNECT
DISCONNECT is a coordinate value that signifies a disconnected vertex in a string of points...
Definition: GeomApi.h:76
static void SendUISyncMessage(RscId syncGroupRscId, WStringR mdlTaskId, RscId syncItemId)
Send a message to UI items that need to refresh themselves when certain events occur.
char Utf8Char
Definition: Bentley.r.h:156