Jump to content

ScreenMask without text


M477H13U

Recommended Posts

Hello UniGUI users ! (:

 

Basically our project is a desktop. We would like to add a ScreenMask (just the loading icon, no text) on our shortCut only when user double click these shortCut.

 

For now, I manage to get the following rendering:

 

post-4875-0-81411500-1521628295.png

with ScreenMask do
  begin
  Opacity := 0.5;
  Target := FuniImage;
  Enabled := True;
  ScreenMask.Message := '</br>';
  WaitData := True;
end;
  1. But the loading icon is not centered. How could I achieve something like that ?
  2. How could I force screenMask to be shown only on double click ? Because currently, if you click or right click, it is apparent..

Thanks for you help !  ^_^

Link to comment
Share on other sites

Hi,

 

Can you try this approach?!:

 

FUniImage

 

1.

function afterrender(sender, eOpts)
{
    sender.el.dom.addEventListener('contextmenu', function(e){ajaxRequest(sender, '_contextmenu', ['x='+e.layerX, 'y='+e.layerY])});
}

2.

function dblclick(sender, eOpts)
{
    if (sender.uniMask) {
        sender.uniMask.ldMask=true;
    };
}

3.

procedure TMainForm.FUniImageAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = '_contextmenu' then
  begin
    FPopupMenu.Popup(Params.Values['x'].ToInteger(), Params.Values['y'].ToInteger(), Sender);
  end;

end;

MainForm

procedure TMainForm.InternalMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  {sleep(500);
  if Button = mbRight then
  begin
    FPopupMenu.Popup(X, Y, Self);
  end}
end;
procedure TMainForm.InternalOpen(Sender: TObject);
begin
  //Do stuff
  sleep(2000);

  FUniImage.JSInterface.JSCode('var me='#1'; if (me.uniMask){me.uniMask.ldMask=false};');

end;
procedure TMainForm.UniFormReady(Sender: TObject);
begin
  FUniImage.JSInterface.JSCode('var me='#1'; if (me.uniMask){me.uniMask.ldMask=false};');
end;
Link to comment
Share on other sites

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...