Module cSigCJReportControlContextMenu.pkg

     1//==============================================================================
     2// Project      : SigCj - VDF Classes for Codejock
     3// File         : cSigCJReportControlContextMenu.pkg
     4// Description  : VDF Classes for standard Context menus within the Report control
     5//
     6// Revision     : $Rev: 599 $
     7//                $Date: 2009-10-14 10:39:01 +0100 (Wed, 14 Oct 2009) $
     8//                $Author: pak $ Martin Pincott
     9// 
    10// Requirements : Visual DataFlex 12.1+
    11//                Codejock SuitePro - Version 12.0.0+
    12//
    13// Copyright    : (c) 2008 VDF SIG UK
    14//                Visual DataFlex Special Interest Group UK.
    15//                http://www.vdfsig.co.uk/
    16//                dev@vdfsig.co.uk
    17//
    18//                This file is part of SigCj.
    19//
    20//                SigCj is free software: you can redistribute it and/or modify
    21//                it under the terms of the GNU Lesser General Public License 
    22//                as published by the Free Software Foundation, either version 
    23//                2.1 of the License, or (at your option) any later version.
    24//
    25//                SigCj is distributed in the hope that it will be useful, but 
    26//                WITHOUT ANY WARRANTY; without even the implied warranty of
    27//                MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    28//                GNU Lesser General Public License for more details.
    29//
    30//                If you have the complete SigCj workspace then a copy of the  
    31//                GNU Lesser General Public License is in the Docs folder. If  
    32//                not, see <http://www.gnu.org/licenses/>.
    33//    
    34//==============================================================================
    35
    36Use cSigCJContextMenu.pkg
    37
    38Register_Function phoFieldChooser Returns Handle
    39Register_Function pbFreezeColumns Returns Boolean   
    40
    41Class cSigCJReportControlContextMenu_Header is a cSigCJContextMenu
    42
    43    Procedure OnAdd_MenuItems
    44        Send Add_MenuItem "Rebuild"             "Rebuild_Report"   False
    45        Send Add_MenuItem "Refresh"             "Refresh_Report"   False
    46        Send Add_MenuItem "Field Chooser"       "FieldChooser"     True 
    47        Send Add_MenuItem "Default Layout"      "DefaultLayout"    False
    48        Send Add_MenuItem "Freeze Column"       "FreezeColumn"     True
    49        Send Add_MenuItem "Clear Freeze Column" "FreezeClear"      False
    50    End_Procedure // OnAdd_MenuItems
    51
    52    Procedure Popup
    53        Boolean bVisible
    54        If (not(phoFieldChooser(Self))) Begin
    55            Set Visible "Field Chooser"  to False
    56            Set Visible "Default Layout" to False
    57        End
    58        Set Visible "Freeze Column"       to (pbFreezeColumns(Self)) 
    59        Set Visible "Clear Freeze Column" to (pbFreezeColumns(Self)) 
    60        Forward Send Popup 
    61    End_Procedure
    62
    63    Procedure Construct_Object
    64        Forward Send Construct_Object
    65        Set phoContextMenu_Header to (Self)
    66    End_Procedure // Construct_Object
    67
    68End_Class // cSigCJReportControlContextMenu_Header
    69
    70Class cSigCJReportControlContextMenu_GroupBox is a cSigCJContextMenu
    71    
    72    Procedure OnAdd_MenuItems
    73        Send Add_MenuItem "Rebuild"            "Rebuild_Report"   False
    74        Send Add_MenuItem "Refresh"            "Refresh_Report"   False
    75        Send Add_MenuItem "Field Chooser"      "FieldChooser"     True 
    76        Send Add_MenuItem "Default Layout"     "DefaultLayout"    False
    77    End_Procedure // OnAdd_MenuItems
    78
    79    Procedure Popup
    80        If (not(phoFieldChooser(Self))) Begin
    81            Set Visible "Field Chooser"  to False
    82            Set Visible "Default Layout" to False
    83        End
    84        Forward Send Popup 
    85    End_Procedure
    86
    87    Procedure Construct_Object
    88        Forward Send Construct_Object
    89        Set phoContextMenu_GroupBox to (Self)
    90    End_Procedure // Construct_Object
    91
    92End_Class // cSigCJReportControlContextMenu_GroupBox 
    93
    94Class cSigCJReportControlContextMenu_ReportArea is a cSigCJContextMenu
    95    
    96    Procedure OnAdd_MenuItems
    97        Send Add_MenuItem "Rebuild"                "Rebuild_Report"   False
    98        Send Add_MenuItem "Refresh"                "Refresh_Report"   False
    99        Send Add_MenuItem "Field Chooser"          "FieldChooser"     True 
   100        Send Add_MenuItem "Default Layout"         "DefaultLayout"    False
   101        Send Add_MenuItem "Select All"             "SelectAll"        True 
   102        Send Add_MenuItem "Deselect All"           "DeselectAll"      False
   103        Send Add_MenuItem "Invert Selection"       "Invert_Selection" False
   104        Send Add_MenuItem "Preview Report"         "PreviewReport"    True 
   105        Send Add_MenuItem "Print Report"           "PrintReport"      False
   106        Send Add_MenuItem "Export To CSV"          "CSV_Export"       False
   107        //Send Add_MenuItem "Process Selected Rows"  "Process_Rows"     True 
   108    End_Procedure // OnAdd_MenuItems
   109
   110    Procedure Popup
   111        If (not(phoFieldChooser(Self))) Begin
   112            Set Visible "Field Chooser"  to False
   113            Set Visible "Default Layout" to False
   114        End
   115        Forward Send Popup 
   116    End_Procedure
   117    
   118    Procedure Construct_Object
   119        Forward Send Construct_Object
   120        Set phoContextMenu_ReportArea to (Self)
   121    End_Procedure // Construct_Object
   122
   123End_Class // cSigCJReportControlContextMenu_ReportArea
   124