Module cSigCJLabel.pkg

     1//==============================================================================
     2// Project      : SigCj - VDF Classes for Codejock
     3// File         : cSigCJLabel.pkg
     4// Description  : VDF Class for Codejock control
     5//
     6// Revision     : $Rev: 624 $
     7//                $Date: 2010-02-26 15:56:09 -0500 (Fri, 26 Feb 2010) $
     8//                $Author: martin $ Martin Pincott
     9// 
    10// Requirements : Visual DataFlex 12.1+
    11//                Codejock SuitePro 2007 - Version 12.0.0+
    12//
    13// Copyright    : (c) 2009 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
    39Use StdFont.pkg
    40
    41{ OverrideProperty=Label_Col_Offset          DesignTime=False }
    42{ OverrideProperty=Label_Justification_Mode  DesignTime=False }
    43{ OverrideProperty=Label_Row_Offset          DesignTime=False }
    44{ OverrideProperty=piMinSize                 DesignTime=False }
    45{ OverrideProperty=Border_Style              DesignTime=False }
    46{ OverrideProperty=Visible_State             DesignTime=False }
    47{ OverrideProperty=Attach_Parent_State       DesignTime=False }
    48{ OverrideProperty=Block_Mouse_State         DesignTime=False }
    49{ OverrideProperty=Client_Area_State         DesignTime=False }
    50{ OverrideProperty=Delegation_Mode           DesignTime=False }
    51{ OverrideProperty=Focus_Mode                DesignTime=False }
    52{ OverrideProperty=pbBindValue               DesignTime=False }
    53{ OverrideProperty=peAutoCreate              DesignTime=False }
    54{ OverrideProperty=peNeighborhood            DesignTime=False }
    55{ OverrideProperty=Popup_State               DesignTime=False }
    56{ OverrideProperty=Ring_State                DesignTime=False }
    57{ OverrideProperty=Scope_State               DesignTime=False }
    58{ OverrideProperty=Search_Case               DesignTime=False }
    59{ OverrideProperty=Skip_State                DesignTime=False }
    60{ OverrideProperty=Help_Id                   DesignTime=False }
    61{ OverrideProperty=Help_Keyword              DesignTime=False }
    62{ OverrideProperty=psHtmlHelpTopic           DesignTime=False }
    63{ OverrideProperty=Status_Help               DesignTime=False }
    64{ OverrideProperty=Use_Parent_Status_Help    DesignTime=False }
    65{ OverrideProperty=psLicenseKey              DesignTime=False }
    66{ OverrideProperty=psProgID                  DesignTime=False }
    67Class cSigCJLabel is a cSigCjComLabel
    68    Import_Class_Protocol cSigCJMethods_Mixin
    69    
    70    Procedure Construct_Object
    71        Forward Send Construct_Object
    72
    73        { DesignTime=False }
    74        Property Integer Private_peAlignment OLExtpAlignLeft
    75
    76        { DesignTime=False }
    77        Property Boolean Private_pbAutoEllipsis False
    78
    79        { DesignTime=False }
    80        Property Boolean Private_pbAutoSize False
    81
    82        { DesignTime=False }
    83        Property Integer Private_piBackColor clBtnFace
    84
    85        { DesignTime=False }
    86        Property String  Private_psCaption ""
    87
    88        { DesignTime=False }
    89        Property Boolean Private_pbEnabled True
    90
    91        { DesignTime=False }
    92        Property Boolean Private_pbEnableMarkup False
    93
    94        { DesignTime=False }
    95        Property Integer Private_piForeColor clBlack
    96
    97        { DesignTime=False }
    98        Property String  Private_psImage ""
    99
   100        { DesignTime=False }
   101        Property Boolean Private_pbRightToLeft False
   102
   103        { DesignTime=False }
   104        Property Boolean Private_pbUseMnemonic False
   105
   106        { DesignTime=False }
   107        Property Boolean Private_pbWordWrap False
   108
   109        //Property Private_p Transparent                  Determines if the background of a TabControlPage is visible in WinXP mode.
   110
   111        //---------------------------------------------------------------------
   112        //Font Properties
   113        { DesignTime=False }
   114        Property Boolean Private_pbBold False
   115
   116        { DesignTime=False }
   117        Property Boolean Private_pbItalic False
   118
   119        { DesignTime=False }
   120        Property Boolean Private_pbStrikethrough False
   121
   122        { DesignTime=False }
   123        Property Boolean Private_pbUnderline False
   124
   125        { DesignTime=False }
   126        Property String Private_psFontName "MS Sans Serif"
   127
   128        { DesignTime=False }
   129        Property Number Private_pnFontSize 8.25
   130
   131        { DesignTime=False }
   132        Property Handle Private_hoFont  (Create(Self, U_cComStdFont))
   133
   134        //---------------------------------------------------------------------
   135
   136    End_Procedure
   137
   138    Procedure End_Construct_Object
   139        Forward Send End_Construct_Object
   140
   141        // Add your code that needs to be executed at the end of the object construction here:
   142
   143    End_Procedure
   144
   145    { MethodType=Event }
   146    Procedure OnCreate
   147        Handle hoFont
   148
   149        Forward Send OnCreate
   150
   151        Set peAlignment     to (Private_peAlignment   (Self))
   152        Set pbAutoEllipsis  to (Private_pbAutoEllipsis(Self))
   153        Set pbAutoSize      to (Private_pbAutoSize    (Self))
   154        Set piBackColor     to (Private_piBackColor   (Self))
   155        Set pbEnabled       to (Private_pbEnabled     (Self))
   156        Set pbEnableMarkup  to (Private_pbEnableMarkup(Self))
   157        Set piForeColor     to (Private_piForeColor   (Self))
   158        Set psImage         to (Private_psImage       (Self))
   159        Set pbRightToLeft   to (Private_pbRightToLeft (Self))
   160        Set pbUseMnemonic   to (Private_pbUseMnemonic (Self))
   161        Set pbWordWrap      to (Private_pbWordWrap    (Self))
   162
   163        //Connect the OCX and dataflex FONT objects and set defaults
   164        Get Private_hoFont   to hoFont
   165        Set pvComObject      of hoFont to (ComFont(Self))
   166        Set ComBold          of hoFont to (Private_pbBold(Self))
   167        Set ComItalic        of hoFont to (Private_pbItalic(Self))
   168        Set ComStrikethrough of hoFont to (Private_pbStrikethrough(Self))
   169        Set ComUnderline     of hoFont to (Private_pbUnderline(Self))
   170        Set ComName          of hoFont to (Private_psFontName(Self))
   171        Set ComSize          of hoFont to (Private_pnFontSize(Self))
   172
   173        //Some of the controls clear the caption when other properties are
   174        //changed, so we always set the caption last.
   175        Set ComCaption  to (Private_psCaption(Self))
   176    End_Procedure  // OnCreate
   177
   178    //-------------------------------------------------------------------------
   179
   180    { MethodType=Property Category="CodeJock" InitialValue=False }
   181    Procedure Set pbBold Boolean bState
   182        Set SigCJProperty Set_Private_pbBold Set_ComBold (Private_hoFont(Self)) to bState
   183    End_Procedure
   184
   185    Function pbBold Returns Boolean
   186        Function_Return (SigCJProperty(Self, Get_Private_pbBold, Get_ComBold, Private_hoFont(Self)))
   187    End_Function
   188
   189    //-------------------------------------------------------------------------
   190
   191    { MethodType=Property Category="CodeJock" InitialValue=False }
   192    Procedure Set pbItalic Boolean bState
   193        Set SigCJProperty Set_Private_pbItalic Set_ComItalic (Private_hoFont(Self)) to bState
   194    End_Procedure
   195
   196    Function pbItalic Returns Boolean
   197        Function_Return (SigCJProperty(Self, Get_Private_pbItalic, Get_ComItalic, Private_hoFont(Self)))
   198    End_Function
   199
   200    //-------------------------------------------------------------------------
   201
   202    { MethodType=Property Category="CodeJock" InitialValue=False }
   203    Procedure Set pbStrikethrough Boolean bState
   204        Set SigCJProperty Set_Private_pbStrikethrough Set_ComStrikethrough (Private_hoFont(Self)) to bState
   205    End_Procedure
   206
   207    Function pbStrikethrough Returns Boolean
   208        Function_Return (SigCJProperty(Self, Get_Private_pbStrikethrough, Get_ComStrikethrough, Private_hoFont(Self)))
   209    End_Function
   210
   211    //-------------------------------------------------------------------------
   212
   213    { MethodType=Property Category="CodeJock" InitialValue=False }
   214    Procedure Set pbUnderline Boolean bState
   215        Set SigCJProperty Set_Private_pbUnderline Set_ComUnderline (Private_hoFont(Self)) to bState
   216    End_Procedure
   217
   218    Function pbUnderline Returns Boolean
   219        Function_Return (SigCJProperty(Self, Get_Private_pbUnderline, Get_ComUnderline, Private_hoFont(Self)))
   220    End_Function
   221
   222    //-------------------------------------------------------------------------
   223
   224    { MethodType=Property Category="CodeJock" InitialValue="MS Sans Serif" }
   225    Procedure Set psFontName String sName
   226        Set SigCJProperty Set_Private_psFontName Set_ComName (Private_hoFont(Self)) to sName
   227    End_Procedure
   228
   229    Function psFontName Returns String
   230        Function_Return (SigCJProperty(Self, Get_Private_psFontName, Get_ComName, Private_hoFont(Self)))
   231    End_Function
   232
   233    //-------------------------------------------------------------------------
   234
   235    { MethodType=Property Category="CodeJock" InitialValue=8.25 }
   236    Procedure Set pnFontSize Number nSize
   237        Set SigCJProperty Set_Private_pnFontSize Set_ComSize (Private_hoFont(Self)) to nSize
   238    End_Procedure
   239
   240    Function pnFontSize Returns Number
   241        Function_Return (SigCJProperty(Self, Get_Private_pnFontSize, Get_ComSize, Private_hoFont(Self)))
   242    End_Function
   243
   244    //-------------------------------------------------------------------------
   245
   246    { MethodType=Property Category="CodeJock" InitialValue=OLExtpAlignLeft }
   247    { EnumList="OLExtpAlignLeft, OLExtpAlignRight, OLExtpAlignCenter, OLExtpAlignMiddle, OLExtpAlignTop, OLExtpAlignBottom" }
   248    Procedure Set peAlignment Integer eAlign
   249        Set SigCJProperty Set_Private_peAlignment Set_ComAlignment to eAlign
   250    End_Procedure
   251
   252    Function peAlignment Returns Boolean
   253        Function_Return (SigCJProperty(Self, Get_Private_peAlignment, Get_ComAlignment ))
   254    End_Function
   255
   256    //-------------------------------------------------------------------------
   257
   258    { MethodType=Property Category="CodeJock" InitialValue=False }
   259    Procedure Set pbAutoEllipsis Boolean bState
   260        Set SigCJProperty Set_Private_pbAutoEllipsis Set_ComAutoEllipsis to bState
   261    End_Procedure
   262
   263    Function pbAutoEllipsis Returns Boolean
   264        Function_Return (SigCJProperty(Self, Get_Private_pbAutoEllipsis, Get_ComAutoEllipsis ))
   265    End_Function
   266
   267    //-------------------------------------------------------------------------
   268
   269    { MethodType=Property Category="CodeJock" InitialValue=False }
   270    Procedure Set pbAutoSize Boolean bState
   271        Set SigCJProperty Set_Private_pbAutoSize Set_ComAutoSize to bState
   272    End_Procedure
   273
   274    Function pbAutoSize Returns Boolean
   275        Function_Return (SigCJProperty(Self, Get_Private_pbAutoSize, Get_ComAutoSize ))
   276    End_Function
   277
   278    //-------------------------------------------------------------------------
   279
   280    { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clBtnFace }
   281    Procedure Set piBackColor Integer iColor
   282        Set SigCJProperty Set_Private_piBackColor Set_ComBackColor to iColor
   283    End_Procedure
   284
   285    Function piBackColor Returns Integer
   286        Function_Return (SigCJProperty(Self, Get_Private_piBackColor, Get_ComBackColor ))
   287    End_Function
   288
   289    //-------------------------------------------------------------------------
   290
   291    { MethodType=Property Category="CodeJock" InitialValue=" " }
   292    Procedure Set psCaption String sLabel
   293        Set SigCJProperty Set_Private_psCaption Set_ComCaption to sLabel
   294    End_Procedure
   295
   296    Function psCaption Returns String
   297        Function_Return (SigCJProperty(Self, Get_Private_psCaption, Get_ComCaption ))
   298    End_Function
   299
   300    //-------------------------------------------------------------------------
   301
   302    { MethodType=Property Category="CodeJock" InitialValue=True }
   303    Procedure Set pbEnabled Boolean bState
   304        Set SigCJProperty Set_Private_pbEnabled Set_ComEnabled to bState
   305    End_Procedure
   306
   307    Function pbEnabled Returns Boolean
   308        Function_Return (SigCJProperty(Self, Get_Private_pbEnabled, Get_ComEnabled ))
   309    End_Function
   310
   311    //-------------------------------------------------------------------------
   312
   313    { MethodType=Property Category="CodeJock" InitialValue=False }
   314    Procedure Set pbEnableMarkup Boolean bState
   315        Set SigCJProperty Set_Private_pbEnableMarkup Set_ComEnableMarkup to bState
   316    End_Procedure
   317
   318    Function pbEnableMarkup Returns Boolean
   319        Function_Return (SigCJProperty(Self, Get_Private_pbEnableMarkup, Get_ComEnableMarkup ))
   320    End_Function
   321
   322    //-------------------------------------------------------------------------
   323
   324    { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clBlack }
   325    Procedure Set piForeColor Integer iColor
   326        Set SigCJProperty Set_Private_piForeColor Set_ComForeColor to iColor
   327    End_Procedure
   328
   329    Function piForeColor Returns Boolean
   330        Function_Return (SigCJProperty(Self, Get_Private_piForeColor, Get_ComForeColor ))
   331    End_Function
   332
   333    //-------------------------------------------------------------------------
   334
   335    Procedure Set psImage String sImage
   336        Integer iImageId
   337        Variant vImage
   338
   339        Set Private_psImage to sImage
   340
   341        If (IsComObjectCreated(Self)) Begin
   342            Get AddImage    of ghoSigCjGlobalSetting sImage 0 OLExtpImageNormal to iImageId
   343            Get ImageFromId of ghoSigCjGlobalSetting iImageId to vImage
   344
   345            Set ComIcon to vImage
   346        End
   347    End_Procedure
   348
   349    Function psImage Returns String
   350        Function_Return (Private_psImage(Self))
   351    End_Function
   352
   353    //-------------------------------------------------------------------------
   354
   355    { MethodType=Property Category="CodeJock" InitialValue=False }
   356    Procedure Set pbRightToLeft Boolean bState
   357        Set SigCJProperty Set_Private_pbRightToLeft Set_ComRightToLeft to bState
   358    End_Procedure
   359
   360    Function pbRightToLeft Returns Boolean
   361        Function_Return (SigCJProperty(Self, Get_Private_pbRightToLeft, Get_ComRightToLeft ))
   362    End_Function
   363
   364    //-------------------------------------------------------------------------
   365
   366    { MethodType=Property Category="CodeJock" InitialValue=False }
   367    Procedure Set pbUseMnemonic Boolean bState
   368        Set SigCJProperty Set_Private_pbUseMnemonic Set_ComUseMnemonic to bState
   369    End_Procedure
   370
   371    Function pbUseMnemonic Returns Boolean
   372        Function_Return (SigCJProperty(Self, Get_Private_pbUseMnemonic, Get_ComUseMnemonic ))
   373    End_Function
   374
   375    //-------------------------------------------------------------------------
   376
   377    { MethodType=Property Category="CodeJock" InitialValue=False }
   378    Procedure Set pbWordWrap Boolean bState
   379        Set SigCJProperty Set_Private_pbWordWrap Set_ComWordWrap to bState
   380    End_Procedure
   381
   382    Function pbWordWrap Returns Boolean
   383        Function_Return (SigCJProperty(Self, Get_Private_pbWordWrap, Get_ComWordWrap ))
   384    End_Function
   385
   386    //-------------------------------------------------------------------------
   387
   388End_Class
   389
   390//==============================================================================
   391//End of Package - cSigCJLabel.pkg
   392//==============================================================================
   393