From: Jos v.d.V. <jo...@us...> - 2006-06-22 09:03:37
|
Update of /cvsroot/win32forth/win32forth/apps/Player4 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28276/apps/Player4 Modified Files: Mediatree.f PLAYER4.F Log Message: Jos: Now joy stick browsing is possible. More improvements are needed to solve the long list problem. Index: PLAYER4.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/PLAYER4.F,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** PLAYER4.F 10 Jun 2006 18:00:04 -0000 1.58 --- PLAYER4.F 22 Jun 2006 09:03:32 -0000 1.59 *************** *** 43,46 **** --- 43,49 ---- defer HandleJoystick ' noop is HandleJoystick + 0 value JoycenterX + 0 value JoycenterY + needs Pl_Toolset.f needs number.f *************** *** 244,249 **** FindFirstJoyStick dup to IDJoystick MaxJoysticks < ! if 0 200 1 hWnd Call SetTimer drop ! then ;M --- 247,256 ---- FindFirstJoyStick dup to IDJoystick MaxJoysticks < ! if [ *lpjoycapsa joycapsa wYmax ] literal @ ! [ *lpjoycapsa joycapsa wYmin ] literal @ - 2/ to JoycenterY ! [ *lpjoycapsa joycapsa wXmax ] literal @ ! [ *lpjoycapsa joycapsa wXmin ] literal @ - 2/ to JoycenterX ! 0 200 1 hWnd Call SetTimer drop ! then ;M *************** *** 392,412 **** : IncreaseVolume ( - ) ! begin GetVolume/timeOut + SetVolLevel ! ButtonIn? until ; ! :Noname ( - ) ! IDJoystick GetJoystickInfo ! dup JOY_BUTTON1 >= ! if case JOY_BUTTON1 of IDM_NEXT DoCommand endof JOY_BUTTON3 of DecreaseVolume endof JOY_BUTTON4 of IncreaseVolume endof JOY_BUTTON5 of IDM_PAUSE/RESUME DoCommand endof JOY_BUTTON6 of down endof ! endcase ! WaitTillDepressed 3drop ! else 4drop then --- 399,508 ---- : IncreaseVolume ( - ) ! begin GetVolume/timeOut 20 max + SetVolLevel ! ButtonIn? until ; ! : ChangeFont ( Big|small - ) ! to UseBigFont Delete: TreeViewFont SetfontTreeView: Catalog ! SW_SHOWMAXIMIZED Show: MainWindow ! ; ! ! : PlaymodeForJoystick ( button - ) ! case JOY_BUTTON1 of IDM_NEXT DoCommand endof + JOY_BUTTON2 of true ChangeFont endof JOY_BUTTON3 of DecreaseVolume endof JOY_BUTTON4 of IncreaseVolume endof JOY_BUTTON5 of IDM_PAUSE/RESUME DoCommand endof JOY_BUTTON6 of down endof ! endcase ! ; ! ! : PlayFromJoystick ! GetSelectedItem: Catalog ! GetLparm: Catalog dup -1 = ! if drop ! else to last-selected-rec PlaySelectedFromTreeView ! then ! ; ! ! : JoystickBrowser ( button - ) ! case ! JOY_BUTTON1 of PlayFromJoystick endof ! JOY_BUTTON8 of OpenChild: Catalog endof ! JOY_BUTTON7 of CloseChild: Catalog endof ! JOY_BUTTON2 of false ChangeFont endof ! endcase ! ! ; ! : DifToCenter? { pos } ( Joycenter pos - dif ) ! dup 2 / over pos - abs > ! if drop 0 ! else pos - negate ! then ! ; ! ! \ debug DifToCenter? 65000 JoycenterY swap DifToCenter? ! \ debug DifToCenter? 32767 JoycenterY swap DifToCenter? ! ! ! : XYDifCenter ( posx posy - difx dify ) ! JoycenterY swap DifToCenter? >r ! JoycenterX swap DifToCenter? r> ! ; ! ! 0 value incr-fact ! ! : ScrollFlag ( difx dify - f ) ! abs swap abs max dup 0= ! if to incr-fact ! else incr-fact JoycenterY >= ! if drop 0 to incr-fact ! else +to incr-fact ! then ! then ! incr-fact 0= ! ; ! ! : down/up ( Y - ) ! dup 0<> ! if 0> ! if DownInTree: Catalog ! else UpInTree: Catalog ! then ! else drop ! then ! ; ! ! : Left/Right ( X - ) ! dup 0<> ! if 0> ! if OpenChild: Catalog ! else CloseChild: Catalog ! then JoycenterY negate 2* to incr-fact ! else drop ! then ! ; ! ! : HandleMovesJoystickBrowser ( x y z button - ) ! 2drop XYDifCenter 2dup ScrollFlag ! if down/up Left/Right ! else 2drop ! then ! ! ; ! ! :Noname ( - >>> ) ! IDJoystick GetJoystickInfo ! dup JOY_BUTTON1 >= ! if UseBigFont ! if JoystickBrowser WaitTillDepressed 3drop ! else PlaymodeForJoystick WaitTillDepressed 3drop ! then ! else UseBigFont ! if HandleMovesJoystickBrowser ! else 4drop ! then then *************** *** 530,534 **** \ ----------------------------------------------------------------------------- ! : InitPlayer ( -- >>> ) Start: MainWindow Start: ControlCenter --- 626,630 ---- \ ----------------------------------------------------------------------------- ! : InitPlayer ( -- ) Start: MainWindow Start: ControlCenter Index: Mediatree.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/apps/Player4/Mediatree.f,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Mediatree.f 25 May 2006 15:36:50 -0000 1.32 --- Mediatree.f 22 Jun 2006 09:03:32 -0000 1.33 *************** *** 11,14 **** --- 11,16 ---- 0 value hItem-last-selected defer GetPositionCatalog + Font TreeViewFont + 0 value UseBigFont :Class MediaTree <super TreeViewControl *************** *** 216,230 **** then ; ! ! :M On_SelChanged: ( -- ) TVIF_PARAM TVIF_HANDLE or to mask - hItemNew to hItem 0 to pszText 0 to cchTextMax tvitem 0 TVM_GETITEMA hWnd Call SendMessage drop ! hItem to hItem-last-selected ! lParam dup to last-selected-rec -1 <> ! if StartPopupWindow then ;M --- 218,239 ---- then ; ! ! :M GetLparm: ( hItem - lParm ) ! to hItem TVIF_PARAM TVIF_HANDLE or to mask 0 to pszText 0 to cchTextMax tvitem 0 TVM_GETITEMA hWnd Call SendMessage drop ! hItem to hItem-last-selected ! lParam \ cr .s ! ;M ! ! :M On_SelChanged: ( -- ) ! hItemNew GetLparm: Self ! dup to last-selected-rec -1 <> ! if UseBigFont not ! if StartPopupWindow ! then then ;M *************** *** 248,251 **** --- 257,278 ---- int EnableNotify? + :M SetfontTreeView: ( - ) + UseBigFont + if 24 32 + else 8 16 + then + Height: TreeViewFont + Width: TreeViewFont + s" Times New Roman (TrueType)" SetFaceName: TreeViewFont + Create: TreeViewFont + true Handle: TreeViewFont WM_SETFONT + GetHandle: TreeView CALL SendMessage drop + ;M + + :M Start: ( Parent -- ) + Start: super + false to UseBigFont SetfontTreeView: Self + ;M + :M ExWindowStyle: ( -- style ) ExWindowStyle: Super *************** *** 277,280 **** --- 304,339 ---- drop AddDropFiles ;M + + \ GetNextItem: bij 0 terug dicht en next parent + : SelectTreeViewItem ( hitem - ) + dup 0<> + if TVGN_CARET SelectItem: TreeView + else drop + then + ; + + :M GetLparm: ( - hItem ) GetLparm: TreeView ;M + :M GetSelectedItem: ( - hItem ) 0 TVGN_CARET GetNextItem: TreeView ;M + + :M DownInTree: ( - ) + GetSelectedItem: Self TVGN_NEXT GetNextItem: TreeView + SelectTreeViewItem + ;M + + :M UpInTree: ( - ) + GetSelectedItem: Self GetPrevious: TreeView + SelectTreeViewItem + ;M + + :M OpenChild: ( - ) + GetSelectedItem: Self GetChild: TreeView + SelectTreeViewItem + ;M + + :M CloseChild: ( - ) + GetSelectedItem: Self GetParentItem: TreeView + Collapse: TreeView + ;M + :M On_Init: ( -- ) On_Init: super |