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
- returneventsaver.cs
- MexNamedPipeBindingCollectionElement.cs
- MgmtResManager.cs
- HyperLink.cs
- panel.cs
- HighlightComponent.cs
- StorageEndPropertyMapping.cs
- TableDetailsCollection.cs
- EventEntry.cs
- SqlBulkCopyColumnMapping.cs
- SqlRewriteScalarSubqueries.cs
- AbstractExpressions.cs
- RowToParametersTransformer.cs
- PluralizationService.cs
- WinEventTracker.cs
- LambdaCompiler.Logical.cs
- _LocalDataStoreMgr.cs
- ApplicationSettingsBase.cs
- ChangeDirector.cs
- NumberFormatInfo.cs
- SendOperation.cs
- PolyBezierSegment.cs
- XmlSchemaComplexType.cs
- DefaultValueConverter.cs
- DesignerProperties.cs
- Parallel.cs
- SpnegoTokenProvider.cs
- PageBuildProvider.cs
- GenerateScriptTypeAttribute.cs
- SyntaxCheck.cs
- XPathScanner.cs
- HttpMethodConstraint.cs
- HtmlInputImage.cs
- InvokePatternIdentifiers.cs
- FrameworkContentElement.cs
- ColumnTypeConverter.cs
- GPPOINT.cs
- ServerValidateEventArgs.cs
- FlowDocumentFormatter.cs
- MergeFilterQuery.cs
- RoleGroup.cs
- PoisonMessageException.cs
- DebugView.cs
- TagPrefixCollection.cs
- AsyncWaitHandle.cs
- MulticastNotSupportedException.cs
- RMEnrollmentPage3.cs
- OdbcHandle.cs
- CookieParameter.cs
- XsdBuilder.cs
- BamlLocalizer.cs
- EventBuilder.cs
- DoubleMinMaxAggregationOperator.cs
- MediaContext.cs
- ExponentialEase.cs
- BrowserCapabilitiesCodeGenerator.cs
- ClientConfigurationSystem.cs
- AttachedPropertyBrowsableAttribute.cs
- JpegBitmapDecoder.cs
- ReliabilityContractAttribute.cs
- DataServiceQuery.cs
- BatchParser.cs
- DecimalConstantAttribute.cs
- ApplicationException.cs
- WinCategoryAttribute.cs
- TextPointer.cs
- OptimalTextSource.cs
- HMAC.cs
- BlurEffect.cs
- StorageConditionPropertyMapping.cs
- documentsequencetextpointer.cs
- PrintingPermissionAttribute.cs
- WorkflowDebuggerSteppingAttribute.cs
- LogEntryDeserializer.cs
- InfocardExtendedInformationEntry.cs
- DefinitionBase.cs
- FrameworkRichTextComposition.cs
- PartialArray.cs
- HttpModuleAction.cs
- MessageQueueKey.cs
- QueryAccessibilityHelpEvent.cs
- IdentitySection.cs
- DesignerCapabilities.cs
- WebBaseEventKeyComparer.cs
- TextStore.cs
- NamedPipeProcessProtocolHandler.cs
- MethodCallConverter.cs
- EllipseGeometry.cs
- AuthStoreRoleProvider.cs
- MenuItemAutomationPeer.cs
- EntityCommandExecutionException.cs
- PbrsForward.cs
- Main.cs
- LogStore.cs
- COM2ExtendedTypeConverter.cs
- GetRecipientRequest.cs
- WebZoneDesigner.cs
- XpsLiterals.cs
- DoubleAnimationClockResource.cs
- Condition.cs