ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Circle Dock

My ideas about [UseSameRotationValues] - with my code

(1/1)

songeastchang:
I found the option "DockSettings.General.useSameRotationValues" couldn't work very well in my environment.
So have another idea about this option, when the DockItems are rotated, why not have a counter rotation between circels?

When the mouse is whelling,  the odd circels are rotated in the clockwise, while the even circles are rotated in the counterclockwise.

I have implemented this in the 0.9.2 alpha8, just a little change can get this cool effect, it was indeed like wheels if done this, maybe.
if there is any problem ,please let me know. thank you.

 private System.Drawing.Point[] CalculateDockItemPositionsForCircle(System.Drawing.Size[] DockItemSizes)
        {
              //...
              int num3 = 0;
                int num4 = 0;
               int numCircleIndex1 = 0;
                for (int j = 0; j < DockItemSizes.Length; j++)
                {
                    double tempRotationValue1 = (!DockSettings.General.useSameRotationValues && numCircleIndex1 % 2 == 0) ? RotationValue : -RotationValue;

                    pointArray[j] = new System.Drawing.Point(((this.CentreObject.Location.X + num2) + ((int)(((base.DockSettings.CircleParams.MinRadius + num3) - (DockItemSizes[j].Width / 2)) * Math.Cos((j * num) + tempRotationValue1)))) - (DockItemSizes[j].Width / 2), ((this.CentreObject.Location.Y + num2) + ((int)(((base.DockSettings.CircleParams.MinRadius + num3) - (DockItemSizes[j].Height / 2)) * Math.Sin((j * num) + tempRotationValue1)))) - (DockItemSizes[j].Height / 2));
                    num4++;
                    if (num4 >= base.DockSettings.CircleParams.ConstNumItemsPerCircle)
                    {
                        num4 = 0;
                       numCircleIndex1++;
                        num3 += base.DockSettings.CircleParams.CircleSeparation;
                    }
                }

Markham:
So have another idea about this option, when the DockItems are rotated, why not have a counter rotation between circels?-songeastchang (December 10, 2009, 01:14 AM)
--- End quote ---
Actually this functionality is in the next version already! My implementation is similar to yours, but yours has a bug: the icons that appear on the even rings will appear in the wrong order.

Here's part of my code:

--- ---                int CircleIndex = 0;
                double _RotationValue = ((DockSettings.General.EnableCounterRotateRings) &&
                    (CircleIndex % 2 == 0) && (!showingLevel)) ? RotationValue : -RotationValue;
                for (int i = 0; i < DockItemSizes.Length; i++)
                {
                    CalculatedPoints[i] = new Point(CentreObject.Location.X + CentreObjectRadius + (int)((double)(DockSettings.CircleParams.MinRadius + IncreaseRadius - DockItemSizes[i].Width / 2) * Math.Cos(i * RadianDivisons + _RotationValue)) - DockItemSizes[i].Width / 2,
                                                    CentreObject.Location.Y + CentreObjectRadius + (int)((double)(DockSettings.CircleParams.MinRadius + IncreaseRadius - DockItemSizes[i].Height / 2) * Math.Sin(i * RadianDivisons + _RotationValue)) - DockItemSizes[i].Height / 2);
                    tempCounter++;
                    if (tempCounter >= DockSettings.CircleParams.ConstNumItemsPerCircle)
                    {
                        tempCounter = 0;
                        CircleIndex++;
                        _RotationValue = ((DockSettings.General.EnableCounterRotateRings) &&
                                          (CircleIndex % 2 == 0) && (!showingLevel)) ? RotationValue : -RotationValue;
                
                        IncreaseRadius = IncreaseRadius + DockSettings.CircleParams.CircleSeparation;
                    }
                }
The boolean variable showingLevel is set true whenever icons are being positioned on the Dock and it is always false when the Dock is being rotated by the mouse or keyboard.

Although the code was included in Beta 1, it could not be enabled due to the fact I had omitted to update the settings dialog. It now is. Thanks for the reminder!

Mark

Navigation

[0] Message Index

Go to full version