| 420 |
// work |
// work |
| 421 |
BOOL file_exist; |
BOOL file_exist; |
| 422 |
int current_bom; // 存在するファイルのエンコーディング(ファイルのBOMから判定) |
int current_bom; // 存在するファイルのエンコーディング(ファイルのBOMから判定) |
| 423 |
|
UINT_PTR timer; |
| 424 |
|
BOOL enable_timer; |
| 425 |
|
WNDPROC proc; |
| 426 |
TTTSet *pts; |
TTTSet *pts; |
| 427 |
TComVar *pcv; |
TComVar *pcv; |
| 428 |
} LogDlgWork_t; |
} LogDlgWork_t; |
| 525 |
work->current_bom = bom; |
work->current_bom = bom; |
| 526 |
} |
} |
| 527 |
|
|
| 528 |
|
static LRESULT CALLBACK FNameEditProc(HWND dlg, UINT msg, |
| 529 |
|
WPARAM wParam, LPARAM lParam) |
| 530 |
|
{ |
| 531 |
|
LogDlgWork_t *work = (LogDlgWork_t *)GetWindowLongPtr(dlg, GWLP_USERDATA); |
| 532 |
|
switch (msg) { |
| 533 |
|
case WM_KEYDOWN: |
| 534 |
|
case WM_LBUTTONDOWN: |
| 535 |
|
case WM_RBUTTONDOWN: |
| 536 |
|
case WM_KILLFOCUS: |
| 537 |
|
work->enable_timer = FALSE; |
| 538 |
|
break; |
| 539 |
|
} |
| 540 |
|
return CallWindowProcW(work->proc, dlg, msg, wParam, lParam); |
| 541 |
|
} |
| 542 |
|
|
| 543 |
static INT_PTR CALLBACK LogFnHook(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) |
static INT_PTR CALLBACK LogFnHook(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) |
| 544 |
{ |
{ |
| 545 |
static const DlgTextInfo TextInfos[] = { |
static const DlgTextInfo TextInfos[] = { |
| 589 |
// ファイル名を設定する |
// ファイル名を設定する |
| 590 |
// ファイルのチェック、コントロールの設定も行われる |
// ファイルのチェック、コントロールの設定も行われる |
| 591 |
// WM_COMMAND, EN_CHANGE が発生する |
// WM_COMMAND, EN_CHANGE が発生する |
| 592 |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, work->info->filename); |
wchar_t *fname = FLogGetLogFilename(work->info->filename); |
| 593 |
work->info->filename = NULL; |
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |
| 594 |
|
free(fname); |
| 595 |
|
HWND file_edit = GetDlgItem(Dialog, IDC_FOPT_FILENAME_EDIT); |
| 596 |
|
SetWindowLongPtr(file_edit, GWLP_USERDATA, (LONG_PTR)work); |
| 597 |
|
work->proc = (WNDPROC)SetWindowLongPtrW(file_edit, GWLP_WNDPROC, (LONG_PTR)FNameEditProc); |
| 598 |
|
|
| 599 |
// timestamp 種別 |
// timestamp 種別 |
| 600 |
int tstype = pts->LogTimestampType == TIMESTAMP_LOCAL ? 0 : |
int tstype = pts->LogTimestampType == TIMESTAMP_LOCAL ? 0 : |
| 615 |
|
|
| 616 |
CenterWindow(Dialog, GetParent(Dialog)); |
CenterWindow(Dialog, GetParent(Dialog)); |
| 617 |
|
|
| 618 |
|
SetFocus(GetDlgItem(Dialog, IDC_FOPT_FILENAME_EDIT)); |
| 619 |
|
|
| 620 |
|
work->enable_timer = TRUE; |
| 621 |
|
work->timer = SetTimer(Dialog, 0, 1000, NULL); |
| 622 |
|
|
| 623 |
return TRUE; |
return TRUE; |
| 624 |
} |
} |
| 625 |
|
|
| 731 |
DragFinish(hDrop); |
DragFinish(hDrop); |
| 732 |
return TRUE; |
return TRUE; |
| 733 |
} |
} |
| 734 |
|
case WM_TIMER: { |
| 735 |
|
if (!work->enable_timer) { |
| 736 |
|
KillTimer(Dialog, work->timer); |
| 737 |
|
work->timer = 0; |
| 738 |
|
break; |
| 739 |
|
} |
| 740 |
|
wchar_t *fname = FLogGetLogFilename(work->info->filename); |
| 741 |
|
SetDlgItemTextW(Dialog, IDC_FOPT_FILENAME_EDIT, fname); |
| 742 |
|
SendDlgItemMessageW(Dialog, IDC_FOPT_FILENAME_EDIT, EM_SETSEL, 0, -1); |
| 743 |
|
free(fname); |
| 744 |
|
work->timer = SetTimer(Dialog, 0, 1000, NULL); |
| 745 |
|
break; |
| 746 |
|
} |
| 747 |
|
case WM_DESTROY: |
| 748 |
|
if (work->timer != 0) { |
| 749 |
|
KillTimer(Dialog, work->timer); |
| 750 |
|
} |
| 751 |
|
break; |
| 752 |
} |
} |
| 753 |
return FALSE; |
return FALSE; |
| 754 |
} |
} |
| 1399 |
BOOL FLogOpenDialog(HINSTANCE hInst, HWND hWnd, FLogDlgInfo_t *info) |
BOOL FLogOpenDialog(HINSTANCE hInst, HWND hWnd, FLogDlgInfo_t *info) |
| 1400 |
{ |
{ |
| 1401 |
LogDlgWork_t *work = (LogDlgWork_t *)calloc(sizeof(LogDlgWork_t), 1); |
LogDlgWork_t *work = (LogDlgWork_t *)calloc(sizeof(LogDlgWork_t), 1); |
|
wchar_t *srcfnameW = FLogGetLogFilename(info->filename); |
|
| 1402 |
work->info = info; |
work->info = info; |
|
work->info->filename = srcfnameW; |
|
| 1403 |
work->pts = &ts; |
work->pts = &ts; |
| 1404 |
work->pcv = &cv; |
work->pcv = &cv; |
| 1405 |
INT_PTR ret = TTDialogBoxParam( |
INT_PTR ret = TTDialogBoxParam( |
| 1406 |
hInst, MAKEINTRESOURCE(IDD_LOGDLG), |
hInst, MAKEINTRESOURCE(IDD_LOGDLG), |
| 1407 |
hWnd, LogFnHook, (LPARAM)work); |
hWnd, LogFnHook, (LPARAM)work); |
|
free(srcfnameW); |
|
| 1408 |
free(work); |
free(work); |
| 1409 |
return ret == IDOK ? TRUE : FALSE; |
return ret == IDOK ? TRUE : FALSE; |
| 1410 |
} |
} |