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
- RequestQueue.cs
- AngleUtil.cs
- CommandHelpers.cs
- EnumConverter.cs
- AsymmetricKeyExchangeDeformatter.cs
- ColorConverter.cs
- RayHitTestParameters.cs
- RegexMatch.cs
- DockPanel.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- RawAppCommandInputReport.cs
- XmlnsDefinitionAttribute.cs
- DesigntimeLicenseContext.cs
- BamlLocalizer.cs
- FixedHyperLink.cs
- FixedElement.cs
- VideoDrawing.cs
- UIElementParagraph.cs
- ProfileProvider.cs
- SerializationFieldInfo.cs
- VersionedStream.cs
- Lasso.cs
- Faults.cs
- WindowsFormsSynchronizationContext.cs
- AuthenticationConfig.cs
- AmbientLight.cs
- Compiler.cs
- ActivityMarkupSerializationProvider.cs
- IListConverters.cs
- XamlContextStack.cs
- ChtmlCommandAdapter.cs
- ResponseStream.cs
- LoginName.cs
- PathSegmentCollection.cs
- DocumentsTrace.cs
- SchemaSetCompiler.cs
- SqlVersion.cs
- altserialization.cs
- BitmapImage.cs
- XmlUTF8TextWriter.cs
- ValueType.cs
- MetaModel.cs
- AlignmentXValidation.cs
- StringTraceRecord.cs
- Automation.cs
- ImageInfo.cs
- WindowsSlider.cs
- XmlDictionaryWriter.cs
- counter.cs
- MethodCallTranslator.cs
- xsdvalidator.cs
- SecurityKeyIdentifier.cs
- GroupBoxAutomationPeer.cs
- LocatorBase.cs
- FullTextBreakpoint.cs
- ElementAction.cs
- SortQuery.cs
- TableHeaderCell.cs
- EditorZoneAutoFormat.cs
- SessionStateUtil.cs
- DbSourceCommand.cs
- ListBox.cs
- DataObjectMethodAttribute.cs
- Point4D.cs
- DbModificationClause.cs
- RsaSecurityToken.cs
- GestureRecognitionResult.cs
- DesignSurfaceManager.cs
- OracleInternalConnection.cs
- CriticalFinalizerObject.cs
- XNameTypeConverter.cs
- DataGridCaption.cs
- LayoutInformation.cs
- QueryOperationResponseOfT.cs
- TableCellAutomationPeer.cs
- Nullable.cs
- ExpressionEditorAttribute.cs
- SessionPageStateSection.cs
- Choices.cs
- TypeToStringValueConverter.cs
- HostedHttpTransportManager.cs
- EventProviderWriter.cs
- TypeSystemHelpers.cs
- ImageInfo.cs
- SocketStream.cs
- ExpressionLexer.cs
- Literal.cs
- DataBoundControlAdapter.cs
- WindowsListViewGroupSubsetLink.cs
- TraceProvider.cs
- unitconverter.cs
- CloseSequence.cs
- NavigationWindowAutomationPeer.cs
- ReceiveErrorHandling.cs
- IdentitySection.cs
- Exceptions.cs
- GridViewDeletedEventArgs.cs
- MonikerBuilder.cs
- Vector.cs
- Storyboard.cs