mirror of
https://github.com/zhongyang219/MusicPlayer2.git
synced 2026-10-21 08:20:02 +08:00
增加浮动播放列表搜索时禁止拖动的处理,迷你模式增加拖动排序功能
This commit is contained in:
@@ -115,6 +115,12 @@ void CFloatPlaylistDlg::GetPlaylistItemSelected()
|
||||
|
||||
}
|
||||
|
||||
void CFloatPlaylistDlg::SetDragEnable()
|
||||
{
|
||||
bool enable = CPlayer::GetInstance().IsPlaylistMode() && !m_searched; //处于播放列表模式且不处理搜索状态时才允许拖动排序
|
||||
m_playlist_ctrl.SetDragEnable(enable);
|
||||
}
|
||||
|
||||
bool CFloatPlaylistDlg::Initilized() const
|
||||
{
|
||||
return m_playlist_ctrl.GetSafeHwnd() != NULL && m_path_static.GetSafeHwnd() != NULL && m_path_edit.GetSafeHwnd() != NULL
|
||||
@@ -174,7 +180,7 @@ BOOL CFloatPlaylistDlg::OnInitDialog()
|
||||
else
|
||||
m_path_static.SetWindowText(CCommon::LoadText(IDS_CURRENT_FOLDER, _T(":")));
|
||||
|
||||
m_playlist_ctrl.SetDragEnable(CPlayer::GetInstance().IsPlaylistMode());
|
||||
SetDragEnable();
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
@@ -265,6 +271,7 @@ void CFloatPlaylistDlg::OnEnChangeSearchEdit()
|
||||
m_searched = (key_word.GetLength() != 0);
|
||||
m_playlist_ctrl.QuickSearch(wstring(key_word));
|
||||
m_playlist_ctrl.ShowPlaylist(theApp.m_ui_data.display_format, m_searched);
|
||||
SetDragEnable();
|
||||
}
|
||||
|
||||
void CFloatPlaylistDlg::OnBnClickedClearSearchButton()
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
CStaticEx& GetPathStatic();
|
||||
CEdit& GetPathEdit();
|
||||
void GetPlaylistItemSelected();
|
||||
void SetDragEnable();
|
||||
|
||||
private:
|
||||
CPlayListCtrl m_playlist_ctrl{ CPlayer::GetInstance().GetPlayList() };
|
||||
@@ -38,7 +39,7 @@ private:
|
||||
|
||||
SLayoutData m_layout; //窗口布局的固定数据
|
||||
|
||||
bool m_searched; //播放列表是否处于搜索状态
|
||||
bool m_searched{ false }; //播放列表是否处于搜索状态
|
||||
int& m_item_selected; //播放列表中鼠标选中的项目
|
||||
vector<int>& m_items_selected;
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ BEGIN_MESSAGE_MAP(CMiniModeDlg, CDialogEx)
|
||||
ON_WM_MOUSELEAVE()
|
||||
ON_WM_SETCURSOR()
|
||||
ON_COMMAND(ID_MINI_MIDE_MINIMIZE, &CMiniModeDlg::OnMiniMideMinimize)
|
||||
ON_MESSAGE(WM_LIST_ITEM_DRAGGED, &CMiniModeDlg::OnListItemDragged)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -285,6 +286,11 @@ void CMiniModeDlg::SetTransparency()
|
||||
CCommon::SetWindowOpacity(m_hWnd, theApp.m_app_setting_data.window_transparency);
|
||||
}
|
||||
|
||||
void CMiniModeDlg::SetDragEnable()
|
||||
{
|
||||
m_playlist_ctrl.SetDragEnable(CPlayer::GetInstance().IsPlaylistMode());
|
||||
}
|
||||
|
||||
BOOL CMiniModeDlg::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
// TODO: 在此添加专用代码和/或调用基类
|
||||
@@ -509,7 +515,7 @@ void CMiniModeDlg::OnNMRClickList2(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
m_item_selected = pNMItemActivate->iItem; //获取鼠标选中的项目
|
||||
m_playlist_ctrl.GetItemSelected(m_items_selected);
|
||||
|
||||
CMenu* pContextMenu = theApp.m_menu_set.m_popup_menu.GetSubMenu(0); //获取第一个弹出菜单
|
||||
CMenu* pContextMenu = theApp.m_menu_set.m_list_popup_menu.GetSubMenu(0); //获取第一个弹出菜单
|
||||
CPoint point; //定义一个用于确定光标位置的位置
|
||||
GetCursorPos(&point); //获取当前光标的位置,以便使得菜单可以跟随光标
|
||||
|
||||
@@ -596,3 +602,9 @@ void CMiniModeDlg::OnMiniMideMinimize()
|
||||
// TODO: 在此添加命令处理程序代码
|
||||
ShowWindow(HIDE_WINDOW);
|
||||
}
|
||||
|
||||
|
||||
afx_msg LRESULT CMiniModeDlg::OnListItemDragged(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
void SetVolume(bool up); //
|
||||
void SetTransparency();
|
||||
|
||||
void SetDragEnable();
|
||||
|
||||
protected:
|
||||
|
||||
int m_position_x;
|
||||
@@ -95,4 +97,6 @@ public:
|
||||
afx_msg void OnMouseLeave();
|
||||
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
|
||||
afx_msg void OnMiniMideMinimize();
|
||||
protected:
|
||||
afx_msg LRESULT OnListItemDragged(WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
Binary file not shown.
@@ -981,8 +981,11 @@ void CMusicPlayerDlg::SetPlaylistDragEnable()
|
||||
{
|
||||
bool enable = CPlayer::GetInstance().IsPlaylistMode() && !m_searched; //处于播放列表模式且不处理搜索状态时才允许拖动排序
|
||||
m_playlist_list.SetDragEnable(enable);
|
||||
|
||||
if (m_pFloatPlaylistDlg->GetSafeHwnd() != NULL)
|
||||
m_pFloatPlaylistDlg->GetListCtrl().SetDragEnable(enable);
|
||||
m_pFloatPlaylistDlg->SetDragEnable();
|
||||
if(m_miniModeDlg.GetSafeHwnd()!=NULL)
|
||||
m_miniModeDlg.SetDragEnable();
|
||||
}
|
||||
|
||||
BOOL CMusicPlayerDlg::OnInitDialog()
|
||||
@@ -3400,6 +3403,7 @@ void CMusicPlayerDlg::OnShowMenuBar()
|
||||
theApp.m_ui_data.show_menu_bar = !theApp.m_ui_data.show_menu_bar;
|
||||
SetMenubarVisible();
|
||||
SetThumbnailClipArea();
|
||||
m_pUI->UpdateToolTipPosition();
|
||||
|
||||
//隐藏菜单栏后弹出提示,告诉用户如何再次显示菜单栏
|
||||
if (!theApp.m_ui_data.show_menu_bar)
|
||||
|
||||
Reference in New Issue
Block a user