첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

728x90
반응형

■ WidgetView 클래스 : 위젯 뷰 사용하기

------------------------------------------------------------------------------------------------------------------------


TestProject.zip



MainForm.cs

 

 

using System;

 

using DevExpress.Utils;

using DevExpress.XtraBars.Docking2010;

using DevExpress.XtraBars.Docking2010.Views.Widget;

using DevExpress.XtraEditors;

 

namespace TestProject

{

    /// <summary>

    /// 메인 폼

    /// </summary>

    public partial class MainForm : XtraForm

    {

        //////////////////////////////////////////////////////////////////////////////////////////////////// Field

        ////////////////////////////////////////////////////////////////////////////////////////// Private

 

        #region Field

 

        /// <summary>

        /// 위젯 뷰

        /// </summary>

        private WidgetView widgetView;

 

        /// <summary>

        /// 스택 그룹 1

        /// </summary>

        private StackGroup stackGroup1;

        

        /// <summary>

        /// 스택 그룹 2

        /// </summary>

        private StackGroup stackGroup2;

 

        #endregion

 

        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor

        ////////////////////////////////////////////////////////////////////////////////////////// Public

 

        #region 생성자 - MainForm()

 

        /// <summary>

        /// 생성자

        /// </summary>

        public MainForm()

        {

            InitializeComponent();

 

            Load += Form_Load;

        }

 

        #endregion

 

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method

        ////////////////////////////////////////////////////////////////////////////////////////// Private

 

        #region 폼 로드시 처리하기 - Form_Load(sender, e)

 

        /// <summary>

        /// 폼 로드시 처리하기

        /// </summary>

        /// <param name="sender">이벤트 발생자</param>

        /// <param name="e">이벤트 인자</param>

        private void Form_Load(object sender, EventArgs e)

        {

            DocumentManager documentManager = new DocumentManager();

 

            this.widgetView = new WidgetView();

 

            documentManager.View             = this.widgetView;

            documentManager.ContainerControl = this;

 

            this.widgetView.AllowDocumentStateChangeAnimation = DefaultBoolean.True;

 

            this.stackGroup1 = new StackGroup();

            this.stackGroup2 = new StackGroup();

 

            this.stackGroup1.Length.UnitType  = LengthUnitType.Star;

            this.stackGroup1.Length.UnitValue = 2;

 

            this.stackGroup2.Length.UnitType  = LengthUnitType.Star;

            this.stackGroup2.Length.UnitValue = 1;

 

            this.widgetView.StackGroups.AddRange

            (

                new StackGroup[]

                {

                    this.stackGroup1,

                    this.stackGroup2

                }

            );

 

            for(int i = 1; i < 4; i++)

            {

                Document document = widgetView.AddDocument

                (

                    "문서 " + i.ToString(),

                    "SummaryControl"

                ) as Document;

 

                this.widgetView.AddDocument(new SummaryControl());

 

                document.MaximizedControl = new DocumentControl();

            }

 

            this.stackGroup1.Items.AddRange

            (

                new Document[]

                {

                    this.widgetView.Documents[0] as Document,

                    this.widgetView.Documents[1] as Document

                }

            );

 

            this.widgetView.Controller.Dock(this.widgetView.Documents[2] as Document, this.stackGroup2);

        }

 

        #endregion

    }

}

 

------------------------------------------------------------------------------------------------------------------------

728x90
반응형
Posted by 사용자 icodebroker

댓글을 달아 주세요