起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 203|回复: 8

[请求]如何获让TMainForm 获得主界面TAB页切换 的消息**

[复制链接]
发表于 2008-1-24 22:34:08 | 显示全部楼层 |阅读模式
按精华贴中的处理方法,只能处理点击主界面功能树中的'结点'才触发 DoFuncActivate

如果只是通过点击 TAB 页,切换已装载的功能页面则不会触发此事件

我想问问此需求在平台中如何处理?
回复

使用道具 举报

发表于 2008-1-25 08:20:46 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-25 12:12:46 | 显示全部楼层
在 tab 页上切换,此事件不会相应!

有无更好的方法?

1.jpg

75.29 KB, 下载次数: 149

回复 支持 反对

使用道具 举报

发表于 2008-1-25 13:20:26 | 显示全部楼层
肯定会相应的,连接页中需要在标准风格主窗体上修改,你修改了吗?
就是连接帖的红色字部分,注意如果修改以后,一定要编译、保存、签入、刷新缓存才可以
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-25 16:35:28 | 显示全部楼层
我这边 打开一个新功能的时候 确实可以响应

但是如果在上图中 的 TAB 页切换就不响应了

点击功能树中的'功能'是可以响应的

目前我需要对一个 MainForm 处理 2 个事件, OnEnterForm,OnExitForm

平台是否考虑将这2个事件 做入标准版?

目前我自己的修改方法 :修改 ShowContiner() 过程

procedure TSTANDARDSTYLEMAINFORM.ShowContainer(AContainer: TFuncContainer);
var
  OldCurrent: TFuncContainer;
begin
  if FCurrentFuncContainer = AContainer then
    Exit;


  //steven add
  //ExitFunc
  if FCurrentFuncContainer <> nil then
    if FCurrentFuncContainer.FFunc <> nil then
      try
        ObjectHelper.CallMethod(FCurrentFuncContainer.FFunc.MainForm, 'OnExitForm', []);
      except
      end;
  //end add


  {//shl07 IE方式,Business的热键都失效了(200608017979)。}
  if AContainer.FFunc <> nil then
    UpdateActionLists(AContainer.FFunc.MainForm.ActionLists);
  {//2006-8-30}
  OldCurrent := FCurrentFuncContainer;

  if OldCurrent <> nil then
    OldCurrent.MyDisableAlign;

  try

    if AContainer = nil then
      FCurrentFuncContainer := nil
    else
    begin
      if AContainer.Func = nil then
      begin
        if FClosing then
          Exit;

        UIRunFunc(TSystemCore.Operator.Context, '', AContainer.FuncURL, '', True, nil, False);
        Exit;
      end;

      // 这样做是为在后面加载好了再切换
      AContainer.SendToBack;
      AContainer.Show;
      AContainer.SetFocus;
      //AContainer.Realign; // 这行是否有必要?现在在System登录的功能中有问题。
      MergeMainMenu(AContainer.Func.MainForm);

      FCurrentFuncContainer := AContainer;

      // 这行必须在 FCurrentFuncContainer 赋值之后
      ReloadRelevancyNavBar;
      ReloadDocRelevancyNavBar;   //add by wdx 20060724
      ReloadEditLogNavBar;
      FCurrentFuncContainer.MyEnableAlign;
      CheckTabButton(FCurrentFuncContainer, True);
    end;

    if OldCurrent <> nil then
    begin
      FFuncContainerActiveStack.Remove(OldCurrent);
      FFuncContainerActiveStack.Add(OldCurrent);
      OldCurrent.Hide;
      CheckTabButton(OldCurrent, False);
    end;


    //steven add
    //EnterFunc
    if AContainer <> nil then
      if AContainer.FFunc <> nil then
        try
          ObjectHelper.CallMethod(AContainer.FFunc.MainForm, 'OnEnterForm', []);
        except
        end;
    //end add


  except
    if OldCurrent <> nil then
    begin
      CheckTabButton(OldCurrent, True);
      OldCurrent.MyEnableAlign;
    end;
    raise;
  end;
end;


不知道是否妥当?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-1-29 12:00:03 | 显示全部楼层
没有人回答呀~顶一下
回复 支持 反对

使用道具 举报

发表于 2008-1-29 13:44:47 | 显示全部楼层
应该可以
不过,因为try  except的原因,OnEnterForm执行中的错误信息会被吃掉,不显示任何错误了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-14 11:30:36 | 显示全部楼层
那请问 justep 有啥好的处理方法?

还是在下一个版本中作为一个标准的方法提供给客户使用?

谢谢
回复 支持 反对

使用道具 举报

发表于 2008-3-14 14:41:16 | 显示全部楼层
目前没有更好的方法,已经作为需求提交。后续逐步完善
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-8 23:06 , Processed in 0.042233 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表