Problem with upgrade to FWH 2018 - 02
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Problem with upgrade to FWH 2018 - 02
Hello,
I have two problems after upgrading to FWH
1. I have changed LISTBOX to XBROWSE and have the following problem displaying a bitmap
@210,000 XBROWSE oLbx FIELDS _ImpFlag( aHBitmaps ) , ;
import->file + IF( PA[08]='CDM-ADMIN', import->serial, '' ) , ;
...
function _ImgFlag displayed an image based on record details, however when changing to xbrowse, the image is gone and it displays numbers, how do I correct this?
Here is _ImpFlag code
FUNCTION _ImpFlag( aBitmap )
IF ( ALLTRIM( import->lastuser ) $ 'CTS EDI,CDM SYSTEM' ) .OR. ( import->commdoc = 2 ) .OR. ( EMPTY( import->mbill ) ) .OR. ( ALLTRIM( import->boxno )=='SHELL RECORD' )
RETURN ( aBitmap[02] )
ELSE
RETURN ( aBitmap[01] )
ENDIF
RETURN ( aBitMap[01] )
2. On our home screen, I would display a logo with the following code and now the logo has disappeared
ACTIVATE WINDOW oWnd ;
VALID MsgNoYes( "Do you want to Exit " + PA[04] + "?" ) ;
ON PAINT ( PalBmpDraw( hDC, (oWnd:nHeight/2-oBmp:nHeight/2)-50,(oWnd:nWidth/2-oBmp:nWidth/2), oBmp:hBitmap, oBmp:hPalette ) );
ON INIT ShowLogo( @oBmp, oWnd ) ;
MAXIMIZED
FUNCTION ShowLogo( oBmp, oWnd )
IF FILE( PA[03] + 'winfrt10.bmp' )
oBmp:LoadBMP( PA[03] + 'winfrt10.bmp' )
ENDIF
oWnd:Refresh()
SysRefresh()
RETURN (.T.)
Thank you in advance for your assistance!
I have two problems after upgrading to FWH
1. I have changed LISTBOX to XBROWSE and have the following problem displaying a bitmap
@210,000 XBROWSE oLbx FIELDS _ImpFlag( aHBitmaps ) , ;
import->file + IF( PA[08]='CDM-ADMIN', import->serial, '' ) , ;
...
function _ImgFlag displayed an image based on record details, however when changing to xbrowse, the image is gone and it displays numbers, how do I correct this?
Here is _ImpFlag code
FUNCTION _ImpFlag( aBitmap )
IF ( ALLTRIM( import->lastuser ) $ 'CTS EDI,CDM SYSTEM' ) .OR. ( import->commdoc = 2 ) .OR. ( EMPTY( import->mbill ) ) .OR. ( ALLTRIM( import->boxno )=='SHELL RECORD' )
RETURN ( aBitmap[02] )
ELSE
RETURN ( aBitmap[01] )
ENDIF
RETURN ( aBitMap[01] )
2. On our home screen, I would display a logo with the following code and now the logo has disappeared
ACTIVATE WINDOW oWnd ;
VALID MsgNoYes( "Do you want to Exit " + PA[04] + "?" ) ;
ON PAINT ( PalBmpDraw( hDC, (oWnd:nHeight/2-oBmp:nHeight/2)-50,(oWnd:nWidth/2-oBmp:nWidth/2), oBmp:hBitmap, oBmp:hPalette ) );
ON INIT ShowLogo( @oBmp, oWnd ) ;
MAXIMIZED
FUNCTION ShowLogo( oBmp, oWnd )
IF FILE( PA[03] + 'winfrt10.bmp' )
oBmp:LoadBMP( PA[03] + 'winfrt10.bmp' )
ENDIF
oWnd:Refresh()
SysRefresh()
RETURN (.T.)
Thank you in advance for your assistance!
Re: Problem with upgrade to FWH 2018 - 02
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Hello,
Thank you, I tried that option in XBROWSE and it did not work.
XBROWSE code
@210,000 XBROWSE oLbx FIELDS _ImpFlag(oLbx, 1) , ;
...
FUNCTION _ImpFlag( oLbx, nCol )
local aBitmaps := {} , ;
nBitmap := 1
AADD( aBitmaps, PA[25] + "yes.bmp" )
AADD( aBitmaps, PA[25] + "no.bmp" )
DO CASE
CASE "UECANADA" $ Pmod
IF ( import->reltype = 1 )
nBitmap := 1
ELSE
nBitmap := 2
ENDIF
OTHERWISE
IF ( ALLTRIM( import->lastuser ) $ 'CTS EDI,CDM SYSTEM' ) .OR. ( import->commdoc = 2 ) .OR. ( EMPTY( import->mbill ) ) .OR. ( ALLTRIM( import->boxno )=='SHELL RECORD' )
nBitmap := 2
ELSE
nBitmap := 1
ENDIF
ENDCASE
RETURN ( oLbx:aCols[nCol]:AddBmpFile(aBitmaps[nBitmap]) )
Thank you, I tried that option in XBROWSE and it did not work.
XBROWSE code
@210,000 XBROWSE oLbx FIELDS _ImpFlag(oLbx, 1) , ;
...
FUNCTION _ImpFlag( oLbx, nCol )
local aBitmaps := {} , ;
nBitmap := 1
AADD( aBitmaps, PA[25] + "yes.bmp" )
AADD( aBitmaps, PA[25] + "no.bmp" )
DO CASE
CASE "UECANADA" $ Pmod
IF ( import->reltype = 1 )
nBitmap := 1
ELSE
nBitmap := 2
ENDIF
OTHERWISE
IF ( ALLTRIM( import->lastuser ) $ 'CTS EDI,CDM SYSTEM' ) .OR. ( import->commdoc = 2 ) .OR. ( EMPTY( import->mbill ) ) .OR. ( ALLTRIM( import->boxno )=='SHELL RECORD' )
nBitmap := 2
ELSE
nBitmap := 1
ENDIF
ENDCASE
RETURN ( oLbx:aCols[nCol]:AddBmpFile(aBitmaps[nBitmap]) )
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Please let us know what version you were using before upgrading.
About display of logo. There is a much simpler way. Please see this code:
I will come back to you about xbrowse, in my next post.
About display of logo. There is a much simpler way. Please see this code:
Code: Select all
function Main()
local oWnd, oBmp
local cLogoBmpFile := "c:\fwh\bitmaps\fivewin.bmp" // Your bmp file name
DEFINE WINDOW oWnd
DEFINE BITMAP oBmp FILE cLogoBmpFile // does not matter even if the file does not exist
ACTIVATE WINDOW oWnd ON PAINT oWnd:DrawImage( oBmp )
oBmp:End()
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Converting from Listbox to XBrowse:
After this code:
Please insert this code:
You will see bitmps in the first column.
After this code:
Code: Select all
@210,000 XBROWSE oLbx FIELDS _ImpFlag( aHBitmaps ) , ;
import->file + IF( PA[08]='CDM-ADMIN', import->serial, '' ) , ;
Code: Select all
WITH OBJECT oBrw:aCols[ 1 ]
:cDataType := "P"
:lBmpTransparent := .t.
:nDataBmpAlign := AL_CENTER
END
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Thank you! That worked!
I look forward to details regarding BMP and XBROWSE
I look forward to details regarding BMP and XBROWSE
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
cdmmaui wrote:Thank you! That worked!
I look forward to details regarding BMP and XBROWSE
In the case of Listbox(WBrowse) a field can be either character or numeric type. All numeric fields are assumed to be bitmap handles and displayed as bitmaps.
In the case of XBrowse, any field can return a value of any type. Numbers, dates, logical, character, etc are displayed as number, dates, logical, character, etc.
If we want a number to be displayed as bitmap, we need to clealy specify that by
oCol:cDataType := "P" // "P" means picture/Image.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Thank you Sir!
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Dear Rao,
Thanks for your help on this. However, I have one problem, at times I need to change to the image that was loaded with
DEFINE BITMAP oBmp FILENAME cBitmapFile
I tried, oBmp:LoadBMP( cLogo ), however system locks up. Can you assist? I provided code below:
//-------------------------------------
FUNCTION LoadLogo( oBmp, oWnd )
local cLogo := cDataFolder + 'winfrt10.bmp'
// New bitmap
IF FILE( cLogo )
oBmp:LoadBMP( cLogo )
ENDIF
oWnd:Refresh()
SysRefresh()
RETURN (.T.)
Thanks for your help on this. However, I have one problem, at times I need to change to the image that was loaded with
DEFINE BITMAP oBmp FILENAME cBitmapFile
I tried, oBmp:LoadBMP( cLogo ), however system locks up. Can you assist? I provided code below:
//-------------------------------------
FUNCTION LoadLogo( oBmp, oWnd )
local cLogo := cDataFolder + 'winfrt10.bmp'
// New bitmap
IF FILE( cLogo )
oBmp:LoadBMP( cLogo )
ENDIF
oWnd:Refresh()
SysRefresh()
RETURN (.T.)
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Please try oBmp:LoadImage( cLogo )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- cdmmaui
- Posts: 653
- Joined: Fri Oct 28, 2005 9:53 am
- Location: The Woodlands - Dallas - Scottsdale - London
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Dear Rao,
That was better, however the new image is displayed on top of old image. Eventually, bitmap refreshes correctly. I have added the following code with no luck.
oBmp:Refresh()
oWnd:Refresh()
SysRefresh()
That was better, however the new image is displayed on top of old image. Eventually, bitmap refreshes correctly. I have added the following code with no luck.
oBmp:Refresh()
oWnd:Refresh()
SysRefresh()
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Darrell,
Please try doing oWnd:Refresh() only
Please try doing oWnd:Refresh() only
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
This is a working sample:
Code: Select all
#include "fivewin.ch"
function Main()
local oWnd, oBmp
local cLogoBmpFile := "c:\fwh\bitmaps\fivewin.bmp" // Your bmp file name
DEFINE WINDOW oWnd
DEFINE BITMAP oBmp FILE cLogoBmpFile // does not matter even if the file does not exist
@ 0,0 BUTTON "ChangeLogo" SIZE 80,30 PIXEL OF oWnd ;
ACTION ( oBmp:LoadImage( "c:\fwh\bitmaps\007.bmp" ), oWnd:Refresh() )
ACTIVATE WINDOW oWnd CENTERED ON PAINT oWnd:DrawImage( oBmp )
oBmp:End()
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Problem with upgrade to FWH 2018 - 02
Another simpler way:
Code: Select all
#include "fivewin.ch"
function Main()
local oWnd, oBmp
local cLogoBmpFile := "c:\fwh\bitmaps\fivewin.bmp" // Your bmp file name
DEFINE WINDOW oWnd
@ 0,0 BUTTON "ChangeLogo" SIZE 80,30 PIXEL OF oWnd ;
ACTION ( cLogoBmpFile := "c:\fwh\bitmaps\007.bmp", oWnd:Refresh() )
ACTIVATE WINDOW oWnd CENTERED ON PAINT oWnd:DrawImage( cLogoBmpFile )
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India