oBrw:cBmpAdjBrush changed in FWH 9.04 ?

oBrw:cBmpAdjBrush changed in FWH 9.04 ?

Postby ukoenig » Thu May 28, 2009 7:59 pm

Hello,

some month ago, we started a function ( Daniel ) for xBrowse oBrw:cBmpAdjBrush
During testing, i could change the background at runtime.
This function is included now in FWH 9.04.
Testing this function after the Update I noticed that, selecting a Image with button-action,
the background ( adjusted in the browser before ) changes to tiled.
I tested with the same image and function.
Is there something wrong ( changed : doesn't work at runtime anymore ) ?

At start :

Image

With Button-selection ( same Image and function )

Image

It works only at Startup :
Code: Select all  Expand view

....
....
oBrw:l2007 := .T.

oBrw:lHScroll := .T.
oBrw:lVScroll := .T.
// Image - background  Works !!
// ------------------------------------
GRADBMP1 := c_path + "IMAGES\Fantasy1.BMP"
NEW_IMAGE( oBrw )
...
...
oBrw:lFastedit := .T.
oBrw:CreateFromResource( 110 )

// Image - select ( Changes to Tiled works like function < NEW_IMAGE( oBrw ) > )
// --------------------------------------------------------------------------------------------
REDEFINE BTNBMP oBtn30 ID 30 OF oDlg5  2007 ;
FILENAME c_path + "preview.bmp" ;
LEFT ;
PROMPT "  &Load Image   " ;
FONT oProgFont ;
ACTION ( cFilter := "BMP (*.bmp)|*.bmp|", ;
   GRADBMP1 := cGetFile32( cFilter,"Select a Picture" ,,  "\" + CurDir() + "\IMAGES\" ), ;
   IIF( Empty( GRADBMP1 ), MsgAlert( "
No file selected !","ATTENTION") , ;
         NEW_IMAGE( oBrw ) ) )   

// ------------ DISPLAY Adjusted Image -------------

STATIC FUNCTION NEW_IMAGE( oBrw )
oBrw:cBmpAdjBrush := ALLTRIM(GRADBMP1)
oBrw:SetBackGround( ALLTRIM(GRADBMP1) )
aeval( oBrw:aCols, { |o|o:lColTransparent := .t. } )
oBrw:Refresh()
GRADBMP1 := "
"
RETURN NIL

// -------------- DISPLAY Tiled Brush  ----------------

FUNCTION NEW_BRUSH(oBrw)
Local oBrush1

DEFINE BRUSH oBrush1 FILENAME ALLTRIM(GRADBMP1)
oBrw:SetBackGround( oBrush1 )
RELEASE BRUSH oBrush1
GRADBMP1 := "
"

RETURN NIL

 


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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oBrw:cBmpAdjBrush changed in FWH 9.04 ?

Postby nageswaragunupudi » Thu May 28, 2009 9:16 pm

By comparing source code of xbrowse 903 and 904 I notice that line number 1014 "DeleteObject( hBmpNew )" is newly inserted in 904.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: oBrw:cBmpAdjBrush changed in FWH 9.04 ?

Postby ukoenig » Thu May 28, 2009 9:33 pm

Thank You very much for the information.

I deleted the line, but still the same : at button-action, the background changes to tiled.

I added a switch button to a other application. IT WORKS THERE.
I have to check, where the difference comes from. ( I'm glad, that there is no bug )

The working browser ( switching the background between 2 Images ) inside a Folder

Image
Image

Code: Select all  Expand view

lSwitch := .T.
PRIVATE aText[9][2]
aText[1] := { "Row 1", "Row 1                          " }
aText[2] := { "Row 2", "Row 2                          " }
aText[3] := { "Row 3", "Row 3                          " }
aText[4] := { "Row 4", "Row 4                          " }
aText[5] := { "Row 5", "Row 5                          " }
aText[6] := { "Row 6", "Row 6                          " }
aText[7] := { "Row 7", "Row 7                          " }
aText[8] := { "Row 8", "Row 8                          " }
aText[9] := { "Row 9", "Row 9                          " }

oLbx1 := TXBrowse():New( oFld:aDialogs[1] )
oLbx1:nColDividerStyle := LINESTYLE_BLACK
oLbx1:nRowDividerStyle := LINESTYLE_BLACK
oLbx1:nRecSelColor = 15512898
oLbx1:bClrSelFocus = { || { 16777215, 15512898 } }
oLbx1:bClrStd = { || { 16777215,  } }
oLbx1:bClrSel = { || { 16777215, 15512898 } }
oLbx1:SetArray( aTEXT )
oLbx1:lHScroll := .T.
oLbx1:lVScroll := .T.
oLbx1:lFooter := .T.
oLbx1:lRecordSelector  := .T.
// -------------------
oLbx1:cBmpAdjBrush := "Tree.bmp"
oLbx1:SetBackGround( "Tree.bmp" )
aeval( oLbx1:aCols, { |o|o:lColTransparent := .t. } )
// -------------------
oLbx1:CreateFromResource( 140 )

// Switch - Button
// ------------------
REDEFINE BUTTONBMP oBtn2  ID 20 OF oFld:aDialogs[1] ;
ACTION ( IIF( lSwitch = .T., ;
( lSwitch := .F., oLbx1:cBmpAdjBrush := "Fish.bmp" , ;
  oLbx1:SetBackGround( "Fish.bmp" ) ), ;
( lSwitch := .T., oLbx1:cBmpAdjBrush := "Tree.bmp" , ;
  oLbx1:SetBackGround( "Tree.bmp" ) ) ), ;         
oLbx1:Refresh() ) ;
BITMAP "quit" PROMPT SPACE(10) + "&Test Background" TEXTRIGHT
oBtn2:cToolTip =  { "Switch between" + CRLF + ;
                             "two Images","Image-Test", 1, CLR_BLACK, 14089979 }
 


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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], jair, nageswaragunupudi and 102 guests