如何通过代码跳转所有对话框?

时间:2022-03-07 20:24:53

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?

例如,如果在TaxVatTable.validateWrite中调用一个类TaxVATNumValidateES \ validateVATNum并且这里存在一个BOX并且我不想显示,是否有解决方案?

Exist a way to disable dialog box function in all cases?

在所有情况下都存在禁用对话框功能的方法吗?

1 个解决方案

#1


2  

Yes you can, just modify the relevant methods in \Classes\Box.

是的,你可以,只需修改\ 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.

问题是Box消息是用户做出的决策点。那么你怎么知道他们总会选择什么呢?在大多数情况下,您可以返回_defaultButton并且可能是O-K.

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.

它们调用不同类型的表单,但您所指的是\ System Documentation \ Classes \ DialogBox,它是内核代码,因此您可以覆盖它的最低点是Box类。

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.

它用于表格和各地。如果你只是让它总是返回是,你可能会导致各种各样的问题。

#1


2  

Yes you can, just modify the relevant methods in \Classes\Box.

是的,你可以,只需修改\ 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.

问题是Box消息是用户做出的决策点。那么你怎么知道他们总会选择什么呢?在大多数情况下,您可以返回_defaultButton并且可能是O-K.

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.

它们调用不同类型的表单,但您所指的是\ System Documentation \ Classes \ DialogBox,它是内核代码,因此您可以覆盖它的最低点是Box类。

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.

它用于表格和各地。如果你只是让它总是返回是,你可能会导致各种各样的问题。