C# Class BrightIdeasSoftware.HeaderControl

Class used to capture window messages for the header of the list view control.
Inheritance: System.Windows.Forms.NativeWindow
Afficher le fichier Open project: soywiz/cspspemu Class Usage Examples

Private Properties

Свойство Type Description
CalculateColumnHeight float
CalculateFilterIndicatorWidth int
DrawImageAndText void
DrawText void
DrawVerticalText void
HandleHeaderCustomDraw bool
NeedsCustomDraw bool
NeedsCustomDraw bool
WndProc void

Méthodes publiques

Méthode Description
GetItemRect ( int itemIndex ) : Rectangle

Return the bounds of the item with the given index

HeaderControl ( ObjectListView olv ) : System

Create a header control for the given ObjectListView.

Invalidate ( ) : void

Force the header to redraw by invalidating it

Méthodes protégées

Méthode Description
CalculateFont ( OLVColumn column, bool isHot, bool isPressed ) : Font

What font should be used to draw the header text?

CalculateHeight ( Graphics g ) : int

Calculate how height the header needs to be

CalculateStyle ( OLVColumn column, bool isHot, bool isPressed ) : BrightIdeasSoftware.HeaderStateStyle

What style should be applied to the header?

CreateToolTip ( ) : void

Create a native tool tip control for this listview

CustomDrawHeaderCell ( Graphics g, int columnIndex, int itemState ) : void

Draw one cell of the header

DrawFilterIndicator ( Graphics g, Rectangle r ) : Rectangle

Draw an indication that this column has a filter applied to it

DrawHeaderImageAndText ( Graphics g, Rectangle r, OLVColumn column, BrightIdeasSoftware.HeaderStateStyle stateStyle ) : void

Draw the header's image and text

DrawThemedBackground ( Graphics g, Rectangle r, int columnIndex, bool isSelected ) : void

Draw a more-or-less pure themed header background.

DrawThemedSortIndicator ( Graphics g, Rectangle r ) : void

Draw a sort indicator using themes

DrawUnthemedBackground ( Graphics g, Rectangle r, int columnIndex, bool isSelected, BrightIdeasSoftware.HeaderStateStyle stateStyle ) : void

Draw a background for the header, without using Themes.

DrawUnthemedSortIndicator ( Graphics g, Rectangle r ) : Rectangle

Draw a sort indicator without using themes

HandleDestroy ( Message &m ) : bool

Handle when the underlying header control is destroyed

HandleLayout ( Message &m ) : bool

The message divides a ListView's space between the header and the rows of the listview. The WINDOWPOS structure controls the headers bounds, the RECT controls the listview bounds.

HandleMouseMove ( Message &m ) : bool

Handle the MouseMove windows message

HandleNotify ( Message &m ) : bool

Handle the Notify windows message

HandleSetCursor ( Message &m ) : bool

Handle the SetCursor windows message

HasFilterIndicator ( OLVColumn column ) : bool

Should the given column be drawn with a filter indicator against it?

HasNonThemedSortIndicator ( OLVColumn column ) : bool

Should the given column show a non-themed sort indicator?

HasSortIndicator ( OLVColumn column ) : bool

Should the given column show a sort indicator?

NeedsCustomDraw ( ) : bool

Does this header need to be custom drawn?

Word wrapping and colored text require custom drawning. Funnily enough, we can change the font natively.

Private Methods

Méthode Description
CalculateColumnHeight ( Graphics g, OLVColumn column, TextFormatFlags flags, bool isHot, int i ) : float
CalculateFilterIndicatorWidth ( Rectangle r ) : int
DrawImageAndText ( Graphics g, Rectangle r, OLVColumn column, TextFormatFlags flags, Font f, Color color, int imageTextGap ) : void
DrawText ( Graphics g, Rectangle r, OLVColumn column, TextFormatFlags flags, Font f, Color color ) : void
DrawVerticalText ( Graphics g, Rectangle r, OLVColumn column, Font f, Color color ) : void
HandleHeaderCustomDraw ( Message &m ) : bool

Handle the CustomDraw windows message

NeedsCustomDraw ( BrightIdeasSoftware.HeaderFormatStyle style ) : bool
NeedsCustomDraw ( BrightIdeasSoftware.HeaderStateStyle style ) : bool
WndProc ( Message &m ) : void

Method Details

CalculateFont() protected méthode

What font should be used to draw the header text?
protected CalculateFont ( OLVColumn column, bool isHot, bool isPressed ) : Font
column OLVColumn
isHot bool
isPressed bool
Résultat System.Drawing.Font

CalculateHeight() protected méthode

Calculate how height the header needs to be
protected CalculateHeight ( Graphics g ) : int
g System.Drawing.Graphics
Résultat int

