Skip to content

CAppMainWnd::TrackPopupMenuを追加する - #2880

Merged
berryzplus merged 2 commits into
sakura-editor:masterfrom
berryzplus:feature/add_track_popup_menu
Nov 19, 2026
Merged

berryzplus merged 2 commits into
sakura-editor:masterfrom
berryzplus:feature/add_track_popup_menu

Conversation

@berryzplus

Copy link
Copy Markdown
Contributor

PR対象

  • アプリ(サクラエディタ本体)

カテゴリ

  • 改善

PR の背景

このあたりをテストするために必要。

// 選択されたメニューに対応する処理を実行する
switch( nId ){
case 110: // ファイルを開く
// 通常のドロップファイル処理を行う
::SendMessageAny( GetEditWnd().GetHwnd(), WM_DROPFILES, (WPARAM)hDrop, 0 );
break;

導入すればここを書き替えてテスト可能にできる。

int nId = ::TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_RETURNCMD,
( pt.x > rcWork.left )? pt.x: rcWork.left,
( pt.y < rcWork.bottom )? pt.y: rcWork.bottom,
0, hwnd, nullptr);

仕様・動作説明

  • モック可能なポップアップメニュー表示機能をメインウィンドウの機能として抜き出し定義します。

本件、勝手にやります。

PR の影響範囲

テスト内容

関連 issue, PR

参考資料

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Test Results

2 088 tests  ±0   2 088 ✅ ±0   12m 17s ⏱️ + 2m 2s
  178 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit f81886b. ± Comparison against base commit 4327409.

♻️ This comment has been updated with latest results.

@berryzplus berryzplus left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplication Code 指標で引っかかっている。

CControlTray から抜き出した部分が「まったく同じ」であるため。

CControlTray から ポップアップメニューを表示する には 共通処理 が存在していて、
そこを対策してやればいいんだろうけど。

Comment thread sakura_core/_main/CControlTray.cpp Resolved
モック可能なポップアップメニュー表示機能をメインウィンドウの機能として抜き出し定義する。
@berryzplus
berryzplus force-pushed the feature/add_track_popup_menu branch from ad5091c to f81886b Compare November 19, 2026 03:08
@sonarqubecloud

Copy link
Copy Markdown

@berryzplus
berryzplus merged commit 144ae9c into sakura-editor:master Nov 19, 2026
17 checks passed
@berryzplus
berryzplus deleted the feature/add_track_popup_menu branch November 19, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant