to torble(elbrot):
其实我对Dephi的语法掌握得并不深入,直接看控件源码很困难我只是要使用的源码就可以了,如你有的话,帮忙贴一下。

解决方案 »

  1.   

    to torble(elbrot):
    [email protected]万分感谢!
      

  2.   

    各位看官,TOutlookBar是个什么样的控件呀自带的么,我怎么没见过,请教请教?
    /**************************************/
    /*              学无止境              */ 
    /**************************************/
      

  3.   

    to torble(elbrot):
    E-mail收到,谢谢不过我需要的是通过代码添加ITME的示例(比如如何添加PAGE以及如何在PAGE中添加按钮等功能),你的例子中的ITEM都是通过IDE界面生成的,似乎简单了一些。能否给我一份更详细的资料?
      

  4.   

    从控件源码中可以了解:procedure TOutlookBarEditor.ExecuteVerb(Index: Integer);
    var
      ovDesigner: IFormDesigner;
      ovZoneControl: TOutlookBar;
      ovNewZone, ovMoveZone: TOutlookSection;
      i: integer;
    begin
      ovDesigner := Self.Designer;
      case Index of
        0:  // add section
          begin
            if (Component is TOutlookBar) then
              ovZoneControl := (Component as TOutlookBar)
            else
              ovZoneControl := (TOutlookSection(Component).Parent as TOutlookBar);
            ovNewZone := TOutlookSection.Create(ovDesigner.Form);
            ovNewZone.Name := ovDesigner.UniqueName(TOutlookSection.ClassName);
            ovNewZone.Caption := ovNewZone.Name;
            ovNewZone.Parent := ovZoneControl;
            ovZoneControl.ActiveSection := ovNewZone;
            ovDesigner.SelectComponent(ovNewZone);
            ovNewZone.ParentAsZC.Invalidate;
          end;
        1:  // move section to down
          begin
            if (Component is TOutlookSection) then
            begin
              ovZoneControl := (TOutlookSection(Component).Parent as TOutlookBar);
              ovNewZone := TOutlookSection(Component);
              if ovNewZone.TabIndex < (ovZoneControl.ZACount - 1) then begin
                ovMoveZone := ovZoneControl.FindNextTab(ovNewZone);
                i := ovNewZone.TabIndex;
                ovNewZone.TabIndex := ovMoveZone.tabindex;
                ovMoveZone.TabIndex := i;
                ovZoneControl.Invalidate;
              end;
            end;
          end;
        2:  // move section to down
          begin
             if (Component is TOutlookSection) then
             begin
                ovZoneControl := (TOutlookSection(Component).Parent as TOutlookBar);
                ovNewZone := TOutlookSection(Component);
                if ovNewZone.TabIndex > 0 then begin
                  ovMoveZone := ovZoneControl.FindPrevTab(ovNewZone);
                  i := ovNewZone.TabIndex;
                  ovNewZone.TabIndex := ovMoveZone.tabindex;
                  ovMoveZone.TabIndex := i;
                  ovZoneControl.Invalidate;
                end;
             end;
           end;
      end;
      Designer.Modified;
    end;procedure TOutlookSectionEditor.ExecuteVerb(Index: Integer);
    var
      ovDesigner: IFormDesigner;
      ovSection: TOutlookSection;
      ovNewItem: TOutlookItem;
      ovLastItem: TOutlookItem;
    begin
      ovDesigner := Self.Designer;
      case Index of
        0:  // add new item
          begin
            if (Component is TOutlookSection) then
              ovSection := (Component as TOutlookSection)
            else
              ovSection := (TOutlookItem(Component).Parent as TOutlookSection);
            ovNewItem := TOutlookItem.Create(ovDesigner.Form);
            ovNewItem.Name := ovDesigner.UniqueName(TOutlookItem.ClassName);
            ovNewItem.Caption := ovNewItem.Name;
            ovNewItem.Parent := ovSection;
            ovLastItem := TOutlookItem(ovSection.Controls[ovSection.ControlCount - 1]);
            ovNewItem.Top := ovLastItem.Top + ovLastItem.Height + 2;
            ovNewItem.Height := TOutlookBar(ovSection.Parent).ButtonHeight;
            ovNewItem.Parent.Invalidate;
          end;
      end;
      Designer.Modified;
    end;
      

  5.   

    你只要看标注了 // add section和// add new item这些地方就可以了
      

  6.   

    to torble(elbrot):
    我发现我和你用的TOutLookBar控件不一样,你用的是不是1st的? 
      

  7.   

    这个控件的开头是这样的:TOutlookBar
      Copyright (c). 2000. Emerson de Almeida Carneiro.
      Barra de menus verticais estilo MS-OutLook.
      

  8.   

    那个版本无所谓啊,关键你不是要知道怎样动态建立 Section 和 Item 吗?
      

  9.   

    to torble(elbrot):
    我可以将我用的发给你看吗? 
      

  10.   

    to torble(elbrot):
    请查收...
      

  11.   

    to shockjoy(无聊死了):
    [email protected]
    谢谢to zhiwen_huang(黄志文):   
    TOutlookBar就是类似于OICQ的用户列表(如好友名单、黑名单)一样的界面。
      

  12.   

    确实不一样啊,我觉得我的比较新,我把我的发给你好了,这个控件可以在设计期直接建立
    Section 和 Item ,如果想动态的建立 就看上面的例子。 BYE~
      

  13.   

    TO qianying(千影):
    我是想问哪有这样的控件呀,我现在正想要用呢
    /**************************************/
    /*              学无止境              */ 
    /**************************************/ 
      

  14.   

    to zhiwen_huang(黄志文):
    我用的: 
    http://www.justep.com/downloads/freeware/outlookbar.zip或者是torble(elbrot)发给我的,你要的话留下EMAILto hanlen():
    我用的版本中没有Demo。