Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can I show image or paint a small rectangle?
#1
is there a way besides using "curtain" to paint an image (like a logo) somewhere on the screen? I'd like it to stay visible and in front while certain conditions are true while allowing my browser window to still be active and enabled. Is that possible?

Craig
There ought to be a law that limits the number of laws!
#2
Function dialog_logo
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str sb3
sb3="$windows$\soap bubbles.bmp"
hDlg=ShowDialog("dialog_logo" &dialog_logo &controls 0 1 0 WS_VISIBLE 0 -1 -1) ;;create nonmodal and invisible to avoid activation
SetWindowPos hDlg 0 0 0 0 0 SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW ;;show with SWP_NOACTIVATE flag
opt waitmsg 1
wait 5

;BEGIN DIALOG
;0 "" 0x90000044 0x80 0 0 120 112 ""
;3 Static 0x5400000E 0x0 0 0 16 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam) ;;not necessary in QM >= 2.1.9
,case WM_DESTROY DT_DeleteData(hDlg) ;;not necessary in QM >= 2.1.9
ret
#3
Thanks, I'm a little confused as to its execution - I don't seem to be able to run it from the command dialog_logo 0 0 0 0 - I get the following error message:

Error (RT) in dialog_logo: cannot create dialog. Dialog definition not found or is invalid. First argument of ShowDialog must be name of macro or function that contains dialog definition (text that begins with BEGIN DIALOG)

If I change the first parameter to "1", the error message goes away, but nothing happens that I can discern. Should I separate this into two different files in the same way that Curtain runs Curtain_dialog ?

I unfortunately don't use dialogs often enough to imprint their usage in my brain...

Thanks, Craig
There ought to be a law that limits the number of laws!
#4
dialog_logo 0 0 0 0

should work, unless encrypted. Or use mac:

Code:
Copy      Help
mac "dialog_logo"

In older QM versions, ShowDialog would fail if dialog definition begins with ; (not spaces). To paste code from forum, use menu Edit -> Other formats -> Paste escaped. It replaces ; to spaces, and , to tabs.
#5
I just got back to this project and still cannot run dialog_logo through either of those to means. The problem seems within the 8th line of the function as the cursor is left there:

hDlg=ShowDialog("dialog_logo" &dialog_logo &controls 0 1 0 WS_VISIBLE 0 -1 -1)

again the error is:
Error (RT) in dialog_logo: cannot create dialog. Dialog definition not found or is invalid.
First argument of ShowDialog must be name of macro or function that contains dialog definition (text that begins with BEGIN DIALOG)

I'm using QM2.1.9.

Thanks, Craig
There ought to be a law that limits the number of laws!
#6
Try this.
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

lpstr dd=
;BEGIN DIALOG
;0 "" 0x90000044 0x80 0 0 120 112 ""
;3 Static 0x5400000E 0x0 0 0 16 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "" ""


str controls = "3"
str sb3
sb3="$windows$\soap bubbles.bmp"
hDlg=ShowDialog(dd &dialog_logo &controls 0 3 0 WS_VISIBLE 0 -1 -1) ;;create nonmodal and invisible to avoid activation
SetWindowPos hDlg 0 0 0 0 0 SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW ;;show with SWP_NOACTIVATE flag
opt waitmsg 1
wait 5

ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam) ;;not necessary in QM >= 2.1.9
,case WM_DESTROY DT_DeleteData(hDlg) ;;not necessary in QM >= 2.1.9
ret
#7
I hope I am not missing some basic issue...It still gives me the same runtime error

Craig
There ought to be a law that limits the number of laws!
#8
Can you debug it?

Expand folder System\Dialogs\Dialog Functions\private.
In dialog_logo, before ShowDialog line, insert Deb.
Run dialog_logo (or macro that calls it). At Deb it stops.
Press F5 repeatedly.
What is the last executed line in function CompileDialog?
#9
perhaps this highlights something I've done wrong...Are you saying that I should have placed the dialog_logo function into this system folder in order to work?
There ought to be a law that limits the number of laws!
#10
No. Expanding the folder is necessary for debugging because F5 does not step into nonexpanded folders.
#11
within "ShowDialog" it is the following:

