Slow down drawing lazarus / 43-Android ---------------------------------------------------------------------- tango13 · 2022-04-20 20:58 Hi all, I'm using a jDrawingView to draw some simple graphics and I would like to slow down the drawing a bit. The drawing code is implemented in the onDraw event and things work as expected. However, if I try to slow the drawing process by inserting some sleep() the effect is not what I'm looking for, the process actually takes more time but I don't see the drawing progressively made, it's all drawn all at once when the function exits. Is there a way to achieve what I'm trying to do? Thanks a lot! ---------------------------------------------------------------------- lainz · 2022-04-20 22:30 Use a kind of timer, and draw each part of the drawing at specific time? ---------------------------------------------------------------------- loaded · 2022-04-21 05:38 In my experience you should use Surfaceview for such drawing operations. The work I did in this way; https://youtu.be/gBS0AMrJ50s The relevant example will give you an idea. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ....\lazandroidmodulewizard-master\demos\GUI\AppSurfaceViewDemo1 ---------------------------------------------------------------------- Seenkao · 2022-04-21 06:10 Для понимания происходящего. Всё что вы рисуете на экране, будет выводится в любом случае сразу. Для того чтоб добиться эффекта медленной прорисовки, вам надо рисовать по частям, в каждый момент времени добавляя дополнительные примитивы. Допустим вы хотите вывести квадрат, круг и треугольник, чтоб они появлялись друг за другом. Вы не можете использовать Sleep для этого в одном кадре. Вам нужно в первом кадре прорисовать квадрат. Во втором кадре прорисовать квадрат и круг. И в третьем кадре прорисовать квадрат, круг и треугольник. Между кадрами соответственно должны быть достаточные промежутки времени, чтоб это было заметно, тут можете использовать Sleep. google translate: To understand what is happening. Everything that you draw on the screen will be displayed in any case immediately. In order to achieve the effect of slow drawing, you need to draw in parts, adding additional primitives at each point in time. Let's say you want to draw a square, a circle, and a triangle so that they appear one after the other. You can't use Sleep for this in one frame. You need to draw a square in the first frame. In the second frame, draw a square and a circle. And in the third frame draw a square, a circle and a triangle. Between frames, respectively, there should be sufficient time intervals for this to be noticeable, here you can use Sleep. ---------------------------------------------------------------------- loaded · 2022-04-21 06:31 Things are different on Android. Normally, you cannot make any display on the screen before the drawing method is finished. Quote from: Seenkao on April 21, 2022, 08:10:11 amTo understand what is happening. Everything that you draw on the screen will be displayed in any case immediately. In order to achieve the effect of slow drawing, you need to draw in parts, adding additional primitives at each point in time. Let's say you want to draw a square, a circle, and a triangle so that they appear one after the other. You can't use Sleep for this in one frame. You need to draw a square in the first frame. In the second frame, draw a square and a circle. And in the third frame draw a square, a circle and a triangle. Between frames, respectively, there should be sufficient time intervals for this to be noticeable, here you can use Sleep. With your method; If you want to draw a drawing containing ~100,000 objects, drawing becomes a nuisance. But instead; If you use Surfacaview, which is designed for such work, and a thread owned by surfaceview itself. Things become very enjoyable. ---------------------------------------------------------------------- Seenkao · 2022-04-21 06:38 Вы читаете, что я пишу? Я написал для понимания, что происходит!!! Это не метод, это то, как всё это происходит. Человек в одном кадре пытается сделать задержку. Но это не может быть реализовано в одном кадре. И я ему показываю как должно происходить. Я не говорю, что ваш метод не правильный! ))) Возможно он его и выберет! Потому что это легче, чем самому что-то реализовывать. google translate: Do you read what I write? I wrote to understand what's going on!!! It's not a method, it's how it all happens. A person in one frame is trying to make a delay. But it cannot be implemented in one frame. And I show him how to do it. I'm not saying your method is wrong! ))) Perhaps he will choose it! Because it's easier than doing something yourself. ---------------------------------------------------------------------- loaded · 2022-04-21 07:08 I think there is a misunderstanding! Quote from: Seenkao on April 21, 2022, 08:38:54 amDo you read what I write? I am a very good reader! Quote from: Seenkao on April 21, 2022, 08:38:54 amI'm not saying your method is wrong! I didn't say your method was wrong either. In fact, it's a nice method for drawings with few objects. But if he wanted to draw with too many objects, he would have to choose a different method. I wanted to convey this to the relevant friend, not to you. ---------------------------------------------------------------------- tango13 · 2022-04-21 14:52 Thanks everybody for your suggestions, I'll make some test and let you know. ---------------------------------------------------------------------- tango13 · 2022-04-23 07:47 Hi all, I'm trying the SurfaceView use but don't know whether I'm doing things correctly. I started from the SurfaceView demo skeleton but I'm getting a strange behavior: the DrawInBackground event sometimes gets called with the same "process" value as the previous call and the app crashes. Am I missing something (probably  )? Thank you ---------------------------------------------------------------------- loaded · 2022-04-24 10:28 Quote from: tango13 on April 23, 2022, 09:47:36 amprevious call and the app crashes. Yes you are right, In my project, I used LAMW and Android Studio together, and I modified the Surfaceview component on the Android Studio side. That's why I never faced such a problem. I think the jSurfaceView.java file needs to be updated in LAMW. I'll try this process to fix the problem when I'm available. ---------------------------------------------------------------------- tango13 · 2022-05-04 18:28 Thanks for the info. ---------------------------------------------------------------------- jmpessoa · 2022-05-04 18:36 @loaded QuoteI modified the Surfaceview component on the Android Studio side. That's why I never faced such a problem. Please, put here your improved code... Thanks! ---------------------------------------------------------------------- loaded · 2022-05-05 20:05 Master Jmpessoa, sorry for my late reply. I've been very busy these days. Quote from: jmpessoa on May 04, 2022, 08:36:25 pmPlease, put here your improved code... First of all, I should point out that this is not enhanced code. It remains child's play next to the examples you make. I just made it to give you an idea. What I did was; Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...\lazandroidmodulewizard- master\android_wizard\smartdesigner\java\jSurfaceView.java -I replaced the Thread in the  file with Runnabble. -Then I defined a bitmap as a Buffer for the drawing operations and let the drawing operations be drawn on the screen at desired intervals. -I converted the SetDrawingInBackgroundSleeptime method directly to the screen refresh method. Don't let the name mislead you. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i package com.example.appsurfaceviewdemo1; import java.io.File;import java.io.FileOutputStream;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.PixelFormat;import android.graphics.Rect;import android.os.AsyncTask;import android.view.MotionEvent;import android.view.SurfaceHolder;import android.view.SurfaceHolder.Callback;import android.view.SurfaceView;import android.view.View;import android.view.ViewGroup;import android.util.Log;  /*Draft java code by "Lazarus Android Module Wizard" [6/3/2015 0:43:27]*//*https://github.c om/jmpessoa/lazandroidmodulewizard*//*jVisualControl template*/ public class jSurfaceView  extends SurfaceView implements Runnable /*dummy*/ { //please, fix what GUI object will be extended!     private long     pascalObj = 0;    // Pascal Object    private Controls   controls  = null; // Control Class for events    private jCommons LAMWCommon;      private Context context = null;        //private OnClickListener onClickListener;   // click event    private Boolean enabled  = true;         // click-touch enabled!     private SurfaceHolder surfaceHolder;    Paint paint;     boolean mRun = false;    long mSleeptime = 10;    float mStartProgress = 0;    float mStepProgress = 1;    boolean mDrawing = false;     //GUIDELINE: please, preferentially, init all yours params names with "_", ex: int _flag, String _hello ...      private Thread drawThread;        private Bitmap buffer;        private Canvas bcanvas,scanvas;            public jSurfaceView(Controls _ctrls, long _Self) { //Add more others news "_xxx"p arams if needed!        super(_ctrls.activity);        context   = _ctrls.activity;        pascalObj = _Self;        controls  = _ctrls;        LAMWCommon = new jCommons(this,context,pascalObj);              controls.activity.getWindow().setFormat(PixelFormat.UNKNOWN);         surfaceHolder = this.getHolder();        surfaceHolder.addCallback(new Callback() {             @Override            public void surfaceCreated(SurfaceHolder holder) {                controls.pOnSurfaceViewCreated(pascalObj, holder);                //setWillNotDraw(true); //false = Allows us to use invalidate() to call onDraw()            }             @Override            public void surfaceChanged(SurfaceHolder holder, int format, int width,  int height) {                                buffer = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);              controls.pOnSurfaceViewChanged(pascalObj,width,height);          }             @Override            public void surfaceDestroyed(SurfaceHolder holder) {                mRun = false;            }        });          /*     onClickListener = new OnClickListener(){         public void onClick(View view){  //please, do not remove mask for parse invisibility!                 if (enabled) {                    controls.pOnClick(pascalObj, Const.Click_Default); //JNI event onClick!                 }            };     };          setOnClickListener(onClickListener);          */         paint = new Paint();     } //end constructor     public void jFree() {        surfaceHolder  = null;        paint = null;      LAMWCommon.free();    }     public void SetViewParent(ViewGroup _viewgroup) {        LAMWCommon.setParent(_viewgroup);    }     public void RemoveFromViewParent() {        LAMWCommon.removeFromViewParent();    }     public View GetView() {      return this;    }     public void SetLParamWidth(int _w) {        LAMWCommon.setLParamWidth(_w);    }     public void SetLParamHeight(int _h) {        LAMWCommon.setLParamHeight(_h);    }     public void setLGravity(int _g) {        LAMWCommon.setLGravity(_g);    }     public void setLWeight(float _w) {                LAMWCommon.setLWeight(_w);    }     public void SetLeftTopRightBottomWidthHeight(int _left, int _top, int _right, int _bottom, int _w, int _h) {        LAMWCommon.setLeftTopRightBottomWidt hHeight(_left,_top,_right,_bottom,_w,_h);    }     public void AddLParamsAnchorRule(int _rule) {        LAMWCommon.addLParamsAnchorRule(_rule);    }     public void AddLParamsParentRule(int _rule) {        LAMWCommon.addLParamsParentRule(_rule);    }     public void SetLayoutAll(int _idAnchor) {        LAMWCommon.setLayoutAll(_idAnchor);    }     public void ClearLayoutAll() {        LAMWCommon.clearLayoutAll();    }       //write others [public] methods code here......    //GUIDELINE: please, preferentially, init all yours params names with "_", ex: int _flag, String _hello ...     public void DrawLine(Canvas _canvas, float _x1, float _y1, float _x2, float _y2) {        _canvas.drawLine(_x1,_y1,_x2,_y2, paint );    }     public void DrawLine(Canvas _canvas, float[] _points) {        _canvas.drawLines(_points, paint);    }     public  void DrawText(Canvas _canvas, String _text, float _x, float _y ) {        _canvas.drawText(_text,_x,_y,paint);    }     public  void DrawBitmap(Canvas _canvas, Bitmap _bitmap, int _b, int _l, int _r, int _t) {        Rect rect = new Rect(_b,_l,_r,_t); //bello, left, right, top        _canvas.drawBitmap(_bitmap,null,rect,null/*paint*/);    }     public void DrawBitmap(Canvas _canvas, Bitmap _bitmap , float _left, float _top) {        _canvas.drawBitmap(_bitmap, _left, _top, null/*paint*/);    }     public void DrawPoint(Canvas _canvas, float _x1, float _y1) {        _canvas.drawPoint(_x1,_y1,paint);    }     public void DrawCircle(Canvas _canvas, float _cx, float _cy, float _radius) {        _canvas.drawCircle(_cx, _cy, _radius, paint);    }     public void DrawBackground(Canvas _canvas, int _color) {        _canvas.drawColor(_color);    }     public void DrawRect(Canvas _canvas, float _left, float _top, float _right, float _bottom) {      _canvas.drawRect(_left, _top, _right, _bottom, paint);    }     public  void SetPaintStrokeWidth(float _width) {        paint.setStrokeWidth(_width);    }     public  void SetPaintStyle(int _style) {        switch (_style) {            case 0  : { paint.setStyle(Paint.Style.FILL           ); break; }            case 1  : { paint.setStyle(Paint.Style.FILL_AND_STROKE); break; }          case 2  : { paint.setStyle(Paint.Style.STROKE);          break; }          default : { paint.setStyle(Paint.Style.FILL           ); break; }        }    }     public  void SetPaintColor(int _color) {        paint.setColor(_color);    }     public  void SetPaintTextSize(float _textsize) {        paint.setTextSize(_textsize);    }     public void DispatchOnDraw(boolean _value) {        mDrawing = _value;        setWillNotDraw(!_value); //false = Allows us to use invalidate() to call onDraw()    }     public void SaveToFile(String _path, String _filename) {         Bitmap image = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);        Canvas c = new Canvas(image);        this.draw(c);        File file = new File (_path +"/"+ _filename);      if (file.exists ()) file.delete ();        try {            FileOutputStream out = new FileOutputStream(file);             if ( _filename.toLowerCase().contains(".jpg") ) image.compress(Bitmap.CompressFormat.JPEG, 90, out);            if ( _filename.toLowerCase().contains(".png") ) image.compress(Bitmap.CompressFormat.PNG, 100, out);             out.flush();            out.close();         } catch (Exception e) {          e.printStackTrace();        }    }     @Override    public  boolean onTouchEvent( MotionEvent event) {        int act     = event.getAction() & MotionEvent.ACTION_MASK;        switch(act) {          case MotionEvent.ACTION_DOWN: {                switch (event.getPointerCount()) {                    case 1 : { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchDown,1,                          event.getX(0),event.getY(0),0,0); break; }                  default: { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchDown,2,                            event.getX(0),event.getY(0),                            event.getX(1),event.getY(1));     break; }                }              break;}            case MotionEvent.ACTION_MOVE: {                switch (event.getPointerCount()) {                    case 1 : { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchMove,1,                          event.getX(0),event.getY(0),0,0); break; }                  default: { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchMove,2,                            event.getX(0),event.getY(0),                            event.getX(1),event.getY(1));     break; }                }              break;}            case MotionEvent.ACTION_UP: {                switch (event.getPointerCount()) {                    case 1 : { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchUp  ,1,                          event.getX(0),event.getY(0),0,0); break; }                  default: { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchUp  ,2,                            event.getX(0),event.getY(0),                          event.getX(1),event.getY(1));     break; }              }                break;}            case MotionEvent.ACTION_POINTER_DOWN: {                switch (event.getPointerCount()) {                    case 1 : { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchDown,1,                          event.getX(0),event.getY(0),0,0); break; }                  default: { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchDown,2,                            event.getX(0),event.getY(0),                            event.getX(1),event.getY(1));     break; }                }              break;}            case MotionEvent.ACTION_POINTER_UP  : {              // Log.i("Java","PUp");                switch (event.getPointerCount()) {                    case 1 : { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchUp  ,1,                          event.getX(0),event.getY(0),0,0); break; }                  default: { controls.pOnSurfaceViewTouch (pascalObj,Const.TouchUp  ,2,                            event.getX(0),event.getY(0),                          event.getX(1),event.getY(1));     break; }              }                break;}        }        return true;    }     public void SetHolderFixedSize(int _width, int _height) {        surfaceHolder.setFixedSize(_width, _height);    }     public Canvas GetLockedCanvas() {        return surfaceHolder.lockCanvas();    }   public void UnLockCanvas(Canvas _canvas) {        if(_canvas != null) {            surfaceHolder.unlockCanvasAndPost(_canvas);        }    }     //invalidate(): This must be called from a UI thread.     //To call from a non-UI thread, call  postInvalidate().      //http://blog- en.openalfa.com/how-to-draw-graphics-in-android    //http://blog.danielnadeau.io/2012/01/android-canvas-beginners- tutorial.html              //http://www.edu4java.com/en/androidgame/androidgame3.html        public void PostInvalidate() {        this.postInvalidate();    }     public void Invalidate() {        this.invalidate();    }     public void SetKeepScreenOn(boolean _value) {        surfaceHolder.setKeepScreenOn(_value);    }     //Set whether this view can receive the focus.    //Setting this to false will also ensure that this view is not focusable in touch mode.    public void SetFocusable(boolean _value) {        this.setFocusable(_value); // make sure we get key events    }     public void SetProgress(float _startValue, float _step) {        mStartProgress = _startValue;      mStepProgress =  _step;    }      public void DoDrawingInBackground(boolean _value) {        if (!mRun) {          setWillNotDraw(!_value);                         mRun = _value;                      drawThread = new Thread(this, "Draw thread");                      drawThread.start();             }                   }   @Override    protected void onDraw(Canvas canvas) {                      buffer = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);                        bcanvas = new Canvas(buffer);                    bcanvas.drawColor(0xFFFFFFFF);                   Log.i("* SurfaceView onDraw",this.getWidth()+ "x" + this.getHeight());                        controls.pOnSurfaceViewDraw(pascalObj, bcanvas);    }  @Override    public void run()    {                Log.i("* SurfaceView run"," run start");                mRun = true;                this.postInvalidate();                Log.i("* SurfaceView run"," run stop");    }      public void SetDrawingInBackgroundSleeptime(long _sleepTime) { //long mSleeptime = 20;    scanvas = surfaceHolder.lockCanvas();    scanvas.drawBitmap(buffer, 0, 0, paint);        surfaceHolder.unlockCanvasAndPost(scanvas);    Log.i("* SurfaceView SetDrawingInBackgroundSleeptime","SetDrawingInBackgroundSleeptime " + _sleepTime);     }        public Bitmap GetDrawingCache() {        this.setDrawingCacheEnabled(true);        Bitmap b = Bitmap.createBitmap(this.getDrawingCache());        this.setDrawingCacheEnabled(false);        return b;    } } //end class  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ....AppSurfaceViewDemo1\jni\unit1.pasI changed the sample demo file as follows. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {Hint: save all files to location: C:\adt32\eclipse\workspace\AppSurfaceViewDemo1\jni }unit unit1; {$mode delphi} interface uses  Classes, SysUtils, And_jni, And_jni_Bridge, Laz_And_Controls,    Laz_And_Controls_Events, AndroidWidget, surfaceview, imagefilemanager; type   { TAndroidModule1 }   TAndroidModule1 = class(jForm)    jButton1: jButton;    jButton2: jButton;    jImageFileManager1: jImageFileManager;    jSurfaceView1: jSurfaceView;    jTextView1: jTextView;    procedure AndroidModule1Close(Sender: TObject);    procedure AndroidModule1JNIPrompt(Sender: TObject);    procedure jButton1Click(Sender: TObject);    procedure jButton2Click(Sender: TObject);    procedure jSurfaceView1DrawOutBackground(Sender: TObject; progress: single);    procedure jSurfaceView1SurfaceCreated(Sender: TObject);    procedure jSurfaceView1SurfaceDraw(Sender: TObject; canvas: jObject);    procedure jSurfaceView1TouchDown(Sender: TObject; Touch: TMouch);    procedure jSurfaceView1TouchUp(Sender: TObject; Touch: TMouch);   private    {private declarations}    FX1, FY1: single;    FX2, FY2: single;    FInBackground: boolean;   public    {public declarations}  end;   function GetLemurJourney(x: single): single; var  AndroidModule1: TAndroidModule1;  GlobalImage: jObject;  cc:integer=0; implementation {$R *.lfm} { TAndroidModule1 }    function GetLemurJourney(x: single): single;begin   Result:= x;end; procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);begin  GlobalImage:= jImageFileManager1.LoadFromAssets('lemur.jpg');  GlobalImage:= Get_jObjGlobalRef(GlobalImage);end; procedure TAndroidModule1.jSurfaceView1SurfaceCreated(Sender: TObject);var   canv: jObject;begin   FInBackground:= False;   ShowMessage('Surface Created ...');   canv:= jSurfaceView1.GetLockedCanvas();   jSurfaceView1.DrawBackground(canv, colbrLightCyan);   jSurfaceView1.SetPaintTextSize(36);   jSurfaceView1.DrawText(canv, 'Hello World!',300,300);   jSurfaceView1.UnLockCanvas(canv);end;  //simple/trivial drawprocedure TAndroidModule1.jButton1Click(Sender: TObject);begin  FX1:= 100;  FY1:= 100;  FX2:= 250;  FY2:= 500;  jSurfaceView1.DispatchOnDraw(True); //true = Allows SurfaceView use Refresh()/Invalidate() to call onDraw() event!  jSurfaceView1.Invalidate();         //must be called from a main UI threadend; procedure TAndroidModule1.jButton2Click(Sender: TObject);begin  FX1:= 0;  FY1:= 0;  FInBackground:= True;  jSurfaceView1.DispatchOnDraw(true);  jSurfaceView1.DoDrawingInBackground(True);  //fires  OnDrawingInBackgroundRunning  !!end;  //simple/trivial Ondraw event handleprocedure TAndroidModule1.jSurfaceView1SurfaceDraw(Sender: TObject; canvas: jObject);var   i:integer;begin   jSurfaceView1.DispatchOnDraw(false);   jSurfaceView1.DrawBackground(canvas,colbrLightBlue);   inc(cc);   for i:=0 to Random(750)+100 do   begin     jSurfaceView1.DrawBitmap(canvas, GlobalImage, Random(jSurfaceView1.Width), Random(jSurfaceView1.Height));     jSurfaceView1.DrawLine(canvas, FX1, FY1 , i, i);     jSurfaceView1.DrawText(canvas,cc.ToString,300,50);     jSurfaceView1.SetDrawingInBackgroundSleeptime(i); //default/min = 20 miliseconds   end;    jSurfaceView1.SetDrawingInBackgroundSleeptime(-1); //default/min = 20 milisecondsend;   procedure TAndroidModule1.jSurfaceView1DrawOutBackground(Sender: TObject;  progress: single);begin  ShowMessage('The Game is Over...!');  FInBackground:= False;end; procedure TAndroidModule1.jSurfaceView1TouchDown(Sender: TObject; Touch: TMouch);begin  if not FInBackground then ShowMessage('Touch: X='+ FloatToStr(Touch.Pt.X) + ' Y='+FloatToStr(Touch.Pt.Y) );end; procedure TAndroidModule1.jSurfaceView1TouchUp(Sender: TObject; Touch: TMouch);begin  //end; procedure TAndroidModule1.AndroidModule1Close(Sender: TObject);begin  Delete_jGlobalRef(GlobalImage);end; end.  Also, according to my observations, the crash problem in the original example was also fixed. Respects ---------------------------------------------------------------------- Mongkey · 2022-05-16 00:05 , thank you @loaded ---------------------------------------------------------------------- jmpessoa · 2022-05-16 03:26 @ loaded QuoteI converted the SetDrawingInBackgroundSleeptime method directly to the screen refresh method. Don't let the name mislead you. Can you suggest a "good" method name?    (Don't let the name mislead us...) Thank you! ---------------------------------------------------------------------- loaded · 2022-05-16 07:16 Quote from: jmpessoa on May 16, 2022, 05:26:44 amCan you suggest a "good" method name?    (Don't let the name mislead us...) In my own application I call this method with the name "Refresh". Yet you know best, Master Jmpessoa. Respects.