Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <param name="placementDim"></param>
        /// <returns></returns>
        public int getPlacementDif(PlacementDim placementDim)
        {
            int result = 0;

#if !PocketPC
            //tmp
            bool containerRightToLeft = _tableManager.RightToLeftLayout;
#else
            bool containerRightToLeft = false;
#endif
            switch (placementDim)
            {
            case PlacementDim.PLACE_X:
            case PlacementDim.PLACE_DX:
                ILogicalColumn columnManager = _tableManager.ColumnsManager.getLgColumnByMagicIdx(MgColumn);
                int            dx            = columnManager.getDx();
                result = dx * _logicalControl.PlacementData.getPlacement(placementDim, containerRightToLeft) / 100;
                break;

            case PlacementDim.PLACE_Y:
            case PlacementDim.PLACE_DY:
                result = 0; // no Y placement in table's children
                break;

            default:
                break;
            }


            return(result);
        }
Esempio n. 2
0
        /// <summary>
        ///   returns control rectangle
        /// </summary>
        /// <param name = "cellRect">rectangle of table's cell </param>
        /// <returns> </returns>
        public virtual Rectangle getDisplayRect(Rectangle cellRect, bool isHeaderEditor)
        {
            var rect = new Rectangle(0, 0, 0, 0);

            //if (_logicalControl is Line)
            //   rect = ((Line)_logicalControl).calcDisplayRect();
            //else
            {
                // compute rectangle relativly to table
                rect.Height = Height;
                rect.Width  = Width;
                PlacementData placementData = _logicalControl.PlacementData;

                // apply X placement (depends on column width)
                Rectangle      placementRect = placementData.Placement;
                ILogicalColumn columnManager = _tableManager.ColumnsManager.getLgColumnByMagicIdx(MgColumn);
                int            dx            = columnManager.getDx();
                if (_tableManager.RightToLeftLayout)
                {
                    int right = cellRect.Right - _xorigin;
                    right      -= dx * placementRect.X / 100;
                    rect.Width += ((dx * placementRect.Width) / 100);
                    rect.X      = right - rect.Width;
                }
                else
                {
                    rect.X      = GetDisplayRectangleLeft(cellRect);
                    rect.X     += dx * placementRect.X / 100;
                    rect.Width += ((dx * placementRect.Width) / 100);
                }

                // apply Y placement (depends on row height)
                // Defect 138536: For Header control, do not consider change in row height and hence do not consider placement for Y & Height
                int dy = isHeaderEditor ? 0 : _tableManager.GetChangeInRowHeight();
                rect.Y  = GetDisplayRectangleTop(cellRect);
                rect.Y += dy * placementRect.Y / 100;

                //Height of the 3D ComboBox is fixed and depends on the Font.
                //We cannot change it by setting the Height.
                //So, the Height placement is irrelevant.
                //Sets height only for 2D combobox
                if (!IsComboControl() || Is2DComboBoxControl())
                {
                    rect.Height += ((dy * placementRect.Height) / 100);
                }

                rect = _tableManager.GetTableMultiColumnStrategy(isHeaderEditor).GetRectToDraw(rect, cellRect);
            }

            return(rect);
        }