How to add a custom dialog.

Got a problem you cannot solve? Try here.
Post Reply
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

How to add a custom dialog.

Post by bokkie »

I've created a very simple dialog which I want to insert. I can edit the dialog without a problem in the dialog editor but I can't work out how to add it to the dialogs list. I thought right-clicking User Interface -> Dialogs would do it but it seems there's no right-click context available. In the dialogs window I only have the standard list of dialogs and the Change Theme and Edit buttons. I guess this a very basic thing to do but I can't really see anything in the help index that tells me how to do it.

I'd appreciate a pointer if someone has time.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
StyX
Posts: 51
Joined: Fri Apr 11, 2008 7:14 am
Location: Stavanger, Norway
Contact:

Post by StyX »

You can at least add it if you go to MSIcode and then right click on dialogs.

There you'll see the Add Dialogs to Project option.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

StyX wrote:You can at least add it if you go to MSIcode and then right click on dialogs.

There you'll see the Add Dialogs to Project option.
Styx,

If my screenshots make it through can you review them for me. I succeeded as you suggested in adding my dialog via the MSIcode tab. Meanwhile, back in the Design tab I can't see how to add the dialog into the dialog sequence. That's the next part I want to do, assuming of course, I'm going about it in the right way to begin with.

File Attached:

<a href="files/02102009937/Styx1.png">Styx1.png
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

And here is the second screenshot.

File Attached:

Styx2.png
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

Styx,

I think you can bin this now. I think I see what I needed to do. First, adding it via the MSICode tab was the first step. I then noticed the Display Dialog statement for one of the other dialogs (I'm new to the MSIcode game) and I added another one before it for my dialog. I selected my dialog from the pulldown list and when I switched back to the dialog sequence in the Design tab, I could then see my dialog listed in the right place.

All I need to do now is to work out how to wire up the buttons going from one dialog into mine and then onto the next and then work out how to get the data inside a text box on my dialog so I can then use that to customise what my sample project would like to do. Other questions will follow... :oops:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
StyX
Posts: 51
Joined: Fri Apr 11, 2008 7:14 am
Location: Stavanger, Norway
Contact:

Post by StyX »

What I usually do is simply add the dialog directly into the code by hand after it has been added to the project (there may very well be an easier way of doing this using the UI).

So in between where I want to have the custom dialog I add this code:

Code: Select all

Label: Custom
Display Dialog: custom, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: DialogBeforeThisOne
  else
  if Variable WIZARD Equals CANCEL
    GoTo Label: FinishDialog
  end
end
After that the dialog appares in the dialog sequence.

Edit: Hint for your last post: Doubleclick the buttons
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

I see what you are getting at with your code snippet. I independently also noticed the Set Variable statement so it looks like I'd set the variables first and then wire them up to the edit controls and buttons. That seemed to work ok and it seemed to do the right things in the MSIcode and watching the variable confirmed that what I entered was indeed what the rest of the code could 'see'.

I'll keep your snippet in mind as a generic template for future use. Thanks! :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
Post Reply