Module: _checkbx      Library: Clipper 5.3


This module contains the following functions and procedures:



Note: Because this is raw decompiler output, the code is closer
to that seen in a .PPO file, rather than a .PRG file. In other
words, you must allow for the preprocessor conversions normally 
performed based on the contents of STD.CH and other .CH files
 
#include "common.ch"
#include "inkey.ch"

//-----------------------------------------------------------------
//  file-wide static variables
//
static Static1

//---------------------------------------------------[top]-
//  CHECKBOX( Arg1, Arg2, Arg3 )
//
function CHECKBOX( Arg1, Arg2, Arg3 )

   local Local1, Local2, Local3 := array(2)
   if ( !( ISNUMBER( Arg1 ) ) )
      Local1 := Nil
   elseif ( !( ISNUMBER( Arg2 ) ) )
      Local1 := Nil
   else
      if ( ValType(Static1) != "N" )
         Static1 := define()
      endif
      if ( !( ISCHARACTER( Arg3 ) ) )
         Arg3 := ""
      endif
      Local1 := __classins(Static1)
      Local1[ 1 ] := .F.
      Local1[ 2 ] := Arg3
      Local1[ 3 ] := Arg2 + 3 + 1
      Local1[ 4 ] := Arg1
      Local1[ 5 ] := Nil
      Local1[ 6 ] := Arg2
      if ( isdefcolor() )
         Local1[ 7 ] := "W/N,W+/N,W/N,W+/N"
      else
         Local2 := SetColor()
         Local1[ 7 ] := __guicolor(Local2, 5) + "," + ;
            __guicolor(Local2, 2) + "," + __guicolor(Local2, 1) + ;
            "," + __guicolor(Local2, 4)
      endif
      Local1[ 8 ] := Nil
      Local1[ 9 ] := .F.
      Local1[ 10 ] := ""
      Local1[ 11 ] := Arg1
      Local1[ 13 ] := Nil
      Local1[ 14 ] := "[ ]"
      Local3[ 1 ] := "CHECK_F.BMU"
      Local3[ 2 ] := "CHECK_E.BMU"
      Local1[ 15 ] := Local3
   endif
   return Local1

//---------------------------------------------------[top]-
//  DEFINE
//
static function DEFINE

   local Local1 := __classnew("CHECKBOX", 15)
   __classadd(Local1, "Display", "__cbDisplay")
   __classadd(Local1, "HitTest", "__cbHitTest")
   __classadd(Local1, "KillFocus", "__cbKillFocus")
   __classadd(Local1, "Select", "__cbSelect")
   __classadd(Local1, "SetFocus", "__cbSetFocus")
   __classadd(Local1, "Bitmaps", "__cbBitmaps")
   __classadd(Local1, "_Bitmaps", "__cbBitmaps")
   __classadd(Local1, "Buffer", "__cbBuffer")
   __classadd(Local1, "_Buffer", "__cbBuffer")
   __classadd(Local1, "CapCol", "__cbCapCol")
   __classadd(Local1, "_CapCol", "__cbCapCol")
   __classadd(Local1, "CapRow", "__cbCapRow")
   __classadd(Local1, "_CapRow", "__cbCapRow")
   __classadd(Local1, "Caption", "__cbCaption")
   __classadd(Local1, "_Caption", "__cbCaption")
   __classadd(Local1, "Cargo", "__cbCargo")
   __classadd(Local1, "_Cargo", "__cbCargo")
   __classadd(Local1, "Col", "__cbCol")
   __classadd(Local1, "_Col", "__cbCol")
   __classadd(Local1, "ColorSpec", "__cbColorSpec")
   __classadd(Local1, "_ColorSpec", "__cbColorSpec")
   __classadd(Local1, "fBlock", "__cbfBlock")
   __classadd(Local1, "_fBlock", "__cbfBlock")
   __classadd(Local1, "HasFocus", "__cbHasFocus")
   __classadd(Local1, "_HasFocus", "__cbHasFocus")
   __classadd(Local1, "Message", "__cbMessage")
   __classadd(Local1, "_Message", "__cbMessage")
   __classadd(Local1, "Row", "__cbRow")
   __classadd(Local1, "_Row", "__cbRow")
   __classadd(Local1, "sBlock", "__cbsBlock")
   __classadd(Local1, "_sBlock", "__cbsBlock")
   __classadd(Local1, "Style", "__cbStyle")
   __classadd(Local1, "_Style", "__cbStyle")
   __classadd(Local1, "TypeOut", "__cbTypeOut")
   __classadd(Local1, "_TypeOut", "__cbTypeOut")
   return Local1

