public bool OnDisplayBrowseMoveNextSameLine(object commandObject, ref UIItemDisplayProperties display) { return(OnDisplayBrowseMoveNext(commandObject, ref display)); }
public bool OnDisplayApproveAndMoveNext(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = CanNavigateBundles; display.Visible = display.Enabled; return(true); //we've handled this }
public bool OnDisplayExport(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = true; return(true); }
/// <summary> /// Enable the 'File Print...' menu option for the LexEdit dictionary preview /// </summary> public bool OnDisplayPrint(object parameter, UIItemDisplayProperties display) { display.Enabled = display.Visible = true; return(true); }
public virtual bool OnDisplayWordformChangeCase(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = InFriendlyArea; return(true); //we've handled this }
public virtual bool OnDisplayShowHumanApprovedAnalysisConc(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = InFriendlyArea; return(true); //we've handled this }
/// <summary> /// decide whether to enable this tree delete Menu Item /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public virtual bool OnDisplayDataTreeDeleteSense(object commandObject, ref UIItemDisplayProperties display) { return(OnDisplayDataTreeDelete(commandObject, ref display)); //we handled this, no need to ask anyone else. }
/// <summary> /// whether or not to display the Make phrase icon and menu item. /// </summary> /// <remarks>OnJoinWords is in the base class because used by icon</remarks> public bool OnDisplayJoinWords(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = CanNavigateBundles && ShowLinkWordsIcon; display.Visible = display.Enabled; return(true); //we've handled this }
public bool OnDisplayLaunchConnectedDialog(object parameters, ref UIItemDisplayProperties display) { display.Enabled = false; display.Visible = false; XCore.Command command = parameters as XCore.Command; if (command == null) { return(true); } Form formActive = ActiveForm; FwXWindow wndActive = formActive as FwXWindow; if (wndActive == null) { return(true); } Mediator mediator = wndActive.Mediator; if (mediator == null) { return(true); } string area = (string)mediator.PropertyTable.GetValue("areaChoice"); bool fEnabled = true; switch (command.Id) { case "CmdImportSFMLexicon": fEnabled = area == "lexicon"; break; case "CmdImportLinguaLinksData": fEnabled = area == "lexicon"; break; case "CmdImportLiftData": fEnabled = area == "lexicon"; break; case "CmdImportInterlinearSfm": case "CmdImportWordsAndGlossesSfm": case "CmdImportInterlinearData": if (mediator.PropertyTable.GetStringProperty("currentContentControl", null) == "concordance" || mediator.PropertyTable.GetStringProperty("currentContentControl", null) == "concordance") { fEnabled = false; } else { fEnabled = area == "textsWords"; } break; case "CmdImportSFMNotebook": fEnabled = area == "notebook"; break; default: break; } display.Enabled = fEnabled; display.Visible = fEnabled; return(true); }
/// <summary> /// handle the message to see if the menu item should be enabled /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public virtual bool OnDisplayShow_DictionaryPubPreview(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = InFriendlyAreaShow_DictionaryPubPreview; return(true); //we've handled this }
public bool OnDisplaySFMImport(object parameters, ref UIItemDisplayProperties display) { return(true); }
/// <summary> /// Determine whether or not to show the Send/Receive Project menu item. /// </summary> /// <param name="parameters"></param> /// <param name="display"></param> /// <returns></returns> public bool OnDisplayFLExLiftBridge(object parameters, ref UIItemDisplayProperties display) { CheckForFlexBridgeInstalled(display); return(true); // We dealt with it. }
/// <summary> /// Called (by xcore) to control display params of the Help->About FLEx Bridge menu. /// </summary> public bool OnDisplayAboutFlexBridge(object commandObject, ref UIItemDisplayProperties display) { CheckForFlexBridgeInstalled(display); return(true); // We dealt with it. }
/// <summary> /// Enable the "Disregard Analysis And" submenu, if we can. /// </summary> public virtual bool OnDisplayBrowseMovementMenu(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = CanNavigateBundles; display.Visible = display.Enabled; return(true); }
/// <summary> /// decide whether to display this tree insert Menu Item /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public override bool OnDisplayDataTreeInsert(object commandObject, ref UIItemDisplayProperties display) { Slice slice = m_dataEntryForm.CurrentSlice; if (slice == null && m_dataEntryForm.Slices.Count > 0) { slice = m_dataEntryForm.FieldAt(0); } if (slice == null || slice.IsDisposed || (m_dataEntryForm.Mediator.PropertyTable.GetValue("ActiveClerk") as RecordClerk).ListSize == 0) { // don't display the datatree menu/toolbar items when we don't have a data tree slice. // (If the slice is disposed, we're in a weird state, possibly trying to update the toolbar during OnIdle though we haven't // in fact finished reconstructing the tree. Leave things disabled, and hope they will get enabled // on the next call when things have stabilized.) display.Visible = false; display.Enabled = false; return(true); } base.OnDisplayDataTreeInsert(commandObject, ref display); if (!(slice.Object is ILexEntry) && !(slice.ContainingDataTree.Root is ILexEntry)) { return(false); } FDO.ILexEntry entry = slice.Object as ILexEntry; if (entry == null) { entry = slice.ContainingDataTree.Root as ILexEntry; } if (entry == null || !entry.IsValidObject) { // At one point this could happen during delete object. Not sure it will be possible when I // finish debugging that, but the defensive programming doesn't hurt. display.Enabled = false; display.Visible = false; return(true); } XCore.Command command = (XCore.Command)commandObject; if (command.Id.EndsWith("AffixProcess")) { var mmt = entry.PrimaryMorphType; bool enable = mmt != null && mmt.IsAffixType; display.Enabled = enable; display.Visible = enable; return(true); } //if there aren't any alternate forms, go ahead and let the user choose either kind if (entry.AlternateFormsOS.Count == 0) { return(true); } if (command.Id.EndsWith("AffixAllomorph")) { if (!(entry.AlternateFormsOS[0] is IMoAffixAllomorph)) { display.Visible = false; } return(true); } if (command.Id.EndsWith("StemAllomorph")) { if (!(entry.AlternateFormsOS[0] is IMoStemAllomorph)) { display.Visible = false; } return(true); } return(true); //we handled this, no need to ask anyone else. }
/// <summary> /// The NextIncompleteBundle (without confirming current--Nc) command is not visible by default. /// Therefore this method, which is called by the mediator using reflection, must be implemented /// if the command is ever to be enabled and visible. It must have this exact name and signature, /// which are determined by the 'message' in its command element. This command is enabled and visible /// exactly when the version that DOES confirm the current choice is, so delegate to that. /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public virtual bool OnDisplayNextIncompleteBundleNc(object commandObject, ref UIItemDisplayProperties display) { return(OnDisplayNextIncompleteBundle(commandObject, ref display)); }
public virtual bool OnDisplaySwapAllomorphWithLexeme(object commandObject, ref UIItemDisplayProperties display) { display.Visible = true; display.Enabled = true; return(true); }
/// <summary> /// handle the message to see if the menu item should be enabled /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public virtual bool OnDisplayFirstBundle(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = CanNavigateBundles; display.Visible = display.Enabled; return(true); //we've handled this }
public virtual bool OnDisplayAlphabeticalOrder(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = GetView().RootPropertySupportsVirtualOrdering(); return(true); }
public bool OnDisplayViewIncorrectWords(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = InFriendlyArea; return(true); //we've handled this }
protected override bool ShouldDisplayMenuForClass(int specifiedClsid, UIItemDisplayProperties display) { return(LexEntryTags.kClassId == specifiedClsid || base.ShouldDisplayMenuForClass(specifiedClsid, display)); }
public virtual bool OnDisplaySpellingStatusUnknown(object commandObject, ref UIItemDisplayProperties display) { display.Enabled = display.Visible = InFriendlyArea; return(true); //we've handled this }
/// <summary> /// Invoked by reflection when displaying the appropriate menu item. Which one is indicated by the paramters node. /// This method is responsible to decide whether to display the command, whether to enable it, and what the text of the menu /// item should be. /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns>true (always) to indicate that we handled this command</returns> public bool OnDisplayMacro(object commandObject, ref UIItemDisplayProperties display) { return(DoDisplayMacro(commandObject, display, GetSelection())); }