The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 HTML Dialog Size
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

j@y

Germany
29 Posts

Posted - 04/26/2017 :  06:19:22 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I have tried to use the 'New HTML Dialog' X Function in CodeBuilder > Tools to build a new dialog with resizing allowed (same problem when disallowed, too).

I found lines where to set the dialog size in the code. However, regardless this setting, Origin remembers the last size of the dialog as displayed (and/or modified by mouse) and ignores the values in the code. Even after compiling and re-running the HTML Dlg, the size remains the same as during the last display.

Where is this setting saved? How can I force Origin to always use the size which is in the code as initial instead of that from the last run?

Many thanks for your help in advance.
(OrPrO 2017 SR1; Win10)

PS: Are there some new materials regarding the HTML dialog coding and functionality besides the three examples?

Edited by - j@y on 04/26/2017 06:20:59 AM

Chris D

428 Posts

Posted - 04/26/2017 :  10:36:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Because this is a very new and evolving addition to Origin, we have not had time to develop very in-depth documentation on the subject of HTML Dialogs beyond what we currently have:
http://www.originlab.com/doc/OriginC/guide/HTML-Dialog
and
http://blog.originlab.com/programming/json-oc-html

However, if you will email tech@originlab.com with your questions (including this one), we can address them directly as I am sure you will have others as you delve deeper into the subject. We can also offer handy tips that may help your specific needs.


Thanks,
Chris Drozdowski
Originlab Technical Support

Edited by - Chris D on 04/26/2017 10:38:34 AM
Go to Top of Page

eparent

118 Posts

Posted - 04/26/2017 :  12:49:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi j@y,

We will add an option to the newHTML X-Function.

For now you can do the following:
You will see a call to DoModal or Create near the bottom of your cpp file. By default the code generated passes a single argument. There is an optional 2nd argument named dwOptions that defaults to zero. Pass the bit flags DLG_NO_LOAD_TOP_LEFT | DLG_NO_LOAD_WIDTH_HEIGHT to stop Origin from saving and restoring the dialog's position and size.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 04/26/2017 :  9:15:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Follow this

http://www.originlab.com/doc/OriginC/guide/first-HTML-dialog

and download the sample, and in HelloWorldDlg1.cpp, you see

void hello()
{
	HelloWorldDlg dlg;
	//prevent reading last dialog position and size from registry
	DWORD dwFlags = DLG_NO_LOAD_TOP_LEFT | DLG_NO_LOAD_WIDTH_HEIGHT;
	dlg.DoModalEx(GetWindow(), dwFlags);
}



CP

Go to Top of Page

j@y

Germany
29 Posts

Posted - 04/27/2017 :  05:19:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much eparent and cpyang!

PS: The most important code

//prevent reading last dialog position and size from registry
DWORD dwFlags = DLG_NO_LOAD_TOP_LEFT | DLG_NO_LOAD_WIDTH_HEIGHT;
dlg.DoModalEx(GetWindow(), dwFlags);


is in the example source file but not on the webpage...

Edited by - j@y on 04/27/2017 10:50:42 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000