Topic: Modeless window

Is it possible to have a Modeless window in MVD, if so how?

Adam
God... please help me become the person my dog thinks I am.

Re: Modeless window

Yes, but only using script, example:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    Form2.Show;
end;
Dmitry.

Re: Modeless window

Great.. Thanks a lot  Dmitry.........

Adam
God... please help me become the person my dog thinks I am.

Re: Modeless window

Hi Dmitry,


I Could't get it work

Post's attachments

Attachment icon Modeles Window.zip 3.18 kb, 380 downloads since 2016-09-15 

Adam
God... please help me become the person my dog thinks I am.

Re: Modeless window

Hello Adam,
I think there are two things that you need to look at.
1.   In your script, you are calling 'form2.show'  from the form1_button1_onclick procedure but you have attached the form1_button1_onclick procedure to form1 itself (form1_onclick).  As far as I know, this can only happen if you have copied it from somewhere else and pasted it to the wrong object/event.
2..  You have a 'new record' action attached to form1.button1.  I don't understand why you would want a 'new record' action AND a script event to both call form2.
Derek.

Re: Modeless window

Hi Derek,

I wanted to have  modeless window/s but implementation of Dmitry's script by me obviously incorrect.

Adam
God... please help me become the person my dog thinks I am.

7 (edited by AD1408 2016-09-16 20:54:18)

Re: Modeless window

AD1408 wrote:

Hi Dmitry,


I Could't get it work


https://s21.postimg.org/q13z107bb/modeless_win.png

Adam
God... please help me become the person my dog thinks I am.

Re: Modeless window

Hi Adam,
If that is all you are wanting to do, I'm not sure why you need to have a separate form at all.  Can you not just put your memo1, edit 1 and 2 buttons all on the same form?  It doesn't matter if they are doing fundamentally different things - they can happily co-exist.
If you want the visual effect of edit1 and the 'run' button appearing and disappearing, then simply make them invisible until called with an event attached to the 'Add Inputs' button.
Have a look at the attachment and see if that's the sort of thing you're after.
Derek.

Post's attachments

Attachment icon Modeles Window.zip 335.63 kb, 361 downloads since 2016-09-16 

9 (edited by AD1408 2016-09-16 23:52:02)

Re: Modeless window

Hi Derek,


Thanks a lot for your suggestion.


I have some uses for Modeless windows. Dmitry was kind enough to supply a script for it but it didn't work for me, or more likely I couldn't implement it correctly.


However, your suggestion is valuable to me. It'll go in my Rough Guide to MVD help file.


I have updated modeles window project with an example usage info on forms.

Post's attachments

Attachment icon Modeles Window.zip 3.18 kb, 368 downloads since 2016-09-17 

Adam
God... please help me become the person my dog thinks I am.

Re: Modeless window

Hi Adam,
Following on from your previous posts about putting the contents of a text file into a memo field and now your latest post about wanting to give the user more detailed instruction when filling in a form, you can always link a help text file to specific fields - so the effect is leading them, step by step, through the form.
Attached is a way I've done it in a couple of applications (but there are many different ways of achieving similar effects).
Also, and apologies if you know this already, you can also add 'hints' to any object;  if your 'help message' is brief, this is the quickest and easiest way to add instructions (in the attached example, if you hover the mouse over any of the input fields, you'll see how it works).
Hope this helps,
Derek.

Post's attachments

Attachment icon Modeles Window options.zip 339.51 kb, 390 downloads since 2016-09-17 

Re: Modeless window

Hi Derek,


Many thanks for another great lesson. This one went in my Rough Guide to MVD help file too, of course credited to you.


Your previous help on displaying text file in a memo was great. I'm using it for displaying license text  on about window.


For modeless window context help was just an simple example. I have different uses in mind, such as adding / editing a record on modeless window and viewing saved records on another window while both are accessible (one at a time). This may create further complications in respect of refreshing windows but it may also be overcome with you guys help.

Adam
God... please help me become the person my dog thinks I am.