Skip to content

Class: cCJGridRestoreLayoutMenuItem

Properties | Events | Methods | Index of Classes

A cCJGrid header context menu item which will restore the grid layout back to its original layout

Hierarchy

cObject > DfComAutomationObject > cComAutomationObject > cCJCommandBarAction > cCJAction > cCJMenuItem > cCJGridRestoreLayoutMenuItem

Show full hierarchy and direct subclasses

Library: Windows Application Class Library

Package: cCJGridRestoreLayoutMenuItem.pkg

Description

cCJGridRestoreLayoutMenuItem is a menu item class designed to be used as a context menu item in a cCJGrid. It restores the grid's column layout back to it's original state by sending the message RestoreLayout to the focus object (which will be the grid object). The resets the grid's column layout back to its original programmed layout.

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

cCJMenuItem