OptOレジ v1.3

#packopt name "optoregi" #packopt version &qu […]

#packopt name "optoregi" #packopt version &qu […]

#packopt name "optoregi"
#packopt version "versiondate.txt"
#packopt lang "1041"
#packopt icon "icon.ico"
#packopt hide 1
#define version "1.3" ;
// ()
#ifdef _debug
#define titl "OptO v" + version + " ()"
#else
#define titl "OptO v" + version
#endif
#include "wgini.as"
#include "kernel32.as"
#include "user32.as"
#include "gdi32.as"
#include "shell32.as"
#uselib "imm32.dll"
#func ImmAssociateContext "ImmAssociateContext" int, int
#module
#deffunc clr int mode, int x1, int y1, int x2, int y2 ; (0 = , 1 = , 2 = 1)
if mode = 0 : cls
color 128, 255, 255 ;
if mode = 2 : boxf x1, y1, x2, y2 : else : boxf
color 0, 0, 0
return mode
#deffunc HideSubWindow int wID ;
gsel wID, -1
EnableWindow hWnd_main@, 1
gsel 0, 1
return wID
// CSV
#deffunc SplitCSV int index, int column ; CSV
if index < 0 or column < 0 : return -1 ; -1
;
if flag = 0 {
sdim temp
sdim spl, , 5
}
flag = 1
noteget temp, index ;
split temp, ",", spl ;
return stat
#defcfunc GetCSV int index, int column ; CSV
SplitCSV index, column ;
if stat - 1 < column : return "" ; -1
return spl(column) ;
#deffunc WriteCSV int index, int column, str word ; CSV
SplitCSV index, column ;
if stat - 1 < column : return -1 ; -1
;
spl(column) = word
temp = spl(0)
repeat stat - 1, 1
temp += "," + spl(cnt)
loop
noteadd temp, index, 1 ;
return
#deffunc SearchCSV int index, int column, str word ; CSV
;
result = -1
if index < 0 or column < 0 or word = "" : return result ; wordnull-1
;
repeat notemax - index, index
if GetCSV(cnt, column) = word { ;
result = cnt
break
}
loop
return result ; -1
#deffunc deletef str _dir ;
sdim pFrom, 260
pFrom = _dir
dim SHFILEOPSTRUCT, 8
SHFILEOPSTRUCT.0 = hWnd
SHFILEOPSTRUCT.1 = $3 ; FO_DELETE
SHFILEOPSTRUCT.2 = varptr( pFrom )
SHFILEOPSTRUCT.3 = 0
SHFILEOPSTRUCT.4 = $4 | $10 | $100 | $400 ; FOF_SILENT | FOF_NOCONFIRMATION | FOF_SIMPLEPROGRESS | FOF_NOERRORUI
SHFileOperation varptr( SHFILEOPSTRUCT )
return stat
#global
//
#define lay_sx (lay_ex - lay_x - lay_ox * 2 - lay_ix * (lay_nx - 1)) / lay_nx ;
#define lay_sy (lay_ey - lay_y - lay_oy * 2 - lay_iy * (lay_ny - 1)) / lay_ny
#define ctype lay_px(%1) lay_x + lay_ox + (lay_sx + lay_ix) * %1 ;
#define ctype lay_py(%1) lay_y + lay_oy + (lay_sy + lay_iy) * %1
///////////////// /////////////////
CreateMutex 0, 0, "OptO_register_!_Mutex" ;
GetLastError
if stat = $B7 { ; ERROR_ALREADY_EXISTS
dialog "OptO", 1, titl
end
}
////////////////// ////////////////////
*s_start ; 便
// ()
#ifdef _debug ;
screen 0, , : title titl
#else ;
bgscr 0, ginfo_dispx, ginfo_dispy, 0, 0, 0 : title titl
#endif
hWnd_main = hWnd
title titl
//
dim temp_i, ;
sdim temp_s, 260 ;
// ()
exist "settings.ini" ;
if strsize = -1 {
temp_s = "[system]\npass=0000\nopened=0\nlast=\npdcount=0\n"
notesel temp_s
notesave "settings.ini"
noteunsel
}
;
setini "settings.ini" ;
sdim s_password ;
getini "system", "pass", s_password
dim s_opened ;
getini "system", "opened", s_opened
sdim s_last ;
getini "system", "last", s_last
exist "pd.csv" ;
temp_i = strsize
exist "rpd.csv" ;
if strsize = -1 or temp_i = -1 { ;
p_buf = "ID,,\n"
notesel p_buf
notesave "pd.csv"
notesave "rpd.csv"
noteunsel
s_pdcount = 0
writeini "system", "pdcount", s_pdcount ; ID
}
gosub *load_pd ; (p_num)
sdim d_buf_total, 4096 ;
exist "total.csv" ;
if strsize = -1 {
;
d_buf_total = ",0\n\n,0\n,0\n\n,0\n,0\n\n,0\n\nID,,\n"
repeat p_num
d_buf_total += p_id(cnt) + ",0,0\n"
loop
;
notesel d_buf_total
notesave "total.csv"
noteunsel
} else {
;
notesel d_buf_total
noteload "total.csv"
noteunsel
}
dirlist temp_s, "daily", 5 ;
if stat = 0 : mkdir "daily"
dirlist temp_s, "history", 5 ;
if stat = 0 : mkdir "history"
dirlist temp_s, "refund", 5 ;
if stat = 0 : mkdir "refund"
dirlist temp_s, "hourly", 5 ;
if stat = 0 : mkdir "hourly"
//
;
dim tkey_arg, 11, 2 ;
tkey_arg(0, 0) = 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 1
tkey_arg(0, 1) = 3, 2, 2, 2, 1, 1, 1, 0, 0, 0, 3
dim tkey_clr_ID ; ID
dim LVCOLUMS, 6 ; LVCOLUMN
dim SHFILEOPSTRUCT, 8 ; SHFILEOPSTRUCT
sdim input_pw ;
dim main_x : dim main_y ;
dim main_w : dim main_h ;
;
dim s_pdcount ; ID
s_week = "", "", "", "", "", "", ""
s_today = strf("%04d/%02d/%02d", gettime(0), gettime(1), gettime(3))
;
unit_x = ginfo_winx / 128 ;
unit_y = ginfo_winy / 96 ; 480p -> 5:5, 1080p -> 15:11
dim lay_x : dim lay_y ;
dim lay_ex : dim lay_ey ;
dim lay_ox : dim lay_oy ;
dim lay_ix : dim lay_iy ;
dim lay_nx : dim lay_ny ;
dim lay_mpx : dim lay_mpy ;
dim lay_msx : dim lay_msy ;
;
dim t_sx ; X
dim t_sy ; Y
;
o_amount = 10000, 5000, 2000, 1000, 500, 100, 50, 10, 5, 1
dim o_num, 10 ; (1)
dim o_sum ;
dim o_error ;
dim o_focus ;
dim o_input ;
;
dim c_num, p_num ;
dim c_anum ;
dim c_total ;
dim c_depoint ;
dim c_change ;
; ()
dim p_index ;
;
sdim h_buf, 1024 ;
;
sdim d_buf, 4096 ; (notesel)
sdim d_buf_date, 4096 ;
sdim d_list, 512 ;
dim d_total ;
dim d_sel ;
dim d_path ;
;
sdim r_list, 512 ;
sdim r_path, 260 ;
dim r_total ;
dim r_pnum ;
sdim r_ID, , p_num ; ID
dim r_num, p_num ;
;
sdim u_buf, 256 ;
sdim u_buf_date, 256 ;
;
sdim a_name ;
dim a_value ;
;
sdim e_newpass ;
//
; (hFont.0)
font msgothic, unit_y * 6
mref bmscr, 67
CreateFontIndirect varptr(bmscr.49)
hFont.0 = stat
; (hFont.1)
font msgothic, unit_y * 4, 1
mref bmscr, 67
CreateFontIndirect varptr(bmscr.49)
hFont.1 = stat
//
; (sub_1)
screen 1, unit_x * 50, unit_y * 20, 6
hWnd_sub1 = hWnd
title ""
GetWindowLong hWnd_sub1, -16 ; GWL_STYLE
SetWindowLong hWnd_sub1, -16, stat & ($10000 | $20000 | $40000) ^ stat ; GWL_STYLE
SetWindowLong hWnd_sub1, -8, hWnd_main ; GWL_HWNDPARENT
SetWindowPos hWnd_sub1, 0, 0, 0, 0, 0, $1 | $2 | $4 | $20 ; SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED
clr 1
font msgothic, unit_y * 6 ;
objmode 2
pos unit_x * 2, unit_y * 2
input input_pw, ginfo_winx - unit_x * 4, ginfo_winy / 2 - unit_y * 2, 4
hInput = objinfo_hwnd(stat)
sendmsg hInput, $CC, '*' ; EM_SETPASSWORDCHAR
SetWindowLong hInput, -16, $50010080 | $2000 ;
ImmAssociateContext hInput, 0 ; IME
objsize ginfo_winx / 2 - unit_x * 2, ginfo_winy / 2 - unit_y * 2
button gosub "OK", *sub_1_OK
pos ginfo_cx + ginfo_winx / 2 - unit_x * 2, ginfo_cy - (ginfo_winy / 2 - unit_y * 2)
button gosub "キャンセル", *sub_1_cancel
gsel 0
//
onexit gosub *exit
onerror gosub *exerror
//
;
SelectObject hdc, hFont.0
mes s_today + strf("[%s] %02d:%02d:%02d", s_week(gettime(2)), gettime(4), gettime(5), gettime(6))
t_sx = ginfo_mesx : t_sy = ginfo_mesy
gosub *mode_0_i
///////////////// /////////////////
repeat
if ginfo_act = 0 {
;
redraw 0
clr 2, 0, 0, t_sx, t_sy
pos 0, 0
SelectObject hdc, hFont.0
mes s_today + strf("[%s] %02d:%02d:%02d", s_week(gettime(2)), gettime(4), gettime(5), gettime(6))
redraw
}
wait 100
loop
stop
//////// () //////
*mode_open ;
clr 0 ; ()
;
exist "daily\\" + f_date + ".csv"
if strsize = -1 {
;
SelectObject hdc, hFont.0
color 255 ;
pos unit_x * 6, unit_y * 6
mes ""
color , , 255 ;
mes""
color ;
pos ginfo_cx + unit_y * 6, ginfo_cy + unit_y * 3
lay_x = ginfo_cx : lay_y = ginfo_cy
mes "5000× \n2000× \n1000× \n 500× \n 100× \n 50× \n 10× \n 5× \n 1× "
pos ginfo_cx - unit_y * 6, ginfo_cy + unit_y * 3
lay_mpx = ginfo_cx : lay_mpy = ginfo_cy
mes " "
;
font msgothic, unit_y * 5
objmode 2
pos lay_x + unit_y * 25, lay_y + 1
repeat length(o_num) - 1 ; 1
input o_num(cnt + 1), unit_y * 20, unit_y * 6 ;
hInput.cnt = objinfo_hwnd(stat)
SetWindowLong hInput.cnt, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.cnt, 0 ; IME
loop
pos lay_mpx + unit_y * 13, lay_mpy + 1
input o_sum, unit_y * 38, unit_y * 6 ;
nInput = stat
objskip nInput, 7 ;
hInput.nInput = objinfo_hwnd(nInput)
SetWindowLong hInput.nInput, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.nInput, 0 ; IME
sendmsg hInput.nInput, $CF, 1 ;
//
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 3
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *o_open
objskip stat, 3
;
font msgothic, unit_y * 7
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_4
objskip stat, 3
pos lay_px(0), lay_py(2)
button gosub "", *o_change
objskip stat, 3
//
;
lay_x = unit_x * (81 - 5) : lay_y = ginfo_cy - unit_y * 5
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = 0 : lay_iy = 0
lay_nx = 3 : lay_ny = 4
;
font msgothic, unit_y * 8, 1
objmode 2
;
objsize lay_sx * 2 + lay_ix, lay_sy
pos lay_px(tkey_arg(10, 0)), lay_py(tkey_arg(10, 1))
button gosub "", *o_tenkey
tkey_clr_ID = stat
objskip tkey_clr_ID, 3
;
objsize lay_sx, lay_sy
repeat length(tkey_arg) - 1
pos lay_px(tkey_arg(cnt, 0)), lay_py(tkey_arg(cnt, 1))
button gosub str(cnt), *o_tenkey
objskip stat, 3
loop
oncmd gosub *o_command, $111 ;
} else {
dialog "\n", 2, titl
if stat = 6 { ;
;
s_opened = 1
writeini "system", "opened", s_opened
notesel d_buf ; ()
noteload "daily\\" + f_date + ".csv" ;
noteunsel
gosub *mode_4
} else { ;
gosub *mode_4
}
}
return
*mode_close ;
;
dim o_num, 10 ; (1)
dim o_sum ;
dim o_focus ;
dim o_input ;
*mode_close_back ;
clr 0 ; ()
;
SelectObject hdc, hFont.0
color 255 ;
pos unit_x * 6, unit_y * 6
mes ""
color , , 255 ;
mes ""
color ;
pos ginfo_cx + unit_y * 6, ginfo_cy + unit_y * 3
lay_x = ginfo_cx : lay_y = ginfo_cy
mes "10000× \n 5000× \n 2000× \n 1000× \n 500× \n 100× \n 50× \n 10× \n 5× \n 1× "
pos ginfo_cx - unit_y * 6, ginfo_cy + unit_y * 3
lay_mpx = ginfo_cx : lay_mpy = ginfo_cy
mes " "
;
font msgothic, unit_y * 5
objmode 2
pos lay_x + unit_y * 28, lay_y + 1
repeat length(o_num)
input o_num(cnt), unit_y * 20, unit_y * 6 ;
hInput.cnt = objinfo_hwnd(stat)
SetWindowLong hInput.cnt, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.cnt, 0 ; IME
loop
pos lay_mpx + unit_y * 13, lay_mpy + 1
input o_sum, unit_y * 41, unit_y * 6 ;
nInput = stat
objskip nInput, 7 ;
hInput.nInput = objinfo_hwnd(nInput)
SetWindowLong hInput.nInput, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.nInput, 0 ; IME
sendmsg hInput.nInput, $CF, 1 ;
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 3
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 7, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_close2
objskip stat, 3
;
font msgothic, unit_y * 7
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_4
objenable stat, 1 + (s_last ! s_today)
objskip stat, 3
pos lay_px(0), lay_py(2)
button gosub "", *o_change
objskip stat, 3
//
;
lay_x = unit_x * (81 - 5) : lay_y = ginfo_cy - unit_y * 5
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = 0 : lay_iy = 0
lay_nx = 3 : lay_ny = 4
;
font msgothic, unit_y * 8, 1
objmode 2
;
objsize lay_sx * 2 + lay_ix, lay_sy
pos lay_px(tkey_arg(10, 0)), lay_py(tkey_arg(10, 1))
button gosub "", *o_tenkey
tkey_clr_ID = stat
objskip tkey_clr_ID, 3
;
objsize lay_sx, lay_sy
repeat length(tkey_arg) - 1
pos lay_px(tkey_arg(cnt, 0)), lay_py(tkey_arg(cnt, 1))
button gosub str(cnt), *o_tenkey
objskip stat, 3
loop
oncmd gosub *o_command, $111 ;
return
*mode_close2
oncmd gosub *dummy, $111 ;
clr 0 ; ()
;
notesel d_buf
d_total = int(GetCSV(9, 1))
noteunsel
;
SelectObject hdc, hFont.0
color 255 ;
pos unit_x * 6, unit_y * 6
mes ""
color , , 255 ;
mes ""
;
temp_i = ginfo_cx : lay_mpy = ginfo_cy + unit_y * 6
SelectObject hdc, hFont.0 ;
pos ginfo_winx, ginfo_winy
mes strf(" %8d ", 0)
lay_msx = ginfo_mesx : lay_msy = ginfo_mesy
lay_mpx = temp_i + unit_y * 75 - lay_msx ;
;
color , , 255 ;
pos lay_mpx, lay_mpy
mes strf(" %10d ", o_sum)
;
color 255 ;
mes strf(" %10d ", d_total)
color 0, 0, 0
mes "────────────"
;
color , 128 ;
mes strf(" %10d ", o_sum - d_total)
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *o_close
objskip stat, 3
;
font msgothic, unit_y * 9
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_close_back
return
///////// () /////////
*mode_0_i ;
clr 0 ; ()
f_date = strf("%04d-%02d-%02d", gettime(0), gettime(1), gettime(3)) ; (yyyy-mm-dd)
;
if s_opened { ;
if s_last ! s_today { ;
if s_last = "" { ;
dialog "\n", 1, titl
exist "daily\\" + f_date + ".csv"
if strsize = -1 {
;
s_opened = 0
writeini "system", "opened", s_opened
} else {
;
writeini "system", "last", s_today
}
} else { ;
dialog "(" + s_last + ")\n", 3, titl
if stat = 6 { ;
f_date = s_last
strrep f_date, "/", "-"
;
exist "daily\\" + f_date + ".csv"
if strsize = -1 {
dialog "(" + s_last + ")", 1, titl
} else {
notesel d_buf
noteload "daily\\" + f_date + ".csv"
noteunsel
gosub *mode_close ;
return
}
} else {
;
s_opened = 0
writeini "system", "opened", s_opened
}
}
} else { ;
exist "daily\\" + f_date + ".csv"
if strsize = -1 { ;
dialog "\n", 1, titl
;
s_opened = 0
writeini "system", "opened", s_opened
} else { ; ()
notesel d_buf ; ()
noteload "daily\\" + f_date + ".csv" ;
noteunsel
notesel u_buf ;
noteload "hourly\\" + f_date + ".csv" ;
noteunsel
}
}
} else { ;
if s_last ! s_today { ;
dialog "\n[] ⇒ []", 0, titl
}
; ()
}
if p_num = 0 : dialog "\n[] ⇒ []", 1, titl
*mode_0 ;
clr 0 ; ()
;
lay_x = 0 : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 12 : lay_oy = unit_y * 12
lay_ix = unit_x * 4 : lay_iy = unit_y * 4
lay_nx = 3 : lay_ny = 1
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 12, 5
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_1
objenable stat, p_num * s_opened
;
font msgothic, unit_y * 12
objmode 2
pos lay_px(1), lay_py(0)
button gosub "\n", *mode_2
SetWindowLong objinfo_hwnd(stat), -16, $50000000 | $2000 ;
pos lay_px(2), lay_py(0) ;
lay_ny = 2 ;
objsize lay_sx, lay_sy
button gosub "", *mode_3
objenable stat, s_opened
pos lay_px(2), lay_py(1)
#ifdef _debug
button gosub "", *mode_4
#else
button gosub "", *sub_1
#endif
objsel 0
onkey 0
return
*mode_1 ;
;
c_total = 0 : c_anum = 0
repeat p_num
c_num(cnt) = 0
loop
*mode_1_back
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy - unit_y * 18
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 46, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 13, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 9, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
;
repeat p_num
;
temp_s = p_name(cnt)
LVCOLUMS = $1, cnt, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = str(p_value(cnt))
LVCOLUMS = $1, cnt, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = str(c_num(cnt))
LVCOLUMS = $1, cnt, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
lay_mpx = ginfo_cx : lay_mpy = ginfo_cy
SelectObject hdc, hFont.0
pos ginfo_winx, ginfo_winy
mes strf("%8d", 0)
lay_msx = ginfo_mesx : lay_msy = ginfo_mesy
lay_mpx = lay_mpx + unit_x * 75 - lay_msx
pos lay_mpx, lay_mpy
mes strf("%8d", c_total)
//
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 10
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_1_cancel
;
font msgothic, unit_y * 10, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_1_1
//
;
lay_x = unit_x * (81 - 5) : lay_y = ginfo_cy - unit_y * 5
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = 0 : lay_iy = 0
lay_nx = 3 : lay_ny = 4
;
font msgothic, unit_y * 8, 1
objmode 2
;
objsize lay_sx * 2 + lay_ix, lay_sy
pos lay_px(tkey_arg(10, 0)), lay_py(tkey_arg(10, 1))
button gosub "", *mode_1_tenkey
tkey_clr_ID = stat
;
objsize lay_sx, lay_sy
repeat length(tkey_arg) - 1
pos lay_px(tkey_arg(cnt, 0)), lay_py(tkey_arg(cnt, 1))
button gosub str(cnt), *mode_1_tenkey
loop
onkey gosub *mode_1_key_event ; mode_1
return
*mode_2 ;
clr 0 ; ()
;
lay_x = 0 : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 12 : lay_oy = unit_y * 12
lay_ix = unit_x * 4 : lay_iy = unit_y * 4
lay_nx = 1 : lay_ny = 3
;
font msgothic, unit_y * 12
objmode 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_2_1
pos lay_px(0), lay_py(1)
button gosub "", *mode_2_2
pos lay_px(0), lay_py(2)
button gosub "", *mode_0
return
*mode_3 ;
#ifndef _debug ;
dialog "", 0, titl
#endif
*mode_3_back
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy - unit_y * 18
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 67, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
//
;
font msgothic, unit_y * 9
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_0
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_3_1
dirlist r_list, "history\\" + f_date + "\\**-**-**.csv", 3
repeat stat
temp_s = strmid(r_list, cnt * 14, 8) ; ( + )
strrep temp_s, "-", ":"
;
LVCOLUMS = $1, 0, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
noteunsel
return
*mode_4 ;
oncmd gosub *dummy, $111 ;
clr 0 ; ()
;
lay_x = 0 : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 12 : lay_oy = unit_y * 12
lay_ix = unit_x * 4 : lay_iy = unit_y * 4
lay_nx = 3 : lay_ny = 2
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 10, 5
objmode 2
pos lay_px(0), lay_py(0)
if s_opened {
button gosub "", *mode_close
} else {
if s_last = s_today {
button gosub "", *mode_open
} else {
button gosub "", *mode_open
}
}
;
font msgothic, unit_y * 10
objmode 2
pos lay_px(1), lay_py(0)
button gosub "\n", *mode_4_2
nButton = stat
SetWindowLong objinfo_hwnd(nButton), -16, $50000000 | $2000 ;
objenable nButton, s_opened
pos lay_px(2), lay_py(0)
button gosub "\n", *mode_4_3
nButton = stat
SetWindowLong objinfo_hwnd(nButton), -16, $50000000 | $2000 ;
objenable nButton, s_opened
pos lay_px(0), lay_py(1)
button gosub "\n", *mode_4_4
SetWindowLong objinfo_hwnd(stat), -16, $50000000 | $2000 ;
pos lay_px(1), lay_py(1)
button gosub "", *mode_4_5
pos lay_px(2), lay_py(1)
button gosub "", *mode_0
font msgothic, unit_y * 4, 1
objsize unit_x * 14, unit_y * 6
pos ginfo_winx - unit_x * 14, 0
button gosub "", *exit2
pos ginfo_winx - unit_x * 28, 0
button gosub "", *s_mini
return
*sub_1 ;
if s_password = "0000" { ; 0000
gosub *mode_4
return
}
main_x = ginfo_wx1 : main_y = ginfo_wy1
main_w = ginfo_winx : main_h = ginfo_winy
EnableWindow hWnd_main, 0
gsel 1
width unit_x * 50, unit_y * 20, main_x + (main_w - ginfo_winx) / 2, main_y + (main_h - ginfo_winy) / 2
objprm 0, "" : objsel 0
gsel 1, 1
onkey gosub *sub_1_key_event
return
//////////// () ////////////
*mode_1_1 ;
if c_anum <= 0 { ; 0
dialog "", 0, titl
return
}
if c_total <= 0 {
dialog "\n", 1, titl
return
}
;
c_depoint = 0
c_change = 1
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy / 2 - unit_y * 6
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETBKCOLOR)
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETTEXTBKCOLOR)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 46, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 13, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 9, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
;
repeat p_num
if c_num(cnt) = 0 : continue ; 0
;
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(p_name(cnt))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = str(p_value(cnt))
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = str(c_num(cnt))
LVCOLUMS = $1, temp_i, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
temp_i = ginfo_cx : lay_mpy = ginfo_cy + unit_y * 4
SelectObject hdc, hFont.0 ;
pos ginfo_winx, ginfo_winy
mes strf(" %8d ", 0)
lay_msx = ginfo_mesx : lay_msy = ginfo_mesy
lay_mpx = temp_i + unit_y * 75 - lay_msx ;
;
pos lay_mpx, lay_mpy
mes strf(" %8d ", c_total)
;
color 255, 0, 0
lay_mpx = ginfo_cx : lay_mpy = ginfo_cy
mes strf(" %8d ", c_depoint)
color 0, 0, 0
mes "────────────"
//
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 10
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_1_back
;
font msgothic, unit_y * 10, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_1_1_confirm
//
;
font msgothic, unit_y * 8, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = ginfo_cy - unit_y * 5
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = 0 : lay_iy = 0
lay_nx = 3 : lay_ny = 4
;
objsize lay_sx * 2 + lay_ix, lay_sy
pos lay_px(tkey_arg(10, 0)), lay_py(tkey_arg(10, 1))
button gosub "", *mode_1_tenkey
tkey_clr_ID = stat
;
objsize lay_sx, lay_sy
repeat length(tkey_arg) - 1
pos lay_px(tkey_arg(cnt, 0)), lay_py(tkey_arg(cnt, 1))
button gosub str(cnt), *mode_1_tenkey
loop
onkey gosub *mode_1_1_key_event
return
*mode_2_1 ;
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy - unit_y * 12
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETBKCOLOR)
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETTEXTBKCOLOR)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 67, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
dirlist d_list, "daily\\****-**-**.csv", 3 ;
repeat stat
temp_s = strmid(d_list, cnt * 16, 10) ; ( + )
strrep temp_s, "-", "/"
;
LVCOLUMS = $1, 0, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
//
;
font msgothic, unit_y * 9
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_2
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_2_1_1
return
*mode_2_2 ;
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy - unit_y * 12
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETBKCOLOR)
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETTEXTBKCOLOR)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 43, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
//
;
font msgothic, unit_y * 9, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_2
notesel d_buf_total ;
;
repeat notemax - 11, 11
temp_s = GetCSV(cnt, 0) ; ID
p_index = -1
repeat p_num ;
if temp_s = p_id(cnt) : p_index = cnt : break
loop
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(p_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
repeat rp_num ;
if temp_s = rp_id(cnt) : p_index = cnt : break
loop
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(rp_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
;
temp_s = "(ID:" + temp_s + ")"
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
}
}
;
temp_s = GetCSV(cnt, 1)
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = GetCSV(cnt, 2)
LVCOLUMS = $1, temp_i, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
SelectObject hdc, hFont.0 ;
color 128, , 255 ;
mes strf("\n%11d", int(GetCSV(0, 1)))
color 255, 128 ;
mes strf("\n%11d", int(GetCSV(2, 1)))
color 255 ;
mes strf("\n%11d", int(GetCSV(3, 1)))
color , 128 ;
mes strf("\n%11d", int(GetCSV(6, 1)))
color , , 255 ;
mes strf("\n%11d", int(GetCSV(8, 1)))
noteunsel ;
return
*mode_2_1_1 ;
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
d_sel = stat
*mode_2_1_1_back
clrobj 1, 2 ;
sendmsg hList, $1009 ; LVM_DELETEALLITEMS
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 43, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
sendmsg hList, $101C, 3 ; (LVM_DELETECOLUMN)
sendmsg hList, $101C, 3 ; (LVM_DELETECOLUMN)
sendmsg hList, $101C, 3 ; (LVM_DELETECOLUMN)
sendmsg hList, $101C, 3 ; (LVM_DELETECOLUMN)
;
font msgothic, unit_y * 9, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_2_1
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_2_1_2
;
notesel d_list
noteget d_path, notemax - d_sel - 1
noteunsel
;
notesel d_buf_date
noteload "daily\\" + d_path
if notemax = 0 {
dialog "", 1, titl
noteunsel ;
gosub *mode_2_1
return
}
;
repeat notemax - 14, 14
temp_s = GetCSV(cnt, 0) ; ID
p_index = -1
repeat p_num ;
if temp_s = p_id(cnt) : p_index = cnt : break
loop
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(p_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
repeat rp_num ;
if temp_s = rp_id(cnt) : p_index = cnt : break
loop
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(rp_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
;
temp_s = "(ID:" + temp_s + ")"
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
}
}
;
temp_s = GetCSV(cnt, 1)
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = GetCSV(cnt, 2)
LVCOLUMS = $1, temp_i, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
SelectObject hdc, hFont.0 ;
color 255, 128 ;
mes strf("\n%11d", int(GetCSV(3, 1)))
color 255 ;
mes strf("\n%11d", int(GetCSV(4, 1)))
color , 128 ;
mes strf("\n%11d", int(GetCSV(7, 1)))
color , , 255 ;
mes strf("\n%11d", int(GetCSV(11, 1)))
noteunsel ;
return
*mode_2_1_2 ;
clrobj 1, 2 ;
sendmsg hList, $1009 ; LVM_DELETEALLITEMS
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 13, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 16, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 21, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 17, varptr(temp_s), 0, 0
sendmsg hList, $101B, 3, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
sendmsg hList, $101C, 4 ; (LVM_DELETECOLUMN)
sendmsg hList, $101C, 4 ; (LVM_DELETECOLUMN)
sendmsg hList, $101C, 4 ; (LVM_DELETECOLUMN)
;
font msgothic, unit_y * 9, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_2_1
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_2_1_1_back
notesel u_buf_date
noteload "hourly\\" + d_path
repeat 24
;
temp_s = strf("%02d:00", cnt)
LVCOLUMS = $1, cnt, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = GetCSV(cnt + 1, 1)
temp_i = int(temp_s)
LVCOLUMS = $1, cnt, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = GetCSV(cnt + 1, 2)
LVCOLUMS = $1, cnt, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
if temp_i {
temp_s = str(int(temp_s) / temp_i)
} else : temp_s = "0"
LVCOLUMS = $1, cnt, 3, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
noteunsel
return
*mode_3_1 ;
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
temp_i = stat
clrobj 1, 2 ;
sendmsg hList, $1009 ; LVM_DELETEALLITEMS
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 55, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
sendmsg hList, $101C, 2 ; (LVM_DELETECOLUMN)
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
font msgothic, unit_y * 9
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_3_back
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_3_1_refund
;
notesel r_list
noteget temp_s, notemax - temp_i - 1
noteunsel
r_path = f_date + "\\" + temp_s ;
;
notesel h_buf
noteload "history\\" + r_path
if notemax = 0 {
dialog "", 1, titl
noteunsel ;
gosub *mode_3_back
return
}
;
repeat notemax - 2, 2
temp_s = GetCSV(cnt, 0) ; ID
p_index = -1
repeat p_num ;
if temp_s = p_id(cnt) : p_index = cnt : break
loop
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(p_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
repeat rp_num ;
if temp_s = rp_id(cnt) : p_index = cnt : break
loop
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(rp_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
;
temp_s = "(ID:" + temp_s + ")"
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
}
}
;
temp_s = GetCSV(cnt, 1)
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
SelectObject hdc, hFont.0 ;
color 255 ;
mes strf("\n\n%11d", int(GetCSV(0, 1)))
noteunsel ;
return
*mode_4_2 ;
;
dim o_num, 10 ; (1)
dim o_sum ;
dim o_focus ;
dim o_input ;
*mode_4_2_back ;
clr 0 ; ()
;
SelectObject hdc, hFont.0
color 255 ;
pos unit_x * 6, unit_y * 6
mes "" + strf("(%04d/%02d/%02d[%s])", gettime(0), gettime(1), gettime(3), s_week(gettime(2)))
color , , 255 ;
mes ""
color ;
pos ginfo_cx + unit_y * 6, ginfo_cy + unit_y * 3
lay_x = ginfo_cx : lay_y = ginfo_cy
mes "10000× \n 5000× \n 2000× \n 1000× \n 500× \n 100× \n 50× \n 10× \n 5× \n 1× "
pos ginfo_cx - unit_y * 6, ginfo_cy + unit_y * 3
lay_mpx = ginfo_cx : lay_mpy = ginfo_cy
mes " "
;
font msgothic, unit_y * 5
objmode 2
pos lay_x + unit_y * 28, lay_y + 1
repeat length(o_num)
input o_num(cnt), unit_y * 20, unit_y * 6 ;
hInput.cnt = objinfo_hwnd(stat)
SetWindowLong hInput.cnt, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.cnt, 0 ; IME
loop
pos lay_mpx + unit_y * 13, lay_mpy + 1
input o_sum, unit_y * 41, unit_y * 6 ;
nInput = stat
objskip nInput, 7 ;
hInput.nInput = objinfo_hwnd(nInput)
SetWindowLong hInput.nInput, -16, $50010080 | $2002 ;
ImmAssociateContext hInput.nInput, 0 ; IME
sendmsg hInput.nInput, $CF, 1 ;
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 3
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 7, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_2_1
objskip stat, 3
;
font msgothic, unit_y * 7
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_4
objskip stat, 3
pos lay_px(0), lay_py(2)
button gosub "", *o_change
objskip stat, 3
//
;
lay_x = unit_x * (81 - 5) : lay_y = ginfo_cy - unit_y * 5
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = 0 : lay_iy = 0
lay_nx = 3 : lay_ny = 4
;
font msgothic, unit_y * 8, 1
objmode 2
;
objsize lay_sx * 2 + lay_ix, lay_sy
pos lay_px(tkey_arg(10, 0)), lay_py(tkey_arg(10, 1))
button gosub "", *o_tenkey
tkey_clr_ID = stat
objskip tkey_clr_ID, 3
;
objsize lay_sx, lay_sy
repeat length(tkey_arg) - 1
pos lay_px(tkey_arg(cnt, 0)), lay_py(tkey_arg(cnt, 1))
button gosub str(cnt), *o_tenkey
objskip stat, 3
loop
oncmd gosub *o_command, $111 ;
return
*mode_4_2_1
oncmd gosub *dummy, $111 ;
clr 0 ; ()
;
notesel d_buf
d_total = int(GetCSV(9, 1))
noteunsel
;
SelectObject hdc, hFont.0
color 255 ;
pos unit_x * 6, unit_y * 6
mes "" + strf("(%04d/%02d/%02d[%s])", gettime(0), gettime(1), gettime(3), s_week(gettime(2)))
color , , 255 ;
mes ""
;
temp_i = ginfo_cx : lay_mpy = ginfo_cy + unit_y * 6
SelectObject hdc, hFont.0 ;
pos ginfo_winx, ginfo_winy
mes strf(" %8d ", 0)
lay_msx = ginfo_mesx : lay_msy = ginfo_mesy
lay_mpx = temp_i + unit_y * 75 - lay_msx ;
;
color , , 255 ;
pos lay_mpx, lay_mpy
mes strf(" %10d ", o_sum)
;
color 255 ;
mes strf(" %10d ", d_total)
color 0, 0, 0
mes "────────────"
;
color , 128 ;
mes strf(" %10d ", o_sum - d_total)
;
lay_x = unit_x * (81 - 5) : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
;
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_2_1_error
objskip stat, 3
;
font msgothic, unit_y * 9
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_4_2_back
return
*mode_4_3 ;
clr 0 ; ()
//
pos unit_x * 6, unit_y * 6
winobj "SysListView32", "", $200, $50000001, unit_x * 75, ginfo_winy - unit_y * 18
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 67, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
//
;
font msgothic, unit_y * 9
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_4
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_3_2
dirlist r_list, "refund\\" + f_date + "\\**-**-**.csv", 3
repeat stat
temp_s = strmid(r_list, cnt * 14, 8) ; ( + )
strrep temp_s, "-", ":"
;
LVCOLUMS = $1, 0, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
noteunsel
return
*mode_4_3_2 ;
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
temp_i = stat
clrobj 1, 2 ;
sendmsg hList, $1009 ; LVM_DELETEALLITEMS
;
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 55, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
sendmsg hList, $101C, 2 ; (LVM_DELETECOLUMN)
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
font msgothic, unit_y * 9
objmode 2
pos lay_px(0), lay_py(0)
button gosub "", *mode_4_3
font msgothic, unit_y * 9, 5
objmode 2
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_3_2_cancel
;
notesel r_list
noteget temp_s, notemax - temp_i - 1
noteunsel
r_path = f_date + "\\" + temp_s ;
;
notesel h_buf
noteload "refund\\" + r_path
if notemax = 0 {
dialog "", 1, titl
noteunsel ;
gosub *mode_4_3
return
}
;
repeat notemax - 2, 2
temp_s = GetCSV(cnt, 0) ; ID
p_index = -1
repeat p_num ;
if temp_s = p_id(cnt) : p_index = cnt : break
loop
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(p_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
repeat rp_num ;
if temp_s = rp_id(cnt) : p_index = cnt : break
loop
if p_index >= 0 { ;
;
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(rp_name(p_index))
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
} else {
;
temp_s = "(ID:" + temp_s + ")"
LVCOLUMS = $1, temp_i, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
}
}
;
temp_s = GetCSV(cnt, 1)
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
;
SelectObject hdc, hFont.0 ;
color 255 ;
mes strf("\n\n%11d", int(GetCSV(0, 1)))
noteunsel ;
return
*mode_4_4 ;
clr 0 ; ()
getini "system", "pdcount", s_pdcount
;
font msgothic, unit_y * 5, 1
objmode 2
pos unit_x * 6, unit_y * 6
mes ""
input a_name, unit_x * 72, unit_y * 6
pos ginfo_cx + unit_x * 72, unit_y * 6
mes ""
input a_value, unit_x * 24, unit_y * 6
hInput = objinfo_hwnd(stat)
SetWindowLong hInput, -16, $50010080 | $2 ;
ImmAssociateContext hInput, 0 ; IME
pos ginfo_cx + unit_x * 24, unit_y * 11
objsize unit_x * 20, unit_y * 6
button gosub "", *mode_4_4_add
;
pos unit_x * 6, unit_y * 18
winobj "SysListView32", "", $200, $50000001, ginfo_winx - unit_x * 12, ginfo_winy - unit_y * 30
hList = objinfo_hwnd(stat)
sendmsg hList, $1036, , $1 | $20 ; (LVM_SETEXTENDEDLISTVIEWSTYLE)
sendmsg hList, $30, hFont.1, 0 ; (WM_SETFONT)
syscolor 16
sendmsg hList, $1001, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETBKCOLOR)
sendmsg hList, $1026, , (ginfo_r) + (ginfo_g << 8) + (ginfo_b << 16) ; (LVM_SETTEXTBKCOLOR)
color 0, 0, 0
ImmAssociateContext hList, 0 ; IME
objsize (ginfo_winx - unit_x * 12) / 4, unit_y * 6
lay_x = (ginfo_winx - unit_x * 12) / 4
lay_y = ginfo_cy
;
button gosub "", *mode_4_4_delete
pos unit_x * 6 + lay_x, lay_y
button gosub "", *mode_4_4_up
pos unit_x * 6 + lay_x * 2, lay_y
button gosub "", *mode_4_4_down
font msgothic, unit_y * 5, 5
objmode 2
pos unit_x * 6 + lay_x * 3, lay_y
button gosub "", *mode_4_4_reflect
;
temp_s = "ID"
LVCOLUMS = $F, 1, unit_x * 24, varptr(temp_s), 0, 0
sendmsg hList, $101B, 0, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 0, unit_x * 64, varptr(temp_s), 0, 0
sendmsg hList, $101B, 1, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
temp_s = ""
LVCOLUMS = $F, 1, unit_x * 12, varptr(temp_s), 0, 0
sendmsg hList, $101B, 2, varptr(LVCOLUMS) ; LVM_INSERTCOLUMN
;
repeat p_num
; ID
temp_s = p_ID(cnt)
LVCOLUMS = $1, cnt, 0, 0, 0, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = p_name(cnt)
LVCOLUMS = $1, cnt, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = str(p_value(cnt))
LVCOLUMS = $1, cnt, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
loop
return
*mode_4_5 ;
clr 0 ; ()
;
lay_x = 0 : lay_y = 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy
lay_ox = unit_x * 12 : lay_oy = unit_y * 12
lay_ix = unit_x * 4 : lay_iy = unit_y * 4
lay_nx = 1 : lay_ny = 3
;
font msgothic, unit_y * 12
objmode 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_4_5_1
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_5_2
pos lay_px(0), lay_py(2)
button gosub "", *mode_4
return
*mode_4_5_1 ;
clr 0 ; ()
pos unit_x * 6, unit_y * 6
font msgothic, unit_y * 6
mes ""
color 255 ;
mes "\n:" + s_password
color , , 255 ;
mes "\n:"
objmode 2
pos ginfo_cx + ginfo_mesx, ginfo_cy - unit_y * 6
input e_newpass, unit_y * 14, unit_y * 7, 4
hInput = objinfo_hwnd(stat)
sendmsg hInput, $CC, '*' ; EM_SETPASSWORDCHAR
SetWindowLong hInput, -16, $50010080 | $2000 ;
ImmAssociateContext hInput, 0 ; IME
font msgothic, unit_y * 3
color
pos unit_x * 6
mes "\n※ 4使\n※ 0000"
//
;
font msgothic, unit_y * 9, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_4_5
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_5_1_change
return
*mode_4_5_2 ;
clr 0 ; ()
;
dim i_today
dim i_ex
dim i_total
dim i_pd
font msgothic, unit_y * 4, 1
pos unit_x * 6, unit_y * 6
color 255 ;
mes "\n"
font msgothic, unit_y * 6
objmode 2
objsize unit_x * 75, unit_y * 6, unit_y * 8
chkbox "", i_today
objenable stat, s_opened + (s_last = s_today) ;
chkbox "", i_ex
chkbox "", i_total
chkbox "", i_pd
button gosub "", *mode_4_5_2_all
hButton = objinfo_hwnd(stat)
sendmsg hButton, $F4, $3
//
;
font msgothic, unit_y * 9, 1
objmode 2
;
lay_x = unit_x * (81 - 5) : lay_y = unit_y * 0
lay_ex = ginfo_winx : lay_ey = ginfo_winy / 2
lay_ox = unit_x * 6 : lay_oy = unit_y * 6
lay_ix = unit_x : lay_iy = unit_y
lay_nx = 1 : lay_ny = 2
objsize lay_sx, lay_sy
pos lay_px(0), lay_py(0)
button gosub "", *mode_4_5
pos lay_px(0), lay_py(1)
button gosub "", *mode_4_5_2_init
return
///////////////// /////////////////
*o_open ;
dialog "" + o_sum + "\n", 2, titl
if stat = 7 : return
oncmd gosub *dummy, $111 ;
;
d_buf = s_today + "\n," + o_sum + "\n\n,0\n,0\n\n,0\n,0\n\n," + o_sum + "\n,0\n,0\n\nID,,\n"
repeat p_num
d_buf += p_id(cnt) + ",0,0\n"
loop
notesel d_buf ; ()
notesave "daily\\" + f_date + ".csv"
noteunsel
;
notesel d_buf_total
WriteCSV 0, 1, str(int(GetCSV(0, 1)) + 1)
notesave "total.csv"
;
s_opened = 1
writeini "system", "opened", s_opened
;
s_last = s_today
writeini "system", "last", s_last
;
dirlist temp_s, "history\\" + f_date, 5
if stat = 0 : mkdir "history\\" + f_date
;
dirlist temp_s, "refund\\" + f_date, 5
if stat = 0 : mkdir "refund\\" + f_date
;
u_buf = ",,\n"
repeat 24
u_buf += strf("%02d,0,0\n", cnt)
loop
notesel u_buf
notesave "hourly\\" + f_date + ".csv"
noteunsel
gosub *mode_4 ;
return
*o_close ;
o_error = o_sum - d_total ;
if o_error { ;
dialog "" + o_error + "\n", 3, titl
} else { ;
dialog "", 2, titl
}
if stat = 7 : return ;
;
notesel d_buf
WriteCSV 10, 1, str(o_sum) ;
WriteCSV 11, 1, str(o_error) ;
notesave "daily\\" + f_date + ".csv"
noteunsel
notesel d_buf_total
WriteCSV 8, 1, str(int(GetCSV(8, 1)) + o_error)
notesave "total.csv"
noteunsel
;
s_opened = 0
writeini "system", "opened", s_opened
gosub *mode_4
return
*o_change
o_input ^ 1 ; 0,1
if o_input { ; o_input = 1
oncmd gosub *dummy, $111 ; WM_COMMAND
repeat 9 + s_opened
sendmsg hInput.cnt, $CF, 1 ;
objprm cnt, 0 ;
objskip cnt, 7 ;
loop
sendmsg hInput(9 + s_opened), $CF, 0 ;
o_focus = 9 + s_opened
objsel o_focus ;
objskip o_focus, 5 ;
} else { ; o_input = 0
sendmsg hInput(9 + s_opened), $CF, 1 ;
objskip 9 + s_opened, 7 ;
repeat 9 + s_opened
sendmsg hInput.cnt, $CF, 0 ;
objskip cnt, 5 ;
loop
oncmd gosub *o_command, $111 ; WM_COMMAND
o_focus = 0
objsel o_focus ;
}
return
*o_command ;
repeat 9 + s_opened
if lParam = hInput.cnt {
o_focus = cnt ; ID
;
o_sum = 0
repeat 10
o_sum += o_amount(cnt) * o_num(cnt)
loop
objprm 9 + s_opened, o_sum ;
}
loop
return
*o_tenkey ;
temp_i = stat - tkey_clr_ID ; ID
objsel o_focus
if temp_i { ;
if o_focus < 9 + s_opened {
if o_num(o_focus + 1 - s_opened) > 0 : keybd_event 39, 0, 0, 0 ; →
} else {
if o_sum > 0 : keybd_event 39, 0, 0, 0 ; →
}
keybd_event temp_i + 47, 0, 0, 0 ; 09
} else {
keybd_event 48, 0, 0, 0 ; 0
}
return
*load_pd ;
//
; (p_num)
sdim p_buf, 4096 ;
dim p_num ;
;
notesel p_buf
noteload "pd.csv"
;
if notemax = 0 {
dialog "(pd.csv)\n", 1, titl
noteunsel ;
return
}
; CSV
p_num = notemax - 1
; (p_num)
sdim p_id, p_num ; ID
sdim p_name, , p_num ;
dim p_value, p_num ;
repeat p_num ;
noteget temp_s, cnt + 1 ;
split temp_s, ",", p_id(cnt), p_name(cnt), temp_s ; (ID, , )
p_value(cnt) = int(temp_s) ; int
loop
noteunsel ;
//
; (p_num)
sdim rp_buf, 4096 ;
dim rp_num ;
;
notesel rp_buf
noteload "rpd.csv"
;
if notemax = 0 {
dialog "(rpd.csv)\n", 1, titl
noteunsel ;
return
}
; CSV
rp_num = notemax - 1
; (p_num)
sdim rp_id, rp_num ; ID
sdim rp_name, , rp_num ;
dim rp_value, rp_num ;
repeat rp_num ;
noteget temp_s, cnt + 1 ;
split temp_s, ",", rp_id(cnt), rp_name(cnt), temp_s ; (ID, , )
rp_value(cnt) = int(temp_s) ; int
loop
noteunsel ;
return
*aggregate ;
if s_last ! s_today : return ;
clr 0 ; ()
SelectObject hdc, hFont.0
pos 0, 0
mes "..."
return
// sub_1
*sub_1_OK
if input_pw ! s_password {
dialog "", 0, titl
objsel 0
return
}
onkey 0
HideSubWindow 1
gosub *mode_4
return
*sub_1_cancel
onkey 0
HideSubWindow 1
return
// mode_1
*mode_1_cancel ; mode_1
if c_anum {
dialog "", 2, titl
if stat = 7 : return
}
gosub *mode_0
return
*mode_1_tenkey ; mode_1 and mode_1_1
temp_i = stat - tkey_clr_ID ; ID
objsel 0 ;
if temp_i { ;
keybd_event temp_i + 47, 0, 0, 0 ; 09
} else {
keybd_event 46, 0, 0, 0 ; Delete
}
return
*mode_1_key_event ; mode_1
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
temp_i = stat ; INDEX
;
if wParam >= 48 & wParam <= 57 { ;
c_num(temp_i) = c_num(temp_i) * 10 + wParam - 48
} elseif wParam >= 96 and wParam <= 105 { ;
c_num(temp_i) = c_num(temp_i) * 10 + wParam - 96
} elseif wParam = 8 | wParam = 46 { ; BSDEL
c_num(temp_i) = 0
} else {
return
}
;
temp_s = str(c_num(temp_i))
LVCOLUMS = $1, temp_i, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
c_total = 0 : c_anum = 0
repeat p_num
c_anum += c_num(cnt)
c_total += p_value(cnt) * c_num(cnt)
loop
;
clr 2, lay_mpx, lay_mpy, lay_mpx + lay_msx, lay_mpy + lay_msy
SelectObject hdc, hFont.0
pos lay_mpx, lay_mpy
mes strf("%8d", c_total)
return
*mode_1_1_key_event ; mode_1_1
;
if wParam >= 48 & wParam <= 57 { ;
temp_i = wParam - 48
c_depoint = c_depoint * 10 + temp_i
} elseif wParam >= 96 and wParam <= 105 { ;
temp_i = wParam - 96
c_depoint = c_depoint * 10 + temp_i
} elseif wParam = 8 | wParam = 46 { ; BSDEL
c_depoint = 0
} else {
return
}
/*mode_1_1_exactly2 ; */
clr 2, lay_mpx, lay_mpy, lay_mpx + lay_msx, lay_mpy + lay_msy
SelectObject hdc, hFont.0
color 255, 0, 0
pos lay_mpx, lay_mpy
mes strf(" %8d ", c_depoint)
color 0, 0, 0
return
*mode_1_1_confirm
if c_depoint < c_total {
dialog "\n", 0, titl
return
}
if c_change {;
; &
onkey 0
objenable 1, 0 ;
repeat 11
objenable tkey_clr_ID + cnt, 0 ;
loop
objprm 2, ""
;
SelectObject hdc, hFont.0
color 0, 0, 255
pos lay_mpx, lay_mpy + lay_msy * 2
mes strf(" %8d ", c_depoint - c_total)
color 0, 0, 0
c_change = 0
return
}
//
;
notesel d_buf_total
WriteCSV 2, 1, str(int(GetCSV(2, 1)) + 1) ;
WriteCSV 3, 1, str(int(GetCSV(3, 1)) + c_total) ;
repeat p_num
if c_num(cnt) = 0 : continue ; 0
SearchCSV 11, 0, p_id(cnt) ; ID
if stat = -1 {
d_buf_total += p_id(cnt) + "," + c_num(cnt) + ",0\n" ;
} else {
WriteCSV stat, 1, str(int(GetCSV(stat, 1)) + c_num(cnt)) ;
}
loop
notesave "total.csv"
noteunsel ;
;
notesel u_buf
WriteCSV gettime(4) + 1, 1, str(int(GetCSV(gettime(4) + 1, 1)) + 1) ;
WriteCSV gettime(4) + 1, 2, str(int(GetCSV(gettime(4) + 1, 2)) + c_total) ;
notesave "hourly\\" + f_date + ".csv"
noteunsel
;
notesel d_buf
WriteCSV 3, 1, str(int(GetCSV(3, 1)) + 1) ;
WriteCSV 4, 1, str(int(GetCSV(4, 1)) + c_total) ;
WriteCSV 9, 1, str(int(GetCSV(9, 1)) + c_total) ;
;
h_buf = "," + c_total + "\nID,\n" ; ()
repeat p_num
if c_num(cnt) = 0 : continue ; 0
;
h_buf += p_id(cnt) + "," + c_num(cnt) + "\n"
;
SearchCSV 14, 0, p_id(cnt) ; ID
if stat = -1 {
d_buf += p_id(cnt) + "," + c_num(cnt) + ",0\n" ;
} else {
WriteCSV stat, 1, str(int(GetCSV(stat, 1)) + c_num(cnt)) ;
}
loop
notesave "daily\\" + f_date + ".csv" ;
noteunsel
notesel h_buf ;
notesave "history\\" + f_date + "\\" + strf("%02d-%02d-%02d", gettime(4), gettime(5), gettime(6)) + ".csv" ;
noteunsel
gosub *mode_0 ;
return
*mode_3_1_refund ;
dialog "", 2, titl
if stat = 7 : return ;
notesel h_buf ;
;
r_total = int(GetCSV(0, 1))
r_pnum = notemax - 2 ;
repeat r_pnum
r_ID(cnt) = GetCSV(cnt + 2, 0) ; ID
r_num(cnt) = int(GetCSV(cnt + 2, 1)) ;
loop
noteunsel ;
;
notesel d_buf
WriteCSV 3, 1, str(int(GetCSV(3, 1)) - 1) ;
WriteCSV 4, 1, str(int(GetCSV(4, 1)) - r_total) ;
WriteCSV 6, 1, str(int(GetCSV(6, 1)) + 1) ;
WriteCSV 7, 1, str(int(GetCSV(7, 1)) + r_total) ;
WriteCSV 9, 1, str(int(GetCSV(9, 1)) - r_total) ;
repeat r_pnum
SearchCSV 14, 0, r_ID(cnt) ; ID
temp_i = stat
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) - r_num(cnt)) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) + r_num(cnt)) ;
loop
notesave "daily\\" + f_date + ".csv" ;
noteunsel
;
temp_i = int(getpath(r_path, 9)) + 1
notesel u_buf
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) - 1) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) - r_total) ;
notesave "hourly\\" + f_date + ".csv" ;
noteunsel
;
notesel d_buf_total
WriteCSV 2, 1, str(int(GetCSV(2, 1)) - 1) ;
WriteCSV 3, 1, str(int(GetCSV(3, 1)) - r_total) ;
WriteCSV 5, 1, str(int(GetCSV(5, 1)) + 1) ;
WriteCSV 6, 1, str(int(GetCSV(6, 1)) + r_total) ;
repeat r_pnum
SearchCSV 9, 0, r_ID(cnt) ; ID
temp_i = stat
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) - r_num(cnt)) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) + r_num(cnt)) ;
loop
notesave "total.csv" ;
noteunsel
; ()
bcopy "history\\" + r_path, "refund\\" + r_path ;
delete "history\\" + r_path ;
gosub *mode_3_back
return
*mode_4_2_1_error
o_error = o_sum - d_total ;
if o_error {
dialog "" + o_error + "", 1, titl
}
;
notesel d_buf
WriteCSV 11, 1, str(o_sum - d_total)
notesave "daily\\" + f_date + ".csv"
noteunsel
notesel d_buf_total
WriteCSV 8, 1, str(int(GetCSV(8, 1)) + o_sum - d_total)
notesave "total.csv"
noteunsel
gosub *mode_4
return
*mode_4_3_2_cancel
dialog "", 2, titl
if stat = 7 : return ;
notesel h_buf ;
;
r_total = int(GetCSV(0, 1))
r_pnum = notemax - 2 ;
repeat r_pnum
r_ID(cnt) = GetCSV(cnt + 2, 0) ; ID
r_num(cnt) = int(GetCSV(cnt + 2, 1)) ;
loop
noteunsel ;
;
notesel d_buf
WriteCSV 3, 1, str(int(GetCSV(3, 1)) + 1) ;
WriteCSV 4, 1, str(int(GetCSV(4, 1)) + r_total) ;
WriteCSV 6, 1, str(int(GetCSV(6, 1)) - 1) ;
WriteCSV 7, 1, str(int(GetCSV(7, 1)) - r_total) ;
WriteCSV 9, 1, str(int(GetCSV(9, 1)) + r_total) ;
repeat r_pnum
SearchCSV 14, 0, r_ID(cnt) ; ID
temp_i = stat
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) + r_num(cnt)) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) - r_num(cnt)) ;
loop
notesave "daily\\" + f_date + ".csv" ;
noteunsel
;
temp_i = int(getpath(r_path, 9)) + 1
notesel u_buf
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) + 1) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) + r_total) ;
notesave "hourly\\" + f_date + ".csv" ;
noteunsel
;
notesel d_buf_total
WriteCSV 2, 1, str(int(GetCSV(2, 1)) + 1) ;
WriteCSV 3, 1, str(int(GetCSV(3, 1)) + r_total) ;
WriteCSV 5, 1, str(int(GetCSV(5, 1)) - 1) ;
WriteCSV 6, 1, str(int(GetCSV(6, 1)) - r_total) ;
repeat r_pnum
SearchCSV 9, 0, r_ID(cnt) ; ID
temp_i = stat
WriteCSV temp_i, 1, str(int(GetCSV(temp_i, 1)) + r_num(cnt)) ;
WriteCSV temp_i, 2, str(int(GetCSV(temp_i, 2)) - r_num(cnt)) ;
loop
notesave "total.csv" ;
noteunsel
; ()
bcopy "refund\\" + r_path, "history\\" + r_path ;
delete "refund\\" + r_path ;
gosub *mode_4_3
return
*mode_4_4_add ; mode_4_4
if a_name = "" or a_value = 0 {
dialog "", 1, titl
return
}
notesel p_buf
repeat ; ID
SearchCSV 1, 0, strf("%08X", s_pdcount)
if stat ! -1 : s_pdcount++ : else : break
loop
noteadd strf("%08X", s_pdcount) + "," + a_name + "," + a_value, -1, 0 ;
noteunsel
s_pdcount++
;
;
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
temp_i = stat
; ID
temp_s = strf("%08X", s_pdcount)
LVCOLUMS = $1, temp_i, 0, 2, 2, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
LVCOLUMS = $1, temp_i, 1, 0, 0, varptr(a_name)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = str(a_value)
LVCOLUMS = $1, temp_i, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
objprm 0, ""
objprm 1, 0
return
*mode_4_4_delete ; mode_4_4
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
temp_i = stat ; INDEX
;
notesel p_buf
noteget temp_s, temp_i + 1 ;
notedel temp_i + 1 ;
noteunsel
;
notesel rp_buf
noteadd temp_s, -1, 0
noteunsel
;
sendmsg hList, $1008, temp_i ; LVM_DELETEITEM
return
*mode_4_4_up ; mode_4_4
objsel 3 ;
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat <= 0 : return ;
temp_i = stat ; INDEX
;
notesel p_buf
noteget temp_s, temp_i + 1
notedel temp_i + 1
noteadd temp_s, temp_i, 0
;
sendmsg hList, $1008, temp_i ; LVM_DELETEITEM
; ID
temp_s = GetCSV(temp_i, 0)
LVCOLUMS = $1 | $8, temp_i - 1, 0, 2, 2, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = GetCSV(temp_i, 1)
LVCOLUMS = $1, temp_i - 1, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = GetCSV(temp_i, 2)
LVCOLUMS = $1, temp_i - 1, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
noteunsel
return
*mode_4_4_down ; mode_4_4
objsel 3 ;
;
sendmsg hList, $100C, -1, $2 ; LVM_GETNEXTITEM LVNI_SELECTED
if stat = -1 : return
temp_i = stat ; INDEX
;
sendmsg hList, $1004 ; LVM_GETITEMCOUNT
if stat <= temp_i + 1 : return ;
;
notesel p_buf
noteget temp_s, temp_i + 1
notedel temp_i + 1
noteadd temp_s, temp_i + 2, 0
;
sendmsg hList, $1008, temp_i ; LVM_DELETEITEM
; ID
temp_s = GetCSV(temp_i + 2, 0)
LVCOLUMS = $1 | $8, temp_i + 1, 0, 2, 2, varptr(temp_s)
sendmsg hList, $1007, 0, varptr(LVCOLUMS) ; LVM_INSERTITEM
;
temp_s = GetCSV(temp_i + 2, 1)
LVCOLUMS = $1, temp_i + 1, 1, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
;
temp_s = GetCSV(temp_i + 2, 2)
LVCOLUMS = $1, temp_i + 1, 2, 0, 0, varptr(temp_s)
sendmsg hList, $1006, 0, varptr(LVCOLUMS) ; LVM_SETITEM
return
*mode_4_4_reflect ; mode_4_4
writeini "system", "pdcount", s_pdcount ; ID
;
notesel p_buf
notesave "pd.csv"
noteunsel
notesel rp_buf
notesave "rpd.csv"
noteunsel
gosub *load_pd
gosub *mode_4
return
*mode_4_5_1_change ;
dialog "", 2, titl
if stat = 7 : return ;
;
s_password = e_newpass
writeini "system", "pass", s_password
e_newpass = ""
gosub *mode_4_5
return
*mode_4_5_2_all ;
sendmsg hButton, $F0 ;
if stat {
repeat 4 - (1 - ( s_last = s_today)), 1 - (s_last = s_today)
objenable cnt, 0 ;
objprm cnt, 1 ;
loop
} else {
repeat 4 - (1 - (s_last = s_today)), 1 - (s_last = s_today)
objenable cnt, 1 ;
loop
}
return
*mode_4_5_2_init ;
if i_today + i_ex + i_total + i_pd = 0 {
dialog "", 1, titl
return
}
dialog "\n\n()", 3, titl
if stat = 7 : return ;
if i_today and s_last = s_today { ;
delete "daily\\" + f_date + ".csv"
delete "hourly\\" + f_date + ".csv"
deletef dir_cur + "\\history\\" + f_date
deletef dir_cur + "\\refund\\" + f_date
;
s_opened = 0
writeini "system", "opened", s_opened
;
temp_s = ""
writeini "system", "last", temp_s
}
if i_ex { ;
notesel r_list
;
dirlist r_list, "daily\\****-**-**.csv", 1
repeat stat
noteget temp_s, cnt
if temp_s = f_date + ".csv" : continue
delete "daily\\" + temp_s
loop
;
dirlist r_list, "hourly\\****-**-**.csv", 1
repeat stat
noteget temp_s, cnt
if temp_s = f_date + ".csv" : continue
delete "hourly\\" + temp_s
loop
;
dirlist r_list, "history\\****-**-**", 5
repeat stat
noteget temp_s, cnt
if temp_s = f_date : continue
deletef dir_cur + "\\history\\" + temp_s
loop
;
dirlist r_list, "refund\\****-**-**", 5
repeat stat
noteget temp_s, cnt
if temp_s = f_date : continue
deletef dir_cur + "\\refund\\" + temp_s
loop
noteunsel
;
temp_s = ""
writeini "system", "last", temp_s
}
if i_total { ;
delete "total.csv"
}
if i_pd { ;
delete "pd.csv"
delete "rpd.csv"
}
sendmsg hButton, $F0 ;
if stat { ;
delete "settings.ini"
deletef dir_cur + "\\daily"
deletef dir_cur + "\\history"
deletef dir_cur + "\\hourly"
deletef dir_cur + "\\refund"
}
;
GetModuleFileName 0, varptr(temp_s), 260 ;
gosub *release
exec "cmd /q /c \"timeout /t 2 /nobreak & start \"\" \"" + temp_s + "\"\"" ;
end
return
*s_mini ;
sendmsg hwnd, $112, $F020 ; SC_MINIMIZE
return
*sub_1_key_event ;
if wParam = 13 : gosub *sub_1_OK
return
*dummy ; ()
return
/////////////// ///////////////
*release ;
onerror 0
onexit 0
oncmd 0
onkey 0
;
DeleteObject hFont.0 ;
DeleteObject hFont.1 ;
return
*exerror ;
; ()
#ifdef _debug ;
dialog "" + lParam + "" + wParam + "", 1, titl
#else ;
dialog "\n\n : " + wParam, 1, titl
#endif
gosub *release ;
end
end
*exit
if wParam ! 0 {
HideSubWindow wParam ;
return
}
*exit2
#ifndef _debug ;
if s_opened {
dialog "\nOptO", 3, titl
} else {
dialog "OptO", 3, titl
}
if stat = 7 : return
#endif
gosub *release ;
end
end
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX