How to jump all dialog BOX by code? - dialog

Is there a way to jump all Dialog Box in standard code?
For example if in TaxVatTable.validateWrite call a class TaxVATNumValidateES\validateVATNum and here exist a BOX and I don't want to show, is there a solution?
Exist a way to disable dialog box function in all cases?

Yes you can, just modify the relevant methods in \Classes\Box.
The issue is those Box messages are a decision point being made by the user. So how do you know what they'll always choose? You can return the _defaultButton and probably be O-K in most cases.
They call different types of forms, but the one you're referring to is \System Documentation\Classes\DialogBox which is kernel code so the lowest point you can override it is at the Box class.
You can see how they short-circuit by doing this:
if (clientKind() == ClientType::COMObject)
return _defaultButton;
EDIT:
I want to add that I do NOT recommend doing this. Just change the code in the locations where it's called. You'd be functionally breaking part of the framework. Other developers may NEED to call this functionality at some point.
It's used on forms and all over the place. If you just make it always return Yes, you could cause ALL sorts of problems.

Related

ReSharper calls inspection does not find a method

With R# 2017.3 I'm trying to find out whether method A through a call chain eventually might call method B.
So, I'm using Inspect->Incoming calls and try to use the filter field providing the method B name. Even though I know for sure that the method B is in the call tree, the Inspection UI does not find it.
However, if I click many times on "Expand All" and the method B appears in the UI, finally the search to find it.
Is this a bug or there is some setting that controls this behavior (e.g. nesting level)?
I've got the answer from JetBrains:
This behavior is by design because the calculation of the enŠµire call hierarchy at once could take a very long time.

Creating a string picker dialog from a collection in vba via built in dialog?

(Questions with an answer of NO are still useful; they're just not the solution to the problem. Answers say, no, there is no built-in, you have to implement the dialog for yourself...)
In VBA, (ms-word, or ms-excel, but seems like a generic operation) is there any way to simply a provide a collection to a built in dialog in order to prompt the user to select a value from a list of values?
I can't believe there's not a built in method to do this, it seems like a such a generic operation that could be coded once and everybody would re-use it. I can certainly hand code it, but why bother if it's already in the vba libraries someplace.
I've searched for a solution, but it does appear that the standard answer is to hand code it.
My aproach would be to create a Form, add a ListBox, Ok, Cancel and the ShowModal property.
To use it first set the ListBox RowSource according to what you need:
https://msdn.microsoft.com/en-us/library/office/ff196460.aspx
Then make it visible, manage Ok/Cancel and then use the ItemsSelect property (multiselect is possible):
https://msdn.microsoft.com/en-us/library/office/ff823015.aspx
Yup, no such thing.
Hand-code it, and keep it as part of your VBA "toolbox" - make yourself an add-in that other VBA projects can reference, so you can reuse the code without having to rewrite it every time.
Then export the code modules from your host document, upload them to a GitHub repository, and share your solution with the world so the next person looking for it doesn't need to implement it from scratch again.
The VBA standard library is rather limited, and beyond MsgBox there isn't much available in terms of built-in UI. That's just how it is.

Dynamic Navigation Rules

On a Custom Control I have defined a Navigation Rule xsp-success go to xpDemo.xsp. This works fine, but the Navigation rule is probably one of the only places that there is not the little blue diamond to allow for a computed result. What I want to do is something like this
(viewScope.get("vsSomething") == "Something) ? "/xpSomeWhere.xsp" : "/xpSomeWhereElse.xsp"
I could define a different xsp-??? for each possible success but that would be a blow-up waiting to happen.
In addition I want to re-use the CC in several different situations and the major difference is that where I want to navigate to. I could do a context.reDirectTo() but that then means that I have to repeat the code many times in several different places that might not be totally obvious thus creating a maintenance headache. The obvious place would seem to be the Navigation Rules. I can't believe that I'm the first person wanting to do this but my search has turned up nothing.
They can indeed be computed, just not using the "Navigation" section of the properties pane. If you go instead to the XSP source or to the "navigationRules" element of the "All Properties" section, you can modify the "viewId" property to include a computed value as normal.

Saving to multiple lists from 1 sharepoint 2007 list form

I have a request form I'm working on, wherein different departemnts need to be able to update it. To minimize overlap and lost changes I'd like to be able to submit data from the new form to different lists, but I cannot find a way to do this.
Does anyone have any experience trying to do anything similar?
If you're familiar with JQuery andSPServices I could envisage a way to do this.
In the EditForm.aspx, add the JQuery and SPServices libraries. using the $.(document).Ready function, I'd do a quick item update with the SPServices and just copy a column with the same data, so in effect no change looks to have taken place. I'd add in the edit comments something like "Pseduo checkout to [name], [date_time]".
Then allow the user to edit the form as normal but in the code you've added, you trap the PreSave Action and check that the person trying to do the save is the same as the last modified - if it is, save as normal, otherwise, return false on the PreSave and it will be denied. When you actually allow the save, set the edit comments to something sensible.
To complete this, check before doing the pseudo checkout, that the last comments don't contain the psuedo checkout phrase so that you can prevent anyone opening/editing the form whilst somebody else is in the middle of an edit.
This gives a cheap and relatievly easy to implement Check-In/Check-Out for a list. Not perfect of course but should work well in most scenarios (not in datasheet though, so you might need to prevent that type of edit).
If you have two lists would you not then have the problem of potentially two requests for the same thing?
Does none of the version control options for the list solve the problem of potentially multiple concurrent editors?
While SPService is certainly a solution, but you will have to build a UI of ur own.
Try writing a event receiver, which can copy over item to another list as soon as it is created.
It will be nice if you can tell why you really want to have a copy of item in another list
i.e. Auditing purpose etc. , you can get a perfect solution for this in Forum

VS2010 modify intellisense popup order via an addin?

Is it possible to modify the order of the intellisense options shown when I hit ctrl-space?
Specifically, I'd like to order them in scope, so that if I have a variable in my function that matches what I've typed so far then it goes to the top of the list. If there's a member in the class, that's next, etc. I'm just kind of sick of having to type enough that I don't match some random global symbol in Windows' crypto libraries or whatever.
Is this kind of this possible? Where do I start? I looked for an obvious option in vs2010, but didn't find anything.
My programming language is native c++.
Here's what I've found so far.
A walkthrough showing how to add items to the intellisense popup: http://msdn.microsoft.com/en-us/library/ee372314.aspx
The walkthrough uses the ICompletionSession interface:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.language.intellisense.icompletionsession.aspx
It looks as if you might be able to clear the CompletionSets, and replace them with your own completion sets, but I'm not sure if there's any way to change the order, or if they are always sorted. There is the IIntellisensePresenter interface, but it looks like it's pretty much empty.
Also, from the walkthrough, it looks like you can fill the CompletionSets with a dumb list of strings, so you'd need some other way of interrogating the symbols to determine scope, which may not always be possible.
In short: Probably not possible at the moment.

Resources