Unit Curtain |
C U R T A I N Hergestellt von der KAP Dipl.-Ing. Holger Lembke Hamburger Straße 284 38114 Braunschweig Germany Telefon: +49-531-334676 Fax: +49-531-340215 0. Sorry ======== You might find some German words, funny english words or even complete stupid sentences. I´m sooo sorry. Please send me the correct version, if it hurts too much. 1. What is Curtain ================== You know the problem: procedure Tform.Button1Click(Sender: TObject); Var i : integer; begin for i:=1 to 1000 do begin { loop } dosomething; application.processmessages; end; end; During this loop, the user can still click on every tbutton, tlistbox, tcheckbox etc. on the form. Focuses can be change, tcheckbox.checked will change, all other clicks will be executed at the end of the loop. Not very funny. The user gets puzzled, the program perhaps didn´t work. Just another problem: procedure Tform.Button1Click(Sender: TObject); Var i : integer; begin anotherform.show; {<------} for i:=1 to 1000 do begin { loop } dosomething; application.processmessages; end; anotherform.hide; {<------} end; Now you show a "please wait"-dialog. But it doesn´t help! The user can switch back to the form and press buttons, click in lists etc. CURTAIN offers a very simple solution: It places a curtain over the form, that looks a bit like a greyed dialog. So the user can see the dialog, he can click on it but nothing happens. This is it. Not very much, but a great help. You will love it! Usage is easy: procedure Tform.Button1Click(Sender: TObject); Var i : integer; begin addcurtaintoform(self); {<=======} for i:=1 to 1000 do begin dosomething; application.processmessages; end; removecurtainfromform(self); {<=======} end; Or, if you like it as a TComponent, drop it into a form and use it like that: procedure Tform.Button1Click(Sender: TObject); Var i : integer; begin curtain1.onoff:=csclosed; {<=======} for i:=1 to 1000 do begin dosomething; application.processmessages; end; curtain1.onoff:=csopen; {<=======} end; 2. Using Curtain ================ YOU ARE NOT ALLOWED TO USE CURTAIN IN ANY COMMERCIAL PRODUKT WITHOUT BUYING IT. Hereby you get the full source code. You can test it, see how it works, whether it fits your demands. You are allowed to use it for free products. But if Curtain is included in any product you earn money with, you MUST buy it.
Classes |
TCurtain -
Functions |
addcurtaintoform - **********************************************************************************) (
**********************************************************************************) (
Register - **********************************************************************************) (
**********************************************************************************) (
removecurtainfromform - **********************************************************************************) (
Types |
Constants |
Variables |
Functions |
**********************************************************************************) (
**********************************************************************************) (
Types |
curtainstate = (csopen, csclosed);**********************************************************************************) (
Constants |
Variables |