Page 1 of 1

DCBROWSE refresh SIZE

Posted: Sun Apr 19, 2015 1:29 pm
by Victorio
Hi,
Please, how to refresh size of DCBROWSE if I change it after creating ?
I have DCBROWSE .... SIZE x,y

in toolbar I have changing button (zoom) which changing y for example from 200 to 400.
using oBrowse:RefreshAll() i tried...., same the DC_getrefresh()

here is little sample
@pozypa,10 DCBROWSE oBrowsepa ALIAS "CPARCELY" ;
SIZE rozxpa,rozypa PIXEL ;
NOSOFTTRACK ;
SCOPE ;
OPTIMIZE ;
CURSORMODE XBPBRW_CURSOR_ROW ;
ITEMMARKED {||Eval(bVLA),Eval(bSTA),;
DC_GetRefresh(GetList,, ;
DCGETREFRESH_TYPE_EXCLUDE,(GETLIST_BROWSE))} ;
SCROLLBARHEIGHT 12 ;
PRESENTATION aBrowPres
...
TOOLBAR :
* Zoom
DCADDBUTTON CAPTION {||cCaptionzoom} PARENT oToolbar1 ;
ACTION {||tone(1000,1),cCaptionzoom:=zoompa(),oBrowsepa:RefreshAll(), ;
oBrowsevl:RefreshAll(),oBrowsecs:RefreshAll(),;
oBrowsepa:forcestable(),oBrowsepa:refreshCurrent(),;
DC_GetRefresh(GetList) ;
}

DCREAD GUI ;
OPTIONS GetOptions ;
MODAL ;
EVAL {|o|SetAppFocus(oBrowsepa:GetColumn(1))}

Re: DCBROWSE refresh SIZE

Posted: Sun Apr 19, 2015 1:47 pm
by rdonnay
I really don't understand your question.
Are you saying that the browse rows don't refresh after zooming?
What is causing the zooming? Is it zoompa() ?

Code: Select all

DCADDBUTTON CAPTION {||cCaptionzoom} PARENT oToolbar1 ;
 ACTION {||tone(1000,1), ;
              cCaptionzoom:=zoompa(), ;
              oBrowsepa:RefreshAll(), ;          <<<<< this should refresh the oBrowsepa browse
              oBrowsevl:RefreshAll(), ;
              oBrowsecs:RefreshAll(),;
              oBrowsepa:forcestable(), ;         <<<<< you don't need this
              oBrowsepa:refreshCurrent(),;     <<<<< you don't need this
              DC_GetRefresh(GetList) ;           <<<<< you don't need this
}

Re: DCBROWSE refresh SIZE

Posted: Sun Apr 19, 2015 10:58 pm
by Victorio
browse rows refresh, but size of table is still same.
I tried HIDE, WHEN, it works , but change size not.
I will try something today, maybe I do it.

Function zoompa() only change variable Y for SIZE . (SIZE X,Y for DCBROWSE) resp. variable "rozypa"
If I click Zoom, Y change from 200 to 600 for example , and second click from 600 to 200.
Zoompa also return name for Button (ZOOM-ON, ZOOM-OFF) for cCaption.

Re: DCBROWSE refresh SIZE

Posted: Mon Apr 20, 2015 4:41 am
by Zdeno Bielik
Hi Viktor,

try something like this:

x := oBrowse:currentPos()[1], ;
y := oBrowse:currentPos()[2], ;
oBrowse:Hide(), ;
; && oBrowse:SetSize( { x/2, y/2} ), ; && half size
oBrowse:SetSize( { 400, 200 } ), ;
oBrowse:Configure(), ;
oBrowse:Show(), ;

HTH
Zdeno

Re: DCBROWSE refresh SIZE

Posted: Mon Apr 20, 2015 4:47 am
by Zdeno Bielik
ooops,

actual positions
x := oBrowse:currentPos()[1], ;
y := oBrowse:currentPos()[2], ;

actual sizes
x := oBrowse:currentSize()[1], ;
y := oBrowse:currentSize()[2], ;

Re: DCBROWSE refresh SIZE

Posted: Mon Apr 20, 2015 5:23 am
by rdonnay
Zeno gave you the correct solution.

Re: DCBROWSE refresh SIZE

Posted: Mon Apr 20, 2015 6:43 am
by Victorio
Zdeno Bielik : thanks/ďakujem

rdonnay, Zdeno Bielik : actually I modifying my source, (have some problems with switching to default position and size) but will be ok, table size is changing correctly.