1.
data osettingbmp
method helpmenu()
2.
METHOD New( oWnd ) CLASS TXBrowse
...
::hBmpRecSel := FwRArrow()
// add the lines
::osettingbmp:=TBitmap():Define( "config",,::oWnd)
::osettingbmp:ltransparent:=.t.
3.
METHOD Paint() CLASS TXBrowse
...
PalBmpDraw( ::hDC, (::nHeaderHeight - 3-if(::lgetbar,::nrowheight*2,0))*0.2, RECORDSELECTOR_WIDTH*0.2,;
::osettingbmp:hBitmap,;
::osettingbmp:hPalette,;
if(::lgetbar,::nHeaderHeight - 3-::nrowheight*2,::nheaderHeight/::nHeaderLines)*0.8,;
if(::lgetbar,::nHeaderHeight - 3-::nrowheight*2,::nheaderHeight/::nHeaderLines)*0.8;
,, .t., Eval( ::bClrHeader, Self ) [ 2 ] )
end
// add lines end
::DispEnd( aInfo )
::oFont:Deactivate( hDC )
return 0
4.
METHOD
LButtonDown( nRow, nCol, nFlags ) CLASS TXBrowse
...
if ::lDrag
return Super:
LButtonDown( nRow, nCol, nFlags )
endif
// add the lines
if nRow < ::HeaderHeight()-if(::lgetbar,::nrowheight*2,0) .and. nCol > 0 .and.ncol<RECORDSELECTOR_WIDTH
::setmenu()
return
end
5.
METHOD helpmenu( nRow, nCol, nFlags ) CLASS TXBrowse
local oMenu, oCol
local cPrompt
local nFor, nLen
local omenu2
local color1,color2
nLen := len( ::aCols )
MENU omenu2 2007 popup
if ::nMarqueeStyle == MARQSTYLE_HIGHLROWMS
MENUITEM "选择行,取消选择行 Contrl+点击" ACTION (::SELECT(2),::drawline(.t.))
MENUITEM "选择块 Shift+点击" ACTION ::SELECT(3)
MENUITEM "选择全部 " ACTION ::SELECT(4)
MENUITEM "取消全部选择 " ACTION ::SELECT(0)
end
if ::nMarqueeStyle == MARQSTYLE_HIGHLROW
MENUITEM "双击鼠标,本行拖入单据主表" ACTION EVAL(::BLDBLClick) WHEN !EVAL(::beof())
end
if ::bkeydown<>nil.and.::nMarqueeStyle==MARQSTYLE_HIGHLCELL
MENUITEM "添加新行 Insert" ACTION EVAL(::bkeydown,VK_INSERT) WHEN !EVAL(::beof())
MENUITEM "删除本行 Delete" ACTION EVAL(::bkeydown,VK_DELETE) WHEN !EVAL(::beof())
end
separator
MENUITEM "另存入Excel" ACTION ::SAVE()
MENUITEM "打印" ACTION ::REPORT(,.f.)
MENUITEM "打印预览" ACTION ::REPORT(,.t.)
separator
MENUITEM "表格设置:" ACTION tablesethelp(self)
MENUITEM "删除/隐藏/恢复栏位"
MENU
for nFor := 1 to nLen
oCol := ::aCols[ nFor ]
cPrompt := Trim( MemoLine( if(VALTYPE(oCol:cHeader)=="C",oCol:cHeader,EVAL(oCol:cHeader)), 250, 1 ) )
MenuAddItem( cPrompt, , !oCol:lHide, ( len(::aDisplay) != 1 .or. ocol:nPos != 1 ), GenMenuBlock( ::aCols, nFor ) )
next
ENDMENU
if ::bkeydown<>nil.and.::nMarqueeStyle==MARQSTYLE_HIGHLCELL
MENUITEM "更改字体颜色" ACTION (color1:=ChooseColor(),restorestate2(self,color1,color2))
MENUITEM "更改背景颜色" ACTION (color2:=ChooseColor(),restorestate2(self,color1,color2))
MENUITEM "恢复默认颜色" ACTION (restorestate2(self,CLR_BLACK,GetSysColor( 5 )))
end
if ::cid<>nil
MENUITEM "保存显示格式" ACTION savestate(self)
end
separator
MENUITEM "说明帮助" ACTION help(::ownd:ccaption)
ENDMENU
ACTIVATE POPUP oMenu2 AT nRow, nCol OF Self
6.
Shuming Wang