Module: _mnuitem      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]-
//  DEFINE
//
static function DEFINE

   local Local1 := __classnew("MENUITEM", 12)
   __classadd(Local1, "IsPopUp", "__miIsPopUp")
   __classadd(Local1, "Caption", "__miCaption")
   __classadd(Local1, "_Caption", "__miCaption")
   __classadd(Local1, "Cargo", "__miCargo")
   __classadd(Local1, "_Cargo", "__miCargo")
   __classadd(Local1, "Checked", "__miChecked")
   __classadd(Local1, "_Checked", "__miChecked")
   __classadd(Local1, "Data", "__miData")
   __classadd(Local1, "_Data", "__miData")
   __classadd(Local1, "Enabled", "__miEnabled")
   __classadd(Local1, "_Enabled", "__miEnabled")
   __classadd(Local1, "Id", "__miId")
   __classadd(Local1, "_Id", "__miId")
   __classadd(Local1, "Message", "__miMessage")
   __classadd(Local1, "_Message", "__miMessage")
   __classadd(Local1, "ShortCut", "__miShortCut")
   __classadd(Local1, "_ShortCut", "__miShortCut")
   __classadd(Local1, "Style", "__miStyle")
   __classadd(Local1, "_Style", "__miStyle")
   return Local1

//---------------------------------------------------[top]-
//  MENUITEM( Arg1, Arg2, Arg3, Arg4, Arg5 )
//
function MENUITEM( Arg1, Arg2, Arg3, Arg4, Arg5 )

   local Local1, Local2, Local3 := .T.
   if ( ValType(Static1) != "N" )
      Static1 := define()
   endif
   Local2 := __classins(Static1)
   Local2:caption(Arg1)
   if ( Arg1 == "" )
      Arg2 := Nil
      Local3 := .F.
   endif
   if ( ( Local1 := ValType(Arg2) ) == "O" .AND. !( ;
         Local2:classname() == "POPUPMENU" ) )
      Local2[ 5 ] := Arg2
   else
      Local2:data(Arg2)
   endif
   if ( !( ISNUMBER( Arg3 ) ) )
      Arg3 := 0
   endif
   if ( !( ISCHARACTER( Arg4 ) ) )
      Arg4 := ""
   endif
   if ( !( ISNUMBER( Arg5 ) ) )
      Arg5 := 0
   endif
   Local2[ 2 ] := Nil
   Local2[ 3 ] := .F.
   Local2[ 4 ] := -1
   Local2[ 6 ] := Local3
   Local2[ 7 ] := Arg5
   Local2[ 8 ] := Arg4
   Local2[ 9 ] := ""
   Local2[ 10 ] := -1
   Local2[ 11 ] := Arg3
   Local2[ 12 ] := ""
   return Local2

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

   if ( ( qself()[ 1 ] := _einstvar(qself(), "CAPTION", Arg1, "C", ;
         1001), !( ISNIL( Arg1 ) ) .AND. Arg1 == "" ) )
      qself()[ 5 ] := Nil
      qself()[ 3 ] := .F.
      qself()[ 6 ] := .F.
   endif
   return qself()[ 1 ]

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

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

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

   if ( ( qself()[ 3 ] := _einstvar(qself(), "CHECKED", Arg1, "L", ;
         1001), !( ISNIL( Arg1 ) ) .AND. !( qself()[ 1 ] == "" ) ) )
      qself()[ 3 ] := Arg1
   endif
   return qself()[ 3 ]

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

   if ( !( ISOBJECT( Arg1 ) ) )
   elseif ( !( Arg1:classname() == "MENUITEM" ) )
   elseif ( ISNUMBER( Arg2 ) )
      Arg1[ 4 ] := Arg2
   endif
   return Arg1[ 4 ]

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

   local Local1
   if ( ISNIL( Arg1 ) )
   elseif ( ISBLOCK( Arg1 ) )
      qself()[ 5 ] := Arg1
   else
      qself()[ 5 ] := _einstvar(qself(), "DATA", Arg1, "O", 1001, { ;
         |_1, _2| _1:classname() == "POPUPMENU" })
   endif
   return qself()[ 5 ]

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

   if ( !( ISNIL( Arg1 ) ) )
      _einstvar(qself(), "ENABLED", Arg1, "L", 1001)
      if ( !( qself()[ 1 ] == "" ) )
         qself()[ 6 ] := Arg1
      endif
   endif
   return qself()[ 6 ]

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

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

//---------------------------------------------------[top]-
//  __MIISPOPU
//
function __MIISPOPU

   if ( !( ISOBJECT( qself()[ 5 ] ) ) )
   elseif ( qself()[ 5 ]:classname() == "POPUPMENU" )
      return .T.
   endif
   return .F.

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

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

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

   if ( !( ISOBJECT( Arg1 ) ) )
   elseif ( !( Arg1:classname() == "MENUITEM" ) )
   elseif ( ISNUMBER( Arg2 ) )
      Arg1[ 10 ] := Arg2
   endif
   return Arg1[ 10 ]

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

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

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

   if ( !( ISNIL( Arg1 ) ) )
      qself()[ 12 ] := _einstvar(qself(), "STYLE", Arg1, "C", 1001, { ;
         |_1, _2| Len(_2) == 2 })
   endif
   return qself()[ 12 ]

//---EOF


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