Choose your top Archicad wishes!

Read more
Archicad C++ API
About Archicad add-on development using the C++ API.

[SOLVED] Changing a Modal Dialog size

Anonymous
Not applicable
Hi

I have a modal dialog defined in a GRC file with a fixed width/height. This dialog has been unchanged for 12 months, however now I need to add 5 fields to it - so the height needs to be increased. But when I increase the height in the GRC file it "remembers" the old height.

The GRC set up the modal dialog as:
'GDLG'  32580    Modal | normalFrame | noGrow   0    0  310  540  " Configuration "  {
How can I force the dialog to use the new height pls? I know the height is stored in the Windows registry, but I cannot get all the users of my plugin to hack their registry to fix this.

Thanks

Paul
4 REPLIES 4
Anonymous
Not applicable
paulk wrote:
Hi

I have a modal dialog defined in a GRC file with a fixed width/height. This dialog has been unchanged for 12 months, however now I need to add 5 fields to it - so the height needs to be increased. But when I increase the height in the GRC file it "remembers" the old height.

The GRC set up the modal dialog as:
'GDLG'  32580    Modal | normalFrame | noGrow   0    0  310  540  " Configuration "  {
How can I force the dialog to use the new height pls? I know the height is stored in the Windows registry, but I cannot get all the users of my plugin to hack their registry to fix this.

Thanks

Paul
You can try by this way
this->SetClientSize(x, y)
In my case every dialog is a class which inherits from DG::ModalDialog

How you build your dialog ?
Anonymous
Not applicable
Hi

I am running my dialog with
DGModalDialog (ACAPI_GetOwnResModule(), ConfigurationDLG_GDLGID, ACAPI_GetOwnResModule(), ConfigurationDlgCallBack, NULL);
I tried adding
DGSetDialogMinSize (ConfigurationDLG_GDLGID, DG_FRAME, 310, 700);
in the DG_MSG_INIT handler, but that does nothing.

EDIT: Using DGSetDialogSize in the DG_MSG_INIT handler works. A bit odd needing to hardcode the dialog size, but it resolves the issue.

Thanks

Paul
Ralph Wessel
Mentor
paulk wrote:
Using DGSetDialogSize in the DG_MSG_INIT handler works. A bit odd needing to hardcode the dialog size, but it resolves the issue.
You can avoid hardcoding the size by asking the API to give you the size of the dialog as defined in the resources. Just call DGGetDialogSize with the rectType set to DG_ORIGCLIENT
Ralph Wessel BArch
Anonymous
Not applicable
Thanks Ralph.