Xbrowse SetBackGround error

Post Reply
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Xbrowse SetBackGround error

Post by Eoeo »

I insert on a xbrowse a background

oApp():oGrid:SetBackGround(".\bitmaps\familyb.bmp",2 )

and it run ok

only when the user iconize the application the procedure make a strange error


I have this strange error


Code: Select all


Application
===========
   Path and name: C:\Work\Prg\Family\main.Exe (32 bits)
   Size: 3,682,816 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 21 secs 
   Error occurred at: 19-06-2012, 18:52:44
   Error description: Error BASE/1004  Class: 'NUMERIC' has no exported method: COORSUPDATE
   Args:
     [   1] = N   1711608313

Stack Calls
===========
   Called from:  => COORSUPDATE( 0 )
   Called from: .\source\classes\BRUSH.PRG => RESIZEBITMAP( 563 )
   Called from: .\source\classes\BRUSH.PRG => TBRUSH:RESIZE( 517 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:MAKEBRUSH( 5361 )
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE( 437 )
   Called from:  => TXBROWSE:RESIZE( 0 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1700 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11632 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => WNDSETSIZE( 0 )
   Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW:TWINDOW( 597 )
   Called from:  => TXBROWSE:SETSIZE( 0 )
   Called from: source\main.prg => RESIZEWNDMAIN( 983 )
   Called from: source\main.prg => (b)TAPPLICATION:ACTIVATE( 340 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE( 2138 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 980 )
   Called from: source\main.prg => TAPPLICATION:ACTIVATE( 348 )
   Called from: source\main.prg => MAIN( 58 )
 


I tried with also 1 and 0 and make the same error

with oApp():oGrid:SetBackGround(".\bitmaps\familyb.bmp",3 ) not make error

but I see two images on background
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Xbrowse SetBackGround error

Post by ukoenig »

I couldn't find any problems.

Can You test these 2 samples ?

From WINDOWS

Image

Code: Select all

#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'

REQUEST DBFCDX

static oSysFont, cBmpPath   := '..\bitmaps\'

FUNCTION MAIN()
local oWnd, oBar, oBrw

oSysFont := TFont():New("Arial",0,-14,.F.,.T.,0,0,0,.T. )

USE CUSTOMER SHARED

DEFINE WINDOW oWnd TITLE 'XBrowse BackGrounds ( WINDOWS )'

@ 0, 0 XBROWSE oBrw OF oWnd ;
PIXEL FONT oSysFont ;
ALIAS 'CUSTOMER' AUTOCOLS ;
CELL LINES ;
COLOR CLR_WHITE, CLR_BLUE

   // obrw:acols[2]:cdatatype := 'P'

DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007

DEFINE BUTTON OF oBar PROMPT 'Image' ;
ACTION BckFromImage( oBrw ) FONT oSysfont TOOLTIP "Load new Image ..."

DEFINE BUTTON OF oBar PROMPT 'Paste' ;
ACTION BckPaste( oBrw ) FONT oSysfont TOOLTIP "Paste Image ..."

DEFINE BUTTON OF oBar PROMPT 'Clear' ;
ACTION oBrw:SetBackGround() FONT oSysfont TOOLTIP "Clear Background ..."

DEFINE BUTTON OF oBar PROMPT 'Tiled' GROUP ;
ACTION oBrw:SetBackGround( nil, BCK_TILED ) FONT oSysfont TOOLTIP "Show TILED Image ..."

DEFINE BUTTON OF oBar PROMPT 'Stretch' ;
ACTION oBrw:SetBackGround( nil, BCK_STRETCH ) FONT oSysfont TOOLTIP "Show STRETCHED Image ..."

DEFINE BUTTON OF oBar PROMPT 'Fill' ;
ACTION oBrw:SetBackGround( nil, BCK_FILL ) FONT oSysfont TOOLTIP "FILL Background with Image ..."

DEFINE BUTTON OF oBar PROMPT 'Quit' GROUP ;
ACTION oWnd:End() FONT oSysfont TOOLTIP "QUIT xBrowse-test ..."

SET MESSAGE OF oWnd TO FWVERSION 2007

oBrw:SetBackGround( '..\bitmaps\olga1.jpg', BCK_FILL )
oBrw:CreateFromCode()
oWnd:oClient := oBrw

ACTIVATE WINDOW oWnd MAXIMIZED
oSysfont:End()

RETURN NIL

// --------------

STATIC FUNCTION BCKFROMIMAGE( oBrw )
local cImage

IF ! Empty( cImage := cGetFile( "Image File (*.bmp,jpg,png)|*.bmp;*.png;*.jpg|", ;
     "Select Image file ",, '..\bitmaps\' ) )
      oBrw:SetBackGround( cImage )
ENDIF

RETURN NIL

// ---------------

STATIC FUNCTION BCKPASTE( oBrw )
local oClp, hBmp

DEFINE CLIPBOARD oClp OF oBrw FORMAT BITMAP
hBmp  := oClp:GetBitmap()

IF hBmp == 0
      MsgInfo( 'No image in clipboard' )
ELSE
      oBrw:SetBackGround( hBmp )
      oClp:Clear()
ENDIF

oClp:End()

RETURN NIL
From DIALOG ( Nowait )

Image

Code: Select all

#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'

REQUEST DBFCDX

static oSysFont, cBmpPath   := '..\bitmaps\'

FUNCTION MAIN()
local oWnd, oDlg, oBar, oBrw

oSysFont := TFont():New("Arial",0,-14,.F.,.T.,0,0,0,.T. )

USE CUSTOMER SHARED

DEFINE WINDOW oWnd TITLE 'XBrowse BackGrounds ( DIALOG )'

DEFINE DIALOG oDlg FROM 50, 50 TO 500, 700 OF oWnd  PIXEL ;
TITLE  'XBrowse BackGrounds ( Dialog-test )' ;
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX

@ 0, 0 XBROWSE oBrw OF oDlg ;
SIZE 400, 300 PIXEL FONT oSysFont ;
ALIAS 'CUSTOMER' AUTOCOLS ;
CELL LINES ;
COLOR CLR_WHITE, CLR_BLUE

   // obrw:acols[2]:cdatatype := 'P'

DEFINE BUTTONBAR oBar OF oWnd SIZE 100,32 2007 

DEFINE BUTTON OF oBar PROMPT 'Image' ;
ACTION BckFromImage( oWnd, oBrw ) FONT oSysfont TOOLTIP "Load new Image ..."

DEFINE BUTTON OF oBar PROMPT 'Brush' ;
ACTION BckFromBrush( oWnd, oBrw ) FONT oSysfont TOOLTIP "Load new Brush ..."

DEFINE BUTTON OF oBar PROMPT 'Paste' ;
ACTION BckPaste( oBrw ) FONT oSysfont TOOLTIP "Paste Image ..."

DEFINE BUTTON OF oBar PROMPT 'Clear' ;
ACTION oBrw:SetBackGround() FONT oSysfont TOOLTIP "Clear Background ..."

DEFINE BUTTON OF oBar PROMPT 'Tiled' GROUP ;
ACTION oBrw:SetBackGround( nil, BCK_TILED ) FONT oSysfont TOOLTIP "Show TILED Image ..."

DEFINE BUTTON OF oBar PROMPT 'Stretch' ;
ACTION oBrw:SetBackGround( nil, BCK_STRETCH ) FONT oSysfont TOOLTIP "Show STRETCHED Image ..."

DEFINE BUTTON OF oBar PROMPT 'Fill' ;
ACTION oBrw:SetBackGround( nil, BCK_FILL ) FONT oSysfont TOOLTIP "FILL Background with Image ..."

DEFINE BUTTON OF oBar PROMPT 'Quit' GROUP ;
ACTION ( oDlg:End(), oWnd:End() ) FONT oSysfont TOOLTIP "QUIT xBrowse-test ..."

SET MESSAGE OF oWnd TO FWVERSION 2007

oBrw:SetBackGround( '..\bitmaps\olga1.jpg', BCK_FILL )
oBrw:CreateFromCode()
oDlg:oClient := oBrw

ACTIVATE DIALOG oDlg NOWAIT CENTERED ;
ON INIT oBrw:Move( 0, 0, oDlg:nWidth -5, oDlg:nHeight - 25, .T. )

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT W_BACKGRD( oWnd, 2, , cBmpPath + 'olga1.jpg' ) 

oSysfont:End()

RETURN NIL

// -------------------------

STATIC FUNCTION BCKFROMIMAGE( oWnd, oBrw )
local cImage

IF ! Empty( cImage := cGetFile( "Image File (*.bmp,jpg,png)|*.bmp;*.png;*.jpg|", ;
    "Select Image file ",, '..\bitmaps\' ) )
    oBrw:SetBackGround( cImage )
    W_BACKGRD( oWnd, 2, , cImage ) 
ENDIF

RETURN NIL

// -------------------------

STATIC FUNCTION BCKFROMBRUSH( oWnd, oBrw )
local cImage

IF ! Empty( cImage := cGetFile( "Image File (*.bmp,jpg,png)|*.bmp;*.png;*.jpg|", ;
    "Select Image file ",, '..\bitmaps\backgrnd\' ) )
    oBrw:SetBackGround( cImage, BCK_TILED )
    W_BACKGRD( oWnd, 1, , cImage ) 
ENDIF

RETURN NIL

// ------------------

STATIC FUNCTION BCKPASTE( oBrw )
local oClp, hBmp

DEFINE CLIPBOARD oClp OF oBrw FORMAT BITMAP
hBmp  := oClp:GetBitmap()
IF hBmp == 0
    MsgInfo( 'No image in clipboard' )
ELSE
    oBrw:SetBackGround( hBmp )
    oClp:Clear()
ENDIF
oClp:End()

RETURN NIL

// --------  WINDOW - Background Modal ---------------

FUNCTION W_BACKGRD( oWnd, nStyle, cBrush, cImage ) 
local oBrush

IF nStyle = 1 // BMP-BRUSH
    DEFINE BRUSH oBrush FILE cImage
ENDIF
IF nStyle = 2 // Image ADJUSTED
    DEFINE IMAGE oImage FILE cImage
    oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oWnd:nWidth, oWnd:nHeight , .T. ) ) 
    oImage:End()
ENDIF

oWnd:SetBrush( oBrush )
oBrush:End()

RETURN( NIL )
Best Regards
Uwe :?:
Last edited by ukoenig on Thu Jun 21, 2012 8:16 am, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Xbrowse SetBackGround error

Post by Eoeo »

sorry Uwe,
I use a DIALOG NO WAIT into a Window
the background run ok
when I iconize the app then it make error..
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Xbrowse SetBackGround error

Post by ukoenig »

I had a look at Your Errormessage
Called from: .\source\classes\BRUSH.PRG => RESIZEBITMAP( 563 )

Line 563 looks different in new FWH-release :

hBmpNew := ResizeImg( hBmp, nWidth, nHeight )

Are You using a changed Class TBrush ?

The working EXE-files for Download :

http://www.pflegeplus.com/fw_download/XBRBrush.zip

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Xbrowse SetBackGround error

Post by Eoeo »

I have the last April version of Fwh

and no use modified brush class

perhaps

2 := FitOutside

it is no compatible wuth dialog NOWAIT into oWnd


run only with 3 := Fitinside
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse SetBackGround error

Post by nageswaragunupudi »

We have tested with xbrbckg1.prg in the samples folder. We are not finding any errors.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Eoeo
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Xbrowse SetBackGround error

Post by Eoeo »

Mr Rao,

the problem happen when the user iconize the application

with Wnd run ok

with a Dialog with style nStyle := nOR( WS_CHILD, 4 it make error

i sent you a test sample pls control you email !!
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse SetBackGround error

Post by nageswaragunupudi »

with a Dialog with style nStyle := nOR( WS_CHILD, 4 it make error

i sent you a test sample pls control you email !!
I shall check the sample and get back. Thanks
Regards

G. N. Rao.
Hyderabad, India
Post Reply