Changeset 2069 for trunk/eraser


Ignore:
Timestamp:
5/8/2010 1:54:00 AM (5 years ago)
Author:
lowjoel
Message:

Fall back to a normal (non-split) button when the current platform doesn't support split buttons; the split button context menu can be found by right-clicking the button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Util/ExtensionClasses/SplitButton.cs

    r2067 r2069  
    4545            { 
    4646                CreateParams createParams = base.CreateParams; 
    47                 createParams.Style |= NativeMethods.BS_SPLITBUTTON; 
     47                if (IsSupportedOnCurrentPlatform) 
     48                    createParams.Style |= NativeMethods.BS_SPLITBUTTON; 
    4849                return createParams; 
    4950            } 
     
    8687                    //we will also show the context menu when the user right-clicks 
    8788                    //the button. 
    88                     if (Environment.OSVersion.Version.Major >= 6) 
     89                    if (!IsSupportedOnCurrentPlatform) 
    8990                        return; 
    9091                    break; 
     
    9293 
    9394            base.WndProc(ref m); 
     95        } 
     96 
     97        /// <summary> 
     98        /// Checks whether the current platform supports the control. 
     99        /// </summary> 
     100        private static bool IsSupportedOnCurrentPlatform 
     101        { 
     102            get 
     103            { 
     104                return Environment.OSVersion.Version.Major >= 6; 
     105            } 
    94106        } 
    95107 
Note: See TracChangeset for help on using the changeset viewer.