TD音乐界面添加keyboard的流程
1,添加layout_audio.ini窗口
窗口的属性为window_splash//没有边框和标题栏的普通窗口类型
music_main_window={
type="window"
x=0
y=0
w=1024
h=600
flags={
disable
window_splash
hide_h_scrollbar
hide_v_scrollbar
no_v_scroll
no_h_scroll
show
}
style="player_full_bg"
music_album_icon={
type="button"
x=53
y=131
w=230
h=220
style="music_album_pic"
flags={
disable
}
}
2,添加layout_keyboard.ini窗口
窗口属性为window_dock //Dock 窗口类型
gotokeyboard_main_window={ type="window" x=0 y=0 w=1024 h=600 flags={ disable hide_h_scrollbar hide_v_scrollbar no_v_scroll no_h_scroll window_dock show } #style="gotokeyboard_main_window_bg" style="none" gotokeyboard_back_btn={ type="button" x=0 y=0 w=1024 h=600 #style="gotokeyboard_back_bg" flags={ hide } }
3,在MediaView新建GotoKeyboard,在TwShow前加上TwUpdateShow(),不然界面会有异常
void MediaView::showKeyBoard(bool bShow, FileType type) { if (!m_gotokeyboard) { m_gotokeyboard = new GotoKeyboard(m_self); //m_gotokeyboard = new GotoKeyboard(m_musicWindow.music_goto_btn, m_self); connectex(m_gotokeyboard, m_gotokeyboard->showTimerSig, this, &MediaView::showTimerSlot); connectex(m_gotokeyboard, m_gotokeyboard->gotoIndexSig, this, &MediaView::gotoIndexSlot); } int total = m_curMediaList.size(); for(int i = 0; i < total; i++) { ULOGD("%s file:%s\n",__FUNCTION__,((string)m_curMediaList.at(i)).c_str()); } m_gotokeyboard->setTotalIndex(total); TwUpdateShow() TwShow(m_gotokeyboard->getView()); }

浙公网安备 33010602011771号