if(!i) end "cannot create dialog. Dialog definition not found or is invalid%s" 0 es

just before that, it exectutes within CompileDialog:

if(findrx(dd "(?s)^[ ;]*BEGIN DIALOG *[](.+?)[][ ;]*END DIALOG$" 0 8 si 1)<0) ret

It returns from CompileDialog at this command
There ought to be a law that limits the number of laws!
#12
What is dd before

if(findrx(dd "(?s)^[ ;]*BEGIN DIALOG *[](.+?)[][ ;]*END DIALOG$" 0 8 si 1)<0) ret

?

Use out dd to display it in output. If readonly, uncheck it in System folder's properties dialog. Also remove Deb.
#13
contents of "dd" just before error:

BEGIN DIALOG
0 "" 0x90000044 0x80 0 0 120 112 ""
3 Static 0x5400000E 0x0 0 0 16 16 ""
END DIALOG
DIALOG EDITOR: "" 0x2010901 "" ""
There ought to be a law that limits the number of laws!
#14
p.s. - there is no blank line before "BEGIN DIALOG"
There ought to be a law that limits the number of laws!
#15
Blank lines are not necessary. Maybe copied code contains invalid newline characters, or invalid space characters. Try the attachment. It cannot be corrupted.


Attached Files
.qml   dialog_logo.qml (Size: 892 bytes / Downloads: 560)
#16
Maybe in code

END DIALOG

line ends with spaces?
#17
Yes that worked...THANK YOU!
There ought to be a law that limits the number of laws!
#18
The downloaded code worked. As far as END DIALOG, it ended with a single space showing in the "out dd"
There ought to be a law that limits the number of laws!
#19
if(findrx(dd "(?s)^[ ;]*BEGIN DIALOG *[](.+?)[][ ;]*END DIALOG$" 0 8 si 1)<0) ret

failed at red $. It should be

if(findrx(dd "(?s)^[ ;]*BEGIN DIALOG *[](.+?)[][ ;]*END DIALOG *$" 0 8 si 1)<0) ret

Normally, code inserted by Dialog Editor does not contain spaces in end of lines, but spaces can be added in code copied from forum. Will be fixed in next release, thank you.
#20
Thank You, too. I cannot make this logo appear over a section just in the middle of the screen. Is that to be expected? If I move it, the curtain window hides everything from the lower right corner up to the logo. Is there a setting that places my 50x50 pixel bitmap logo in a designated central area (say x=400, y=300) without graying out the lower right quadrant?

Thanks!

Craig
There ought to be a law that limits the number of laws!
#21
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str sb3
sb3="$windows$\soap bubbles.bmp"
hDlg=ShowDialog("dialog_logo" &dialog_logo &controls 0 1 0 WS_VISIBLE) ;;create nonmodal and invisible to avoid activation
SetWindowPos hDlg 0 0 0 0 0 SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_SHOWWINDOW ;;show with SWP_NOACTIVATE flag
opt waitmsg 1
wait 5

;BEGIN DIALOG
;0 "" 0x90000844 0x80 0 0 119 111 ""
;3 Static 0x5400000E 0x0 0 0 16 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010901 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam) ;;not necessary in QM >= 2.1.9
,
,int cx cy; GetWinXY id(3 hDlg) 0 0 cx cy
,siz cx cy hDlg
,
,case WM_DESTROY DT_DeleteData(hDlg) ;;not necessary in QM >= 2.1.9
ret

Paste in QM using menu Edit -> Other formats -> Paste escaped.
#22
Thanks! I see I have to play with the first line after the BEGIN DIALOG in order to move it to the proper location.

Craig
There ought to be a law that limits the number of laws!


Forum Jump:


Users browsing this thread: 1 Guest(s)