简体   繁体   English

TBindNavigator的Delphi对象Pascal对应的运行时调用

[英]Delphi Object Pascal corresponding run-time calls of TBindNavigator

My question is about Delphi Object Pascal corresponding run-time calls of TBindNavigator component buttons. 我的问题是有关TBindNavigator组件按钮的Delphi对象Pascal相应的运行时调用。 I'm interesting of the following buttons: 我对以下按钮很感兴趣:

  • "Post"; “邮报”;
  • "Cancel"; “取消”;
  • "Refresh". “刷新”。

How can I implement it in the code without TBindNavigator? 没有TBindNavigator的情况下如何在代码中实现它? Would you please clarify this issue? 您能否澄清这个问题? Thanks. 谢谢。

If you wish to implement the necessary actions with simultaneous check if they are enabled etc. then you do not need TBindNavigator at all. 如果您希望同时执行必要的操作并检查它们是否已启用等,则完全不需要TBindNavigator The easiest way is the following: 最简单的方法如下:

The sample for an FMX Form: FMX表单的示例:

  1. Add a TActionList to your form. TActionList添加到您的窗体。
  2. Add a New Standard Action form LiveBindings node of necessary TFMXBindNavigatePost , TFMXBindNavigateCancel etc. class. 添加必要的TFMXBindNavigatePostTFMXBindNavigateCancel等类的New Standard Action表单LiveBindings节点。
  3. Select this action and set Datasource property. 选择此操作并设置Datasource属性。
  4. Assign the action to the necessary TButton or other control. 将操作分配给必要的TButton或其他控件。

Steps 2-4 can be done in the other way as well. 步骤2-4也可以用其他方式完成。

  1. Selet the control (ie TButton ), select property Action and click the arrow on the right. 选择控件(即TButton ),选择属性Action ,然后单击右侧的箭头。
  2. Select New standard action then LiveBindings . 选择“ New standard action然后选择New standard action LiveBindings Select the necessary class TFMXBindNavigate* . 选择必要的类TFMXBindNavigate* The action will be assigned to the TButton . 该动作将分配给TButton
  3. Select TActionList and choose the added action and set DataSource property. 选择TActionList并选择添加的操作并设置DataSource属性。

The action will be kept up-to-date by LiveBindings . 该操作将通过LiveBindings保持最新。 The necessary controls will become Enabled - Disabled and will act as buttons of TBindNavigator . 必要的控件将变为Enabled - Disabled ,并将用作TBindNavigator按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM