Welcome Guest.   Make a donation to an author on the site November 24, 2014, 11:55:25 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: My ideas about [UseSameRotationValues] - with my code  (Read 1394 times)
songeastchang
Participant
*
Posts: 5


see users location on a map View Profile Give some DonationCredits to this forum member
« on: December 10, 2009, 01:14:07 AM »

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;
                    }
                }
« Last Edit: December 10, 2009, 01:31:19 AM by songeastchang » Logged
Markham
Honorary Member
**
Posts: 404


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: December 10, 2009, 12:35:53 PM »

So have another idea about this option, when the DockItems are rotated, why not have a counter rotation between circels?
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:
[copy or print]
               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
« Last Edit: December 10, 2009, 02:06:39 PM by Markham » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.025s | Server load: 0.07 ]