Example #1
0
        /// <summary> the method checks if double click event should be raised We can not use DoubleClick event, since it is possible that first click is
        /// performed on the container, and the second on loogical's control editor.</summary>
        /// <param name="mapData"></param>
        /// <returns></returns>
        internal bool isDoubleClick(MapData mapData)
        {
            if (!GuiUtils.isOwnerDrawControl(mapData.getControl()))
            {
                return(false);
            }
            bool ret  = false;
            long time = Misc.getSystemMilliseconds();
            long diff = time - lastClickTime;

            if (lastClicked != null && lastClicked.Equals(mapData) && diff < SystemInformation.DoubleClickTime)
            {
                // this is double click
                ret         = true;
                time        = -1;
                lastClicked = null;
            }
            else
            {
                lastClicked   = mapData;
                lastClickTime = time;
            }
            return(ret);
        }