Jump to content

Recommended Posts

Posted

Hi there!

 

I am having a strange behavior, I have created a new component that is similar to UNIDBNAVIGATOR.

 

I used the concept of compound components, then I have a TUniFrame as the base and created TUniImages as the buttons.

 

I wanted to have Flat Images, so the TUniImage works for that, and responds to the OnClick event.

 

Everything fine here,

 

I have placed those TUniImage on my TUniFrame and assigneded the OnClick:

  uiCancel.OnClick   := OnDBCommandClick;
  uiRefresh.OnClick  := OnDBCommandClick;
  uiPost.OnClick     := OnDBCommandClick;
  uiDelete.OnClick   := OnDBCommandClick;
  uiInsert.OnClick   := OnDBCommandClick;
  uiNext.OnClick     := OnDBCommandClick;
  uiPrevious.OnClick := OnDBCommandClick;

Based on that I receive the command and change my DataSource just fine.

 

However I dont want to have those "buttons" enabled always, for that:

procedure TNaharWebDBNavigator.UpdateButtonsState;
begin
  if Not Assigned(FDataSource) then
    exit;

  if not Assigned(FDataSource.DataSet) then
    exit;

  case FDataSource.DataSet.State of
    dsInactive :
      begin
        uiPrevious.Visible  := false;
        uiNext.Visible      := false;
        uiInsert.Visible    := false;
        uiDelete.Visible    := false;
        uiPost.Visible      := false;
        uiRefresh.Visible   := false;
        uiCancel.Visible    := false;
      end;
    dsBrowse :
      begin
        uiPrevious.Visible  := true;
        uiNext.Visible      := true;
        uiInsert.Visible    := true;
        uiDelete.Visible    := true;
        uiPost.Visible      := false;
        uiRefresh.Visible   := true;
        uiCancel.Visible    := false;
      end;
    dsInsert, dsEdit :
      begin
        uiPrevious.Visible  := false;
        uiNext.Visible      := false;
        uiInsert.Visible    := false;
        uiDelete.Visible    := false;
        uiPost.Visible      := true;
        uiRefresh.Visible   := false;
        uiCancel.Visible    := true;
      end;
    else
    begin
      uiPrevious.Visible  := false;
      uiNext.Visible      := false;
      uiInsert.Visible    := false;
      uiDelete.Visible    := false;
      uiPost.Visible      := false;
      uiRefresh.Visible   := false;
      uiCancel.Visible    := false;
    end;
  end;

end;

Testing it, it does now works correctly, the buttons (TUniImage) do not get hide or visible correctly. 

 

My component keep all of them visible for the first time, and in Loaded update the status.

 

I see it changing the visible on the first time correctly. But after that there is not way to work correctly. The visible property is changed on the program but it is not reflected on the extjs side.

 

Is there a way to force an update of the properties from the delphi side to extjs?

 

Or, what is wrong?

 

Eduardo

 

 

  • 12 years later...
Posted

Hi!

I have exactly the same issue. The visible property of UnimImage sometimes has no effect. I was searching the forum, but I only found this topic. is there any solution?

The only workaround I've found is to create the UnimImage every time it should be visible and to free it, when it should be non visible. Not my prefered solution...

Best regards
Mike

Posted

Hi Mike,

I toggled TUnimImage.Visible many times (including reloading the picture in the same request) and it hid/showed every time — I couldn't catch the intermittent miss here.

Which uniGUI version are you on, and could you share a small test case (and roughly how often / in what situation it fails) so I can reproduce it?

Posted

Hi Sherzod,

I use v1_90_0_1551.

This behaviour is not reproducible. 

I use a picture of an egg timer to make clear, that the program is busy and the user has to wait. During that, I start a REST Api call to an AI-model, which creates an image (it's another bigger image, which lays under the egg timer-image). After the new image is loaded and shown, I set "visible:=false" of the egg timer-image. Sometimes it works, sometimes the egg timer-image remains on the screen (the user thinks that he still have to wait 🙂 ).
It seems, that the property is completely ignored in this case. I did some tests with a timer, which set the visible property to false after some seconds, but that worked neither.

Now I create the image every time I need it new, and free it after the waiting period. I can live with that solution and I think, that we have to live with that.

Best regards

Mike

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...