Example:
-- Adds some text to the end of the control. appendText( myedit, ">Ready\n" )
See Also: getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
The type of controls that have caption text are windows, menus, labels, and buttons. Other controls will return "".
Example:
sequence ctext sequence clst clst = {Btn1, Btn2, MenuItem3, Radio1, Checkbox2} for i = 1 to length(ctext) do ctext[i] = ReplaceText(getCaption(clst[i]), "all", "some") setCaption(clst[i], ctext[i]) end for
See Also: appendText, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
Note that Menuitems, Radio, Checkbox and TriCheckbox controls return a single character string of "0", "1", or "2" for Unchecked, Checked, and Neither respectively.
For statusbars and treeviews, id can be a 2-element sequence containing {ControlID, Panel#} to get the value of a specific sub-panel of the statusbar, or treeview item.
For RichEdit controls, this returns the selected text only.
For ListView controls, this returns a sequence that contains one element
for each selected item in the ListView. Each element is itself a sequence
that contains an string element for each column in the ListView.
ListView example:
sequence text text = getData(myListView) -- If two rows were selected then the returned value -- may look like this ... { { "Col 1 data", "Col 2 data", "Col 3 data", ...}, -- 1st selected row { "Col 1 data", "Col 2 data", "Col 3 data", ...} -- 2nd selected row }
For StatusBar controls, object can be a two-element sequence,
the first is the control's id, and the second is the section of
the status bar (this is zero-based). Also, this returns two-elements:
[1] is the text,
[2] is the rendering method.
For /TreeView controls, id takes the form {TV, TVItemID}. Where TVItemID is the id returned by addTVItem(). To get the currently selected treeview item, use zero for the TVItemID.
Example:
sequence text text[i] = getData(EditFld1)
See Also: appendText, getCaption, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This uses w32TextToNumber() function to do the conversion.
If the text value cannot be converted to a numeric value, zero is return.
Example:
-- get the numeric value from TheTextEdit atom numbernumber = getNumber( TheTextEdit )
See Also: appendText, getCaption, getData, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This only works with text edit controls.
Example:
-- get the selected text from TheTextEdit sequence texttext = getSelectedText( TheTextEdit )
See Also: appendText, getCaption, getData, getNumber, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This returns the control's caption if it has one, otherwise it returns its value.
See also: getCaption and getData
Example:
-- get the text from TheTextEdit sequence texttext = getText( TheTextEdit ) tvtext = getText ( {myTreeView, itemid} ) tvselectedtext = getText ( {myTreeView, 0} ) -- get the contents of the second panel in the statusbar. sbtext = getText( {StatBar, 2})
btnCaption = getText( myBtn )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This gets the values for each of the controls specified in Ids. The controls can be specified as either a control ID (integer) or a control name.
If your application has multiple controls with the same name, you can specify a context for this routine to limit the search to. This is usually the Window that the requested controls belong to.
Example:
sequence lValues lValues = getValues(CustWin, {"Name", "Address", "ZIP", "Telephone"})
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
Example:
-- Adds some text to the end of the control. insertText( myedit, "\n(Ready)\n" )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This can be used on MenuItems, ListView, TreeView, Radio, and Checkboxes.
Note for TreeView, the id takes the form {id, item}
Note for ListViews, the id normally takes to form {id, row}. But if you just use id, then the row with focus is examined.
Example:
integer flag-- is TheRadio1 checked? flag = isChecked( TheRadio1 ) -- Is row 3 checked. flag = isChecked ({myLV, 3})
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
Object can be one of the following:
If Bitmap is a sequence, it will be assumed to be the name of an bitmap file, and Win32Lib will attempt to load the bitmap.
Otherwise, bitmap is assumed to be the handle of a bitmap.
Example:
-- assign a bitmap to the picture button setBitmap( PictureButton1, "close.bmp" )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setCheck, setIcon, setPixmap, setSelectedText, setText, showMessage
This works for MenuItems and toggle controls such as Radio, CheckBox and ToggleButton, and for ListViews
Note that id can be either a single control id or a list of control ids.
Example:
-- set a check on the SyntaxColoring option setCheck( SyntaxColoring, w32True ) setCheck( {TBtn1, TBtn2, TBtn3}, w32False)
Note: For ListViews, the id is actually in the form {{id,row}} so it knows which row to check. Take note of the double sequence syntax.
-- Add a check mark to row 2. setCheck( {{myLV, 2}}, w32True)
Note If id is a menu item which has been defined as being in a menu item group (/defineMenuItemGroup), this routine turns on that menu item. This routine ensures that only one item from a menu radio group will be marked. Any that were previously marked will be 'turned off'
Example:
-- set the current loudness level. defineMenuRadioGroup({miPianissimo, miPiano, piModerato, miForte, miFortissimo}) . . . setCheck( miForte, w32True)
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setIcon, setPixmap, setSelectedText, setText, showMessage
id can be one of the following:
icon can represent a file name, a handle to an icon, or a predefined system
icon code.
To use an icon handle, you need to first get the handle using some other
method (eg loadIconFromFile) and pass it to this routine as a
sequence that only contains the handle. For example: {hIcon}
To use a system icon, you need to specify one of the names:
To use an icon from a file, just supply the file name. This can be a ICO, EXE, or DLL file. However, this will only fetch the first icon in that file. Some icon files can contain multiple icons. To use one of the other icons in a multi-icon file, you need to use the syntax {filename, icon#}. The icon# is the number of the icon to use. The first icno is 1, the second is 2, etc...
Example:
-- assign an icon to the window setIcon( TheWindow, "euphoria.ico" )-- assign the third icon to a button setIcon( pBtnStop, {"applib.ico", 3} )
-- Use a icon handle hIcon = loadIconFromFile({"applib.ico", 2}) setIcon( pBtnGo, {hIcon})
-- Use a system icon setIcon( bBtnErr, IDI_ERROR )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setPixmap, setSelectedText, setText, showMessage
If bitmap is a sequence, it will be assumed to be the name of an bitmap file, and Win32Lib will attempt to load the bitmap.
Otherwise, bitmap is assumed to be the handle of a bitmap.
Example:
-- assign a bitmap to the picture button setPixmap( Pixmap1, "spaceship.bmp" )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setSelectedText, setText, showMessage
This only works with edit text controls.
Example:
-- add HTML formatting to the selected text text = getSelectedText( TheMle ) setSelectedText( TheMle, "<I>" & text & "</I>" )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setText, showMessage
If the control is editable, it updated the data in the control.
Otherwise, it updates the caption text of the control.
For StatusBar controls, the pID can also be used to specify
the subField to use. It takes the form of a 2-element sequence
{id, subfield}.
Example:
-- change the caption of status bar setText( TheStatusBar, "Ready" ) -- If a statusbar has subfields, you can specify -- them like: setText( {TheStatusBar,2}, "2nd subField")
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, showMessage
pText is the text string which is displayed in the first (or only) panel of the
status bar which is on the main window.
It is possible to display it on a different status bar by using the format
{ Message, pID }, where pID is either a Window id, which has a status bar, or
an actual status bar control id.
If you wish to display the message in a panel other than the first panel, the
pID has the format {id, panel#}
In any case, if the pID is zero, the application's main window is assumed.
Example:
-- Show the caption of status bar in the main window showMessage( "Ready" ) -- To display a message in another window: showMessage( {"Searching...", EditWindow} ) -- If the statusbar has subfields, you can specify them like: showMessage( {"2nd subField", {EditWindow,2}} )
See Also: appendText, getCaption, getData, getNumber, getSelectedText, getTabItem, getText, getValues, insertText, isChecked, setBitmap, setCheck, setIcon, setPixmap, setSelectedText, setText