I am having a problem with the TPanel:paint() method.
When I put a xbrowse on a panel and the panel on a window, the scrollbars of the xbrowse don't display. Actually, they display very briefly when resizing the window but then they vanish leaving the panel showing through.
I found that if I subclass TPanel and use the parent classes' paint method instead, it works fine. So there is apparently a problem with the paint method in the TPanel class.
I have provided simple test code below to show the problem. Use it with the FWH\samples\customer.dbf file.
I am using FWH 15.05.
Regards,
James
- Code: Select all Expand view
- #include "fivewin.ch"
#include "xbrowse.ch"
function main()
local oWnd,oBar,oPanel,oBrw,oCust
DEFINE WINDOW oWnd TITLE "Test Panel Containing xBrowse"
define buttonbar oBar of oWnd 2007
oPanel:= TPanel():new()
//oPanel:= MyPanel():new() // This solves the problem with a new class
oPanel:setColor(CLR_BLACK,CLR_BLUE)
oCust:= TDatabase():New(,"customer")
oCust:use()
oCust:gotop()
oBrw:= TXBrowse():new()
add column to oBrw data oCust:first header "First"
oBrw:bSkip:= {|nRecs| oCust:skipper(nRecs) }
oBrw:createFromCode()
oPanel:oClient:= oBrw
oWnd:oClient:= oPanel // oBrw scrollbars only display during resizing
//oWnd:oClient:= oBrw // This works OK
set message to "F1 for help" of oWnd 2007
activate window oWnd
return nil
// New class overrides the TPanel:paint() method and
// instead calls the parent class's paint method
Class MyPanel from TPanel
Method paint
endclass
Method paint class mypanel
return ::TControl():paint()
// EOF