Class: cCJGridFreezeColumnMenuItem
Properties | Events | Methods | Index of Classes
A cCJGrid header context menu item, which will set or clear a freeze column
Hierarchy
cObject > DfComAutomationObject > cComAutomationObject > cCJCommandBarAction > cCJAction > cCJMenuItem > cCJGridFreezeColumnMenuItem
Show full hierarchy and direct subclasses
- cObject
- DfComAutomationObject
- cComAutomationObject
- cCJCommandBarAction
- cCJAction
- cCJMenuItem
- cCJGridFreezeColumnMenuItem
Library: Windows Application Class Library
Package: cCJGridFreezeColumnMenuItem.pkg
Description
cCJGridFreezeColumnMenuItem is a menu item class designed to be used as a context menu item in a cCJGrid. It allows you designate a freeze column. Freeze columns are columns to the left of the grid that will not scroll horizontally when the width of the columns exceeds the width of the grid. It freezes the column by sending the message FreezeColumn to the focus object (which will be the grid object), passing the column object that invoked the menu.
If there is no column object because you right clicked in a non-column area, the menu item is disabled. (see IsEnabled).
You can only freeze columns when column auto-sizing is disabled. Therefore, this menu item is hidden when pbAutoColumnSizing is False (see IsVisible).
This is one of the standard context menu items included with grid headers.
Object oCustomHeaderContext is a cCJContextMenu
Object oFieldChooser is a cCJGridFieldChooserMenuItem
End_Object
Object oLayout is a cCJGridRestoreLayoutMenuItem
End_Object
Object oAutoSizeToggle is a cCJMenuItem
Set pbControlBeginGroup to True
Set psCaption to "AutoSize Columns"
Procedure OnExecute Variant vCommandBarControl
Handle hoFocus
Boolean bAuto
Get IsChecked to bAuto
Get Focus to hoFocus
Set pbAutoColumnSizing of hoFocus to (not(bAuto))
End_Procedure
Function IsChecked Returns Boolean
Handle hoFocus
Boolean bAuto
Get Focus to hoFocus
Get pbAutoColumnSizing of hoFocus to bAuto
Function_Return (bAuto)
End_Function
End_Object
Object oBestFit is a cCJMenuItem
Set pbControlBeginGroup to True
Set psCaption to "Best Fit Column"
Procedure OnExecute Variant vCommandBarControl
Handle hoFocus hoCol
Get Focus to hoFocus
Get phoContextMenuColumn of hoFocus to hoCol
Send ComBestFit of hoCol
End_Procedure
Function IsEnabled Returns Boolean
Handle hoFocus
Handle hoCol
Get Focus to hoFocus
Get phoContextMenuColumn of hoFocus to hoCol
Function_Return (hoCol)
End_Function
End_Object
Object oHideCol is a cCJMenuItem
Set psCaption to "Hide Column"
Procedure OnExecute Variant vCommandBarControl
Handle hoFocus hoCol
Get Focus to hoFocus
Get phoContextMenuColumn of hoFocus to hoCol
Set pbVisible of hoCol to False
End_Procedure
Function IsEnabled Returns Boolean
Handle hoFocus hoCol
Boolean bAllow bAllow1
Get Focus to hoFocus
Get phoContextMenuColumn of hoFocus to hoCol
Get pbAllowColumnRemove of hoFocus to bAllow
If (hoCol) Begin
Get pbAllowDrag of hoCol to bAllow1
End
Function_Return (hoCol<>0 and bAllow and bAllow1)
End_Function
End_Object
Object oBestFit is a cCJMenuItem
Set psCaption to "Show All Columns"
Procedure OnExecute Variant vCommandBarControl
Handle hoFocus hoCol
Get Focus to hoFocus
Send ShowAllColumns of hoFocus
End_Procedure
End_Object
Object oFreeze is a cCJGridFreezeColumnMenuItem
Set pbControlBeginGroup to True
End_Object
End_Object
Set phoHeaderContextMenu to (oCustomHeaderContext)
See Also