' Rapid-Q by William Yu (c)1999-2000 . ' ================================================================================ ' Upload_il_tuo_script_su_Rapidq.it ' Qcombobox ****** QCOMBOBOX Component ****** QCombobox implements a simple pull down listbox. The first item in any combobox is 0, the next is 1, and so on... QCombobox Properties Field Type R/W Default Support =============== =============== =============== =============== =============== Align INTEGER RW alNone W Align determines how the control aligns within its parent control. Color INTEGER RW W CopyMode INTEGER RW cmBlackness W Cursor INTEGER RW crDefault W DropDownCount INTEGER RW 8 W DropDownCount is the maximum number of items displayed in the drop-down list. Enabled INTEGER RW True WXG Font QFONT W W Height INTEGER RW WXG Hint STRING RW WXG Item ARRAY of STRING RW WXG ItemCount INTEGER R WXG ItemHeight INTEGER RW W ItemIndex INTEGER RW -1 WXG ItemIndex indicates which item in the drop-down list is selected. If no item is selected, then ItemIndex is -1. Left INTEGER RW 0 WXG MaxLength INTEGER RW W MaxLength is the maximum number of characters the user can type into the edit portion of the combobox. Parent QFORM/QPANEL/ W WXG QTABCONTROL PopupMenu QPOPUPMENU W W ShowHint INTEGER RW False WXG Sorted INTEGER RW False WG Style INTEGER RW csDropDown W Style determines the display style of the combobox. 0 = csDropDown -- A drop-down list with an edit box for manually entered text. 1 = csSimple -- A drop-down list with an edit box and a fixed list (list box) underneath. 2 = csDropDownList -- A drop-down list with no edit box for manual entry. 3 = csOwnerDrawFixed -- Owner-draw drop-down list with an edit box. Each item in the list is the height specified by the ItemHeight property. 4 = csOwnerDrawVariable -- Owner-draw drop-down list with an edit box. Each item can have varying heights. TabOrder INTEGER RW W Tag INTEGER RW WXG Text STRING RW W Top INTEGER RW 0 WXG Visible INTEGER RW True WXG Width INTEGER RW WXG QCombobox Methods Method Type Description Params Support =============== =============== =============== =============== =============== AddItems SUBI Add items to STRINGs, WXG combobox Infinite SUB (x1%, y1%, Draw & Fill Circle x2%, y2%, c%, Circle 6 W fill%) Clear SUB Clears entire 0 WXG Combobox 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%) 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 combobox SUB (x1%, y1%, Draws & RoundRect x2%, y2%, x3%, Fills a rounded 7 W y3%, c%) rectangle 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 QCombobox Events Event Type Occurs when... Params Support =============== =============== =============== =============== =============== OnChange VOID User selects a 0 WXG different item SUB (Index%, Items are OnDrawItem State%, R AS redrawn for 3 W QRect) ownerdraw comboboxes Calculate SUB (Index%, Height for OnMeasureItem Height%) ownerdraw 3 W variable comboboxes QCombobox Examples DIM Form AS QForm DIM ComboBox AS QComboBox SUB ItemChanged PRINT ComboBox.Item(ItemIndex) END SUB ComboBox.Parent = Form ComboBox.OnChange = ItemChanged ComboBox.AddItems '1. Apples', '2. Oranges', '3. Bananas' Form.ShowModal ' =============================================================================== ' 2003 Holyguard.net - 2007_Abruzzoweb