This documentation is far from being completed or correct!
The name tinEWG means "this is not EuWinGui". tinEWG was born as an extension for EuWinGui, as i tried to improve Designer for EuWinGui.
tinEWG is still under construction and I'am really shure it will be forever. I use it for my own small projects and expand it as i need it myself.
tinEWG is not a replacement for the fullfeatured frameworks like Win32lib or EuGTK or wxWindows, but it is handy for simple Prgrams that don't need a complex GUI.
tinewg is based on ideas of Andrea Cini and his EuWinGui library. I use his documentation of EuWinGui as a starting point for the documentation of tinewg and he kindly gave me the permission to use his work.
Hello Andreas sure you can use the documentation as a starting base for your project. Thanks for keeping reference to my work. Best wishes and good luck| Andrea
As i think it is very Important to have a clear License for any kind of Software
i hereby put this Software under the MIT license.
Copyright (c) <2013> <Andreas Wagner andi@indonesianet.de>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Also tinEWG is mostly compatible to EuWinGui, there are some differences
A simple tinEWG program may look like this
include tinewg.exw Window ("EuWinGUI - The First Program",100,100,290,95) constant button1=Control(Button,"Info",5,10,270,50) SetIcon("T.ICO") procedure clickbutton() InfoMsg("Programmed in Euphoria with the EuWinGUI Library!!","EuWinGUI") end procedure SetHandler (button1,Click,routine_id("clickbutton")) WinMain ()
But for sure, you can also write your code in the default EuWinGui style
include tinewg.exw atom button1 procedure EventLoop() while True do WaitEvent() if Event = Click then if EventOwner = button1 then InfoMsg("Programmed in Euphoria with the EuWinGUI Library!!","EuWinGUI") end if end if end while end procedure procedure Main() Window("EuWinGUI - The First Program",100,100,290,95) button1 = Control(Button,"Info",5,10,270,50) SetIcon("T.ICO") EventLoop() CloseApp(0) end procedure Main()
Or even mix both of the styles (sometimes you have to do this)
include tinewg.exw Window("EuWinGUI - The First Program",100,100,290,95) constant button1 = Control(Button,"Info",5,10,270,50) procedure clickbutton() InfoMsg("Programmed in Euphoria with the EuWinGUI Library!!","EuWinGUI") end procedure SetHandler (button1,Click,routine_id("clickbutton")) procedure EventLoop() while WaitEvent () do ProcessHandlers () end while end procedure procedure Main() SetIcon("T.ICO") EventLoop() CloseApp(0) end procedure Main()
include tinewg.exw public constant TINVERSION
Just a number, can be used to make sure that a specific Version is used, or the Version is not to old for your Software. As of this writing the actual number is 78(hex) I think a real Version 1.0.0 will follow the number FF(hex), if ever.
include tinewg.exw public sequence PosRect
include tinewg.exw public sequence LPRECT
include tinewg.exw public constant True
include tinewg.exw public constant False
include tinewg.exw public constant Null
include tinewg.exw public object Void
include tinewg.exw public integer CloseEventEnabled
initially set to False; if set to True before running the event loop allows the generation of a Close event if the user clicks on a window's default close button; process this Event to perform some actions before the application is finished (and remember to finish it with a call to the CloseApp() procedure to free the resources created by EuWinGUI) or to make a Dialog control invisible in a multiple-windows application
include tinewg.exw public integer UseTransparentPics
(initially set to False; if set to True before using the SetPic() procedure, tells Windows to use the color of the leftmost/topmost pixel of a bitmap loaded from a file as "transparent color": all the occurences of that color inside the image are automatically replaced with the color of the window's surface, so that is possible to load into Picture/ClickPicture/PictureButton controls images with a "transparent" background); Note that this flag has no effect if the bitmap has been created in memory using NewMB()
include tinewg.exw public integer WinOnTop
(initially set to False; set this variable to True before using the Window() procedure if you need to create an always-on-top Main Window)
include tinewg.exw public integer ShowFlag
initially set to True; by default, the Main Window and all controls are shown immediately after their creation. By setting this variable to False BEFORE the creation of the main window or any control it is possible to create them initially hidden. To make them visible it will be necessary to call the SetVisible() EuWinGUI procedure. For example if an application uses many controls the interface's creation could take some time and cause some noisy "flickerings". By setting this variable to False BEFORE using the Window() procedure and resetting it to True BEFORE the creation of the controls, the main window is not shown after its creation and remains hidden until a call to SetVisible(WinHwnd,True) make it visible. This way it is possible to add all the needed controls to the window while it is still hidden and then make it visible only after the interface is completely created and all the settings have been made (i.e. before entering the event loop); this way, no flickerings occur
SetVisible,AnimateWindow,ShowWindow
include tinewg.exw public integer AutoResize
include tinewg.exw public integer UserTrap
include tinewg.exw public atom GameLoop
include tinewg.exw public atom WinHwnd
stores the handle of the Main Window, after it has been created using the Window() procedure, for use with any EuWinGUI function which need a control's handle to work
include tinewg.exw public atom Event
stores the last Event type recorded after returning from the WaitEvent() function
include tinewg.exw public atom EventOwner
stores the handle of the control to which the last Event recorded after returning from the WaitEvent() function belongs
include tinewg.exw public atom EventItem
stores an additional value associated with certain Event types, after returning from the WaitEvent() funtion; for instance stores the char code of the key pressed, once a Key Event has occurred
include tinewg.exw public atom PictureHandle
include tinewg.exw public atom WindowType
initially set to NoMaxWin; use this variable to set the appearance (style) of the Main Window or of a Dialog control before using the Window() procedure or the Control(Dialog,...) function.
include tinewg.exw public constant NoMaxWin
default; window with titlebar, minimize+close buttons and solid frame
include tinewg.exw public constant NoMaxMinWin
window with titlebar, close button only and solid frame
include tinewg.exw public constant NoSysWin
window with titlebar, no active buttons and solid frame
include tinewg.exw public constant NoTitleWin
window without titlebar and solid frame
include tinewg.exw public constant NoBorderWin
flat window without titlebar and border
include tinewg.exw public constant StandardWin
Resizeable Window with titlebar
include tinewg.exw public atom MouseX
(store the pointer's coordinates, relative to the upper-left corner of the control's client area, after the occurrence of a recognized mouse event (i.e. Click, Release, RClick, RRelease, Move if the issuing control is the Main Window or a Dialog, or the Move event only if the control is another type) Note: The Move events generated while one of the mouse buttons is pressed (as well as the Release and RRelease events) and recognized by the Main Window or by a Dialog can be issued when the mouse pointer is phisically out of the owner window's boundaries. Since the values stored into MouseX/Y can range from 0 to 65535 (e.g. no negative values are returned by Windows) and are relative to the upper-left corner of the window's client area, it is not directly possible to know if the mouse has generated the events inside or outside the window's boundaries. However it is possible to know that with a simple check: if MouseX (MouseY) is bigger than the width (height) of the owner's window, it means that the event was surely generated while the mouse was outside the right (bottom) boundary of the window, BUT if MouseX (MouseY) is ALSO greater than the screen's width (height) it means that the event was generated while the mouse pointer was outside the left (top) boundary of the window's client area. Practically, if MouseX (MouseY) returns a value of 65535, it means that the event was generated when the pointer was located 1 pixel left (up) of the beginning of the window's client area, 65534 means it was 2 pixels left (top) and so on.)
include tinewg.exw public atom Ticks
include tinewg.exw public atom FN_DEFAULT
include tinewg.exw public atom FN_FIXED
include tinewg.exw public constant event_names
include tinewg.exw public constant Click
generated by leftclicking a Control/Window
recognized/generated by: ALL windows and controls BUT Group,Picture,Framed/Text,Label
when: one of the specified controls is clicked with the left mouse button; if the control is a window, the Event is generated when the mouse button is pressed, otherwise it is generated when the button is released
include tinewg.exw public constant Move
recognized/generated by: ALL windows and controls BUT Group,Picture,Framed/Text,Label
when: the mouse pointer is moved over the client area of one of the specified controls not covered by others
include tinewg.exw public constant RClick
recognized/generated by: ALL windows and controls BUT Group,Picture,Framed/Text,Label
when: the right mouse button is pressed over a window. Note: by handling this Event it is possible to incidentally break the normal handling procedure of the same event (if any) made by Windows. For example, by intercepting the RClick Event of an Edit field it is possible to prevent the default Cut/Copy/Paste Windows popup menu to be shown. For this reason, particular care must be made if intercepting this Event while the owner control already has an associated default Windows action to perform
include tinewg.exw public constant Time
include tinewg.exw public constant Close
recognized/generated by: Main Window,Dialog when: CloseEventEnabled is set to True, and the user clicks on the window's default close ("X") button
include tinewg.exw public constant HotKey
include tinewg.exw public constant Restore
include tinewg.exw public constant Key
include tinewg.exw public constant DClick
include tinewg.exw public constant Release
recognized/generated by: Main Window,Dialog when: the left mouse button is released after it was pressed over a window
include tinewg.exw public constant RRelease
include tinewg.exw public constant PosChanged
include tinewg.exw public constant CurChange
include tinewg.exw public constant Paint
include tinewg.exw public constant Menu
include tinewg.exw public constant Default
include tinewg.exw public constant Ipc
include tinewg.exw public constant Mci
include tinewg.exw public constant ReSize
include tinewg.exw public constant Button
Simple button with a caption
atom button1=Control(Button,"Button",0,0,80,30)
include tinewg.exw public constant PictureButton
Button showing a custom BMP picture instead of a caption
include tinewg.exw public constant Edit
Editable field with horizontal scrollable text
include tinewg.exw public constant SimEdit
Simple editable field with fixed width text
include tinewg.exw public constant MultiEdit
Multiline editable field with horizontal scrollable text
include tinewg.exw public constant SimMultiEdit
Simple multiline editable field with fixed width text and word wrapping
include tinewg.exw public constant List
Simple list box
atom lbox=Control(List,"",0,0,80,80) ListAdd(lbox,"ListItem 1") ListAdd(lbox,"ListItem 2") [...] ListAdd(lbox,"ListItem n")
include tinewg.exw public constant SortedList
Sorted list box. The Items are automaticlly sorted in this ListBox.
include tinewg.exw public atom RichEdit
include tinewg.exw public atom ToolTip
include tinewg.exw public constant CR_WE
include tinewg.exw public constant CR_NS
include tinewg.exw public constant CR_SIZE
include tinewg.exw public constant CR_VARROW
include tinewg.exw public constant CR_WAIT
include tinewg.exw public constant CR_NULL
include tinewg.exw public constant CR_HELP
include tinewg.exw public constant X_DIM
include tinewg.exw public constant Y_DIM
include tinewg.exw public constant KEY_ENTER
include tinewg.exw public constant KEY_BACKSPACE
include tinewg.exw public constant KEY_ESCAPE
include tinewg.exw public constant KEY_DOWN
include tinewg.exw public constant KEY_UP
include tinewg.exw public constant KEY_LEFT
include tinewg.exw public constant KEY_RIGHT
include tinewg.exw public constant KEY_CLEAR
include tinewg.exw public constant KEY_PAUSE
include tinewg.exw public constant KEY_CAPSLOCK
include tinewg.exw public constant KEY_PGUP
include tinewg.exw public constant KEY_PGDN
include tinewg.exw public constant KEY_END
include tinewg.exw public constant KEY_HOME
include tinewg.exw public constant KEY_INS
include tinewg.exw public constant KEY_DEL
include tinewg.exw public constant KEY_FUNC01
include tinewg.exw public constant Save
include tinewg.exw public constant Open
include tinewg.exw public constant CL_WHITE
include tinewg.exw public constant CL_GRAY
include tinewg.exw public constant CL_DKGRAY
include tinewg.exw public constant CL_BLACK
include tinewg.exw public constant CL_YELLOW
include tinewg.exw public constant CL_DKYELLOW
include tinewg.exw public constant CL_RED
include tinewg.exw public constant CL_DKRED
include tinewg.exw public constant CL_GREEN
include tinewg.exw public constant CL_DKGREEN
include tinewg.exw public constant CL_CYAN
include tinewg.exw public constant CL_DKCYAN
include tinewg.exw public constant CL_BLUE
include tinewg.exw public constant CL_DKBLUE
include tinewg.exw public constant CL_PURPLE
include tinewg.exw public constant CL_DKPURPLE
include tinewg.exw public constant CL_DEFAULT
include tinewg.exw public atom PressedKey
include tinewg.exw public atom EraseBkg
include tinewg.exw public sequence TrappedMsg
include tinewg.exw public atom MessageBoxReturnValue
include tinewg.exw public atom WinBackGround
include tinewg.exw public atom ParentWnd
include tinewg.exw public atom SpecialMode
include tinewg.exw public sequence DefaultPrinter
include tinewg.exw public constant Designer
include tinewg.exw public constant NoDesigner
include tinewg.exw public constant gDesigner
include tinewg.exw public atom ctlEvent
include tinewg.exw public atom ctlEventOwner
include tinewg.exw public atom ctlEventItem
include tinewg.exw public bool NoVisualStyles
include tinewg.exw WinBackGround
Sets the Color of the Window and Dialog Backgrounds, must be between 0 to 31 must be set before the main Window is created You can also set WinBackGround to any other Brush. e.g. WinBackGround=c_func(myCreateSolidBrush,{#00F0F0F0})
include tinewg.exw public bool DialogIsChild
Set the creation behavior of Dialog Windows. Dialog as Child is the standardway in the original EWG
include tinewg.exw public bool DialogIsRealChild
include tinewg.exw public sequence tinEWGApp
The Classname of the Main Window. You can change this as you like it
include tinewg.exw public constant rs_mode_non
include tinewg.exw public function LoWord(atom dword)
include tinewg.exw public function HiWord(atom dword)
include tinewg.exw public procedure SetRtl()
include tinewg.exw public constant MCI_Alias
include tinewg.exw public function ShortFileName(sequence filename)
include tinewg.exw public function MCI_SendString(sequence command, object answer = 0, atom size = 0, atom handle = WinHwnd)
include tinewg.exw public function MCI_Stop(flatsequence device = MCI_Alias)
include tinewg.exw public function MCI_Pause(flatsequence device = MCI_Alias)
include tinewg.exw public function MCI_Play(flatsequence device = MCI_Alias)
include tinewg.exw public function MCI_Close(flatsequence device = MCI_Alias)
include tinewg.exw public function MCI_Set(flatsequence command, sequence device = MCI_Alias)
include tinewg.exw public function MCI_Get(flatsequence command, sequence device = MCI_Alias)
include tinewg.exw public function MCI_Volume(flatsequence percent, sequence device = MCI_Alias)
include tinewg.exw public function MCI_Seek(flatsequence pos, sequence device = MCI_Alias)
include tinewg.exw public function MCI_Open(sequence filename, sequence device = "auto", sequence alias = MCI_Alias)
include tinewg.exw public procedure PlaySnd(sequence filename)
Plays a wave (.WAV) sound. To stop a playing wave sound, use StopSnd() (see below). By starting playing a new sound while another is still in execution will cause the old one to stop and be replaced by the newer one. Note that Windows allows playing wave sound only if they can fit into the system's physical memory, so it is not recommended to play extremely large files. Note also that if the wave file passed as argument doesn't exist, the default Windows "error" sound is played. [sequence wavfile] is the complete pathname of the wave (.WAV) file to play
This function is not compatible with the MCI_* functions!(it does not Play a Sound opend with MCI_Open() etc.)
include tinewg.exw public procedure StopSnd()
Stops an actually playing Wavefile started with PlaySnd.
This function is not compatible with the MCI_* functions! (It does not stop a Sound startet with MCI_Play() etc.)
include tinewg.exw public procedure SetOpacity(atom handle = WinHwnd, atom opag = 50)
include tinewg.exw public procedure SetOpacityRGB(atom handle = WinHwnd, atom opag = 0)
A very simple attempt for IPC(Inter Program Communication)
include tinewg.exw public atom IPC_FRIEND
After a IPC event is received, this stores the Windowhandle of the sending Window you can use this handle to send Data to this Window.
Event IPC
include tinewg.exw public function IPC_RecString()
include tinewg.exw public procedure IPC_Ack(atom friend = IPC_FRIEND)
include tinewg.exw public procedure IPC_SendString(object target, sequence data)
include tinewg.exw public function GetDesktopWindow()
include tinewg.exw public function CallWindowProc(atom wndproc, atom hwnd, atom msg, atom wParam, atom lParam)
include tinewg.exw public function SetWindowLong(atom hwnd, atom index, atom newlong)
include tinewg.exw public function GetWindowLong(atom hwnd, atom index)
include tinewg.exw public function IsIconic(atom handle)
Determines whether the specified window is minimized (iconic).
f the window is iconic, the return value is nonzero.
If the window is not iconic, the return value is zero.
include tinewg.exw public function IsZoomed(atom handle)
Determines whether a window is maximized.
If the window is zoomed, the return value is nonzero.
If the window is not zoomed, the return value is zero.
include tinewg.exw public function IsWindowVisible(atom handle)
Determines the visibility state of the specified window.
If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, the return value is zero.
This does not mean you can see the Window. It just means that the Window has the WS_VISIBLE style set
It is possible that this Window is hidden by other windows.
include tinewg.exw public function CreateBrush(atom color)
include tinewg.exw public function EnumWindows()
include tinewg.exw public procedure CopyImageToClipboard(atom bitmaphandle)
include tinewg.exw public procedure CopyTextToClipboard(sequence text)
include tinewg.exw public function CreateMenu()
include tinewg.exw public function CreatePopupMenu()
include tinewg.exw public function DrawMenuBar(atom handle)
include tinewg.exw public function TrackPopupMenu(atom menuhandle, atom xpos, atom ypos, atom handle, atom flag = False)
include tinewg.exw public function ConnectMenu(atom handle, atom menuhandle)
include tinewg.exw public function DestroyMenu(atom handle)
include tinewg.exw public procedure AppendTextItem(atom menuhandle, atom id, object itemtext)
include tinewg.exw public function AppendSeparator(atom menuhandle)
include tinewg.exw public function AppendPopup(atom menuhandle, atom popuphandle, object itemtext)
include tinewg.exw public procedure EnableItem(atom menuhandle, object id, atom flag)
include tinewg.exw public procedure RedrawWindow(atom handle)
include tinewg.exw public function AnimateWindow(atom handle, atom time1, atom ShowFlags)
include tinewg.exw public function SetTimer(atom ident, atom time1, atom tproc)
include tinewg.exw public procedure keybd_event(integer vk, integer scan, integer extended)
Extentedkey = 1 ;keyup = 2 ;keydown = 0 : or_all,scan should be zero
include tinewg.exw public procedure showDesktop()
Press left Windowskey + d
include tinewg.exw public function KillTimer(atom ident)
include tinewg.exw public procedure Sleep(atom milliseconds)
Win32api Sleep function, same like the Euphoria sleep() just call it with milliseconds instead of seconds
include tinewg.exw public procedure ShowWindow(atom handle, atom style)
Win32api, style is one of the SW_ constants (like SW_SHOWNORMAL etc.) shows or hides a control or window
include tinewg.exw public function MessageBox(atom hwnd, sequence text, sequence title, sequence style)
include tinewg.exw public function GetSystemMetrics(atom index)
include tinewg.exw public function FindWindow(object name, object class = 0)
include tinewg.exw public procedure SetWindowTheme(atom handle, object ParamA = 0, object ParamB = 0)
This is (right now) only useful for switching Themes off!
Call it with anything for paramA and paramB switches the Theme off
include tinewg.exw public function SendMessage(atom hwnd, atom msg, atom wparam, atom lparam)
include tinewg.exw public function PostMessage(atom hwnd, atom msg, atom wparam, atom lparam)
include tinewg.exw public function SetFocus(atom handle)
include tinewg.exw public function LoadIcon(atom hinstance, object string)
include tinewg.exw public function LoadImage(atom myinstance, object name, atom ptype, atom width, atom height, atom flags)
include tinewg.exw public procedure SetClientRect(atom handle, atom xsize, atom ysize)
Resizes a Windows Clientarea to the desired size. The Windowsize will be expanded fit the desired size of the clientarea. SetClientRect(WinHWnd,640,480) will expand an allready exsisting Window, so the Clientarea has a size of 640x480
include tinewg.exw public function GetClientRect(atom hwnd)
include tinewg.exw public function GetWindowRect(atom hwnd)
include tinewg.exw public function GetChildFromPoint(atom handle, atom x, atom y)
include tinewg.exw public procedure sb_SetParts(atom hwnd, sequence coord)
include tinewg.exw public procedure sb_SetText(atom hwnd, sequence text, atom part = 0)
include tinewg.exw public procedure sb_SetIcon(atom hwnd, atom handle, atom part = 0)
include tinewg.exw public procedure ColorSelection(atom handle, atom colour)
include tinewg.exw public procedure SetTextColor(atom handle, atom colour)
include tinewg.exw public procedure SetSelection(atom handle, integer start = 0, integer ende =(- 1))
include tinewg.exw public procedure HideSelection(atom handle, integer hide = True)
include tinewg.exw public procedure ReplaceSelection(atom handle, flatsequence text)
include tinewg.exw public function GetSelection(atom handle)
include tinewg.exw public function GetCharFromPos(atom handle, integer xpos, integer ypos)
Gets information about the character closest to a specified point in the client area of an edit control. Returns the zero-based index of the char.
include tinewg.exw public function LineFromChar(atom handle, integer char = - 1)
Gets the index of the line that contains the specified character index in a multiline edit control. A character index is the zero-based index of the character from the beginning of the edit control. (-1) indicates that the current line will be returned Return value The return value is the zero-based line number of the line containing the character index specified by wParam.
include tinewg.exw public function LineIndex(atom handle, integer line = - 1)
Gets the character index of the first character of a specified line in a multiline edit control. A character index is the zero-based index of the character from the beginning of the edit control. (-1) specifies the current lineReturn value The return value is the character index of the line specified in the wParam parameter, or it is –1 if the specified line number is greater than the number of lines in the edit control.
include tinewg.exw public function LineLength(atom handle, atom char = - 1)
Retrieves the length, in characters, of a line in an edit control. You can send this message to either an edit control or a rich edit control.Return value For multiline edit controls, the return value is the length, in TCHARs, of the line specified by the wParam parameter. For ANSI text, this is the number of bytes; It does not include the carriage-return character at the end of the line. For single-line edit controls, the return value is the length, in TCHARs, of the text in the edit control.
include tinewg.exw public function FindText(atom handle, sequence text, integer start = 0, integer ende = - 1, atom wholeword = 1)
include tinewg.exw public function edt_GetLine(atom handle, atom linenumber)
Get a line of text from an edit or richedit control
include tinewg.exw public function edt_GetLineCount(atom handle)
Get linecount from an edit or richedit control
include tinewg.exw public function edt_GetActLine(atom handle)
Get first visible line in an edit or richedit control
include tinewg.exw public procedure edt_GotoLine(atom handle, atom line)
Scroll to a specific line in a edit or richedit control
include tinewg.exw public procedure tt_AddTool(atom tip, atom handle, sequence text, atom width = - 1)
Add a ToolTip, if width is set to -1 then a single line tooltip will be created
include tinewg.exw public procedure AddToolTip(atom handle, sequence text, atom width = - 1)
include tinewg.exw public procedure SetIconToolTip(atom handle, atom icon = 5, sequence text = "Info")
include tinewg.exw public procedure SetGroup(object handle, atom group)
include tinewg.exw public procedure ctlSetResize(atom handle, atom modus)
Sets the mode for resizing for a control
new Function for controlling the AutoResizing of controls
avaible modes are:
rs_mode_full does a full resize of the control (you may also use True)
rs_mode_non does not any resizing on the control (you may also use False)
rs_mode_pos does only change the start position of the control
rs_mode_size does only change the size of the control
include tinewg.exw public function GetTrappedMessage()
This low-level function is reserved to Programmers who already have a good knowledge of Windows low-level programming and can be safely ignored by casual Users of the library. It resets the UserTrap variable to False and returns a 4-element sequence containing the data (hwnd,message,wParam,lParam) stored and associated with the latest "trapped" Windows message (see the TrapMessage() procedure below) so that the message itself can be handled appropriately into the application's EventLoop() procedure and processed as needed as if it was one of the default EuWinGUI Events.
This is only here to stay compatible to EuWinGui.
SetWindowLong,GetWindowLong,TrapMessage
include tinewg.exw public procedure TrapMessage(atom msg)
include tinewg.exw public procedure SetDrawingProc(atom control, atom id)
include tinewg.exw public function NewFont(sequence fontname, integer fontsize, atom bold, atom italic, atom underlined)
Creates and loads a new font type for use on EuWinGUI controls and drawing procedures, according to the given argument values and returning its handle. The SetFont() and SetDrawingFont() procedures can use the returned handle to set the newly created font on any control or to set it for use with the following calls to the DrawString() drawing procedure. "fontname" is the name of the font to use, fontsize is the dimension of the new font to create and bold, italic and underlined are self-descriptive style flags to set to True whenever the new font must be created with any of those styles "on".
the Operating System will create a font in any case, but IF the specified font, size, or styles are not ALL available at the same time on the system where the application is run, the font type will be created just according to the closest font, size, and styles available. For this reason, it is perfectly possible that a font is created using even a different fontname from the one you specified if, for instance, the fontname you specified is present into the system where your application is run but the size or style attributes you need are not available. Be sure that the font and attributes you want to use are available on the systems where your application is run! Note also that Windows could prevent to set some font types (generally the most "elaborated" ones) on certain control types if they were succesfully created.
times1 = NewFont("Times New Roman", 16, True,False,False) SetFont(Button01,times1)
will create a new bold font type using "Times New Roman" as base font type and 16 point size and then will use it on "Button01" control. The font will be created exactly with the specified charachteristics, only if it is present on the system where the program is run.
[sequence fontname] is the name of the font to use
[integer fontsize] is the size of the font to create
[atom bold,italic,underlined] flags to set to True or False according to the style needed for the new font
include tinewg.exw public function ChooseFont()
Displays the standard System DialogBox for choosing a Font. ChooseFont returns a 5-Element sequence. You can pass this elements to NewFont() to create the font. If the call fails (the user has closed the Dialog without choosing a font) then all elements of the sequence are 0. It's up to you to catch this situation.
include tinewg.exw sequence f,rect atom textfont Window("ChooseFont Demo") atom b1=Control(Button,"ChooseFont",0,0,80,30) rect=GetClientRect(WinHwnd) atom text=Control(Label,"",0,30,rect[3],rect[4]-30) procedure b1click() f=ChooseFont() if sequence(f[1]) then textfont=NewFont(f[1],f[2],f[3],f[4],f[5]) SetFont(text,textfont) else SetFont(text,FN_DEFAULT) end if SetText(text,"Hallo Welt") end procedure SetHandler(b1,Click,routine_id("b1click")) WinMain()
include tinewg.exw public function NewMB(atom width, atom height)
Creates a new Memory Bitmap with the specified dimensions, filled with the color specified by the last call to the SetPenColor() procedure, and returns its handle. A Memory Bitmap can be used exactly as a bitmap loaded from a file. It can be loaded onto a Picture-class control using the SetPic() procedure.
[atom width, heigth] set the width and heigth of the new Memory Bitmap
include tinewg.exw public procedure SetPenCol(atom colorpen)
This extends EuWinGui so you can only set the Pen(for Borders and Lines)
SetPenCol(CL_RED) SetBrushCol(CL_RED)
Is equal to
SetPenColor(CL_RED)
include tinewg.exw public procedure SetBrushCol(atom colorpen)
This extends EuWinGui so you can only set the Brush(for filling)
SetPenCol(CL_RED) SetBrushCol(CL_RED)
Is equal to
SetPenColor(CL_RED)
include tinewg.exw public procedure SetPenColor(atom colorpen)
EuWinGui seems to handle only one Color for Pen and Brush so we simulate this here This function should works as expected for EuWinGui.
Sets the color which will be used by EuWinGUI with all the following drawing procedures until a new call to this procedure will change it. The default color is black, but it is possible to draw using any color. The basic 16 Windows colors are predefined by EuWinGUI and can be used as argument of this procedure (see Appendix D for the complete list of EuWinGUI predefined colors and their hexadecimal values), however, in case a specific color is needed, it is possible to pass it as a hexadecimal RGB value according to the format #bbggrr (where bb, gg, rr are values ranging from #00 to #FF (decimal 0 to 255) and defining the quantity and proportion of blue, green and red which will form the desired color). Note however that depending on the system's settings where your application is run (for example if you are using a screen color depth of 65536 colors, e.g. 16 bit), it is very possible that a given color is not available; in that case, the closest color among the available ones will be automatically used by the operating system. Note that it is possible to check which color was actually used by drawing a point or a line on a bitmap and retrieveing its true color using the GetPixelColor() function.
For example SetPenColor(CL_RED) will set the color of all the following drawings to the standard Windows red color, while SetPenColor(#E0E0E0) will set the pen color to a custom light gray.
[atom color] is the hexadecimal value defining the color which will be used by all the following drawing procedures
include tinewg.exw public procedure SetPenSize(atom size)
Sets the width, in pixels, of the lines that will be drawn by DrawLine(), DrawMultiLine() and DrawPolygon() procedures, until a new call to this procedure will change it. Width must be comprised between 1 and 50; the default value is 1.
[atom width] is the desired width of the lines drawn by the line-drawing procedures
include tinewg.exw public procedure DrawPolygon(flatsequence points, atom fillflag = False)
Draws a polygon (e.g. a closed multi-segment line) linking all the points indicated by the sequence passed as first argument, over the client area of the window or control indicated by the last call to SetDrawingControl(), using the line width indicated by the last call to SetPenSize() and the color indicated by the last call to SetPenColor(). The polygon is also filled with the same color, if the fillflag argument is set to True. Since any drawing made directly over a window or control's surface is automatically cleared by the operating system when the window or control is repainted, to make the drawings persistent (e.g. always visible at any one time) they must be placed inside a custom "paint procedure" which is executed each time this occurs. (See SetDrawingProc() below). Failing to do that will cause the drawing to be cleared as soon as the window or control is repainted by Windows, unless you are drawing on a memory bitmap.
draws and fills a rectangle linking the points whose coordinates are (10,10),(50,10),(50,90) and (10,90). [sequence points] is the plain sequence storing the point's coordinates [atom fillflag] set to True to draw a filled polygon or False to draw an outlined polygons
include tinewg.exw public procedure DrawCircle(integer x, integer y, integer radius, atom fillflag = False)
include tinewg.exw public procedure DrawRectangle(integer x1, integer y1, integer x2, integer y2, atom fillflag = False)
include tinewg.exw public procedure DrawEllipse(integer x1, integer y1, integer x2, integer y2, atom fillflag = False)
include tinewg.exw public function GetPixelColor(atom xpos, atom ypos)
Returns the color of the pixel with the specified coordinates from the current drawing bitmap (or Memory Bitmap) or control, according to the last call to SetDrawingMB() or SetDrawingControl(). Note that it is possible to retrieve the color of a pixel of a control ONLY if it is visible on the screen. In case it was not possible to retrieve the color of the specified pixel, the function's result will be bigger than #FFFFFF.
[atom xpos,ypos] are the coordinates of the pixel to check
include tinewg.exw public procedure DrawPoint(atom xpos, atom ypos)
Draws a single pixel over the client area of the window or control indicated by the last call to SetDrawingControl(), or over the memory bitmap indicated by the last call to SetDrawingMB() using the color indicated by the latest call to SetPenColor(). Since any drawing made directly over a window or control's surface is automatically cleared by the operating system when the window or control is repainted, to make the drawings persistent (e.g. always visible at any one time) they must be placed inside a custom "paint procedure" which is executed each time this occurs. (See SetDrawingProc() below). Failing to do that will cause the drawing to be cleared as soon as the window or control is repainted by Windows, unless you are drawing on a memory bitmap.
[integer pointx,pointy] are the pixel's coordinates (pixel 0,0 is the top-left one)
DrawPolygon,DrawLine,DrawPoint,GetPixelColor
include tinewg.exw public procedure DrawLine(integer startx, integer starty, integer endx, integer endy)
Draws a straight line over the client area of the window or control indicated by the last call to SetDrawingControl(), or over the memory bitmap indicated by the last call to SetDrawingMB() using the color indicated by the latest call to SetPenColor() and a line width indicated by the last call to SetPenSize(). Since any drawing made directly over a window or control's surface is automatically cleared by the operating system when the window or control is repainted, to make the drawings persistent (e.g. always visible at any one time) they must be placed inside a custom "paint procedure" which is executed each time this occurs. (See SetDrawingProc() below). Failing to do that will cause the drawing to be cleared as soon as the window or control is repainted by Windows, unless you are drawing on a memory bitmap.
[integer startx,starty] are the line's starting coordinates (point 0,0 is the top-left one) [integer endx,endy] are the line's ending coordinates (point 0,0 is the top-left one)
DrawPolygon,DrawLine,DrawPoint,DrawMultiLine
include tinewg.exw public procedure DrawMultiLine(sequence lines)
DrawMultiLine(linestodraw) A particular version of DrawLine() (see above) which draws several (consecutive or not) lines at one time. A single call to DrawMultiLine() to draw several lines is much faster than several consecutive calls to DrawLine(). "linestodraw" is a sequence of 4-element sequences storing the lines to draw. For example:
DrawMultiLine({{10,10,20,20},{35,30,40,50},{100,20,100,50}})
DrawLine(10,10,20,20) DrawLine(35,30,40,50) DrawLine(100,20,100,50)
but much faster to execute. (This is not true for tinEWG)
[sequence linestodraw] is a sequence of 4-element sequences storing the lines to draw
DrawPolygon,DrawLine,DrawPoint,DrawMultiLine
include tinewg.exw public procedure CopyMB(atom sourcebitmap, atom xpos, atom ypos, atom xsize, atom ysize, atom destbitmap, atom destxpos, atom destypos, atom destxsize = xsize, atom destysize = ysize)
Should work like the EWG procedure
include tinewg.exw public procedure CopyMBToControl(atom sourcebitmap, atom xpos, atom ypos, atom xsize, atom ysize, atom destcontrol, atom destxpos, atom destypos, atom destxsize = xsize, atom destysize = ysize)
include tinewg.exw public procedure CaptureControl(atom handle, atom mem_bitmap, atom flag = True)
include tinewg.exw public procedure DrawString(atom startx, atom starty, sequence text)
Draws some text over the client area of the window or control indicated by the last call to SetDrawingControl(), or over the memory bitmap indicated by the last call to SetDrawingMB() using the color indicated by the last call to SetPenColor() and the font indicated by the last call to SetDrawingFont(). Since any drawing made directly over a window or control's surface is automatically cleared by the operating system when the window or control is repainted, to make the drawings persistent (e.g. always visible at any one time) they must be placed inside a custom "paint procedure" which is executed each time this occurs. (See SetDrawingProc() below). Failing to do that will cause the drawing to be cleared as soon as the window or control is repainted by Windows, unless you are drawing on a memory bitmap.
[atom startx,starty] are the text's starting coordinates (point 0,0 is the top-left one) [sequence text] is the text to draw
include tinewg.exw public procedure SetDrawingFont(atom font)
This procedure allows to set the font type which will be used with all the following calls to the DrawString() procedure. The font type can be either one created with the NewFont() function or one of the default types.
[atom font] is the handle of the font to use
include tinewg.exw public function GetStringSize(atom control, sequence sstring, atom font, atom dimensionflag)
include tinewg.exw public procedure SetRepaintOn(atom control, atom flag)
include tinewg.exw public function IsKeyPressed(atom x)
Returns True if the specified keyboard's key is actually pressed, or False otherwise. For instance IsKeyPressed('A') will return True if the keyboard's key 'A' is pressed at the time the function is called.
[atom key] identifies the keyboard's key to check (e.g. 'A' or 'B' ... or '9' and so on)
include tinewg.exw public procedure SetCur(object cursorshape)
Sets temporarily the cursor's shape to one of five available standard window types or to one loaded from disk using the LoadCur() function (see above), "temporarily" meaning that Windows automatically restores the original cursor's shape each time the mouse is moved. For this reason, this procedure is normally used when handling the mouse Events (e.g. Move,Click,Release,RClick,RRelease) of a control to change the shape of the pointer each time it lies, it is clicked or moved over it. For instance, it is possible to change the shape of the cursor to an hourglass to advise the program's User of a lengthy operation in progress by using SetCur(CR_WAIT) inside the handling procedure of the Move Event of all the program's controls and windows.
[atom cursorshape] is one of the default cursor shapes or the handle of a cursor loaded from disk
CR_WE (West-East double arrow)
CR_NS (North-South double arrow)
CR_SIZE (Four directions arrow)
CR_VARROW (Vertical arrow)
CR_WAIT (Hourglass)
CR_NULL (No cursor visible)
CR_HELP
include tinewg.exw public procedure SetDrawingControl(atom control)
Set the indicated window or control as the one over which all the following drawing instructions will draw, until a new call to this procedure or to SetDrawingMB() will change it again. Initially, the default "drawing control" is the application's Main Window.
[atom control] is the handle of the control over which all the following drawing instructions will draw
include tinewg.exw public procedure SetDrawingMB(atom bitmap)
Set the indicated bitmap or Memory Bitmap as the one over which all the following drawing instructions will draw, until a new call to this procedure or to SetDrawingControl() will change it again.
[atom bitmap] is the handle of a Memory Bitmap or of a bitmap loaded from file over which all the following drawing instructions will draw
include tinewg.exw public procedure SetCanvas(atom canvas)
This is a replacement for the SetDrawingMB() and the SetDrawingControl() procedures with tinEWG you only will need SetCanvas() and the above procedures are obsolete, but supported for EuWinGui Apps.
SetDrawingControl,SetDrawingMB
include tinewg.exw public procedure RunApp(sequence appname, sequence parameter)
Starts or open the given program, file or directory, using the given parameters, if any. Not-executable files can be run directly, but only if their extension is already associated with an executable application. Note that this procedure DOES NOT change the working directory to the one of the started application; should it be necessary to change working directory, just use the Euphoria function chdir() before calling this procedure.
[sequence program] is the complete pathname of the program or file to run
[sequence parameters] are the parameters to use when running the specified program
include tinewg.exw public procedure Activate(atom handle)
include tinewg.exw public procedure ActivateText(atom handle)
include tinewg.exw public function Message(atom hwnd, atom msg, atom wParam, atom lParam, atom delayflag)
This low-level function is reserved to Programmers who already have a good knowledge of Windows low-level programming and can be safely ignored by casual Users of the library.
It serves to send (if delayflag is False) or post (if delayflag is True) a Windows message to an existing control or window.
[atom hwnd,msg,wParam,lParam] the data to send or post to the application's message queue [atom delayflag] set to True to post the message or False to send it immediately
include tinewg.exw public procedure CloseApp(atom exitcode = 0)
Closes the application with the given exit code. Use always this procedure to terminate any EuWinGUI application, so that the memory allocated for fonts and other resources is correctly freed.
[atom exitcode] the code returned to the system when the application closes
include tinewg.exw public function WaitEvent()
Starts the event handling procedure and wait until the user interacts in some ways with the program's interface. Once one of the supported events is trapped, sets the global variable Event to the Event's Type and the global variable EventOwner to the handle of the Control which received the Event, then returns.
include tinewg.exw public procedure ProcessEvent()
This procedure works almost like WaitEvent() (see below) with the difference that it returns immediately after having processed all the waiting events. By using this function, a EuWinGUI application can perform other tasks while waiting for more Events to occurr, at the cost of a much increased CPU usage.
include tinewg.exw public function IsEventWaiting()
include tinewg.exw public procedure WarnMsg(object text, object title)
Shows a standard warning Dialog with custom message, caption and the exclamation icon. Note: the application freezes (e.g. do not process any Event) until the message box is closed.
[sequence message] is the message to show
[sequence caption] is the Dialog's window caption
include tinewg.exw public procedure InfoMsg(object text, object title)
Shows a standard information Dialog with custom message, caption and the information icon. Note: the application freezes (e.g. do not process any Event) until the message box is closed.
[sequence message] is the message to show [sequence caption] is the Dialog's window caption
include tinewg.exw public function AskMsg(object text, object title)
Shows a standard ask Dialog with custom message, Yes/No buttons, caption and the question icon. If the user clicks on Yes buttons the function returns True, otherwise it returns False. Note: the application freezes (e.g. do not process any Event) until the message box is closed.
[sequence message] is the message to show
[sequence caption] is the Dialog's window caption
include tinewg.exw public function ScreenHeight()
Returns the current DeskTop (screen) height, in pixels.
This function is very useful to center the main window on the screen. If hei is the window's height, to center it vertically on the screen, set the y position of the window to
floor((ScreenHeight()-hei)/2)
include tinewg.exw public function ScreenWidth()
Returns the current DeskTop (screen) width, in pixels.
This function is very useful to center the main window on the screen. If wid is the window's width, to center it horizontally on the screen, set the x position of the window to
floor((ScreenWidth()-wid)/2)
include tinewg.exw public procedure SetText(atom handle, flatsequence text, atom part = 0)
include tinewg.exw public function GetText(atom handle)
include tinewg.exw public procedure SetIcon(sequence icon_file)
Sets the icon of the Main Window or of the last window used with a call to the SetParentWindow() procedure to the one specified. By default, the Main Window's or a Dialog's icon is the one bound with the compiled script, or the Euphoria one if the program was not bound.
[sequence iconpath] is the full pathname of the .ICO file to load
include tinewg.exw public procedure SetIconFR(sequence icon_file, atom handle = 0)
include tinewg.exw public function LoadIco(sequence icon_file)
include tinewg.exw public procedure SetIco(atom handle)
include tinewg.exw public procedure SetIconToButton(atom control, sequence icon_file, atom x = 0, atom y = 0)
If x and/or y = 0 than the original Icon size will be used.
include tinewg.exw public procedure SetIconToButtonFR(atom control, sequence icon_file, atom x = 0, atom y = 0, atom handle = 0)
include tinewg.exw public function LoadPicFR(sequence picture_file, atom handle = 0)
include tinewg.exw public procedure SetParentWindow(atom handle)
Sets the Main Window or an existing Dialog control as parent of all the controls created after this procedure has been used and until a new call to the same procedure changes again the "parent" window of all the newly created controls. It allows to populate the Dialog controls with other controls types as it is normally done with the Main Window. Note that Dialogs controls are always created as children of the Main Window, regardless of the window passed as argument of this function.
[atom parentwindow] is the handle of the Main Window (WinHwnd) or of a Dialog which will be used as parent of all the controls created following the call of this procedure
include tinewg.exw public function LoadPic(sequence picture_file)
Loads a BMP image from disk, returns its handle and stores the same handle into the PictureHandle global atom too. Only standard BMP images can be loaded, but it is not necessary that the file has the .BMP extension. That means that you can rename your BMPs file with new extensions to hide them from the User of your application, but you can still load them with this procedure. Note that each time this function is called, an amount of RAM equal to the size of the just loaded image is used (even if loading the same image multiple times) and won't be available to other applications until the program terminates or until you use the DeleteImage() procedure (see above) to delete the loaded images and free up the used memory. Note that whatever the color resolution of the loaded bitmap is, once the bitmap is loaded it is converted to the color depth actually used by Windows.
[sequence imagepath] is the full pathname of the .BMP file to load
include tinewg.exw public function LoadCur(sequence cursor_file)
Loads a cursor file from disk and returns its handle. Once a cursor is loaded its handle can be used to change the mouse pointer's shape using the SetCur() procedure (see below).
[sequence cursorpath] is the pathname of the cursor file to load
include tinewg.exw public procedure SetPicture(atom handle, atom controltype = 0, object imagepath = DC_DefaultControl)
A call to this procedure is absolutely equivalent to the code SetPic(control, controltype, LoadPic(imagepath)). It loads and sets at a same time a BMP image into a Picture, ClickPicture, PictureButton or PicturePushButton control, and stores the handle of the loaded image into the PictureHandle global atom. Only standard BMP images are allowed, but it is not necessary that the file has the .BMP extension. That means that you can rename your BMPs file with new extensions to hide them from the User of your application, but you can still load them with this procedure. Note that each time this procedure is called, an amount of RAM equal to the size of the just loaded image is used (even if loading the same image multiple times) and won't be available to other applications until the program terminates. To avoid running out of memory when you need to use a same large bitmap multiple times on a same or different controls, use LoadPic() once to retrieve the handle of the image you need and use SetPic() instead to set it on every control or each time it is needed.
[atom control] is the handle of the Picture, ClickPicture, PictureButton or PicturePushButton control
[atom controltype] is the type (Picture, ClickPicture, PictureButton or PicturePushButton) of the control
[sequence imagepath] is the full pathname of the .BMP file to load
include tinewg.exw public procedure SetPic(atom handle, atom controltype = 0, object imagehandle = DC_DefaultControl)
Sets a BMP image already loaded from a file or a Memory Bitmap created with NewMB() into a Picture, ClickPicture, PictureButton or PicturePushButton control. This procedure is especially useful when loading a BMP from file if your application use multiple times a same bitmap because, differently from the SetPicture() procedure below, it doesn't use addictional memory each time it is called as the third argument of the procedure is not a file path but the handle of a previously loaded bitmap image. The handle of a bitmap image is stored inside the PictureHandle global atom after the SetPicture() procedure has been used a first time to load it, or it is returned by a call to LoadPic() (see above). So, if you need to load a same bitmap inside multiple Picture controls, you can save a lot of memory by calling the LoadPic() function to load the bitmap from disk only once and then using SetPic() to set the same image into the other controls, using the handle returned by the function as third argument of the SetPic() procedure.
Example. Say you have four Picture controls and you need to load the same 100Kb image inside them, the code
SetPicture(pic1,Picture,"image.bmp") SetPicture(pic2,Picture,"image.bmp") SetPicture(pic3,Picture,"image.bmp") SetPicture(pic4,Picture,"image.bmp")
and the code
imghandle = LoadPic("image.bmp") SetPic(pic1,Picture,imghandle) SetPic(pic2,Picture,imghandle) SetPic(pic3,Picture,imghandle) SetPic(pic4,Picture,imghandle)
work the same, but by using the first method you will need 400Kb of RAM, while the second method only uses 100Kb because the image is loaded in memory only once.
[atom control] is the handle of the Picture, ClickPicture, PictureButton or PicturePushButton control
[atom controltype] is the type (Picture, ClickPicture, PictureButton or PicturePushButton) of the control
[atom imagehandle] is the handle of an already loaded bitmap image to use
include tinewg.exw public procedure SetVisible(object handle, atom Flag)
Shows or hides a control or a group of controls. Makes the specified control visible or invisible, depending on the value of flag. Hidden controls cannot respond to events.
[atom control] is the handle of the control to show or hide
[atom flag] set to True to show a control, or False to hide it
include tinewg.exw public function lv_GetItemCount(atom handle)
include tinewg.exw public procedure lv_Clear(atom handle)
include tinewg.exw public function lv_GetIndex(atom handle)
include tinewg.exw public function lv_AddColumn(atom handle, sequence header = "", atom width = 60)
include tinewg.exw public function lv_InsertRow(atom handle, integer row, sequence text)
include tinewg.exw public function lv_SetItem(atom handle, integer row, integer col, sequence text)
include tinewg.exw public function lv_GetItem(atom handle, integer row, integer col)
include tinewg.exw public procedure ListAdd(atom handle, object item)
Adds the specified string item to a List control. If the List control is actually a SortedList, the new item will be placed in alphabetical order among the existing items, otherwise it will be added at the end of the item's list.
[atom control] is the List control to which the string item must be added
[sequence item] is a string to add to the List item's list
include tinewg.exw public procedure ListClear(atom handle)
Clears all of a list control's items.
[atom control] is the List control to clear
include tinewg.exw public procedure ListDel(atom handle)
Deletes the currently selected item only from a List control.
[atom control] is the List control whose item must be deleted
include tinewg.exw public procedure ListIns(atom handle, object item)
Inserts the specified string item into a List control to the currently selected list position. Using this function with SortedList controls could cause to lose the sorting order.
[atom control] is the List control to which the string item must be added
[sequence item] is a string to add to the List item's list
include tinewg.exw public procedure ListPut(atom handle, object item)
Replaces the currently selected list item with the new string specified. Basically, this procedure deletes the currently selected list item and insert the new one into the same position. To avoid undesired list's flickerings caused by the deletion and re-insertion of the item, use the SetRepaintOn() procedure before and after this function. Using this function with SortedList controls could cause the lost of the sorting order.
[atom control] is the List control whose item must be replaced
[sequence item] is the new string item
include tinewg.exw public procedure ListSeek(atom handle, atom pos)
Sets the currently selected item of a List control to the specified position. If position is -1, no items will be selected, while if position exceeds the number of items present into the list, the last item will be selected. The first item of a list is the one with position 0 (zero).
[atom control] is the List control to set
[atom position] is the position number of the item to select
include tinewg.exw public function GetCount(atom handle)
include tinewg.exw public function GetIndex(atom handle)
include tinewg.exw public function GetItem(atom handle)
include tinewg.exw public function GetListItemHeight(atom handle)
include tinewg.exw public procedure SetListCWidth(atom handle, atom width)
include tinewg.exw public function GetSelec(atom handle)
include tinewg.exw public function IsChecked(atom handle)
include tinewg.exw public procedure SetCheck(atom handle, atom Flag)
include tinewg.exw public procedure SetEnable(atom handle, atom Flag)
include tinewg.exw public procedure SetEditSel(atom handle, atom start_pos, atom end_pos)
include tinewg.exw public function GetEditSel(atom handle)
Return a sequnece with the actual selection of the control (if any)
include tinewg.exw public procedure MoveWindow(atom handle, atom xpos, atom ypos, atom height, atom width, atom repaint)
Resizes and moves a Window or Control to the given size and position. This works with all Windows and Controls you can get a handle for.
include tinewg.exw public procedure SetDim(atom handle, atom xsize, atom ysize)
Resizes the main window or a control to the given dimensions. [atom handle] is the handle of the control to move [atom xsize] is the new width of the control [atom ysize] is the new height of the control This works only with Controls created with tinEWG!
include tinewg.exw public procedure SetPos(atom handle, atom xcoord, atom ycoord)
Moves a control to a new position over the Main Window's client area or the Main Windows to another screen's position. [atom handle] is the handle of the control to move [atom xcoord] is the new x position of the control [atom ycoord] is the new y position of the control This works only with Controls created with tinEWG!
include tinewg.exw public function GetImageWidth(atom handle)
Returns the Width of an Image or an Memorybitmap
include tinewg.exw public function GetImageHeight(atom handle)
Returns the Height of an Image or an Memorybitmap
include tinewg.exw public function GetImageSize(atom handle, atom flag)
A more EuWInGui-Style version of getting Image sizes
flag can be X_DIM or Y_DIM
include tinewg.exw public procedure DeleteImage(atom handle)
Deletes an Image or Memorybitmap, and releases the used memory.
include tinewg.exw public function MakeRGB(integer RED, integer GREEN, integer BLUE)
Creates a ColorValue from 3 independed RGB Values. There is no Check for possibillity in this routine. so it is up to you, if you got some strange results ;)
include tinewg.exw public procedure SetColor(atom handle, atom text, atom background)
include tinewg.exw public procedure SetRefresh(atom handle)
include tinewg.exw public procedure SetFont(atom handle, atom font)
include tinewg.exw public procedure SetFixedFont(atom handle)
include tinewg.exw public procedure SetWinTimer(atom time1, atom timer = WinTimer)
SetWinTimer sets a/the Timer
a call with time = Null stops the timer
include tinewg.exw public function FileDlg(object Flag, sequence defaultfile, sequence filters)
Shows a standard "Open" or "Save As" file dialog (depending on the value of flag) and returns the full pathname of the file selected for opening or saving purposes. The starting folder is the current working directory (so it can be changed, if needed, with a previous call to the Euphoria statement chdir()). Argument defaultfile can hold name and extension (no path) of the file used by default when the file dialog appears. Argument filters holds the extension filter definition for the file dialog. Extension filters are given by couples
of file descriptions and extensions separated by vertical lines, using this format: "File Description 1|*.ex1|File Description 2|*.ex2" and so on;
for instance the string:
"JPEG Images|*.JPG;*.JPEG|All Files|*.*"
sets two filter definitions: "JPEG Files" and "All Files";
if the User chooses the first filter from the drop-down list, only files with .JPEG and .JPG extension will be visible, while if he chooses the "All Files" filter, all files will be visible. Note the use of semicolon (";") to separate different extensions belonging to a same filter definition. If argument filter is an empty string (""), the default "All Files|*.*" filter only is used.
As a final note, be aware that, if using the Save flag, the function does NOT automatically append any extension to the returned filepath, regardless of the selected filter.
The application freezes (e.g. do not process any Event) until the dialog box is closed.
[atom flag] set to Open or Save to display a standard "Open" or "Save As.." file dialog
[sequence defaultfile] is the default file name
[sequence filters] is the filter string definition
include tinewg.exw public function GetPageSize(atom dimensionflag)
Returns the width or height in pixels of the current printing document's pages, according to the selected printer and its settings.
[atom dimensionflag] set to X_DIM or Y_DIM to retrieve respectively the width or height of the page
include tinewg.exw public function GetPrinterStringSize(sequence sstring, atom font, atom dimensionflag)
include tinewg.exw public procedure SetPrinterFont(atom font)
include tinewg.exw public procedure SelectPrinter(atom flag = True)
include tinewg.exw public procedure NewDocument(sequence documentname = "New Document")
include tinewg.exw public procedure PrintMB(atom sourcebitmap, atom xpos, atom ypos, atom xsize, atom ysize)
include tinewg.exw public procedure PrintMBBlt(atom sourcebitmap, atom xpos, atom ypos, atom xsize, atom ysize, atom destxpos = xpos, atom destypos = ypos, atom destxsize = xsize, atom destysize = ysize)
include tinewg.exw public procedure PrintString(atom startx, atom starty, sequence text)
include tinewg.exw public procedure SetPrinterPenColor(atom pencolor)
include tinewg.exw public procedure StartPrinting()
include tinewg.exw public procedure NewPage()
include tinewg.exw public procedure PrintWindow(atom handle = WinHwnd, atom hdc = Printhdc, atom flags = 0)
include tinewg.exw public procedure DeleteControl(atom handle)
include tinewg.exw public function Control(object window_class, sequence caption = "New", atom xpos = 0, atom ypos = 0, atom xsize = 80, atom ysize = 20)
Creates one of the supported Control Types, and returns its handle. Can be used only after that the Window() function has been used. If the control can't be created, the function returns zero.
[atom controltype] is one of the supported Control Types
[sequence caption] is the text associated to the Control
[atom xpos,ypos] the Control's coordinates relative to the Window
[atom xsize,ysize] the Control's width and height
include tinewg.exw public function Window(sequence title = "TinEwg Window", atom xpos = - 1, atom ypos = - 1, atom xsize = 400, atom ysize = 200)
Creates and shows the application's Main Window and assign the Window's handle to the global variable WinHwnd.
It is the first WinGUI function to use to create the program's interface. If the Main Window can't be created,
WinHwnd is set to zero. The appearance (style) of the Main Window can be choosen, before using this procedure,
by setting the values of global variables WindowType and WinOnTop (see above). xpos,ypos defaults to -1, which centers the Window on the screen.
[sequence caption] is the Window's title
[atom xpos,ypos] are the Window's screen coordinates
[atom xsize,ysize] are the Window's width and height
include tinewg.exw public function GetForegroundWindow()
include tinewg.exw public function BringWindowToTop(atom hwnd)
include tinewg.exw public function SetForegroundWindow(atom hwnd)
include tinewg.exw public function SetActiveWindow(atom hwnd)
include tinewg.exw public procedure ForceForeground(atom aWinHwnd, atom showflag = 1)
include tinewg.exw public procedure SetHandler(object handle, object htype, object routineid)
include tinewg.exw public procedure ProcessHandlers()
include tinewg.exw public procedure WinMain()
include tinewg.exw public procedure WinGame()
include tinewg.exw public procedure pb_Step(atom handle)
include tinewg.exw public procedure pb_SetRange(atom handle, atom minimum = 1, atom maximum = 100)
include tinewg.exw public procedure pb_SetStep(atom handle, atom step = 1)
include tinewg.exw public function pb_SetPos(atom handle, atom pos = 1)
include tinewg.exw public function pb_GetPos(atom handle)
include tinewg.exw public procedure pb_SetMarquee(atom handle, atom onoff = True, atom milliseconds = 30)
include tinewg.exw public procedure pb_MakeMarquee(atom handle)
include tinewg.exw public procedure pb_MakeVertical(atom handle)