Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonPopupAdapter.cs / 1305376 / RadioButtonPopupAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.ButtonInternal { using System; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.Windows.Forms; internal class RadioButtonPopupAdapter : RadioButtonFlatAdapter { internal RadioButtonPopupAdapter(ButtonBase control) : base(control) {} internal override void PaintUp(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackgroundFlat(e, layout.checkBounds, colors.buttonShadow, colors.options.highContrast ? colors.buttonFace : colors.highlight, true); DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintOver(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, colors.options.highContrast ? colors.buttonFace : colors.highlight, colors, true); DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintDown(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, colors.highlight, colors, true); DrawCheckOnly(e, layout, colors.buttonShadow, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } #region Layout protected override ButtonBaseAdapter CreateButtonAdapter() { return new ButtonPopupAdapter(Control); } protected override LayoutOptions Layout(PaintEventArgs e) { LayoutOptions layout = base.Layout(e); if (!Control.MouseIsDown && !Control.MouseIsOver) { layout.shadowedText = true; } return layout; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Ray3DHitTestResult.cs
- InheritedPropertyDescriptor.cs
- DbDataAdapter.cs
- CleanUpVirtualizedItemEventArgs.cs
- ModuleElement.cs
- InstanceNormalEvent.cs
- EditorPartChrome.cs
- shaperfactoryquerycacheentry.cs
- LOSFormatter.cs
- mediaclock.cs
- TextViewBase.cs
- MeasureItemEvent.cs
- ApplicationDirectoryMembershipCondition.cs
- RadioButtonList.cs
- QueryableFilterRepeater.cs
- SQLInt32.cs
- RichTextBox.cs
- SortableBindingList.cs
- XmlName.cs
- SqlExpander.cs
- WpfKnownMember.cs
- TraceSwitch.cs
- RootProfilePropertySettingsCollection.cs
- CodeDirectiveCollection.cs
- StatusBarAutomationPeer.cs
- DataGridViewRowEventArgs.cs
- MgmtConfigurationRecord.cs
- DbProviderFactoriesConfigurationHandler.cs
- FormViewRow.cs
- BitmapCodecInfoInternal.cs
- WebPartDisplayModeCollection.cs
- GcHandle.cs
- OleDbConnectionInternal.cs
- Monitor.cs
- QuaternionIndependentAnimationStorage.cs
- GeneralEndpointIdentity.cs
- StrokeNodeOperations2.cs
- ISAPIRuntime.cs
- DetailsViewInsertedEventArgs.cs
- OrderedDictionary.cs
- PagerStyle.cs
- TransformerConfigurationWizardBase.cs
- Resources.Designer.cs
- TabItemWrapperAutomationPeer.cs
- QueryConverter.cs
- ClientSession.cs
- QilInvokeLateBound.cs
- TreePrinter.cs
- OpCellTreeNode.cs
- RegistryPermission.cs
- StringInfo.cs
- SQLSingle.cs
- TimeBoundedCache.cs
- SoapIncludeAttribute.cs
- FlowNode.cs
- Vector3DAnimationUsingKeyFrames.cs
- Triplet.cs
- EdmItemError.cs
- WebContentFormatHelper.cs
- EventEntry.cs
- DataBindingHandlerAttribute.cs
- ObjectConverter.cs
- ContentHostHelper.cs
- ImageSourceValueSerializer.cs
- MexBindingBindingCollectionElement.cs
- NetworkAddressChange.cs
- SamlAuthorizationDecisionClaimResource.cs
- SerializableAttribute.cs
- DirtyTextRange.cs
- Oid.cs
- DriveInfo.cs
- NodeFunctions.cs
- DetailsViewDeletedEventArgs.cs
- EdmProperty.cs
- XmlObjectSerializerReadContext.cs
- shaperfactoryquerycacheentry.cs
- Popup.cs
- ProtectedProviderSettings.cs
- RuntimeEnvironment.cs
- XPathExpr.cs
- XmlDataDocument.cs
- Input.cs
- ErrorInfoXmlDocument.cs
- SqlProcedureAttribute.cs
- MethodBuilderInstantiation.cs
- CodeDelegateCreateExpression.cs
- safemediahandle.cs
- XhtmlBasicLinkAdapter.cs
- GroupItem.cs
- SimpleWorkerRequest.cs
- CompilerGeneratedAttribute.cs
- CngKeyBlobFormat.cs
- VirtualDirectoryMappingCollection.cs
- DoubleStorage.cs
- BooleanToVisibilityConverter.cs
- FormattedText.cs
- SendActivityDesigner.cs
- XPathSelectionIterator.cs
- MouseGestureValueSerializer.cs
- ModelPerspective.cs