Module cSigCJListView.pkg

     1//==============================================================================
     2// Project      : SigCj - VDF Classes for Codejock
     3// File         : cSigCJListView.pkg
     4// Description  : VDF Class for Codejock control
     5//
     6// Revision     : $Rev: 675 $
     7//                $Date: 2011-02-23 10:51:39 -0500 (Wed, 23 Feb 2011) $
     8//                $Author: martin $ 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 SigCjW_Controls.pkg
    37Use cSigCJMethods_Mixin.pkg
    38Use cSigCJGlobalSettings.pkg
    39
    40Define eLVStyle_Icon            for OLExtpListViewIcon
    41Define eLVStyle_SmallIcon       for OLExtpListViewSmallIcon
    42Define eLVStyle_List            for OLExtpListViewList
    43Define eLVStyle_Report          for OLExtpListViewReport
    44
    45Class cSigCJListView is a cSigCjComListView
    46    Import_Class_Protocol cSigCJMethods_Mixin
    47    
    48    Procedure Construct_Object
    49        Forward Send Construct_Object
    50
    51        // Define new Properties:
    52        { DesignTime=False Visibility=Private }
    53        Property Handle  Private.phoListViewItems           (Create(Self, U_cSigCjComListViewItems))        
    54        { DesignTime=False Visibility=Private }
    55        Property Handle  Private.phoListViewColumnHeaders   (Create(Self, U_cSigCjComListViewColumnHeaders))   
    56        
    57        { DesignTime=False Visibility=Private }
    58        Property Boolean Private.pbAllowColumnReorder       False
    59        { DesignTime=False Visibility=Private }
    60        Property Integer Private.peAppearance               OLExtpAppearanceStandard
    61        { DesignTime=False Visibility=Private }
    62        Property Integer Private.piBackColor                clWindow
    63        { DesignTime=False Visibility=Private }
    64        Property Boolean Private.pbShowCheckboxes           False
    65        { DesignTime=False Visibility=Private }
    66        Property Integer Private.peListViewStyle            eLVStyle_Icon
    67    End_Procedure
    68    
    69    // Create and augment procedures and functions
    70    { MethodType=Property Category="CodeJock" }
    71    { PropertyType=Boolean InitialValue=False }
    72    Procedure Set pbAllowColumnReorder Boolean bState
    73        If (IsComObjectCreated(Self)) Begin
    74            Set ComAllowColumnReorder to bState
    75        End
    76        Set Private.pbAllowColumnReorder to bState
    77    End_Procedure
    78
    79    { MethodType=Property Category="CodeJock" }
    80    Function pbAllowColumnReorder Returns Boolean
    81        Function_Return (Private.pbAllowColumnReorder(Self))
    82    End_Function
    83
    84    { MethodType=Property Category="CodeJock" }
    85    #IF (SigCj_Codejock_Version < 150001) 
    86        { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
    87        { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceOffice2007" }
    88    #ELSE    
    89        { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
    90        { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceResource" }
    91    #ENDIF 
    92    Procedure Set peAppearance Integer eAppearance
    93        If (IsComObjectCreated(Self)) Begin
    94            Set ComAppearance to eAppearance
    95        End
    96        Set Private.peAppearance to eAppearance        
    97    End_Procedure
    98
    99    { MethodType=Property Category="CodeJock" }
   100    Function peAppearance Returns Integer
   101        Function_Return (Private.peAppearance(Self))
   102    End_Function
   103    
   104    { MethodType=Property Category="CodeJock" }
   105    Procedure Set piBackColor Integer iColor
   106        If (IsComObjectCreated(Self)) Begin
   107            Set ComBackColor to iColor
   108        End
   109        Set Private.piBackColor to iColor
   110    End_Procedure
   111
   112    { MethodType=Property Category="CodeJock" }
   113    Function piBackColor Returns Integer
   114        Function_Return (Private.piBackColor(Self))
   115    End_Function
   116
   117    { MethodType=Property Category="CodeJock" }
   118    { PropertyType=Boolean InitialValue=False }
   119    Procedure Set pbShowCheckboxes Boolean bState
   120        If (IsComObjectCreated(Self)) Begin
   121            Set ComCheckboxes to bState
   122        End
   123        Set Private.pbShowCheckboxes to bState
   124    End_Procedure
   125
   126    { MethodType=Property Category="CodeJock" }
   127    Function pbShowCheckboxes Returns Boolean
   128        Function_Return (Private.pbShowCheckboxes(Self))
   129    End_Function
   130
   131    { MethodType=Property Category="CodeJock" }
   132    { EnumList="eLVStyle_Icon,eLVStyle_SmallIcon,eLVStyle_List,eLVStyle_Report" }
   133    { InitialValue=eLVAppearance_Standard}
   134    Procedure Set peListViewStyle Integer eStyle
   135        If (IsComObjectCreated(Self)) Begin
   136            Set ComView to eStyle
   137        End
   138        Set Private.peListViewStyle to eStyle        
   139    End_Procedure
   140
   141    { MethodType=Property Category="CodeJock" }
   142    Function peListViewStyle Returns Integer
   143        Function_Return (Private.peListViewStyle(Self))
   144    End_Function
   145
   146    Procedure AddListItem Integer iListItemIndex String sKey String sItemLabel String sImage
   147        Handle hoListItems
   148        Variant vListItem
   149        Integer iImageID
   150        
   151        Get Private.phoListViewItems to hoListItems
   152        If (sImage <> "") Begin
   153            Get AddImage of ghoSigCjGlobalSetting sImage 0 0 to iImageID
   154        End
   155        Get ComAdd of hoListItems iListItemIndex sKey sItemLabel iImageID to vListItem
   156    End_Procedure
   157
   158    { MethodType=Event }
   159    Procedure OnCreate
   160        Set pvComObject of (Private.phoListViewItems(Self)) to (ComListItems(Self))
   161        Set pvComObject of (Private.phoListViewColumnHeaders(Self)) to (ComColumnHeaders(Self))
   162        
   163        Set pbAllowColumnReorder to (Private.pbAllowColumnReorder(Self))
   164        Set peAppearance to (Private.peAppearance(Self))
   165        Set piBackColor to (Private.piBackColor(Self))
   166        Set pbShowCheckboxes to (Private.pbShowCheckboxes(Self))
   167        Set peListViewStyle to (Private.peListViewStyle(Self))
   168        
   169        Set ComColumnHeaderIcons to (ComIcons(ghoSigCjGlobalSetting))
   170        Set ComIcons             to (ComIcons(ghoSigCjGlobalSetting))
   171        Set ComIconSize to 16
   172        
   173        Variant vVoid
   174        Integer iImageID
   175                                              
   176        Get AddImage of ghoSigCjGlobalSetting "Lookup32.bmp" 0 0 to iImageID
   177        Get ComAdd of (Private.phoListViewColumnHeaders(Self)) 1 "Key" "Header" 70 1 iImageID to vVoid
   178        Get ComAdd of (Private.phoListViewItems(Self)) 1 "Item1" "Item One" iImageID to vVoid
   179        
   180        //Send OnAddListViewItems
   181    End_Procedure
   182End_Class
   183
   184//==============================================================================
   185//End of Package - cSigCJListView.pkg
   186//==============================================================================
   187