-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
プロパティシートのコントロール表示のちらつき防止 #1424
プロパティシートのコントロール表示のちらつき防止 #1424
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -616,6 +616,8 @@ void CPropKeyword::SetKeyWordSet( HWND hwndDlg, int nIdx ) | |
HWND hwndList; | ||
LV_ITEM lvi; | ||
|
||
::SendMessage( hwndDlg, WM_SETREDRAW, FALSE, 0 ); | ||
|
||
ListView_DeleteAllItems( ::GetDlgItem( hwndDlg, IDC_LIST_KEYWORD ) ); | ||
if( 0 <= nIdx ){ | ||
::EnableWindow( ::GetDlgItem( hwndDlg, IDC_BUTTON_DELSET ), TRUE ); | ||
|
@@ -654,9 +656,6 @@ void CPropKeyword::SetKeyWordSet( HWND hwndDlg, int nIdx ) | |
nNum = m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.GetKeyWordNum( nIdx ); | ||
hwndList = ::GetDlgItem( hwndDlg, IDC_LIST_KEYWORD ); | ||
|
||
// 2005.01.25 Moca/genta リスト追加中は再描画を抑制してすばやく表示 | ||
::SendMessageAny( hwndList, WM_SETREDRAW, FALSE, 0 ); | ||
|
||
for( i = 0; i < nNum; ++i ){ | ||
/* n番目のセットのm番目のキーワードを返す */ | ||
const WCHAR* pszKeyWord = m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.GetKeyWord( nIdx, i ); | ||
|
@@ -670,12 +669,12 @@ void CPropKeyword::SetKeyWordSet( HWND hwndDlg, int nIdx ) | |
} | ||
m_Common.m_sSpecialKeyword.m_CKeyWordSetMgr.m_nCurrentKeyWordSetIdx = nIdx; | ||
|
||
// 2005.01.25 Moca/genta リスト追加完了のため再描画許可 | ||
::SendMessageAny( hwndList, WM_SETREDRAW, TRUE, 0 ); | ||
|
||
//キーワード数を表示する。 | ||
DispKeywordCount( hwndDlg ); | ||
|
||
::SendMessage( hwndDlg, WM_SETREDRAW, TRUE, 0 ); | ||
InvalidateRect(hwndDlg, NULL, FALSE); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここにはありますね・・・ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ここも親ダイアログに対しての場合ですね。 |
||
|
||
return; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1173,7 +1173,7 @@ END | |
|
||
IDD_PROP_TAB DIALOGEX 0, 0, 293, 240 | ||
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||
EXSTYLE WS_EX_CONTEXTHELP | ||
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_COMPOSITED | ||
FONT 9, "MS Pゴシック" | ||
BEGIN | ||
CONTROL "タブバーを表示する(&D)", IDC_CHECK_DispTabWnd, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 11, 111, 10 | ||
|
@@ -1187,7 +1187,7 @@ BEGIN | |
LTEXT "閉じるボタン(&X)", IDC_TextTabClose, 124, 116, 48, 8 | ||
COMBOBOX IDC_CHECK_DispTabClose, 173, 113, 46, 80, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | ||
PUSHBUTTON "フォント(&F)...", IDC_BUTTON_TABFONT, 232, 113, 51, 14 | ||
RTEXT "Font", IDC_STATIC_TABFONT, 102, 127, 180, 17, SS_RIGHT | ||
RTEXT "Font", IDC_STATIC_TABFONT, 102, 127, 180, 12, SS_RIGHT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これは必要です? or NOT? 必要なら入れたらよいと思います。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WS_EX_COMPOSITED を付けるとこの変更入れないと表示に問題がありました。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles の
と書かれています。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
画面の下から上の順番でコントロールを描画していくってことでしょうね。 |
||
CONTROL "タブ一覧をソートする(&S)", IDC_CHECK_SortTabList, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 15, 129, 85, 10 | ||
CONTROL "多段(&M)", IDC_CHECK_TAB_MULTILINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 15, 141, 60, 10 | ||
RTEXT "表示位置(&P)", IDC_TAB_POSITION, 80, 143, 40, 8 | ||
|
@@ -1404,7 +1404,7 @@ END | |
|
||
IDD_PROP_KEYBIND DIALOGEX 0, 0, 293, 240 | ||
STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||
EXSTYLE WS_EX_CONTEXTHELP | ||
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_COMPOSITED | ||
FONT 9, "MS Pゴシック" | ||
BEGIN | ||
RTEXT "種別(&K)", IDC_LABEL_MENUFUNCKIND, 4, 4, 51, 8 | ||
|
@@ -1428,7 +1428,7 @@ END | |
|
||
IDD_PROP_CUSTMENU DIALOGEX 0, 0, 293, 240 | ||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | ||
EXSTYLE WS_EX_CONTEXTHELP | ||
EXSTYLE WS_EX_CONTEXTHELP | WS_EX_COMPOSITED | ||
FONT 9, "MS Pゴシック" | ||
BEGIN | ||
RTEXT "種別(&K)", IDC_LABEL_MENUFUNCKIND, 4, 4, 52, 8 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ん?これは必要ですか・・・?
(たぶん、必要だから入れてると思いますが念のための確認です。)
window描画の仕組み
InvalidateRect(hwnd, NULL, FALSE)
は、クライアント領域の全域更新を指示する命令です。WM_SETREDRAW で再描画フラグを戻しただけだけだと更新されない仕様だと思うんですが、ここに要るなら他にもいるような気がして、何故ここだけ?と思いました。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コントロールのウィンドウの変更に対して WM_SETREDRAW する場合は後で InvalidateRect を呼ばないでも表示が更新されてたんですが、親のダイアログの場合は呼ばないと表示が更新されませんでした。理屈は分かっていません。