Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Info Dialog
Hey, i need to show changing of some variables in dialog

For example i have text and values[4 3 2] displayed by somehow:
Case1 - [4] times
Case2 - [3] times
Case3 - [2] times

then from some event i get 5 instead of 4 and wish to display fresh info about how many times case1 was used.
here i can use multiple OnScreenDisplay but i have about 8 cases and this looks not so good.

so would be nice to use some dialog (compact and scalable way). but i dont know how without recreating it every time variable changes
(stupid way save variable in registry then use setwintext for editboxes during dialog creation)
Function InfoWindow
Copy      Help
function# [x] [y] [flags] [$title] ;;flags: 1 in this thread, 64 raw x y

;Shows inactive topmost window where macros can display text.
;Returns static text control handle. To display text, use setwintext.
;Does not wait until the dialog is closed.

;x, y - dialog position. Same as with ShowDialog.
;;;1 - create the window in this thread. Can be used if this thread has a dialog or somehow processes Windows messages. Without this flag the window is in other thread.
;;;64 - same as with ShowDialog.
;title - window title bar text.

;int+ g_myinfowindow
;if(!IsWindow(g_myinfowindow)) g_myinfowindow=InfoWindow(-1 1 0 "QM - InfoWindow")
;_s="1"; _s.setwintext(g_myinfowindow)
;_s="2"; _s.setwintext(g_myinfowindow)
;clo GetParent(g_myinfowindow)

int h
if flags&0x10001
,sub.Thread x y flags title h
,mac "sub.Thread" "" x y flags|0x10000 title &h
,wait 0 V h
ret h

#sub Thread
function x y flags $title &hwnd

str dd=
;0 "" 0x80C80848 0x188 0 0 223 136 "{title}"
;3 Static 0x54000000 0x0 4 4 218 130 ""
;DIALOG EDITOR: "" 0x2040200 "" "" "" "

int h=ShowDialog(dd 0 0 0 flags&64|1 0 0 0 x y)
hid- h
hwnd=id(3 h)
if(flags&0x10000=0) ret
opt waitmsg 1
wait 0 -WC hwnd; err

Macro Macro2360
Copy      Help
int+ g_myinfowindow
if(!IsWindow(g_myinfowindow)) g_myinfowindow=InfoWindow(-1 1 0 "QM - InfoWindow")

int v1 v2 v3
str s=
;Case1 - {v1} times
;Case2 - {v2} times
;Case3 - {v3} times
nice, thx Big Grin

Forum Jump:

Users browsing this thread: 1 Guest(s)