I liked the v11 dialogs, except it didn't support GIF files so I'm trying v12 to make it work.
So here's the problem. I want to make a dialog fullscreen. In v11, I just GetScreenRes>x,y and set the Dialog height = y and width = x. In v12, this doesn't work. None of the variables work. I can't even use %SCRIPT_DIR%
In order to set anything to a variable, I'd have to SetDialogProperty ?? Seems ridiculous just to set default settings. What's the whole point in defining the dialog if you have to do extra SetDialogProperties just to get it work?
Also I can't get the Left and Top attributes to work.
object Dialog1: TForm
Left = 0
Top = 0
Just creates a Dialog that appears in random locations, never 0,0.
Don't understand v12 Dialogs
Moderators: Dorian (MJT support), JRL
What made you think version 12 dialogs support gif files?gummybear wrote:I liked the v11 dialogs, except it didn't support GIF files so I'm trying v12 to make it work.
I wrote a test script just to be sureHelp for Dialog Objects wrote:LoadImage
Loads an image from file. Specify the filename of the picture to display (can be bitmap, jpeg, png, ico). Note that the image data is loaded statically into and stored in the dialog. To link dynamically assign a filename to LoadImage at runtime.
SetDialogProperty>Dialog1,msimage1,LoadImage,%temp_dir%test.jpg
Works
SetDialogProperty>Dialog1,msimage1,LoadImage,%temp_dir%test.gif
Does not.
I agree, it would be handy to be able to set values via variables within the dialog block like we could in days of yore but that is no longer the case. You know what you need to do. Using SetDialogProperties is not really that big of an inconvenience. The extra functionality of the version 12 dialogs compared with previous versions makes it all worthwhile in my opinion.gummybear wrote:So here's the problem. I want to make a dialog fullscreen. In v11, I just GetScreenRes>x,y and set the Dialog height = y and width = x. In v12, this doesn't work. None of the variables work. I can't even use %SCRIPT_DIR%
In order to set anything to a variable, I'd have to SetDialogProperty ?? Seems ridiculous just to set default settings. What's the whole point in defining the dialog if you have to do extra SetDialogProperties just to get it work?
For what its worth, for position and size, I find it simpler to use The MoveWindow> and ResizeWindow> functions rather than four lines of SetDialogProperties>. Be sure your give your dialog a unique name. Place them in the script anywhere between where the dialog block is defined and the Show>dialog line.
Last edited by JRL on Tue Sep 13, 2011 6:50 pm, edited 1 time in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
4 lines?
Only one is needed to make a window maximized (full screen if you prefer):
SetDialogProperty>Dialog1,,WindowState,wsMaximized
Show>Dialog1,r
Easier than v11.
Only one is needed to make a window maximized (full screen if you prefer):
SetDialogProperty>Dialog1,,WindowState,wsMaximized
Show>Dialog1,r
Easier than v11.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Yes four lines.
I was not addressing the full screen dialog aspect and perhaps should have quoted gummybear first.
Whether its four lines or two or ten shouldn't really matter. What really matters is that the version 12 style dialogs have greater flexibility. If you have the chance to learn to use them, do it. Well worth the time.
I was not addressing the full screen dialog aspect and perhaps should have quoted gummybear first.
I have never been able to set the location of a v12 dialog by setting the Top and Left values inside the dialog block. I have had success using SetDialogProperties to set those same values. However, rather than using two lines of SetDialogProperties to set location I generally prefer to use MoveWindow and I can thus get the dialog to reside in the desired position using one line. And though setting the size in the dialog block by setting the values of ClientWidth and ClientHeight works (and is probably more accurate when you consider title bar and border width user modifications) using ResizeWindow usually works for me and is again one line rather than two.gummybear wrote:Also I can't get the Left and Top attributes to work.
Whether its four lines or two or ten shouldn't really matter. What really matters is that the version 12 style dialogs have greater flexibility. If you have the chance to learn to use them, do it. Well worth the time.