Module cCJGridFieldChooser.pkg

     1Use cCJReportControl.pkg
     2
     3Class cCJGridFieldChooser is a cCJFieldChooser
     4    
     5    Procedure Construct_Object
     6        Forward Send Construct_Object
     7
     8        {Visibility = Private}
     9        Property Boolean private_pbSortAscending False // The SortAscending Property specifies whether to Sort the items in the Field Chooser in alphabetical order. See FieldChooser.SortAscending
    10//        {Visibility = Private}
    11//        Property Short private_peAppearance 0   // Specifies whether the FieldChooser control is drawn with 3D effects.  See FieldChooser.Appearance
    12        {Visibility = Private}
    13        Property Short private_peBorderStyle 0   // Specifies the border style for the FieldChooser control.  See FieldChooser.BorderStyle
    14        {Visibility = Private}
    15        Property Boolean private_Enabled_State True  // Specifies whether the FieldChooser control can respond to events.  See FieldChooser.Enabled 
    16        
    17        Property Handle phoGridObject 0          // Specifies the grid object that will be attached to this field chooser.
    18    End_Procedure
    19   
    20    // Enabled_State
    21    
    22    // Specifies whether the FieldChooser control can respond to events.  See FieldChooser.Enabled
    23    { MethodType=Property InitialValue=True } 
    24    Procedure Set Enabled_State Boolean bValue
    25        Set private_Enabled_State to bValue
    26        If (IsComObjectCreated(Self)) Begin
    27            Set ComEnabled to bValue 
    28        End
    29    End_Procedure
    30    
    31    { MethodType=Property }
    32    Function Enabled_State Returns Boolean
    33        Boolean bValue
    34        Get private_Enabled_State to bValue
    35        Function_Return bValue
    36    End_Function
    37
    38    // pbSortAscending
    39    
    40    // The SortAscending Property specifies whether to Sort the items in the Field Chooser in alphabetical order. See FieldChooser.SortAscending.
    41    { MethodType=Property InitialValue=False } 
    42    Procedure Set pbSortAscending Boolean bValue
    43        Set private_pbSortAscending to bValue
    44        If (IsComObjectCreated(Self)) Begin
    45            Set ComSortAscending to bValue 
    46        End
    47    End_Procedure
    48    
    49    { MethodType=Property }
    50    Function pbSortAscending Returns Boolean
    51        Boolean bValue
    52        Get private_pbSortAscending to bValue
    53        Function_Return bValue
    54    End_Function
    55
    56//    // peAppearance
    57//    
    58//    // Specifies whether the FieldChooser control is drawn with 3D effects.  See FieldChooser.Appearance
    59//    { MethodType=Property InitialValue=0 } 
    60//    Procedure Set peAppearance Short eValue
    61//        Set private_peAppearance to eValue
    62//        If (IsComObjectCreated(Self)) Begin
    63//            Set ComAppearance to eValue 
    64//        End
    65//    End_Procedure
    66//    
    67//    { MethodType=Property }
    68//    Function peAppearance Returns Short
    69//        Short eValue
    70//        Get private_peAppearance to eValue
    71//        Function_Return eValue
    72//    End_Function
    73    
    74    // peBorderStyle
    75    
    76    // Specifies the border style for the FieldChooser control.
    77    { MethodType=Property InitialValue=0 } 
    78    Procedure Set peBorderStyle Short eValue
    79        Set private_peBorderStyle to eValue
    80        If (IsComObjectCreated(Self)) Begin
    81            Set ComBorderStyle to eValue 
    82        End
    83    End_Procedure
    84    
    85    { MethodType=Property }
    86    Function peBorderStyle Returns Short
    87        Short eValue
    88        Get private_peBorderStyle to eValue
    89        Function_Return eValue
    90    End_Function
    91    
    92    // OnCreate
    93    
    94    Procedure OnCreate
    95        Handle hoGridObject
    96        
    97        Forward Send OnCreate
    98
    99//        Set ComAppearance  to (peAppearance(Self))
   100        Set ComBorderStyle to (peBorderStyle(Self))
   101        Set ComEnabled to (Enabled_State(Self))
   102        Set ComSortAscending to (pbSortAscending(Self))
   103        
   104        // Attach to the Grid object....
   105        Get phoGridObject to hoGridObject
   106        
   107        If (hoGridObject <> 0) Begin
   108            Send AttachFieldChooser of hoGridObject Self True
   109        End
   110    End_Procedure 
   111    
   112    Procedure ReleaseComObject
   113        Handle hoGridObject
   114        Forward Send ReleaseComObject
   115        Get phoGridObject to hoGridObject
   116        If (hoGridObject <> 0) Begin
   117            Send AttachFieldChooser of hoGridObject Self False
   118        End
   119    End_Procedure
   120    
   121End_Class
   122
   123Class cCJGridFieldChooserPanel is a ToolPanel
   124
   125    Procedure Construct_Object 
   126        Forward Send Construct_Object
   127        { DesignTime=False }
   128        Property Handle phoFieldChooserControl
   129        Set Size to 100 80
   130        Set Auto_Locate_State to True
   131        Set Popup_State to True
   132        Set Label to C_$FieldChooser
   133        
   134    
   135        Object oFieldChooser is a cCJGridFieldChooser
   136            Set Size to 100 80
   137            Set peAnchors to anAll
   138            Set peBorderStyle to 1 
   139            Set pbSortAscending to True
   140            Set phoFieldChooserControl to Self
   141        End_Object 
   142        
   143    End_Procedure
   144    
   145    { MethodType=Property }
   146    Procedure Set phoGridObject Handle hoGrid
   147        Handle hoFieldChooserControl
   148        Get phoFieldChooserControl to hoFieldChooserControl
   149        Set phoGridObject of hoFieldChooserControl to hoGrid        
   150    End_Procedure
   151
   152    { MethodType=Property }
   153    Function phoGridObject Returns Handle
   154        Handle hoFieldChooserControl hoGrid
   155        Get phoFieldChooserControl to hoFieldChooserControl
   156        Get phoGridObject of hoFieldChooserControl to hoGrid        
   157        Function_Return hoGrid
   158    End_Function
   159
   160End_Class
   161