Share your advanced knowledge/code with the community.
User avatar
Posts: 599
Joined: Mon Feb 24, 2014 10:17 pm


by Peter Thu Jun 08, 2017 10:09 am


if you want to block your UI (because you have a long running background process like HttpRequest or something else) you can use the $.blockUI() - Command (in JavaScript mode).

Here is a sample code how to use it:
Code: Select all

Procedure BlockUI(Message.s)
  ! $.blockUI({ message: v_message });

Procedure UnblockUI()
  ! $.unblockUI();

Procedure TimerEvent()
  RemoveWindowTimer(#Window, #Timer) 

Procedure ButtonEvent()
  BlockUI("<h1>Waiting 3 seconds...</h1>")
  AddWindowTimer(#Window, #Timer, 3000) ; Wait 3 Seconds...
  BindEvent(#PB_Event_Timer, @TimerEvent(), #Window)

OpenWindow(#Window, 0, 0, 300, 100, "BlockUI example", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)

ButtonGadget(#Button, 10, 10, 200, 30, "Block UI for 3 seconds")

BindGadgetEvent(#Button, @ButtonEvent())

You can get further informations here:

Greetings ... Peter
User avatar
Posts: 274
Joined: Wed Aug 19, 2015 3:02 pm
Location: United Kingdom

Re: BlockUI

by SparrowhawkMMU Mon Dec 18, 2017 8:50 am

+1 very useful and cleaner than what I am currently using.
Posts: 100
Joined: Mon Jul 13, 2015 7:40 am

Re: BlockUI

by bbanelli Tue Jan 02, 2018 9:21 pm

Fantastic trick n' tip, Peter, as always!!!
"If you lie to the compiler, it will get its revenge."
Henry Spencer
Posts: 29
Joined: Sat Mar 24, 2018 1:33 pm

Re: BlockUI

by munfraid Sat Jun 23, 2018 12:50 pm

Thanks very much for this great Tip, Peter! It's so easy and works like charme. I put a spinner using this code:

Code: Select all
BlockUI("<p><i class='fa fa-spinner fa-spin fa-4x' aria-hidden='true'></i></p>")

The spinner is shown, but any idea how I can remove the white box in the background? Would like to show just the spinner itself.
Return to Tricks 'n' Tips

Who is online

Users browsing this forum: No registered users and 2 guests