Changing NVLabel content on form action handler

delphi package - automated exception handling
Post Reply
benok
Posts: 9
Joined: Thu Oct 29, 2015 12:53 am

Changing NVLabel content on form action handler

Post by benok »

Hi again :-),

I want to add a wizard page to confirm the users what is sent to the developer.
I want to change the label text by the user selection of the ScreenShot page.

First, I tried to use the action handler of the confirmation page with the "nvaFormShow" event,
but the label text can't change from this event.

(I'm happy if you support changing label content from the nvaFormShow/nvaItemEvent event,
but it seems difficult as you say here.)

1. So, I want to add "nvaFormBeforeShow" event to madNVAssistant.pas.
How can I achieve this?

I tried to add "madNVAssistant.pas" to my Project like your post here, but no luck. (it depends on other sources).

2. Is there any document or a post to recompile dcu's from the modified source?
I think we are happy to have a batch file for recompile to tweak madExcept's source code a little.
Could you provide something like this?
madshi
Site Admin
Posts: 10857
Joined: Sun Mar 21, 2004 5:25 pm

Re: Changing NVLabel content on form action handler

Post by madshi »

It's been many years since I worked on that part of the madExcept code, so my memory is a bit shady. I think you should be able to use the following callback exported by madNVAssistant.pas:

Code: Select all

var
  OnAssistantCreate : procedure (const assistant: INVAssistant; const exception: IUnknown) = nil;
You should be able to modify the forms/labels in this callback by using the INVAssistant methods.

As an alternative, you can recompile the madExcept source code yourself. You'll need to copy pas files you want to recompile into your project folder - together with the mad.inc file.
benok
Posts: 9
Joined: Thu Oct 29, 2015 12:53 am

Re: Changing NVLabel content on form action handler

Post by benok »

I tried OnAssistantCreate first, but it's called only once before showing the first page.
So I can't use that event for modifying the page label by the user selection of the previous page.
As an alternative, you can recompile the madExcept source code yourself.
You'll need to copy pas files you want to recompile into your project folder - together with the mad.inc file.
You mean, all I have to do is add all the pas/inc files to my project, right?
I will try this later but, are there any pitfalls?
madshi
Site Admin
Posts: 10857
Joined: Sun Mar 21, 2004 5:25 pm

Re: Changing NVLabel content on form action handler

Post by madshi »

I think the assistant is created in its entirely, or do I remember that incorrectly? It's been a very long time since I implemented it. If it's created in its entirety - with all pages - before OnAssistantCreate is called, you should be able to modify the label.

You probably don't even need to copy *all* the pas files in, but just those you want to modify. The only pitfall is that if you install a new madExcept build, you'll have to redo all changes.
benok
Posts: 9
Joined: Thu Oct 29, 2015 12:53 am

Re: Changing NVLabel content on form action handler

Post by benok »

Thank you for your advice.
I will give it a try! :-)
Post Reply