[DUG]: How do I refer back to a calling form?

2003-02-25 Thread Dave . Jollie
Hi everyone I have a form (MainForm) which calls a function in a unit I'm creating, called DatabaseUtils. I want this unit to be able to have access to the public variables etc. of the calling form, without needing to hardcode into the DatabaseUtils unit, uses MainForm. Any form could have called

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Paul Mckenzie
pass a Sender parameter Regards Paul McKenzie Analyst Programmer SMSS ltd. - Original Message - From: [EMAIL PROTECTED] To: Multiple recipients of list delphi [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:07 AM Subject: [DUG]: How do I refer back to a calling form? Hi

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Steve Peacocke
I have a form (MainForm) which calls a function in a unit I'm creating, called DatabaseUtils. I want this unit to be able to have access to the public variables etc. of the calling form, without needing to hardcode into the DatabaseUtils unit, uses MainForm. Any form could have called my new

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Dave . Jollie
Hi Paul Yes I thought it was that basic, but it doesn't work for me. :-( Some code snippets from MainForm.pas: type TMainForm = class(TForm) UV: TUVObjects; ... procedure TMainForm.UpdateWMS(PolNum: string); ... NewCorrKey := WriteNewCorrRecord(Sender,CORR,CORI,PolNum); // this calls

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Robert Martin
Type sender as TMainForm(Sender).uv etc Why not pass UV directly ? Rob Software engineer Wild Software Ltd Ph 03 377-0495 - Original Message - From: [EMAIL PROTECTED] To: Multiple recipients of list delphi [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:38 AM Subject: RE:

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Paul Mckenzie
If you are doing this sort of thing - i.e. accessing objects contained in the Form Code from DatabaseUtils.pas: function WriteNewCorrRecord(Sender: TObject; CORR, CORI: integer; PolNum: string): string; begin if Sender.UV.ReadRecord(CORI,PolNum) then... Why not pass the object UV

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Stephen Barker
further to what Rob said: it is not clear from your main form code snippet what 'sender' is so try something like: NewCorrKey := WriteNewCorrRecord(Self.UV,CORR,CORI,PolNum); // this calls DatabaseUtils.pas Code from DatabaseUtils.pas: function WriteNewCorrRecord(UV: TUVObjects;

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Dave . Jollie
Thanks everyone. I've worked with Robert's comments on avoiding tight coupling and Paul's comments below, and changed my approach. I now only pass PolNum and my datamodule gets its own UV object to work with (UV contains all the procedures and methods for writing to our Universe database). So now

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread David Brennan
Dave, Robert Martin is right in that you probably shouldn't be doing this. If DatabaseUtils accesses MainForm then it isn't really generic database utilities at all. I think you should probably pass parameters you need, such as UV, into the procedure instead. To answer your question tho... there

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Robert Martin
Sounds good to me :) Rob Software engineer Wild Software Ltd Ph 03 377-0495 - Original Message - From: [EMAIL PROTECTED] To: Multiple recipients of list delphi [EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 11:40 AM Subject: RE: [DUG]: How do I refer back to a calling form?

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Myles Penlington
To answer your question tho... there isn't really any way that you can get the code in DatabaseUtils.pas to directly access properties declared in TMainForm without having MainForm.pas in your uses clause (which obviously you don't want for generic database utilities). Having said that there are

Re: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread Kurt at iadvance
[EMAIL PROTECTED] wrote: Thanks everyone. I've worked with Robert's comments on avoiding tight coupling and Paul's comments below, and changed my approach. I now only pass PolNum and my datamodule gets its own UV object to work with (UV contains all the procedures and methods for writing to our

RE: [DUG]: Arrow keys

2003-02-25 Thread Max Nilson
Rohit Gupta asked: I have a component descended from TCustomPanel. Its keydown just does not see the arrow keys what gives. I have examined other controls but can not figure out the missing magic. The arrow keys are being eaten by the TCustomForm.CMDialogKey processing. If you want to

RE: [DUG]: How do I refer back to a calling form?

2003-02-25 Thread David Brennan
Myles, This is not quite correct? Mmmm, maybe I am just being pedantic but further on my email did actually mention that you could achieve this by using RTTI. However I don't think it is a good solution as it is comparitively slow, bypasses the normal type checking and is just generally messy.

[DUG]: RxTrayIcon1

2003-02-25 Thread Alistair George
Hi all just figured it out for myself: RxTrayIcon1.Icon.Assign(RxTrayIcon1.icons[0]); //desired icon within [] --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website:

[DUG]: RxTrayIcon1.Icons

2003-02-25 Thread Alistair George
Hello Matt, Thanks! But of course it is always a better feeling to suss it out yourself. MD RxTrayIcon1.Icon := RxTrayIcon1.Icons[ x ]; BTW appreciate comments from others on Q I asked before. Sorry I am not contributing much knowledge in this group but over the last years my skills have

Re: [DUG]: RxTrayIcon1

2003-02-25 Thread Matt Dee
Hi all just figured it out for myself: RxTrayIcon1.Icon.Assign(RxTrayIcon1.icons[0]); //desired icon within [] Just make sure you've already created and assigned an Icon to RxTrayIcon1.Icon, otherwise the call to assign will fail. (I think :-)

[DUG]: Paramstr(1)

2003-02-25 Thread Alistair George
Passing command line to the app is easy. But unfortunately there is a problem that the form is not created yet, so you cannot pass parameters to the component settings (my parameter contains a bunch of settings). The obvious easy solution would be to start a timer in the program which fires a

RE: [DUG]: Paramstr(1)

2003-02-25 Thread Jeremy Coulter
You could intergegate the paramstr's in the dpr file before the application.createform bit etc. Jeremy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair George Sent: Wednesday, 26 February 2003 19:19 To: Multiple recipients of list delphi Subject:

Re: [DUG]: Paramstr(1)

2003-02-25 Thread Chris Milham
Hi Alistair, You are able to call paramstr() anywhere in your app so why not just use it in the constructor or show event of your form? HTH, Chris Alistair George wrote: Passing command line to the app is easy. But unfortunately there is a problem that the form is not created yet, so you

Re[2]: [DUG]: Paramstr(1)

2003-02-25 Thread Alistair George
Hello Chris, CM You are able to call paramstr() anywhere in your app so why not just use CM it in the constructor or show event of your form? CM HTH, Realised that, but I think the SHOW event is actually before the form is shown. Anyway, it doesnt work there! Ta, Al+