From: George H. <geo...@us...> - 2012-08-14 13:27:24
|
Update of /cvsroot/win32forth/win32forth/src/lib In directory vz-cvs-4.sog:/tmp/cvs-serv15927 Modified Files: ListBox.f Log Message: Added GetSelction: and GetString: methods to ComboBox control. Index: ListBox.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/ListBox.f,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ListBox.f 29 Aug 2006 08:52:25 -0000 1.3 --- ListBox.f 14 Aug 2012 13:27:22 -0000 1.4 *************** *** 71,80 **** 0 swap CB_SETCURSEL SendMessage:SelfDrop ;M :M GetSelectedString: ( -- addr cnt ) ! \ *G Get the selected from the combo box. ! \ ** Note: The string is returned in the global \i NEW$ \d. ! 0 0 CB_GETCURSEL SendMessage:Self ! new$ dup rot CB_GETLBTEXT SendMessage:Self ! ;M :M Setfont: ( handle -- ) --- 71,91 ---- 0 swap CB_SETCURSEL SendMessage:SelfDrop ;M + :M GetSelection: ( -- n ) + \ *G Retrieve the index of the currently selected item, if any. + \ *P The return value is the zero-based index of the currently selected item. If there is no + \ ** selection, the return value is CB_ERR. + 0 0 CB_GETCURSEL SendMessage:Self ;M + + :M GetString: ( index -- addr n ) + \ *G Retrieve a string from the combo box. + \ *P The return value is the address and length of the string. + \ ** If \i n \d does not specify a valid index, the length is CB_ERR. + new$ dup rot CB_GETTEXT SendMessage:Self ;M + :M GetSelectedString: ( -- addr cnt ) ! \ *G Retrieve the currently selected string from the combo box. ! \ ** Note: The string is returned in a dynamicly allocated buffer of medium persistance. If a ! \ ** permenant copy is needed it should be moved. ! GetSelection: self GetString: self ;M :M Setfont: ( handle -- ) *************** *** 234,244 **** :M GetString: ( index -- addr n ) \ *G Retrieve a string from the list box. ! \ *P The return value is the length of the string, in chars, excluding the terminating null character. ! \ ** If \i n \d does not specify a valid index, the return value is LB_ERR. new$ dup rot LB_GETTEXT SendMessage:Self ;M :M GetSelectedString: ( -- addr cnt ) \ *G Retrieve the currently selected string from the list box. ! \ ** Note: The string is returned in the global \i NEW$ \d. GetSelection: self GetString: self ;M --- 245,256 ---- :M GetString: ( index -- addr n ) \ *G Retrieve a string from the list box. ! \ *P The return value is the address and length of the string. ! \ ** If \i n \d does not specify a valid index, the length is LB_ERR. new$ dup rot LB_GETTEXT SendMessage:Self ;M :M GetSelectedString: ( -- addr cnt ) \ *G Retrieve the currently selected string from the list box. ! \ ** Note: The string is returned in a dynamicly allocated buffer of medium persistance. If a ! \ ** permenant copy is needed it should be moved. GetSelection: self GetString: self ;M |