Is this a bug? and a wish in the upgrade


LIBRARY "TrueCtrl.trc"

CALL TC_INIT
CALL TC_Win_SetTitle(AA1, "SCROLL")
CALL TC_Win_SetFont (AA1, "COURIER NEW", 12, "BOLD")
CALL TC_Show(AA1)
CLEAR
CALL TC_Win_Switch(AA1)

DIM t$(0:100), list(0)
FOR J=0 TO 100
LET T$(J)=STR$(J)
LET T$(J)=STR$(J)
NEXT J

CALL TC_Show (AA1)
CALL TC_ListBox_Create (id, "MULTIPLE",0.6,1,0,1)
CALL TC_SetList (id, t$())
CALL TC_Win_Switch(AA1)

OPEN #1: SCREEN 0,0.6,0,1
SET WINDOW -20,20,-1,1
SET BACK 7
CLEAR
FOR X=-20 TO 20 STEP 0.1
PLOT X, SIN(X/5);
NEXT X

DO
CALL TC_Event (0, event$, window, x1, x2)

IF X1=13 THEN
CLEAR
CALL TC_ListBox_Get(id, list())
LET K=UBOUND(LIST)
PRINT t$(list(K));
ELSE IF X1=27 THEN
EXIT DO
END IF
!CALL TC_ListBox_Clear (id, list(K))
!CALL TC_ListBox_Set (id, 1) ! Reset
LOOP
CALL TC_Cleanup
END

SUB TC_ListBox_Get (cid, sel())
! This routine returns a list of numbers
! The numbers start at 0. I.e., 0 = first, 1 = second, etc.

DIM V(1)
LET OBJM_GET=3

CALL Object (OBJM_GET, cid, "SELECTION", "", v())
LET n = v(1)
MAT Redim sel(n)
FOR i = 1 to n
LET sel(i) = v(i+1) + 1
NEXT i
END SUB

-----------------------------
Is this a bug?
When I ran the code above in v5.41, i noticed that SUB TC_ListBox_Get didn't seem to work except for an "ENTER" key initially. if it has the powerful initial letter quick spell search, then it should be able to use any keys initially. is there a way but i missed?

And for a new updrade that you are currently working on, I wish that i could use some colorization for the lists in "SUB TC_ListBox_Get", probably passing the DIM color() into the SUB.

Comments

LISTBOX

Hi Ryan,

I am more than 12000 miles away from home right now so I cannot test out your code.

Nothing is likely to be done to TrueCtrl in the near future to add color to objects. However, I have re-written the whole of TrueCtrl using TB graphics rather than Windows APIs. As a result color and font changes are universally available to all TrueCtrl objects. For example in the case of ListBoxes the background and font colors can be set. In addition the font, and color of the list title bar can be set, as well as optional color rulings between each item in the list. Moreover, the list can be displayed plain, recessed or raised. I have also re-written the TrueDial library to give dialog boxes access to colors and fonts. There is also a wider range of dialog boxes. It is likely that these two new libraries will be released when the new editor has been completed.

Regards
Big John