How to change the xBrowse-bkstyle at runtime ?

How to change the xBrowse-bkstyle at runtime ?

Postby ukoenig » Thu Apr 15, 2021 8:43 am

I would like to change the style at runtime from selection ( radio )

@ 10, 10 XBROWSE oBrw1 SIZE 850, 525 PIXEL OF oFld:aDialogs[ 1 ] ;
COLSIZES 40, 110, 110, 200, 150, 70, 100, 100, 100, 80, 60, 120, 160 ;
DATASOURCE oCustomer AUTOCOLS LINES NOBORDER FONT oFont2 ;
BACKGROUND cBackImg STRETCH UPDATE :D // OK see image

doesn't work :(
// TILED 0
// STRETCH 1
// FILL 2
SetBkMode( oBrw1:GetDC(), 2 )

changing
BACKGROUND cBackImg UPDATE //STRETCH

SetBkMode( oBrw1:GetDC(), 1 )
oBrw1:Refresh()
no difference
-----------------------
another promlem found during my testing :!:
a non existing brush will show a error
maybe instead if not exists will show a message or using a existing system-brush :?:

BACKGROUND 'BLUSTONE' UPDATE // not exists

// Error description: Error BASE/1068 Argument error: array access
// Args:
// [ 1] = U
// [ 2] = N 1

//Stack Calls
//===========
// Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT( 2205 )
// Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY( 2133 )
// Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1793 )
// Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11921 )

--------------------
created with
[color=#0000FF]BACKGROUND cBackImg TILED UPDATE
BACKGROUND cBackImg STRETCH UPDATE
BACKGROUND cBackImg FILL UPDATE


Imageis it possible

regards
Uwe :?:
Last edited by ukoenig on Fri May 14, 2021 10: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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to change the xBrowse-bkstyle at runtime ?

Postby ukoenig » Fri Apr 16, 2021 1:10 pm

It is working now :D

Code: Select all  Expand view

Radio defined on mainwindow !!!

@ 50, 920  RADIO oRadio1 VAR nMode  OF oWnd PIXEL  UPDATE ;
ITEMS "0  TILED", "1  STRETCH", "2  FILL" SIZE 120, 25;
HELPID 100, 101, 102 ;
ON CHANGE ( nBKMode := nMode -1, ; // because first position = bkmode 0
                        oSystem:GoTop(), ;
                        oSystem:nBKmode := nMode, ;
                        oSystem:Save(), ;
                        oBrw1:Refresh() )
AEval( oRadio1:aItems, { | oRad | oRad:lTransparent := .T., oRad:SetFont(  oFont2 ) } )

Browser defined on folderpage 1 !!!

@ 10, 10 XBROWSE oBrw1 SIZE 850, 525 PIXEL OF oFld:aDialogs[ 1 ] ;
COLSIZES 40, 110, 110, 200, 150, 70, 100, 100, 100, 80, 60, 120, 160 ;      
DATASOURCE oCustomer AUTOCOLS LINES NOBORDER FONT oFont2 ;
BACKGROUND cBackImg FILL UPDATE    

WITH OBJECT oBrw1
    :nMarqueeStyle := MARQSTYLE_NOMARQUEE  // 0
    :aCols[1]:bClrStd       := { || { aTextCol[1], CLR_BLACK } }
    :aCols[2]:bClrStd       := { || { aTextCol[2], CLR_BLACK } }
    :aCols[3]:bClrStd       := { || { aTextCol[3], CLR_BLACK } }
    :aCols[4]:bClrStd       := { || { aTextCol[4], CLR_BLACK } }
    :aCols[5]:bClrStd       := { || { aTextCol[5], CLR_BLACK } }
    :aCols[6]:bClrStd       := { || { aTextCol[6], CLR_BLACK } }
    :aCols[7]:bClrStd       := { || { aTextCol[7], CLR_BLACK } }
    :aCols[8]:bClrStd       := { || { aTextCol[8], CLR_BLACK } }
    :lContrastClr  := .F.
                   
       :CreateFromCode()
END

oBrw1:bPainted  := < |hDC|  
    // TILED   0
    // STRETCH 1
    // FILL    2
    oBrw1:SetBackGround( , nBKMode ) // nBKMode = Radioposition - 1
RETURN NIL
>
 


regards
Uwe :D
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: No registered users and 105 guests