Exemplo n.º 1
0
        ///<summary>
        /// Create and configure the areas, as defined in the layout file.
        ///</summary>
        void Configure()
        {
            XmlNodeList areaList = layoutDoc.GetElementsByTagName("area");

            foreach (XmlNode areaNode in areaList)
            {
                XmlAttributeCollection attrColl = areaNode.Attributes;
                string type = attrColl["type"].Value;

                Area area = Area.Factory(type, areaGroup);
                if (area == null)
                {
                    continue;
                }

                areaGroup.Areas.Add(area);
                area.Configure(areaNode);
            }

            // give the focus to the first applicable area
            foreach (Area a in areaGroup.Areas)
            {
                if (a.Type != "offset" && a.Type != "separator")
                {
                    a.HasCursorFocus      = true;
                    areaGroup.FocusedArea = a;
                    break;
                }
            }

            // reset cursor
            areaGroup.SetCursor(0, 0);
        }
Exemplo n.º 2
0
        public void MoveCursor(long offset, int digit)
        {
            AreaGroup areaGroup = dvDisplay.Layout.AreaGroup;

            areaGroup.SetCursor(offset, digit);

            if (CursorChanged != null)
            {
                CursorChanged(this);
            }
        }
Exemplo n.º 3
0
        private void CleanupByteBuffer()
        {
            if (byteBuffer != null)
            {
                byteBuffer.Changed     -= OnByteBufferChanged;
                byteBuffer.FileChanged -= OnByteBufferFileChanged;
            }

            AreaGroup areaGroup = dvDisplay.Layout.AreaGroup;

            areaGroup.Buffer = null;
            areaGroup.SetCursor(0, 0);
            areaGroup.Selection.Clear();

            byteBuffer = null;
        }
Exemplo n.º 4
0
        private void SetupByteBuffer(ByteBuffer bb)
        {
            byteBuffer              = bb;
            byteBuffer.Changed     += OnByteBufferChanged;
            byteBuffer.FileChanged += OnByteBufferFileChanged;


            AreaGroup areaGroup = dvDisplay.Layout.AreaGroup;

            areaGroup.Buffer = byteBuffer;
            areaGroup.SetCursor(0, 0);
            areaGroup.Selection = new Util.Range();

            dvDisplay.Redraw();
            dvDisplay.VScroll.Adjustment.Value = 0;

            OnPreferencesChanged(Preferences.Instance);
            if (BufferChanged != null)
            {
                BufferChanged(this);
            }
        }