Attributes

These are routines that let you inspect and alter attributes of controls. For more specialized routines, see:

  • Edit Control: Working with text edit controls ( EditText, MleText ).
  • List Control: Working with lists ( List, SortedList ), combos ( Combo, SortedCombo ), etc.
  • Scroll Control: Working with scrollbars ( HScroll, VScroll ) and trackbars ( HTrackBar, VTrackbar ).

  • closeWindow( window ) Close window.
  • create( class, title, parent, x, y, cx, cy, flags ) Create an object of type class.
  • getClientPoint( window, x, y ) Get screen position of point { x, y } in window.
  • getClientRect( object ) Get uncovered portion of the client area.
  • getExtent( object ) Get the extent of object.
  • getMousePos() Retrieves absolute position of the mouse.
  • getNumber( object ) Get the numeric value of text from object.
  • getSize( object ) Get the metrics of object.
  • getSysColor( window, color ) Return atom with value of a system color.
  • getText( object ) Get the text in object.
  • isChecked( object ) Returns the checked state of object.
  • isEnabled( object ) Returns the enabled state of object.
  • isScreenPointIn( control, x, y ) Return True if the screen point { x, y } is within control.
  • isVisible( object ) Returns the visibility state of object.
  • moveWindow( control, x, y, cx, cy, repaint ) Move and resize control.
  • openWindow( window, style ) Opens a window.
  • popup( popupMenu, x, y ) Display popupMenu at { x, y }.
  • setBitmap( object, bitmap ) Assign an icon to object.
  • setCheck( object, checked flag ) Check or uncheck object.
  • setEnable( object, visible flag ) Enable or disable object.
  • setFocus( id ) Set the focus to the specified window or control.
  • setHint( control, text ) Set the tooltip text for a control.
  • setIcon( object, icon ) Assign an icon to object.
  • setPixmap( pixmap, bitmap ) Assign a new value to a Pixmap.
  • setText( object, text ) Set the text in object.
  • setVisible( object, visible flag ) Make object visible or invisible.
  • setWindowBackColor( window, color ) Sets window to color.
  • WinMain( window, style ) Run event loop.

    Controls

    Controls are the basic elements of Windows programs. You can create them, query and change Attributes, and respond to Events.

    See Also: Attributes, Control, Edit Control, List Control, Scroll Control

  • Bitmap Static bitmap control.
  • CheckBox CheckBox control.
  • Combo Combo box control.
  • CText Center-justified label control.
  • DefPushButton Default command button control.
  • DropDownList Drop down list control.
  • EditText Text edit control control.
  • Group Group control.
  • HScroll Horizontal scrollbar control.
  • HTrackBar Horizontal track bar control.
  • HTrackBar Vertical track bar control.
  • Icon
  • List List.
  • LText Left-justified label control.
  • Menu Menu bar item control.
  • MenuItem Dropdown menu item control.
  • MleEdit Multi-line edit control.
  • PictureButton Command button with graphic control.
  • Pixmap Color bitmap.
  • Popup Popup menu control.
  • Printer Handle to the printer.
  • PushButton Command button control.
  • Radio Radio button control.
  • RText Right-justified label control.
  • Screen Identifes the screen.
  • setSize( control, cx, cy ) Resize control to cx x cy.
  • SimpleCombo Simple combo box control.
  • SortedCombo Sorted combo box control.
  • SortedList Sorted list control.
  • StatusBar Window status bar control.
  • TabControl Tab Control.
  • TabItem Tab on a TabControl.
  • ToggleButton Toggle button control.
  • TogglePicture Toggle button with graphic control.
  • ToolBar Window toolbar control.
  • TriCheckBox Three state checkbox control.
  • VScroll Vertical scrollbar control.
  • Window A Window is a normal Win32 window.

    Dialogs

    These are functions the bring up common dialogs.

  • getColorDialog( window, default color ) "Get Color" Dialog
  • getFontDialog( window ) "Get Font" Dialog
  • getOpenFileName( window, file, filters ) "Open File" dialog.
  • getSaveFileName( window, file, filters ) "Save File" dialog.

    Edit Control

    These are routines that let you inspect and alter attributes of the text edit controls, EditText and MleText.

  • clear( object ) Clear selected text from object.
  • copy( object ) Copy any selected text from object and place in the clipboard.
  • cut( object ) Cut any selected text from object and place in the clipboard.
  • paste( object ) Paste text from the clipboard to object.
  • undo( object ) Undo last edit in object.

    Events

    Events are routines that are triggered in response to actions taken by the user of the application - mouse clicks, key presses, resizing windows, and so on.

  • onChange() Value in a control is changed.
  • onClick() Mouse is clicked.
  • onClose() A Window is closed.
  • onDestroy() The application is being closed.
  • onDragAndDrop( file name ) A file has been dragged onto the control or window.
  • onEvent( event, wParam, lParam ) An event (any type) has occured.
  • onGotFocus() A control (or Window) receives focus.
  • onKeyDown( scanCode, shift ) Key is pressed.
  • onKeyPress( keyCode, shift ) "Printable" key is pressed.
  • onKeyUp( scanCode, shift ) Key is released.
  • onLostFocus() A Window or control loses focus.
  • onMouse( event, x, y, shift ) Event triggered when a mouse action takes place.
  • onOpen() A Window is opened.
  • onPaint( x1, y1, x2, y2 ) A portion or all of a Window needs to be redrawn.
  • onResize( style, x, y ) A Window is resized.
  • onScroll( position ) Scrollbar value has changed.
  • onTimer() A timer is triggered.
  • returnValue( value ) Override default value returned by handler.

    Fonts

    These routines allow you to work with text graphics: displaying text, changing the font, and so on.

  • getFontMetric( id, field ) Gets font metric field value for id's current font.
  • getFontSize( id ) Gets font metrics for id's current font.
  • getTextExtent( object, text )
  • setDefaultFont( id ) Set the font to default system font.
  • setFont( object, font name, point size, attributes ) Set the font for a control or window.
  • setHintFont( font, point size, attributes ) Set font type and size for the control's hints.
  • setPosition( window, x, y ) Position the text pen in window.
  • setTextAlign( id, style ) Set the font alignment to use when printing text.
  • setTextColor( window, color ) Set the text color to use when drawing text in window.
  • wPrint( window, object ) Equivalent to Euphoria's print() routine.
  • wPrintf( window, format, data ) Equivalent to Euphoria's printf() routine.
  • wPuts( window, text ) Equivalent to Euphoria's puts() function.

    Graphics

    These are routines that allow you to draw on controls, typically a Window, Pixmap or Printer.

    The predefined colors are:

          Black, Blue, Green, Cyan, Red, Magenta, Brown 
          White, Gray, BrightBlue, BrightGreen, BrightCyan, 
          BrightRed, BrightMagenta, Yellow and BrightWhite 
    

  • bitBlt( dst, dstX, dstY, src, srcX, srcY, wide, high, rop ) Copy image (or partial image) from source to destination.
  • copyBlt( dst, dstX, dstY, src ) Copy full image from source to destination.
  • copyToBitmapFile( window, fileName, x1, y1, x2, y2 ) Copies image in source to file fileName.
  • createDIB( data ) Converts a Euphoria bitmap format into a Win32 bitmap.
  • drawArc( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd ) Draw an arc.
  • drawBitmap( window, DIB handle, x, y ) Draws DIB (device independant bitmap) in window at { x, y }.
  • drawChord( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd ) Draw a chord.
  • drawEllipse( window, filled, x1, y1, x2, y2 ) Draw an ellipse.
  • drawLine( window, x1, y1, x2, y2 ) Draw a line.
  • drawPie( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd ) Draw a pie slice.
  • drawPolygon( window, filled, points ) Draw a polygon.
  • drawRectangle( window, filled, x1, y1, x2, y2 ) Draw a rectangle.
  • drawRoundRectangle( window, filled, x1, y1, x2, y2, xc, yc ) Draw a rounded rectangle.
  • getPixel( window, x, y ) Get a pixel value from window's client area.
  • loadBitmapFromFile( file name ) Loads a bitmap file.
  • repaintRect( window, x1, y1, x2, y2 ) Force window to be partially repainted.
  • repaintWindow( window ) Force window to be entirely repainted.
  • rgb( red, green, blue ) Convert a {red, green, blue} tuple into a color.
  • setBackColor( window, color ) Set the color for used for the pen fill color in window.
  • setPenBkMode( window, mode ) Determines if the background color for lines and text.
  • setPenColor( window, color ) Set the the pen color used in window.
  • setPenROP2( window, code ) Determines what mode graphics are drawn in.
  • setPenStyle( window, color ) Set the style that lines are drawn in.
  • setPenWidth( window, pixel width ) Set the the pen width used in window.
  • setPixel( window, x, y, rgb color ) Set a pixel value in window's client area.
  • textToBitmap( text ) Converts a sequence of text into a monochrome bitmap.
  • transBlt( dst, dstX, dstY, src ) Copy full image from source to destination, with transparency.

    List Control

    These are routines that let you inspect and alter attributes of controls with lists: Combo, DropDownList, List, SimpleCombo, SortedCombo, SortedList.

    The first item in a list is 1, not 0. This makes it consistant with Euphoria's indexing method, but can be a bit confusing if you are used to working with zero-based arrays.

  • addItem( control, text ) Add text to control's list.
  • deleteItem( list, position ) Delete item from list's list at position .
  • eraseItems( list ) Remove all items from list.
  • getCount( list ) Get the count of items in list.
  • getIndex( list ) Get the index of the selected item on the list.
  • getItem( list, index ) Return the text of item at index in list.
  • insertItem( list, text, position ) Insert text into list's list at position .
  • setIndex( list, index ) Set the selected item on the list to index.

    Low Level Routines

    These routines give you access to C data structures, the device context, and other Win32 API goodies.

  • address( structure address, field ) Get address of field in structure.
  • allocate_struct( structure ) Allocate memory for structure, and initialize to zero.
  • allot( i ) Allocate space in structure for a new field.
  • allotted_size() Return allocate size of structure, and reset for new structure.
  • fetch( structure address, field ) Fetch field from structure.
  • free_strings() Free strings created by store.
  • getDC( control ) Get the DC (device context) of a control.
  • hi_word( a ) Returns high portion of word.
  • killTimer( window, timer ) Stop a timer.
  • linkFunc( dll, name, args, result ) Dynamically link a C routine as a Euphoria function.
  • linkProc( dll, name, args, result ) Dynamically link a C routine as a Euphoria procedure.
  • lo_word( a ) Get low portion of number.
  • or_all( s ) Performs or_bits on all the elements of the sequence.
  • pack_word( low, high ) Packs values into word.
  • peek_string( address ) Get sequence from address holding C-style string.
  • releaseDC( control ) Release the device context of the control.
  • sendMessage( control, command, wParam, lParam ) Send a Win32 message to the requested control.
  • setTimer( window, timer, ticks ) Start a timer ticking in window.
  • store( structure, field, value ) Store a value into a structure.

    Mouse

    These are routines that deal with the mouse and mouse pointer.

  • captureMouse( window ) Send all mouse events to window.
  • createMousePointer( hotspot x, hotspot y, image ) Create a new mouse pointer.
  • releaseMouse() Return control of the mouse to Windows.
  • setMousePointer( control, pointer ) Set the pointer the mouse displays when in control.

    Printing

    These are routines that allow you to interact with the Printer.

  • endDoc() Ends the print job.
  • endPage() Ends the printing of the current page.
  • getPrinter() Get the Printer.
  • releasePrinter() Release the Printer, freeing it up for others to use.
  • startDoc( job name ) Starts a new document on Printer.
  • startPage() Prepares the printer to begin a new page.

    Scroll Control

    These routines let you inspect and alter attributes of the scroll bar controls HScroll and VScroll and track bar controls HTrackBar and VTrackBar.

  • getScrollChange( scroll ) Returns the amount that scroll will change.
  • getScrollPos( scroll, position ) Gets the value of a scroll control.
  • getScrollRange( scroll ) Returns scroll's range of values.
  • setScrollChange( scroll, line size, page size ) Adjust the amount that a scroll control will change.
  • setScrollPos( scroll, position ) Sets the value of scroll.
  • setScrollRange( scroll, low, high ) Sets the range of values of scroll.

    Types

    These are data types defined by Win32Lib.

  • int( i ) Same as the declaration integer().
  • seq( s ) Same as the declaration sequence().

    Utilities

    These are routines that didn't seem to fit in any other category.

  • abortErr( message ) Display an error message, and abort.
  • abs( a ) Absolute value.
  • findKey( key, list ) Find key in list.
  • playSound( wave file ) Play the .WAV file.
  • setWarning( flag ) Hides warning messages from user.
  • shellExecute( command, file, style ) Launch a Windows application
  • warnErr( message ) Display an error message, with option to abort.

    XPM

    These routines deal with a portable graphics file format called XPM - "X Pixmap". XPM graphics can be embedded in programs as text data.

  • createXpm( filename, euphoria bitmap ) Creates an XPM file from a Euphoria bitmap.
  • createXpmFromBmpFile( filename, euphoria bitmap ) Creates an XPM file from a bitmap file.
  • setTransparentColor( color ) Defines what the transparent color is to be. The parameter can
  • xpmToEuBmp( xpm ) Convert XPM data into a standard Euphoria bitmap.
  • xpmToPixmap( xpm ) Create a Pixmap from XPM data.

    abortErr( message )

    Display an error message, and abort.

    Category: Utilities

    Example:

          abortErr( "Fatal error. Bummer, dude." ) 
    

    See Also: abs, findKey, playSound, setWarning, shellExecute, warnErr


    abs( a )

    Absolute value.

    Returns: Absolute value of the atom.

    Category: Utilities

    See Also: abortErr, findKey, playSound, setWarning, shellExecute, warnErr


    addItem( control, text )

    Add text to control's list.

    Category: List Control

    Example:

              -- add "Apples" to TheList 
              addItem( TheList, "Apples" ) 
    

    See Also: deleteItem, eraseItems, getCount, getIndex, getItem, insertItem, setIndex


    address( structure address, field )

    Get address of field in structure.

    Returns: Address of the field in the structure.

    Category: Low Level Routines

    This is typically used if the structure contains an array of topic Low Level Routines.

    In this snippet, the memBitmapInfo structure contains an array of RGBQUAD colors. The array is populated with the values in the pal:

        -- get the start of the rgbQuad array 
        rgbQuad = address( memBitmapInfo, bmiColors ) 
    

    -- copy the pal to memory for i = 1 to colors do

    -- store values store( rgbQuad, rgbRed, pal[i][1] ) store( rgbQuad, rgbGreen, pal[i][2] ) store( rgbQuad, rgbBlue, pal[i][3] ) store( rgbQuad, rgbReserved, 0 )

    -- move to next quad rgbQuad += SIZEOF_RGBQUAD

    end for

    See Also: allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    allocate_struct( structure )

    Allocate memory for structure, and initialize to zero.

    Returns: Address of allocated structure.

    Category: Low Level Routines

    Example:

          atom pt 
    

    -- allocate a point structure pt = allocate_struct( SIZEOF_POINT )

    See Also: address, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    allot( i )

    Allocate space in structure for a new field.

    Returns: Pointer to allotted memory.

    Category: Low Level Routines

    Allowable types are:

  • Byte: 8 bit value
  • Word: 16 bit value
  • Integer: 16 bit value, save as Word
  • Long: 32 bit value
  • DWord: 32 bit value, same as Long
  • Ptr: 32 bit value, same as Long
  • Lpsz: Long pointer (32 bits) to zero delimited string

    Example:

     global constant 
        rectLeft            = allot( Long ), 
        rectTop             = allot( Long ), 
        rectRight           = allot( Long ), 
        rectBottom          = allot( Long ), 
        SIZEOF_RECT        = allotted_size() 
    

    See Also: address, allocate_struct, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    allotted_size()

    Return allocate size of structure, and reset for new structure.

    Returns: Allotted size of structure.

    Category: Low Level Routines

    Example:

     global constant 
        rectLeft            = allot( Long ), 
        rectTop             = allot( Long ), 
        rectRight           = allot( Long ), 
        rectBottom          = allot( Long ), 
        SIZEOF_RECT        = allotted_size() 
    

    See Also: address, allocate_struct, allot, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    bitBlt( dst, dstX, dstY, src, srcX, srcY, wide, high, rop )

    Copy image (or partial image) from source to destination.

    Category: Graphics

    The bitBlt function can be used to rapidly copy images, or portions of images.

    If you want to copy the entire source image with the SRCCOPY ROP code, copyBlt does the same thing, but requires less arguments.

    To copy images with transparency, use transBlt.

    The arguments are:

  • dst: Image destination
  • dstX: X position in destination
  • dstY: Y position in destination
  • src: Image source
  • srcX: X position in source
  • srcY: Y position in source
  • wide: Width of image to copy
  • high: Height of image to copy
  • rop: Raster opeartion (ROP) code to apply

    The ROP (raster operation) specifies how to combine the source with the destination. The codes are:

  • SrcCopy dest = source
  • SrcPaint dest = source OR dest
  • SrcAnd dest = source AND dest
  • SrcInvert dest = source XOR dest
  • SrcErase dest = source AND (NOT dest)
  • NotSrcCopy dest = (NOT source)
  • NotSrcErase dest = (NOT src) AND (NOT dest)
  • MergeCopy dest = (source AND pattern)
  • MergePaint dest = (NOT source) OR dest
  • PatCopy dest = pattern
  • PatPaint dest = dest OR (pattern OR (NOT source))
  • PatInvert dest = pattern XOR dest
  • DstInvert dest = (NOT dest)
  • Blackness dest = BLACK
  • Whiteness dest = WHITE

    Note: At the moment, the coordinates are zero relative; this may be changed in later releases. Example:

              -- draw a bitmap in a window 
              atom hDIB 
    

    -- load the bitmap hDib = loadBitmapFromFile( "lizard.bmp" )

    -- copy 40x40 portion of source image to destination bitBlt( TheWindow, -- copy to TheWindow 10, 10, -- put at {10,10} in TheWindow Pixmap1, -- copy from Pixmap1 0, 0 -- upper left hand corner is {0,0} 40, 40, -- copy a 40x40 pixel portion SRCCOPY ) -- replace destination with image

    See Also: copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    Bitmap

    Static bitmap control.

    Category: Controls

    A Bitmap does not respond to events.

    A Bitmap has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • SS_BITMAP: bitmap

    See Also: CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    captureMouse( window )

    Send all mouse events to window.

    Category: Mouse

    To release the mouse, use releaseMouse.

    Example:

              -- grab the mouse for TheWindow 
              captureMouse( TheWindow ) 
    

    See Also: createMousePointer, releaseMouse, setMousePointer


    CheckBox

    CheckBox control.

    Category: Controls

    A CheckBox is a button that can be toggled on or off. It appears as a box with a label to the side. Clicking the checkbox causes an 'X' to be toggled in the box.

    A CheckBox has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_AUTOCHECKBOX: checkbox, default window handling
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    clear( object )

    Clear selected text from object.

    Category: Edit Control

    Example:

              -- clear selected text in TheTextEdit 
              clear( TheTextEdit ) 
    

    See Also: copy, cut, paste, undo


    closeWindow( window )

    Close window.

    Category: Attributes

    If window is not a main window, window will be hidden and the onClose event will be triggered.

    If window is the main window (see WinMain), then the application will be shut down and the onDestroy event will

    Example:

              -- close TheDialog 
              closeWindow( TheDialog ) 
    

    See Also: create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    Combo

    Combo box control.

    Category: Controls

    A Combo is a combination of an edit control and a list. If you need the items in the combo to be sorted, use a SortedCombo instead. In addition to being able to select a value from the combo's list, the user can enter their own value as well.

    A Combo has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_VSCROLL: attach a vertical scroll bar
  • CBS_DISABLENOSCROLL: allow the user to scroll
  • CBS_DROPDOWN: the list can drop down, like a menu
  • CBS_DROPDOWNLIST: probably shouldn't have this attribute
  • CBS_HASSTRINGS: contains string values
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    copy( object )

    Copy any selected text from object and place in the clipboard.

    Category: Edit Control

    Example:

              -- copy text from TheTextEdit into the clipboard 
              copy( TheTextEdit ) 
    

    See Also: clear, cut, paste, undo


    copyBlt( dst, dstX, dstY, src )

    Copy full image from source to destination.

    Category: Graphics

    If you only want to copy a portion of the source or need to combine the source and destination, use bitBlt.

    To copy images with transparency, use transBlt.

    The arguments are:

  • dst: Image destination
  • dstX: X position in destination
  • dstY: Y position in destination
  • src: Image source

    Note: At the moment, the coordinates are zero relative; this will be changed in later releases. Example:

              -- draw a bitmap in a window 
              atom hDIB 
    

    -- load the bitmap hDib = loadBitmapFromFile( "shuttle.bmp" )

    -- copy the entire image to TheWindow copyBlt( TheWindow, 10, 10, hDib )

    See Also: bitBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    copyToBitmapFile( window, fileName, x1, y1, x2, y2 )

    Copies image in source to file fileName.

    Returns: Returns 0 (BMP_SUCCESS) if succeeds.

    Category: Graphics

    There are a number of caveats:

  • It uses getPixel , so it's slow.
  • It uses save_bitmap, so it's currently limited to 256 colors. The error codes are the also the same as those returned by save_bitmap.

    Example:

              -- save {0,0} {100,100} on the screen to a file 
              copyToBitmapFile( Screen, "screen.bmp", 0, 0, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    create( class, title, parent, x, y, cx, cy, flags )

    Create an object of type class.

    Returns: Control identifier.

    Category: Attributes

    The title is the text that will appear in the object's caption. x and y specify the position of the object, and cx and cy specify the width and height.

    You can specify additional attributes by passing them in the flags parameter.

    Returns: The value returned is the id of the control. This is typically the first parameter expected in Win32Lib functions.

    The parent of the main window is 0.

    If you don't care about the positioning of a window, you can use the parameter Default, and Windows will automatically position the window.

    Note that, for windows, the size specified by cx, cy is the total size of the window, not the size of the client area.

    The following will create a Window called MyWindow:

          -- create a window 
          constant MyWindow = create( Window,         -- the class 
                                  "My Window",        -- the caption      
                                  0,                  -- the parent 
                                  Default, Default,   -- x and y position 
                                  60, 40,             -- height and width 
                                  0 )                 -- no special flags 
    

    The following will create a PushButton in MyWindow:

          -- create a pushbutton 
          constant MyButton = create( PushButton,     -- the class 
                                      "Push Me!",     -- the caption      
                                      MyWindow,      -- the parent 
                                      10, 10,         -- x and y position 
                                      60, 40,         -- height and width 
                                      0 )             -- no special flags 
    

    The different classes of objects are:

  • Bitmap: static bitmap
  • CheckBox: check box
  • Combo: combo box - has edit box and drop down list
  • CText: static text lable, center justified
  • DefPushButton: default push button
  • DropDownList: drop down list, non-editable
  • EditText: edit text
  • Group: group box
  • HScroll: horizontal scroll bar
  • HTrackBar: horizontal track bar
  • List: list with scroll bar
  • LText: left justified static label
  • Icon: static icon
  • Menu: menu bar item
  • MenuItem: dropdown menu item
  • MleText: multiple line text edit
  • PictureButton: push button with graphic
  • PushButton: push button
  • Radio: radio button
  • RText: right-justified static text label
  • Pixmap: off-screen color bitmap
  • SimpleCombo: combo box, no drop down list
  • SortedCombo: combo box, with sorted list
  • SortedList: list, with sorted elements
  • StatusBar: control for status text
  • TabControl: control containing tab items
  • TabItem: control item in TabControl
  • ToolBar: control for placing other controls into
  • ToggleButton: push button that toggles off and on
  • TogglePicture: toggle button with picture
  • TriCheckBox: 3 state check box
  • VScroll: vertical scroll bar
  • VTrackBar: vertical track bar
  • Window: window

    See Also: closeWindow, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    createDIB( data )

    Converts a Euphoria bitmap format into a Win32 bitmap.

    Returns: Handle to Win32 bitmap, or Null on an error.

    Category: Graphics

    The data is in the form { pal, data }.

    The name createDIB ("Device Independant Bitmap") was intended to distinguish this function from the obsolete createBitmap, which created only monochrome bitmaps.

    You only need to supply as many palette entries that are actually used by the image. Pixel indexes into the palette start at 0 (to be compatible with how Euphoria uses bitmaps)

    Palette entries are color tuples in the form { r, g, b }, with each color value ranging from 0 to 255.

    Example:

              -- create a bitmap, and display it 
              atom hBitmap 
              sequence pixels, pal 
    

    -- the pixels data pixels = { { 0,0,0,0 }, -- scan line 1 { 0,1,1,0 }, -- scan line 2 { 0,1,1,0 }, -- scan line 3 { 0,0,0,0 } } -- scan line 4

    -- the pal data (color tuples) pal = { { 255, 0, 0 }, -- color 0 is bright red { 0, 0, 255 } } -- color 1 is bright blue

    -- create the DIB hBitmap = createDIB( {Pal, Pixels} )

    -- display the bitmap in TheWindow at {1,1} drawBitmap( theWindow, hBitmap, 1, 1 )

    See Also: bitBlt, copyBlt, copyToBitmapFile, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    createMousePointer( hotspot x, hotspot y, image )

    Create a new mouse pointer.

    Category: Mouse

    The x and y values are the "hotspot". The image is a 2x2 text sequence of the pointer. Bytes are interpreted as follows:

    ' ' = transparent '.' = solid white 'x' = solid black

    Example:

          constant PlusPointer = createMousePointer( 8, 8, { 
              "     xxxxxx       ", 
              "     x....xx     ", 
              "     x....xx     ", 
              "     x....xx     ", 
              "     x....xx     ", 
              "xxxxxx....xxxxxx ", 
              "x..............xx", 
              "x..............xx", 
              "x..............xx", 
              "x..............xx", 
              "xxxxxx....xxxxxxx", 
              " xxxxx....xxxxxxx", 
              "     x....xx     ", 
              "     x....xx     ", 
              "     x....xx     ", 
              "     xxxxxxx     ", 
              "      xxxxxx     "} ) 
    

    -- set as pointer for MyWindow setMousePointer( MyWindow, PlusPointer )

    See Also: captureMouse, releaseMouse, setMousePointer


    createXpm( filename, euphoria bitmap )

    Creates an XPM file from a Euphoria bitmap.

    Returns: Status code.

    Category: XPM

    Status codes:

  • XPM_OK. File created successfully
  • XPM_ERR_FILE: File related error
  • XPM_ERR_COLORS: Too many colors in bitmap

    See Also: createXpmFromBmpFile, setTransparentColor, xpmToEuBmp, xpmToPixmap


    createXpmFromBmpFile( filename, euphoria bitmap )

    Creates an XPM file from a bitmap file.

    Returns: Status code.

    Category: XPM

    Status codes:

  • XPM_OK. File created successfully
  • XPM_ERR_FILE: File related error
  • XPM_ERR_COLORS: Too many colors in bitmap

    See Also: createXpm, setTransparentColor, xpmToEuBmp, xpmToPixmap


    CText

    Center-justified label control.

    Category: Controls

    A CText control does not respond to events.

    A CText has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • ES_CENTER: center justify the text

    See Also: Bitmap, CheckBox, Combo, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    cut( object )

    Cut any selected text from object and place in the clipboard.

    Category: Edit Control

    Example:

              -- cut text from TheTextEdit 
              cut( TheTextEdit ) 
    

    See Also: clear, copy, paste, undo


    DefPushButton

    Default command button control.

    Category: Controls

    A DefPushButton is a PushButton, but is displayed with an extra border indicating that this button will automatically be selected if the user presses the Return button on the keyboard.

    Unfortunately, this behavior is not currently implemented, so it simply behaves the same as a normal PushButton.

    A DefPushButton has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_DEFPUSHBUTTON: button style is default pushbutton
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    deleteItem( list, position )

    Delete item from list's list at position .

    Category: List Control

    The position starts at 1.

    Example:

              -- delete item 2 from the list 
              deleteItem( TheList, 2 ) 
    

    See Also: addItem, eraseItems, getCount, getIndex, getItem, insertItem, setIndex


    drawArc( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd )

    Draw an arc.

    Category: Graphics

    Draws the arc in the current pen color. The arc's bounding rectangle is defined as { x1, y1 } to { x2, y2 }. If filled is true, the ellipse is filled in the current pen color.

    The arc is defined by the intersection between the radial start point and radial end point. The radial start point is a line running from the center of the bounding rectangle to { xStart, yStart }, and radial end point by a line running from the center of the bounding rectangle to { xEnd, yEnd }.

    If filled is true, the arc will be filled.

    Example:

          -- draw a bright cyan filled arc in TheWindow 
          setPenColor( TheWindow, BrightCyan ) 
          drawArc( TheWindow,  
                      True,           -- filled 
                      1, 1,           -- upper left boundary 
                      100, 100,       -- lower right boundary 
                      49, 1,          -- top center of rectangle 
                      100, 49 )       -- right center of rectangle 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawBitmap( window, DIB handle, x, y )

    Draws DIB (device independant bitmap) in window at { x, y }.

    Category: Graphics

    Note: The term bitmap is inconsistant; I expect to be renaming these routines in the future.

    Example:

              -- load a bitmap, and display in window 
              atom hBitmap 
    

    -- load the bitmap hBitmap = loadBitmapFromFile( "graphic.bmp" )

    -- display the bitmap in TheWindow at {1,1} drawBitmap( theWindow, hBitmap, 1, 1 )

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawChord( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd )

    Draw a chord.

    Category: Graphics

    Draws the chord in the current pen color.

    A chord is a region bounded by the intersection of an ellipse and a line segment. The ellipse is bounding rectangle is defined { x1, y1 } to { x2, y2 }. If filled is true, the chord is filled in the current pen color.

    The chord is defined by the intersection between the radial start point and radial end point. The radial start point is a line running from the center of the bounding rectangle to { xStart, yStart }, and radial end point by a line running from the center of the bounding rectangle to { xEnd, yEnd }.

    If filled is true, the chord will be filled.

    Example:

          -- draw a yellow chord in TheWindow 
          setPenColor( TheWindow, Yellow ) 
          drawChord( TheWindow,  
                      True,           -- filled 
                      1, 1,           -- upper left boundary 
                      100, 100,       -- lower right boundary 
                      49, 1,          -- top center of rectangle 
                      100, 49 )       -- right center of rectangle 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawEllipse( window, filled, x1, y1, x2, y2 )

    Draw an ellipse.

    Category: Graphics

    Draws the ellipse in the current pen color within the rectangle bounded by { x1, y1 } and { x2, y2 }. If filled is true, the ellipse is filled in the current pen color.

    Example:

          -- draw a black ellipse in TheWindow 
          setPenColor( TheWindow, Black ) 
          drawEllipse( TheWindow, True, 10, 10, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawLine( window, x1, y1, x2, y2 )

    Draw a line.

    Category: Graphics

    The line is drawn in the current pen color between { x1, y1 } and { x2, y2 }.

    Example:

          -- draw a line in TheWindow from {10,10} to {100,100} 
          drawLine( TheWindow, 10, 10, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawPie( window, filled, x1, y1, x2, y2, xStart, yStart, xEnd, yEnd )

    Draw a pie slice.

    Category: Graphics

    Draws the pie slice in the current pen color. The bounding rectangle is defined as { x1, y1 } to { x2, y2 }. If filled is true, the slice is filled in the current pen color.

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawPolygon( window, filled, points )

    Draw a polygon.

    Category: Graphics

    Draws the polygon in window in the current pen color using points. If i/ filled is true, the polygon will be filled.

    Example:

          -- draw a blue filled triangle in TheWindow 
          sequence points 
    

    -- define the points points = { { 10, 10 }, { 80, 40 }, { 40, 80 } }

    -- set pen color setPenColor( TheWindow, Blue )

    -- draw a filled polygon using the points drawPolygon( TheWindow, True, points )

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawRectangle( window, filled, x1, y1, x2, y2 )

    Draw a rectangle.

    Category: Graphics

    Draws the rectangle in the current pen color from { x1, y1 } to { x2, y2 }. If filled is true, the rectangle is filled in the current pen color.

    Example:

          -- draw a filled green rectangle in TheWindow 
          setPenColor( TheWindow, Green ) 
          drawRectangle( TheWindow, True, 10, 10, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    drawRoundRectangle( window, filled, x1, y1, x2, y2, xc, yc )

    Draw a rounded rectangle.

    Category: Graphics

    Draws the rounde rectangle in the current pen color from { x1, y1 } to { x2, y2 }. The ellipse corner width and height are specified in xc and yc. If filled is true, the rectangle is filled in the current pen color.

    Example:

          -- draw a filled blue round rectangle in TheWindow 
          setPenColor( TheWindow, Green ) 
          drawRoundRectangle( TheWindow, True, 10, 10, 100, 100, 5, 5 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    DropDownList

    Drop down list control.

    Category: Controls

    A DropDownList is like a Combo, but the user can only select items on the list, and not enter their own value into the edit box.

    A DropDownList has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_VSCROLL: attach a vertical scroll bar
  • CBS_DROPDOWN: the list can drop down, like a menu
  • CBS_HASSTRINGS: contains string values
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    EditText

    Text edit control control.

    Category: Controls

    An EditText allows the user to enter text values into the control.

    A EditText has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • ES_AUTOHSCROLL: automatic vertical scrollbar, if needed
  • ES_LEFT: left justify the text
  • WS_BORDER: draw with a border
  • WS_TABSTOP: the control can be tabbed to
  • WS_EX_CLIENTEDGE: 3D effect
  • WS_EX_ACCEPTFILES: drag and drop support

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    endDoc()

    Ends the print job.

    Returns: True if succeeds.

    Category: Printing

    Applications should call endDoc when finished printing.

    Refer to Printer for details.

    See Also: endPage, getPrinter, releasePrinter, startDoc, startPage


    endPage()

    Ends the printing of the current page.

    Returns: True if succeeds.

    Category: Printing

    Refer to Printer for details.

    See Also: endDoc, getPrinter, releasePrinter, startDoc, startPage


    eraseItems( list )

    Remove all items from list.

    Category: List Control

    Example:

              -- erase items from TheList 
              eraseItems( TheList ) 
    

    See Also: addItem, deleteItem, getCount, getIndex, getItem, insertItem, setIndex


    fetch( structure address, field )

    Fetch field from structure.

    Returns: Field from a structure.

    Category: Low Level Routines

    Data conversion is automatic. For example, if the field is an Lpsz, a sequence containing the string will automatically be returned.

    Example:

          -- fetch the average character width from the text metrics structure 
          width = fetch( tm, tmAveCharWidth ) 
    

    See Also: address, allocate_struct, allot, allotted_size, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    findKey( key, list )

    Find key in list.

    Returns: Index of sublist with matching key.

    Category: Utilities

    Example:

          -- find a value from a list 
          integer at 
          at = findKey( name, nameList ) 
    

    See Also: abortErr, abs, playSound, setWarning, shellExecute, warnErr


    free_strings()

    Free strings created by store.

    Category: Low Level Routines

    Free any strings that have been allocated to the structure. If the structure uses any Lpsz data types, you should call free_strings when you free the structure.

    Example:

          -- call Win32 StartDoc routine 
          atom di, result 
    

    -- allocate the structure di = allocate_struct( SIZEOF_DOCINFO )

    -- store the values store( di, DOCINFO_cbSize, SIZEOF_DOCINFO ) store( di, DOCINFO_lpszDocName, job )

    result = c_func( xStartDoc, { printerDC, di } )

    -- free the structure free( di ) free_strings()

    See Also: address, allocate_struct, allot, allotted_size, fetch, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    getClientPoint( window, x, y )

    Get screen position of point { x, y } in window.

    Returns: { screen x, screen y }

    Category: Attributes

    Example:

          -- where does {10, 10} in MyWindow appear on the screen? 
          sequence point 
    

    -- get the screen position point = getClientPoint( MyWindow, 10, 10 )

    -- display the size wPrintf( MyWindow, "The point {10,10} maps to {%d, %d on the screen"}, point )

    See Also: closeWindow, create, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getClientRect( object )

    Get uncovered portion of the client area.

    Returns: { x1, y1, x2, y2 }

    Category: Attributes

    Unlike the menu, toolbar and statusbar both occupy space in the window. To determine what part of the window's client area is not covered, use this function. This function can be used even if there is no toobar or statusbar in the window.

    For example, the generic demo has a MleEdit that needs to be resized every time the window is resized. It uses getClientRect to determine the metrics of the MleEdit.

              -- color the unoccupied portion of the window red 
              sequence rect 
    

    -- find out what portion of the window is free rect = getClientRect( TheWindow )

    -- draw a filled rectangle setPenColor( TheWindow, Red ) drawRectangle( TheWindow, rect[1], rect[2], rect[3], rect[4] )

    See Also: closeWindow, create, getClientPoint, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getColorDialog( window, default color )

    "Get Color" Dialog

    Returns: Selected color, or default color if nothing selected.

    Category: Dialogs

    Calling this function brings up the modal "Select Color" dialog, allowing the user to select a color from the default color list, or add a color to the custom color list.

    The parameter passed in default color is an atom representing the default color to select, in #RRGGBB format. Passing -1 specifies that the color black (#000000) is the default color.

    NOTE: For some reason, the parameter seems to be in the #BBGGRR format instead of the #RRGGBB form. If someone could figure out what's happening here, I'd appreciate it.

    Example:

              -- get a color; red ( #FF0000 ) is the default 
              atom color       
              color = getColorDialog( Window, #FF0000 ) 
    

    See Also: getFontDialog, getOpenFileName, getSaveFileName


    getCount( list )

    Get the count of items in list.

    Returns: Count of items, or zero if control's list is empty.

    Category: List Control

    Example:

              -- count size of TheList 
              integer count 
    

    count = getCount( TheList )

    See Also: addItem, deleteItem, eraseItems, getIndex, getItem, insertItem, setIndex


    getDC( control )

    Get the DC (device context) of a control.

    Returns: Device Context (DC) of control.

    Category: Low Level Routines

    If the DC is already grabbed, the value is simply returned without grabbing it again.

    There are four special cases that are handled:

  • Normal controls: This includes any control that is normally visible on the screen. This performs a normal GetDC.
  • Screen: Passing the parameter of Screen returns the DC of the monitor.
  • Printer: Passing the parameter of Printer returns the printer's DC, assuming that one has been selected with getPrinter.
  • Pixmaps: This causes a DC compatible with the screen resolution to be created with the pixmap selected into it.
  • Other: If the value passed is not identifiable as a valid Win32Lib control, it is assumed to be a DIB. A compatible DC is created, and the DIB is selected into it.

    When you are done with the DC, it should be released with releaseDC unless the DC was obtained during an onPaint event, since the DC will be released automatically.

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    getExtent( object )

    Get the extent of object.

    Returns: { width, height }

    Category: Attributes

    Example:

          -- how large is TheButton? 
          sequence extent 
    

    -- get the size of TheButton extent = getExtent( TheButton )

    -- display the size wPrintf( MyWindow, "TheButton is %d by %d}, extent )

    See Also: closeWindow, create, getClientPoint, getClientRect, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getFontDialog( window )

    "Get Font" Dialog

    Returns: { font name, points, style flags, color } or -1 if cancelled.

    Category: Dialogs

    Calling this function brings up the modal "Select Font" dialog, allowing the user to select a font from the list of available fonts.

    Example:

              integer flags, points 
              atom color 
              sequence font 
              object result 
    

    -- get a font choice from the user result = getFontDialog( MyWindow ) if sequence( result ) then -- get the values font = result[1] points = result[2] flags = result[3] color = result[4] end if

    See Also: getColorDialog, getOpenFileName, getSaveFileName


    getFontMetric( id, field )

    Gets font metric field value for id's current font.

    Returns: field's value

    Category: Fonts

    Example:

              -- get the descent for the default font 
              integer descent 
    

    setDefaultFont( MyWindow ) descent = getFontMetric( MyWindow, tmDescent ) wPrintf( MyWindow, "The default font's descent is %", descent )

    See Also: getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    getFontSize( id )

    Gets font metrics for id's current font.

    Returns: { width, height } of average character.

    Category: Fonts

    Example:

              -- show the metrics of the default font 
              sequence size 
    

    setDefaultFont( MyWindow ) size = getFontSize( MyWindow ) wPrintf( MyWindow, "The default font is %d by %d", size )

    See Also: getFontMetric, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    getIndex( list )

    Get the index of the selected item on the list.

    Returns: Index of selected item, or zero if no item is selected.

    Category: List Control

    Example:

              -- get index of selected item in TheList 
              integer index 
    

    index = getIndex( TheList )

    See Also: addItem, deleteItem, eraseItems, getCount, getItem, insertItem, setIndex


    getItem( list, index )

    Return the text of item at index in list.

    Returns: Text of item, or "" if fails.

    Category: List Control

    Example:

              -- get the text of the third item in TheList 
              sequence text 
    

    -- get the text text = getItem( TheList, 3 )

    See Also: addItem, deleteItem, eraseItems, getCount, getIndex, insertItem, setIndex


    getMousePos()

    Retrieves absolute position of the mouse.

    Returns: Mouse {x,y} position, relative to screen.

    Category: Attributes

    Example:

     sequence pos 
    

    pos = getMousePos() if pos[1] > 200 then -- code goes here... end if

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getNumber( object )

    Get the numeric value of text from object.

    Returns: Numeric value of caption or edit.

    Category: Attributes

    This is basically a combination of Euphoria's value() function and getText().

    Example:

          -- get the numeric value from TheTextEdit 
          atom number 
    

    number = getNumber( TheTextEdit )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getOpenFileName( window, file, filters )

    "Open File" dialog.

    Returns: Selected file name, or empty sequence if cancelled.

    Category: Dialogs

    Calling this function brings up the modal "Open File" dialog, allowing the user to select a file name. file is a sequence holding the default file name. filters is a list of patterns to limit displayed files to, in the format:

          { "text", pattern, "text", pattern ... } 
    

    For example:

          constant FileTypes = { 
              "Text File", "*.TXT", 
              "Euphoria Program", "*.EX;*.EXW;*.E;*.EW", 
              "All Files", "*.*" } 
    

    Note that a pattern can contain several different values.

    Example:

              -- get file name to open 
              sequence filename 
    

    filename = getOpenFileName( TheWindow, -- parent window "", -- no default name { "Text File", "*.TXT", -- text files "All Files", "*.*" } ) -- everything else

    See Also: getColorDialog, getFontDialog, getSaveFileName


    getPixel( window, x, y )

    Get a pixel value from window's client area.

    Returns: rgb value of point.

    Category: Graphics

    Example:

          -- get a pixel color from {10,10} in TheWindow 
          atom rgb 
          rgb = getPixel( TheWindow, 10, 10 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    getPrinter()

    Get the Printer.

    Returns: { start page, end page, copies }, or False if user aborted.

    Category: Printing

    This pops up the "Select Printer" dialog for the user to select a printer from.

    Refer to Printer for details.

    See Also: endDoc, endPage, releasePrinter, startDoc, startPage


    getSaveFileName( window, file, filters )

    "Save File" dialog.

    Returns: Selected file name, or empty sequence if cancelled.

    Category: Dialogs

    Calling this function brings up the modal "Save File" dialog, allowing the user to select a file name. file is a sequence holding the default file name. filters is a list of patterns to limit displayed files to, in the format:

          { "text", pattern, "text", pattern ... } 
    

    For example:

          constant FileTypes = { 
              "Text File", "*.TXT", 
              "Euphoria Program", "*.EX;*.EXW;*.E;*.EW", 
              "All Files", "*.*" } 
    

    Note that a pattern can contain several different values.

    Example:

              -- get file name to save 
              filename = getOpenFileName(  
                              TheWindow,                  -- parent window 
                              "MyFile.txt",               -- default name 
                              { "Text File", "*.TXT",     -- text files     
                                "All Files", "*.*" } )    -- everything else 
    

    See Also: getColorDialog, getFontDialog, getOpenFileName


    getScrollChange( scroll )

    Returns the amount that scroll will change.

    Returns: { line change, page change }

    Category: Scroll Control

    This value is set by setScrollChange. The default value is {1,10}, indicating the small change and large change amounts.

    Example:

              -- get change amount for TheScroll 
              sequence change 
              change = getScrollChange( TheScroll ) 
    

    See Also: getScrollPos, getScrollRange, setScrollChange, setScrollPos, setScrollRange


    getScrollPos( scroll, position )

    Gets the value of a scroll control.

    Returns: Position of the thumb on the scroll control.

    Category: Scroll Control

    Example:

              -- get value of TheScroll   
              integer pos 
              pos = getScrollPos( TheScroll ) 
    

    See Also: getScrollChange, getScrollRange, setScrollChange, setScrollPos, setScrollRange


    getScrollRange( scroll )

    Returns scroll's range of values.

    Returns: { low, high }

    Category: Scroll Control

    This value is set by setScrollRange. The default value is {0,100}.

    Example:

              -- get range of TheScroll 
              sequence range 
              range = getScrollRange( TheScroll ) 
    

    See Also: getScrollChange, getScrollPos, setScrollChange, setScrollPos, setScrollRange


    getSize( object )

    Get the metrics of object.

    Returns: { x1, y1, x2, y2 }

    Category: Attributes

    Example:

          -- where is the window located? 
          sequence size 
    

    -- get the size of the window size = getSize( MyWindow )

    -- display the position wPrintf( MyWindow, "MyWindow is located at %d,%d}, size[1..2] )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getSysColor( window, color )

    Return atom with value of a system color.

    Category: Attributes

    The system colors in Windows are:

  • COLOR_SCROLLBAR
  • COLOR_BACKGROUND
  • COLOR_DESKTOP
  • COLOR_ACTIVECAPTION
  • COLOR_INACTIVECAPTION
  • COLOR_MENU
  • COLOR_WINDOW
  • COLOR_WINDOWFRAME
  • COLOR_MENUTEXT
  • COLOR_WINDOWTEXT
  • COLOR_CAPTIONTEXT
  • COLOR_ACTIVEBORDER
  • COLOR_INACTIVEBORDER
  • COLOR_APPWORKSPACE
  • COLOR_HIGHLIGHT
  • COLOR_HIGHLIGHTTEXT
  • COLOR_BTNFACE
  • COLOR_BTNSHADOW
  • COLOR_GRAYTEXT
  • COLOR_BTNTEXT
  • COLOR_INACTIVECAPTIONTEXT
  • COLOR_BTNHIGHLIGHT
  • COLOR_3DDKSHADOW
  • COLOR_3DLIGHT
  • COLOR_INFOTEXT
  • COLOR_INFOBK

    Example:

              -- Set the window to the button color 
              setWindowBackColor( MyWindow, getSysColor( COLOR_BTNFACE ) ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getText( object )

    Get the text in object.

    Returns: Text in object's caption or edit.

    Category: Attributes

    If the control is editable, it returns the data in the control. Otherwise, it returns the caption text of the control.

    Example:

          -- get the text from TheTextEdit 
          sequence text 
    

    text = getText( TheTextEdit )

    Note: This should probably be divided into two seperate functions, getCaption and getData.

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    getTextExtent( object, text )

    Returns: { width, height } of text.

    Category: Fonts

    short Gets the metrics of the text string, using object's current font.

    Example:

              -- show the metrics of the string 
              sequence text, extent 
    

    -- the string to measure text = "Hi, there!"

    -- measure the string extent = getTextExtent( MyWindow, text )

    -- show results wPrintf( MyWindow, "The string %s is %d by %d", {string, extent[1], extent[2]} )

    See Also: getFontMetric, getFontSize, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    Group

    Group control.

    Category: Controls

    A Group is a static control, and recieves no events. It's main function is to seperate other controls into groups.

    In addition to providing a visual cue, the group alters the behavior of the Radio control; all the radio buttons within a single group are considered to belong to the same group.

    When placing controls in groups, it's a good idea to make them children of the Group, instead of children of the Window. If you don't, the Group may end up routing events meant for the control to itself. For example, onDragAndDrop events will be routed to the Group instead of the child.

    A Group has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_GROUPBOX: group box control

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    hi_word( a )

    Returns high portion of word.

    Returns: High 16 bits of a 32 bit word.

    Category: Low Level Routines

    Typically used to decode Win32 message values when several values are packed into a single number.

    Example:

          -- extract the high portion from lParam 
          integer y 
          y = hi_word( lParam ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    HScroll

    Horizontal scrollbar control.

    Category: Controls

    An HScroll has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • SBS_HORZ: horizontal scroll bar
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    HTrackBar

    Horizontal track bar control.

    Category: Controls

    An HTrackBar has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • TBS_VERT: vertical scrollbar
  • TBS_AUTOTICKS: ticks automatically created
  • TBS_ENABLESELRANGE: range highlighted, triangles at end of range
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    HTrackBar

    Vertical track bar control.

    Category: Controls

    A VTrackBar has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • TBS_VERT: vertical scrollbar
  • TBS_AUTOTICKS: ticks automatically created
  • TBS_ENABLESELRANGE: range highlighted, triangles at end of range
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    Icon

    Category: Controls

    Icon control. An Icon is a static small graphic. As a static control, it does not respond to events.

    An Icon has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • SS_ICON: icon

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    insertItem( list, text, position )

    Insert text into list's list at position .

    Category: List Control

    The position starts at 1.

    Example:

              -- insert "Bannanas" at position 2 in TheList 
              insertItem( TheList, "Bannanas", 2 ) 
    

    See Also: addItem, deleteItem, eraseItems, getCount, getIndex, getItem, setIndex


    int( i )

    Same as the declaration integer().

    Returns: True if i is an integer

    Category: Types

    See Also: seq


    isChecked( object )

    Returns the checked state of object.

    Category: Attributes

    Example:

              -- is TheRadio1 checked? 
              integer flag 
    

    flag = isChecked( TheRadio1 )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    isEnabled( object )

    Returns the enabled state of object.

    Category: Attributes

    Example:

              -- is TheButton enabled? 
              integer flag 
    

    flag = isEnabled( TheButton )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    isScreenPointIn( control, x, y )

    Return True if the screen point { x, y } is within control.

    Returns: True if point { x, y } is within control.

    Category: Attributes

    This is used for hit testing, to determine if a point lies on a control.

    Example:

              -- check if screen point {10,10} lies in MyWindow 
              if isScreenPointIn( MyWindow, 10, 10 ) then 
                  -- point is in MyWindow 
              end if 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    isVisible( object )

    Returns the visibility state of object.

    Category: Attributes

    Example:

              -- is TheButton visible? 
              integer flag 
    

    flag = isVisible( TheButton )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    killTimer( window, timer )

    Stop a timer.

    Category: Low Level Routines

    This deactivates timer that was set with setTimer.

    Example:

              -- deactivate timer #12 
              killTimer( MyWindow, 12 ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    linkFunc( dll, name, args, result )

    Dynamically link a C routine as a Euphoria function.

    Returns: Handle to C function.

    Category: Low Level Routines

    Essentially the same as define_c_func, but generates an error message and aborts if the routine can't be linked to.

    Example:

          constant xLoadIcon = linkFunc(user32, "LoadIconA", {C_POINTER, C_POINTER}, C_POINTER) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    linkProc( dll, name, args, result )

    Dynamically link a C routine as a Euphoria procedure.

    Returns: Handle to C procedure.

    Category: Low Level Routines

    Essentially the same as define_c_proc, but generates an error message and aborts if the routine can't be linked to.

    Example:

          constant xKillTimer = linkProc(user32, "KillTimer", {C_POINTER, C_UINT}) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    List

    List.

    Category: Controls

    A List contains a list of items, arranged in the order that they were placed into the list. To have a sorted list, either sort the items before placing them into the list, or use the SortedList control.

    A List has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • LBS_NOTIFY: notify parent of events
  • WS_VSCROLL: attach a vertical scroll bar
  • WS_BORDER: draw a border on the control
  • WS_TABSTOP: the control can be tabbed to
  • WS_EX_CLIENTEDGE: 3D effect
  • WS_EX_ACCEPTFILES: drag and drop support

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    loadBitmapFromFile( file name )

    Loads a bitmap file.

    Returns: Win32 handle of bitmap, or Null if an error occured.

    Category: Graphics

    Note: The name bitmap is a bit confusing; it should be more properly called loadDIBFromFile. At some point, the graphic routines need to be renamed in a more consistant manner.

    Example:

              -- load a bitmap, and display in window 
              atom hBitmap 
    

    -- load the bitmap hBitmap = loadBitmapFromFile( "graphic.bmp" )

    -- display the bitmap in TheWindow at {1,1} drawBitmap( theWindow, hBitmap, 1, 1 )

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    lo_word( a )

    Get low portion of number.

    Returns: Low 16 bits of a 32 bit word.

    Category: Low Level Routines

    Typically used to decode Win32 message values when several values are packed into a single number.

    Example:

          -- extract the low portion from lParam 
          integer x 
          x = lo_word( lParam ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    LText

    Left-justified label control.

    Category: Controls

    An LText control does not respond to events.

    An LText has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • ES_LEFT: left justify the text

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    Menu

    Menu bar item control.

    Category: Controls

    A Menu is an item in a window's menubar. There is no need to declare a menubar for a window; if a Menu is created, the menubar will automatically be created for it.

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    MenuItem

    Dropdown menu item control.

    Category: Controls

    A MenuItem is an item in a window's Menu. Menu items are placed sequentially into menus.

    There is currently no way to remove menu items.

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    MleEdit

    Multi-line edit control.

    Category: Controls

    An MleEdit (multi-line edit) control is like a mini-text editor. The user can enter in multiple lines of text.

    Since the Tab key is accepted as input into the MLE, the user has to press Control+Tab to move to the next control, instead of the standard Tab key.

    A MleEdit has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_HSCROLL: horizontal scroll bar
  • WS_VSCROLL: vertical scroll bar
  • ES_LEFT: left justify the text
  • WS_BORDER: draw with a border
  • ES_MULTILINE: allow multiple lines of text
  • WS_TABSTOP: the control can be tabbed to
  • WS_EX_CLIENTEDGE: 3D effect
  • WS_EX_ACCEPTFILES: drag and drop support

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    moveWindow( control, x, y, cx, cy, repaint )

    Move and resize control.

    Category: Attributes

    The name is a bit misleading, since this applies to controls as well as to windows. The name setPosition is already taken, although this may be changed to movePen in the future.

    control is moved to x, y, and sized to cx, cy. If the repaint flag is set, the window is repainted.

    To find the current size and position of control, use getSize.

    Example:

              -- move Button1 to 20x20 
              sequence size 
    

    -- get the current size size = getSize( Button1 )

    -- change the size and repaint moveWindow( Button1, 20, 20, size[3], size[4], True )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    onChange()

    Value in a control is changed.

    Category: Events

    To determine the new value of the control, use the appropriate function - getText, isChecked, etc.

    See Also: onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onClick()

    Mouse is clicked.

    Category: Events

    It is issued along with and onMouse event.

    This event is typically used when a control such as a PushButton or CheckBox is clicked.

    See Also: onChange, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onClose()

    A Window is closed.

    Category: Events

    This typically occurs via closeWindow, although the user can select the close control on the window as well.

    Closing a window does not actually destroy it (unless it is the main window; the window is merely hidden. Refer to closeWindow for more details.

    This event is only triggered for a Window.

    See Also: onChange, onClick, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onDestroy()

    The application is being closed.

    Category: Events

    This is triggered when a the main window is closed.

    This event is only triggered for the main window.

    See Also: onChange, onClick, onClose, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onDragAndDrop( file name )

    A file has been dragged onto the control or window.

    Category: Events

    This is triggered by the user dragging and dropping a file onto a control or window. If more than one file is dropped, each file name triggers a seperate onDragAndDrop event. The following controls respond to onDragAndDrop:

  • Window
  • List
  • SortedList
  • EditText
  • MleText

    For example, the following code adds the name of the file to TheList when a file is dragged and dropped on it:

          procedure dropped( fileName ) 
              -- add the file name to the list 
              addItem( TheList, fileName )                   
          end procedure 
          onDragAndDrop[ TheList ] = routine_id("dropped") 
    

    See Also: onChange, onClick, onClose, onDestroy, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onEvent( event, wParam, lParam )

    An event (any type) has occured.

    Category: Events

    Before the events are processed by any of the trap routines or default Windows routines, the onEvent trap is processed.

    If you want to skip the default Windows processing of the event, pass a non-zero value to the returnValue routine.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onGotFocus()

    A control (or Window) receives focus.

    Category: Events

    Focus means that keyboard events are directed to that control. Static controls (such as LText) cannot get focus.

    When a Win32Lib window gets focus, it will give focus back to the last control in the window that had focus. If there are no controls in the window that can recieve focus, the focus will remain with the window.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onKeyDown( scanCode, shift )

    Key is pressed.

    Category: Events

    The scanCode is "raw" value of the key. The primary purpose of onKeyDown is to trap "special" keys not reported by onKeyPress.

    The shift parameter has bits set indicating the if the shift, control, and alt keys are pressed. The masks for each key are:

  • ShiftMask
  • ControlMask
  • AltMask

    For example, to see if the Shift+Backspace key was pressed, you could write:

          -- shift+backspace? 
          if  and_bits( shift, ControlMask ) 
          and scanCode = VK_BACK then 
              -- shift+backspace held 
          end if 
    

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onKeyPress( keyCode, shift )

    "Printable" key is pressed.

    Category: Events

    The keyCode is ANSII value of the key. Only "visible" keys are reported with this function. To trap "special" keys (such as the cursor keys), use onKeyDown. For example:

          -- is it the letter 'a'? 
          if keyCode = 'a' then 
              -- it's the letter a 
          end if 
    

    The shift parameter has bits set indicating the if the shift, control, and alt keys are pressed. The masks for each key are:

  • ShiftMask
  • ControlMask
  • AltMask

    For example, to see if the control key is held down, you could write:

          -- control key held down? 
          if and_bits( shift, ControlMask ) then 
              -- control key is held down 
          end if 
    

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onKeyUp( scanCode, shift )

    Key is released.

    Category: Events

    The scanCode is the raw scan code value of the key. Use the VK_ constants to determine the value of the key.

    The shift parameter has bits set indicating the if the shift, control, and alt keys are pressed.

    See onKeyDown for details.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onLostFocus()

    A Window or control loses focus.

    Category: Events

    Focus means that keyboard events are directed to that control. See onGotFocus.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onMouse, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onMouse( event, x, y, shift )

    Event triggered when a mouse action takes place.

    Category: Events

    The event parameter will be one of the following values:

  • MouseMove: the mouse was moved
  • LeftDown: the left mouse button was pressed
  • RightDown: the right mouse button was pressed
  • LeftUp: the left mouse button was released
  • RightUp: the right mouse button was released
  • LeftDoubleClick: the left mouse button was double clicked
  • RightDoubleClick: the right mouse button was double clicked

    The x and y parameters specify where the mouse is located. If the mouse has been grabbed (see captureMouse), the values of x and y can be negative if the mouse is outside the client area.

    The shift parameter has bits set indicating the if the shift, control, and alt keys are pressed. The masks for each key are:

  • ShiftMask
  • ControlMask
  • AltMask

    For example, to see if the shift key is held down, you could write:

          if and_bits( shift, ShiftMask ) then 
              -- shift is held down 
          end if 
    

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onOpen, onPaint, onResize, onScroll, onTimer, returnValue


    onOpen()

    A Window is opened.

    Category: Events

    This is typically triggered by WinMain, or openWindow, before the window is visible by the user.

    Typically, code that is run at this point does some sort of initialization.

    This event is only triggered for a Window.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onPaint, onResize, onScroll, onTimer, returnValue


    onPaint( x1, y1, x2, y2 )

    A portion or all of a Window needs to be redrawn.

    Category: Events

    The parameters indicate the portion of the window that needs to be updated.

    Not only does {x1,y1,x2,y2} define the area that needs to be redrawn, Windows restricts your application to only being able to draw in those areas! If your application tries to write outside this rectangle on an onPaint event, nothing will be drawn there.

    Since Windows expects you application to be able to redraw any part of the application's window when responding to an onPaint event, this means that the onPaint routine must know how to render any part of the window.

    For programs without any graphics and text drawn on the window, there is no problem - since there are no graphics, there is nothing to update.

    If the application is fairly lightweight (such as a tic-tac-toe game), you simply choose to ignore the parameters passed to onPaint, and redraw the entire window with each onPaint event.

    If there is sufficient graphics to make the task of repainting the window complex, the best approach is probably to do double-buffering with a Pixmap.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onResize, onScroll, onTimer, returnValue


    onResize( style, x, y )

    A Window is resized.

    Category: Events

    The style is one of the following:

  • SIZE_RESTORED: Window was restored
  • SIZE_MINIMIZED: Window was minimized
  • SIZE_MAXIMIZED: Window was maximized

    Expect the style parameters to change to system-independant constants at some point in time.

    The x and y parameters are the size of the client area.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onScroll, onTimer, returnValue


    onScroll( position )

    Scrollbar value has changed.

    Category: Events

    The position parameter indicates the new value of a scrollbar or trackbar.

    This event is only triggered for HScroll and VScroll controls.

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onTimer, returnValue


    onTimer()

    A timer is triggered.

    Category: Events

    Timers are clocks that are maintained by Windows, and trigger onTimer events at a user-specified interval, measured in milliseconds.

    They are created and removed with the calls:

  • setTimer( window, timer id, milliseconds )
  • killTimer( window, timer id )

    A timer is not treated as an actual control. Rather, the event is sent to the window that the timer is associated with.

    ---------------------------------------------------------------------------

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, returnValue


    openWindow( window, style )

    Opens a window.

    Category: Attributes

    The style flag is one of the following:

  • Normal: Original size.
  • Minimize: Minimized into the task bar.
  • Maximize: Fills screen.
  • Modal: Original size, but no other application window can get focus until this window is closed. Use to emulate modal dialogs.
  • Win32 Flag: For example, SW_SHOWMINNOACTIVE.

    The openWindow function will trigger an onOpen event.

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    or_all( s )

    Performs or_bits on all the elements of the sequence.

    Returns: OR'd value of sequence elements.

    Category: Low Level Routines

    Typically used to combine a series of attribute flags together.

    Example:

          -- combine flags 
          integer flags 
          flags = or_all( { WS_CHILD, WS_VISIBLE, BS_PUSHBUTTON, WS_TABSTOP} ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, pack_word, peek_string, releaseDC, sendMessage, setTimer, store


    pack_word( low, high )

    Packs values into word.

    Returns: 32 bit word with low value in low 16 bits, high value in high 16 bits.

    Category: Low Level Routines

    Typically used to encode a message parameter into a 32 bit word.

    Example:

          -- pack min and max into parameter 
          integer y 
          lParam = pack_word( min, max ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, peek_string, releaseDC, sendMessage, setTimer, store


    paste( object )

    Paste text from the clipboard to object.

    Category: Edit Control

    Example:

              -- paste text from clipboard to TheTextEdit 
              paste( TheTextEdit ) 
    

    See Also: clear, copy, cut, undo


    peek_string( address )

    Get sequence from address holding C-style string.

    Returns: Sequence containing the C-style string.

    Category: Low Level Routines

    This is typically done automatically by the fetch function.

    Example:

          -- get a C-string from address 
          sequence s 
    

    s = peek_string( address )

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, releaseDC, sendMessage, setTimer, store


    PictureButton

    Command button with graphic control.

    Category: Controls

    A PictureButton is a PushButton with a graphic instead of text. The graphic can be specified by passing the name or address of a bitmap control in the flags parameter, or with setBitmap, setIcon or setPixmap.

    A PictureButton is typically used in a ToolBar.

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_PUSHBUTTON: button style is pushbutton
  • BS_BITMAP: displays a bitmap
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    Pixmap

    Color bitmap.

    Category: Controls

    A Pixmap is an off-screen color bitmap. It can be displayed in a window by using one of the bitblt functions (see Graphics for details).

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    playSound( wave file )

    Play the .WAV file.

    Returns: True if succeeds, False if fails.

    Category: Utilities

    This is a wrapper around the Win32 PlaySound command.

    See Also: abortErr, abs, findKey, setWarning, shellExecute, warnErr


    Popup

    Popup menu control.

    Category: Controls

    A Popup is a menu not attached to a window. To display a popup, use popup().

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    popup( popupMenu, x, y )

    Display popupMenu at { x, y }.

    Category: Attributes

    Example:

    -- create a popup for MyWindow constant MyPopup = create( Popup, "", MyWindow, 0, 0, 0, 0, 0 )

    -- add four items into it constant Item1 = create( MenuItem, "Item 1", MyPopup, 0, 0, 0, 0, 0 ), Item2 = create( MenuItem, "Item 2", MyPopup, 0, 0, 0, 0, 0 ), Item3 = create( MenuItem, "Item 3", MyPopup, 0, 0, 0, 0, 0 ), Item4 = create( MenuItem, "Item 4", MyPopup, 0, 0, 0, 0, 0 )

    -- popup the menu at {10,10} in MyWindow popup( MyPopup, 10, 10 )

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    Printer

    Handle to the printer.

    Category: Controls

    The Printer refers to the selected printer. Before it can be used, you must first select a printer using getPrinter. After you are done printing, you should release the Printer with releasePrinter.

    Each document should be begin and end with a startDoc and endDoc pair. Likewise, each page should begin and end with a startPage and endPage pair.

    For the sake of space, the example doesn't use the values returned by getPrinter.

    Example:

        -- example of using printer 
        sequence result 
        atom ok 
    

    -- select the printer result = getPrinter()

    -- did the user select a printer? if length( result ) then

    -- start a new document if not startDoc( sprintf( "My Job, Copy %s", {i} ) ) then exit end if

    -- start a new page if not startPage() then exit end if

    -- print on the page wPuts( Printer, "Hello, Printer!" )

    -- close the page if not endPage() then exit end if

    -- close the document if not endDoc() then exit end if

    -- release the printer releasePrinter()

    end if

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    PushButton

    Command button control.

    Category: Controls

    A PushButton is a normal push button (sometimes called command button). A PushButton has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_PUSHBUTTON: button style is pushbutton
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    Radio

    Radio button control.

    Category: Controls

    A Radio is similar to a CheckBox, in functionality. Like a checkbox, it can be toggled on and off. However, radio buttons are grouped controls - if one is toggled on, the rest in the group are toggled off.

    Win32Lib considers a radio button in a group if they are contained by the same Group control. If there is no Group control, then all the radio buttons are considered to belong to the same group.

    A Radio has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_AUTORADIOBUTTON: radio button control
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    releaseDC( control )

    Release the device context of the control.

    Category: Low Level Routines

    The DC should have been obtained with getDC.

    If the control is not a Pixmap or DIB, and the DC was obtained during an onPaint event, there is no need to release the DC. Win32Lib will automatically release all DCs obtained during an onPaint there is no need to release the DC, since Win32Lib will release all the DCs at the end of supposed to have the DC, there is no need to release it.

    If the control is the Printer, there is no need to release the DC using releaseDC. Instead, use releasePrinter

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, sendMessage, setTimer, store


    releaseMouse()

    Return control of the mouse to Windows.

    Category: Mouse

    This is called after captureMouse to put control of the mouse back to normal.

    Example:

              -- release the mouse. 
              releaseMouse() 
    

    See Also: captureMouse, createMousePointer, setMousePointer


    releasePrinter()

    Release the Printer, freeing it up for others to use.

    Category: Printing

    The Printer must first be grabbed with getPrinter.

    Refer to Printer for details.

    See Also: endDoc, endPage, getPrinter, startDoc, startPage


    repaintRect( window, x1, y1, x2, y2 )

    Force window to be partially repainted.

    Category: Graphics

    This sends repaints a the specified portion of the window with the background color, erasing that portion of it. It then triggers an onPaint event for that window, passing the erased area as parameters.

    Example:

          -- repaint only a portion of MyWindow 
          repaintRect( myWindow, 1, 1, 10, 10 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    repaintWindow( window )

    Force window to be entirely repainted.

    Category: Graphics

    This repaints the entire window in it's background color, effectively erasing everything in it. It then triggers an onPaint event for that window, requesting that the entire window be repainted.

    Example:

          -- force MyWindow to be repainted 
          repaintWindow( myWindow ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    returnValue( value )

    Override default value returned by handler.

    Category: Events

    This allows you to override the value an event handler returns to Win32. By default, when an event is processed, it goes through these steps:

  • onEvent: If there is an onEvent handler for this control, it is passed the event.
  • Event Trap: If there is a specific handler for this event, that handler is triggered. For example, WM_SETFOCUS triggers onGotFocus, WM_SIZE triggers onResize, etc.
  • Default Windows Handler: Finally, the default Window handler for the control is called. In the case of subclassed controls, CallWindowProc calls the normal handler; for windows, DefWindowProc is called.

    Setting returnValue causes processing to stop at the step that the value was set in, and return that value to Windows.

    Example: (not tested yet!)

              -- prevent Button1 from seeing any space bar keys 
              procedure Button1_KeyDown( int keycode, int shift ) 
                  if keycode = VK_SPACE then 
                      -- set return value 
                      returnValue( True ) 
                  end if 
              end procedure 
              onKeyDown[ Button1 ] = routine_id("Button1_KeyDown") 
    

    See Also: onChange, onClick, onClose, onDestroy, onDragAndDrop, onEvent, onGotFocus, onKeyDown, onKeyPress, onKeyUp, onLostFocus, onMouse, onOpen, onPaint, onResize, onScroll, onTimer


    rgb( red, green, blue )

    Convert a {red, green, blue} tuple into a color.

    Returns: Atom representing the color tuple.

    Category: Graphics

    Converts the red, green and blue values (ranging from 0-255) into an atom representing that color tuple. Each value represents the relative brightness of each primary color element.

    Example:

          -- set the pen color to a random green 
          setPenColor( MyControl, rgb( 0, 0, rand( 255 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    RText

    Right-justified label control.

    Category: Controls

    An RText control does not respond to events.

    An RText has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • ES_RIGHT: right justify the text

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    Screen

    Identifes the screen.

    Category: Controls

    The Screen refers to the computer screen. It is automatically created, and it most graphic methods that work in Windows will also work with the screen.

    Example:

              -- Draw an 'x' across the screen 
              sequence extent 
    

    -- get the screen extent extent = getExtent( Screen )

    -- set the pen color to red setPenColor( Screen, Red )

    -- draw the lines drawLine( Screen, 0, 0, extent[1], extent[2] ) drawLine( Screen, extent[1], 0, extent[2], 0 )

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    sendMessage( control, command, wParam, lParam )

    Send a Win32 message to the requested control.

    Returns: Win32 result code.

    Category: Low Level Routines

    This just converts the control id into a handle and calls SendMessage.

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, setTimer, store


    seq( s )

    Same as the declaration sequence().

    Returns: True if i is a sequence.

    Category: Types

    See Also: int


    setBackColor( window, color )

    Set the color for used for the pen fill color in window.

    Category: Graphics

    Note: At best, this function is a misnamed, and it's probably no event longer in use. When the pen mode is set to OPAQUE, this specifies the color used to fill the 'gaps'.

    However, Win32Lib doesn't directly support these pen modes, so it's not clear that this function even needs to exist. Further, it's often confused with setWindowBackColor.

    Example:

              -- set pen opaque color 
              setTextColor( TheWindow, Red ) 
              wPuts( TheWindow, "This text is in red" ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    setBitmap( object, bitmap )

    Assign an icon to object.

    Category: Attributes

    Object can be one of the following:

  • Bitmap
  • PictureButton
  • TogglePicture

    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 
              setIcon( PictureButton1, "close.bmp" ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setCheck( object, checked flag )

    Check or uncheck object.

    Category: Attributes

    This works for Menus and MenuItems as well as toggle controls such as Radio, CheckBox and ToggleButton.

    Example:

              -- set a check on the SyntaxColoring option 
              setCheck( SyntaxColoring, True ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setDefaultFont( id )

    Set the font to default system font.

    Category: Fonts

    Example:

          -- restore MyWindow to the default font 
          setDefaultFont( MyWindow ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    setEnable( object, visible flag )

    Enable or disable object.

    Category: Attributes

    Example:

              -- disable TheButton 
              setEnable( TheButton, False ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setFocus( id )

    Set the focus to the specified window or control.

    Category: Attributes

    This will cause the window or control that currently has focus to lose it.

    The window or control losing focus will get an onLostFocus event, and the window or control that is getting focus will get an onGotFocus event.

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setFont( object, font name, point size, attributes )

    Set the font for a control or window.

    Category: Fonts

    The attributes flag can be a combination of the following:

  • Normal
  • Bold
  • Italic
  • Underline
  • Strikeout

    For example:

          -- change the font in MyWindow 
          setFont( MyWindow, "Arial", 10, Bold+Italic ) 
          wPuts( MyWindow, "This is Arial 10 point bold italic." ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    setHint( control, text )

    Set the tooltip text for a control.

    Category: Attributes

    If the mouse stays still over a control that has tooltip text associated with it, a small window displaying the tooltip text will appear.

    Any control that can get mouse events can have tooltips associated with it, although it tends to work best with PictureButtons, typically in the ToolBar.

    Setting the text to "" effectively removes the tooltip.

    Example:

          -- set hint for CloseButton 
          setHint( CloseButton, "Closes the window" ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setIcon, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setHintFont( font, point size, attributes )

    Set font type and size for the control's hints.

    Category: Fonts

    Default values are { "MS Sans Serif", 8 points, Normal }.

    Example:

       setHintFont( "Times New Roman", 10, Bold) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    setIcon( object, icon )

    Assign an icon to object.

    Category: Attributes

    Object can be one of the following:

  • Window
  • Icon
  • PictureButton
  • TogglePicture

    If icon is a sequence, it will be assumed to be the name of an icon file, and Win32Lib will attempt to load the icon.

    Otherwise, icon is assumed to be the handle of an icon.

    Example:

              -- assign an icon to the window 
              setIcon( TheWindow, "euphoria.ico" ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setPixmap, setText, setVisible, setWindowBackColor, WinMain


    setIndex( list, index )

    Set the selected item on the list to index.

    Category: List Control

    Use 0 to set the index to 'unselected.'

    Example:

              -- select the first item on the list 
              integer result 
    

    result = setIndex( TheList, 1 )

    See Also: addItem, deleteItem, eraseItems, getCount, getIndex, getItem, insertItem


    setMousePointer( control, pointer )

    Set the pointer the mouse displays when in control.

    Category: Mouse

    The default mouse pointer displayed is the ArrowPointer, except for TextEdit and MleEdit controls, which use the IBeamPointer.

    The pointer can either be a system pointer, or one created with the createMousePointer function.

    System mouse pointers are:

  • Null: Use default pointer
  • ArrowPointer: Standard arrow
  • IBeamPointer: Text I-Beam
  • WaitPointer: Hourglass
  • CrossPointer: Crosshair
  • UpArrowPointer: Vertical arrow
  • SizeNWSEPointer: Double-pointed arrow pointing northwest and southeast
  • SIZENESWPointer: Double-pointed arrow pointing northeast and southwest
  • SizeWEPointer: Double-pointed arrow pointing west and east
  • SizeNSPointer: Double-pointed arrow pointing north and south
  • SizeAllPointer: Same as SizePointer
  • NoPointer: Slashed circle
  • AppStartingPointer: Standard arrow with small hourglass
  • IconPointer: Four-pointed arrow

    Example:

              -- Change mouse pointer in MyWindow to CrossPointer 
              setMousePointer( MyWindow, CrossPointer ) 
    

    See Also: captureMouse, createMousePointer, releaseMouse


    setPenBkMode( window, mode )

    Determines if the background color for lines and text.

    Category: Graphics

    Modes are:

  • OPAQUE: Draws using background color.
  • TRANSPARENT: Draws without background color.

    If mode is OPAQUE, the color set in setBackColor is used. The default mode is TRANSPARENT.

    Example:

              -- draw an XOR line in TheWindow 
              setPenROP2( TheWindow, R2_XORPEN )            
              drawLine( TheWindow, 10, 10, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    setPenColor( window, color )

    Set the the pen color used in window.

    Category: Graphics

    This is the color that is used by other graphics routines.

    To set the color of text, use setTextColor.

    Example:

              -- set pen color to red 
              setPenColor( TheWindow, Red )         
              -- draw a red line 
              drawLine( TheWindow, 10, 10, 40, 40 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    setPenROP2( window, code )

    Determines what mode graphics are drawn in.

    Category: Graphics

    The default value is R2_COPYPEN. The ROP2 codes are:

  • R2_BLACK: Pixel is always 0.
  • R2_NOTMERGEPEN: Pixel is the inverse of the R2_MERGEPEN color.
  • R2_MASKNOTPEN: combination common screen and inverse of pen.
  • R2_NOTCOPYPEN: Pixel is the inverse of the pen color.
  • R2_MASKPENNOT: combination common to pen and inverse of screen.
  • R2_NOT: Pixel is the inverse of the screen color.
  • R2_XORPEN: Pixel is the inverse of the R2_XORPEN color.
  • R2_NOTMASKPEN: Pixel is the inverse of the R2_MASKPEN color.
  • R2_MASKPEN: combination common to pen and the screen.
  • R2_NOTXORPEN: combination of colors in pen and screen, but not in both.
  • R2_NOP: Pixel remains unchanged.
  • R2_MERGENOTPEN: combination of screen and inverse of pen.
  • R2_COPYPEN: Pixel is the pen color.
  • R2_MERGEPENNOT: combination of pen color and inverse of screen color.
  • R2_MERGEPEN: combination of pen color and the screen color.
  • R2_WHITE: Pixel is always 1.

    Example:

              -- draw an XOR line in TheWindow 
              setPenROP2( TheWindow, R2_XORPEN )            
              drawLine( TheWindow, 10, 10, 100, 100 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenStyle, setPenWidth, setPixel, textToBitmap, transBlt


    setPenStyle( window, color )

    Set the style that lines are drawn in.

    Category: Graphics

    This allows the creation of various dotted line styles. Use setBackColor to define the background fill used on the line.

    The following styles are defined:

  • Solid
  • Dash
  • Dot
  • DashDot
  • DashDotDot

    Note: This routine will probably be dropped in later releases.

    Example:

              -- set pen style 
              setPenStyle( TheWindow, Dot )            
    

    -- draw a line using that pen style drawLine( TheWindow, 10, 10, 100, 100 )

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenWidth, setPixel, textToBitmap, transBlt


    setPenWidth( window, pixel width )

    Set the the pen width used in window.

    Category: Graphics

    The default thickness of the pen is 1 pixel.

    Example:

              -- set pen thickness of 3 
              setPenWidth( TheWindow, 3 ) 
              -- draw a thick line 
              drawLine( TheWindow, 10, 10, 40, 40 ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPixel, textToBitmap, transBlt


    setPixel( window, x, y, rgb color )

    Set a pixel value in window's client area.

    Category: Graphics

    Example:

          -- set pixel at {10,10} to Red 
          setPixel( TheWindow, 10, 10, Red ) 
    

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, textToBitmap, transBlt


    setPixmap( pixmap, bitmap )

    Assign a new value to a Pixmap.

    Category: Attributes

    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: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setText, setVisible, setWindowBackColor, WinMain


    setPosition( window, x, y )

    Position the text pen in window.

    Category: Fonts

    Example:

          -- move the pen 
          setPosition( MyWindow, 10, 10 ) 
    

    -- display message wPuts( MyWindow, "This is at {10,10}" )

    Note: There's a good chance this routine name will be changed in a future release to moveTo().

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setTextAlign, setTextColor, wPrint, wPrintf, wPuts


    setScrollChange( scroll, line size, page size )

    Adjust the amount that a scroll control will change.

    Category: Scroll Control

    The line size is the amount that the scroll will adjust when the up/down arrow is selected, and the page size is used when the page up/page down is selected.

    For trackbars, the page size is used to determine the distance between the tick marks.

    The default values are {1,10}.

    Example:

              -- set change amount for TheScroll 
              setScrollChange( TheScroll, 1, 10 ) 
    

    See Also: getScrollChange, getScrollPos, getScrollRange, setScrollPos, setScrollRange


    setScrollPos( scroll, position )

    Sets the value of scroll.

    Category: Scroll Control

    The value must be greater than zero. This will trigger an onScroll event.

    Example:

              -- set value of the TheScroll 
              setScrollPos( TheScroll, 20 ) 
    

    See Also: getScrollChange, getScrollPos, getScrollRange, setScrollChange, setScrollRange


    setScrollRange( scroll, low, high )

    Sets the range of values of scroll.

    Category: Scroll Control

    The low value must be greater than zero.

    The default values are {0,100}.

    Example:

              -- set range for TheScroll 
              setScrollRange( TheScroll, 1, 100 ) 
    

    See Also: getScrollChange, getScrollPos, getScrollRange, setScrollChange, setScrollPos


    setSize( control, cx, cy )

    Resize control to cx x cy.

    Category: Controls

    Example:

              -- size Button1 to 60x32 
              setSize( Button1, 60, 32 ) 
    

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    setText( object, text )

    Set the text in object.

    Category: Attributes

    If the control is editable, it updated the data in the control. Otherwise, it updates the caption text of the control.

    Example:

          -- change the caption of status bar 
          setText( TheStatusBar, "Ready" ) 
    

    Note: This should probably be divided into two seperate functions, setCaption and setData.

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setVisible, setWindowBackColor, WinMain


    setTextAlign( id, style )

    Set the font alignment to use when printing text.

    Category: Fonts

    The default option is AlignTop. Options include:

  • AlignTop: Text is displayed below {x,y}
  • AlignBottom: Text is displayed above {x,y}
  • AlignBaseline: Text is displayed on baseline {x,y}

    Example:

              -- draw a line 
              drawLine( Win, 10, 100, 100, 100 ) 
    

    -- top alignment (default) setTextAlign( Win, AlignTop ) setPosition( Win, 10, 100 ) wPuts( Win, "AlignTop" )

    -- bottom alignment setTextAlign( Win, AlignBottom ) setPosition( Win, 10, 100 ) wPuts( Win, "AlignBottom" )

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextColor, wPrint, wPrintf, wPuts


    setTextColor( window, color )

    Set the text color to use when drawing text in window.

    Category: Fonts

    To set the color of the graphics pen, use setPenColor.

    Example:

              -- draw text in red in TheWindow 
              setTextColor( TheWindow, Red ) 
              wPuts( TheWindow, "This text is in red" ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, wPrint, wPrintf, wPuts


    setTimer( window, timer, ticks )

    Start a timer ticking in window.

    Category: Low Level Routines

    Timers are clocks that are maintained by Windows, and trigger events at a user-specified interval, measured in milliseconds.

    The arguments are:

  • window: Window the timer belongs to.
  • timer: Unique ID assigned to the timer.
  • milliseconds: How much time, in milliseconds, that must pass before triggering an onTimer event.

    To respond to timer events, use onTime. You can have more than one timer per window. If your window is too busy to receive the timer messages, they will be discarded.

    Example:

              -- start a timer with id #12 in MyWindow  
              -- it will trigger every 3 seconds. 
              setTimer( MyWindow, 12, 3000 ) 
    

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, store


    setTransparentColor( color )

    Defines what the transparent color is to be. The parameter can

    Category: XPM

    be an rgb atom, or a sequence in the form {r,g,b}.

    The default color is {255,0,255} (a light pink).

    For routines that create XPMs, this means that the color specified in the XPM as None are rendered using this color.

    The transBlt routine uses this value to determine what color not to render on the destination.

    This routine can also be used to make the transparent color of XPMs match the system color of buttons. This is useful for PictureButtons.

              -- set transparent colors to match button face color 
              setTransparentColor( getSysColor( COLOR_BTNFACE ) ) 
    

    See Also: createXpm, createXpmFromBmpFile, xpmToEuBmp, xpmToPixmap


    setVisible( object, visible flag )

    Make object visible or invisible.

    Category: Attributes

    Example:

              -- make TheButton invisible 
              setVisible( TheButton, False ) 
    

    Note: If object is a Window being made visible, it will trigger an onOpen event. However, if it is a Window being made invisible, it will not trigger any event. This should probably be corrected.

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setWindowBackColor, WinMain


    setWarning( flag )

    Hides warning messages from user.

    Category: Utilities

    Since 'warning' messages (triggered by warnErr) are only warnings and not fatal, it may be advantageous to suppress them in an application.

    Example:

          -- suppress warning messages 
          setWarning( False ) 
    

    See Also: abortErr, abs, findKey, playSound, shellExecute, warnErr


    setWindowBackColor( window, color )

    Sets window to color.

    Category: Attributes

    This is typically used to change the default color of a window. You can use getSysColor to get a default system color. This will trigger an onPaint event.

    Example:

              -- Set the window background color to bright white 
              setWindowBackColor( MyWindow, BrightWhite ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, WinMain


    shellExecute( command, file, style )

    Launch a Windows application

    Category: Utilities

    This is a wrapper around the Win32 ShellExecute command.

    See Also: abortErr, abs, findKey, playSound, setWarning, warnErr


    SimpleCombo

    Simple combo box control.

    Category: Controls

    A SimpleCombo is a combo box with no dropdown. The user can select from various values by using the cursor keys.

    A SimpleCombo has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • CBS_DROPDOWNLIST: has a list of values
  • CBS_HASSTRINGS: contains string values
  • CBS_SIMPLE: probably shouldn't have this attribute
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    SortedCombo

    Sorted combo box control.

    Category: Controls

    A SortedCombo is a combination of an edit control and a list.

    A SortedCombo has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_VSCROLL: attach a vertical scroll bar
  • CBS_DISABLENOSCROLL: allow the user to scroll
  • CBS_DROPDOWN: the list can drop down, like a menu
  • CBS_DROPDOWNLIST: probably shouldn't have this attribute
  • CBS_HASSTRINGS: contains string values
  • CBS_SIMPLE: probably shouldn't have this attribute
  • CBS_SORT: sorted
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    SortedList

    Sorted list control.

    Category: Controls

    A SortedList contains a list of items, arranged in alphabetical order. To have an unsorted list, use the List control instead.

    A SortedList has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • LBS_NOTIFY: notify parent of events
  • LBS_SORT: sort items in list
  • WS_VSCROLL: attach a vertical scroll bar
  • WS_BORDER: draw a border on the control
  • WS_TABSTOP: the control can be tabbed to
  • WS_EX_CLIENTEDGE: 3D effect
  • WS_EX_ACCEPTFILES: drag and drop support

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    startDoc( job name )

    Starts a new document on Printer.

    Returns: True if succeeds.

    Category: Printing

    Start a new document on the Printer. The job name is the name of the job as seen by the system.

    Refer to Printer for details.

    See Also: endDoc, endPage, getPrinter, releasePrinter, startPage


    startPage()

    Prepares the printer to begin a new page.

    Returns: True if succeeds.

    Category: Printing

    Refer to Printer for details.

    See Also: endDoc, endPage, getPrinter, releasePrinter, startDoc


    StatusBar

    Window status bar control.

    Category: Controls

    A StatusBar is a control placed at the bottom of the window that status messages can be written into. The status bar is implemented using the Win32 common control toolbar.

    When the parent window is resized, Win32Lib automatically repositions the StatusBar.

    Note that the status bar occupies space like any other control. To determine what portion of the window's client area is not occupied by the statusbar (and toolbar), use the getClientRect function.

    A StatusBar has the following attributes:

  • CCS_BOTTOM: place on bottom of the window
  • WS_CHILD: child control of parent
  • WS_BORDER: draw a border
  • WS_CLIPSIBLINGS: clip child controls

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    store( structure, field, value )

    Store a value into a structure.

    Category: Low Level Routines

    Type conversion is automatic. For example, if an Lpsz field is used, the value is automatically converted from a sequence to a C-style string, and the address of that string is stored in the structure.

    Note: Strings are allotted using allot_string(), and must be freed using free_string.

    Example:

          -- allocate RECT structure, and populate it 
          atom rect                                   
    

    -- allocate the structure rect = allocate_struct( SIZEOF_RECT )

    -- store values into the structure store( rect, rectLeft, x1 ) store( rect, rectTop, y1 ) store( rect, rectRight, x2 ) store( rect, rectBottom, y2 )

    See Also: address, allocate_struct, allot, allotted_size, fetch, free_strings, getDC, hi_word, killTimer, linkFunc, linkProc, lo_word, or_all, pack_word, peek_string, releaseDC, sendMessage, setTimer


    TabControl

    Tab Control.

    Category: Controls

    A TabControl is a container control. It can have one or more TabItems. Selecting a TabItem in a TabControl activates it, and displays any controls that are associated with it.

    Since the TabControl is a container, controls can be placed into it, just like placing them into a window. However, it becomes the coder's responsibility to show and hide various controls as different TabItems are selected. It is easier to associate controls with TabItems, since Win32Lib will automatically take care of those details.

    The TabControl has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • WS_CLIPCHILDEN: controls not fitting on the TabControl are clipped.
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    TabItem

    Tab on a TabControl.

    Category: Controls

    A TabItem is a tab attached to the top of a TabControl. TabItems respond to being selected by triggering an onClick event.

    Items can be automatically displayed in a TabControl by setting their owner to the TabItem instead of the TabControl. Win32Lib will automatically reparent controls with TabItems to the TabControl, and maintain a logical association between them. For example:

      constant  
        Win     = create( Window, "Testing", 0, Default, Default, 100, 100, 0 ), 
        Tabs    = create( TabControl, "", Win, 10, 10, 80, 80, 0 ), 
        Tab1    = create( TabItem, "Tab Number &1", Tabs, 0, 0, 0, 0, 0 ), 
        Tab2    = create( TabItem, "Tab Number &2", Tabs, 0, 0, 0, 0, 0 ), 
        Button1 = create( PushButton, "Button 1", Tab2, 10, 60, 80, 40, 0 ) 
    

    In the example above, Button1 is created in Tabs (the parent of Tab2). When Tab2 is clicked, it will appear in Tabs at {10,60}. When Tab1 is clicked, it will disappear from Tabs.

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    textToBitmap( text )

    Converts a sequence of text into a monochrome bitmap.

    Returns: Handle to Win32 bitmap, or Null on an error.

    Category: Graphics

    Spaces are converted to White pixels; all other characters are converted to Black pixels.

    Note: This routine should probably be deprecated, or at least renames.

    Example:

              -- create a bitmap, and display it 
              atom hBitmap 
              sequence image 
    

    -- the image image = { " xxxxxx ", "x x", "x x x x", "x x", "x x x x", "x x x x", "x xxxx x", " xxxxxx ",

    -- create the bitmap hBitmap = textToBitmap( image )

    -- display the bitmap in TheWindow at {1,1} drawBitmap( theWindow, hBitmap, 1, 1 )

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, transBlt


    ToggleButton

    Toggle button control.

    Category: Controls

    A ToggleButton is a PushButton that behaves like a CheckBox - clicking it toggles it down, clicking again toggles it back up. It is typically used in a ToolBar.

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_PUSHBUTTON: button style is pushbutton
  • BS_BITMAP: displays a bitmap
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, TogglePicture, ToolBar, TriCheckBox, VScroll, Window


    TogglePicture

    Toggle button with graphic control.

    Category: Controls

    A TogglePicture is a combination of a ToggleButton and a PictureButton. The graphic can be specified by passing the name or address of a bitmap in the flags parameter, or with setBitmap, setIcon or setPixmap.

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_PUSHBUTTON: button style is pushbutton
  • BS_BITMAP: displays a bitmap
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, ToolBar, TriCheckBox, VScroll, Window


    ToolBar

    Window toolbar control.

    Category: Controls

    A ToolBar is a container at the top of a window that can hold other controls - typically PushButtons or ToggleButtons. Toolbars are implemented using the Win32 common control toolbar.

    When the parent window is resized, Win32Lib automatically repositions the ToolBar.

    Note that the toolbar occupies space like any other control. To determine what portion of the window's client area is not occupied by the toolbar (and statusbar), use the getClientRect function.

    A ToolBar has the following attributes:

  • CCS_TOP: place on top of the window
  • CCS_NORESIZE: don't automatically resize (Win32Lib does it)
  • WS_CHILD: child control of parent
  • WS_BORDER: draw a border
  • WS_CLIPSIBLINGS: clip child controls

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, TriCheckBox, VScroll, Window


    transBlt( dst, dstX, dstY, src )

    Copy full image from source to destination, with transparency.

    Category: Graphics

    TransBlt is typically used for displaying non-rectangular bitmaps - sprites. It is a computationally expensive operation; if there is no transparency in your image, you should use copyBlt or bitBlt instead.

    By default, transBlt assumes that the color {255,0,255} is to be treated as transparent. To change the transparent color, use setTransparentColor.

    The arguments are:

  • dst: Image destination
  • dstX: X position in destination
  • dstY: Y position in destination
  • src: Image source

    Note: At the moment, the coordinates are zero relative; this will be changed in later releases. Example:

              -- draw a bitmap using transparency 
              atom hDIB          
              sequence extent 
    

    -- get the size of TheWindow extent = getExtent( TheWindow )

    -- load the bitmap hDib = loadBitmapFromFile( "shuttle.bmp" )

    -- treat the color BrightWhite as transparent setTransparentColor( BrightWhite )

    -- copy multiple images to TheWindow for i = 1 to 20 do transBlt( TheWindow, -- destination rand( extent[1] ), -- x position rand( extent[2] ), -- y position hDib ) -- image to copy end for

    See Also: bitBlt, copyBlt, copyToBitmapFile, createDIB, drawArc, drawBitmap, drawChord, drawEllipse, drawLine, drawPie, drawPolygon, drawRectangle, drawRoundRectangle, getPixel, loadBitmapFromFile, repaintRect, repaintWindow, rgb, setBackColor, setPenBkMode, setPenColor, setPenROP2, setPenStyle, setPenWidth, setPixel, textToBitmap


    TriCheckBox

    Three state checkbox control.

    Category: Controls

    A TriCheckBox is similar to a CheckBox, but it has three states: on, off, or dim.

    A TriCheckBox has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • BS_AUTO3STATE: tri-state check box
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, VScroll, Window


    undo( object )

    Undo last edit in object.

    Category: Edit Control

    Example:

              -- undo last edit in TheTextEdit 
              undo( TheTextEdit ) 
    

    See Also: clear, copy, cut, paste


    VScroll

    Vertical scrollbar control.

    Category: Controls

    A VScroll has the following attributes:

  • WS_CHILD: child control of the parent
  • WS_VISIBLE: it is visible
  • SBS_VERT: vertical scroll bar
  • WS_TABSTOP: the control can be tabbed to

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, Window


    warnErr( message )

    Display an error message, with option to abort.

    Category: Utilities

    Example:

          warnErr( "Bad data. Abort program?" ) 
    

    See Also: abortErr, abs, findKey, playSound, setWarning, shellExecute


    Window

    A Window is a normal Win32 window.

    Category: Controls

    See Also: Bitmap, CheckBox, Combo, CText, DefPushButton, DropDownList, EditText, Group, HScroll, HTrackBar, HTrackBar, Icon, List, LText, Menu, MenuItem, MleEdit, PictureButton, Pixmap, Popup, Printer, PushButton, Radio, RText, Screen, setSize, SimpleCombo, SortedCombo, SortedList, StatusBar, TabControl, TabItem, ToggleButton, TogglePicture, ToolBar, TriCheckBox, VScroll


    WinMain( window, style )

    Run event loop.

    Category: Attributes

    This is the main processing loop for Win32Lib. Call WinMain after all the controls have been declared to run the event loop.

    The main window is set to window. When window is closed, the application is shut down.

    The style flag is one of the following:

  • Normal: Original size.
  • Minimize: Minimized into the task bar.
  • Maximize: Fills screen.
  • Modal: Original size, but no other application window can get focus until this window is closed. Use to emulate modal dialogs.

    The WinMain function will trigger an onOpen event.

    For example:

          -- set TheWindow as main window, open normally 
          WinMain( MyWindow, Normal ) 
    

    See Also: closeWindow, create, getClientPoint, getClientRect, getExtent, getMousePos, getNumber, getSize, getSysColor, getText, isChecked, isEnabled, isScreenPointIn, isVisible, moveWindow, openWindow, popup, setBitmap, setCheck, setEnable, setFocus, setHint, setIcon, setPixmap, setText, setVisible, setWindowBackColor


    wPrint( window, object )

    Equivalent to Euphoria's print() routine.

    Category: Fonts

    window specifies the Window to receive the data.

    For example:

          -- dump s to the window 
          wPrint( MyWindow, s ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrintf, wPuts


    wPrintf( window, format, data )

    Equivalent to Euphoria's printf() routine.

    Category: Fonts

    window specifies the Window to receive the text.

    For example:

          -- show value of a 
          wPrintf( MyWindow, "the value of a is %d", {a} ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPuts


    wPuts( window, text )

    Equivalent to Euphoria's puts() function.

    Category: Fonts

    The window parameter determines what Window will be written to.

    Example:

          -- put text in a window 
          wPuts( MyWindow, "Hello, World!" ) 
    

    See Also: getFontMetric, getFontSize, getTextExtent, setDefaultFont, setFont, setHintFont, setPosition, setTextAlign, setTextColor, wPrint, wPrintf


    xpmToEuBmp( xpm )

    Convert XPM data into a standard Euphoria bitmap.

    Returns: A Euphoria bitmap in a sequence. On failure, an error code.

    Category: XPM

    The error codes are:

  • XPM_ERR_COLORS: Too many colors in bitmap
  • XPM_ERR_HEADER: Error in XPM header
  • XPM_ERR_COLOR: Couldn't translate color code

    See Also: createXpm, createXpmFromBmpFile, setTransparentColor, xpmToPixmap


    xpmToPixmap( xpm )

    Create a Pixmap from XPM data.

    Returns: A Euphoria bitmap, or an error code.

    Category: XPM

    The error codes are:

  • XPM_ERR_COLORS: Too many colors in bitmap
  • XPM_ERR_HEADER: Error in XPM header
  • XPM_ERR_COLOR: Couldn't translate color code

    See Also: createXpm, createXpmFromBmpFile, setTransparentColor, xpmToEuBmp