//---------------------------------------------------[top]-
//  __CBBITMAP( Arg1 )
//
function __CBBITMAP( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 15 ] := _einstvar(qself(), "BITMAPS", Arg1, "A", 1001)
   endif
   return qself()[ 15 ]

//---------------------------------------------------[top]-
//  __CBBUFFER
//
function __CBBUFFER

   return qself()[ 1 ]

//---------------------------------------------------[top]-
//  __CBCAPCOL( Arg1 )
//
function __CBCAPCOL( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 3 ] := _einstvar(qself(), "CAPCOL", Arg1, "N", 1001)
   endif
   return qself()[ 3 ]

//---------------------------------------------------[top]-
//  __CBCAPROW( Arg1 )
//
function __CBCAPROW( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 4 ] := _einstvar(qself(), "CAPROW", Arg1, "N", 1001)
   endif
   return qself()[ 4 ]

//---------------------------------------------------[top]-
//  __CBCAPTIO( Arg1 )
//
function __CBCAPTIO( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 2 ] := _einstvar(qself(), "CAPTION", Arg1, "C", 1001)
   endif
   return qself()[ 2 ]

//---------------------------------------------------[top]-
//  __CBCARGO( Arg1 )
//
function __CBCARGO( Arg1 )

   if ( PCount() != 0 )
      qself()[ 5 ] := Arg1
   endif
   return qself()[ 5 ]

//---------------------------------------------------[top]-
//  __CBCOL( Arg1 )
//
function __CBCOL( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 6 ] := _einstvar(qself(), "COL", Arg1, "N", 1001)
   endif
   return qself()[ 6 ]

//---------------------------------------------------[top]-
//  __CBCOLORS( Arg1 )
//
function __CBCOLORS( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 7 ] := _einstvar(qself(), "COLORSPEC", Arg1, "C", ;
         1001, { |_1, _2| !Empty(__guicolor(Arg1, 4)) .AND. ;
         Empty(__guicolor(Arg1, 5)) })
   endif
   return qself()[ 7 ]

//---------------------------------------------------[top]-
//  __CBDISPLA
//
function __CBDISPLA

   local Local1 := SetColor(), Local2:= Row(), Local3:= Col(), ;
      Local4 := qself()[ 14 ], Local5, Local6, Local7, Local8, ;
      Local9 := msetcursor(.F.)
   dispbegin()
   if ( qself()[ 9 ] )
      set color to (__guicolor(qself()[ 7 ], 2))
   else
      set color to (__guicolor(qself()[ 7 ], 1))
   endif
   if ( !_isgraphic() )
      SetPos(qself()[ 11 ], qself()[ 6 ] + 1)
      if ( qself()[ 1 ] )
         ?? SubStr(Local4, 2, 1)
      else
         ?? SubStr(Local4, 3, 1)
      endif
      set color to (__guicolor(qself()[ 7 ], 3))
      SetPos(qself()[ 11 ], qself()[ 6 ])
      ?? Left(Local4, 1)
      SetPos(qself()[ 11 ], qself()[ 6 ] + 2)
      ?? right(Local4, 1)
   else
      Local7 := qself()[ 15 ]
      if ( qself()[ 1 ] )
         Local8 := gbmpload(Local7[ 1 ])
      else
         Local8 := gbmpload(Local7[ 2 ])
      endif
      if ( ISNIL( Local8 ) )
      elseif ( !( ISNIL( Local8[ 1 ] ) ) .AND. !( ISNIL( Local8[ 2 ] ;
            ) ) )
         gbmpdisp(Local8, ( qself()[ 6 ] + 1 ) * 8, qself()[ 11 ] * ;
            gmode()[ 5 ])
      endif
   endif
   if ( !Empty(Local5 := qself()[ 2 ]) )
      if ( ( Local6 := At("&", Local5) ) == 0 )
      elseif ( Local6 == Len(Local5) )
         Local6 := 0
      else
         Local5 := stuff(Local5, Local6, 1, "")
      endif
      SetPos(qself()[ 4 ], qself()[ 3 ])
      ?? Local5
      if ( Local6 != 0 )
         set color to (__guicolor(qself()[ 7 ], 4))
         SetPos(qself()[ 4 ], qself()[ 3 ] + Local6 - 1)
         ?? SubStr(Local5, Local6, 1)
      endif
   endif
   dispend()
   msetcursor(Local9)
   set color to (Local1)
   SetPos(Local2, Local3)
   return qself()

