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
- PropertyMetadata.cs
- ProxyWebPartManager.cs
- TagMapInfo.cs
- CodeGotoStatement.cs
- ManualResetEvent.cs
- MethodBuilder.cs
- ChainedAsyncResult.cs
- ConversionContext.cs
- CommentEmitter.cs
- BooleanProjectedSlot.cs
- ArcSegment.cs
- UnsafeNativeMethods.cs
- DataGridAutoFormat.cs
- GridViewCancelEditEventArgs.cs
- NonVisualControlAttribute.cs
- TableLayout.cs
- DefaultPrintController.cs
- ValidatedControlConverter.cs
- RawStylusInputCustomData.cs
- ListenerElementsCollection.cs
- CheckPair.cs
- KnownBoxes.cs
- WmfPlaceableFileHeader.cs
- ListDictionary.cs
- ProtocolsSection.cs
- SoapExtensionImporter.cs
- ObjectListDataBindEventArgs.cs
- AssemblyGen.cs
- processwaithandle.cs
- MediaElementAutomationPeer.cs
- KeyConstraint.cs
- QilFactory.cs
- StringCollection.cs
- ErrorWebPart.cs
- ProfessionalColorTable.cs
- CollectionViewGroup.cs
- TransportBindingElement.cs
- UrlPropertyAttribute.cs
- RenderOptions.cs
- Win32.cs
- LocalizationComments.cs
- MessageHeaderDescriptionCollection.cs
- SafeProcessHandle.cs
- XPathSingletonIterator.cs
- SrgsRuleRef.cs
- XmlAnyAttributeAttribute.cs
- OrderPreservingPipeliningMergeHelper.cs
- SharedPersonalizationStateInfo.cs
- RichTextBox.cs
- Int64Converter.cs
- CompilerGlobalScopeAttribute.cs
- WindowsScrollBar.cs
- CommonServiceBehaviorElement.cs
- mactripleDES.cs
- ColorDialog.cs
- PersonalizationDictionary.cs
- BlurEffect.cs
- METAHEADER.cs
- DBSqlParserColumn.cs
- JournalEntry.cs
- StringCollection.cs
- SimpleRecyclingCache.cs
- _ConnectStream.cs
- BeginEvent.cs
- WebPartUtil.cs
- TextParentUndoUnit.cs
- ComPlusServiceHost.cs
- UIElement.cs
- CategoryEditor.cs
- InputLanguageEventArgs.cs
- AggregateNode.cs
- Nodes.cs
- DataGridBoolColumn.cs
- WebConfigManager.cs
- ColorContext.cs
- _ConnectStream.cs
- FreeFormPanel.cs
- StreamWriter.cs
- GridViewRowCollection.cs
- Triangle.cs
- VBIdentifierName.cs
- SubtreeProcessor.cs
- BrushConverter.cs
- CriticalFinalizerObject.cs
- NumericExpr.cs
- XsltCompileContext.cs
- _NegoState.cs
- MemberDescriptor.cs
- elementinformation.cs
- TreeView.cs
- FormViewInsertedEventArgs.cs
- COAUTHINFO.cs
- XmlSchemaProviderAttribute.cs
- HtmlEncodedRawTextWriter.cs
- IPPacketInformation.cs
- _RequestCacheProtocol.cs
- SplitterPanel.cs
- GuidConverter.cs
- SetIterators.cs
- HttpApplication.cs