CalculateStyle() protected méthode

What style should be applied to the header?
protected CalculateStyle ( OLVColumn column, bool isHot, bool isPressed ) : BrightIdeasSoftware.HeaderStateStyle
column OLVColumn
isHot bool
isPressed bool
Résultat BrightIdeasSoftware.HeaderStateStyle

CreateToolTip() protected méthode

Create a native tool tip control for this listview
protected CreateToolTip ( ) : void
Résultat void

CustomDrawHeaderCell() protected méthode

Draw one cell of the header
protected CustomDrawHeaderCell ( Graphics g, int columnIndex, int itemState ) : void
g System.Drawing.Graphics
columnIndex int
itemState int
Résultat void

DrawFilterIndicator() protected méthode

Draw an indication that this column has a filter applied to it
protected DrawFilterIndicator ( Graphics g, Rectangle r ) : Rectangle
g System.Drawing.Graphics
r System.Drawing.Rectangle
Résultat System.Drawing.Rectangle

DrawHeaderImageAndText() protected méthode

Draw the header's image and text
protected DrawHeaderImageAndText ( Graphics g, Rectangle r, OLVColumn column, BrightIdeasSoftware.HeaderStateStyle stateStyle ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
column OLVColumn
stateStyle BrightIdeasSoftware.HeaderStateStyle
Résultat void

DrawThemedBackground() protected méthode

Draw a more-or-less pure themed header background.
protected DrawThemedBackground ( Graphics g, Rectangle r, int columnIndex, bool isSelected ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
columnIndex int
isSelected bool
Résultat void

DrawThemedSortIndicator() protected méthode

Draw a sort indicator using themes
protected DrawThemedSortIndicator ( Graphics g, Rectangle r ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
Résultat void

DrawUnthemedBackground() protected méthode

Draw a background for the header, without using Themes.
protected DrawUnthemedBackground ( Graphics g, Rectangle r, int columnIndex, bool isSelected, BrightIdeasSoftware.HeaderStateStyle stateStyle ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
columnIndex int
isSelected bool
stateStyle BrightIdeasSoftware.HeaderStateStyle
Résultat void

DrawUnthemedSortIndicator() protected méthode

Draw a sort indicator without using themes
protected DrawUnthemedSortIndicator ( Graphics g, Rectangle r ) : Rectangle
g System.Drawing.Graphics
r System.Drawing.Rectangle
Résultat System.Drawing.Rectangle

GetItemRect() public méthode

Return the bounds of the item with the given index
public GetItemRect ( int itemIndex ) : Rectangle
itemIndex int
Résultat System.Drawing.Rectangle

HandleDestroy() protected méthode

Handle when the underlying header control is destroyed
protected HandleDestroy ( Message &m ) : bool
m System.Windows.Forms.Message
Résultat bool

HandleLayout() protected méthode

The message divides a ListView's space between the header and the rows of the listview. The WINDOWPOS structure controls the headers bounds, the RECT controls the listview bounds.
protected HandleLayout ( Message &m ) : bool
m System.Windows.Forms.Message
Résultat bool

HandleMouseMove() protected méthode

Handle the MouseMove windows message
protected HandleMouseMove ( Message &m ) : bool
m System.Windows.Forms.Message
Résultat bool

HandleNotify() protected méthode

Handle the Notify windows message
protected HandleNotify ( Message &m ) : bool
m System.Windows.Forms.Message
Résultat bool

HandleSetCursor() protected méthode

Handle the SetCursor windows message
protected HandleSetCursor ( Message &m ) : bool
m System.Windows.Forms.Message
Résultat bool

HasFilterIndicator() protected méthode

Should the given column be drawn with a filter indicator against it?
protected HasFilterIndicator ( OLVColumn column ) : bool
column OLVColumn
Résultat bool

HasNonThemedSortIndicator() protected méthode

Should the given column show a non-themed sort indicator?
protected HasNonThemedSortIndicator ( OLVColumn column ) : bool
column OLVColumn
Résultat bool

HasSortIndicator() protected méthode

Should the given column show a sort indicator?
protected HasSortIndicator ( OLVColumn column ) : bool
column OLVColumn
Résultat bool

HeaderControl() public méthode

Create a header control for the given ObjectListView.
public HeaderControl ( ObjectListView olv ) : System
olv ObjectListView
Résultat System

Invalidate() public méthode

Force the header to redraw by invalidating it
public Invalidate ( ) : void
Résultat void

NeedsCustomDraw() protected méthode

Does this header need to be custom drawn?
Word wrapping and colored text require custom drawning. Funnily enough, we can change the font natively.
protected NeedsCustomDraw ( ) : bool
Résultat bool