Module: _menu 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:= -1, Static2:= -1, Static3:= -1, Static4:= -1, ;
Static5, Static6
//---------------------------------------------------[top]-
// POPUP( Arg1, Arg2, Arg3, Arg4 )
//
function POPUP( Arg1, Arg2, Arg3, Arg4 )
local Local1, Local2
if ( ValType(Static6) != "N" )
Static6 := pudefine()
endif
if ( !( ISNUMBER( Arg1 ) ) )
Arg1 := Nil
endif
if ( !( ISNUMBER( Arg2 ) ) )
Arg2 := Nil
endif
if ( !( ISNUMBER( Arg3 ) ) )
Arg3 := Nil
endif
if ( !( ISNUMBER( Arg4 ) ) )
Arg4 := Nil
endif
Local1 := __classins(Static6)
Local1[ 7 ] := Arg1
Local1[ 8 ] := Arg2
Local1[ 12 ] := Arg3
Local1[ 9 ] := Arg4
if ( isdefcolor() )
Local1[ 1 ] := "N/W,W/N,W+/W,W+/N,N+/W,W/N"
else
Local2 := SetColor()
Local1[ 1 ] := __guicolor(Local2, 5) + "," + __guicolor(Local2, ;
2) + "," + __guicolor(Local2, 4) + "," + __guicolor(Local2, ;
2) + "," + __guicolor(Local2, 1) + "," + __guicolor(Local2, ;
3)
endif
Local1[ 2 ] := 0
Local1[ 3 ] := {}
Local1[ 4 ] := Nil
Local1[ 5 ] := 0
Local1[ 6 ] := 0
Local1[ 10 ] := Nil
Local1[ 11 ] := {}
Local1[ 13 ] := "ÚÄ¿³ÙÄÀ³" + ( "Ã" + "Ä" + "´" )
return Local1
//---------------------------------------------------[top]-
// CAPTIONMET( Arg1 )
//
static function CAPTIONMET( Arg1 )
local Local1 := __caplengt(Arg1:caption()) + 2, Local2
if ( Arg1:ispopup() )
Local1++
endif
return Local1
//---------------------------------------------------[top]-
// PUDEFINE
//
static function PUDEFINE
local Local1 := __classnew("POPUPMENU", 13)
__classadd(Local1, "AddItem", "__mnuAddItem")
__classadd(Local1, "DelItem", "__mnuDelItem")
__classadd(Local1, "GetFirst", "__mnuGetFirst")
__classadd(Local1, "GetItem", "__mnuGetItem")
__classadd(Local1, "GetLast", "__mnuGetLast")
__classadd(Local1, "GetNext", "__mnuGetNext")
__classadd(Local1, "GetPrev", "__mnuGetPrev")
__classadd(Local1, "GetShortCt", "__mnuGetShortCt")
__classadd(Local1, "InsItem", "__mnuInsItem")
__classadd(Local1, "Select", "__mnuSelect")
__classadd(Local1, "SetItem", "__mnuSetItem")
__classadd(Local1, "Close", "__puClose")
__classadd(Local1, "Display", "__puDisplay")
__classadd(Local1, "GetAccel", "__puGetAccel")
__classadd(Local1, "HitTest", "__puHitTest")
__classadd(Local1, "IsOpen", "__puIsOpen")
__classadd(Local1, "Open", "__puOpen")
__classadd(Local1, "Bottom", "__puBottom")
__classadd(Local1, "_Bottom", "__puBottom")
__classadd(Local1, "Top", "__mnuTop")
__classadd(Local1, "_Top", "__mnuTop")
__classadd(Local1, "Width", "__puWidth")
__classadd(Local1, "_Width", "__puWidth")
__classadd(Local1, "Border", "__puBorder")
__classadd(Local1, "_Border", "__puBorder")
__classadd(Local1, "Left", "__mnuLeft")
__classadd(Local1, "_Left", "__mnuLeft")
__classadd(Local1, "Right", "__mnuRight")
__classadd(Local1, "_Right", "__mnuRight")
__classadd(Local1, "Cargo", "__mnuCargo")
__classadd(Local1, "_Cargo", "__mnuCargo")
__classadd(Local1, "ColorSpec", "__mnuColorSpec")
__classadd(Local1, "_ColorSpec", "__mnuColorSpec")
__classadd(Local1, "Current", "__mnuCurrent")
__classadd(Local1, "_Current", "__mnuCurrent")
__classadd(Local1, "ItemCount", "__mnuItemCount")
__classadd(Local1, "_ItemCount", "__mnuItemCount")
return Local1
//---------------------------------------------------[top]-
// SETMETRICS( Arg1 )
//
static function SETMETRICS( Arg1 )
if ( !( ISNIL( Arg1[ 7 ] ) ) )
elseif ( ISNIL( Arg1[ 12 ] ) )
Arg1[ 7 ] := Int(( MaxRow() - ( Arg1[ 2 ] + 2 ) ) / 2)
else
Arg1[ 7 ] := Arg1[ 12 ] - Arg1[ 2 ] - 1
endif
if ( !( ISNIL( Arg1[ 8 ] ) ) )
elseif ( ISNIL( Arg1[ 9 ] ) )
Arg1[ 8 ] := Int(( MaxCol() - ( Arg1[ 6 ] + 2 ) ) / 2)
else
Arg1[ 8 ] := Arg1[ 9 ] - Arg1[ 6 ] - 1
endif
Arg1[ 12 ] := Arg1[ 7 ] + Arg1[ 2 ] + 1
Arg1[ 9 ] := Arg1[ 8 ] + Arg1[ 6 ] + 1
return Arg1
//---------------------------------------------------[top]-
// TBDEFINE
//
static function TBDEFINE
local Local1 := __classnew("TOPBARMENU", 11)
__classadd(Local1, "AddItem", "__mnuAddItem")
__classadd(Local1, "DelItem", "__mnuDelItem")
__classadd(Local1, "GetFirst", "__mnuGetFirst")
__classadd(Local1, "GetItem", "__mnuGetItem")
__classadd(Local1, "GetLast", "__mnuGetLast")
__classadd(Local1, "GetNext", "__mnuGetNext")
__classadd(Local1, "GetPrev", "__mnuGetPrev")
__classadd(Local1, "GetShortCt", "__mnuGetShortCt")
__classadd(Local1, "InsItem", "__mnuInsItem")
__classadd(Local1, "Select", "__mnuSelect")
__classadd(Local1, "SetItem", "__mnuSetItem")
__classadd(Local1, "Display", "__tbmDisplay")
__classadd(Local1, "GetAccel", "__tbmGetAccel")
__classadd(Local1, "HitTest", "__tbmHitTest")
__classadd(Local1, "Row", "__mnuTop")
__classadd(Local1, "_Row", "__mnuTop")
__classadd(Local1, "Left", "__mnuLeft")
__classadd(Local1, "_Left", "__mnuLeft")
__classadd(Local1, "Right", "__mnuRight")
__classadd(Local1, "_Right", "__mnuRight")
__classadd(Local1, "Cargo", "__mnuCargo")
__classadd(Local1, "_Cargo", "__mnuCargo")
__classadd(Local1, "ColorSpec", "__mnuColorSpec")
__classadd(Local1, "_ColorSpec", "__mnuColorSpec")
__classadd(Local1, "Current", "__mnuCurrent")
__classadd(Local1, "_Current", "__mnuCurrent")
__classadd(Local1, "ItemCount", "__mnuItemCount")
__classadd(Local1, "_ItemCount", "__mnuItemCount")
return Local1
//---------------------------------------------------[top]-
// TOPBAR( Arg1, Arg2, Arg3 )
//
function TOPBAR( Arg1, Arg2, Arg3 )
local Local1, Local2
if ( !( ISNUMBER( Arg1 ) ) )
Local1 := Nil
elseif ( !( ISNUMBER( Arg2 ) ) )
Local1 := Nil
elseif ( !( ISNUMBER( Arg3 ) ) )
Local1 := Nil
else
if ( ValType(Static5) != "N" )
Static5 := tbdefine()
endif
Local1 := __classins(Static5)
Local1[ 7 ] := Arg1
Local1[ 8 ] := Arg2
Local1[ 9 ] := Arg3
if ( isdefcolor() )
Local1[ 1 ] := "N/W,W/N,W+/W,W+/N,N+/W,W/N"
else
Local2 := SetColor()
Local1[ 1 ] := __guicolor(Local2, 5) + "," + ;
__guicolor(Local2, 2) + "," + __guicolor(Local2, 4) + ;
"," + __guicolor(Local2, 2) + "," + __guicolor(Local2, ;
1) + "," + __guicolor(Local2, 3)
endif
Local1[ 2 ] := 0
Local1[ 3 ] := {}
Local1[ 4 ] := Nil
Local1[ 5 ] := 0
Local1[ 10 ] := Nil
Local1[ 6 ] := 0
Local1[ 11 ] := {}
endif
return Local1
//---------------------------------------------------[top]-
// __MNUADDIT( Arg1 )
//
function __MNUADDIT( Arg1 )
local Local1
if ( !( ISOBJECT( Arg1 ) ) )
elseif ( Arg1:classname() == "MENUITEM" )
qself()[ 2 ]++
AAdd(qself()[ 3 ], Arg1)
qself()[ 6 ] := Max(captionmet(Arg1), qself()[ 6 ])
endif
return qself()
//---------------------------------------------------[top]-
// __MNUCARGO( Arg1 )
//
function __MNUCARGO( Arg1 )
if ( PCount() != 0 )
qself()[ 4 ] := Arg1
endif
return qself()[ 4 ]
//---------------------------------------------------[top]-
// __MNUCOLOR( Arg1 )
//
function __MNUCOLOR( Arg1 )
if ( !( ISNIL( Arg1 ) ) )
qself()[ 1 ] := _einstvar(qself(), "COLORSPEC", Arg1, "C", ;
1001, { |_1, _2| !Empty(__guicolor(Arg1, 6)) .AND. ;
Empty(__guicolor(Arg1, 7)) })
endif
return qself()[ 1 ]
//---------------------------------------------------[top]-
// __MNUCURRE
//
function __MNUCURRE
return qself()[ 5 ]
//---------------------------------------------------[top]-
// __MNUDELIT( Arg1 )
//
function __MNUDELIT( Arg1 )
local Local1, Local2, Local3, Local4, Local5
if ( Arg1 < 1 )
elseif ( Arg1 <= qself()[ 2 ] )
Local1 := Len(qself()[ 3 ][ Arg1 ]:caption())
adel(qself()[ 3 ], Arg1)
asize(qself()[ 3 ], --qself()[ 2 ])
if ( Local1 + 2 == qself()[ 6 ] )
Local2 := qself()[ 3 ]
Local4 := qself()[ 2 ]
Local5 := 0
for Local3 := 1 to Local4
Local5 := Max(captionmet(Local2[ Local3 ]), Local5)
next
qself()[ 6 ] := Local5
endif
endif
return qself()
//---------------------------------------------------[top]-
// __MNUGETFI
//
function __MNUGETFI
local Local1, Local2 := qself()[ 3 ], Local3:= qself()[ 2 ]
for Local1 := 1 to Local3
if ( Local2[ Local1 ]:enabled() )
exit
endif
next
if ( Local1 > Local3 )
Local1 := 0
endif
return Local1
//---------------------------------------------------[top]-
// __MNUGETIT( Arg1 )
//
function __MNUGETIT( Arg1 )
if ( Arg1 < 1 )
elseif ( Arg1 <= qself()[ 2 ] )
return qself()[ 3 ][ Arg1 ]
endif
return Nil
//---------------------------------------------------[top]-
// __MNUGETLA
//
function __MNUGETLA
local Local1, Local2 := qself()[ 3 ], Local3
for Local1 := qself()[ 2 ] to 1 step -1
if ( Local2[ Local1 ]:enabled() )
exit
endif
next
return Local1
//---------------------------------------------------[top]-
// __MNUGETNE
//
function __MNUGETNE
local Local1, Local2, Local3 := qself()[ 3 ], Local4
Local1 := qself()[ 5 ]
Local4 := qself()[ 2 ]
Local2 := Local1 + 1
do while ( Local2 != Local1 )
if ( Local2 > Local4 )
Local2 := 0
exit
endif
if ( Local3[ Local2 ]:enabled() )
exit
endif
Local2++
enddo
return Local2
//---------------------------------------------------[top]-
// __MNUGETPR
//
function __MNUGETPR
local Local1, Local2, Local3 := qself()[ 3 ]
Local1 := qself()[ 5 ]
Local2 := Local1 - 1
do while ( Local2 != Local1 )
if ( Local2 <= 0 )
Local2 := 0
exit
endif
if ( Local3[ Local2 ]:enabled() )
exit
endif
Local2--
enddo
return Local2
//---------------------------------------------------[top]-
// __MNUGETSH( Arg1 )
//
function __MNUGETSH( Arg1 )
local Local1, Local2 := qself()[ 2 ], Local3:= qself()[ 3 ], ;
Local4, Local5
for Local1 := 1 to Local2
if ( Arg1 == Local3[ Local1 ]:shortcut() )
return Local1
endif
next
return 0
//---------------------------------------------------[top]-
// __MNUINSIT( Arg1, Arg2 )
//
function __MNUINSIT( Arg1, Arg2 )
local Local1, Local2
do case
case Arg1 < 1
case Arg1 > qself()[ 2 ]
case !( ISOBJECT( Arg2 ) )
_einstvar(qself(), "INSITEM", Arg2, "B", 1001)
case Arg2:classname() == "MENUITEM"
asize(qself()[ 3 ], ++qself()[ 2 ])
ains(qself()[ 3 ], Arg1)
qself()[ 3 ][ Arg1 ] := Arg2
qself()[ 6 ] := Max(captionmet(Arg2), qself()[ 6 ])
endcase
return qself()
//---------------------------------------------------[top]-
// __MNUITEMC( Arg1 )
//
function __MNUITEMC( Arg1 )
return qself()[ 2 ]
//---------------------------------------------------[top]-
// __MNULEFT( Arg1 )
//
function __MNULEFT( Arg1 )
if ( !( ISNIL( Arg1 ) ) )
qself()[ 8 ] := _einstvar(qself(), "LEFT", Arg1, "N", 1001)
endif
return qself()[ 8 ]
//---------------------------------------------------[top]-
// __MNURIGHT( Arg1 )
//
function __MNURIGHT( Arg1 )
if ( !( ISNIL( Arg1 ) ) )
qself()[ 9 ] := _einstvar(qself(), "RIGHT", Arg1, "N", 1001)
endif
return qself()[ 9 ]
//---------------------------------------------------[top]-
// __MNUSELEC( Arg1 )
//
function __MNUSELEC( Arg1 )
do case
case Arg1 == qself()[ 5 ]
return qself()
case Arg1 < 0
return qself()
case Arg1 == 0
case Arg1 > qself()[ 2 ]
return qself()
case !qself()[ 3 ][ Arg1 ]:enabled()
return qself()
endcase
if ( qself()[ 10 ] != Nil )
if ( qself()[ 5 ] == 0 )
elseif ( qself()[ 3 ][ qself()[ 5 ] ]:ispopup() )
qself()[ 3 ][ qself()[ 5 ] ]:data():close()
endif
endif
qself()[ 5 ] := Arg1
return qself()
//---------------------------------------------------[top]-
// __MNUSETIT( Arg1, Arg2 )
//
function __MNUSETIT( Arg1, Arg2 )
local Local1
do case
case Arg1 < 1
case Arg1 > qself()[ 2 ]
case !( ISOBJECT( Arg2 ) )
_einstvar(qself(), "SETITEM", Arg2, "B", 1001)
case Arg2:classname() == "MENUITEM"
qself()[ 3 ][ Arg1 ] := Arg2
qself()[ 6 ] := Max(captionmet(Arg2), qself()[ 6 ])
endcase
return Nil
//---------------------------------------------------[top]-
// __MNUTOP( Arg1 )
//
function __MNUTOP( Arg1 )
if ( !( ISNIL( Arg1 ) ) )
qself()[ 7 ] := _einstvar(qself(), "TOP", Arg1, "N", 1001)
endif
return qself()[ 7 ]
//---------------------------------------------------[top]-
// __PUBORDER( Arg1 )
//
function __PUBORDER( Arg1 )
local Local1
if ( !( ISNIL( Arg1 ) ) )
qself()[ 13 ] := _einstvar(qself(), "BORDER", Arg1, "C", 1001, ;
{ |_1, _2| Len(_2) == 0 .OR. Len(_2) == 11 })
endif
return qself()[ 13 ]
//---------------------------------------------------[top]-
// __PUBOTTOM( Arg1 )
//
function __PUBOTTOM( Arg1 )
if ( !( ISNIL( Arg1 ) ) )
qself()[ 12 ] := _einstvar(qself(), "BOTTOM", Arg1, "N", 1001)
endif
return qself()[ 12 ]
//---------------------------------------------------[top]-
// __PUCLOSE
//
function __PUCLOSE
local Local1, Local2, Local3, Local4, Local5, Local6, Local7, ;
Local8, Local9, Local10, Local11, Local12, Local13, Local14, ;
Local15, Local16, Local17, Local18, Local19, Local20, Local21, ;
Local22, Local23, Local24, Local25, Local26, Local27, Local28, ;
Local29, Local30, Local31, Local32
if ( !qself():isopen() )
return qself()
endif
setmetrics(qself())
Local20 := _isgraphic()
if ( qself()[ 5 ] == 0 )
elseif ( !qself()[ 3 ][ qself()[ 5 ] ]:ispopup() )
elseif ( qself()[ 3 ][ qself()[ 5 ] ]:data():isopen() )
Local1 := qself()[ 3 ][ qself()[ 5 ] ]:data()
Local1:close()
endif
if ( !Local20 )
Local2 := qself()[ 10 ]
RestScreen(Asc(SubStr(Local2, 1, 1)), Asc(SubStr(Local2, 2, ;
1)), Asc(SubStr(Local2, 3, 1)), Asc(SubStr(Local2, 4, 1)), ;
SubStr(qself()[ 10 ], 5))
else
Local32 := Len(qself()[ 10 ])
Local28 := qself()[ 10 ][ Local32 - 3 ]
Local29 := qself()[ 10 ][ Local32 - 2 ]
Local30 := qself()[ 10 ][ Local32 - 1 ]
Local31 := qself()[ 10 ][ Local32 ]
adel(qself()[ 10 ], Local32)
adel(qself()[ 10 ], Local32 - 1)
adel(qself()[ 10 ], Local32 - 2)
adel(qself()[ 10 ], Local32 - 3)
RestScreen(Local28, Local29, Local30, Local31, qself()[ 10 ])
endif
qself()[ 10 ] := Nil
qself()[ 5 ] := 0
return qself()
//---------------------------------------------------[top]-
// __PUDISPLA
//
function __PUDISPLA
local Local1, Local2, Local3, Local4, Local5, Local6, Local7, ;
Local8, Local9, Local10, Local11, Local12, Local13, Local14, ;
Local15, Local16, Local17, Local18, Local19, Local20, Local21, ;
Local22, Local23, Local24, Local25, Local26, Local27, Local28, ;
Local29, Local30, Local31, Local32, Local33, Local34, Local35, ;
Local36
if ( qself():isopen() )
Local27 := _isgraphic()
setmetrics(qself())
Local4 := qself()[ 7 ]
Local5 := qself()[ 8 ]
Local6 := qself()[ 3 ]
Local7 := qself()[ 2 ]
Local8 := qself()[ 5 ]
Local9 := qself()[ 2 ]
Local10 := qself()[ 6 ]
Local20 := SubStr(qself()[ 13 ], 1, 8)
Local21 := SubStr(qself()[ 13 ], 9, 1)
Local22 := SubStr(qself()[ 13 ], 11, 1)
Local23 := SubStr(qself()[ 13 ], 10, 1)
Local11 := __guicolor(qself()[ 1 ], 1)
Local12 := __guicolor(qself()[ 1 ], 2)
Local13 := __guicolor(qself()[ 1 ], 3)
Local14 := __guicolor(qself()[ 1 ], 4)
Local15 := __guicolor(qself()[ 1 ], 5)
if ( Local27 )
Local31 := _getnumcol(Local11)
Local30 := _getnumcol(Local12)
Local32 := _getnumcol(Local13)
Local33 := _getnumcol(Local14)
Local34 := _getnumcol(Local15)
Local28 := At("/", Local11)
Local25 := _getnumcol(SubStr(Local11, Local28 + 1, ;
Len(Local11) - Local28))
Local28 := At("/", Local12)
Local29 := _getnumcol(SubStr(Local12, Local28 + 1, ;
Len(Local12) - Local28))
endif
Local2 := Row()
Local3 := Col()
Local1 := SetColor()
Local35 := msetcursor(.F.)
dispbegin()
set color to (__guicolor(qself()[ 1 ], 6))
Local31 := _getnumcol(Local11)
if ( !_isgraphic() )
@ Local4, Local5, qself()[ 12 ], qself()[ 9 ] box Local20 + ;
" "
else
Local36 := gmode()[ 5 ]
grect(Local5 * 8, Local4 * Local36 + 2, qself()[ 9 ] * 8, ;
qself()[ 12 ] * Local36, .T., Local25, -1)
endif
Local5++
for Local16 := 1 to Local9
Local4++
if ( Local6[ Local16 ]:caption() == "Ä" )
if ( !_isgraphic() )
set color to (__guicolor(qself()[ 1 ], 6))
SetPos(Local4, Local5 - 1)
?? Local21 + Replicate(Local23, Local10) + Local22
loop
else
gline(( Local5 - 1 ) * 8 + 1, Local4 * 16 + 8, ( ;
Local5 + Local10 ) * 8 - 1, Local4 * 16 + 8, ;
Local31, -1)
Local36 := gmode()[ 5 ]
gline(( Local5 - 1 ) * 8 + 1, Local4 * Local36 + 8, ( ;
Local5 + Local10 ) * 8 - 1, Local4 * Local36 + 8, ;
Local31, -1)
endif
else
Local17 := padr(Local6[ Local16 ]:caption(), Local10 - 1)
if ( Local6[ Local16 ]:checked() )
Local17 := SubStr(Local6[ Local16 ]:style(), 1, 1) + ;
Local17
else
Local17 := " " + Local17
endif
if ( Local6[ Local16 ]:ispopup() )
Local19 := Local6[ Local16 ]:data()
Local19:top(Local4)
Local19:left(qself()[ 9 ] + 1)
Local19:bottom(Nil)
Local19:right(Nil)
Local17 := Local17 + SubStr(Local6[ Local16 ]:style(), ;
2, 1)
else
Local17 := Local17 + " "
endif
__mirow(Local6[ Local16 ], Local4)
__micolumn(Local6[ Local16 ], Local5)
if ( Local16 == Local8 )
set color to (Local12)
elseif ( !Local6[ Local16 ]:enabled() )
set color to (Local15)
else
set color to (Local11)
endif
if ( ( Local18 := At("&", Local17) ) == 0 )
if ( ( Local24 := ;
rat(SubStr(Local6[ Local16 ]:style(), 2, 1), ;
Local17) ) != 0 )
Local17 := stuff(Local17, Local24 - 1, 1, "")
else
Local17 := SubStr(Local17, 1, Len(Local17) - 1)
endif
elseif ( Local18 == Len(Trim(Local17)) )
Local17 := SubStr(Local17, 1, Len(Local17) - 1)
Local18 := 0
else
Local17 := stuff(Local17, Local18, 1, "")
endif
if ( !Local27 )
SetPos(Local4, Local5)
?? Local17
else
if ( Local16 == Static2 )
grect(( Local5 - 1 ) * 8, Local4 * 16, ( Local5 + ;
Len(Local17) ) * 8, ( Local4 + 1 ) * 16, .T., ;
Local25, -1)
endif
if ( Local16 == Local8 )
grect(( Local5 - 1 ) * 8, Local4 * 16, ( Local5 + ;
Len(Local17) ) * 8, ( Local4 + 1 ) * 16, .T., ;
Local29, -1)
endif
if ( Local16 == Local8 )
gwriteat(Local5 * 8, Local4 * 16, Local17, ;
Local30, -1)
elseif ( Local16 == Static2 )
gwriteat(Local5 * 8, Local4 * 16, Local17, ;
Local31, -1)
else
if ( !Local6[ Local16 ]:enabled() )
Local26 := Local34
else
Local26 := Local31
endif
gwriteat(Local5 * 8, Local4 * 16, Local17, ;
Local26, -1)
endif
Local36 := gmode()[ 5 ]
if ( Local16 == Static2 )
grect(( Local5 - 1 ) * 8, Local4 * Local36, ( ;
Local5 + Len(Local17) ) * 8, ( Local4 + 1 ) * ;
Local36, .T., Local25, -1)
endif
if ( Local16 == Local8 )
grect(( Local5 - 1 ) * 8, Local4 * Local36, ( ;
Local5 + Len(Local17) ) * 8, ( Local4 + 1 ) * ;
Local36, .T., Local29, -1)
endif
if ( Local16 == Local8 )
gwriteat(Local5 * 8, Local4 * Local36, Local17, ;
Local30, -1)
elseif ( Local16 == Static2 )
gwriteat(Local5 * 8, Local4 * Local36, Local17, ;
Local31, -1)
else
if ( !Local6[ Local16 ]:enabled() )
Local26 := Local34
else
Local26 := Local31
endif
gwriteat(Local5 * 8, Local4 * Local36, Local17, ;
Local26, -1)
endif
endif
if ( !Local6[ Local16 ]:enabled() )
elseif ( Local18 != 0 )
if ( !Local27 )
if ( Local16 == Local8 )
set color to (Local14)
else
set color to (Local13)
endif
SetPos(Local4, Local5 + Local18 - 1)
?? SubStr(Local17, Local18, 1)
elseif ( Local16 == Local8 )
Local36 := gmode()[ 5 ]
gwriteat(( Local5 + Local18 - 1 ) * 8, Local4 * ;
Local36, SubStr(Local17, Local18, 1), Local33, ;
-1)
elseif ( Local16 == Static2 )
Local36 := gmode()[ 5 ]
gwriteat(( Local5 + Local18 - 1 ) * 8, Local4 * ;
Local36, SubStr(Local17, Local18, 1), Local32, ;
-1)
else
Local36 := gmode()[ 5 ]
gwriteat(( Local5 + Local18 - 1 ) * 8, Local4 * ;
Local36, SubStr(Local17, Local18, 1), Local32, ;
-1)
endif
endif
endif
next
dispend()
msetcursor(Local35)
Static2 := Local8
Static3 := Local5
set color to (Local1)
SetPos(Local2, Local3)
endif
Static1 := qself()[ 8 ]
return qself()
//---------------------------------------------------[top]-
// __PUGETACC( Arg1 )
//
function __PUGETACC( Arg1 )
local Local1, Local2, Local3, Local4, Local5
if ( ISNUMBER( Arg1 ) )
Arg1 := Chr(Arg1)
endif
Arg1 := Lower(Arg1)
Local2 := qself()[ 2 ]
Local3 := qself()[ 3 ]
for Local1 := 1 to Local2
Local5 := Local3[ Local1 ]:caption()
if ( ( Local4 := At("&", Local5) ) == 0 )
elseif ( Local4 == Len(Local5) )
elseif ( Arg1 == Lower(SubStr(Local5, Local4 + 1, 1)) )
return Local1
endif
next
return 0
//---------------------------------------------------[top]-
// __PUHITTES( Arg1, Arg2 )
//
function __PUHITTES( Arg1, Arg2 )
local Local1, Local2
setmetrics(qself())
do case
case Arg1 == qself()[ 7 ]
if ( Arg2 == qself()[ 8 ] )
return -1
elseif ( Arg2 == qself()[ 9 ] )
return -3
elseif ( Arg2 >= qself()[ 8 ] .AND. Arg2 <= qself()[ 9 ] )
return -2
endif
case Arg1 == qself()[ 12 ]
if ( Arg2 == qself()[ 8 ] )
return -7
elseif ( Arg2 == qself()[ 9 ] )
return -5
elseif ( Arg2 >= qself()[ 8 ] .AND. Arg2 <= qself()[ 9 ] )
return -6
endif
case Arg2 == qself()[ 8 ]
if ( Arg1 >= qself()[ 7 ] .AND. Arg1 <= qself()[ 12 ] )
return -8
else
return 0
endif
case Arg2 == qself()[ 9 ]
if ( Arg1 >= qself()[ 7 ] .AND. Arg1 <= qself()[ 12 ] )
return -4
else
return 0
endif
case Arg1 <= qself()[ 7 ]
case Arg1 >= qself()[ 12 ]
case Arg2 <= qself()[ 8 ]
case Arg2 < qself()[ 9 ]
Local2 := Arg1 - qself()[ 7 ]
Local1 := qself()[ 3 ][ Local2 ]
if ( Local1:caption() == "Ä" )
return -4098
else
return Local2
endif
endcase
return 0
//---------------------------------------------------[top]-
// __PUISOPEN
//
function __PUISOPEN
return qself()[ 10 ] != Nil
//---------------------------------------------------[top]-
// __PUOPEN
//
function __PUOPEN
local Local1, Local2, Local3, Local4, Local5
setmetrics(qself())
Local1 := qself()[ 7 ]
Local2 := qself()[ 8 ]
if ( ( Local3 := qself()[ 12 ] ) < 0 )
Local3 := Local1 + qself()[ 2 ] + 1
endif
if ( ( Local4 := qself()[ 9 ] ) < 0 )
Local4 := Local2 + qself()[ 6 ] + 1
endif
if ( Local4 < 0 .OR. Local4 > MaxCol() )
qself()[ 8 ] := MaxCol() - qself()[ 6 ] - 1
qself()[ 9 ] := MaxCol()
qself()[ 7 ] := qself()[ 7 ] + 1
qself()[ 12 ] := qself()[ 12 ] + 1
Local2 := qself()[ 8 ]
Local4 := qself()[ 9 ]
Local1 := qself()[ 7 ]
Local3 := qself()[ 12 ]
endif
if ( !_isgraphic() )
qself()[ 10 ] := Chr(Local1) + Chr(Local2) + Chr(Local3) + ;
Chr(Local4) + SaveScreen(Local1, Local2, Local3, Local4)
else
qself()[ 10 ] := SaveScreen(Local1, Local2, Local3, Local4)
AAdd(qself()[ 10 ], Local1)
AAdd(qself()[ 10 ], Local2)
AAdd(qself()[ 10 ], Local3)
AAdd(qself()[ 10 ], Local4)
endif
qself():display()
return qself()
//---------------------------------------------------[top]-
// __PUWIDTH
//
function __PUWIDTH
return qself()[ 6 ]
//---------------------------------------------------[top]-
// __TBMDISPL
//
function __TBMDISPL
local Local1, Local2, Local3, Local4, Local5, Local6, Local7, ;
Local8, Local9, Local10, Local11, Local12, Local13, Local14, ;
Local15, Local16, Local17, Local18, Local19, Local20 := ;
_isgraphic(), Local21, Local22, Local23, Local24, Local25, ;
Local26, Local27, Local28, Local29, Local30, Local31, Local32
Local4 := qself()[ 7 ]
Local5 := qself()[ 8 ]
Local17 := qself()[ 9 ]
Local16 := qself()[ 3 ]
Local15 := qself()[ 2 ]
Local19 := qself()[ 5 ]
Local2 := Row()
Local3 := Col()
Local11 := __guicolor(qself()[ 1 ], 1)
Local13 := __guicolor(qself()[ 1 ], 2)
Local10 := __guicolor(qself()[ 1 ], 3)
Local12 := __guicolor(qself()[ 1 ], 4)
Local14 := __guicolor(qself()[ 1 ], 5)
if ( Local20 )
Local21 := _getnumcol(Local11)
Local22 := _getnumcol(Local13)
Local23 := _getnumcol(Local10)
Local24 := _getnumcol(Local12)
Local25 := _getnumcol(Local14)
Local28 := At("/", Local13)
Local29 := _getnumcol(SubStr(Local13, Local28 + 1, Len(Local13) ;
- Local28))
Local28 := At("/", Local11)
Local30 := _getnumcol(SubStr(Local11, Local28 + 1, Len(Local11) ;
- Local28))
endif
Local31 := msetcursor(.F.)
dispbegin()
Local1 := SetColor(Local11)
if ( !Local20 )
SetPos(Local4, Local5)
DevOut(Space(Local17 - Local5 + 1))
elseif ( Static4 == -1 )
Local32 := gmode()[ 5 ]
grect(Local5 * 8, Local4 * Local32, ( Local17 - Local5 + 1 ) * ;
8, ( Local4 + 1 ) * Local32, .T., Local30, -1)
endif
for Local7 := 1 to Local15
Local8 := " " + Trim(Local16[ Local7 ]:caption()) + " "
Local6 := Len(Local8)
if ( Local6 == 0 )
loop
elseif ( Local5 + Local6 > Local17 )
Local5 := Local17 - Local6
endif
__mirow(Local16[ Local7 ], Local4)
__micolumn(Local16[ Local7 ], Local5)
if ( Local16[ Local7 ]:ispopup() )
Local9 := Local16[ Local7 ]:data()
Local9:top(Local4 + 1)
Local9:left(Local5)
Local9:bottom(Nil)
Local9:right(Nil)
endif
if ( Local7 == Local19 )
set color to (Local13)
Local26 := Local22
elseif ( !Local16[ Local7 ]:enabled() )
set color to (Local14)
Local26 := Local25
else
set color to (Local11)
Local26 := Local21
endif
SetPos(Local4, Local5)
if ( ( Local18 := At("&", Local8) ) == 0 )
elseif ( Local18 == Len(Local8) )
Local18 := 0
else
Local8 := stuff(Local8, Local18, 1, "")
Local6--
endif
if ( !Local20 )
?? Local8
else
Local32 := gmode()[ 5 ]
if ( Local7 == Static4 )
grect(Local5 * 8, Local4 * Local32, ( Local5 + ;
Len(Local8) ) * 8, ( Local4 + 1 ) * Local32, .T., ;
Local30, -1)
endif
if ( Local7 == Local19 )
grect(Local5 * 8, Local4 * Local32, ( Local5 + ;
Len(Local8) ) * 8, ( Local4 + 1 ) * Local32, .T., ;
Local29, -1)
endif
gwriteat(Local5 * 8, Local4 * Local32, Local8, Local26, -1)
endif
if ( !Local16[ Local7 ]:enabled() )
elseif ( Local18 != 0 )
if ( Local7 == Local19 )
set color to (Local12)
Local27 := Local24
else
set color to (Local10)
Local27 := Local23
endif
if ( !Local20 )
SetPos(Local4, Local5 + Local18 - 1)
?? SubStr(Local8, Local18, 1)
else
Local32 := gmode()[ 5 ]
gwriteat(( Local5 + Local18 - 1 ) * 8, Local4 * Local32, ;
SubStr(Local8, Local18, 1), Local27, -1)
endif
endif
Local5 := Local5 + Local6
next
if ( Local19 == 0 )
elseif ( !qself()[ 3 ][ Local19 ]:ispopup() )
elseif ( qself()[ 3 ][ Local19 ]:data():isopen() )
qself()[ 3 ][ Local19 ]:data():display()
endif
dispend()
msetcursor(Local31)
set color to (Local1)
SetPos(Local2, Local3)
Static4 := Local19
return qself()
//---------------------------------------------------[top]-
// __TBMGETAC( Arg1 )
//
function __TBMGETAC( Arg1 )
local Local1, Local2, Local3, Local4, Local5, Local6
do case
case Arg1 >= 272 .AND. Arg1 <= 281
Local5 := SubStr("qwertyuiop", Arg1 - 272 + 1, 1)
case Arg1 >= 286 .AND. Arg1 <= 294
Local5 := SubStr("asdfghjkl", Arg1 - 286 + 1, 1)
case Arg1 >= 300 .AND. Arg1 <= 306
Local5 := SubStr("zxcvbnm", Arg1 - 300 + 1, 1)
case Arg1 >= 376 .AND. Arg1 <= 385
Local5 := SubStr("1234567890", Arg1 - 376 + 1, 1)
otherwise
return 0
endcase
Local2 := qself()[ 2 ]
Local3 := qself()[ 3 ]
for Local1 := 1 to Local2
Local6 := Local3[ Local1 ]
if ( ( Local4 := At("&", Local6:caption()) ) == 0 )
elseif ( Local4 == Len(Local6:caption()) )
elseif ( Lower(SubStr(Local6:caption(), Local4 + 1, 1)) == ;
Local5 )
return Local1
endif
next
return 0
//---------------------------------------------------[top]-
// __TBMHITTE( Arg1, Arg2 )
//
function __TBMHITTE( Arg1, Arg2 )
local Local1 := qself()[ 3 ], Local2, Local3:= qself()[ 2 ], Local4
if ( Arg1 == qself()[ 7 ] )
for Local2 := 1 to Local3
if ( Arg2 < ( Local4 := __micolumn(Local1[ Local2 ]) ) )
elseif ( Arg2 < Local4 + Len(Local1[ Local2 ]:caption()) + ;
1 )
return Local2
endif
next
endif
return 0
//---EOF
Use your Browser's BACK button to return to Function Listings