Module SigCjW_CheckBox.pkg

     1//==============================================================================
     2// Project      : SigCj - VDF Classes for Codejock
     3// File         : SigCjW_CheckBox.pkg
     4// Description  : VDF Class for Codejock control
     5//
     6// Created by   : Ian Smith
     7// Revision     : $Rev: $
     8//                $Date: $
     9//                $Author: $
    10//
    11// Requirements : Visual DataFlex 14.1
    12//                Codejock SuitePro - Version 13.4.2
    13//
    14// Copyright    : (c) 2009 VDF SIG UK
    15//                Visual DataFlex Special Interest Group UK.
    16//                http://www.vdfsig.co.uk/
    17//                dev@vdfsig.co.uk
    18//
    19//                This file is part of SigCj.
    20//
    21//                SigCj is free software: you can redistribute it and/or modify
    22//                it under the terms of the GNU Lesser General Public License
    23//                as published by the Free Software Foundation, either version
    24//                2.1 of the License, or (at your option) any later version.
    25//
    26//                SigCj is distributed in the hope that it will be useful, but
    27//                WITHOUT ANY WARRANTY; without even the implied warranty of
    28//                MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    29//                GNU Lesser General Public License for more details.
    30//
    31//                If you have the complete SigCj workspace then a copy of the
    32//                GNU Lesser General Public License is in the Docs folder. If
    33//                not, see <http://www.gnu.org/licenses/>.
    34//
    35//==============================================================================
    36
    37//==============================================================================
    38// NOTE
    39// ====
    40// This control has been moved from the SigCjW_Controls.pkg package as we need a
    41// data aware version as well.
    42//==============================================================================
    43
    44Use FlexCom20.pkg
    45Use cComDbActiveXControl.pkg
    46Use SigCjLicense_v13.4.2.pkg
    47
    48Define OLEAppearanceStyle for Integer
    49    Define OLExtpAppearanceStandard for 0
    50    Define OLExtpAppearanceFlat for 1
    51    Define OLExtpAppearanceUltraFlat for 2
    52    Define OLExtpAppearanceOffice2000 for 3
    53    Define OLExtpAppearanceOfficeXP for 4
    54    Define OLExtpAppearanceOffice2003 for 5
    55    Define OLExtpAppearanceOffice2007 for 6
    56
    57Define OLEAlignmentStyle for Integer
    58    Define OLExtpAlignLeft for 0
    59    Define OLExtpAlignRight for 1
    60    Define OLExtpAlignCenter for 2
    61    Define OLExtpAlignMiddle for 0
    62    Define OLExtpAlignTop for 4
    63    Define OLExtpAlignBottom for 8
    64
    65Define OLEOLEDropConstants for Integer
    66    Define OLExtpOLEDropNone for 0
    67    Define OLExtpOLEDropManual for 1
    68
    69Define OLEOLEDragConstants for Integer
    70    Define OLExtpOLEDragManual for 0
    71    Define OLExtpOLEDragAutomatic for 1
    72
    73Define OLECheckAlignment for Integer
    74    Define OLExtpCheckAlignLeft for 0
    75    Define OLExtpCheckAlignRight for 1
    76
    77Define OLECheckBoxValue for Integer
    78    Define OLExtpUnchecked for 0
    79    Define OLExtpChecked for 1
    80    Define OLExtpGrayed for 2
    81
    82// Dispatch interface for CheckBox Control
    83Class cSigCjCom_DCheckBox is a Mixin
    84
    85    { MethodType=Property DesignTime=False }
    86    Function ComCaption Returns String
    87        String retVal
    88        Get ComProperty of (phDispatchDriver(Self)) -518 OLE_VT_BSTR to retVal
    89        Function_Return retVal
    90    End_Function
    91
    92    { MethodType=Property DesignTime=False }
    93    Procedure Set ComCaption String value
    94        Set ComProperty of (phDispatchDriver(Self)) -518 OLE_VT_BSTR to value
    95    End_Procedure
    96
    97    { MethodType=Property DesignTime=False }
    98    Function ComFont Returns Variant
    99        Variant retVal
   100        Get ComProperty of (phDispatchDriver(Self)) -512 OLE_VT_DISPATCH to retVal
   101        Function_Return retVal
   102    End_Function
   103
   104    { MethodType=Property DesignTime=False }
   105    Procedure Set ComFont Variant value
   106        Set ComProperty of (phDispatchDriver(Self)) -512 OLE_VT_DISPATCH to value
   107    End_Procedure
   108
   109    { MethodType=Property DesignTime=False }
   110    Function ComBackColor Returns OLE_COLOR
   111        OLE_COLOR retVal
   112        Get ComProperty of (phDispatchDriver(Self)) -501 OLE_VT_I4 to retVal
   113        Function_Return retVal
   114    End_Function
   115
   116    { MethodType=Property DesignTime=False }
   117    Procedure Set ComBackColor OLE_COLOR value
   118        Set ComProperty of (phDispatchDriver(Self)) -501 OLE_VT_I4 to value
   119    End_Procedure
   120
   121    { MethodType=Property DesignTime=False }
   122    Function ComForeColor Returns OLE_COLOR
   123        OLE_COLOR retVal
   124        Get ComProperty of (phDispatchDriver(Self)) -513 OLE_VT_I4 to retVal
   125        Function_Return retVal
   126    End_Function
   127
   128    { MethodType=Property DesignTime=False }
   129    Procedure Set ComForeColor OLE_COLOR value
   130        Set ComProperty of (phDispatchDriver(Self)) -513 OLE_VT_I4 to value
   131    End_Procedure
   132
   133    { MethodType=Property DesignTime=False }
   134    Function ComHWnd Returns OLE_HANDLE
   135        OLE_HANDLE retVal
   136        Get ComProperty of (phDispatchDriver(Self)) -515 OLE_VT_I4 to retVal
   137        Function_Return retVal
   138    End_Function
   139
   140    { MethodType=Property DesignTime=False }
   141    Procedure Set ComHWnd OLE_HANDLE value
   142        Set ComProperty of (phDispatchDriver(Self)) -515 OLE_VT_I4 to value
   143    End_Procedure
   144
   145    { MethodType=Property DesignTime=False }
   146    Function ComEnabled Returns Boolean
   147        Boolean retVal
   148        Get ComProperty of (phDispatchDriver(Self)) -514 OLE_VT_BOOL to retVal
   149        Function_Return retVal
   150    End_Function
   151
   152    { MethodType=Property DesignTime=False }
   153    Procedure Set ComEnabled Boolean value
   154        Set ComProperty of (phDispatchDriver(Self)) -514 OLE_VT_BOOL to value
   155    End_Procedure
   156
   157    { MethodType=Property DesignTime=False }
   158    Function ComTransparent Returns Boolean
   159        Boolean retVal
   160        Get ComProperty of (phDispatchDriver(Self)) 3 OLE_VT_BOOL to retVal
   161        Function_Return retVal
   162    End_Function
   163
   164    { MethodType=Property DesignTime=False }
   165    Procedure Set ComTransparent Boolean value
   166        Set ComProperty of (phDispatchDriver(Self)) 3 OLE_VT_BOOL to value
   167    End_Procedure
   168
   169    { MethodType=Property DesignTime=False }
   170    Function ComUseVisualStyle Returns Boolean
   171        Boolean retVal
   172        Get ComProperty of (phDispatchDriver(Self)) 5 OLE_VT_BOOL to retVal
   173        Function_Return retVal
   174    End_Function
   175
   176    { MethodType=Property DesignTime=False }
   177    Procedure Set ComUseVisualStyle Boolean value
   178        Set ComProperty of (phDispatchDriver(Self)) 5 OLE_VT_BOOL to value
   179    End_Procedure
   180
   181    { MethodType=Property DesignTime=False }
   182    Function ComAppearance Returns OLEAppearanceStyle
   183        OLEAppearanceStyle retVal
   184        Get ComProperty of (phDispatchDriver(Self)) 6 OLE_VT_I4 to retVal
   185        Function_Return retVal
   186    End_Function
   187
   188    { MethodType=Property DesignTime=False }
   189    Procedure Set ComAppearance OLEAppearanceStyle value
   190        Set ComProperty of (phDispatchDriver(Self)) 6 OLE_VT_I4 to value
   191    End_Procedure
   192
   193    { MethodType=Property DesignTime=False }
   194    Function ComTextAlignment Returns OLEAlignmentStyle
   195        OLEAlignmentStyle retVal
   196        Get ComProperty of (phDispatchDriver(Self)) 7 OLE_VT_I4 to retVal
   197        Function_Return retVal
   198    End_Function
   199
   200    { MethodType=Property DesignTime=False }
   201    Procedure Set ComTextAlignment OLEAlignmentStyle value
   202        Set ComProperty of (phDispatchDriver(Self)) 7 OLE_VT_I4 to value
   203    End_Procedure
   204
   205    { MethodType=Property DesignTime=False }
   206    Function ComMultiLine Returns Boolean
   207        Boolean retVal
   208        Get ComProperty of (phDispatchDriver(Self)) 8 OLE_VT_BOOL to retVal
   209        Function_Return retVal
   210    End_Function
   211
   212    { MethodType=Property DesignTime=False }
   213    Procedure Set ComMultiLine Boolean value
   214        Set ComProperty of (phDispatchDriver(Self)) 8 OLE_VT_BOOL to value
   215    End_Procedure
   216
   217    // (Member is Bindable)
   218    // (Member is DefaultBind)
   219    { MethodType=Property DesignTime=False }
   220    Function ComValue Returns OLECheckBoxValue
   221        OLECheckBoxValue retVal
   222        Get ComProperty of (phDispatchDriver(Self)) 0 OLE_VT_I4 to retVal
   223        Function_Return retVal
   224    End_Function
   225
   226    // (Member is Bindable)
   227    // (Member is DefaultBind)
   228    { MethodType=Property DesignTime=False }
   229    Procedure Set ComValue OLECheckBoxValue value
   230        Set ComProperty of (phDispatchDriver(Self)) 0 OLE_VT_I4 to value
   231    End_Procedure
   232
   233    { MethodType=Property DesignTime=False }
   234    Function ComRightToLeft Returns Boolean
   235        Boolean retVal
   236        Get ComProperty of (phDispatchDriver(Self)) -611 OLE_VT_BOOL to retVal
   237        Function_Return retVal
   238    End_Function
   239
   240    { MethodType=Property DesignTime=False }
   241    Procedure Set ComRightToLeft Boolean value
   242        Set ComProperty of (phDispatchDriver(Self)) -611 OLE_VT_BOOL to value
   243    End_Procedure
   244
   245    { MethodType=Property DesignTime=False }
   246    Function ComEnableMarkup Returns Boolean
   247        Boolean retVal
   248        Get ComProperty of (phDispatchDriver(Self)) 30 OLE_VT_BOOL to retVal
   249        Function_Return retVal
   250    End_Function
   251
   252    { MethodType=Property DesignTime=False }
   253    Procedure Set ComEnableMarkup Boolean value
   254        Set ComProperty of (phDispatchDriver(Self)) 30 OLE_VT_BOOL to value
   255    End_Procedure
   256
   257    // Returns/Sets whether this control can act as an OLE drop target.
   258    { MethodType=Property DesignTime=False }
   259    Function ComOLEDropMode Returns OLEOLEDropConstants
   260        OLEOLEDropConstants retVal
   261        Get ComProperty of (phDispatchDriver(Self)) 52 OLE_VT_I4 to retVal
   262        Function_Return retVal
   263    End_Function
   264
   265    // Returns/Sets whether this control can act as an OLE drop target.
   266    { MethodType=Property DesignTime=False }
   267    Procedure Set ComOLEDropMode OLEOLEDropConstants value
   268        Set ComProperty of (phDispatchDriver(Self)) 52 OLE_VT_I4 to value
   269    End_Procedure
   270
   271    { MethodType=Property DesignTime=False }
   272    Function ComDrawFocusRect Returns Boolean
   273        Boolean retVal
   274        Get ComProperty of (phDispatchDriver(Self)) 32 OLE_VT_BOOL to retVal
   275        Function_Return retVal
   276    End_Function
   277
   278    { MethodType=Property DesignTime=False }
   279    Procedure Set ComDrawFocusRect Boolean value
   280        Set ComProperty of (phDispatchDriver(Self)) 32 OLE_VT_BOOL to value
   281    End_Procedure
   282
   283    { MethodType=Property DesignTime=False }
   284    Function ComAlignment Returns OLECheckAlignment
   285        OLECheckAlignment retVal
   286        Get ComProperty of (phDispatchDriver(Self)) 37 OLE_VT_I4 to retVal
   287        Function_Return retVal
   288    End_Function
   289
   290    { MethodType=Property DesignTime=False }
   291    Procedure Set ComAlignment OLECheckAlignment value
   292        Set ComProperty of (phDispatchDriver(Self)) 37 OLE_VT_I4 to value
   293    End_Procedure
   294
   295    { MethodType=Property DesignTime=False }
   296    Function ComControlToolTip Returns String
   297        String retVal
   298        Get ComProperty of (phDispatchDriver(Self)) 70 OLE_VT_BSTR to retVal
   299        Function_Return retVal
   300    End_Function
   301
   302    { MethodType=Property DesignTime=False }
   303    Procedure Set ComControlToolTip String value
   304        Set ComProperty of (phDispatchDriver(Self)) 70 OLE_VT_BSTR to value
   305    End_Procedure
   306
   307    { MethodType=Property DesignTime=False }
   308    Function ComMarkupContext Returns Variant
   309        Handle hDispatchDriver
   310        Variant retVal
   311        Get phDispatchDriver to hDispatchDriver
   312        Get InvokeComMethod of hDispatchDriver 40 OLE_VT_DISPATCH to retVal
   313        Function_Return retVal
   314    End_Function
   315
   316    { MethodType=Property DesignTime=False }
   317    Function ComToolTipContext Returns Variant
   318        Handle hDispatchDriver
   319        Variant retVal
   320        Get phDispatchDriver to hDispatchDriver
   321        Get InvokeComMethod of hDispatchDriver 71 OLE_VT_DISPATCH to retVal
   322        Function_Return retVal
   323    End_Function
   324
   325    Procedure ComAboutBox
   326        Handle hDispatchDriver
   327        Get phDispatchDriver to hDispatchDriver
   328        Send InvokeComMethod to hDispatchDriver -552 OLE_VT_VOID
   329    End_Procedure
   330End_Class
   331
   332// Event interface for CheckBox Control
   333Class cSigCjCom_DCheckBoxEvents is a Mixin
   334
   335    { MethodType=Event }
   336    Procedure OnComClick
   337    End_Procedure
   338
   339    { MethodType=Event }
   340    Procedure OnComMouseDown Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly
   341    End_Procedure
   342
   343    { MethodType=Event }
   344    Procedure OnComMouseMove Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly
   345    End_Procedure
   346
   347    { MethodType=Event }
   348    Procedure OnComMouseUp Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly
   349    End_Procedure
   350
   351    { MethodType=Event }
   352    Procedure OnComKeyDown Short ByRef llKeyCode Short llShift
   353    End_Procedure
   354
   355    { MethodType=Event }
   356    Procedure OnComKeyPress Short ByRef llKeyAscii
   357    End_Procedure
   358
   359    { MethodType=Event }
   360    Procedure OnComKeyUp Short ByRef llKeyCode Short llShift
   361    End_Procedure
   362
   363    { MethodType=Event }
   364    Procedure OnComOLEDragOver Variant llData Integer ByRef llEffect Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly Short llstate
   365    End_Procedure
   366
   367    { MethodType=Event }
   368    Procedure OnComOLEDragDrop Variant llData Integer ByRef llEffect Short llButton Short llShift OLE_XPOS_PIXELS llx OLE_YPOS_PIXELS lly
   369    End_Procedure
   370
   371    { Visibility=Private }
   372    Procedure RegisterComEvents
   373        Send RegisterComEvent -600 msg_OnComClick
   374        Send RegisterComEvent -605 msg_OnComMouseDown
   375        Send RegisterComEvent -606 msg_OnComMouseMove
   376        Send RegisterComEvent -607 msg_OnComMouseUp
   377        Send RegisterComEvent -602 msg_OnComKeyDown
   378        Send RegisterComEvent -603 msg_OnComKeyPress
   379        Send RegisterComEvent -604 msg_OnComKeyUp
   380        Send RegisterComEvent 300 msg_OnComOLEDragOver
   381        Send RegisterComEvent 301 msg_OnComOLEDragDrop
   382    End_Procedure
   383End_Class
   384
   385//==============================================================================
   386
   387// CoClass
   388// CheckBox Control
   389{ CLSID=L_cSigCjComCheckBox }
   390Class cSigCjComCheckBox is a cComActiveXControl
   391    Import_Class_Protocol cSigCjCom_DCheckBox
   392    Import_Class_Protocol cSigCjCom_DCheckBoxEvents
   393
   394    Procedure Construct_Object
   395        Forward Send Construct_Object
   396        Set psProgID to L_cSigCjComCheckBox
   397        Set psEventId to "{7F87BE9B-8784-4B18-976D-F889C1F8B1E9}"
   398        Set psLicenseKey to L_cSigCjKeyControls
   399        Set peAutoCreate to acDeferredAutoCreate
   400        //Connect the default bindable property
   401        Send RegisterPropertyChangeEvent 0 msg_OnControlValueChanged
   402    End_Procedure
   403
   404    Function ControlValue Returns String
   405        //Associate the default bindable property with Get Value
   406        String retVal
   407        Get ComValue to retVal
   408        Function_Return retVal
   409    End_Function
   410
   411    Procedure Set ControlValue String sVal
   412        //Associate the default bindable property with Set Value
   413        Set ComValue to sVal
   414    End_Procedure
   415End_Class
   416
   417//==============================================================================
   418
   419// CoClass
   420// CheckBox Control
   421{ CLSID=L_cSigCjComCheckBox }
   422Class cSigCjComDbCheckBox is a cComDbActiveXControl
   423    Import_Class_Protocol cSigCjCom_DCheckBox
   424    Import_Class_Protocol cSigCjCom_DCheckBoxEvents
   425
   426    Procedure Construct_Object
   427        Forward Send Construct_Object
   428        Set psProgID to L_cSigCjComCheckBox
   429        Set psEventId to "{7F87BE9B-8784-4B18-976D-F889C1F8B1E9}"
   430        Set psLicenseKey to L_cSigCjKeyControls
   431        Set peAutoCreate to acDeferredAutoCreate
   432
   433        Send RegisterPropertyChangeEvent 0 msg_OnControlValueChanged
   434        //Connect the default bindable property
   435        Send RegisterPropertyChangeEvent 0 msg_OnControlValueChanged
   436    End_Procedure
   437
   438    Function ControlValue Returns String
   439        //Associate the default bindable property with Get Value
   440        String retVal
   441        Get ComValue to retVal
   442        Function_Return retVal
   443    End_Function
   444
   445    Procedure Set ControlValue String sVal
   446        //Associate the default bindable property with Set Value
   447        Set ComValue to sVal
   448    End_Procedure
   449End_Class
   450
   451//==============================================================================
   452//End of package - SigCjW_CheckBox.pkg
   453//==============================================================================
   454