This addin was a response to the request for a way to preview dialogs. However I am not sure how I can make sure that there is a dialog in the topmost MDI child. This is the first test, try it out and tell me if there are any problems. Select Preview from the project menu, I will make this a button on the toolbar when I am done.

REQUIRED:

The dialog you wish to preview *must* be in the topmost MDI child !!!

Please report any problem controls that you might find :)
Posted on 2004-03-16 11:19:42 by donkey
I took a bit of time and added a button to the toolbar instead of the menu item. New upload, there was only one download.

Added the dialog messages to the dispatch loop so the preview would act more like a dialog, there were 2 downloads.
Posted on 2004-03-16 12:47:21 by donkey
Hi Donkey

An easy way to check if the topmost mdi is a dialog is to check the hDialog member of the ADDINHANDLES structure.

Bugs:

- Font size always 10pt MS Sans Serif. Will WM_GETFONT on hDialog work?
- Groupbox always positioned at 0,0
- Dialog style not correct

KetilO
Posted on 2004-03-16 16:09:34 by KetilO
Hi Ketil,

I'll check the hDialog member of the structure.

1> I'll try, I had tried with the controls and got 0 returned
2> I'll look at why I can't get the WindowRect for GroupBoxes
3> Saving the dialog for last, it requires alot of tests to make sure it can still close.

Is there a way I can distinguish from static child controls and ones that RadASM adds for sizing etc...
Posted on 2004-03-16 16:19:59 by donkey
Hi Ketil,

Ok, I think I have most of the issues worked out. The problem was that the groupbox was a child of a static and I used GetParent to get the handle for the ScreenToClient coordinate transform. This resulted in a top/botton of 0,0. After trying GetAncestor with no success I simply save the handle of the dialog and use that to perform the transform. In order to make everything work, I now check every static to see if it has children, if it does it is not added to the preview. This appears to have solved most of the problems.

Just as a suggestion, it would be good if you could superclass the static control and give a different class name to controls you add to the dialog. It would be much simpler to sort through the controls and exclude the ones that RadASM adds. For example it is not possible to programatically distinguish between the sizing static and one that is user added so I have to leave them in the preview.

New upload.
Posted on 2004-03-16 22:03:06 by donkey
Populated treeview and listviews to make the dialog look a little more complete when displaying these controls. The listview is populated for all modes.

New upload
Posted on 2004-03-17 19:34:34 by donkey
Hi Donkey, your addin very cool :alright:

I found some error (May be you've know those bugs) :grin: :
+ When i draw some controls into form in resource editor, i select one control and press Dialog Preview, around that cotrol still have the selection.
+ I add Group box or Image , and in Dialog preview, i resize dialog , Minimize or Maximize, somesthings wrong.

Waitting for the next release of this cool addin. :)

Regard
Posted on 2004-03-21 06:38:44 by neverending
Hi Neverending,

As I said way up there,

For example it is not possible to programatically distinguish between the sizing static and one that is user added so I have to leave them in the preview.


Those small squares are the sizing statics, they are actually a static control and I have no way of knowing which static controls are yours and which are RadASM's so I leave them all in. Just click on an empty spot on the dialog before previewing.

I will study the style of the groupbox, unfortunately the groupbox presents it's own problems as it is the child of another control so I have to see what property is causing it not to be redawn properly. Should be something simple to find and correct.
Posted on 2004-03-21 07:22:36 by donkey
I have added a couple more special cases, the groupbox is fixed as well as the simple combobox.
Posted on 2004-03-21 07:54:34 by donkey
I think it must be in more intuitive place, not in a toolbar end somewhere. Could Ketil add this button somewhere near controls and make it more visible. Besides, menu selection would help a lot.
Posted on 2004-04-16 02:45:03 by Ulterior

I think it must be in more intuitive place, not in a toolbar end somewhere. Could Ketil add this button somewhere near controls and make it more visible. Besides, menu selection would help a lot.


Hi Ulterior,

Well, you're asking the wrong guy, I'm a big fan of toolbars :grin:

The toolbar is fully customizable, you can just move the button where you want on the main toolbar

Seriously though, I guess if you want it somewhere else you can modify the addin, it has the source attached and is pretty clear. For myself I don't like menus and the Dialog Tools toolbar is reserved for dialog controls. Besides my Dialog tools are just about full, I have many of my own classes on it. As for a menu item, there are far too many menu items already and I tend to find long menus annoying. At any rate, I'm sorry but I don't plan on reopening the project, I have too many others in the works right now.
Posted on 2004-04-16 02:58:01 by donkey