FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error Scroll Panel class
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Error Scroll Panel class
Posted: Thu Aug 02, 2012 01:28 PM
I made a test

static oPanel
Function Main()
Local oPanel,oBrush,oWnd
DEFINE BRUSH oBrush FILENAME "mare.bmp"
DEFINE WINDOW oWnd
oPanel:= TScrollPanel():New(40,2,400,400,oWnd)
oPanel:SetBrush(oBrush)
oWnd:=oPanel
ACTIVATE WINDOW oWnd maximized

Return nil



let me give this error


Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\Errori\ScrollPanel\test.Exe (32 bits)
   Size: 1,816,576 bytes
   Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715)
   FiveWin  Version: FWHX 12.03
   Windows version: 6.1, Build 7600 

   Time from start: 0 hours 0 mins 1 secs 
   Error occurred at: 08/02/12, 15:26:16
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: NTOP
   Args:
     [   1] = U   

Stack Calls
===========
   Called from:  => NTOP( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => (b)TSCROLLPANEL:TSCROLLPANEL( 46 )
   Called from:  => TSCROLLPANEL:GOTOP( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:VSCROLL( 295 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TSCROLLPANEL:HANDLEEVENT( 1700 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
   Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG( 426 )
   Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS( 31 )
   Called from:  => NTOP( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:VSETPOS( 190 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:RESIZE( 119 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TSCROLLPANEL:HANDLEEVENT( 1700 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => WNDHEIGHT( 0 )
   Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL:TCONTROL( 192 )
   Called from:  => TSCROLLPANEL:_NHEIGHT( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:CHECKRESIZE( 140 )
   Called from: .\source\classes\SCRLPANL.PRG => (b)TSCROLLPANEL:NEW( 110 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE( 2134 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => SHOWWINDOW( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 963 )
   Called from: test.prg => MAIN( 21 )
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: Error Scroll Panel class
Posted: Sun Oct 07, 2012 07:05 PM

Any solution ?

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Error Scroll Panel class
Posted: Thu Feb 14, 2013 04:33 PM
Eoeo,

You can't use the oWnd object until it is actually initialized in ACTIVATE WINDOW. Try the code below:

James

Code (fw): Select all Collapse
#include "fivewin.ch"


Function Main()
   Local oPanel,oBrush,oWnd
   DEFINE BRUSH oBrush FILENAME "mare.bmp"
   DEFINE WINDOW oWnd
   ACTIVATE WINDOW oWnd maximized on init(oBrush,oPanel)
Return nil

function createPanel(oBrush,oPanel)
   oPanel:= TScrollPanel():New(40,2,400,400,WndMain())
   oPanel:SetBrush(oBrush)
   WndMain():oClient:=oPanel
return nil
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error Scroll Panel class
Posted: Tue Feb 19, 2013 07:06 AM
The scroll panel should have atleast one control.
Real use of scroll panel is when the controls in the panel exceed the height of the panel/window.

After creating the scroll panel, you should create atleast one control in the panel and after creating all controls it is necessary that you should call oPanel:SetRange().

Your program modified looks like this:
Code (fw): Select all Collapse
static oPanel

Function Main()

Local oPanel,oBrush,oWnd, C := 'HELLO'

   DEFINE BRUSH oBrush FILENAME "clouds1.bmp"
   DEFINE WINDOW oWnd
   oPanel:= TScrollPanel():New(40,2,400,400,oWnd)
   oPanel:SetBrush(oBrush)
   @ 10,10 GET C OF oPanel SIZE 100,20 PIXEL
   oPanel:SetRange()

//   oWnd:=oPanel
   ACTIVATE WINDOW oWnd maximized

Return nil

Real use of scroll panel is only when you have many controls exceeding the height of the scroll panel.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion