예제 #1
0
 void OpenTable(Database.TableReference tableRef, Database.Table table, Database.CellPosition pos, bool focus)
 {
     m_Spreadsheet              = new UI.DatabaseSpreadsheet(m_UIState.FormattingOptions, table, this);
     m_Spreadsheet.onClickLink += OnSpreadsheetClick;
     m_Spreadsheet.Goto(pos);
     m_EventListener.OnRepaint();
 }
예제 #2
0
        public virtual LinkRequest GetCellLink(Database.CellPosition pos)
        {
            var column = GetColumnByIndex(pos.col);

            if (column != null)
            {
                return(column.GetRowLink(pos.row));
            }
            return(null);
        }
 protected override void OnGUI_CellMouseUp(Database.CellPosition pos)
 {
     if (onClickLink != null)
     {
         var link = m_TableDisplay.GetCellLink(pos);
         if (link != null)
         {
             onClickLink(this, link, pos);
         }
     }
 }
예제 #4
0
        public void Goto(Database.CellPosition pos)
        {
            long rowIndex = 0;
            long nextRow  = 0;
            var  y        = GetCumulativeHeight(0, pos.row, out nextRow, ref rowIndex);

            m_GUIState.ScrollPosition              = new Vector2(0, y);
            m_GUIState.SelectedRow                 = pos.row;
            m_GUIState.FirstVisibleRow             = pos.row < 0 ? 0 : pos.row;
            m_GUIState.FirstVisibleRowIndex        = rowIndex;
            m_GUIState.FirstVisibleRowY            = y;
            m_GUIState.HeightBeforeFirstVisibleRow = y;
        }
예제 #5
0
        void OnSpreadsheetClick(UI.DatabaseSpreadsheet sheet, Database.LinkRequest link, Database.CellPosition pos)
        {
            //add current event in history

            m_UIState.AddHistoryEvent(GetCurrentHistoryEvent());
            var tableLinkRequest = link as Database.LinkRequestTable;

            if (tableLinkRequest != null)
            {
                if (tableLinkRequest.LinkToOpen.TableName == ObjectTable.TableName)
                {
                    //open object link in the same pane
                    OpenLinkRequest(tableLinkRequest, true);
                    return;
                }
            }
            else
            {
                Debug.LogWarning("Cannot open unknown link '" + link.ToString() + "'");
            }

            //open the link in the spreadsheet pane
            m_EventListener.OnOpenLink(link, m_ActiveMode);
        }
 protected override void OnGUI_CellMouseDown(Database.CellPosition pos)
 {
     //UnityEngine.Debug.Log("MouseDown at (" + Event.current.mousePosition.x + ", " + Event.current.mousePosition.y + " row:" + row + " col:" + col);
 }
 protected override void OnGUI_CellMouseMove(Database.CellPosition pos)
 {
 }
예제 #8
0
        public void OpenTable(Database.TableReference tableRef, Database.Table table, Database.CellPosition pos, bool focus, bool select)
        {
            if (select)
            {
                var objectUID = GetTableObjectUID(table, pos.row);
                if (objectUID >= 0)
                {
                    SelectObjectByUID(objectUID, focus);
                }
            }

            //m_CurrentTableIndex = m_UIState.GetTableIndex(table);
            m_Spreadsheet              = new UI.DatabaseSpreadsheet(m_UIState.FormattingOptions, table, this);
            m_Spreadsheet.onClickLink += OnSpreadsheetClick;
            m_Spreadsheet.Goto(pos);
            m_EventListener.OnRepaint();
        }
예제 #9
0
 protected virtual void OnGUI_CellMouseUp(Database.CellPosition pos)
 {
 }
예제 #10
0
 public void OpenTable(Database.TableReference tableRef, Database.Table table, Database.CellPosition pos)
 {
     CloseCurrentTable();
     m_CurrentTableLink         = tableRef;
     CurrentTableIndex          = m_UIState.CurrentMode.GetTableIndex(table);
     m_Spreadsheet              = new UI.DatabaseSpreadsheet(m_UIState.FormattingOptions, table, this);
     m_Spreadsheet.onClickLink += OnSpreadsheetClick;
     m_Spreadsheet.Goto(pos);
     m_EventListener.OnRepaint();
 }
예제 #11
0
        void OnSpreadsheetClick(UI.DatabaseSpreadsheet sheet, Database.LinkRequest link, Database.CellPosition pos)
        {
            var hEvent = new History(this, m_UIState.CurrentMode, sheet.DisplayTable.GetLinkTo(pos));

            m_UIState.history.AddEvent(hEvent);
            m_EventListener.OnOpenLink(link);
        }