' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' Qlistbox ****** QLISTBOX Component ****** QListbox implements a generic (veritcal scrolling) Windows listbox. The first item in any listbox is 0, the next is 1, and so on... QListbox Properties Field Type R/W Default Support =============== =============== =============== =============== =============== Align INTEGER RW alNone W Align determines how the control aligns within its parent control. BorderStyle INTEGER RW bsSingle W Color INTEGER RW WX Columns INTEGER RW 0 W Columns specifies the number of columns, in a multi-column listbox, that are visible without having to scroll. CopyMode INTEGER RW cmBlackness W Cursor INTEGER RW crDefault W Enabled INTEGER RW True WXG ExtendedSelect INTEGER RW True WX ExtendedSelect determines if the user can select a sequential range of items in the listbox. Font QFONT W W Height INTEGER RW WXG Hint STRING RW WXG Item ARRAY of STRING RW WXG Item contains the strings that appear in the listbox. ItemCount INTEGER R WXG ItemHeight INTEGER RW W ItemIndex INTEGER RW WXG Left INTEGER RW 0 WXG MultiSelect INTEGER RW False WX Parent QFORM/QPANEL/ W WXG QTABCONTROL PopupMenu QPOPUPMENU W W SelCount INTEGER R W Selected ARRAY of RW WX INTEGER ShowHint INTEGER RW False WXG Sorted INTEGER RW False WG Sorted specifies whether the items in a listbox are arranged alphabetically. Style INTEGER RW lbStandard W Style determines whether the listbox is standard or owner-draw. 0 = lbStandard -- All items are strings, with each item the same height. 1 = lbOwnerDrawFixed -- Each item in the listbox is the height specified by the ItemHeight property. 2 = lbOwnerDrawVariable -- Items in the listbox can be of varying heights. TabOrder INTEGER RW W TabWidth INTEGER RW 0 W Tag INTEGER RW WXG Text STRING RW W Text defines the items in the listbox as CRLF terminated strings. Top INTEGER RW 0 WXG TopIndex INTEGER RW W Visible INTEGER RW True WXG Width INTEGER RW WXG QListbox Methods Method Type Description Params Support =============== =============== =============== =============== =============== AddItems SUBI Add items to STRINGs, WXG listbox Infinite SUB (x1%, y1%, Draw & Fill Circle x2%, y2%, c%, Circle 6 W fill%) Clear SUB Clears entire 0 WXG listbox CopyRect D and S are QRECTs, Image SUB (D, Image, can be a 3 W S) QImage, QCanvas, or QBitmap DelItems SUBI Delete items by Index #s, WXG their index Infinite Draw SUB (x%, y%, Draw Bitmap at 3 W BMP) (X,Y) SUB (x1%, y1%, Draws & FillRect x2%, y2%, c%) Fills a 5 W rectangle InsertItem SUB (Index%, Insert item at 2 WXG String$) Index% Line SUB (x1%, y1%, Draws a line 5 W x2%, y2%, c%) LoadFromFile SUB (FileName Load file to 1 W AS STRING) list Paint SUB (x%, y%, Fill Region 4 W c%, borderc%) Pset SUB (x%, y%, Pixel plot 3 W c%) Rectangle SUB (x1%, y1%, Draws a 5 W x2%, y2%, c%) rectangle Force Repaint SUB repainting of 0 W listbox SUB (x1%, y1%, Draws & RoundRect x2%, y2%, x3%, Fills a rounded 7 W y3%, c%) rectangle SaveToFile SUB (FileName Save list to 1 W AS STRING) file StretchDraw SUB (Rect AS Draw BMP and QRECT, BMP) stretch to fit 2 W inside Rect TextHeight Returns the FUNCTION height, in 1 W (Text$) AS WORD pixels, of Text$ string TextWidth Returns the FUNCTION width, in 1 W (Text$) AS WORD pixels, of Text$ string TextRect SUB (Rect AS Write text, and QRECT, x%, y%, clip within 6 W S$, fc%, bc%) region Rect TextOut SUB (x%, y%, Writes text to 5 W S$, fc%, bc%) image QListbox Events Event Type Occurs when... Params Support =============== =============== =============== =============== =============== OnClick VOID User clicks on 0 WXG item User double OnDblClick VOID clicks on an 0 WXG item SUB (Index%, Items are OnDrawItem State%, R AS redrawn for 3 W QRect) ownerdraw listboxes User presses OnEnter VOID enter to select 0 W item Calculate SUB (Index%, Height for OnMeasureItem Height%) ownerdraw 3 W variable listboxes SUB (Hwnd%, Messages sent WndProc Msg%, wParam%, to Listbox 4 W lParam%) QListbox Examples DIM Form AS QForm DIM ListBox AS QListBox ListBox.Parent = Form ListBox.AddItems "1. Apples", "2. Oranges", "3. Bananas" ListBox.DelItems 1,2 '' Deletes Oranges and Bananas ListBox.Item(0) = "1. Strawberries" '-- Change the first item Form.ShowModal ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb