C# Класс BrightIdeasSoftware.HeaderControl

Class used to capture window messages for the header of the list view control.
Наследование: System.Windows.Forms.NativeWindow
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CalculateColumnHeight float
CalculateFilterIndicatorWidth int
DrawImageAndText void
DrawText void
DrawVerticalText void
HandleHeaderCustomDraw bool
NeedsCustomDraw bool
NeedsCustomDraw bool
WndProc void

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CalculateFont() защищенный Метод

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
Результат System.Drawing.Font

CalculateHeight() защищенный Метод

Calculate how height the header needs to be
protected CalculateHeight ( Graphics g ) : int
g System.Drawing.Graphics
Результат int

CalculateStyle() защищенный Метод

What style should be applied to the header?
protected CalculateStyle ( OLVColumn column, bool isHot, bool isPressed ) : BrightIdeasSoftware.HeaderStateStyle
column OLVColumn
isHot bool
isPressed bool
Результат BrightIdeasSoftware.HeaderStateStyle

CreateToolTip() защищенный Метод

Create a native tool tip control for this listview
protected CreateToolTip ( ) : void
Результат void

CustomDrawHeaderCell() защищенный Метод

Draw one cell of the header
protected CustomDrawHeaderCell ( Graphics g, int columnIndex, int itemState ) : void
g System.Drawing.Graphics
columnIndex int
itemState int
Результат void

DrawFilterIndicator() защищенный Метод

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
Результат System.Drawing.Rectangle

DrawHeaderImageAndText() защищенный Метод

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
Результат void

DrawThemedBackground() защищенный Метод

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
Результат void

DrawThemedSortIndicator() защищенный Метод

Draw a sort indicator using themes
protected DrawThemedSortIndicator ( Graphics g, Rectangle r ) : void
g System.Drawing.Graphics
r System.Drawing.Rectangle
Результат void

DrawUnthemedBackground() защищенный Метод

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
Результат void

DrawUnthemedSortIndicator() защищенный Метод

Draw a sort indicator without using themes
protected DrawUnthemedSortIndicator ( Graphics g, Rectangle r ) : Rectangle
g System.Drawing.Graphics
r System.Drawing.Rectangle
Результат System.Drawing.Rectangle

GetItemRect() публичный Метод

Return the bounds of the item with the given index
public GetItemRect ( int itemIndex ) : Rectangle
itemIndex int
Результат System.Drawing.Rectangle

HandleDestroy() защищенный Метод

Handle when the underlying header control is destroyed
protected HandleDestroy ( Message &m ) : bool
m System.Windows.Forms.Message
Результат bool

HandleLayout() защищенный Метод

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
Результат bool

HandleMouseMove() защищенный Метод

Handle the MouseMove windows message
protected HandleMouseMove ( Message &m ) : bool
m System.Windows.Forms.Message
Результат bool

HandleNotify() защищенный Метод

Handle the Notify windows message
protected HandleNotify ( Message &m ) : bool
m System.Windows.Forms.Message
Результат bool

HandleSetCursor() защищенный Метод

Handle the SetCursor windows message
protected HandleSetCursor ( Message &m ) : bool
m System.Windows.Forms.Message
Результат bool

HasFilterIndicator() защищенный Метод

Should the given column be drawn with a filter indicator against it?
protected HasFilterIndicator ( OLVColumn column ) : bool
column OLVColumn
Результат bool

HasNonThemedSortIndicator() защищенный Метод

Should the given column show a non-themed sort indicator?
protected HasNonThemedSortIndicator ( OLVColumn column ) : bool
column OLVColumn
Результат bool

HasSortIndicator() защищенный Метод

Should the given column show a sort indicator?
protected HasSortIndicator ( OLVColumn column ) : bool
column OLVColumn
Результат bool

HeaderControl() публичный Метод

Create a header control for the given ObjectListView.
public HeaderControl ( ObjectListView olv ) : System
olv ObjectListView
Результат System

Invalidate() публичный Метод

Force the header to redraw by invalidating it
public Invalidate ( ) : void
Результат void

NeedsCustomDraw() защищенный Метод

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
Результат bool