Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonPopupAdapter.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlNavigatorStack.cs
- WasHttpModulesInstallComponent.cs
- Int16AnimationBase.cs
- ClientOptions.cs
- GcSettings.cs
- SmtpTransport.cs
- ThreadPoolTaskScheduler.cs
- ErrorStyle.cs
- DiagnosticsConfigurationHandler.cs
- UDPClient.cs
- QueryOptionExpression.cs
- ReflectionTypeLoadException.cs
- ECDiffieHellmanCng.cs
- DefaultPrintController.cs
- BrowsableAttribute.cs
- LightweightCodeGenerator.cs
- Interlocked.cs
- TimeStampChecker.cs
- WebPartTransformer.cs
- ImplicitInputBrush.cs
- StylusButtonEventArgs.cs
- ImmutableClientRuntime.cs
- DataGridColumn.cs
- LinkLabelLinkClickedEvent.cs
- ResourceAssociationTypeEnd.cs
- Request.cs
- HelloMessageApril2005.cs
- XmlNamespaceMappingCollection.cs
- OleDbPropertySetGuid.cs
- SmiEventSink_Default.cs
- SHA1CryptoServiceProvider.cs
- Figure.cs
- DSACryptoServiceProvider.cs
- PathGeometry.cs
- ThreadAttributes.cs
- CanonicalXml.cs
- XmlSchemaExternal.cs
- Model3DGroup.cs
- log.cs
- CheckBoxPopupAdapter.cs
- TypeValidationEventArgs.cs
- Point3DKeyFrameCollection.cs
- GeneratedCodeAttribute.cs
- ScriptResourceInfo.cs
- WebZone.cs
- HtmlValidationSummaryAdapter.cs
- ThemeableAttribute.cs
- VideoDrawing.cs
- TakeQueryOptionExpression.cs
- ApplicationInfo.cs
- ForeignKeyFactory.cs
- MimePart.cs
- NoResizeSelectionBorderGlyph.cs
- SyndicationSerializer.cs
- CriticalHandle.cs
- UniqueConstraint.cs
- Bits.cs
- unsafenativemethodsother.cs
- EntityCollectionChangedParams.cs
- RTTrackingProfile.cs
- DiagnosticsConfiguration.cs
- WebAdminConfigurationHelper.cs
- TreeNodeMouseHoverEvent.cs
- XmlSchemaAttributeGroupRef.cs
- PasswordBoxAutomationPeer.cs
- XmlEncoding.cs
- FixedSOMImage.cs
- SQLInt16.cs
- SecureStringHasher.cs
- CodeSnippetExpression.cs
- HttpListenerRequest.cs
- OrderToken.cs
- EdmTypeAttribute.cs
- VisualCollection.cs
- XmlEventCache.cs
- GAC.cs
- SystemWebExtensionsSectionGroup.cs
- TrailingSpaceComparer.cs
- IdentityModelDictionary.cs
- RepeaterCommandEventArgs.cs
- QuaternionIndependentAnimationStorage.cs
- XamlTypeMapper.cs
- EntityDataSourceState.cs
- LayoutTable.cs
- CategoryGridEntry.cs
- OdbcError.cs
- ConfigDefinitionUpdates.cs
- PropertyMetadata.cs
- PerformanceCounterCategory.cs
- DocumentXPathNavigator.cs
- SimpleHandlerBuildProvider.cs
- ParseHttpDate.cs
- BrushMappingModeValidation.cs
- objectquery_tresulttype.cs
- MonthCalendar.cs
- GuidelineCollection.cs
- EncodingTable.cs
- ArrayList.cs
- sqlinternaltransaction.cs
- CapabilitiesSection.cs