//---------------------------------------------------[top]-
//  __CBFBLOCK( Arg1 )
//
function __CBFBLOCK( Arg1 )

   if ( PCount() == 0 )
   elseif ( ISNIL( Arg1 ) )
      qself()[ 8 ] := Arg1
   else
      qself()[ 8 ] := _einstvar(qself(), "FBLOCK", Arg1, "B", 1001)
   endif
   return qself()[ 8 ]

//---------------------------------------------------[top]-
//  __CBHASFOC
//
function __CBHASFOC

   return qself()[ 9 ]

//---------------------------------------------------[top]-
//  __CBHITTES( Arg1, Arg2 )
//
function __CBHITTES( Arg1, Arg2 )

   local Local1, Local2
   if ( Arg1 != qself()[ 11 ] )
   elseif ( Arg2 < qself()[ 6 ] )
   elseif ( Arg2 < qself()[ 6 ] + 3 )
      return -2049
   endif
   Local2 := Len(qself()[ 2 ])
   if ( ( Local1 := At("&", qself()[ 2 ]) ) == 0 )
   elseif ( Local1 < Local2 )
      Local2--
   endif
   if ( Arg1 != qself()[ 4 ] )
   elseif ( Arg2 < qself()[ 3 ] )
   elseif ( Arg2 < qself()[ 3 ] + Local2 )
      return -1025
   endif
   return 0

//---------------------------------------------------[top]-
//  __CBKILLFO
//
function __CBKILLFO

   if ( qself()[ 9 ] )
      qself()[ 9 ] := .F.
      if ( ISBLOCK( qself()[ 8 ] ) )
         eval(qself()[ 8 ])
      endif
      qself():display()
      setcursor(qself()[ 13 ])
   endif
   return qself()

//---------------------------------------------------[top]-
//  __CBMESSAG( Arg1 )
//
function __CBMESSAG( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 10 ] := _einstvar(qself(), "MESSAGE", Arg1, "C", 1001)
   endif
   return qself()[ 10 ]

//---------------------------------------------------[top]-
//  __CBROW( Arg1 )
//
function __CBROW( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 11 ] := _einstvar(qself(), "ROW", Arg1, "N", 1001)
   endif
   return qself()[ 11 ]

//---------------------------------------------------[top]-
//  __CBSBLOCK( Arg1 )
//
function __CBSBLOCK( Arg1 )

   if ( PCount() == 0 )
   elseif ( ISNIL( Arg1 ) )
      qself()[ 12 ] := Arg1
   else
      qself()[ 12 ] := _einstvar(qself(), "SBLOCK", Arg1, "B", 1001)
   endif
   return qself()[ 12 ]

//---------------------------------------------------[top]-
//  __CBSELECT( Arg1 )
//
function __CBSELECT( Arg1 )

   local Local1 := qself()[ 1 ]
   if ( ISLOGICAL( Arg1 ) )
      qself()[ 1 ] := Arg1
   else
      qself()[ 1 ] := !qself()[ 1 ]
   endif
   if ( Local1 != qself()[ 1 ] .AND. ISBLOCK( ( qself():display(), ;
         qself()[ 12 ] ) ) )
      eval(qself()[ 12 ])
   endif
   return qself()

//---------------------------------------------------[top]-
//  __CBSETFOC
//
function __CBSETFOC

   if ( !qself()[ 9 ] .AND. ISBLOCK( ( qself()[ 13 ] := setcursor(0), ;
         qself()[ 9 ] := .T., qself():display(), qself()[ 8 ] ) ) )
      eval(qself()[ 8 ])
   endif
   return qself()

//---------------------------------------------------[top]-
//  __CBSTYLE( Arg1 )
//
function __CBSTYLE( Arg1 )

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 14 ] := _einstvar(qself(), "STYLE", Arg1, "C", 1001, { ;
         |_1, _2| LTrim(Str(Len(_2))) $ "04" })
   endif
   return qself()[ 14 ]

//---------------------------------------------------[top]-
//  __CBTYPEOU
//
function __CBTYPEOU

   return .F.

//---EOF


Use your Browser's BACK button to return to Function Listings