04-25-2017, 02:49 AM
Hello ~ Gintaras ~~!
I try to make simple log window with vertical autoscroll attribute and make below function and macro
I added VScroll and VAutoScroll attributes to dlg_log function
but V Scroll doesn't seem to work
Thank you in advance!
Function dlg_log
Macro Macro3
I try to make simple log window with vertical autoscroll attribute and make below function and macro
I added VScroll and VAutoScroll attributes to dlg_log function
but V Scroll doesn't seem to work
Thank you in advance!
Function dlg_log
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 252 160 "LOGwin"
;3 Edit 0x54231044 0x200 8 8 238 144 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040500 "*" "" "" ""
str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,case WM_TIMER
,SetTimer hDlg 0 1000 0
,case WM_TIMER
,sel wParam
,,case 0
,case WM_DESTROY
,case WM_COMMAND goto messages2
,
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Macro Macro3
int N
str newLog oldLog
str logfile = "d:\log.txt"
str tmplog = "d:\log.tmp"
int w toDEL
del- tmplog
N=0
rep
,N+1
,wait 1.5
,oldLog.getfile(tmplog);err
,if(N>5)
,,toDEL = find(oldLog ".")
,,oldLog.remove(0 toDEL+1)
,oldLog.trim()
,newLog.format("%s[]LOG - %i." oldLog N);newLog.trim()
,newLog.setfile(logfile 0 -1 1)
,newLog.setfile(tmplog 0 -1 1)
,w=win("LOGwin" "")
,if(w) newLog.setwintext(id(3 w))