Code:
/ DotNET / DotNET / 8.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
- FixedDocumentPaginator.cs
- PageStatePersister.cs
- GridViewEditEventArgs.cs
- OleStrCAMarshaler.cs
- ApplicationInfo.cs
- Logging.cs
- InputLangChangeRequestEvent.cs
- MultiPageTextView.cs
- AppearanceEditorPart.cs
- ApplicationId.cs
- AvTraceDetails.cs
- Restrictions.cs
- ItemContainerGenerator.cs
- CompositeFontParser.cs
- PolyQuadraticBezierSegment.cs
- ConstructorArgumentAttribute.cs
- DynamicQueryableWrapper.cs
- PrimitiveCodeDomSerializer.cs
- Interlocked.cs
- StringToken.cs
- SmiSettersStream.cs
- SafeLocalMemHandle.cs
- HMACMD5.cs
- VisualStyleElement.cs
- OperatingSystem.cs
- HotSpot.cs
- FormatConvertedBitmap.cs
- KeyValuePair.cs
- VBCodeProvider.cs
- WindowsTab.cs
- ObservableCollection.cs
- SessionEndingEventArgs.cs
- DataSourceXmlAttributeAttribute.cs
- MetadataSerializer.cs
- TextBreakpoint.cs
- DesignUtil.cs
- Positioning.cs
- WebServiceEndpoint.cs
- VisualProxy.cs
- AssemblyCollection.cs
- BeginSelectCardRequest.cs
- InfoCardKeyedHashAlgorithm.cs
- DataBoundControlHelper.cs
- HtmlEmptyTagControlBuilder.cs
- AssemblyLoader.cs
- X509ChainElement.cs
- Application.cs
- LoginCancelEventArgs.cs
- wgx_sdk_version.cs
- XPathNavigatorKeyComparer.cs
- AdRotator.cs
- SmtpFailedRecipientException.cs
- ArithmeticException.cs
- MemoryRecordBuffer.cs
- HttpServerVarsCollection.cs
- Command.cs
- localization.cs
- ControllableStoryboardAction.cs
- SchemaSetCompiler.cs
- AutoGeneratedField.cs
- ScrollPattern.cs
- manifestimages.cs
- EqualityComparer.cs
- VariantWrapper.cs
- FatalException.cs
- ResourceDescriptionAttribute.cs
- InputReferenceExpression.cs
- TypeValidationEventArgs.cs
- FtpRequestCacheValidator.cs
- TripleDESCryptoServiceProvider.cs
- Substitution.cs
- FunctionQuery.cs
- StreamingContext.cs
- Trustee.cs
- OAVariantLib.cs
- LambdaCompiler.Logical.cs
- CodeSubDirectory.cs
- DifferencingCollection.cs
- ExtensionSimplifierMarkupObject.cs
- Parser.cs
- Stylesheet.cs
- RecordConverter.cs
- NotCondition.cs
- CompositeKey.cs
- FixedTextSelectionProcessor.cs
- WindowsEditBoxRange.cs
- CompoundFileDeflateTransform.cs
- ProviderCollection.cs
- EndpointAddressMessageFilter.cs
- QueryOperationResponseOfT.cs
- PasswordTextNavigator.cs
- TopClause.cs
- TimelineCollection.cs
- AnnotationService.cs
- BroadcastEventHelper.cs
- SRDisplayNameAttribute.cs
- WriteTimeStream.cs
- SynchronizingStream.cs
- _TransmitFileOverlappedAsyncResult.cs
- RightsManagementPermission.cs