Home

IUP - LuaForge

image

Contents

1. Motif Driver e Several memory leaks were fixed They occurred when IupGetAttribute called functions from XM which allocated memory to store the attribute s value This change may cause problems for applications which did not copy the value returned from IupGetAttribute and used the returned string This usage of the return value from IupGetAttribute is not appropriate because the user has to copy this string if he she intends to remain using it the returned string is intern to IUP e The dialog s Close callback was not closing the application when it returned LUP_CLOSE e The IUP_ACTION callback from ITupMultiline was not returning the new text value if the key was validated parameter after e The dropdown list was not automatically showing the first element when it was opened e The Motif driver now returns the default font when IupGetAttribute n IUP_FONT is performed IupLua e The names of callbacks show_cb and map_cb were corrected e A bug that made a toggle image not appear was fixed Extended Controls e The default cursor of the IupMat rix element now looks like the MS Excel cursor Remember to call TupMat rixOpen even when using IupLua e Alignment center of the field in column 0 of the IupMatrix element e The user can now return ILUP_CONTINUE at the action callback of element TupMatrix to allow IUP to go on treating
2. include lt iupcpi h gt static Iclass classe NULL static Ihandle DialCreate m todo de cria o void IupDialOpen void classe iupCpiSetClassMethod classe Creation of Control Instances 51 iupCpiCreateNewClass dial n ICPI_CREATE DialCreate The created control must make a function available whose name must be IupControl where Control is the control name This function is to be used by the user to create a new control instance and should not receive arguments If the control is a container the the arguments are necessarily its children In this creation function if no parameters are necessary just call upCreate with the control s name If the control allows children use LupCreatev to pass them forward to IUP This function will create the control s Ihandle by means of the function registered by ICPI_CREATE Example1 Thandle IupDial return IupCreate dial Example2 Thandle IupBox Thandle params Thandle elem NULL unsigned int i 0 va_list arg if first va_start first i 1 while va_end arg va_arg arg arg params Ihandle i 0 va_start arg elem first whil elem NULL first params itt elem elem va_arg arg params i NULL va_end arg elem TupCreatev name NULL i Thandl mall r Ihandle first
3. e itt oc sizeof Ihandle i 1 Thandle params 52 free params return elem CPI Methods The Iclass structure fields are mostly pointers to functions to be called by IUP in certain moments These pointers to functions play the same parts as objects in languages such as C Following the C philosophy the CPI defines a set of functions which can be used to provide the controls a default behavior The Iclass structure stores these function pointers which are defined right after the call to LupCpiCreateNewClass In several occasions the default behavior defined by the CPI is not adequate for the new control s implementation In this case a new function must be set providing the desired implementation for such method If convenient this new function can call the function implementing the method s default behavior either before or after performing the specific treatment of the new control Generally a method that will always be redefined to a new control is the one in charge of creating instances of this control To redefine replace a control method function iupCpiSetClassMethod must be used It receives as parameters the values described below iupCpiSetClassMethod parameter Default method used Description This method is called by IUP when an instance fc When this function is called IUP already has a re CPI_CREATE instance represented by the self parameter TI the
4. elem Identifier of the interface element This function returns the name of the type of an interface element Notes The following names are predefined unknown color W image button canvas dialog W FLL frame hbox item separator submenu label list menu radio tex t toggle VZbox zbox multiline user IupSetHandle Defines a name for an interface element Parameters Return Thandle IupSetHandle char name Ihandle element in C TupSetHandle name string element iuplua_tag gt handle iuplua_tag in Iup iup SetHandle name string element iuplua_tag gt handle iuplua_tag in Iuj name name of the interface element element identifier of the interface element This function returns the identifier of the interface element previously associated to the parameter name 76 Note Attention To delete an element s name use TupSetHandle my element name NULL See Also TupGetHandle IupGetHandle Retrieves the identifier of an interface element Parameters Return Thandle IupGetHandle char name in C TupGetHandle name string gt handle iuplua_tag in IupLua3 iup GetHandle name string gt handle iuplua_tag in IupLua5 name name of an interface element This function returns the identifier of the interface element Note This function is used for integrating IUP and LED To manipulate an in
5. gt language string in IupLua3 iup GetLanguage gt language string in IupLua5 For a list of all possible return values see IupSet Language Affects All elements with predefined texts Example in C include lt stdio h gt include lt stdlib h gt include lt string h gt include iup h void main void TupOpen TupMessage IUP Language IupGetLanguage IupClose return 64 65 IupMapFont Retrieves the name of a native font given the name of the IUP font Parameters Return char IupMapFont char iupfont in C IupMapFont iupfont string gt nativefont string in IupLua3 iup MapFont iupfont string gt nativefont string in IupLua5 This function returns the name of the native font See Also TupUnMapFont FONT attribute IupUnMapFont Retrieves the name of the IUP font given the native font Parameters Return char IupUnMapFont char font in C TupUnMapFont font string gt iupfont string in IupLua3 iup UnMapFont font string gt iupfont string in IupLua5 This function returns the name of the IUP font given the native font If such font does not exist the function will return NULL See Also TupMapFont IUP FONT iuplua_open Initializes the Lua Binding This function must be called by the host program before running any Lua functions but it is important to
6. USERNAME Global attribute IUP_SYSTEM now returns a more complete string e Cursor now changes instantly it only changed before returning to IUP e In an inactive IupToggle the IMINACTIVE image is now correct Motif The iupmot library no longer exists Tecmake has been updated but those who use their own metafiles must remove this file from the list of libraries in the application New attribute AUTOREPEAT allows turning on and off the automatic repetition mode of pressed keys IupLua 4 5 IupListDialog when selection type is 1 single was not returning any value 4 5 Callbacks mapcb and showcb had their names wrong map_cb and show_cb 3 Callback action in IupMultiline was not passing the parameter after 4 5 In LupTree callbacks afterselection and beforeselection were replaced with the callback selection IupControls We have joined seven libraries in one dial gauge cb gc mask tabs and val But neither the initialization functions nor each control s inclusion files were changed The source code does not need to be altered except for the makefiles Tecmake was given a flag USE_IUPCONTROLS to automatically include this library TupMatrix The name of the library was changed from iupmatrx to iupmatrix The same for the inclusion files Therefore all applications that use IupMat rix must change the source code and
7. HEIGHT Image height WIDTH Image width Notes An image created with IupImage can be reused for different buttons and labels But in Motif the BGCOLOR color index will be calculated only once when it is first used The images must be destroyed when they are no longer necessary by means of the IupDestroy function To destroy an image it cannot be in use Please observe the rules for creating cursor images CURSOR The pixels array is duplicated internally so you can discart it after calling IupImage If do not set a colors it is used a default color for the 16 first colors The default color table is the same for Windows and Motif 93 0 0 0 O black 1 128 0 0 dark red 2 0 128 O dark green 3 128 128 0O dark yellow 4 0 0 128 dark blue 5 128 0 128 dark magenta 6 0 128 128 dark cian 7 192 192 192 gray 8 128 128 128 dark gray 9 255 0 0 red 10 0 255 0 green 11 255 255 0 yellow 12 0 0 255 blue 13 255 0 255 magenta 14 0 255 255 eran 15 255 255 255 white For images with more than 16 colors all the color indices must be defined up to the maximum number of colors For example if the biggest image index is 100 then all the colors from i 16 up to i 100 must be defined even if some indices are not used Note that to use more than 128 colors you must use an unsigned char pointer and simply cast it to char when calling the Iup
8. IupAppend Inserts an interface element at the end of a list in hbox vbox zbox ormenu Parameters Return Thandle IupAppend Ihandle box Ihandle element in C TupAppend box element iuplua_tag gt box iuplua_tag in IupLua3 iup Append box element iuplua_tag gt box iuplua_tag in IupLua5 box Identifier of an hbox vbox zbox or menu element Identifier of the element to be inserted in the box This function returns box if the interface element was successfully inserted Otherwise NULL nil in Lua is returned Notes This function must be used when the interface elements that will compose an hbox vbox zbox or menu are not known a priori in the program s compilation stage If the box where the interface element is being inserted is visible the IupAppend function does not update it automatically For such the box must be hidden IupHide and made visible IupShow again ATTENTION Currently this function only works before the element is mapped by means of functions IupMap IupShow IupShowXyY or IupPopup See Also ITupDetach IupHbox IupVbox TupZbox LTupMenu IupGetNextChild Returns the children of the given control based on his brother Parameters Return Ihandle IupGetNextChild Ihandle parent Ihandle lastchild in C IupGetNextChild parent lastchild iuplua_tag gt ret iuplua_tag in IupLua3 iup GetNextChild parent lastchild iuplua_tag gt
9. IupSetAttribute n 30 10 v TupMatSetAttribute n BGCOLOR 30 10 v IupSetAttribute n BGCO TupMatSetAttribute n ALIGNMENT 10 0 v IupSetAttribute n ALI noticed that in this case the second value will be ignored Navigation Navigating through the matrix cells outside the edition mode is done by using the following keys e Arrows Shift from the current cell to the next one according to the arrow s direction e Page Up and Page Down Scroll a spreadsheet up or down one page e Home Shifts from the current cell to the fist column in the line e Home Home Shifts from the current cell to the upper left corner of the visible page e Home Home Home Shifts form the current cell to the upper left corner of the first page of the matrix e End Shifts from the current cell to the last column in the line e End End Shifts from the current cell to the lower right corner of the visible page e End End End Shifts from the current cell to the lower right corner of the last page in the matrix e Del Deletes the contents of all selected cells Inside the edition mode the following keys are used for a text field e Up and down arrows Shift the current key leaving the edition mode e Left and right arrows If they are on the extremes of the text being edited they shift the current key leaving the edition mode e Ctrl Arrows Shift the current cell leaving the edition mode When the matrix is outside
10. NO etc iupcb changed to iup colorbrowser e Use LoadLibrary to load IUP from Lua e There was no stack pop in color processing loop fo IupImage in IupLuaS e lupLua4 is not supported anymore LEDC Added support for IupTree and IupSbox Fixed include for IupColorBrowser Fixed small invalid memory access 12 Version 2 1 18 Feb 2004 General New split panel control IupSbox IupTree and IupMatrix libraries are now part of iupcontrols New functions to traverse IUP controls IupGetNextChild IupGetBrother IupGetParent IupAppend accepts elements other than predefined internal controls allowing CPI containers Focus now may go to CPI controls Attribute IUP_X IUP_Y are now valid for every control that has a native representation returns the position of the control in screen coordinates CURSORPOS global attribute is now returned from the driver IupGetFile was not allowing new files and should not change user directories IupGetFile was not accepting long directories IupAlarm does not take ENTER as button click anymore IupScanf does not accept when option is float Windows 95 is no longer supported IupTree Trying to get attribute NAME for and invalid ID returns NULL Fixed attributes I UP_CTRL e IUP_SHIFT for mouse interaction TupMatrix Special keys such as backspace control c etc are now ignored when not in edit mode leaveitem enteritem were not being generated when the focus was leaving or entering the
11. Returns the id of the node on success and nil otherwise ab ab le self handle le self handle TreeGetT TreeGetT id id gt gt number number ret ret tab number number e in IupLua5 in Iup in Iupli in Iupli a3 tabl e in Iup uad self Identifier of the TupTree interacting with the user id Node identifier Returns the table of the node on success and nil otherwise Creates a 1I upTree with the values shown on the images below and allows the user to change them dynamically 153 TableTree result TableTree result e Aninals e TEE E irina Is A Ba Mammals aS Crustaceans Shrimp Lobster See Also IupCanvas IupTree Attributes General SCROLLBAR Associates a horizontal and or vertical scrollbar to the canvas Default YE S FONT Character font of the text displayed on the element ADDEXPANDED Defines if branches will be expanded when created The root node is always expanded when created Possible values YES The branches will be created expanded NO The branches will be created collapsed Default NO Marks VALUE The selected node When changed also marks the node but only if the Control and Shift keys are not used Possible values The node identifier to be selected When changed also accepts the values ROOT the root node LAST the last node 154
12. TupGetFromc where element_name is the name of the element previously defined with TupSetHandle Error Handling Error handling differ between each Lua version To keep IupLua s API as compatible as possible functions have been created to execute Lua code int iupl int iupl lua_dofile lua_State L char filename lua_dostring lua_State L const char str ing const char chunk_3 If the given functions are used in every IupLua version the errors will be reported through the ERRORMESSAGE function If this function is not defined by the user IUP will use its default implementation shows a dialog with the error message If the user chooses not to use those functions errors will be handled according to the version of Lua used The Architecture Behind IupLua The Lua API for the IUP system was based on object classes representing the different interface elements A hierarchy was built among these classes with the main purpose of reusing code Code inheritance was implemented precisely as described in the Lua user guide The root of this hierarchy is the WIDGET class It contains the basic construction parameter type verification and allocation of structures for controlling IUP s interface elements This class also defines the basic parameters of all classes such as handle which stores the handle of the associated IUP element and parent used to implement the inheritance mechanism Even though almost a
13. WEST EAST NE SEY NW SW ACENTER Default NE MARGIN Defines the margin of the visible element VALUE Defines the visible element The value passed must be the identifier of one of the elements contained in the zbox Default the first element SIZE Defines the zbox size Default the smallest size that fits its largest element Note The box can be created with no elements and be dynamic filled using lupAppen Though this element can have attributes ALIGNMENT and MARGIN it does not have attribute GAP Examples 21D x r Select an element Ente your text here See Also TupHbox IupVBox IupItem Creates an item of the menu interface element When selected it generates an action Parameters Return Thandle IupItem char title char action in C ijupitem title title string gt elem iuplua_tag in IupLua3 iup item title title string gt elem iuplua_tag in IupLua5 item title action in LED title Text to be shown on the item action Name of the action generated when the item is selected This function returns the identifier of the created item 119 Attributes KEY Associates a key to the item VALUE Indicates the item s state When the value is ON a mark will be displayed to the left of the item Default OFF TITLE Text shown to the user It is possible to change its value on the fly IMAGE Windows Only Image of the n
14. s size has precedence over the smallest size required by its children either if it was specified in its creation or in run time Attributing a NULL value to SIZE or RASTERSIZE in C in a dialog will recompute its size according to its children TITLE Dialog s title On Motif if it is not defined the dialog will not be properly displayed 104 STARTFOCUS Name of the dialog element that must receive the focus right after the dialog is opened DEFAULTENTER Name of the button activated when Enter is hit DEFAULTESC Name of the button activated when Esc is hit gt lt Dialog s horizontal position on the screen in pixels IK Dialog s vertical position on the screen in pixels SHRINK Allows changing the elements distribution when the dialog is smaller than the minimum size PARENTDIALOG Makes the dialog be treated as a child of the specified dialog FULLSCREEN Makes the dialog occupy the whole screen All dialog details such as border maximize button etc are removed Possible values YES NO Must be set before mapping to the native system In Motif you may have to click in the dialog to set its focus Use IupPopup for better results WIN_SAVEBITS Windows Only This attribute is only consulted when the dialog is mapped When this attribute is true YES the dialog stores the original image of the desktop region it occupies if Windows has enough memory to store th
15. 127 Callback typedef int Iparamcb Ihandle dialog int param_index void user_data dialog dialog handle param_index current parameter being changed It is 1 if the user pressed the OK button It is 2 when the dialog is mapped just before shown It is 3 if the user pressed the Cancel button user_data a user pointer that is passed in the function call You can reject the change or the OK action by returning 0 in the callback otherwise you must return 1 You should not programmatically change the current parameter value during the callback On the other hand you can freely change the value of other parameters Use the dialog attribute PARAMn to get the parameter Ihandle but not that this is not the actual control Where n is the parameter index in the order they are specified starting at 0 but separators are not counted Use the parameter attribute CONTROL to get the actual control For example Thandle param2 Ihandle IupGetAttribute dialog PARAM2 int value2 IupGetInt param2 IUP_VALUE Thandle param5 Ihandle IupGetAttribute dialog PARAM5 Thandle ctr1l5 Ihandle lupGetAttribute param5 CONTROL if value2 0 TupSetAttribute param5 IUP_VALUE New Value TupSetAttribute ctr15 IUP_VALUE New Value Since parameters are user controls and not real controls you must update the control value and the parameter value Be aware
16. All you have to do is define a default action and verify which is the name of the action that activated it Affects 198 Global callback See Also TupSetFunction IupGetActionName ENTERWINDOW_CB Action generated when the mouse enters the canvas Callback int function Ihandle self in C elem enterwindow gt ret number in IupLua3 elem enterwindow_cb gt ret number in IupLua5 self identifier of the canvas the mouse has entered Affects TupCanvas GETFOCUS_CB Action generated when an element is given keyboard focus This callback is called after the KILLFOCUS_CB Callback int function Ihandle self in C elem getfocus gt ret number in IupLua3 elem getfocus_cb gt ret number in IuplLua5 self identifier of the element that received keyboard focus Affects All elements with user interaction except menus See Also RILLFOCUS CB HELP_CB Action generated when the user press F1 at a control In Motif is also activated by the Help button in some workstations keyboard Callback void function Ihandle self in C elem help gt ret number in IuplLua3 199 elem help_cb gt ret number in IupLua5 self identifier of the element that received keyboard focus Affects All elements with user interaction HIGHLIGHT_CB Callback triggered every time the mouse pointer hovers an JupItem Callback int functio
17. Changes on global attributes COMPUTERNAME USERNAME now implemented also in Motif COPYRIGHT not documented SCREENDEPTH SYSTEMVERSION new for Windows and Motif SYSTEM Implementation were different from the documentation CURSORPOS was documented as if it was only for Windows LOCKLOOP now implemented also in Motif The definitions IUP_SBDRAGV and IUP_SBDRAGH were not documented Callback MENUSELECT_CB changed to HIGHLIGHT_CB Now implemented also in Motif New menu callback MENUCLOSE_CB New utility functions IupMessagef and IupGetInt2 Improved visual appearance of IupScanf IupAlarm and IupListDialog New creation attribute SEPARATOR for IupLabel so you can create vertical or horizontal line separators New IupGetText predefined dialog Now all the predefined dialogs consult the global attribute UP_PARENTDIALOG New HELP_CB callback for all interactive controls The KEYPRESS_CB callback now will be called repeatedly if the key is pressed and held IupList can now have an edit box associated The OLD newfocus parameter of the KILLFOCUS_CB is now NULL always in Windows and Motif The BGCOLOR color for IupImage transparency was not according to the documentation It was using the default background color of the dialog Now it uses the BGCOLOR of the control where it is inserted Windows Menus for notification icons system tray were not working correctly Cursors in Windows now accept more than
18. IMGBLANK blank sheet of paper and IMGPAPER written sheet of paper Scrollbar 150 IupTree s scrollbar is activated by default and works automatically When a node leaves the visible area the scrollbar automatically scrolls so as to make it visible We recommend not changing the SCROLLBAR attribute Fonts The fonts used by IupTree are like the ones defined by IUP see attribute FONT We recommend using only IUP defined fonts Manipulation Node insertion or removal is done by means of attributes It is allowed to remove nodes and branches inside callbacks associated to opening or closing branches This means that the user may insert nodes and branches only when necessary when the parent brach is opened allowing the use of a larger IupTree without too much overhead Then when the parent branch is closed the subtree can be removed A side effect of this use is that the expanded or collapsed state of the children branches must be managed by the user When a node is added removed or renamed the tree is not automatically redrawn You must set REDRAW YES when you finish changing the tree Simple Marking Is the LupTree s default operation mode In this mode only one node is marked and it matches the selected node Multiple Marking IupTree allows marking several nodes simultaneously using the Shift and Control keys To use multiple marking the user must use attributes SHIFT and
19. SAVE or DIR Default OPEN TITLE Dialog s title FILE Name of the file initially shown in the File Name field in the dialog FILTER File filter 107 FILTERINFO Filter s description EXTFILTER Windows Only Defines several file filters It has priority over FILTER and FILTERINFO Must be a text with the format Descriptionl filterl Description2 filter2 filter3 The amount of descriptions and of filters is unlimited Example Text files txt doc Image files gif jpg bmp J DIRECTORY Initial directory PARENTDIALOG Makes the dialog be treated as a child of the specified dialog ALLOWNEW Indicates if non existent file names are accepted If equals NO and the user specifies a non existing file an alert dialog is shown NOCHANGEDIR Indicates if the initial working directory must be restored after the user navigation F LLEEXIST Indicates if the file defined by the FILE attribute exists or not STATUS Indicates the status of the selection made 1 New file 0 Normal existing file 1 Operation cancelled VALUE Name of the selected file or NULL if no file was selected NOOVERWRITEPROMPT do not prompt to overwrite an existant file when in SAVE dialog Default is NO i e prompt before overwrite MULTIPLEFILES Windows Only When YES this attribute allows the user of IupFileDl
20. including the copyright notice below somewhere in your product or its documentation A nice but optional way to give us further credit is to include a Tecgraf logo in a web page for your product The library is designed and implemented by a team at Tecgraf PUC Rio in Brazil The implementation is not derived from licensed software The library was developed by request of Petrobras Petrobras permits Tecgraf to distribute the library under the coditions here presented Copyright 1994 2004 Tecgraf PUC Rio and PETROBRAS S A 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 5 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 FR
21. ival in C iupMaskMatGet Ihandle h char val int lin int col in C iupMaskMatGetFloat Ihandle h float fval int lin int col in C iupMaskMatGetDouble Ihandle h double dval int lin int col in C iupMaskMatGetInt Ihandle h int ival int lin int col These functions check if the mask is complete and they retrieve the field s value in only one call h Thandle of IupText or IupMatrix val fval ival Pointers used to complete the return value 131 lin col Line and column numbers in the matrix They return 1 if the text satisfies the mask or 0 otherwise Notes User callbacks previously associated to the text editing field or to the Matrix field that is before the 1upMaskSet function is called will be called by the library if the pressed key satisfies the mask Attention for the callback to be actually called the user must call not only lupSetAttribute but also lupSetFunction To make the use of masks simpler the following predefined masks were created IUPMASK_FLOAT Float number IUPMASK_UFLOAT Float number with no sign IUPMASK_EFLOAT Float number with exponential notation IUPMASK_INT Integer number IUPMASK_UINT Integer number with no sign Examples IupSbox Creates a split panel control Allows the provided control to be enclosed in a box that allows resizing Parameters Return Thandle IupSbox Ihandle elem in C iupsbox elem iup
22. mousemove_cb val number gt ret number in IupLua5 BUTTON_PRESS_CB Called when the user presses the left mouse button over the valuator The value of VALUE is passed as parameter The thumb is always repositioned to the current mouse position int function Ihandle self double val in C elem buttonpress val number gt ret number in IupLua3 elem buttonpress_cb val number gt ret number in IuplLua5 BUTTON_RELEASE_CB Called when the user releases the mouse button after having pressed it over the valuator The value of VALUE is passed as parameter int function Ihandle self double val in C elem buttonrelease val number gt ret number in IupLua3 elem buttonrelease_cb val number gt ret number in IupLua5 Notes When the keyboard arrows are pressed and released or the mouse wheel is rotated the mouse press and the mouse release callbacks are called in this order If you hold the key down a mouse move callback is also called In these cases the value is incremented by 10 of the interval max min Examples m JupVal a E VALUE TE VALUE 0 75 See Also TupCanvas Iup Matrix 136 Creates a matrix of alphanumeric fields Therefore all values of the matrix s fields are strings The matrix is not a grid container like many systems have It inherits from IupCanvas It has two modes of operation normal and callback mode In normal mode string values are s
23. or ILUP_DEFAULT from ending TupMainLoop LINUX The button press event was not being received by the canvas when the CTRL key was pressed Version 1 8 29 May 98 General also includes changes to both drivers BUG Valuator Dial and Gauge could cause an invalid memory access on resize or destroy BUG The parse of CPI elements described in LED was corrected BUG Valuator was removing the application s idle action NEW FILEDLG control NEW IupStoreAttribute function NEW IupSet fAttribute function NEW IupSetGlobal IupGetGlobal and IupStoreGlobal functions for global attributes NEW K_sCR key shift enter combination is now treated by IUP callback IUP_K_sCR code K_SCR NEW IUP_TYPENAME attribute returns the name of the element type e NEW CPI popup method NEW Definition of global attributes verification only TUP_VERSION IUP_DRIVER IUP_SYSTEM and IUP_SCREENSIZE NEW Attributes IUP_X and IUP_Y were implemented for dialogs only They provide the dialog s upper left corner coordinates in relation to the upper left corner of the screen NEW IUP_SHRINK attribute to change the computation of the position and size of elements NEW CPI control for an OpenGL canvas 30 e CHANGE The IUP_TYPE attribute of the IupFileD1g control was changed into UP_DIALOGTYPE which must contain OPEN SAVE or NULL e
24. the application crashed e Hitting Esc was causing garbage to be written in the matrix field e A bug that made the value_edit callback be called several times was fixed it was called several times because the matrix kept trying to exit the edition mode with other events IupTree Control e New LuptTree control 20 Scrollbar Multiple selection Default image size 16x16 Lua Binding IupCB Control The name of the Lua colorbrowser element has changed Now it is called iupcb not cb Windows Driver The LUP_MULTIPLEFILES attribute was created Now it is possible in Windows to select several files ina FileDlg TupHelp now only initializes DDE when it is used Version 1 8 8 15 Mar 2001 The global h macros h rgb h and hls h files are no longer exported by IUP Some keys were in conflict among themselves shift home and 4 for instance Shift space and Ctrl space were added to the K_ANY callback Windows and Motif UP_VISIBLE was returning NULL on IUP when the dialog was not mapped TupSet Language can now be called before ITupOpen iuptoolbar and iupfiletext were removed from the distribution Several defines such as st rieq are no longer exported from 1upcpi h Functions iupAddSymbol iupGetSymbol iupgetdata and iupsetdata are no longer exported from the CPI Motif Driver The Tip font is now inherited from the element it belongs Inserting a text IUP_INSERT or IU
25. 2 colors and can have size different from 32x32 IupImage was rewritten in Windows to be more simple and flexible This also solved some weird button backgrounds in gcc3 New global attributes SHIFTKEY and CONTROLKEY can be ON or OFF return the Motif the key state windows only The default size for buttons in Windows was increased by 2 characters Returning IUP_CLOSE in a SHOW_CB of an IupPopup wasn t closing dialog IupOpen instead of initializing OLE now only initializes COM Colnitialize The border of buttons are now drawn by a system function instead of simulated New attribute PLACEMENT to show the dialog maximized or minimized In IupFileDlg when browsing for folder it will use a new interface with a resizable dialog and other features Also in IupFileDlg fixed start position for lupPopup New file selection callback and preview area IupFileDlg was not using the UP_PARENTDIALOG attribute Default value for IUP_NOOVERWRITEPROMPT was wrong ALLOW_NEW was inconsistent with the documentation The button callback now is called only when the button is released inside the button area WOM callback renamed to WOM_CB New HELPBUTTON attribute for the dialog The menu item now accepts auxiliary bitmaps When the dialog has a multiline and the user press ESC the window was improperly closed Fixed comboox resize feedback When resizing the dialog the combobox was temporarily opened IupCanvas was not receiving a
26. CB Action generated when an element in the dropdown list is selected EDITION _CB Action generated when the current cell enters or leaves the edition mode ENTERITEM_CB Action generated when a matrix cell is selected becoming the current cell FGCOLOR CB Action generated to retrieve the foreground color of a cell when it needs to be redrawn LEAVEITEM CB Action generated when a cell is no longer the current cell MOUSEMOVE CEB Action generated to notify the application that the mouse has moved over the matrix SCROLL CB Action generated when the matrix visualization surface is changed VALUE _CB Action generated to verify the value of a cell in the matrix when it needs to be redrawn VALUE _EDIT_CB Action generated to notify the application that the value of a cell was changed Additional Functions in lupLua elem setcell lin col number value string Modifies the text of a cell elem getcell lin col number gt cell string Returns the text of a cell Notes The IupMask control can be used to create a mask and filter the text entered by the user in each cell 138 In Motif when start editing a cell using a double click the user must click again to the edit control get the focus Titles A matrix might have titles for lines and columns This must be defined before the matrix is mapped and cannot be changed afterwards A matrix will have line titles if before it is mapped
27. Control Before running any function from the Lua Binding you must run the iuplua_open function to initialize the toolkit This function must be run after a call to function IupOpen All this is done in C in Lua s host program Example int main void TupOpen TupControlsOpen Lua 3 2 initialization could be Lua 4 0 or Lua 5 0 lua_open lua_iolibopen lua_strlibopen lua_mathlibopen 46 iuplua_open Initialize Binding Lua controlslua_open Inicialize CPI controls binding Lua TupMainLoop TupControlsClose TupClose return 0 Generating Applications To use the Lua Binding you need to link the program to the IupLua library and to the Lua library JupLua is available in Lua 3 2 and Lua 5 0 Simple Attributes Each interface element is created as a Lua table and its attributes are indicated as fields in this table Some of these attributes are directly transferred to IUP so that any changes made to them immediately reflect on the screen By means of Lua s tag method system attribute values defined in IupLua can be transferred to IUP being immediately updated However not all attributes are transferred to IUP Some are control attributes such as handle which stores the handle of the IUP element and parent which stores the object immediately above in the class hierarchy Attributes that receive strings or numbers as values are immediately transferred to IUP
28. HOME e END were not working propertly e Clicking or was not activating the SELECT ION_CB callback e SELECTION_CB is now in the binding BEFORESELECTION_CB and AF TERSELECTION_CB are not e The IUP_MARKEDid attribute now returns IUP_YES or LUP_NO depending on the state of the node s mark If the node does not exist the returned value is NULL e IupTree was breaking when it tried to erase a marked node inside BRANCHCLOSE_CB e The BRANCHCLOSE_CB callback was not being called for the correct node e SELECTION_CB was included in the binding e Including a new leaf now does not alter selection IupGL Control e Created attribute ERROR indicating error in a GL canvas IupCB Control e User canvas was not being reactivated after the mouse callbacks IupLua e TupGetGlobal and IupSetGlobal were not doing toupper e New function created to get an Ihandle created in C lupGetFromc e The IUP_BUTTON_CB callback was not being called e Functions isshift iscontrol isbuttonl isbutton2 isbutton3 and isdouble are now exported e IupPreviousField and IupNextField were not implemented e The OPEN_CB callback was implemented in the binding with the name OPEN e New callback TIUP_MOUSEMOVE_CB for matrix Version 1 8 9 07 May 2001 IupMatrx Control e If the user defined FGCOLOR while the mat rix was in edition mode
29. If the specified node does not exist nothing happens This attribute can only be set Possible values MARKED Deletes all marked nodes and all their children SELECTED Deletes only the selected node and its children CHILDREN Deletes only the children of the selected node Returns the identifier of the marked node s parent REDRAW Forces an immediate redraw It is necessary to force a redraw whenever the 157 user adds or removes a node or a branch The value is ignored IupTree Callbacks SELECTION_CB Action generated when an element is selected or deselected This action occurs when the user clicks with the mouse or uses the keyboard with the appropriate combination of keys int function Ihandle self int id int status in C elem selection id status number gt ret number in IupLua3 elem selection_cbh id status number gt ret number in IupLua5 self Identifier of the LupTree interacting with the user id Node identifier status node was selected 0 node was unselected This function must return IUP_IGNORE for the selected node not to be changed or IUP_DEFAULT to change it BRANCHOPEN_CB Action generated when a branch is expanded This action occurs when the user clicks the sign on the left of the branch or when double clicks the branch image or hits Enter on a collapsed branch int function Ihandle self int id in C elem branchopen
30. It inherits from IupCanvas The branches can be expanded or collapsed When a branch is expanded its immediate children are visible and when it is collapsed they are hidden The leaves can generate an executed or renamed action branches can only generate renamed actions Both branches and leaves can have an associated text The selected node is the node with the focus rectangle marked nodes have their background inverted Parameters Return Ihandle IupTree void in C iuptree gt elem iuplua_tag in IupLua3 iup tree gt elem iuplua_tag in IupLua5 tree in LED This function returns the identifier of the created IupTree or NULL if an error occurs Attributes General SCROLLBAR FONT ADDEXPANDED Marks CTRL SHIFT STARTING VALUE MARKED Images IMAGELEAF IMAGEBRANCHCOLLAPSED IMAGEBRANCHEXPANDED IMAGEid IMAGEEXPANDEDid Nodes NAME STATE DEPTH KIND PARENT COLOR 149 Action ADDLEAF ADDBRANCH DELNODE REDRAW Callbacks SELECTION_CB Action generated when an node is selected or deselected BRANCHOPEN_CB Action generated when a branch is expanded BRANCHCLOSE_CB Action generated when a branch is collapsed EXECUTELEAF_CB Action generated when a leaf is to be executed RENAMENODE_CB Action generated when a node is to be renamed RIGHTCLICK_CB Action generated when the right mouse button is pressed over a node Notes Branches may be added in IupLua using a Lua Table see E
31. IupListDialog This dialog shows a simple or multiple list and waits for user feedback Parameters Return int IupListDialog int type char title int size char list int option IupListDialog type number title string size number list table of strin iup ListDialog type number title string size number list table of stri type 1 simple selection 2 multiple selection title Text for the dialog s title size Number of options list List of options option Initial option starting at 1 note that this index is different from the return value kept for compability reasons max_col Maximum number of columns in the list max_1in Maximum number of lines in the list mark Flag vector used only when t ype 2 When t ype 1 the function returns the number of the selected option the first option is 0 or 1 if the user cancels the operation When t ype 2 the function returns 1 when the user cancels the operation If the user does not cancel the operationthe function returns a non zero value and the mark parameter will have value 1 for the options selected by the user and value O for non selected options Comments In IupLua the return value depends on used option In case type is 1 simple selection the return value is a 0 based number of the selected option If the type is 2 multiple selection the return type is a table with the marked options The dialog uses a global attribute called PARENTDIALOG as t
32. K_cF4 K_cF5 K_cF6 K_cF7 K_cF8 K_cF9 ARARRRRAR K _CF1 Ctrl F12 EREE E l pracketieft K_bracketright 193 194 6 eC lt x K_xX O p ESC K_ESC A Q ve Enter BackSpace K_BS N INS Insert J o N J A a Tab K_TAB Home K_HOME G ac N a td PgUp K_PGUP LEFT K_LEFT MIDDLE KM K_RIG a RIGHT END K_END K_DOWN DOWN z O a 5 Ei AU Q Z PgDn K Pause Ti i tj Tj nN tj N 6 AU D G Nn FA 195 Character Fonts HELVETICA_NORMAL_8 TIMES NORMAL _ 8 COURIER_NORMAL 8 HELVETICA_ITALIC_8 COURIER_ITALIC_8 TIMES_ITALIC_8 HELVETICA_BOLD_8 COURIER_BOLD_8 TIMES _BOLD_8 HELVETICA_NORMAL_10 COURIER_NORMAL_10 TIMES NORMAL_ 10 HELVETICA_ITALIC_10 COURIER_ITALIC_10 TIMES_ITALIC_10 HELVETICA_BOLD_10 COURIER_BOLD_10 TIMES _BOLD_10 HELVETICA_NORMAL_12 COURIER_NORMAL_12 TIMES NORMAL_ 12 HELVETICA_ITALIC_12 COURIER_ITALIC_12 TIMES _ITALIC_12 HELVETICA_BOLD_ 14 COURIER _BOLD_14 TIMES _BOLD_ 14 Events IUP is a graphic interface library so most of the time it waits for an event to occur such 196 as a button click or a mouse leaving a window The user can inform IUP that he she wishes callbacks to be called informing that en event has taken place For further information on callbacks see Gu
33. TABTITLE attribute specifying the text to be shown in its tab s title If this attribute is omitted the Tabs behavior is undetermined This function returns the created Tabs s identifier or NULL if an error occurs The second form in C must end the array with a NULL Attributes ALIGNMENT Changes the respective attribute in the internal zbox TABTITLE Contains the text to be shown in the tab s title If this value is NULL it will remain empty This attribute is used only in the elements contained in the tab 133 TABTYPE Indicates the type of tab which can be one of the following TOP BOTTOM LEFT or RIGHT Default is TOP FONT Indicates the font to be used in the internal tab text Font Table FONT_ACTIVE Indicates the font to be used when the tab is selected Font Table FONT_INACTIVE Indicates the font to be used when the tab is inactive Font Table TABSIZE Contains the size of a tab If this value is NULL the tab will be shown with the smallest possible value that fits its title This size can refer to the whole IupTabs thus affecting all tabs or to a specific tab If both are defined the size of a specific tab will have priority over the global IupTabs size VALUE Contains the name of the currently selected tab Changing this attribute adding the name of a different tab makes the latter be the active tab If the provided name does not correspond to any tab nothing occurs To set a name to a tab
34. TupDialog MENUBOX When set this attribute shows the menu box in a dialog title area Value W YES W or NO W Default YES Note This attribute is only consulted when the dialog is first mapped 1 upMap 178 TupShow if the active window management system is mwm Affects TupDialog RESIZE Allows interactively changing the dialog s size Value YES or NO Default YES Note This attribute is only consulted when the dialog is first mapped J TupMap IupShowXY or lupPopup After such it cannot be changed On Motif it only works TupShow if the active window management system is mwm Affects TupDialog MENU Associates a menu to the dialog Value Name of a menu type interface element Affects TupDialog STARTFOCUS IupShowXY or lupPopup After such it cannot be changed On Motif it only works Name of the dialog s element that must receive the focus right after the dialog is opened Value 179 Name of an element Affects TupDialog PARENTDIALOG The dialog that specifies this attribute is treated as the child dialog of the specified value Value Name of a IUP dialog Default NULL Note This behavior is system dependent but usually what happens is this dialog does not move behind its PARENTDIALOG even if the user clicks the PARENTDIALOG If the PARENTDIALOG is minimized this dialog is aut
35. _RELEASE_CB Called when the user releases the left mouse button after pressing it over the dial int function Ihandle self double angle elem buttonrelease angle number gt ret number in IupLua3 elem buttonrelease_cbh angle number gt ret number in IupLua5 Notes When the keyboard arrows are pressed and released the mouse press and the mouse release callbacks are called in this order If you hold the key down a mouse move callback is also called When the wheel is rotated only the mouse move callback is called and it increments the last angle the dial was rotated In these cases the value is incremented by PI 10 18 degrees Examples 124 Creates several Dials and shows each dial s value ina Label JupDial CENX See Also IupCanvas IupGauge Creates a Gauge control Shows a percent value that can be updated to simulate a progression It inherits from IupCanvas Parameters Return Ihandle IupGauge void in C iupgauge gt elem iuplua_tag in IupLua3 iup gauge gt elem iuplua_tag in IupLua5 gauge in LED The function returns the identifier of the created Gauge or NULL if an error occurs Attributes MIN Contains the minimum valuator value Default is 0 MAX Contains the maximum valuator value Default is 1 VALUE Contains a number between MIN and MAX indicating the gauge position DASHED Changes the style of the gauge for a dashed
36. a double click press release In Motif the textbox and the dropdown did not open when you double click a cell But now the user still needs to click again in the control to put it into focus After editing the cell in the last line now the focus goes to the column on the right at the last line instead of the first line BGCOLOR now works also for titles FONT attribute now can be set get just like BGCOLOR and FGCOLOR But the cell size is calculated always from the matrix attribute IUP_FONT e Documentation reviewed and reorganized e CTRL and SHIFT accepts only values IUP_YES and IUP_NO Default value of SHIFT and CONTROL is NO it was NULL Pressing Space without Control now activates the RENAMENODE_CB callback IupLua The selection callback wasn t working in Lua 5 binding MOUSEMOVE_CB in Dial control was receiving wrong angle parameter in Lua 5 binding IupGLCanvas wasn t working in Lua 5 binding Major IupLua5 change It now complies to LTN7 namespaces All exported functions are accessed only through iup FunctionName no up prefix anymore All callbacks in Lua are now access through their exact name in the C API Mostly add sufix _cb to name most common callbacks renamed for ex getfocus_cb killfocus_cb Also some names were fix valuecb gt gt value_cb and mapcb gt gt map_cb Numeric definitions also changed UP_DEFAULT gt gt iup DEFAULT String definitions for values are no longer supported use YES
37. an attribute of the L 0 type is defined It will have column titles if before being mapped an attribute of the 0 C type is defined The size of a line title is given by attribute WIDTHO if it is defined Otherwise it is given by the size of the largest title defined when the matrix is mapped Titles for lines or columns can be generated with more that one text line For such the title value must contain a n The matrix does not by itself change the line s height to fit titles with multiple lines The user must change the line s size manually by using attribute HEIGHTn In IUP s size definition a line with height 8 will fit one text line a line with height 16 will fit two text lines and so on Callback Mode Very large matrices must use the callback mode to set the values and not the regular value attributes of the cells The idea is the following 1 Register the VALUE_CB callback 2 No longer set the value of the cells They will be set one by one by the callback Note that the values of the cells must now be stored by the user 3 If the matrix is editable set the VALUE_EDIT_CB callback 4 When the matrix must be invalidated use the REDRAW attribute to force a matrix redraw A negative aspect is that when VALUE_CB is defined the matrix never verifies attributes of type sd sd Therefore it also does not verify line and column titles which must be given by the
38. as callbacks in C in the same order and they can either return a value or not if no return value is set the IUP_DEFAULT value is returned The following example shows the definition of an action for a button function ok action local aux self fgcolor self fgcolor self bgcolor self bgcolor aux end Or you can do function myaction self end ok action myaction The IUP API binding Even though there are sintatic sugars used to handle callbacks and attributes in Lua most of the functions defined in C are exported to Lua such as IupSetAttribute IupGetBrother among others Exchanging Values between C and Lua Each binding to a version of Lua uses different features of the language in order to implement IUP handles Ihand1le in Lua Therefore functions have been created to help exchange references between Lua and C To push an Thandle in Lua s stack use the function iuplua_pushihandle lua_State L Ihandle n In Lua 3 2 the lua_State parameter does not exist 48 To receive an handle in a C function called from Lua just use one of the following functions according to which Lua you are using lua_getuserdata Lua 3 2 lua_touserdata Lua 4 or lua_unboxpointer in Lua 5 In order to bring IUP handles created in C to Lua the user can give the IUP handle a name by means of 1 Ex lua_ihandle upSetHandle and call in Lua the function 1 TupGetFromC element_name
39. be shown int function Ihandle self int lin int col in C elem dropcheck lin col number gt ret number in IupLua3 elem dropcheck_cb lin col number gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the cell This function must return IUP_DEFAULT to show a dropdown field feedback or IUP_IGNORE to ignore the dropdown feedback DROP_CB Action generated before the current cell enters edition mode to determine if a text field or a dropdown will be shown If this action is not registered a text field will be shown Its return determines what type of element will be used in the edition mode If the selected type is a dropdown the values appearing in the dropdown must be fulfilled in this callback just like elements are added to any list the drop parameter is the handle of the dropdown list to be shown You should also set the list s current value VALUE the default is always 1 The previously cell value can be verified from the given drop Ihandle via the PREVIOUSVALUE attribute int function Ihandle self Ihandle drop int lin int col in C elem drop drop iuplua_tag lin col number gt ret number in IupLu elem drop_cb drop iuplua_tag lin col number gt ret number in Iu self Identifier of the matrix interacting with the user drop Identifier of the dropdown list which will be shown to the us
40. binding and the CPI controls But this is a polemic issue Also IUP does not have a wide localization feature it only includes support for messages in English and Portuguese And it does not have support for Unicode characters Make it Reusable Make it Simple Make it Small Screenshots Click on the picture to enlarge image Jek auns a Bes Hs a re Siirrasi p t sn ORN Guide System Control Before running any of IUP s functions function IupOpen must be run to initialize the toolkit After running the last IUP function function IupClose must be run so that the toolkit can free internal memory and close the interface system Executing these functions in this order is crucial for the correct functioning of the toolkit Between calls to the IupOpen and IupClose functions the application can create dialogs and display them However IUP is an event oriented interface system so it will keep a loop waiting for the user to interact with the application For this loop to occur the user must call the IupMainLoop function which is generally used right before IupClose When the user closes the application function IupMainLoop will return calling IupClose and ending the application s execution Therefore usually an application employing IUP will have a code in the main function similar to the following void main void if IupOpen IUP_ERROR fprintf s
41. boxes vbox horizontal boxes hbox and filling 111 There is also a depth box in which layers of elements can be created for the same dialog and the elements in each layer are only visible when that given layer is active Elements IUP contains several user interface elements The library s main characteristic is the use of native elements This means that the drawing and management of a button or menu is done by the native interface system not by IUP This makes the application s appearance more similar to that of other applications in that system On the other hand the application s appearance can vary from one system to another Even though IUP is not totally object oriented because of the interface system s event mechanism as well as other reasons the elements follow a certain hierarchy The creation process for an element occurs before the creation of the dialog in which that element will be inserted Therefore when the element is created its parent is not known but after the dialog is created all elements receive a parent This mechanism is quite different from that of native systems who first create the dialog and then the element using the dialog as a parent This feature creates some limitations for IUP usually related to the insertion and removal of elements of an already mapped dialog Now we come to the notion of mapping Since the elements are created differently from the native system native elements ca
42. call it after IupOpen Parameters Return void iuplua_open void in C There is no equivalent in Lua Note For a more detailed explanation on the system control for the Lua Binding please refer to Lua Binding System Control See Also IupOpen Guide System Control 66 iupkey_open Allows IUP keyboard definitions to be used in IupLua This function must be run by the host program after Luplua_open Please refer to the Keyboard Codes table for a list of possible values Parameters Return void iupkey_open void in C There is no equivalent in Lua See Also K_ANY callback KEY attribute IupDestroy Destroys an interface element and all of its descendants Parameters Return void IupDestroy Ihandle element in C TupDestroy element iuplua_tag in IuplLua3 iup Destroy element iuplua_tag in IupLua5 or element destroy in IupLua element Identifier of the interface element to be destroyed Notes This function deletes the names associated to the interface elements being destroyed It does not free the memory of attribute values that was allocated by the application ATTENTION The interface elements associated by means of attributes such as menus in dialogs and images in buttons are not destroyed The application will be in charge of such task IupGetFocus Verifies the interface element with keyboard focus that is the element that receives keyboard events Parameters
43. callback The result is that at the moment the matrix is created it resorts solely to the existence of attributes WIDTHO and HEIGHTO to find out if it will have line or column titles That is for such matrices to have titles the WIDTHO and HEIGHTO attributes must be defined This problem is not serious because with IUP s definition of SIZE HEIGHTO 8 will always produce a column title in the size desired Another important reminder if VALUE_CB is defined and VALUE_EDIT_CB is not it is absolutely necessary that the application does not allow the user to edit any cell This must be done by returning IUP_IGNORE in the IUP_ED ON_CB callback In the future this will be done inside the matrix H Utility Functions These functions can be used to help set and get attributes from the matrix void IupMatSetAttribute Ihandle n char a int 1 int c char v void IupMatStoreAttribute Ihandle n char a int l int c char v char IupMatGetAttribute Ihandle n char a int 1l int c int TupMatGetInt Ihandle n char a int 1l int c float IupMatGetFloat Ihandle n char a int 1l int c void IupMatSetfAttribute Ihandle n char a int l int c char f 139 They work just like the respective tradicional set and get functions But the attribute string is complemented with the L and C values For ex TupMatSetAttribute n 30 10 v
44. does not contain r Motif Driver v1 8 2 14 Aug 98 IupFileD1g was corrected the IUP_F ILE and IUP_DTIR attributes were not being treated correctly In some specific situations closing a dialog could lead to the end of LupMainLoop causing an abortion of the application 29 Version 1 8 1 Windows Driver v1 8 1 17 Jul 98 Correction IUP s Matrix element was being shown with different fonts from the ones used by IUP especially on UNIX platforms A bug related to ZBOX was fixed TupAppend on Multiline now includes n at the end of the text e A font set by CD no longer affects canvas size computation TupSetAttribute from a IupRadio s VALUE with the name of a toggle with more than one name now works Default attributes now store values that match the documentation Function TupF lush was implemented Small errors in dialog size computations were corrected Now the dialog size is changed when the size of one of its children increases Motif Driver v1 8 1 16 Jun 98 Correction IUP s Matrix element was being shown with different fonts from the ones used by IUP especially on UNIX platforms e Dropdown list combo box remained opened if the element was hidden or destroyed e The use of popup dialogs was sometimes preventing the last LUP_CLOSE
45. equivalent to the command uname s Windows it identifies if you are on NT WinXP or 98 Several values can be provided Lin Sun Sol TR ux os aris x ATX Win Win Win Win Win Win Win Win SYSTEMVERSION 95 950SR2 98 98SE Me NT 2K XP Informs the current operating system version Value On UNIX it is equivalent to the command uname r On Windows it identifies the system version with build number and service pack version SCREENSIZE sysname On release Returns the screen size in pixels In Windows it excludes the task bar area Value String in the widthxheight format SCREENDEPTH Returns the screen depth in bits per pixel LOCKLOOP 189 190 Locks the loop even when an all dialogs have been closed Possible values YES or NO CURSORPOS This attribute programaticaly changes the cursor position Accept values in the format poshxposv example 200x200 in absolute coordinates relative to the upper left corner of the screen COMPUTERNAME Returns the hostname USERNAME Returns the user logged in Keyboard Codes The table below shows the IUP codification of every key in the keyboard Each key is represented by an integer value defined in the iupkey h file which must be included in the application IUP uses the US default codification this means that if you installed a keyboard specific for your country th
46. found here The GUI Toolkit Framework Page An interesting article can be found here GUI Toolkits for The X Window System Conclusions From the selected toolkits using the defined approach we can eliminate some toolkits The 4 first are not updated anymore or the development is very slow GraphApp is an one author only project FOX has a great look but the license can be restrictive in some cases FLTK promesses a new version with a better look but until then it does not have a pretty good look The FLTK documentation also does not help GTK can be used as a replacement for Motif but not as a portable toolkit since is 34 target for X Windows Qt has several license limitations although is a very stable and powerful toolkit Qt can be also used as a replacement for Motif The best free solution that we choose is wx Widgets becase of the native controls and its portability Developing IUP IUP uses Native Controls in Windows and Motif Mac port is outdated and not maintained for long time MacOS 9 was terrible With Mac OS X we may have the opportunity to do something better IUP is in C is small and powerful But today only 2 developers only a few extra help and many other projects to work simultaneously So it is hard to keep the code updated One possibility that can reduce our demand is to implement IUP on top of one of these toolkits so we can focus on the best of our toolkit its API the dynamic layout the Lua
47. g b in LED r g b intensity 0 255 of red green and blue respectively This function returns the identifier of the created color or NULL nil in IupLua if an error occurs Attributes BLUE Blue intensity GREEN Green intensity RED Red intensity 91 Integer values from 0 to 255 are accepted Notes Though this function exists to help creating colors the simplest way to modify a color is by directly defining values in a string suchas 0 0 255 as specified in attributes FGCOLOR and BGCOLOR This function does not exist in IupLua because the r g b concatenation can be used to obtain the same effect Examples IupFrame Creates a Frame interface element which draws a frame with a title around an interface element Parameters Return Thandle IupFrame Ihandle element in C iupframe element iuplua_tag gt elem iuplua_tag in IupLua3 iup frame element iuplua_tag gt elem iuplua_tag in IupLua5 frame element in LED element Identifier of an interface element which will receive the frame This function returns the identifier of the created frame or NULL if an error occurs Attributes FGCOLOR Text color SIZE Frame size TITLE Text the user will see at the top of the frame MARGIN Margin of the visible element Notes Though this element has the attribute MARGIN it does not have the attributes ALIGNMENT and GAP because it can contain only o
48. id number gt ret number in IupLua3 elem branchopen_cb id number gt ret number in IupLua5 self Identifier of the LupTree interacting with the user id Node identifier This function must return IUP_IGNORE for the branch not to be opened or IUP_DEFAULT for the branch to be opened BRANCHCLOSE_CB Action generated when a branch is collapsed This action occurs when the user clicks the sign on the left of the branch or when double clicks the branch image or hits Enter on an expanded branch int function Ihandle self int id in C elem branchclose id number gt ret number in IupLua3 elem branchclose_cb id number gt ret number in IupLua5 self Identifier of the LupTree interacting with the user id Identifier of the clicked node This function must return IUP_IGNORE for the branch not to be closed or IUP_DEFAULT for the branch to be closed EXECUTELEAF_CB Action generated when a leaf is to be executed This action occurs when the user double clicks the leaf image or hits Enter on a leaf int function Ihandle self int id in C elem executeleaf id number gt ret number in IupLua3 elem executeleaf_cb id number gt ret number in IupLua5 self Identifier of the LupTree interacting with the user id Identifier of the clicked node RENAMENODE_CB Action generated when a node is to be renamed It occurs only
49. if an error occurs Attributes RGB Contains the color selected in the control in the rrr ggg bbb format r g and b are integers ranging from 0 to 255 This value can both be consulted and modified Callbacks DRAG_CB Called several times while the color is being changed by dragging the mouse over the control int drag Ihandle self unsigned char r unsigned char g unsigned char CHANGE CB Called when the user releases the left mouse button over the control defining the selected color elem drag r number g number b number gt ret number in IupLua3 elem drag_cb r number g number b number gt ret number in IupLu int change Ihandle self unsigned char r unsigned char g unsigned cha elem change r number g number b number gt ret number in elem change_cb r number g number b number gt ret number Examples IupDial Creates a dial for regulating a given angular variable It inherits from IupCanvas Parameters Return Ihandle IupDial char type in C iupdial type string gt elem iuplua_tag in IupLua3 iup dial type string gt elem iuplua_tag in IupLua5 dial type in LED tipo dial type Can be HORIZONTAL VERTICAL or CIRCULAR The function returns the identifier of the created dial or NULL if an error occurs Attributes FGCOLOR Controls the foreground color The default value is 64 64 64 The foreground color is n
50. is a table with such parameters to some systems where the IUP library has been tested If the command does not work or if it is not possible then the graphics library really does not support 24 bpp Execution Command startx bpp 24 Since color requests are always successful in TrueColor 24bpp windows we have minimized visualization problems for images that make use of complex color palettes when there is a high color demand not always all colors requested can be obtained The IUP applications also coexist more peacefully with other applications and among themselves since the colors used by TrueColor 24bpp windows do not use the colormap cells used by all applications XtAddCallback failed When a warning about XtAddCallback appears during the application inicialization and it aborts this means that you are using a Motif with a different version than the Motif 210 used to build IUP Reinstall Motif or rebuils IUP using your Motif Win32 Driver This driver was designed for the modern Microsoft Windows in 32 bits 98 2000 XP Environment Variables VERSION When this variable is set UP generates a message indicating the driver s version when initializing Exclusive Attributes HINSTANCE global This attribute returns a handle HINSTANCE that identifies the application in the native system It is a verification only attribute SYSTEMLANGUAGE global Return respectively a text with a description of the s
51. its visual feedback Possible values NYEsy NO Default YES ALIGNMENT Label s alignment Possible values ALEFT ARIGHT ACENTER Default ALEFT SEPARATOR Turns the label into a line separator The EXPAND attribute is updated accordingly Possible values HORIZONTAL VERTICAL Notes Labels with images texts or line separator can not change its behavior after mapped This is a creation attribute But after creation the image can be changed for another image and the text for another text Though this element can have the IMAGE attribute it does not have attributes MINACTIVE and IMPRESS because it does not interact with the user through the mouse or keyboard The n character is accepted for line change but the initial size of the element is computed for one line only In this case the EXPAND attribute must be YES so that the text can be properly visualized Examples See Also upiIimage IupButton 95 IupList Creates a list interface element which is a list of two state on or off items An action is generated when an event changes the state of an item Parameters Return Thandle IupList char action in C iuplist gt elem iuplua_tag in IupLua3 iup list gt elem iuplua_tag in IupLua5 list action in LED action String with the name of the action generated when the state of an item is
52. mapped on the screen After the mapping specifying these special attributes has no effect The specific TupGLCanvas attributes are BUFFER Indicates if the buffer will be single SINGLE or double DOUBLE Default is SINGLE COLOR Indicates the color model to be adopted INDEX or RGBA Default is RGBA BUFFER_SIZE Indicates the number of bits for representing the color indices valid only for INDEX Default is 8 256 color palette RED_SIZE GREEN_SIZE and BLUE_SIZE Indicate the number of bits for representing each color component valid only for RGBA Default is 8 for each component True Color support ALPHA SIZE Indicates the number of bits for representing each color s alpha component valid only for RGBA and for hardware that store the alpha component 160 Default is 0 DEPTH_SIZE Indicates the number of bits for representing the z coordinate in the z buffer Value 0 means the z buffer is not necessary STENCIL SIZE Indicates the number of bits in the stencil buffer Value 0 means the stencil buffer is not necessary Default is 0 ACCUM_RED_ SIZE ACCUM_GREEN_SIZE ACCUM BLUE_SIZE and ACCUM_ALPHA SIZE Indicate the number of bits for representing the color components in the accumulation buffer Value 0 means the accumulation buffer is not necessary Default is 0 STEREO Creates a stereo GL canvas special glasses are required to visual
53. matrix enters edition mode e The matrix was not showing the selected cells when the user changed focus from the matrix e The matrix was not calling K_ANY from the parent if the callback had been set after matrix creation e IUP_RIGHTCLICK_CB is now called IUP_CLICK_CB This callback is now called for every mouse button e New callback IUP_MOUSEMOVE_CB IupTree Control e Attribute IUP_MARKED now also sets e upTree s binding now exports functions to set and get ID e Redraw is now done with one attribute This avoids unecessary redraw when the user wants to insert a lot of data e IupTree now takes leafs and nodes before LupMap e Clicking to selecta LEAF was not always working in Windows e BRANCHOPEN and BRANCHCLOSE callbacks were not testing the return value correctly 19 e Double clicking was not working propertly When the user clicked a node while the timer was still waiting for the second click it was impossible to click a nother node e Hitting the space button with CTRL pressed now marks the element immediatly e SELECTION_CB callback was created This callback is called when any type of mark is made on the Tree The return value blocks this action e Removed callbacks BEFORESELECTION_CB and AFTERSELECTION_CB e Setting IUP_VALUE though programming does not activate callbacks anymore e Keyboard control including arrow keys PGUP PBDOWN
54. or by changing the VISIBLE attribute or by means of a callback returning IUP_CLOSE the elements in this dialog are not destroyed so that you can show them again To destroy dialogs the IupDestroy function must be called See Also TupShowXY IupShow IupPopup lIupDestroy 68 IupMap Creates native interface objects corresponding to the given IUP interface elements Parameters Return int IupMap Ihandle element in C TupMap element iuplua tag gt ret number in IupLua3 iup Map element iuplua tag gt ret number in IupLua5 element Identifier of an interface element Notes When element is of type dialog this function creates the native interface element of a dialog and of each element it contains but only if the element has not been mapped yet When element is not of type dialog this function will only create the native interface element if the element is inside an already mapped dialog If element was already mapped nothing happens If the WID attribute is NULL it means the element was not already mapped This function is automatically called always before a dialog is made visible This way it only makes sense for the application to call it when the value of the WID attribute must be known before a dialog is made visible See Also TupShowXY IupShow ILIupPopup IupPopup Shows a dialog or menu and restricts user interaction only to the specified
55. pattern Default is NO 125 MARGIN Changes the distance from the Gauge s border to its inside It is only one number that works in both directions x and y Default 1 Ex IupSetAttribute mygauge MARGIN 5 TEXT Contains a text to be shown inside the Gauge If it is NULL the percentage value given by VALUE will be shown If the gauge is dashed the text is never shown SHOW_TEXT Indicates if the text inside the Gauge is to be shown or not Possible values YES or NO Default YES FGCOLOR Controls the gauge and text color The default is 64 96 192 FONT Character font of the text SIZE The default is 170x17 EXPAND The default is NO Examples Creates a Gauge with a control bar m upGauge See Also TupCanvas IupGetColor Shows the default IUP dialog which allows the user to select a color Parameters Return int IupGetColor int x int y unsigned char r unsigned char g unsigned chi IupGetColor x y r g b number gt r g b number in IupLua3 iup GetColor x y r g b number gt r g b number in IupLua5 x y x y values of the IupPopup function r g b Pointers to variables that will receive the color selected by the user if the OK button is pressed The value in the variables at the moment the function is called defines the color being selected when the dialog is shown If the OK button is not pressed the r g and b values ar
56. pressed keys in the conventional IUP way e The dropdown list at TupMat rix was losing its current value when the user changed cells e The IupGetColor element was being drawn outside the canvas old problem in cdActivate e The font in IupTabs is now inherited e Attributes ICTL_ACTIVE_FONT ICTL_INACTIVE_FONT ICTL_FONT were 25 implemented in the LupTabs element Attribute IUP_MARGIN was implemented for the IupGauge element Version 1 8 5 18 Apr 2000 The versions of libraries UP and IupLua were synchronized From this version on these tools will be distributed together The library generation mechanism was changed to use libmake All DLLs are available and following the same standard as the DLLs of other Tecgraf libraries e A FAQ was created for IUP http www tecgraf puc rio br mark iup faq iup txt e Several memory management problems were fixed e Attribute IUP_DIALOGTYPE can now assume three values IUP_OPEN IUP_SAVE and UP_DIR Due to the creation of IUP_DIR the IUP_ALLOWDIR attribute is no longer used One more value was added to attribute BGCOLOR IUP_TRANSPARENT used only by the Canvas to avoid unnecessary drawing Function TupGetError was removed from iup h Function lupDataEntry was removed from iup h Windows Driver Function iupdrvSet IdleFunction was adde
57. preview area Callbacks FILE_CB Windows Only Action generated when a file is selected int function Ihandle self const char file name const char status elem file file name status string gt ret number in IupLua3 elem file_cb file name status string gt ret number in IupLua5 self identifier of the element that activated the function file name name of the file selected status describes the currect action Can be INIT when the dialog has started file_name is NULL FINISH when the dialog is closed file_name is NULL SELECT a file has been selected Ok the user pressed the OK button If the callback returns IGNO PAINT the preview area must be repainted This is used only whe Notes In the Windows driver the FileDialog is not altered by IupSetLanguage To show the dialog use function IupPopup In Lua use the popup function Example in C filedlg IupFileDlg IupPopup filedlg IUP_ANYWHERE IUP_ANYWHERE Example in IupLua 3 filedlg iupfiledlg filedlg popup IUP_ANYWHERE IUP_ANYWHERE 109 Examples See Also TIupMessage IupScanf IupListDialog IupAlarm IupGetFile TupPopup IupAlarm Shows a dialog containing a message with up to three buttons and waits for the user to press one Parameters Return int IupAlarm char t char m cha
58. program starts Do not select Support Windows XP Themes e Parameters Linker where you are going to list the libraries you use for example liup liupcontrols lcd lcdiup lcomct132 lole32 In this configuration you are using also the additional library of Controls that uses the CD library also available at the download page e Directories Library Directories and Include Directories where you are going to list the include path for example iup lib mingw3 cd lib mingw3 or c tecgraf iup lib mingw3 c tecgraf cd lib mingw3 And iup include cd include or c tecgraf iup include c tecgraf cd include Project Options In some cases the IDE may force the compilation of C files as C If do not want that then uncheck the option in the settings for each file Still in the Project Options dialog in the Files tab select the file and uncheck Compile File as C Visual C IDE Project Properties Guide This guide was built using Microsoft Visual Studio NET 2003 which includes Visual C 7 1 To create a new project go to the menu File New Project 42 43 Select Win32 Project on the Templates Before finishing the Wizard select Application Settings Mark Windows application and Empty project You can also create a Console application and whenever you execute your application a text console will also be displayed But this is
59. receiving other interface objects are not directly transferred because IUP only accepts strings as a value The metamethod that transfers attributes to IUP verifies if the attribute value is of a widget type that is if it is an interface element If the element already has a name this name is passed to IUP If not a new name is created associated to the element and passed to IUP as the value of the attribute being defined This policy is very useful for associating two interface elements because you can abstract the fact that IUP uses a string to make associations and imagine the interface element itself is being used Callbacks Some attributes are not directly transferred to IUP They are either control attributes or attributes in charge of treating the actions associated to objects Since the use of actions requires registering functions in C to be called when the event occurs there is a differentiated treatment for such attributes The IupLua system does not require the creation and registration of C functions for this purpose Callbacks of different types of interface events are registered by the library when they are initialized These default callbacks call methods of the object receiving the event Each different event calls a different method which can have a few parameters The objects are initialized with none of these methods set so the programmer is in charge of setting them when required They receive the same parameters
60. redraw callback Affects TupCanvas See Also SCROLLBAR POSY Thumbnail position in the vertical scrollbar in any unit Value Any floating point value Must be a value between YMIN and YMAX DY Default 0 0 Note When the canvas is visible a change in POSY generates a redraw in the vertical scrollbar on the screen This attribute does not generate a redraw of the canvas Shall the user need this he she must call a redraw callback Affects TupCanvas See Also SCROLLBAR DX Size of the horizontal scrollbar s thumbnail in any unit Value Any floating point value greater than zero and smaller than the difference between XMAX and XMIN Default 0 1 186 Note A change in these values will only be effective after attribute POSX or POSY has been changed Affects TupCanvas See Also SCROLLBAR DY Size of the vertical scrollbar s thumbnail in any unit Value Any floating point value greater than zero and smaller than the difference between YMAX and YMIN Default 0 1 Note A change in these values will only be effective after attribute POSX or POSY has been changed Affects TupCanvas See Also SCROLLBAR XMAX Maximum value of the horizontal scrollbar in any unit Value Any floating point value Default 1 0 Note A change in this value will only be effective after attribute POSX or POSY is changed 187 Affects TupCanvas Se
61. ret iuplua_tag in IupLua parent Identifier of an interface control lastchild Identifier of the last interface control returned by the function Note This function will return the children of the control in the exact same order in which they were assigned Example Lists all children of a IupVbox include lt stdio h gt include iup h int main Thandle dialog bt lb vbox tmp NULL TupOpen bt TupButton Button mu lb IupLabel Label vbox IupVbox bt lb NULL dialog IupDialog vbox TupShow dialog while 1 tmp IupGetNextChild vbox tmp if tmp printf vbox has a child of type s n IupGetType tmp else break TupMainLoop IupClose return 0 See Also TupGetBrother IupGetBrother Returns the brother of a control or NULL if there is none Parameters Return Thandle IupGetBrother Ihandle econtrol in C IupGetBrother control iuplua_tag gt ret iuplua_tag in IupLua3 iup GetBrother control iuplua_tag gt ret iuplua_tag in IupLua5 control Brother of interface control given See Also IupGetNextChi led 74 75 IupGetType Verifies the name of the type of an interface element Parameters Return char IupGetType Ihandle elem in C IupGetType elem iuplua_tag gt name string in IupLua3 iup GetType elem iuplua_tag gt name string in IuplLua5
62. return the same value associated to the get size field Prototype int setnaturalsize Ihandle s This method is called by IUP for the control to sf function must call functions iupSetCurrentWidt Parameters w width in pixels and h height in p values the control dimensions can have Prototype void setcurrentsize Ihandle This method is called by IUP for the control to de window Parameters x and y represent the positic control the control must have computed by IUP method need only be changed if the control has s Prototype void setposition Ihandle sel This method is called to provide a new value to a method is called the attribute s value is already u environment The received parameters mean the 1 being changed value is the new attribute value value Prototype void setattr Ihandle self c value This method is called by IUP to verify the value by parameter attr This method is called before Il environment If this method returns nul 1 IUP v environment If this check also returns nu11 the getdefaultattr field is called Prototype char getattr Ihandle self This method is called by IUP when verifying an lt to the method related to the getattr field and th attribute environment fail returned nu11 54 Prototype char getdefaultattr Ihandle This method is called by IUP when wishing to ve This function must write to the w and h paramet
63. rewritten over the new CPI this will be done progressively in the next versions The Ihandle definition changed from void to typedef struct Ihandle_ Ihandle This has direct implications on C applications that did not do pointer typecast In C code errors might occur and in C there might be warnings 15 New control IupTimer Allows creating timers in Windows and Motif New callback KEYPRESS_CB Allows intercepting any key and replacing all callbacks K xxx TupHelp was rewritten in a simpler way In Windows it simply uses the system s configuration to open a URL and in UNIX it directly runs Netscape or another executable configured by an environment variable New attribute FULLSCREEN allows creating a dialog that occupies exactly the whole screen Dialog IupGetFile was rewritten using lupFileDlg Windows New attribute CURSORPOS allows programmatically changing the cursor s position on the screen New attribute NOOVERWRITEPROMPT for lupFileD1g It prevents IupFileDlg in Save mode from asking the user if s he really wishes to overwrite a file Problem corrected in the file list in the use of attribute MULTIPLE_FILES for IupFileD1g When only a folder was selected it was not setting the STATUS attribute in a cancelled action Greater driver stability Inandle is no longer dependant on the native handle HWND New global attributes HINSTANCE SYSTEMLANGUAGE COMPUTERNAME
64. self handle id number gt ret userdata in IupLu self Identifier of the LupTree interacting with the user id Node identifier Returns the pointer associated to the node int IupTreeGetId Ihandle self void userid in C TupTreeGetId self handle userid userdata gt ret number in IupLua iup IupTreeSetTableId self handle iup TreeSetTableId self handle iup iup iup iup Examples TreeGetId self handle userid self Identifier of the LupTree interacting with the user userid Pointer associated to the node Returns the id of the node on success and 1 on failure id id 152 IupLu userdata gt ret number in number table table in IupLua3 number table table self Identifier of the IupTree interacting with the user id Node identifier table Table that should be associated to the node or leaf Use nil value to free reference Notes This function needs to be called again freeing the node from the table or the table will never be garbage collected Also the user should not use the same table to reference different nodes neither in the same nor across different trees ab ab TreeGetT TreeGetT leId self handle leId self handle table table tabl tabl e e gt gt ret ret self Identifier of the TupTree interacting with the user table Table that should be associated to the node or leaf
65. small libraries instead of one big library Almost all available toolkits today are in C only so C applications are excluded also this means a hundred classes to include and understand each member function The use of attributes makes a lot of things more elegant and simpler to understand e Native Look amp Feel Many toolkits draw their own controls This gives an uniformity among systems but also a disparity among the available applications in the same system Native controls are also faster because they are drawn by the system But the problem is what s native in UNIX Some commercial applications in UNIX start using Motif as the native option It is the official standard but because of license restrictions before the OpenMotif event the system became old and some good alternatives were developed including GTK and Qt Toolkits With these characteristics in mind we select some of the available toolkits ie 33 Name __ License cae Version Language Platforms Controls Team Comments fy fom Bejo fee fn e i 2000 Win X Still no 1 0 License zker ert a CORBA was from Digital ra pone ti earn target for X 1997 Windows basis K bd GTK LGPL 2004 03 2 4 C Win X own of GNOME Windows is apart X is free for Non Commercial basis of KDE a Noa A many Windows is paid Emulates the native look and feel 1992 Win X gt 1994 2004 08 Aes ica aad a More toolkits can be
66. the edition mode pressing any character key makes the current key to enter in the edition mode the old text is replaced by the new one being typed If Enter or Space is pressed the current cell enters the edition mode If Del is pressed the whole contents of the cell will be deleted Double clicking a cell also enters the edition mode When the matrix is in the edition mode to confirm the entered value press Enter By pressing Esc the previous value is restored If the cell leaves the edition mode for any other reason for instance the user shifted the current cell or the user clicked in another control the value will be confirmed After pressing Enter to confirm the value the focus goes to the cell bellow the current cell if at the last line then the focus goes to the cell on the left Examples Creates a simple matrix with the values and layout shown in the image below There is also a menu that allows making some changes to the matrix 140 Alterar Infla o Rem dios Alimentos Energia See Also TupCanvas IupMatrix Attributes Cell Attributes L C Text of the cell located in line L and column C where L and C are integer numbers These are valid only in normal mode L 0 Title of line L 0 C Title of column C 0 0 Title of the area between the line and column titles ALIGNMENTn Alignment of the cells in column n where n must be replaced by the wished column number n gt 0 Possible
67. the makefile to reflect these changes IupTree 16 e In one case the active CD canvas was not being returned to the old canvas before drawing IupGL e In Linux the additional GLw library was added to the control library e New attributes for query in UNIX CONTEXT GLXContext VISUAL XVisuallInfo COLORMAP Colormap Version 1 9 1 17 Oct 2002 General e Version number now resides in iup h it is also included in the library during compilation Windows Driver e ITupLabel with n was not working e Line break in attribute IUP_TIP is now accepted e Double click in the Windows top left corner made the program crash e IUP_READONLY was only accepted if used before IupMap ina IupText or TupMultiline e Windows Driver was limiting initial elements of a TupList to 999 e New attribute FULLSCREEN created e The codes of the numeric keyboard when the CapsLock was turned on were not mapped correctly to IUP e New callback added MENUSELECT_CB called when the mouse hovers over a menu or item not fully implemented Motif Driver e I UP_MOTFONT did not accept IUP fonts Now it accepts both native fonts and IUP fonts e It is acceptable now to select an option in a popup menu with any mouse key e Attribute T UP_STATUS in a filedlg was not working in a silicon IupLua Better error messages In the iupt ree control the callback BRANCHOPEN_CB was not p
68. the typed key Please refer to the Keyboard Codes table for a list of possible values after Represents the new text value in case the key is validated 1 e the callback returns IUP_DEFAULT If the function returns IUP_IGNORE the system will ignore the typed character If the function returns the code of any other key IUP will treat this new key instead of the one typed by the user Notes Text is always left aligned On the Windows driver the act ion callback is not called for the function keys K_F The IupMask control can be used to create a mask and filter the text entered by the user Examples See Also TupMultiLine IupTimer Creates a timer which periodicaly invokes a callback when the time is up Parameters Return Thandle IupTimer in C iluptimer gt elem iuplua_tag in IupLua3 iup timer gt elem iuplua_tag in IupLua5 timer in LED The function returns the identifier of the created handle or NULL if an error occurs Attributes TIME The time interval in miliseconds 101 RUN Starts the timer Possible values YES or NO Callbacks ACTION_CB Called when the time is up int function Ihandle self in C elem action gt ret number in IupLua self Timer handle Examples IupToggle Creates the toggle interface element It is a two state on off button that when selected generates an action that activates a funct
69. values ALEFT ACENTER or ARIGHT Default ALEFT BGCOLOR Background color of the matrix BGCOLORL C Background color of the cell in line L and column C BGCOLORL Background color of the cells in line L BGCOLOR C Background color of the cells in column C When more than one of the four types of attributes that define the background color are defined or if two of them are in conflict the color of a cell will be selected following this priority BGCOLORL C BGCOLORL BGCOLOR C and last BGCOLOR L or C gt 0 but only the second forms is valid for titles FGCOLOR Text color FGCOLORL C Text color of the cell in line L and column C FGCOLORL Text color of the cells in line L FGCOLOR C Text color of the cells in column C When more than one of the four types of attributes that define the text color are defined or if two of them are in conflict the text color of a cell will be selected following this priority FGCOLORL C FGCOLORL FGCOLOR C and last FGCOLOR L or C gt 0 but only the second forms is valid for titles FONT Character font of the text This attribute must be set before the control is showed It affects the calculation of the size of all the matrix cells 141 FONTL C Text font of the cell in line L and column C FONT Text font of the cells in line L FONT C Text font of the cells in column C The cell size is always calculated from the base FONT attribu
70. when the user double clicks the text associated to a node leaf or branch int function Ihandle self int id char name in C elem renamenode id number name string gt ret number in IupLua3 elem renamenode_cb id number name string gt ret number self Identifier of the LupTree interacting with the user id Identifier of the clicked node name Name of the clicked node RIGHTCLICK_CB Action generated when the right mouse button is pressed over the TupTree int function Ihandle self int id in C elem rightclick id number gt ret number in IupLua3 elem rightclick_cb id number gt ret number in IupLua5 self Identifier of the LupTree interacting with the user id Identifier of the clicked node The canvas callback K_ANY if set will be called before the internal callback The TupGetAttribute always returns the internal callback The canvas callbacks ACTION SCROLL CB MAP_CB RESIZE _CB and BUTTON_CB can not be changed The other callbacks can be freely changed See IupCanvas Others The following controls and utilities are offered in separate libraries e IupGLCanvas Creates an OpenGL canvas e IupLoadImage Creates an image from file using the IM library IupGLCanvas Creates an OpenGL canvas drawing area for OpenGL It inherits from IupCanvas Initialization and Usage 159 The IupGLCanvasOpen function must be called af
71. CHANGE The IupSetAttributes function now returns the Inandle CHANGE The IupSetAttribute function no longer returns the old value CHANGE CPI s create method now creates the handle CHANGE New function for CPI class creation CHANGE Some obsolete definitions of iup h are now only available when the IUP_COMPAT macro is set e CHANGE The ICTL_TYPE attribute of the TupTabs control was changed to CTL_TABTYPE Lua Binding e NEW iupkey_open function allows using IUP s key definitions in Lua Windows Driver e NEW Image now accepts BGCOLOR color This turns the color associated to the index into the background color of the element linked to the image e BUG the IUP_TITLE attribute of the IupItem element can now be changed after the element has been mapped e BUG A color problem was fixed it occurred when the name or path of the executable file contained spaces Motif Driver e BUG The dropdown list no longer remains on the screen e BUG The computation of scrollbar attributes POSX and POSY was fixed e BUG Double click was only being generated for the first button e BUG FRAME layout was corrected e BUG The color of the menu item was corrected e BUG The management of the nested elements of a ZBOX and or with the VISIBLE attribute defined for its children was fixed e BUG The color remained undefined when the value of attribute FGCOLOR or BGCOLO
72. CTRL When a user keeps the Control key pressed the individual marking mode is used This way the selected node can be modified without changing the marked node To reverse a node marking the user simply has to press the space bar When the user keeps the Shift key pressed the block marking mode is used This way all nodes between the selected node and the initial node are marked and all others are unmarked The initial node is changed every time a node is marked without the Shift key being pressed This happens when any movement is done without Shift or Control being pressed or when the space bar is pressed together with Control Removing a Node with Del You can simply implement a K_ANY or KEYPRESS_CB and do int k_any Ihandle self int c if c K_DEL TupSetAttribute self DELNODE MARKED IupSetAttribute self REDRAW return IUP_DEFAULT 151 Navigation Using the keyboard Arrow Up Down Shifts the selected node to the neighbor node according to the arrow direction Arrow Left Right Makes the branch collapse expand Home End Selects the root last node Page Up Page Down Selects the node one page above below the selected node Enter If the selected node is an expanded branch it is collapsed if it is a collapsed branch it is expanded if it is a leaf it is executed Space If the Control key is pressed marks or unmarks a node if not calls the rename ca
73. General 18 e The K_ANY callback now considers the state of the CAPSLOCK key The native behavior of the combination of the keys CAPSLOCK and SHIFT was kept e New binding for IUP Lua 4 0 e New binding for TupMask Windows Driver e Driver Windows now deals only with messages generated for IUP elements this used to be a problem with CD s print dialog e Label fonts did not work when set before IupMap e Attribute IUP_FILTERUSED now can be set on before the creation of lupFileDlg e Tip in Windows now accepts n e Tip in Windows is now modified immediatly after it is set though programming e Tip now can be removed immediatly e Ina SubMenu the attribute ACTIVE was not working propertly e The OPEN_CB callback was implemented in the SubMenu Motif Driver e Callback OPEN_CB ina SubMenu was providing wrong parameter e Attribute TUP_BORDER in a dialog was working differently from the manual when the window manager was sawfish IupMask Control e IupMask was becoming unstable when the user set the attribute LUP_SELECTION ina TupText e There was a bug in the lupMask IupMatrix combination IupMatrx Control e Adding a new column or line is now correctly dealing with color inheritance e There was UP_MARK_MODE defined but not IUP_LIN IUP_COL IUP_LINCOL and TUP_CELL e The drop_cbh callback was being called for any focus change It is now being called just when the
74. IUP Portable User Interface Version 2 2 iup tecgraf puc rio br IUP is a portable toolkit for building graphical user interfaces It offers a configuration API in three basic languages C Lua and LED UP s purpose is to allow a program to be executed in different systems without any modification therefore it is highly portable Its main advantages are e high performance due to the fact that the system uses native interface elements e fast learning by the user due to the simplicity of its API This work was developed at Tecgraf PUC Rio by means of the partnership with PETROBRAS CENPES The IUP Team Antonio Escano Scuri Mark Stroetzel Glasberg Tecgraf Computer Graphics Technology Group PUC Rio Brazil http www tecgraf puc rio br iup Overview IUP is a portable toolkit for building graphical user interfaces It offers APIs in three basic languages C Lua and LED Its library contains about 100 functions for creating and manipulating dialogs IUP s purpose is to allow a program to run in different systems without changes this toolkit provides the applications a high portability Supported systems include Motif Microsoft Windows 98 Microsoft Windows NT Microsoft Windows 2000 and Microsoft Windows XP IUP uses an abstract layout model based on the boxes and glue paradigm from the T X text editor This model combined with the dialog specification language LED or with the Lua binding JupLua makes th
75. Image function The EdPatt and the IMLAB applications can load and save images in LED format They allow operations such as importing GIF images and exporting them as IUP images EdPatt allows you to manually edit the images and also have support for imagens in TupLua You can donwload several IUP images in LED format from iup_images zip To view the images you can use the LED viewer application see Iup View in the applications included in the distribution Application icons are usually 32x32 Toolbar bitmaps are 24x24 Menu bitmaps and small icons are 16x16 Examples See Also TupLabel IupButton IupToggle IupLabel Creates a label interface element which displays a text or an image Parameters Return Thandle IupLabel char title in C iuplabel title title string gt elem iuplua_tag in IupLua3 iup label title title string gt elem iuplua_tag in IupLua5 label title in LED title Text to be shown on the label This function returns the identifier of the created label or NULL nil in IupLua if an error occurs 94 Attributes BGCOLOR Background color of the text FGCOLOR Text color FONT Character font of the text IMAGE Label image When this attribute is defined the text is not shown SIZE Label size TITLE Label s text ACTIVE Activates or deactivates the label The only difference between an active label and an inactive one is
76. It indicates if the display allows the creation of TrueColor windows gt 8bpp even if the default is PseudoColor Tabs a problem was fixed concerning the use of the VISIBLE attribute for elements belonging to a non selected tab IupHelp allows using a browser default Netscape for viewing HTML pages The ACTION_CB callback from IupText now receives apart from IThandle and int a char pointing to the new text value in case the key is confirmed Dropdown lists were not correctly processing the VISIBLE attribute A problem with the initialization of multiple selection lists was solved the VALUE attribute was not being respected in some cases Attributes FGCOLOR and BGCOLOR from the dropdown list were not being correctly updated IupLoopStep was re implemented now it no longer blocks when there are no events to be processed it simply returns DEFAULT The dropdown list is closed when the associated textbox is totally or partially darkened e The dropdown list was not being closed when the dialog lost the focus if TIupIdle was registered e A problem in the exhibition of CPI controls was fixed e New return code CONTINUE was created specific for key callbacks to be used when the event is to be propagated to the parent of the element receiving it In some situations elements destroyed by means of IupDest roy were receiving events making the application abort e The redefinition of items in the main menu was making the dialog return to its
77. JupLua For now you should use TupGetNextChild and IupGetBrother Fix names of headers initialization functions and libraries that do not have the iup prefix Improve the fullscreen policy Add a Tutorial section to the manual with some simple examples Install IUP in a GForge environment Motif e Callback SHOW_CB is not called when the dialog is hidden because of PARENTDTALOG e Sometimes the size of TEXT when it is opened is much larger in old SunOS Resizing makes the text go back to the correct size The problem persists even if run on Linux simply by viewing it on SunOS seems to be a bug in the SunOS Motif e Several warnings in the SunOS when using the OpenGL canvas e When another Window Manager is running the TupPopup disable the other windows but they can be placed in front of the popup window if PARENTDIALOG is not used Also in this case some window decorations do not work Windows e Enable XP Visual Styles When using a manifest file the text in the controls are being mixed with unicode chars IupControls e A vertical lupGauge TupMatrix e In Motif when start editing using a double click the user must click again to the edit control get the focus e When removing a line if it has the focus an invalid call to enteritem_cb leave_item_cb will occur for the removed cell e Copy and paste compatible with Excel e Sort for columns IupTree e Drag and Drop 32 e Rename node like in Iu
78. L nil in Lua the attribute will be removed Note 84 The value stored in the attribute is duplicated See Also TupSetAttribute IupGetGlobal IupSetGlobal IupSetGlobal Defines an attribute for the global environment Parameters Return void IupSetGlobal char a char v in C TupSetGlobal attribute string value string in IupLua3 iup SetGlobal attribute string value string in IupLua5 a name of the attribute v value of the attribute If it equals NULL nil in IupLua the attribute will be removed Notes The value stored in the attribute is not duplicated Therefore you can store your private attributes such as a structure of data to be used in a callback When you want IUP to store the attribute s value by duplicating the string use function IupStoreGlobal See Also TupSetAttribute IupGetGlobal IupStoreGlobal IupGetGlobal Verifies an attribute s value in the global environment Parameters Return char IupGetGlobal char a in C TupGetGlobal a string gt value string in IupLua3 iup GetGlobal a string gt value string in TIupLua5 a name of the attribute This function returns the attribute s value If the attribute does not exist NULL nil in Lua is returned Note This function s return value is not necessarily the same one used by the application to define the attribute s value The subsequent call to the IupGetGloba
79. OM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE History of Changes Version 2 2 2 07 Oct 2004 General e Fixed bug in IupGetFile FILTER initialization e Improved IMINACTIVE automatic generation algorithm e New zip package for download with iup images in LED format e New application IupView to load and display LED files e Fixed some attribute storage in iupMask and IupGetParam Fixed bug when several masks are used in the same dialog e Replaced the internal Lua4 code for a smaller hash table module Thanks to Danny Reinhold e Fixed IupGetParam invalid memory access e IupNextField and IupPreviousField now only changes the focus for the checked toggle inside a radio e lupGetAttributes now returns the pointer address if attribute is a known internal pointer data e Now pressing Enter over a button activates it even if it is not the DEFAULTENTER button e Esc and Backspace keys now will be translated even if CapsLock is active Windows e New ENTERWINDOW_CB and LEAVEWINDOW_CB for buttons e Fixed double click for button toggle and list were not being considered as two clicks e removed FLAT style from toggles with IMPRESS image Fixed size of toggle with image e New attribute SHOWDROPDOWN to open the dropdown list programmatically e Removed a black border around IupMultiline and IupText e Removed the TABSTOP for non marked Toggles inside a Radio e Fixed invalid memory access when men
80. Other values such as functions or objects are stored in IupLua and might receive special treatment as will be explained later For instance a button can be created as follows defining a title and the background color ok iupbutton title Ok bgcolor 0 255 0 Font color can be subsequently changed by modifying the value of attribute Egcolor ok fgcolor 255 0 0 Note that the attribute names in C and in IupLua are the same but in IupLua they can be written in lower case The names of element creation functions are also in lower case since they are actually constructors of Lua tables Some parameters are required attributes such as title in buttons Their types are checked when the element is created The required parameters are exactly the paremeters that are necessary for the element to be created in C Some interface elements contain one or more other elements as is the case of dialogs lists and boxes In such cases the object s element list is put together as a vector that is the elements are placed one after the other separated by commas They can be accessed by indexing the object containing them as can be seen in this example box iuphbox bt1l bt2 bt3 box 1 fgcolor 255 0 0 changes btl foreground color box 2 fgcolor caixa 1l fgcolor changes bt2 foreground color Other Attributes 47 While the attributes receiving numbers or strings are directly transferred to IUP attributes
81. PGUP the node one page below PGDN the node one page above NEXT the node following the selected node If the selected node is the last one the last one will be used instead PREVIOUS the previous node of the selected node If the selected node is the root the root will be used instead The following values are also accepted but they are independent from the state of the Control and Shift keys and from the CTRL and SHIFT attributes And the selected node is not changed These values are kept here for backward compatibility but they would fit better in the MARKED attribute Ww INVERT Inverts the node s marking Using the INVERTid form where id is the node identifier it is possible to invert the marking of any node BLOCK Marks all nodes between the selected node and the initial block marking node see Navigation Multiple Marking CLEARALL Unmarks all nodes MARKALL Marks all nodes INVERTALL Inverts the marking of all nodes MARKED The marking state of the selected node Using the MARKEDid form where id is the node identifier it is possible to retrieve or change the marking state of any node Possible values YES The node is marked NO The node is not marked Returns NULL if the node s id is invalid CTRL Activates or deactivates the Control key function Possible values YES Control key activated allows marking individual nodes NO Control key deactivated d
82. P_APPEND on Motif was ignoring the maximum number of characters Some ITALIC fonts were not working Several visibility problems were fixed for ZBOX inside a ZBOX The default value of the ALLOWNEW attribute in fi leopen mode allowed creating a new file now standardized IupTabs Control IupTabs was not considering attribute IUP_ALIGNMENT Tabs was not showing the selected element if it was selected while the Tabs was invisible it was a Motif bug The lt TAB gt key was neither passing the focus to IupTabs nor taking the focus off it The SIZE attribute is now defined for the tabs of IupTabs ICTL_TABSIZE Changing the text value for Tabs was not recomputing the Tabs size The appearance of TupTabs was enhanced IupTabs now sends the focus back to the first element when the user tries to shift right after 21 the last element e Now a redraw can be forced on Tabs with the I UP_REDRAW attribute IupMat rx Control e Ctrl arrows was not working properly e The behavior of the DEL key to delete a set of cells now also considers the return of the UP_EDITION_CB callback e The mark is now shown not the focus when mat rx loses the focus users were having problems when wishing to hit a button to cause an action over the matrix e Oh the NT platform the fields of the created matrix had the wrong values when an automatic scroll occurred e Right
83. R was not valid e BUG General cleaning was made to remove memory leaks from the driver e NEW Attributes IUP_X and IUP_Y to provide the pixel position of any element e NEW Attribute IUP_RASTERSIZE can be consulted e NEW Menu item now accepts t to align the text to the right Windows already allowed it e NEW Version number was added can be retrieved with tecver e CHANGE Multiline s scrollbar is no longer deactivated with ACTIVE NO e CHANGE Multiline s and list s BGCOLOR no longer affects the scrollbars Version 1 7 e The implemented code was made compatible with manual specifications iup h was changed to reflect that To use old definitions set IUP_COMPAT before including the iup h file to the applications To Do 31 General e Allow the functions IupAppend and IupDetach to be used for dynamic creation of menus and IupTabs To allow IupShow after a IupPopup To show a border for visual location of VBOX HBOX and FILL Can be a dialog attribute Transform all controls into CPI controls improve the possibility of implementing new drivers Flat button activated by mouse hover a gtk driver in Linux a wx Widgets driver a MacOS X driver Reduce flicker when dialog is resized Change all comments in the source code to english Add comments to the internal includes for Doxygen e Attribute for boxes to retrieve the child controls like in
84. Return Thandle IupGetFocus void in C TupGetFocus gt elem iuplua_tag in IupLua3 iup GetFocus gt elem iuplua_tag in IupLua5 This function returns the identifier of the interface element which at the moment is receiving keyboard events See Also 67 LupSst Focus IupSetFocus Defines the interface element that will receive the keyboard focus i e the element that will receive keyboard events Parameters Return Thandle IupSetFocus Ihandle element in C IupSetFocus element iuplua_tag gt elem iuplua_tag in IupLua3 iup SetFocus element iuplua_tag gt elem iuplua_tag in IupLua5 element identifier of the interface element that will receive the keyboard focus This function returns the identifier of the interface element that will receive the keyboard focus See Also IMpoerLroOcus IupHide Hides an interface element This function has the same effect as attributing value NO to the interface element s VISIBLE attribute Parameters Return int IupHide Ihandle element in C TupHide element iuplua_tag gt ret number in IupLua3 iup Hide element iuplua_tag gt ret number in IuplLua5 or element hide gt ret number in IupLua element Identifier of the interface element This function returns IUP_NOERROR if the element was removed from the screen Note Once a dialog is hidden either by means of IupHide
85. SIZE 5 canvas IupSetAttributes IlupCanvas repaind_cb BORDER NO R TupSetAttributes IupFill SIZE 5 NULL TupSetAttributes IupFill SIZE 5 82 NULL TITLE Teste Example Creates a list with country names and defines Japan as the selected option In C Thandle lista IupList acao_lista TupSetAttributes lista VALUE 3 1 Brazil 2 USA 3 Japan 4 France See Also IupGetAttribute IupSetAttribute IupGetAttributes TupStoreAttribute IupGetAttributes Verifies all attributes of a given element that are in the internal hash table The known internal pointers are returned as integers Parameters Return char IupGetAttributes Ihandle element in C IupGetAttributes element iulua_tag gt attributes string in IupLua3 lup GetAttributes element iulua_tag gt attributes string in IupLua5 element Identifier of the interface element attributes in the form vl al v2 a2 where vi is the name of an attribute and ai is its value This function returns all attributes defined for that element See Also IupGetAttribute IupSetAttribute IupSetAttributes TupStoreAttribute IupGetFloat Verifies the value of an interface element attribute and converts it to a float value Parameters Return Hh loat IupGetFloat Ihandle element char a in C There is no equivalent in IupLua E j e
86. See Also IupGetAttribute IupSetAttribute IupSetAttributes TupGetAttributes IupStoreAttribute IupGetAttribute Verifies the name of an interface element attribute Parameters Return char IupGetAttribute Ihandle element char a in C TupGetAttribute element iuplua_tag a string gt value string in IupLua3 iup GetAttribute element iuplua_tag a string gt value string in IupLua5d element Identifier of the interface element a name of the attribute This function returns attribute s value If the attribute does not exist NULL nil in TupLua is returned Notes This function s return value is not necessarily the same one used by the application to define the attribute s value The subsequent call to the IupGetAttribute function may change the contents of the previously returned pointer as this is an internal IUP buffer The user is in charge of storing the value before calling any other IUP function The user has to understand that there is a difference between IUP attributes such as VALUE or SIZE and those stored for the user The IUP attributes are often dynamically computed stored in a temporary buffer and returned for the user to have access to the 81 values In the case of attributes stored for the user the pointer returned by IupGetAttribute will be the same as the stored pointer allowing the contents to be changed The pointers of internal IUP attributes retur
87. _FGCOLOR was not working on Windows unless its background color was also changed upItem outside a submenu was not calling the callback On Windows the IUP_HOTSPOT attribute was being read incorrectly the correct form is with 00 IupMat rix Control DROPDOWN s function in Matrix was corrected Now the user fulfills the dropdown values which always start at position 1 If the user wishes he she can set the initial dropdown value by checking the I UP_PREVIOUSVALUE attribute about the dropdown element passed as parameter This attribute returns the previously selected string value Dropdown now enters edition mode just as regular fields do Dropdown can automatically close after the user s choice Simply return IUP_CONTINUE for the callback chosen by the dropdown Now the dropdown accepts the ESC key restoring its previous value An element with focus is now drawn with double focus The color of a selected element is now 20 attenuated When the user entered edition mode using the mouse and exited it hitting ENTER the cell remained selected Matrix no longer gets lost when it has 0 lines Matrix was not accepting a user to return a constant string with n from a callback A Matrix that loses the focus does not lose the selection but it is not apparent TAB no longer changes cells in the Matrix it now changes IUP elements Hitting dele
88. a very useful situation so you can the use standard C printf function to display textual information for debugging purposes Then add your files in the menu Project Add New Item or Project Add Existing Item After creating the project you must configure it to find the IUP includes and libraries In Visual Studio there are two places where you can do this One is in the menu Tools Options then select Project Visual C Directories Select Include Files or Library Files in Show directories for In this dialog you will configure parameters that will affect all the projects you open Or you can configure the parameters only for the project you created In this case go the menu Project Properties To configure the include files location select C C General in the left tree then write the list of folders separated by in Additional Include Directories To configure the library files location select Linker General in the left tree then write won the list of folders separated by in Additional Library Directories 44 Now you must add the libraries you use In this same dialog select Linker Input in the left tree then write the list of files separated by spaces in Additional Dependencies hase gt ee sose Ma poen EEEE we eee te tet In this sample configuration the project is using the additional library of Controls that uses the CD library also available at the d
89. ameras VCRs and TVs Windows only e IupDB Portuguese DISCONTINUED Associates controls to database fields Attributes Attributes are used to add or remove characteristics to from elements Each element has a set of attributes that affect it and each attribute can work differently for each element Depending on the element its attribute s value can be computed or simply verified it can be internally stored or not If an element does not have a given attribute defined this attribute will be inherited from its parent Only a few attributes are not inherited IUP_TITLE IUP_VALUE UP_ALIGNMENT IUP_X IUP_Y IUP_RASTERSIZE and IUP_SIZE For further information on attributes see Guide Attributes ATENTION Not all attributes are listed here Some are described only in the documentation of each control All Attributes that affect all elements or all of the elements with user interaction or most of them Image Attributes that affect element IupImage Item SubItem Affects menu composition elements Item and SubItem List Attributes that change the functioning of element IupList 163 Vbox Hbox Zbox Frame Attributes that affect dialog composition elements Button Toggle Label Attributes that affect buttons toggles and labels which are basic elements for constructing the dialog Text Attributes that affect element IupText which allows the us
90. and font can be set by the user by means of a resource file called Iup It must be in the user s home or in a directory pointed to by the XAPPLRESDIR environment variable Below you can see an example of this file s contents background ff0000 foreground a0ff00 fontList misc fixed bold r normal 13 208 The values used in the example above are the ones used by IUP if these resources are not defined Generating Applications IUP Motif is composed by two libraries iupmot and iup They use the Motif Xm Xtoolkit Xt and Xlib X11 libraries To link an application to IUP use the following options in the linker call in the same order liup 1Xm 1Xmu 1Xt 1X11 lm Though these are the minimum requirements depending on the platform other libraries might be needed Typically they are X extensions Xext needed in SunOS and Xpm needed in Linux They must be listed after Xt and before X11 For instance liup 1Xm 1Xmu 1Xt 1Xpm 1Xext 1X11 1m Usually these libraries are placed in default directories being automatically located by the linker When the linker warns you about a missing library add their location directories with option L In Tecgraf some machines require such option Padrao L usr lib I usr include Linux L usr X11R6 lib I usr X11R6 include IRIX L usr 1ib32 I usr include X11 Solaris L usr openwin lib I usr openwin share include X11 AIX I usr in
91. andle self in C elem killfocus gt ret number in IupLua3 elem killfocus_cb gt ret number in TIupLua5 self identifier of the element that lost keyboard focus Affects All elements with user interaction except menus See Also GETFOCUS CEB LEAVEWINDOW_CB Action generated when the mouse leaves a canvas Callback int function Ihandle self in C elem leavewindow gt ret number in IupLua3 elem leavewindow_cb gt ret number in IupLua5 self identifier of the canvas the mouse left Affects TupCanvas MAP_CB Called right after an element is mapped Callback int function Ihandle self in C elem mapcb gt ret number in IupLua3 elem map_cb gt ret number in TIupLua5 Affects TupDialog IupCanvas MENUCLOSE_CB Called just before a submenu is closed Callback int function Ihandle self in C elem menuclose gt ret number in IupLua3 elem menuclose_cb gt ret number in TIupLua5 Comments Does not work for popup menus Affects TupMenu IupSubMenu MOTION_CB Action generated when the mouse moves Callback int function Ihandle self int x int y char r in C elem motion x y number r string gt ret number in IupLua3 elem motion_cb x y number r string gt ret number in IupLua5 self identifier of the canvas that activated the function s exe
92. anism Elements Basic elements with a visual representation Together with composition elements they constitute the dialog s layout Auxiliary Elements Elements that complement the visual representation of the above elements Extra Lua Elements Controls that help creating groups of elements in Lua CPI Controls Extra controls They can either be native controls or not Most of them are not native and they are implemented using the CD library to draw the elements Others Extra controls which do not take part in IUP s distribution They are distributed separately IupButton Creates an interface element that is a button When selected this element activates a function in the application Its visual presentation can contain a text or an image Parameters Return Thandle IupButton char title char action in C ijupbutton title title string gt elem iuplua_tag in IupLua3 iup button title title string gt elem iuplua_tag in IupLua5 button title action in LED title Text to be shown to the user action Name of the action generated when the button is selected This function returns the identifier of the created button or NULL nil in IupLua if an error occurs Attributes BGCOLOR Background color of the text FGCOLOR Text color 88 FONT Character font of the text IMAGE Image of the non pressed button The button s title attribute TITLE is not shown when this attribu
93. arsing step of the LED file is transferred from execution to compilation However creating the IUP elements described in LED takes most of the execution time of the TupLoad function so the gain in efficiency may not be very significant Usage lede v c f funcname o file files TN shows lede s version number C does not generate code just checks for errors in the LED files uses lt funcname gt as the name of the generated exported function default led_load o file uses lt file gt as the name of the generated file default Led c f funcname Error Messages Several warnings and error messages might be generated during compilation Errors abort the compilation The messages can be the following warning undeclared control name argument number The name name was used as an argument where a IUP element was expected but no element with this name was previously declared 59 warning string expected argument number A name callback was passed as a parameter for a string type argument warning callback expected argument number A string was passed as a parameter for a callback type argument warning unknown control name used An unknown element called name was used The compiler assumes the element s creation function is called Iup Name with name capitalized and assumes the arguments types based on what was passed on LED warning elem declared without a name An elem type eleme
94. ase size equally in both directions The dialog uses a global attribute called UP_PARENTDIALOG as the parent dialog if it is defined Examples Here is an example showing many the possible parameters We show only one for each type but you can have as many parameters of the same type you want Integer 3456 Real 1 3 543 Sep Integer Sep2 Angle IE ll 192 I Real 2 jas a0 String string text List item Cancel See Also TupScanf IupGetColor IupMask IupValuator IupDial TupList TupMask Allows associating a mask to a TupText ora IupMatrix element See the Pattern Specification for information on patterns Functions int iupMaskSet Ihandle h char mask int autofill int casei in C or in I int iupMaskMatSet Ihandle h char mask int autofill int casei int lin i int int int int int int in in in in in in Ca ae es aed in 130 These functions are responsible for setting the mask to be used h Ihandle of IupText or IupMatrix mask Mask to be used autofill When 1 turns the auto fill mode on In auto fill mode whenever possible literal characters will be automatically added to the field casei When 1 uppercase or lowercase characters will be treated indistinctly lin col Line and column numbers in the matrix They return 1 if the mask is set or O if there is a
95. assing the node parameter In the iuptree control new functions were implemented to associate and retrieve a Lua Table from a node or leaf e IupGLCanvas binding IupTree Expand and collapse no more alters selection of elements When all nodes were deleted using DELNODE 0 CHILDREN inside a tree_selection callback the program crashed e BRANCH_OPEN now passes parameter node e IUP _DEPTH now works for folders and leaves Attention the depth works only with the 17 appointed element not with its children Some conditions necessary fora DEPTH change were wrong e Redraw optimization e When a tree was big the scrollback was not working properly When the tree was totally expanded and the scrollbar was all down collapsing folders made the thumb be wrongly calculated PGDN and PGUP were stopping in any folder that was closed e Even when the user did not want a folder or leaf to be selected sometimes the tree allowed it e When the tree s folder does not have children an empty box is shown next to it instead of the and symbol e Sometimes an error occurred in selection when a double click was done in a tree Callback RENAMENODE_CB now works correctly When the TreeSet Value function was used to define a tree using a folder with no leaves made the program crash New attribute COLORid allows the text color to be changed IupTabs UP_REPAINT was not repainting
96. atrix If its value is COL the vector will begin with letter C and will have further NUMCOL positions each one corresponding to a column in the matrix If its value is LINCOL the first letter which can be either L or C will indicate which of the above formats is being used The values must be numbers in a vector of characters 0 and 1 Default NULL MULTIPLE Defines if more than one entity defined by MARK_MODE can be marked Possible values W YE S W or W NO W 1 Default NO Action Attributes ADDCOL Adds a new column to the matrix after the number of the specified column To insert a column at the top of the spreadsheet value 0 must be used To add more than one column use format C C where the first number corresponds to the base column and the second number corresponds to the number of columns to be added It is valid only in normal mode The value must be a column number ADDLIN Adds a new line to the matrix after the number of the specified line To insert a line at the top of the spreadsheet value 0 must be used To add more than one line use format L L where the first number corresponds to the base line and the second number corresponds to the number of lines to be added It is valid only in normal mode 143 The value must be a line number DELCOL Removes the given column from the matrix To remove more than one column use format C C where the first numbe
97. cally underlines the first appearance of the chosen menu letter For such the chosen letter must necessarily be a part of the menu text In the menu bar some systems automatically associate the ALT lt letter gt combination for the chosen letter This is valid for the Windows driver but not for the Motif driver Be careful not to misuse this attribute in relation to K_ANY callback Affects upitem IupSubMenu DROPDOWN Changes the appearance of the list for the user only the selected item is shown beside a button with an arrow pointing down To select another option the user must press this button which displays all items in the list Value W YES W or NO W Default NO Notes This attribute is ignored for multiple lists attribute MULTIPLE YES This attribute is only consulted when the dialog is first mapped lLupMap IupShow TupShowXY or lupPopup After such it cannot be changed Affects IupList MULTIPLE Allows the simultaneous selection of several items Otherwise only one item can be selected at a time 171 Value W YES W or NO W Default NO Affects IupList VISIBLE_ITEMS Number of items that appear when a DROPDOWN list is activated Value Integer number Default Depends on the native system Note Only makes sense when the DROPDOWN attribute is YES Affects IupList MARGIN Defines a margin in pix
98. cation that uses this function the program must be linked to the function s library iupim lib on Windows and 1ibiupim a on Unix The iupim h file must also be included in the source code To make the function available in Lua use the initialization function in C iupluaim_open after calling iuplua_open The iupluaim h file must also be included in the source code The program must be linked to the functions s libraries iupluaim 1ib on Windows and 1ibiupluaim a on Unix Parameters Return Thandle IupLoadImage const char file name in C TupLoadiImage file_ name string gt elem iuplua_tag in IuplLua3 iup LoadImage file name string gt elem iuplua_tag in IupLua5 file_name Name of the file to be loaded This function returns the identifier of the created image or NULL if an error occurs See Also upImage Third party e IupSpeech Creates a speech engine that allows speech recognition and speech Uses Microsoft Speech SDK 5 1 e Color Bar Portuguese The extended control Colorbar was developed with the purpose of aiding IUP CD applications which need to work with a color palette allowing a selection of up to two 162 colors e Joystick Portuguese OLD Allows the use use of joystick Windows only e Play Video Portuguese OLD Allows the user to play videos using IUP Windows only e Capture Video Portuguese OLD Allows the user to capture frames from c
99. changed This function returns the identifier of the created list or NULL nil in JupLua if an error occurs Attributes 1 First item in the list 2 Second item in the list 3 Third item in the list n n item in the list The values can be any text Default NULL The first element with a NULL is considered the end of the list The string containing the item s number does not need to be static because IUP duplicates it internally but the contents of each element in the list needs to be either static or stored in IUP by means of the IupStoreAttribute function DROPDOWN Changes the appearance of the list for the user only the selected item is shown beside a button with the image of an arrow pointing down Creation only attribute Can be YES or NO Default NO EDITBOx Adds an edit box to the list Creation only attribute Can be YES or NO Default NO VISIBLE_ITEMS Number of items that appear when a DROPDOWN list is activated MULTIPLE Allows selecting several items simultaneously multiple list SIZE Size of the list Default smallest size that allows viewing the list VALUE List with edit box Text entered by the user Simple list Integer number representing the selected element in the list begins at 1 It can be zero if there is no selected item Multiple list Sequence of and symbols indicating the state of each item When setting thi
100. ck Returning CLOSE closes the dialog Notes Except for the menu all other elements must be inside a dialog to interact with the user Therefore an interface element will only be visible when its VISIBLE attribute and that of the dialog are YES A menu that is not associated to a dialog can interact with the user by means of the TupPopup function Values attributed to the SIZE attribute of a dialog are always accepted regardless of the minimum size required by its children For a dialog to have the minimum necessary size to fit all elements contained in it simply define NULL in C to SIZE In the case of partial dimensions a specified dimension is always used while a non defined dimension uses the smallest necessary size for the elements in the corresponding direction In Motif the decorations MENUBOX MINBOX MAXBOX RESIZE and BORDER will work only if the running Window Manager supports the Motif WM hints Examples IupFileDlg Creates the File Dialog element It is a predefined dialog for selecting files or a directory Parameters Return Thandle IupFileDlg void in C iupfiledlg gt elem iuplua_tag in IupLua3 iup filedlg gt elem iuplua_tag in IupLua5 filedlig in LED This function returns the identifier of the created dialog or NULL if an error occurs Attributes DIALOGTYPE Type of dialog Open Save or GetDirectory Can have values OPEN
101. ck also receives the toggle s state int funcion Ihandle self int v in C elem action v number gt ret number in IupLua v 1 if the toggle s state was shifted to on 0 if it was shifted to off Notes Toggles with images or texts can not change its behavior after mapped This is a creation attribute But after creation the image can be changed for another image and the text for another text Text is left aligned and image is centered Toggles are activated using the Space key In Windows the BGCOLOR attribute is ignored when an IMAGE is specified In Windows for toggles inside a radio the ACTION callback may also be called when a not selected toggle receive the focus Examples See Also upimege IupButton Tuplabel JupUser Creates a user element in IUP which is not associated to any interface element It is used to map an external element to a IUP element Its use is restricted and is usually done by CPI elements Parameters Return Thandle IupUser void in C There is no equivalent in IupLua There is no equivalent in LED This function returns the identifier of the created element or NULL if an error occurs IupDialog Creates a dialog element It manages user interaction with the interface elements For any 103 interface element to be shown it must be encapsulated in a dialog Parameters Return Thandle IupDialog Ihandle element in C iu
102. clicking the matrix now passes the control parameter as in BUTTON_CB isshift r iscontrol r isbuttonl r isbutton2 r isbutton3 r isdouble r e Vertically scrolling by dragging the thumb now works properly e The focus is now correctly drawn inside the matrix when only half the cell appears half of the focus is drawn e When leaving the edition mode by clicking an element outside the matrix the focus was remaining on the IupText in the matrix e Colors and alignments are now moved when a cell is moved either by adding new lines or columns or by deleting lines or columns e The matrix now leaves the edition mode whenever lines or columns are removed e When the user clicked a cell near the end of the matrix on the x coordinate an automatic scroll was made and the cell beside the desired cell was marked Windows Driver e KEY in IupItem was replicating the underlined KEYs and some times adding the wrong values because of that IupLua exe e Now works properly with all controls IUP Manual e All elements now have examples at least in IupLua and C e The IupMask manual was created Version 1 8 7 23 Nov 2000 e The alignment of composition elements can now be changed on the fly e Current language treatment has been changed ATTENTION previous putenv no longer works Use new functions lupSet Language and lupGet Language Default language Portuguese e IupAlarm s design was reformu
103. clude Motif2 1 In systems that support dynamic libraries the library name is libiup so To force a link with static libraries in these systems use option static In this case the library name will be Libiup a Following are some makefile suggestions All of them can be used in SunOS Sun IRIX Silicon and AIX IBM systems For Linux 1Xpm must be added at the end of the SYSLIBS variable e Simple Makefile This makefile can be used to generate simple applications which use only IUP e Makefile for IUP with CD For applications that use the CD graphics system e Makefile to generate several versions This makefile is a base to generate several versions of the application one for each platform Each version is stored in a separate directory managed by the makefile The available IUP binaries and the tests were done in the following systems e Linux24 Red Hat 7 3 i686 Kernel 2 4 18 27 7 x gcc 2 95 3 Motif 2 1 30 e Linux24g3 Red Hat Fedora i686 Kernel 2 4 22 1 2199 gcc 3 3 2 Motif 2 2 2 e AIX43 IBM AIX 4 3 gcc 2 95 2 Motif 2 1 0 e IRIX65 SGI IRIX 6 5 gcc 3 0 4 Motif 2 1 20 e IRIX6465 SGI IRIX 6 5 64 bits OS but libs are still 32 bits gcc 3 0 4 Motif 1 2 4 e IRIX6465cc SGI IRIX 6 5 cc MIPSpro 7 30 Motif 1 2 4 Tips 209 e SunOS57 Sun Solaris 7 sparc gcc 2 95 2 Motif 2 1 0 e Sunos58 Sun Solaris 8 sparc gcc 2 95 3 Motif 2 1 0 During linking in
104. cter Fonts table for a list of the fonts existing in IUP drivers Default Depends on the native interface system Affects All elements with an associated text Note To set a font the user can use one of the font options provided in the Character Fonts table or directly use the name of a native font in the driver Attention when consulting this attribute the user will always be returned the name of the driver font being used not the name of the IUP font To get the name of the IUP font the user must use the TupUnMapFont function See Also TITLE IupMapFont IupUnMapFont EXPAND Makes the size of an element dynamic It expands or retracts fulfilling empty spaces inside a dialog Value YES both directions HORIZONTAL VERTICAL or NO Default Depends on the element When not specified otherwise the default value is NO Affects All that have a visual representation Does not apply to radio zbox vbox hbox 166 Control s absolute horizontal position on the screen in pixels relative to the upper left corner This attribute can only be consulted Value Integer number Affects All controls that have visual representation Y Control s absolute vertical position on the screen in pixels relative to the upper left corner This attribute can only be consulted Value Integer number Affects All controls that have visual representation SIZE Si
105. ction function path of a function This function returns the address of the previous function associated to the action See Also TupGetFunction DEFAULT ACTION IupLoad Compiles a LED specification Parameters Return char IupLoad char name_file in C TupLoad name_file string gt error string in IupLua3 iup Load name_file string gt error string in IupLua5 name_file name of the file containing the LED specification This function returns NULL nil in Lua if the file was successfully compiled otherwise it returns a pointer to a string containing the error message Note Each time the function loads a LED file the elements contained in it are created Therefore the same LED file cannot be loaded several times otherwise the elements will also be created several times The same applies for running Lua files several times Elements Elements are basic interface components They can have different forms Predefined Dialogs Dialogs with a predefined functionality They are used very frequently and usually return useful values for the application Dialogs Predefined as Elements The same idea but now the dialog s attributes can be changed before they are shown on the screen This provides the predefined dialogs a greater flexibility 87 Composition Elements Elements that do not have a visual representation but they are essential for the functioning of the abstract layout mech
106. ctly Therefore applications that define sizes for dialogs either in LED or in C smaller than the minimum size required by their children will show truncated dialogs To force a computation based on the size of the children set any of these attributes to NULL in C or simply do not define them in LED As a general rule avoid specifying a dialog size unless there is a real need for such in this case be careful to specify a sufficient size TupFileDlg The default value for the DIALOGTYPE attribute was not being recognized the program aborted when there was no defined value When ALLOWNEW NO the dialog informs if the user is specifying a non existing file instead of simply returning as was happening a When the dialog type was OPEN the returned value was 1 Cancel even when the user confirmed the operation a If DIALOGTYPE is SAVE a confirmation is required if the file already exists A new dialog was created for each popup without destroying the previous dialog The NOCHANGEDTR attribute was implemented The dialog does not return if the user specifies a new file when attribute ALLOWNEW NO The same happens when attribute ALLOWDIR NO anda directory is specified In these cases alerts are shown The iupGetColor function for CPI controls was replaced in functionality by the iupGetRGB function iupGetColor is maintained for compatibility purposes but it should no longer be used TRUECOLORCANVAS was created
107. cution x y position in the canvas where the event has occurred in pixels r status of mouse buttons and certain keyboard keys at the moment the event was generated The following macros must be used for verification isshift r iscontrol isbuttonl isbutton2 r isbutton3 r isdouble r r r ia a a aa Affects TupCanvas 202 203 OPEN_CB Called just before a submenu is opened Callback int function Ihandle self in C elem open gt ret number in IupLua3 elem open_cb gt ret number in IupLua5 Comments Does not work for popup menus Affects TupMenu IupSubMenu RESIZE_CB Action generated when the canvas size is changed Callback int function Ihandle self int width int height in C elem resize width height number gt ret number in IupLua3 elem resize_cb width height number gt ret number in IupLua5 self identifier of the canvas that activated the function s execution width new canvas width in pixels height new canvas height in pixels Note This action is also generated right after the dialog is viewed by means of functions TupShow TIupShowXyY or lupPopup In Windows it is also generated after a map and before show Affects TupCanvas SCROLL_CB Called when some manipulation is made to the scrollbar When this attribute is defined the ACTION callback is not called in such cases Callback
108. d to make the Windows driver compatible with Motif The bug that made IUP crash when using MessageBox inside a button callback was fixed IupDestroy now reconfigures the button control function it was making IUP crash The TUP_READONLY attribute was implemented valid for Text and Multiline The IUP_FILTERUSED attribute was implemented it informs which is the filter selected by the user 1 2 3 A bug that caused LupPopup IupMenu item not to call the item s callback was fixed Motif Driver TupDestroy was corrected Ina IupF rame it made IUP crash IupList was corrected It crashed when the user changed its elements and tried to set IUP_VALUE The memory leak at lupGet File was removed List elements were not being correctly deleted IupMatrix Element The bug in the NT matrix was fixed It was not refreshing added elements the values on the cells were wrong The bug in the scroll matrix was fixed Version 1 8 4 09 Dec 1999 Windows Driver A problem which called the dropdown callback even for an already deleted element was fixed Function IupHelp is now available 26 e A bug was fixed it caused excessive system resource usage when dialogs with several elements were used e The size of the version dialog was corrected e A bug was fixed it made IUP crash depending on the use of MessageBox Same for TupFileDialog e Callback IUP_BUTTON_CB was added for t
109. duced in version 2 2 e Fixed HTML help navigation e For disabled buttons and toggles when the IMINACTIVE is not defined by IMAGE is defined we replace the non transparent colors by a darker version of the background color creating the disabled effect e New key K_PAUSE Windows e Fixed dynamic cursor creation e Toggle with inactive image could be enabled disabled only once Fixed toggle in Radio behavior Some keys were not being treated correctly Improved key codes management Motif e Fixed IupList setattribute VALUE and list items activated the ACTION callback Controls e Circular IupDial now uses abssolute angle e CARET did not work when set inside EDITION_CB in IupMatrix e Check for double initialization of IupControls e Better resize management for IupVal and IupDial IupControls now depends on the CD library version 4 3 3 in Motif IupLua e Wrong implementation of DROPCHECK_CB Version 2 2 11 Aug 2004 INCOMPATIBILITIES e Definition of K_parenleft changed to K_parentleft in C and all Lua bindings Major IupLua5 change see IupLua section bellow IupLua4 is not supported Motif 1 x is not supported General Documentation in Portuguese removed from the manual Changed and documented the default palette used in IupImage IupImage can now have up to 256 colors New mouse wheel callback WHEEL _CB for Windows and Motif If not defined the wheel will automatically scroll the canvas vertically
110. e System Control for Lua Integrates the library with programs and dialogs written in Lua Dialog and Menu Control Controls the visualization of dialogs and menus and controls focus mapping and destruction LED Allows loading an interface description file written in LED Element Composition Helps adding and removing elements Element Manipulation Allows creating and reading internal references of elements Attribute Manipulation Creates modifies and reads attributes of each element or global Allows the attributes to return in different formats Callback Manipulation Allows reading and creating references to functions Extra Lua Functions Auxiliary functions in IupLua GKS Auxiliary functions that help integrating GKS and IUP IupOpen Initializes the IUP toolkit Must be called before any other IUP function Parameters Return int IupOpen void in C There is no equivalent in Lua This function returns IUP_ERROR or IUP_NOERROR Notes 61 The IupOpen function in the Windows driver initializes OLE through the function OlelInitialize IupClose calls OleUninitialize The toolkit s initialization depends on several platform dependent environment variables For a more detailed explanation on the system control please refer to Guide System Control Lua Binding Lua This function must be called by the host program and before the Binding Lua initialization function iuplua_open See Also iu
111. e respectively The return value for this function ca CPI_GETSIZE 0 The control size does not vary when the dialo 1 The control width may vary when the dialog iupCpiDefaultGetSize 2 The control height may vary when the dialog 3 The control width and height may vary when Prototype int getsize Ihandle self in This method is called by IUP when wishing the c The x and y parameters indicate the position the method must return IUP_NOERROR if no error occurs Prototype int popup Ihandle self int Header File For a IUP application to use the new control the prototypes of the initialization functions and the definitions of the new attributes must be made available This is done by means of a header file which must have the same name as the control Function Prototypes The prototypes of all control functions that might be used by the control s client applications must be provided Usually there are only two prototypes the initialization function and the instance creation function It is important to consider that the control might be used in applications both in C and in C Therefore the prototype declaration should be involved by a C extern block see example below Attribute Definition To match the IUP standard macros must be defined to reference the strings identifying the new attributes used by the control For example if a new control has an attribut
112. e Also SCROLLBAR XMIN Minimum value of the horizontal scrollbar in any unit Value Any floating point value Default 0 0 Note A change in this value will only be effective after attribute POSX or POSY is changed Affects TupCanvas See Also SCROLLBAR YMAX Maximum value of the vertical scrollbar in any unit Value Any floating point value Default 1 0 Note A change in this value will only be effective after attribute POSX or POSY is changed Affects TupCanvas See Also SCROLLBAR 188 YMIN Minimum value of the vertical scrollbar in any unit Value Any floating point value Default 0 0 Note A change in this value will only be effective after attribute POSX or POSY is changed Affects TupCanvas See Also SCROLLBAR Global Attributes All the attributes are for verification only VERSION Returns the name of IUP s version Value The value follows the major minor driver format major referring to broader changes minor referring to smaller changes and corrections and driver referring to changes in the respective driver Ex 1 7 2 COPYRIGHT Returns the IUP s copyright Value Ex Copyright C 1994 2004 Tecgraf PUC Rio and PETROBRAS S A DRIVER Informs the current driver being used Value Two drivers are available now one for each platform MOTIF and WIN32 SYSTEM Informs the current operating system Value On UNIX it is
113. e and creates the IUP elements defined in it Naturally the same file cannot be loaded more than once because the elements would be created again This file interpretation does not map the elements to the native system To simply view a LED file objects use the LED viewer application see Iup View in the applications included in the distribution Example The following example creates a dialog with virtually all of IUP s elements as well as some variations of them with some attributes changed The same example is implemented in C LED and Lua Both screens presented are from the same example one in Windows 95 and the other in IRIX MANGAR tem 1 ior v item 1 Checked Buttoni Button3 Disabled Ter e Paa Frame Label Toggle f Li Faeries F Toele Label fewe C Toggle2in Radio Togglel in Radio tiline wv Toggle in Radio List 2 i 1 R amp S st 1 Portability To compile programs in C simply include file iup h If the application only uses functions from IUP and other portable languages such as C or Lua with the same prototype for all platforms then the application immediately becomes platform independent at least concerning user interface because the implementation of the IUP functions is different in each platform The linker is in charge of solving the IUP functions using the library specified in the project makefile For further information on how to link your application please refer to the specific d
114. e dialog creation task more flexible and independent from the graphics system s resolution Currently available interface elements can be categorized as follows e Primitives effective user interaction dialog label button text multi line list toggle canvas frame image e Composition ways to show the elements hbox vbox zbox fill e Grouping definition of a common functionality for a group of elements radio e Menu related both to menu bars and to pop up menus menu submenu item separator e Extended additional elements built outside the library dial gauge matrix tabs valuator GL canvas color chooser color browser toolbar e Dialogs useful predefined dialogs file selection message alarm data input list selection Hence IUP has some advantages over commercial interface toolkits available in the industry e Simplicity due to the small number of functions and to its attribute mechanism the learning curve for a new user is often faster e Portability the same functions are implemented in each one of the platforms thus assuring the interface system s portability e Customization the dialog specification language LED and the Lua binding IupLua are two mechanisms in which it is possible to customize an application for a specific user with a simple syntax text file e Flexibility its abstract layout mechanism provides flexibility to dialog creation e Extensibility the programmer can create
115. e image In this case when the dialog is closed or moved a redrawing event is not generated for the windows that were shadowed by it Its default value is YES TOPMOST Windows Only This attribute puts the dialog always in front of all other dialogs in all applications Default NO TOOLBOX Windows Only This attribute makes the dialog look like a toolbar It is only valid if the PARENTDIALOG attribute is also defined Default NO CLIPCHILDREN Windows Only Modifies the way the dialog and its children are redrawn When option YES is selected the area occupied by the children in the dialog is not redrawn thus preventing the matrix and the canvas from blinking when a resize is made Usually this brings better performance but in some cases it may bring a performance reduction as every time the dialog needs to be redrawn all children are redrawn as well including IupF rame For the attribute to work efficiently the canvas cannot be inside a IupF rame Default NO 105 BRINGFRONT Windows Only This attribute makes the dialog the foreground window Use YES to activate it Useful for multithreaded applications NATIVEPARENT Windows Only Makes any window created in the system even from outside IUP able to be parent of a IUP dialog The value provided should be a valid window handle HWND PLACEMENT Windows Only Changes how the dialog will be show Values MAXIMIZED MINIMIZED and NORMAL A
116. e kept in upper case by without the IUP_ prefix like iup DEFAULT e String definitions for values are no longer supported always use YES NO ACENTER etc IupLua3 Examples MultiList Creates a matrix that allows selection of each line at a time TableTree Shows a tree given a Lua table LabelText Creates a pair Label Text AllFonts Allows you to easily select a font from all possible IUP fonts IupLua Test Application The distribution files include two executables one for Lua 3 and one for Lua 5 that you can use to test your Lua code Both applications have support for all the addicional controls CPI Introduction 50 The IUP toolkit was originally designed to support a set of well defined controls existing in all the destination platforms With the evolution of native systems e g Windows 95 and new requests from users IUP needed to evolve with the purpose of making the addition of new interface elements to the toolkit easier Thus to support the development of new controls for IUP a specific API Application Program Interface was created for this purpose it was called CPI Control Program Interface This new API is orthogonal to the original IUP API that is its use with a client application does not interfere with the conventional use of IUP Only a developer wishing to implement a new IUP control is required study this API Control Implementation To create a new CPI control follow these steps I
117. e key codes will be different from the real keys for a small group of keys For the Brazilian ABNT keyboard the keys 4 L usually will have a different codification But this does not affect the IupText and IupMultiline text input Notice that somes key combinations are not available like Shift Ins Shift Del Alt Space Alt Ctrl Shift Backspace Alt Ctrl Shift Pause Alt Ctrl Shift Esc Ctrl Alt Enter When CapsLock is active the Shiftt lt Key gt combination is used except for Esc and Backspace that will ignore the combination The isxkey key macro defined in the iupkey h file informs whether a given key is an extended code instead of an alphanumeric key In IUP the codification implies that some keys have the same code K_BS K_cH K_TAB K_cI and K_CR K_cM 191 Ctrl E K_cE K_percent Alt F K_mF K_quoteright Alt H K_mH Ctrl G K_cG ee ee ee o E ee l Ctrl LEFT K_cLEI Alt F10 Alt F11 Alt F12 K K K Ay sl Fy Fy Fr Oo N e Rat any e K_m7 a ae Ctrl MIDDLE Ctrl RIGHT Ctrl END Ctrl DOWN 192 K_cM K_cR K_cENI D K_cDO Ctrl PgDn Ctrl Insert Ctrl Del Ctrl F1 Ctrl F2 Ctrl F3 Ctrl F4 Ctrl F5 Ctrl F6 Ctrl F7 Ctrl F8 Ctrl F9 Ctrl F10 Ctrl F11 K_cPGI N AANER Q DE Ww Ke K_cF1 K_cF2 K_cF3
118. e named MODE used to identify its operation mode then the following macro must be defined define IUP_MODE MODE Note that the attributes used by the control may have already been defined in another control s header for instance Thus it is advisable to check if this happens to avoid compilation errors Also refer to section Attribute Treatment Example 55 TupControle h ifndef IUPCONTROLE_H define IUPCONTROLE_H ifdef __cplusplus necess rio quando controle utilizado em c digo C extern C ndif void IupControleOpen void Thandle IupControle ifdef _ cplusplus ndif Novos atributos ifndef IUP_MOD defin TUP_MOD ndif Gl MODE T ifndef IUP_LENGTH defin IUP_LENGTH LENGTH ndif ndif IUPCONTROLI Gl Ey The Iclass Structure The Iclass structure stores pointers to the control s methods described in the table above as well as the following fields e char name Stores the name given to the control This name allows the control to be used in LED e char format Format string used to describe the required attributes defined in LED to create a control instance If this field is null then the new control type has no required attributes The format string can be any seque
119. e not 126 changed These values cannot be NULL The function returns 1 if the OK button is pressed or 0 otherwise Notes In systems with few colors available 256 this function will show the colors by automatically performing dithering providing good results However if only a few colors are available at the system s palette strange artifacts may appear The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined Examples Selecdodecor bs Verm fo Matiz fo Verde fo Lum fo 0 Azul jo Sat 0 0 Ok Cancelar See Also IupMessage IupScanf IupListDialog IupAlarm IupGetFile IupGetParam Shows a popup dialog for capturing parameter values using several types of controls Parameters Return int IupGetParam const char title Iparamcb action void user_data const chi Not available in IupLua title dialog title action user callback to be called whenever a parameter value was changed and when the user pressed the OK button It can be NULL user_data user pointer repassed to the user callback format string describing the parameter list of variables address with initial values for the parameters The last variable must be NULL The function returns 1 if the OK button is pressed 0 if the user canceled or if an error occurred The function will abort if there are errors in the format string as in the number of the expected parameters
120. e programmer changes a selected item on a list no callback is called LED LED is a dialog specification language whose purpose is not to be a complete programming language but rather to make dialog specification simpler than in C IUP s binding for Lua was made a posteriori and completely replaces the LED files Besides Lua is a complete language so a good deal of the application can be implemented with it However this means that the application must link its program to the Lua and to the TupLua libraries as well as the IUP library The LED or Lua files are interpreted and can be sent together with the application s executable However this often becomes an inconvenience To deal with it there are the LEDC and the LuaC compilers In LED attributes and expressions follow this form element attributel valuel attribute2 value2 expression The names of the elements must not contain the iup prefix Attribute values are always interpreted as strings but they need to be in quotes only when they include spaces The IUP_ prefix must not be added to the names of the attributes and predefined values Expressions contain parameters for creating the element In LED there is no distinction between upper and lower case except for attribute names 40 Though the LED files are text files there is no way to interpret a text in memory there is only the IupLoad function which loads a LED fil
121. each system For example vc7 Visual Studio 7 or Linux24g3 Linux Kernel 2 4 with gcc 3 x When installing Tecmake you will need to set a few environment variables You should refer to Tecmake s manual but here are a few tips on how to install it tested on Redhat 7 0 e Set environment variables TCG_HOME and TECMAKE_ HOME pointing to where tecmake mak is installed e Set variables TEC_UNAME TEC_SYSNAME TEC_SYSRELEASE These are well explained in Tecmake s manual under Platforms In IUP s main directory there is a file named make_uname make_uname bat in Windows that calls Tecmake for each IUP library To build IUP for Windows using Visual C 7 0 for example just execute make_uname bat vc7 In order to build IUP on Unix systems you should have Motif version 2 1 or greater Please send any comments or questions to iup tecgraf puc rio br Lua Binding Overview The Lua Binding is an interface between the Lua language and IUP a portable user interface system The main purpose of this package is to provide facilities for constructing IUP dialogs using the Lua language Abstractions were used to create a programming environment similar to that of object oriented languages even though Lua is not one of such languages The concept of event oriented programming is broadly used here because the IUP library is based on this model Most constructions used in IupLua were strongly based on the corresponding constructions in LED System
122. ects TupDialog IupCanvas See Also u mage CONID 184 Canvas identifier for GKS puc This attribute s value must be passed as a connection identifier when opening a IUP type workstation It can only be consulted Affects TupCanvas SCROLLBAR Associates a horizontal and or vertical scrollbar to the canvas Value VERTICAL HORIZONTAL YES both or NO none Default NO Notes The scrollbar allows you to create a virtual space associated to the canvas In the image below such space is marked in red as well as the attributes that affect the composition of this space In green you can see how these attributes are reflected on the scrollbar Hence you can clearly deduce that POSX is limited to XMIN and XMAX DX or XMIN lt POSX lt XMAX DX When the virtual space has the same size as the canvas DX equals XMAX XMIN and at this moment the scrollbar could be hidden as it is not useful this behavior occurs only for the Win32 driver Affects IupCanvas POSX Thumbnail position in the horizontal scrollbar in any unit Value Any floating point value Must be a value between XMIN and XMAX DX 185 Default 0 0 Note When the canvas is visible a change in POSX generates a redraw in the horizontal scrollbar on the screen This attribute does not generate a redraw of the canvas Shall the user need this he she must call a
123. elem bgcolor_cbh lin col number gt ret red green blue number in self Identifier of the matrix where the user typed something lin col Coordinates of the cell red green blue the cell background color If the function return IUP_IGNORE the return values are ignored and the attribute defined background color will be used If returns UP_DEFAULT the returned values will be used as the background color CLICK_CB Action generated when any mouse button is pressed over a cell This callback is always called after other callbacks int function Ihandle self int lin int col char r in C elem click lin col number r string gt ret number in IuplLua3 elem click_cb lin col number r string gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the cell where the mouse button was pressed They can be 1 if the user click outside the matrix but inside the canvas that contains it r Status of the mouse buttons and some keyboard keys at the moment the event is generated The following macros must be used for verification isshift r iscontrol r isbuttonl r isbutton2 r isbutton3 r isdouble r They return 1 if the respective key or button is pressed or 0 otherwise 145 DROPCHECK_CB Action generated before the current cell is redrawn to determine if a dropdown feedback should be shown If this action is not registered no feedback will
124. element This function will only return the control to the application after a callback returns IUP_CLOSE or when the popup dialog is hidden for exemple using IupHide Parameters Return int IupPopup Ihandle element int x int y in C IupPopup element iuplua_tag x y number gt ret number in IupLua3 iup Popup element iuplua_tag x y number gt ret number in IupLua5 or element popup x y number gt ret number in IupLua element Identifier of a dialog or a menu x x coordinate of the left corner of the interface element The following macros are valid e UP_LEFT Positions the element on the left corner of the screen 69 e IUP_CENTER Centers the element on the screen e IUP_RIGHT Positions the element on the right corner of the screen e IUP_MOUSEPOS Positions the element on the mouse cursor y y coordinate of the upper part of the interface element The following macros are valid e IUP_TOP Positions the element on the top of the screen e IUP_CENTER Vertically centers the element on the screen e UP_BOTTOM M Positions the element on the base of the screen e ITUP_MOUSEPOS Positions the element on the mouse cursor This function returns IUP_ERROR if the element could not be created Notes When a popup dialog is interacting with the user another dialog can only be opened by means of the IupPopup function never with IupShow or IupShowxXyY This function can be exec
125. element showxy x y number gt ret number in IupLua element identifier of the dialog x x coordinate of the dialog s left corner The following macros are valid e IUP_LEFT Positions the dialog on the left corner of the screen e I UP_CENTER Horizontally centralizes the dialog on the screen e IUP_RIGHT Positions the dialog on the right corner of the screen e IUP_MOUSEPOS Positions the dialog on the mouse position y y coordinate of the dialog s upper part The following macros are valid e IUP_TOP Positions the dialog on the top of the screen e IUP_CENTER Vertically centralizes the dialog on the screen e IUP_BOTTOM Positions the dialog on the base of the screen e IUP_MOUSEPOS Positions the dialog on the mouse position This function returns IUP_NOERROR if the element was displayed Note This function can be executed more than once for the same dialog This will make the dialog be placed above all other dialogs in the application See Also IupShow IupHide IupPopup IupNextField Shifts the focus to the next element in a dialog to which the specified element belongs In does not depend on the element currently with the focus Parameters Return Thandle IupNextField Ihandle element in C IupNextField element iuplua_tag gt elem iuplua_tag in IupLua3 iup NextField element iuplua_tag gt elem iuplua_tag in IupLua5 element An element 71 Thi
126. els between an element s border and the elements contained by that element Valid only for elements that contain other elements Value widthxheight where width and height are integer values corresponding to the horizontal and vertical margins respectively Default 0x0 no margin Affects TupZbox LIupHbox IupVBox IupFrame ALIGNMENT Defines the elements alignment Values vary according to the elements The default value when it is not specified in an element is ACENTER 172 Affects IupZbox IupHbox IupVBox IupFrame IuplLabel GAP Defines the space in pixels between the interface elements Value Any integer number Default 0 Affects TupHbox IupVBox IMAGE Bitmap image Must be created with function IupImage Value Name of an image Default NULL Note The definition after mapping is only assured if the image has the same size as the image it is replacing Affects TupButton IupToggle Iuplabel See Also upImage IMINACTIVE Image of the element when the ACTIVE attribute equals NO Must be created using function TupImage Value Name of an image Default NULL Affects TupButton lupToggle See Also IMPRESS upImage 173 Image of the element while the user keeps the left mouse button pressed over it Must be created with
127. ement All callbacks receive at least the element which activated the action as a parameter The callbacks implemented in C by the application must return one of the below values e IUP_DEFAULT Proceeds normally with user interaction In case other return values do not apply the callback should return this value e I UP_CLOSE Makes the IupMainLoop function return the control to the application Depending on the state of the application IUP_CLOSE will close all windows e IUP_IGNORE Makes the native system ignore that callback action Applies only to some actions Please refer to specific action documentation to know whether UP_IGNORE applies to it or not e ITUP_CONTINUE Makes the element ignore the callback and pass the treatment of the execution to the parent element In Lua the callbacks are implemented as methods using the language s resources for object orientation Thus the element is implicitly passed as the self parameter and the functions do not need to return a value since the binding is in charge of returning IUP_DEFAULT Note that the callbacks in IupLua do not contain the suffix _CB For further detail see the Lua Binding documentation An important detail when using callbacks is that they are only called when the user actually executes an action over an element A callback is not called when the programmer sets a value via lupSetAttribute For instance when th
128. er Lin col Coordinates of the current cell This function must return IUP_IGNORE to show a text edition field or IUP_DEFAULT to show a dropdown field DROPSELECT_CB Action generated when an element in the dropdown list is selected int function Ihandle self int lin int col Ihandle drop char t elem dropselect lin col number drop iuplua_tag t string i v elem dropselect_cb lin col number drop iuplua_tag t string i self Identifier of the matrix interacting with the user lin col Coordinates of the current cell drop Identifier of the dropdown list shown to the user t Text of the item whose state was changed i Number of the item whose state was changed v Indicates if item was selected or unselected 0 or 1 EDITION_CB Action generated when the current cell enters or leaves the edition mode int function Ihandle self int lin int col int modo aan Ee elem edition lin col mode number gt ret number in IupLua self Identifier of the matrix interacting with the user lin col Coordinates of the current cell in num viol 146 mode 1 if the cell has entered the edition mode or 0 if the cell has left the edition mode The user must return IUP_IGNORE if he she wants to prevent the field from being editable or IUP_DEFAULT otherwise ENTERITEM _CB Action generated when a matrix cell is selected becoming the current cell i
129. er of characters Value IupText Creates an editable field with one line Parameters Return Thandle IupText char action in C iuptext gt elem iuplua_tag in IupLua3 iup text gt elem iuplua_tag in IuplLua5 text action in LED action name of the action generated when the user types something This function returns the identifier of the created text or NULL if an error occurs Attributes APPEND Inserts a text at the end of the current text INSERT Inserts a text in the caret s position BORDER Shows a border around the text NC Maximum number of characters allowed CARET Position of the insertion point READONLY Allows the user only to read the contents without changing it Possible values YES NO default SELECTION Selection interval SELECTEDTEXT Selection text SIZE Text size Default 5 characters width and 1 character height VALUE Text entered by the user If the element is already mapped the string is directly copied to the native control see IupMap 100 The value can be any text including n characters indicating line change Default NULL when the element is not yet mapped if it is Callbacks ACTION Action generated when a keyboard event occurs The callback also receives the typed key int function Ihandle self int ce char after in C elem action e number after string gt ret number in IupLua c Identifier of
130. er to enter data to the interface Multiline Attributes that affect the TupMultiline element which is actually an extension of IupText differing only by the number of lines Text Multiline Attributes that affect both the IupText and IupMultiline elements Dialog Text Multi Canvas Dialog Canvas Dialog Canvas Canvas Scrollbar Attributes for each of such elements Global Element independent attributes Tables Value tables accepted by certain special attributes ACTIVE Activates or inhibits user interaction Value YES active NO inactive Default YES Affects All VISIBLE Shows or hides the element Value YES visible NO hidden Default YES Note Returns NULL if the element has not yet been mapped Affects All except IupItem and IupSeparator BGCOLOR Element s background color Value 164 The RGB components Values should be between 0 and 255 separated by a blank space Default Depends on the native interface system Affects All See Also FGCOLOR FGCOLOR Element s foreground color Usually it is the color of the associated text Value The RGB components Values should be between 0 and 255 separated by a blank space Default Depends on the native interface system 165 Affects All See Also BGCOLOR FONT Character font of the text shown in the element Value Font name Please refer to the Chara
131. es OK otherwise NULL Affects TupFileDlg CURSOR Defines the element s cursor Value Name of a cursor predefined by IUP NONE ARROW 183 BUSY CROSS HAND TUP MOVE PEN RESIZE_N RESIZE_S RESIZE_W RESIZE_E RESIZE_NE RESIZE_SE RESIZE_NW RESIZE_SW Te Default ARROW To use these cursors on Windows the Iup rc file provided with IUP must be added to the project It can receive as a parameter the name of an image to be used as an application defined cursor the cursor must be a TupImage but the image is not a regular one See the notes below Notes For the image to represent a cursor it must use attribute HOTSPOT to define its hotspot place where the mouse click is actually effective Only color indices 0 1 and 2 can be used in a cursor where 0 will be transparent The RGB colors corresponding to indices 1 and 2 are defined just as in regular images In Windows the cursor can have more than 2 colors Cursor sizes are usually less than or equal to 32x32 In the interface system the cursor will only change when the interface system regains control The Windows SDK recomends that cursors and icons should be implemented as resources rather than created at run time When the cursor image is no longer necessary it must be destroyed through function upDestroy Attention the cursor cannot be in use when it is destroyed Aff
132. eturns a handle HWND that identifies the window in the native system It is a verification only attribute only available after the control is mapped Exclusive Callbacks DROPFILES_ CB DIALOG CANVAS Callback called when a file is dragged to the application When several files are dragged the callback is called several times once for each file The callback must return IUP_DEFAULT to be called again for each of the dragged files Returning IUP_IGNORE the process is interrupted int function Ihandle self char filename int numFile int posx self Indicator of the element that received the file drop filename Name of the dragged file numF ile Number of the dragged file If several files are dragged numF ile counts the number of dragged files up to zero posx X coordinate of the point where the user released the mouse button posy Y coordinate of the point where the user released the mouse button Note The callback must be set before the element is mapped Generating Applications To link applications libraries iup 1lib ole32 1ib and comct132 1ib the last two provided with the compilers must be added 212 The iup rc resource file must be included in the application s project makefile so that HAND LUP PEN and SPLITH cursors can be used DLL To use DLL it is necessary to link the application with the IUP lib and that IUP lib is a library speciall
133. eturns the number of names loaded to the table Lua Binding This name is not associated to the name of the Lua variable this was inherited from LED and is needed for some functions See Also TupSetHandle IupGetHandle IupGetName IupGetAllDialogs IupGetDialog Verifies the identifier of a dialog to which an interface element belongs Parameters Return Thandle IupGetDialog Ihandle elem in C IupGetDialog elem iuplua_tag gt handle iuplua_tag in IupLua3 iup GetDialog elem iuplua_tag gt handle iuplua_tag in IupLua5 elem Identifier of an interface element This function returns the identifier of the dialog that contains that interface element IupGetAlIDialogs 78 Verifies the names of all defined dialogs Parameters Return int IupGetAllDialogs char names int n in C TupGetAllDialogs names string table n numer gt num number in IupLua3 iup GetAllDialogs names string table n numer gt num number in IupLua5d names table receiving the names n maximum number of names the table can receive This function returns the number of names loaded to the table Lua Binding This name is not associated to the name of the Lua variable this was inherited from LED and is needed for some functions See Also TupSetHandle lIupGetHandle IupGetName IupGetAllNames IupStoreAttribute Defines an attribute for an interface eleme
134. f the matrix interacting with the user lin col Coordinates of the cell currently in the upper left corner of the matrix Must return the string to be redrawn The existance of this callback defines the callback operation mode of the matrix VALUE_EDIT_CB Action generated to notify the application that the value of a cell was changed Since it is a notification it cannot refuse the value modification which can be done by the EDITION_CB callback int function Ihandle self int lin int col char newval in C elem value_edit lin col newval string gt ret number in IupLua3 elem value_edit_cb lin col newval string gt ret number in IupLua self Identifier of the matrix interacting with the user lin col Coordinates of the cell currently in the upper left corner of the matrix newval String containing the new cell value The user must return IUP_DEFAULT The canvas callbacks ACTION SCROLL_CB KEYPRESS_CB GETFOCUS_CB KILLFOCUS_CB if set will be called before the internal callbacks The IupGetAttribute always returns the internal callbacks The canvas callbacks MOTION_CB MAP_CB RESIZE _CB and BUTTON_CB can not be changed The other callbacks can be freely changed The GETFOCUS KILLFOCUS callbacks are always called before other callbacks 148 See IupCanvas IupTree Creates a tree containing nodes of branches or leaves
135. fter IupShow the attribute is set to NORMAL if it was different NORMAL is equivalent of not defining the attribute HELPBUTTON Windows Only Inserts a help button in the same place of the maximize button It can only be used for dialogs without the minimize and maximize buttons and with the menu box For the next interaction of the user with a control in the dialog the callback HELP CB will be called instead of the control defined ACTION callback Possible values YES NO Default NO TRAY Windows Only When set to YES displays an icon on the system tray TRAYICON Windows Only System tray icon TRAYTIP Windows Only Tray icon s tooltip text HIDETASKBAR Windows Only When set to YES hides the dialog from the task bar Must be used with TRAYICON attribute Callbacks SHOW_CB Called right after the dialog is opened minimized or restored from a minimization MAP_CB Called right after the element is mapped CLOSE_CB Called right before the dialog is closed TRAYCLICK_CB Called right after the mouse button is pressed or released over the tray icon int function Ihandle n int but int pressed int dclick in C elem trayclick but pressed dclick number gt ret number in IupLua elem trayclick_cb but pressed dclick number gt ret number in Iup 106 but identifies the activated mouse button pressed indicates the state of the button dclick indicates a double cli
136. function Iup Value Name of an image Default NULL Note When IMPRESS and 1 mage MAGE are defined IUP does not show the element s borders to provide a 3D effect The user must define the borders on the image Affects LlupButton luplooug le See Also NC upImage Maximum number of characters Value Positive integer number Default 32767 Affects IupList LUTEAL TupMultiline APPEND 174 Inserts a text at the end of the current text independently from the caret s position In the Multiline a n character will be automatically inserted Value Any text Note Only works if the element is mapped Affects fuplist TupMultiline TupText CARET Places the insertion point in a text edition field The first line and the first column begin at 1 Value Multiline String with the Jine column format where line and column are integer numbers corresponding to the caret s position Default 1 1 first character in the first line Value Text List String in the pos format Pos is an integer number corresponding to the caret s position Default 1 first character Note When the value set for the line is greater than the number of lines the caret is placed after the last line only multiline When the value set for the column is greater than the number of characters in a line the caret is
137. g fixes in IupLua 5 0 New function iuplua_pushihandle iuplua_dofile and iuplua_dostring IupGetFromC If iuplua_dofile and iuplua_dostring are used errors are reported through ERRORMESSAGE function Default ERRORMESSAGE function shows a dialog with the error TupLua5 Removed Lua redefinitions of dofile and dostring Minor bug in IupTree function TreeSetValue IupListDialog was not returning a table as it should when in multiple mode IupVal e Attribute UP_VALUE wasn t taking effect when set before mapping e CD canvas was being altered during mouse movement event Manual e CPI manual revision e IupLua manual revision e Several examples revised e Controls section rearranged Distribution e README on how to compile IUP with tecmake Version 2 0 1 31 Jul 2003 General e Attribute IUP_TYPENAME replaced by IupGetType function 14 minor bugs introduced in 2 0 because of internal old misuse of the hash table Following controls were not working with LED val dial gl matrix tree New canvas attribute DRAWSIZE that returns the drawing area of the canvas in Windows we may have an addicional border included in RASTERSIZE Windows e Memory invasion when eliminating an item from an IupList with multiple items e Callback IUP_OPEN_CB sometimes was not being called e New dialog attribute BRINGFRONT which forces dialog to be the window in the front Useful for multithreaded applications e Attribute ACTIVE was not worki
138. g in f fileopen mode to select multiple files The value returned by VALUE is to be changed the following way the directory and the files are passed separately in this order The character used for separating the directory and the files is The file list ends with character followed by NULL When the user selects just one file the directory and the file are not separated by Ex C users sab a txt b txt or C users sab a txt only one file is selected The maximum size allowed by IupFiled1g for file return is 2000 characters If the size exceeds 2000 characters VALUE will return NULL 108 FILTERUSED Windows Only Ina IupFileDlg this attribute allows the user to select which EXTFILTER to use It is also possible to retrieve the selection made by the user Value a string containing the number of the filter SHOWPREVIEW Windows Only A preview area is show inside the File Dialog Can have values YES or NO Default NO When this attribute is set you must use the FILE_CB callback to retreive the file name and the necessary attributes to paint the preview area You must link with the iup rc resource file so the preview area can be enabled PREVIEWDC PREVIEWWIDTH and PREVIEWHEIGHT Windows Only Read only attributes that are updated during the PAINT status of the FILE_CB callback Return the Device Context HDC the width and the height of the client rectangle for the
139. ging this will not work when the focus is leaving the matrix MOUSEMOVE_CB Action generated to notify the application that the mouse has moved over the matrix int function Ihandle self int lin int col in C elem mousemove lin col number gt ret number in IupLua3 elem mousemove_cb lin col number gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the cell that the mouse cursor is currently on 147 SCROLL_CB Action generated when the matrix visualization surface is changed Can be used together with the ORIGIN attribute to synchronize the movement of two or more matrices int function Ihandle self int lin int col in C elem scroll lin col number gt ret number in IupLua3 elem scroll_cb lin col number gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the cell currently in the upper left corner of the matrix The user must return IUP_DEFAULT VALUE_CB Action generated to verify the value of a cell in the matrix when it needs to be redrawn Called both for common cells and for line and column titles char function Ihandle self int lin int col in C elem valuecb lin col number gt ret string in IupLua3 elem value_cb lin col number gt ret string in IupLua5 self Identifier o
140. haracter indicates line change Default NULL TABSIZE Windows Only Controls the number of characters for a tab stop Callbacks ACTION Action generated when a keyboard event occurs The callback also receives the typed key int function Ihandle self int c char after in C elem action e number after string gt ret number in IupLua Notes c Identifier of the typed key Please refer to the Keyboard Codes table for a list of possible values after Represents the new text value if the key is validated 1 e the callback returns IUP_DEFAULT If the function returns IUP_IGNORE the system will ignore the typed character If the function returns the code of any other key IUP will treat this new key instead of the one typed by the user Text is always left aligned iupmultiline has a limitation of about 64 000 characters Since all the keys are processed to change focus to the next element press lt Ctr1 gt lt Tab gt The DEFAULTENTER button will not be processed but the DEFAULTESC will Examples 99 IupMultiLine Advanced Example Here is the text in the multiline Each button below is related to an attribute Select if you want to SET or GET an attribute using the dropdown list in the right 4 r Here is the text that will be used as value when a button is pressed SET Append Insen Border Caret Read oniy Selection Selected Text Numb
141. he TupButton element e A bug was fixed it made IupGet Int d IUP_X return a wrong value when the dialog was maximized CPI Controls e The color inheritance problem was fixed e Corrections were made to the Dial size e Attributes of colors FGCOLOR BGCOLOR and fonts FONT WINFONT MOTIFFONT Version 1 8 3 15 Jun 1999 Windows Driver e The IUP_ACTIVE attribute now also works in the frame e The action callback in Multiline now also accepts the DEL key e Toggle element now accepts an image e The IUP_TOOLBOX attribute was implemented for dialogs e A bug was removed it made a second IupShow in a dialog reset its position to the center of the screen e Treatment of the SIZE and RASTERSIZE attributes was changed e The IUP_ACTION callback now treats the DEL key and commands and keys from the Cut and Paste menu e A conflict was solved it made the key generate a call to the callback as if it were key plic e Keyboard accelerators for menus now work since the focus is no longer on the dialog When a dialog receives the focus back it sets the focus to the last control inside it that had the focus e IUP_K_ANY no longer issues beeps when keys are pressed on the canvas e When the TUP_STARTFOCUS attribute is not defined the focus is set for the first control in the dialog that accepts it thus preventing the dialog from keeping the focus and allowing the menus to be called
142. he column will not be shown on the screen Must be an integer number Default Width defined in the WIDTHDEF attribute HEIGHTn Height of column n where n is the number of the wished column n gt 0 If 142 the height value is 0 the column will not be shown on the screen RESIZEMATRIX Defines if the width of a column can be interactively changed When this is possible the user can change the size of a column by dragging the column title s upper corner Possible values YES or NO Default NO does not allow interactive width change Mark Attributes AREA Defines if the area to be interactively marked by the user will be continuous or not Possible values CONTINUOUS or NOT_CONTINUOUS Default CONTINUOUS MARK _ MODE Defines the entity that can be marked none lines columns lines and or columns and cells Possible values NO LIN COL LINCOL or CELL Default NO no mark MARKED Vector of 0 or 1 characters informing which cells are marked indicated by value 1 The NULL value indicates there is no marked cell The format of this character vector depends on the value of the MARK_MODE attribute if its value is CELL the vector will have NUMLIN x NUMCOL positions corresponding to all the cells in the matrix If its value is LIN the vector will begin with letter L and will have further NUMLIN positions each one corresponding to a line in the m
143. he parent dialog if it is defined Examples See Also IupMessage IupScanf IupGetFile LIupAlarm 112 IupMessage Shows a dialog containing a message and a button and waits for the user to click the button Parameters Return void IupMessage char t char m in C TupMessage t string m string in IupLua3 iup Message t string m string in IupLua5 t Dialog s title m Message Note The IupMessage function shows a dialog centralized on the screen showing the message and the OK button The n character can be added to the message to indicate line change In C there is an utility function to help build the message string it accepts the same format as the C sprintf void IupMessagef char t char f in C The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined Examples See Also TupGetFile IupScanf IupListDialog IupAlarm IupScanf Shows a dialog for capturing values with a format similar to the scanf function in the C stdio library Parameters Return int IupScanf char fmt in C TupScanf fmt string gt n number in IupLua3 iup Scanf fmt string gt n number in TIupLua5 fmt Reading format List of variables This function returns the number of successfully read fields or 1 when the user has canceled the operation In Lua the values are returned by the function in t
144. he same order they were passed Notes 113 The fmt format must include a title and the descriptions of the variable fields to be read using th e following syntax First line Window title followed by n Following lines Must be specified for each variable to be read in the following format text t vs n where text is a descriptive text to be placed to the left of the entry field in a label t is the maximum number of characters allowed v is the maximum number of visible characters in the entry field f is the type char float etc in the C format for I O services All the fields use a text box for input If you need better control of what characters the user enters you should use LupGetParam This other dialog also has many other resources not available in IupScanf The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined Examples Captures an integer number a floating point value and a character string See Also TupGetFile IupMessage IupListDialog IupAlarm IupGetParam IupFill Creates a Fi11 interface element which dynamically occupies empty spaces Parameters Return Thandle IupFill void in C iupfill gt elem iuplua_tag in IupLua3 iup fill gt elem iuplua_tag in IupLua5 fill in LED This function returns the identifier of the created Fill or NULL if an error occurs A
145. ibute of a dialog can now be changed after it was mapped List callback correction the callback is now called both for selected and not selected items New function void IupHelp char url shows a URL ina Netscape window The treatment of the new return value for keyboard callbacks IUP_CONTINUE was implemented IUP_CURSOR attribute was implemented A code was added to treat the case of toggle de selection via LupSetAttribute IUP_CARET now uses as a separator instead of old A restriction was eliminated that prevented the function iupGet Text Size from being called passing a dialog or frame as a parameter New text callback was implemented it receives the text both before and after the change and receives the code of the typed key It was possible to set two activated radio toggles by selecting VALUE for one of them on the radio and VALUE ON on the other toggle Attributes IUP_STARTFOCUS IUP_DEFAULTENTER and ILUP_DEFAULTESC were implemented The IUP_VALUE of a LupRadio was not allowing to be changed if it was not visible A problem was corrected for the lists which were being reset between a ITupShow IupPopup and another Attribute IUP_SELECTEDTEXT was implemented It returns the selected text if there is any with the r already filtered A bug was corrected it caused and Assertion Failed when the mouse was moved after a window was destroyed The value of IUP_VALUE of a IupText anda IupMultiline now
146. ide Events Attention in a callback if one of the parameters is a string this string may be modified during the callback if another IUP function such as IupGetAttribute is called ACTION Action generated when the element is activated Affects each element differently Callback int function Ihandle self in C elem action gt ret number in IupLua self identifier of the element that activated the function In some elements this callback may receive more parameters apart from self Please refer to each element s documentation Affects TupButton LIupitem IupList IupText lupCanvas TupMultiline IupToggle BUTTON_CB Action generated when a mouse button is pressed or released Callback int function Ihandle self int but int pressed int x int y char status in elem button but pressed x y number status string gt ret number in elem button_cb but pressed x y number status string gt ret number self identifies the canvas that activated the function s execution but identifies the activated mouse button IUP_BUTTON1 left mouse button button 1 IUP_BUTTON2 middle mouse button button 2 IUP_BUTTON3 right mouse button button 3 pressed indicates the state of the button O mouse button was released 1 mouse button was pressed x y position in the canvas where the event has occurred in pixels status status of the mouse but
147. in32 Driver If the function is executed several times only one LUP_CLOSE will end all executions See Also IupOpen IupClose IupLoopStep Guide System Control IDLE_ACTION IupLoopStep Runs an iteration of the message loop Parameters Return int IupLoopStep void in C IupLoopStep gt ret number in IupLua3 iup LoopStep gt ret number in IupLua5 This function returns IUP_CLOSE or IUP_DEFAULT Notes This function is useful for allowing a second message loop to be managed by the application itself This means that messages can be intercepted and callbacks can be processed inside an application loop An example of how to use this function is a counter that can be stopped by the user For such the user has to interact with the system which is possible by calling the function periodically This way this function also replaces some old mechanisms implemented using the Idle callback Note that this function does not replace IupMainLoop 63 See Also IupOpen IupClose IupMainLoop IDLE_ACTION Guide System Control TupFlush Processes all pending messages in the message queue Parameters Return void IupFlush void in C IupFlush in IupLua3 iup Flush in IupLua5 Notes When you change an attribute of a certain element the change may not take place immediately For this update to occur faster than usual run L
148. ine the default filter and directory Example docs txt As an output value it is used to contain the filename entered by the user error The function returns an error code whose values can be 1 The name defined by the user is that of a new file 0 The name defined by the user is that of an already existent file 1 The operation was cancelled by the user Note The IupGetFile function does not allocate memory space to store the complete filename entered by the user Therefore the file parameter must be large enough to contain the directory and file names The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined Examples See Also IupMessage IupScanf IupListDialog IupAlarm Tupset Language IupGetText Shows the dialog to edit a multiline text Parameters Return int IupGetText char title char text in C TupGetText title text string gt text string in ITupLua3 iup GetText title text string gt text string in IupLua5 text It contains the initial value of the text and the returned text It must have room for the edited string The function returns a non zero value if successfull In Lua if an error occured returns nil 111 Notes The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined See Also TupMessage IupScanf IupListDialog IupAlarm TupSetLanguage
149. int function Ihandle self int op float posx float posy in C elem scroll op posx posy number gt ret number in IupLua3 204 elem scroll_cb op posx posy number gt ret number in IupLua5 op indicates the operation performed on the scrollbar If the manipulation was made on the vertical scrollbar it can have the following values IUP_SBUP line up IUP_SBDN line down IUP_SBPGUP page up IUP_SBPGDN page down IUP_SBPOSV vertical position IUP_SBDRAGV vertical drag If it was on the horizontal scrollbar the following values are valid IUP_SBLEFT column left IUP_SBRIGHT column right IUP_SBPGLEFT page left IUP_SBPGRIGHT page right IUP_SBPOSH horizontal position IUP_SBDRAGH horizontal drag posx posy the same as the ACTION canvas callback corresponding to the values of attributes IUP_POSX and IUP_POSY Affects TupCanvas SHOW_CB Called right after the dialog is opened minimized or restored from a minimization Callback int function Ihandle self int mode in C elem showch mode number gt ret number in IupLua3 elem show_ch mode number gt ret number in IupLua5 Parameter mode indicates which of the following situations generated the event 0 Show 1 Restore 2 Minimize Affects TupDialog WHEEL_CB Action generated when the mouse wheel is rotated If this callback is not defined the wheel will automa
150. ion in the associated application Its visual representation can contain a text or an image Parameters Return Thandle IupToggle char title char action in C ijuptoggle title title string gt elem iuplua_tag in IuplLua3 iup toggle title title string gt elem iuplua_tag in IupLua5 toggle title action in LED title Text to be shown on the toggle action name of the action generated when the toggle is selected This function returns the identifier of the created toggle or NULL if an error occurs Attributes BGCOLOR Background color of the text shown on the toggle FGCOLOR Color of the text shown on the toggle FONT Character font of the text shown on the toggle IMAGE Toggle image When the IMAGE attribute is defined the TITLE is not shown This makes the toggle look just like a button with an image but its behavior remains the same IMPRESS Image of the pressed toggle MINACTIVE Image of the inactive toggle If it is not defined but IMAGE is defined then for inactive toggles the non transparent colors will be replaced by a darker version of the background color creating the disabled effect VALUE Toggle s state Values can be ON or OFF Default OFF SIZE Toggle size 102 TITLE Toggle s text SELECTCOLOR Motif Only Color of a selected toggle Callbacks ACTION Action generated when the toggle s state on off changes The callba
151. ize it correctly Possible values YES or NO Default NO ERROR If an error is found returns a string containing a description of it CONTEXT VISUAL and COLORMAP Motif Only Returns GLXContext X VisualInfo and Colormap PRINTINFO Motif Only If 1 during the canvas initialization some information will be printed on stderr Callbacks The ITupGLCanvas element understands all callbacks defined for a conventional canvas see upCanvas Addicionally RESIZE_CB By default the resize callback sets glViewport 0 0 width height Auxiliary Functions void IupGLMakeCurrent Ihandle self Activates the self canvas All subsequent OpenGL commands are directed to such canvas void IupGLSwapBuffers Ihandle self Makes the BACK buffer visible This function is necessary when a double buffer is used void IupGLPalette Ihandle self int index float r float g float b Defines a color in the color palette This function is necessary when INDEX color is used Comments 161 An OpenGL canvas when put inside an IupFrame will not work Examples See Also TupCanvas IupLoadImage A function that creates an IupImage from file using the IM library The function can load the formats BMP JPEG GIF TIFF PNG PNM PCX ICO and others For more information about the IM library see http www tecgraf puc rio br im Initialization and Usage To generate an appli
152. l contain the filename selected by the user Value Any text Default NULL Affects TupFileDlg FILTER File filter Value String containing a list of file filters valid in the native system separated by without spaces Default NULL Example x C LED teste Affects TupFileDlg FILTERINFO Filter description Value Any text Default NULL Affects TupFileDlg DIRECTORY Initial directory Value Any text Default NULL dialog opens current directory Note on Windows98 and Windows2000 if the current directory does not have files corresponding to the chosen filter the directory opened will be My Documents Affects TupFileDlg ALLOWNEW Indicates if inexistent filenames are accepted If an inexistent filename is chosen a message box will be shown 181 182 Value W YES or NO Default if the dialog is of type OPEN default is NO if the dialog is of type SAVE default is YES Affects TupFileDlg NOCHANGEDIR Indicates if the initial directory is to be restored after the user has navigated Value YES or NO Default YES Affects TupFileDlg FILEEXIST Indicates whether the file defined by the F ILE attribute exists or not It is only valid if the user has pressed OK in the dialog Can only be consulted Value YES or NO Default YES or NO if the user press
153. l function may change the contents of the 85 previously returned pointer as this is an internal IUP buffer The user is in charge of storing the value before calling ITupGet Global again This pointer must not be freed either See Also TupGetAttribute IupSetGlobal IupGetActionName Returns the name of the action being executed by the application Parameters Return char IupGetActionName void in C There is no equivalent in IupLua Returns the name of the action Note The programmer often defines an action with a given name but when associating it to a function he she might make a typo or vice versa This kind of mistake is very common but IUP cannot detect it automatically The predefined DEFAULT_ACTION action combined with function IupGetAct ionName can help the programmer detect this problem Simply define a default action and check which action name activated it See Also DEFAULT_ACTION IupGetFunction Verifies the function associated to an action Parameters Return Icallback IupGetFunction char aetion in C There is no equivalent in IupLua action name of an action This function returns the path of the function associated to the action See Also TupSetFunction IupSetFunction 86 Associates a function to an action Parameters Return Icallback IupSetFunction char aetion Icallback function in C There is no equivalent in Lua action name of an a
154. lated Now all buttons have the same size e Functions TupUnMapFont and IupMapFont were created to make the use of the driver s fonts easier e Attribute UP_FONT now accepts a string either with the native font or the IUP font and always returns the native font attributes WINFONT and MOTFONT are now obsolete Motif Driver 22 Motif did not have K_ANY for IupList in dropdown mode The IUP_VISIBLE attribute now works for FRAME ZBOX VBOX HBOX and RADIO all elements were tested Now it is no longer lost for internal HBOX elements when the HBOX visibility is changed When the user changed from one ZBOX to another the first one was forgetting which elements were visible Windows Driver When Toggle 1 default begins deactivated it no longer remains marked forever Toggle with image now accepts images IUP_IMPRESS and IUP_IMINACTIVE but it follows the Windows standard for Toggle manipulation Toggle was not verifying whether it was active or not when it was created Canvas redraw was optimized The canvas now uses transparent color as default The user is in charge of drawing the canvas but now it no longer blinks when a redraw is made Tip To avoid unnecessary canvas redraws do not put it inside a frame and use the UP_CLIPCHILDREN attribute Initializing Toggle or Radio with a value and then modifying it via callback was marking both toggles Changing Toggle s color IUP
155. lbar to the matrix Is only effective if defined before the matrix is mapped Default is YES SIZE Size of the matrix Default Minimum size which allows viewing the whole matrix CARET Allows specifying and verifying the caret s position when the matrix is in edition mode SELECTION Allows specifying and verifying selection interval when the matrix is in edition mode 144 HIDEFOCUS do not show the focus mark when drawing the matrix IupMatrix Callbacks ACTION Action generated when a keyboard event occurs int function Ihandle self int c int lin int col int active char a elem action c lin col active after number gt ret number in Iup self Identifier of the matrix where the user typed something c Identifier of the typed key Please refer to the Keyboard Codes table for a list of possible values lin col Coordinates of the selected cell active 1 if the cell is in edition mode and 0 if it is not after The new value of the text in case the key is validated see return values Possible return values are IUP_DEFAULT validates the key IUP_IGNORE ignores the key IUP_CONTINUE forwards the key to IUP s conventional processing This function can also return the identifier of the key to be treated by the matrix BGCOLOR_CB Action generated to retrieve the background color of a cell when it needs to be redrawn int function Ihandle self int lin int col unsigned int red unsigne
156. lement Identifier of the interface element a name of the attribute This function returns a float corresponding to the attribute s value 83 Note The call to LupGet Float cancels IUP s internal buffer This means that after the call to IupGetFloat the contents previously returned by function lupGetAttribute is no longer valid See Also TupGetAttribute IupGetInt IupGetInt Verifies the value of an interface element attribute and converts it to int Parameters Return int IupGetInt Ihandle element char a in C There is no equivalent in IupLua element Identifier of the interface element a name of the attribute This function returns the value of the interface element converted to int Notes If the attribute value is YES NO or ON OFE the function returns 1 0 respectively The call to function ITupGet Int invalidates IUP s internal buffer This means that after a call to this function the contents previously returned by TupGetAttribute will no longer be valid See Also TupGetAttribute IupGetFloat IupStoreGlobal Defines an attribute for the global environment Parameters Return void IupStoreGlobal char a char v in C TupStoreGlobal attribute string value string in IupLua3 iup StoreGlobal attribute string value string in IupLua5 a name of the attribute v value of the attribute If it equals NUL
157. ll classes directly descend from the WI procedures for DGET class some other classes serve as mediators in the tree This is the case of the COMPOSITION class located among the composition element classes IUPHBOX IUPVBOX and IUPZBOX Some classes use part of the code from other classes when they are very similar This happens to UPITEM and UP TOGGLE which reuse the code related to the verification of parameter types and to the definition of the action callback in the IUPBUTTON class Class UPMULT L NE inherits several characteristics from 1 UP TEXT such as the 49 definition of the act ion callback and the verification of parameter types The complete class hierarchy can be represented as follows WIDGET IUPBUTTON IUPITEM IUPTOGGLE IUPCANVAS COMPOSITION IUPHBOX IUPVBOX IUPZBOX UPDIALOG UPFILL UPFRAME UP IMAGE UPLABEL PLIST UPMENU UPRADIO UPSEPARATOR UPSUBMENU UPTEXT IUPMULTILINE Ee EI HHHHHHHHHHH Differences in lupLua5 In IupLua5 we follow the same organization of the Lua libraries using the namespace before all the definitions e All exported functions are accessed only through iup FunctionName including control initialization like iup label e All callbacks in are now access through their exact name in the C API e Numeric definitions wher
158. llback Using the mouse Clicking a node Selects the clicked node Clicking a box Makes the branch to the right of the box collapse expand Clicking an empty region Unmarks all nodes including the selected one Double clicking a node image If the selected node is an expanded branch it is collapsed if it is a collapsed branch it is expanded if it is a leaf it is executed Double clicking a node text Calls the rename callback Extra Functions IupTree has functions that allow associating a pointer or a user defined id to a node In order to do that you provide the id of the node and the pointer userid even if the node s id changes later on the userid will still be associated with the given node In IupLua instead of a pointer the same functions are defined for tables int IupTreeSetUserId Ihandle self int id void userid in C TIupTreeSetUserId self handle id number userid userdata in IupLua iup TreeSetUserId self handle id number userid userdata in IupLu self Identifier of the TupTree interacting with the user id Node identifier userid User pointer associated to the node Use NULL value to free reference Note This function needs to be called again freeing the node from the userdata or it will never be garbage collected void IupTreeGetUserId Ihandle self int id in C TupTreeGetUserlId self handle id number gt ret userdata in IupLua iup TreeGetUserId
159. lor ICTL_DASHED was missing in the documentation of IupGauge The control now has the attributes MIN and MAX just like the valuator For IupVal and IupDial new keyboard and mouse wheel support New attribute SHOWTICKS to show tick marks around the valuator New attribute UNIT to change the angle unit to degrees in the dial Completely changed visual of the controls The controls can now be deactivated and it displays focus feedback Updated visual for the lupGauge and IupTabs controls In IupTabs the popup menu to select a tab sometimes did not set the new tab Matrix Documentation reviewed and reorganized e Returning IUP_CLOSE in CLICK_CB was not closing application The scrollbar drag will now simultaneously scroll the matrix New callback DROPCHECK_CB to aid the dropdown feedback in the cell New utility functions IupMatSetAttribute IupMatStoreAttribute IupMatGetFloat IupMatSetfAttribute IupMatGetAttribute lupMatGetInt Tree 11 Fixed some display erros in Windows because of an error in the size of the scrollbar In Windows pressing a key in a menu activates the k_any of the last active element In the matrix this turns into an infinit loop The matrix now uses the keypress_cb instead of the k_any callback Fixed empty selection in the dropdown list if the user press a regular key to start editing the cell Fixed invalid dropdown value if the user changed focus to the scrollbars CLICK_CB was called twice in
160. lua_tag gt elem iuplua_tag in IupLua3 iup sbox elem iuplua_tag gt elem iuplua_tag in IupLua5 sbox elem in LED elem This function receives as parameter the element that will be enclosed in a Sbox This function returns the created Sbox s identifier or NULL if an error occurs Attributes DIRECTION Indicates the direction of the resize Possible values are NORTH SOUTH EAST WEST COLOR Changes the color of the Sbox s thumb The value should be given in R G B color style Examples 132 CS XI J Figures ili S 2D a parallelogram square diamond a triangle equilateral isoceles scalenus trapeze O amp 3D This is a label Example 2 image IupTabs Creates a Tabs element Allows a single dialog to have several screens grouping options The grouping is done in a single line of tabs arranged according to the tab type It inherits from lupCanvas It contains a IupZbox to control the groups of controls Parameters Return Thandle IupTabs Ihandle elem1l Ihandle elem2 in C Thandle IupTabsv Ihandle elems in C iuptabs eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua3 iup tabs eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua5 tabs elem1 elem2 in LED eleml elem2 This function receives as parameters the elements that will be transformed into Tabs Each of such elements must have a
161. ly implemented drivers for different platforms Motif Driver 206 Driver for the X Windows Motif environment Environment Variables QUIET When this variable is set UP does not generate the message indicating the driver s version when initializing DEBUG This variable s existence makes the driver operate in synchronous mode with the X server This slows down all operations but allows immediately detecting errors caused by X Exclusive Attributes MOTIFVERSION global Returns the version of the run time Motif TRUECOLORCANVAS global Indicates if the display allows creating TrueColor gt 8bpp windows even if PseudoColor is the default Returns YES or NO AUTOREPEAT global Turns on off YES or NO the autorepeat of keyboard keys in the whole system may be used as an optimization in high performance applications XDISPLAY all Returns a Display indicating the control s X display It is a verification only attribute available after the control is mapped XWINDOW all Returns a Window indicating the control s X window It is a verification only attribute available after the control is mapped XSCREEN all Returns a Screen indicating the control s X screen It is a verification only attribute available after the control is mapped MOTIF FONT all This attribute as well as FONT can be used to change a control s font Is should not be used being specified on
162. ly to keep compatibility To change a control s font use FONT 207 Differentiated Attributes ENTERWINDOW_CB LEAVEWINDOW_CB all The same callback available for CANVAS can be used for other elements ICON DIALOG This attribute s value must be a string containing the name of the IUP image to be used as an icon when the dialog is minimized The current window manager will determine how or if the icon will be displayed This attribute returns a Widget which identifies the Intrinsics control It is a verification only attribute available after the control is mapped CURSOR all menus and submenus This attribute can be used in other elements as well as the canvas and dialog Window Manager Dependent Attributes The attributes below can have different behaviors depending on the window manager controlling the display where the application is being viewed They are typically attributes that control dialog visual characteristics since these are drawn by the window manager MAXBOX DIALOG MINBOX DIALOG MENUBOX DIALOG RESIZE DIALOG BORDER DIALOG ICON DIALOG Differentiated Functions Tupr lush Does not always work If there is an example sent by the X server which is not yet in the event queue after a call to IupF lush the queue might not be empty Default Values Resource Files Some default values used by the driver such as background color foreground color
163. matrix leaveitem enteritem should not being called when the cell enters edition mode through the mouse Windows IupOpen IupClose now initializes OLE OleInitialize OleUninitialize ENTERWINDOW LEAVEWINDOW reimplementation LEAVEWINDOW does not fail anymore Mouse hook removed Better performace New attributes TRAY TRAYTIP and TRA YIMAGE and new callback TRAYCLICK_CB which allows a dialog to be put in the tray Action in IupText now responds to the ENTER key Some keys were not working with keypress callback New attribute NATTVEPARENT which makes any dialog in Windows able to be parent of a IUP dialog even from other toolkits Better protection dealing with other processes messages 13 IupFileDialog when used to get directory was not updating STATUS attribute correctly IUP_APPEND small memory problem fix atexit removed KILLFOCUS_CB and GETFOCUS_CB were not being called when focus goes to the menu e MAP _ CB in a canvas is now called before RESIZE_CB like the Motif driver e ALT F4 was not working to close application e Images sometimes show black using Visual C do not use option in Visual C 6 0 NODEFAULTLIB libcd e IUP_TIP does not show when the fade effect is on MS fixed the problem use autoupdate IupLua 3 2 4 0 5 0 Functions exported to Lua IupGetType IupGetParent IupGetNextChild lupGetBrother IupTimer IupSbox binding IupTreeGetTable lupTreeSetTableld IupTreeGetTableld functions created Several bu
164. may contains a border Callbacks ACTION Action generated when the canvas needs to be redrawn Also receives as parameters the scrollbar position int function Ihandle self float x float y in C elem action x y number gt ret number in IupLua x Thumb position in the horizontal scrollbar y Thumb position in the vertical scrollbar 90 This action is also generated right after the dialog is viewed by means of functions IupShow IupShowXyY or IupPopup BUTTON_CB Action generated when any mouse button is pressed or released ENTERWINDOW_CB Action generated when the mouse enters the canvas LEAVEWINDOW_CB Action generated when the mouse leaves the canvas MOTION_CB Action generated when the mouse is moved KEYPRESS_CB Action generated when a key is pressed or released RESIZE_CB Action generated when the canvas size is changed SCROLL_CB Called when the scrollbar is manipulated MAP_CB Called right after the element is mapped WOM_CB Action generated when an audio device receives an event WHEEL_CB Action generated when the mouse wheel is rotated Note Note that some keys might remove the focus from the canvas To avoid this return IGNORE in the K_ANY callback Examples IupColor Creates a color to be used in the color definition of interface elements Parameters Return Ihandle IupColor int r int g int b in C There is no Lua equivalent color r
165. n Ihandle self in C elem highlight gt ret number in IupLua3 elem highlight_cb gt ret number in TIupLua5 Comments This callback should not be used with popup menus Affects upitem IUP_IDLE_ACTION Predefined IUP action generated when there are no events Callback int funetion in C Note Often used to perform background operations For example a time consuming drawing operation may allow the user to take a decision before the operation is over Lua Binding To modify this action function IupSetIdle myfunction must be used Use iup SetIdle myfunction in JupLuaS Using nil as a parameter removes the association Examples Affects Global callback See Also 200 IupSetFunction K_ANY Action generated when a keyboard event occurs Callback int function Ihandle self int e in C elem k_any gt ret number in IupLua self identifier of the element where the user typed something c identifier of typed key Please refer to the Keyboard Codes table for a list of possible values If the function returns IUP_IGNORE the system will ignore the typed character If the function returns the code of any other key IUP will treat this new key instead of the one typed by the user If the function returns IUP_CONTINUE the event will be propagated to the parent of the element receiving it Notes All defined keys are also callbacks
166. n error e g invalid mask iupMaskSetInt Ihandle h int autofill int min int max in C or in Iu iupMaskSetFloat Ihandle h int autofill float min float max in C or iupMaskMatSetInt Ihandle h int autofill int min int max int lin i iupMaskMatSetFloat Ihandle h int autofill float min float max int lii These functions set a mask that defines a limit to the typed number Works only for integers and floats Limitations since the validation process is performed key by key the user cannot type intermediate numbers even inside the limit if they are not following predetermined rules h Ihandle of IupText or IupMat rix autofill When 1 turns the auto fill mode on In auto fill mode whenever possible literal characters will be automatically added to the field min Minimum value accepted in the field max Maximum value accepted in the field lin col Line and column numbers in the matrix They always return 1 iupMaskCheck Ihandle h in C or in IupLua iupMaskMatCheck Ihandle h int lin int col in C or in IupLua These functions verify if what was typed by the user is valid for the defined mask h Thandle of IupText or IupMat rix lin col Line and column numbers in the matrix They return 1 if the text satisfies the mask or O otherwise iupMaskGet Ihandle h char val in C iupMaskGetFloat Ihandle h float fval in C iupMaskGetInt Ihandle h int
167. n only be created after the dialog and this can only happen after the programmer has called the ITupShow function to show the dialog We often need the elements to be created so we can use some other functionality of those elements before they are visible to the user For that purpose the IupMap function was created It maps IUP s elements to native system elements The TupShow function internally uses IupMap before showing the dialog on the screen in case it has not been called Each element contains a unique creation function and all of its management is done by means of attributes and callbacks using only functions that can apply to all elements Attributes Attributes are values associated to the elements and modified by means of functions IupSetAttribute IupSetAttributes and IupStoreAttribute The values passed for such functions are always strings In C and in IupLua there are several string definitions such as IUP_YES which is actually YES In LED there is no need to add the prefix IUP_ or quotation marks Since the attributes are strings there are two functions to store them 38 e IupSetAttribute stores only a pointer to the string and does not duplicate it e IupStoreAtribute duplicates the string allowing you to use it for other purposes With LupSetAttribute you can also store particular application attributes This can be very useful for instance used together with callbacks which are gl
168. nce with the following characters Character Meaning name of a control instance or an action any string interface control Ihandle from this character on a list of control instance names or a list of Hi interface control Ihandle O from this character on a list of controt instance names ora list of 56 actions will be passed xo from this character on a list of strings will be passed from this character on a list of interface controls will be passed Ihandle Attribute Treatment By default a control inherits the same attributes defined for IUP s Canvas element The developer of a new control can define new attributes For such he she must redefine the ICPI_SETATTR ICPI_GETATTR and ICPI_GETDEFATTR methods if necessary If any attribute manipulation method is redefined the standard procedure is e identify if the given attribute is part of the set of attributes that must receive any special treatment by the new control e if the attribute is part of this set then the adequate treatment must be provided e if not the default method must be called to treat the attribute Default Methods In this section we present the set of functions corresponding to the default behavior of an interface element s methods Such functions can either be used to fill an Iclass structure or be called by a new method to execute the default procedure either before or af
169. nction returns the identifier of the created vbox or NULL nil in Lua if an error occurs Attributes ALIGNMENT Horizontally aligns the elements Possible values ALEFT ACENTER ARIGHT Default ALEFT GAP Defines a space in pixels between the interface elements MARGIN Defines a margin in pixels SIZE Height of the vbox Default smallest size that contains the children elements Note The box can be created with no elements and be dynamic filled using lupAppen Examples 117 ioixi a ALIGNMENT ACENTER MARGIN 15 f A i ALIGNMENT ARIGHT SIZE 20 g B By See Also TupZbox IupHbox IupZbox Creates a zbox interface element It is a box that piles up the elements it contains Parameters Return Thandle IupZbox Ihandle eleml Ihandle elem2 NULL in C iupzbox eleml elem2 iuplua_tag gt elem iuplua_tag in TIupLua3 iup zbox eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua5 zbox elem1 elem2 in LED elem1l elem2 List of the identifiers that will be placed in the box Note that in C NULL must be added as the last element defining the end of the list This function returns the identifier of the created zbox or NULL nil in Lua if an error occurs Attributes 118 ALIGNMENT Defines the alignment of the visible element Possible values NORTH SOUTH
170. ne element The BGCOLOR attribute has no effect Examples IupImage Creates an image to be shown on a label button toggle or as a cursor 92 Parameters Return Ihandle IupImage int width int height char pixels in C ilupimage pixels table of numbers colors table of colors gt elem iuplua_ iup image pixels table of numbers colors table of colors gt elem iuplua image width height bl b2 in LED width Image width in pixels height Image height in pixels pixels Vector containing the color of each pixel b1 b2 Color index of the pixels This function returns the identifier of the created image or NULL nil in JupLua if an error occurs Attributes 0 Color in index 0 1 Color in index 1 i Color in index i The indices can range from 0 to 255 The total number of colors is limited to 256 colors Notice that in Lua the first index in the array is 1 the index 0 is ignored in IupLua Be careful when setting colors since they are attributes they follow the same storage rules for standard attributes The values are integer numbers from 0 to 255 one for each color in the RGB standard 255 255 255 If the value of a given index is BGCOLOR the color used will be the background color of the element on which the image will be inserted The BGCOLOR must be defined with an index less than 16 HOTSPOT The hotspot x y coordinates used to define cursors
171. ned by IupGetAttribute must never be freed or changed In IupLua only known internal pointer attributes are returned as user data all other attributes are returned as strings To access attribute data always as user data use IupGetAttributeData Lua 3 and iup GetAttributeData Lua 5 Example See Also TupSetAttribute IupGetInt IupGetFloat IupSetAttributes TupGetHandle IupSetAttributes Defines a set of attributes for an interface element This function keeps a copy of the attributes parameters Parameters Return Thandle IupSetAttributes Ihandle element char attributes in C IupSetAttributes element iulua_tag attributes string gt elem iulua_tag iup SetAttributes element iulua_tag attributes string gt elem iulua_tag element Identifier of the interface element attributes inthe form vl al v2 a2 where vi is the name of an attribute and ai is its value This function returns element if all attributes were defined or NULL nil in Lua otherwise Notes It is worth noting that in this function the names of the attributes recognized by IUP cannot be defined with the prefix ITUP_ This function returns the same Ihandle it receives This way it is a lot easier to create dialogs in C For example dialog IupSetAttributes TupDialog TupVBox TupSetAttributes IupFill SIZE 5 TupHBox TupSetAttributes IupFill
172. new interface elements as needed IUP is free software can be used for public and commercial applications Availability The library is available for several compilers e GCC and CC in the UNIX environment e Visual C Borland C Watcom C and GCC Cygwin and MingW in the Windows environment The library is available for several operating systems e UNIX SunOS IRIX AIX and Linux e Microsoft Windows NT 2K XP Support The official support mechanism is by e mail using iup AT tecgraf puc rio br replace AT by Before sending your message e Check if the reported behavior is not described in the user guide e Check if the reported behavior is not described in the specific format characteristics e Check the History to see if your version is updated e Check the To Do list to see if your problem has already been reported If all these points were checked you can report your problem Please specify in your message function attribute callback platform and compiler Announcements of new versions are done by the read only list iup l AT tecgraf puc rio br replace AT by Send a request to the support e mail to be added or removed from the list Credits This work was developed at Tecgraf by means of the partnership with PETROBRAS CENPES People who took part in IUP s development Andr Carregal Andr Costa Andr Derraik Antonio Scuri Carlos Augusto Mendes Carlos Henrique Levy Carlos J
173. ng IUP the only limitation now is Windows capacity to create native elements 24 e Events of IupButton and IupToggle were being improperly called when a IupHide ora IupShow was made on the dialog e A bug when drawing an image associated to a IupToggle element was fixed e The functioning of attributes IUP_DEFAULTENTER and IUP_DEFAULTESC was corrected e Now when a user changes the selection of a multiple L upList via programming IUP internally updates the selection e The IUP_BGCOLOR attribute to define a new cursor was not standardized with the Motif driver and color 0 in the Windows image was never allowed to be transparent e A bug in the dropdown list was fixed It was not calling callback GETFOCUS_CB causing instability in the lupMat rix element e The transparency color in a cursor now must be color number 0 according to the manual this is the way it was supposed to be e The IupList dropdown callback is no longer called for element 0 which does not exist e A button in a Popup dialog was only allowing to be pressed via mouse Now it can be pressed with the space key e The IupSetAttribute x UP_VISIBLE IUP_YES call when x was a dialog was not working e Calling IupHide with a frame with hvz box or with radio was not the same thing as calling IupSetAttribute n IUP_VISIBLE IUP_NO e The IUP_MOUSEPOS position in a dialog s IupPopup was not functioning
174. ng with radio control e Now folder selection in IupFileDlg uses UP_DIRECTORY as a start path e Now when ESC or ENTER is pressed KEYPRESS_CB is generated Motif Dropdown were becoming unstable when VALUE attribute is set after lupMap Dropdown were not being positioned accordingly IupList was not selecting the first item IupTimer callback were called only once The value BGCOLOR in a value of an image color table index appeared with erroneous color keyboard and mouse callbacks were not being called when in full screen LEDC Updated to reflect 2 0 changes like iupmatrx to iupmatrix Now tests if name is not NULL before using IupSetHandle IupLua New binding for Lua 5 This is beta version since uses old notation iuplabel instead of iup label Version 2 0 23 Jun 2003 General IUP has undergone a large internal reorganization but no structural or algorithmic changes have occurred The purpose of this reorganization was to standardize function variable and module nomenclature This process is not yet complete but the few remaining details will be solved in the next version Table Hash was completely replaced with a modified version of Lua 4 This version is internal of IUP and does not affect applications This has brought us a better management of the memory used by attributes The CPI was changed to allow the creation of native controls as well as controls based on IupCanvas The internal controls were not yet
175. nitialize the control Create control instances Implement the CPI methods associated to the control Make exported information available to the user function prototypes definitions etc General Control Initialization The initialization function is in charge of passing IUP the necessary information so that the control can be used Such information is grouped in an Iclas s type structure which from now on is to be called the class of the control The first step is to create the structure This is done by calling the iupCpiCreateNewClass function To this function two pieces of information must be passed a string identifying the control in a unique way the name of the control and a string describing the creation parameters when the control is created via LED The pointer returned by itupCpiCreateNewClass must be stored in a static module variable as it will be necessary to create new control instances Next step is to replace if necessary the control s CPI method This is done through function LupCpiSetClassMethod which receives the control s class as an argument and the pointer to the new method Important Function iupCpiCreateNewClass fills the class with default methods which provide the control a default behavior This initialization function must be named IupCont rolOpen where Cont rol is the name of the control Example class creation for a control named Dial include lt iup h gt
176. nt Parameters Return void IupStoreAttribute Ihandle element char a char v in C TupStoreAttribute element iulua_tag attribute string value string iup StoreAttribute element iulua_tag attribute string value string element identifier of the interface element a name of the attribute v value of the attribute If it equals NULL nil in IupLua the attribute will be removed from the element Note The value stored in the attribute is duplicated Usually you will not use this function to store private attributes of the application See Also IupGetAttribute IupSetAttribute IupSetAttribute Defines an attribute for an interface element Parameters Return in I in 79 void IupSetAttribute Ihandle element char a char v in C TupSetAttribute element iulua_tag attribute string value string in Iup iup SetAttribute element iulua_tag attribute string value string in Iu element Identifier of the interface element a name of the attribute v value of the attribute If it equals NULL nil in Lua the attribute will be removed from the element Notes The value stored in the attribute is not duplicated Therefore you can store your private attributes such as a structure with data to be used in a callback When you want IUP to store an attribute by duplicating a string passed as a value use function LupStoreAttribute For further information on memor
177. nt function Ihandle self int lin int col in C elem enteritem lin col number gt ret number in IupLua3 elem enteritem_cb lin col number gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the selected cell The user must return ILUP_DEFAULT FGCOLOR_CB Action generated to retrieve the foreground color of a cell when it needs to be redrawn int function Ihandle self int lin int col unsigned int red unsigne elem bgcolor_cbh lin col number gt ret red green blue number in self Identifier of the matrix where the user typed something lin col Coordinates of the cell red green blue the cell foreground color If the function return IUP_IGNORE the return values are ignored and the attribute defined foreground color will be used If returns UP_DEFAULT the returned values will be used as the foreground color LEAVEITEM CB Action generated when a cell is no longer the current cell int function Ihandle self int lin int col in C elem leaveitem lin col number gt ret number in IupLua3 elem leaveitem_cb lin col number gt ret number in IupLua5 self Identifier of the matrix interacting with the user lin col Coordinates of the cell which is no longer the current cell The user must return either I UP_DEFAULT or LUP_IGNORE Returning UP_IGNORE prevents the current cell from chan
178. nt was declared without being associated to any name This declaration creates the element but it will not be accessible so it cannot be used element name already used in line number The name element was already used in line number In IUP the same element cannot have more than one parent too few arguments for name The name element expects more arguments than those already passed too many arguments for name The name element expects less arguments than those passed name is not a valid child The name element cannot be used as a parameter in this case This happens when trying to insert an image into a vbox for instance control expected argument number A string was passed as a parameter for an element type argument string expected argument number An element was passed as a parameter for a string type argument number expected argument number An element or a string was passed as a parameter for a number type argument callback expected argument number An element was passed as a parameter for a callback type argument hotkeys not implemented Even though it is a LED word reserved to an element it is not implemented Functions The internal IUP functions allow the user to read and set values set callbacks destroy elements show and hide dialogs etc deciding how the library must work System Control Allows initializing the library controlling the execution order of tasks and using help 60 through Netscap
179. obal functions called by IUP when the user interacts with an interface element and receive the element relative to the action as a parameter For example by storing a C pointer to some element s specific data the user can retrieve it inside the callback through function IupGetAttribute Therefore even if the callbacks are global functions the same callback can be used for several objects even of different types Elements included in other elements inherit their attributes unless an attribute is defined inside the element This means there is an inheritance mechanism inside a given dialog Therefore when you consult the attribute of an undefined element the inheritance mechanism will check the element containing it and so forth until it reaches the dialog This means for example that if you set the IUP_MARGIN attribute of a vbox containing several other elements including other vboxes all the elements depending on it will be affected Please note not all attributes are inherited Exceptions are LUP_TITLE UP_SIZE UP_VALUE IUP_ALIGNMENT and IUP_FULLSCREEN In IUP s documentation you will notice several common attributes to the elements Some attributes that serve almost all elements are not mentioned in each one of the elements We assume that the programmer knows they exist In some cases common attributes behave differently in different elements In such cases there are comment
180. oes not allow marking individual nodes Default NO SHIFT Activates or deactivates the Shift key function Possible values YES Shift key activated allows marking adjacent nodes NO Shift key deactivated does not allow marking adjacent nodes Default NO STARTING Defines the initial node for the block marking The value must be the node identifier Default root node Images 155 IMAGELEAF Defines the image that will be shown for all leaves Must be a 16x16 image IUP name of the image see IupImage Default IMGLEAF IMAGEBRANCHCOLLAPSED Defines the image that will be shown for all collapsed branches Must be a 16x16 image IUP name of the image see IupImage Default IMGCOLLAPSED IMAGEBRANCHEXPANDED Defines the image that will be shown for all expanded branches Must be a 16x16 image IUP name of the image see IupImage Default IMGEXPANDED IMAGEid Defines the image that will be shown on a specific node Valid for leaves and for collapsed branches This attribute must always be used with the id number This attribute can only be set Ex IMAGE2 IUP name of the image see IupImage Default NULL IMAGEEXPANDEDid Defines the image that will be shown on a specific node It has no effect over leaves and is valid for expanded branches This attribute must always be used with the id number This attribute can onl
181. of any element called when the respective key is activated For exemple K_cC is also a callback activated when the user press Ctrl C A shortcut key or hot key can also be associated to any existing callback either in a menu or any other element using this same mechanism These callbacks do not work in LupLua The K_ANY callback is a callback that depends on the keyboard focus and the keyboard usage of the control with the focus It is usually only set for dialogs but if a control set the K_ANY callback the dialog callback will only be called if the control callback returns ITUP_CONTINUE Also some keys may not activate the callback since they are reserved keys like Enter and Esc Affects All KEYPRESS_CB Action generated when a key is pressed or released If the key is pressed and held several calls will occur Callback int function Ihandle self int c int press in C elem keypress c press number gt ret number in IupLua3 elem keypress_cbh c press number gt ret number in IupLua5 self identifier of the element 201 c identifier of typed key Please refer to the Keyboard Codes table for a list of possible values press is the user pressed the key or 0 otherwise This function may return LUP_CLOSE Affects TupCanvas KILLFOCUS_CB Action generated when an element loses keyboard focus This callback is called before the GETFOCUS_CB Callback int function Ih
182. olor of the provided node Using the form COLORid where id is the node identifier it is possible to set or retrieve the color of any node The value should be a string in the format R G B where R G B are numbers from 0 to 255 Action ADDLEAF Adds a new leaf after the selected node The id of the new leaf will be the id of the selected node 1 The selected node is marked and all others unmaked The selected node position remains the same Using the ADDLEAFid form where id is the node identifier it is possible to insert a leaf after any node In this case the id of the inserted node will be id 1 If the specified node does not exist nothing happens This attribute can only be set The value must be a leaf name ADDBRANCH Adds a new branch after the selected node The id of the new branch will be the id of the selected node 1 The selected node is marked and all others unmaked The selected node position remains the same Using the ADDBRANCHid form where id is the node identifier it is possible to insert a branch after any node In this case the id of the inserted node will be id 1 By default all branches created are expanded If the specified node does not exist nothing happens This attribute can only be set The value must be a branch name DELNODE Removes the marked node or its children Using the DELNODEid form where id is the node identifier it is possible to remove any node The root cannot be removed
183. omatically hidden Affects TupDialog DEFAULTENTER Name of the default button activated when the user hits ENTER on a dialog Value Identifier of a button Default NULL Affects TupDialog DEFAULTESC Name of the default button activated when the user hits ESC on a dialog Value Identifier of a button Default NULL Affects 180 TupDialog SHRINK If this attribute is defined the elements will try to adjust even when the dialog s size is smaller than its minimum limit Value YES or NO Default NO Notes When the user changes the size of the dialog the elements are automatically re distributed inside the dialog Some elements even have their size changed if the EXPAND attribute is active When this size is smaller than a minimum limit in which all elements still fit the dialog the elements distribution is no longer modified Actually the virtual size of the dialog remains larger than its actual size on the screen and some elements to the right are hidden by the borders The SHRINK attribute offers an alternative to this behavior It makes the elements continue to rearrange even if they must overlap The results of this new rearrangement may vary according to the elements distribution on the dialog Affects up FILE TupDialog Filename initially shown in the dialog s File Name field If the user clicks OK this attribute wil
184. on checked menu item IMPRESS Windows Only Image of the checked menu item Callbacks ACTION Action generated when the item is selected HIGHLIGHT_CB Action generated when the item is highlighted Notes The text of the menu item accepts the control character t to force text alignment to the right after this character This is used to add shortcut keys to the menu aligned to the right Ex Save tCtr1 s Menu items are activated using the Enter key Attention Never use the same menu item in different menus Examples See Also Tlupseparator IupSubmenu lIupMenu IupMenu Creates a menu element which groups 3 types of interface elements item submenu and separator Any other interface element defined inside a menu will be ignored Parameters Return Thandle IupMenu Ihandle elem1 Ihandle elem2 NULL in C iupmenu elem1 elem2 iuplua_tag gt elem iuplua_tag in IupLua3 ilup menu eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua5 menu elem1 elem2 in LED elem1 elem2 List of identifiers that will be grouped by the menu NULL defines the end of the list in C This function returns the identifier of the created menu or NULL if an error occurs 120 Note A menu can be that of a dialog bar defined by the dialog s MENU attribute or a popup menu A popup menu is displayed for the user usually on the mouse position and di
185. original size e Consulting attribute BGCOLOR in a dropdown list was aborting the application Consulting attributes BGCOLOR and FGCOLOR of a canvas with a different visual from the default was generating an X Windows error message The problem with LupFileD1g was fixed the application was aborting 28 IupDestroy ina bar menu was inducting an infinite loop to the application The list now matches the documentation it calls the action callback for the de selected element with the v 0 parameter Bug correction The use of a Motif attribute instead of a function was making Motif lost control of memory management memory already liberated was liberated again which aborted the application ACTION in LupText caused SIGSEV when the user pressed ENTER New IupMapFont for mapping IUP fonts gt Motif Version 1 8 2 Windows Driver 12 Jan 99 Function char IupMapFont char font converts a IUP font describer used by the IUP_FONT attribute into a native font describer used by IUP_WIN_FONT File Drag amp Drop was implemented in dialogs and canvases via the IUP_DROPFILES_CB callback Attribute IUP_EXTFILTER was implemented for the IupFileD1g control allowing the use of more than one filter Changes were made to allow the creation of CPI elements other than CANVASes or dialogs The IUP_ACTIVE attr
186. os Pereira de Lucena Claudio Coutinho de Biasi Danny Reinhold Diego Nehab Diogo Martinez Enio Emanuel Russo Guilherme Fonseca Alvarenga Henrique Dalcin Mendes Pinheiro Leonardo Constantino Oliveira Luiz Henrique de Figueiredo Marcelo Gattass Mark Stroetzel Glasberg Mauricio Oliveira Carneiro Milton Jonathan Neil Armstrong Renato Borges Renato Cerqueira Roberto Beauclair Vinicius Almendra We must also mention engineer Enio Emanuel Russo from PETROBRAS who effectively contributed to the system s specification and project The initial version of the present document was developed by Carlos Henrique Levy Neil Armstrong and Andr Carregal being supervised and oriented by Luiz Martins Luiz Henrique de Figueiredo Marcelo Gattass and Carlos Jos Pereira de Lucena at Tecgraf PUC Rio for the Data Processing Sector SEPROC at CENPES PETROBRAS Documentation This toolkit is available at http www tecgraf puc rio br iup The full documentation can be downloaded from the Download by choosing the Documentation Files option The documentation is also available in Adobe Acrobat iup pdf 1 0Mb and Windows HTML Help iup chm 900Kb formats The HTML navigation uses the WebBook tool available at http www tecgraf puc rio br webbook Publications This product stimulated the following scientific publications e Levy C H Figueiredo L H Gattass M Lucena C and Cowan D UP LED A Portable Use
187. ot used for the circular dial TupLua in Iup 123 BGCOLOR Controls the background color The default value is the parent or the dialog background color DENSITY Contains average value of the number of lines per pixel in the dial The purpose of this attribute is to maintain the control s appearance when its size changes Default is 0 2 UNIT Contains the unit of the angle Can be DEGREES or RADIANS Default is RADIANS VALUE Contains the dial value in a given moment The value is an angle starting at zero when the interaction started TYPE Informs whether the dial is VERTICAL HORIZONTAL or CIRCULAR EXPAND The default is NO SIZE the default is 16x80 80x16 or 40x35 according to the dial type Callbacks MOUSEMOVE_ CB Called each time the user moves the dial with the mouse button pressed The angle the dial rotated since it was initialized is passed as a parameter int function Ihandle self double angle in C elem mousemove angle number gt ret number in IupLua3 elem mousemove_cb angle number gt ret number in IupLua5 BUTTON_PRESS_CB Called when the user presses the left mouse button over the dial The angle here is always zero except for the circular dial int function Ihandle self double angle elem buttonpress angle number gt ret number in IupLua3 elem buttonpress_cbh angle number gt ret number in IupLua5 BUTTON
188. ownload page When you build the project the Visual C linker will display the following message LINK warning LNK4098 defaultlib LIBC conflicts with use of other 1il The default configuration use the C run time library with debug information and IUP uses the C run time library without debug information You can simply ignore this warning or change your project properties in C C Code Generation in the left tree then change Run Time Library to Single Threaded ML If you want to use multithreading then you must use the DLL version of the IUP libraries They are built with the Multi threaded DLL MD option Or you must rebuild the libraries with your own parameters Building IUP TUP runs on many different systems and interact with many different libraries such as Motif OpenGL Canvas Draw CD and Lua 3 2 4 0 and 5 0 In order to assist in the compilation process IUP uses Tecmake Tecmake is essentially a general GNU makefile with a series of predefined targets and rules with the purpose of providing those in charge of developing libraries and 45 applications the necessary tools so that versions for different platforms can be generated homogeneously In other words the tecmake user does not need to create a makefile nor be concerned with his her current platform to create a library or application which we will here call product To build IUP first install Tecmake Note that Tecmake defines names for
189. ox that contains the button box static Ihandle cb Identifier of the button box 72 static int visivel 1 1 if the button box is on the screen Function that displays the button box static int exibe void if visivel 0 TupHide pc IupAppend pc cb TupShow pc visivel 1 return IUP_DEFAULT Function that hides the button box static int retira void if visivel 1 TupHide pc TupDetach cb TupShow pc visivel 0 return IUP_DEFAULT void main void Thandle d Identifier of the dialog TupOpen Creates button box cb IupFrame IupVbox TupButton Select acao_select TupButton Line acao_line TupButton Poligono acao_poligono TupButton Circulo acao_circulo NULL Creates a box containing a canvas and the buttons pc IupHbox lupFrame IupCanvas acao_repaint cb NULL d IupDialog pc cria o do di logo TupSetAttribute d IUP_K_Fl exibe_caixa Defines F1 to display the TupSetAttribute d IUP_K_F2 retira_caixa Defines F2 to hide the b Associates functions to the actions TupSetFunction exibe_caixa Icallback exibe TupSetFunction retira_caixa Icallback retira TupShow d Shows the dialog TupMainLoop Interacts with user TupClose 0 otherwis 73 See Also IupAppend IupDestroy
190. pMatrix e Images with variable sizes for nodes IupLua e lupGetParam binding New Controls Spin Button Image Listbox Concrete Layout Container to position elements with abssolute coordinates relative to the box Grid Container to distribute elements in a grid TupOle control Comparing IUP with Other Interface Toolkits Why to still maintain IUP if today we have so many other popular toolkits This is a question we always ask to ourselves before going on for another year To answer that question we must first define the characteristics of the ideal toolkit list the available toolkits and compare them with the ideal and with IUP We would like a toolkit that has e Portability That provides an abstraction for User Interface in Windows UNIX and Macintosh e Free License and Open Source This means that we can also produce commercial applications The pure GPL license can not be used but the LGPL can but must contain an exception stating that derived works in binary form may be distributed on the user s own terms This is a solution that satisfies those who wish to produce GPL ed software and also those producing proprietary software Many libraries are distributed with this license combination e Small and Simple API This is rare Many libraries assume that an Interface toolkit is also a synonymous of a system abstraction and accumulate thousands of extra functions that are not related to User Interface At Tecgraf we like many
191. pdialog element iuplua_tag gt elem iuplua_tag in IupLua3 iup dialog element iuplua_tag gt elem iuplua_tag in IupLua5 dialog element in LED element Identifier of an interface element This function returns the identifier of the created dialog or NULL if an error occurs Attributes CURSOR Defines a cursor for the dialog ICON Dialog s icon MAXBOX Requires a maximize button from the window manager Creation only attribute MENU Associates a menu to the dialog MENUBOX Requires a menu box from the window manager Creation only attribute MINBOX Requires a minimize button from the window manager Creation only attribute RESIZE Allows interactively changing the dialog s size Creation only attribute SIZE Dialog s size Differently from other interface elements the following values can be defined for width and height e FULL Defines the dialog s width or height equal to the screen s width or height e HALF Defines the dialog s width or height equal to half the screen s width or height e THIRD Defines the dialog s width or height equal to 1 3 the screen s width or height e QUARTER Defines the dialog s width or height equal to 1 4 of the screen s width or height e EIGHTH Defines the dialog s width or height equal to 1 8 of the screen s width or height Default the smallest size that allows viewing the dialog The dialog
192. placed after the last character in the line Affects TupList IupMultiline IupText INSERT Inserts a text in the caret s position Value Any text even with n characters indicating line change 175 Affects IupList IupMultiline IupText READONLY Defines whether an element can be entered text or not Value YES or NO Default NO Note Even though this attribute prevents the user from editing text it allows the user to use the navigation keys right left etc Affects IupList IupMultiline IupText SELECTION Modifies or returns the selection of a text edition field Value Multiline A text in the Linl coll 1lin2 col2 format where Linl coll lin2 and col2 are integer numbers corresponding to the selection s interval The first position is 1 Default 1 1 1 1 Value Text List A text in the beg end format where beg and end are integer numbers corresponding to the selection s interval Default 1 1 Affects TupList IupText IupMultiline SELECTEDTEXT Modifies or consults the selected text Value 176 Text Note The text is modified even if the element uses the READONLY attribute Affects TIupList IupText IupMultiline BORDER Shows a border around the element Value WwW YES W or NO W Default YES Note In some elements such as TupDialog this a
193. plua_open IupClose Guide System Control IupClose Ends the IUP toolkit Parameters Return void IupClose void in C There is no Lua equivalent Notes The IupOpen function in the Windows driver initializes OLE through the function OleInitialize IupClose calls OleUninitialize Lua Binding This function must be called by the host program See Also TupOpen IupMainLoop Executes the user interaction until a callback returns IUP_CLOSE Must be called before the IupClose function Parameters Return int IupMainLoop void in C IupMainLoop gt ret number in IupLua3 iup MainLoop gt ret number in IupLua5 Returns IUP_NOERROR or IUP_ERROR 62 Notes If this function is executed at any other moment it will interrupt the execution until a callback returns IUP_CLOSE A second execution of IupMainLoop will have a platform dependent behavior Presently the return value can be ignored as in all platforms it currently returns TUP_NOERROR The message loop will go on only while there is a dialog At the moment the last dialog is destroyed or hidden the loop will be ended and IupMainLoop will return the control to the application except if the Idle callback is defined in this case the Idle callback must return IUP_CLOSE for the application to receive the control back Motif Driver Can be executed several times but a UP_CLOSE must occur for each execution W
194. r b1 char b2 char b3 in C TupAlarm t m b1 b2 b3 string gt button number in IupLua3 iup Alarm t m bl b2 b3 string gt button number in IupLua5 t Dialog s title m Message b1 Text of the first button b2 Text of the second button optional b3 Text of the third button optional This function returns the number 1 2 3 of the button selected by the user or 0 nil in TupLua if the dialog could not be opened Notes This function shows a dialog centralized on the screen with the message and the buttons The n character can be added to the message to indicate line change A button is not shown if its parameter is NULL This is valid only for b2 and b3 Button 1 is set as the DEFAULTENTER and DEFAULTESC If Button 2 exists it is set as the DEFAULTESC If Button 3 exists it is set as the DEFAULTESC The dialog uses a global attribute called PARENTDIALOG as the parent dialog if it is defined Examples File not saved Save it now See Also IupMessage IupScanf IupListDialog IupGetFile 110 IupGetFile Shows the dialog of the native interface system which captures a filename Parameters Return int IupGetFile char file in C TupGetFile file string gt file string error number in IupLua3 iup GetFile file string gt file string error number in IupLua5 file This parameter is used as an input value to def
195. r Interface Development Tool Software Practice amp Experience 26 7 1996 737 762 spe95 pdf e Levy C H IUP LED Uma Ferramenta Port til de Interface com Usuario M Sc dissertation Computer Science Department PUC Rio 1993 levy93 pdf e Figueiredo L H Gattass M and Levy C H Uma Estrat gia de Portabilidade para Aplica es Gr ficas Interativas Proceedings of VI SIBGRAPI 1993 203 211 sib93 pdf e Oliveira Prates R Figueiredo L H and Gattass M Especifica o de Layout Abstrato por Manipula o Direta Proceedings of VII SIBGRAPI 1994 165 172 sib94 pdf e Oliveira Prates R Gattass M and Figueiredo L H Visual LED uma ferramenta interativa para gera o de Interfaces gr ficas M Sc dissertation Computer Science Department PUC Rio 1994 prates94 pdf Tecgraf Library License This product is free software it can be used for both academic and commercial purposes at absolutely no cost There are no royalties or GNU like copyleft restrictions It is licensed under the terms of the MIT license reproduced below and so is compatible with GPL and also qualifies as Open Source software It is not in the public domain Tecgraf and Petrobras keep its copyright The legal details are below The spirit of this license is that you are free to use the library for any purpose at no cost without having to ask us The only requirement is that if you do use it then you should give us credit by
196. r corresponds to the base column and the second number corresponds to the number of columns to be removed It is valid only in normal mode The value must be a column number DELLIN Removes the given line from the matrix To remove more than one line use format L L where the first number corresponds to the base line and the second number corresponds to the number of lines to be removed It is valid only in normal mode The value must be a line number EDIT_MODE When set to YES programatically puts the current cell in edition mode allowing the user to modify its value When consulted informs if the the current cell is being edited Possible values YES or NO REDRAW The user can inform the matrix that the data has changed and it must be redrawn Values ALL Redraws the whole matrix Ld Redraws the given line e g L3 redraws line 3 L d d Redraws the lines in the given region e g L2 4 redraws lines 2 3 and 4 C d Redraws the given column e g C3 redraws column 3 C d d Redraws the columns in the given region e g C2 4 redraws columns 2 3 and 4 General Attributes CURSOR Default cursor used by the matrix The default cursor is a symbol that looks like a cross If you need to refer to this default cursor use name matrx_img_cur_excel FRAMECOLOR Sets the color to be used in the matrix s frame lines SCROLLBAR Associates a horizontal and or vertical scrol
197. required attributes specified in the call to the iupCpiDefaultCreate Prototype IThandle create Iclass class This method is called by IUP when the IupDest control or its dialog If necessary this method cai structures maintained by the control CPI_DESTROY iupCpiDefaultDestroy Prototype void destroy Ihandle self This method is called by IUP to map the control i parameter indicates of which window the control CPI_MAP be a dialog or any other control iupCpiDefaultMap Prototype void map Ihandle self Ihanc This method is called by IUP to destroy the cor CP I_UNMAP without removing the control from the control hic iupCpil DefaultUnmap CPI_SETNATURALSIZE DefaultSetNaturalSize CPI_SETCURRENTSIZE DefaultSetCurrentSize CP _SETPOS ON lupCpiDefaultSetPosition ilupCp CPI_SETATTR iDefaultSetAttr CPI_GETATTR iupCp iDefaultGetAttr CP _GET DEFA ULTATTR LupCpiDefaultGetl DefaultAttr 53 Prototype void unmap Ihandle self This method is called by IUP for the control to sf function must call functions iupSetNaturalWidt implementation might call the function associatec Iclass structure to be described further on to control This function must
198. river documentation Generating Applications The generation of applications is highly dependent on each system Please refer to each of IUP drivers documentation IUP can also work together with other interface toolkits The main problem is the IupMainLoop function If you are going to use only Popup dialogs then it is very simple But to use non modal dialogs without the IupMainLoop you must call IupLoopStep from inside your own message loop Also it is not possible to use Iup controls with dialogs 41 from other toolkits and vice versa There is also a guide on using the Dev C IDE Project Options and Visual C IDE Project Properties Dev C IDE Project Options Guide http www bloodshed net devcpp html Bloodshed Dev C is a full featured Integrated Development Environment IDE for the C C programming language It uses Mingw port of GCC GNU Compiler Collection as it s compiler Dev C can also be used in combination with Cygwin or any other GCC based compiler It has many features and integrated debug and it is free To use IUP with Dev C you will need to download the mingw3 binaries in the download page After unpacking the file in your conputer you must configure your Project Options In the Project Options dialog there are 3 important places e General Type you can configure Win32 GUI or Win32 Console but if you set to console it will always create a console screen behind your window when the
199. rrow keys events correctly in keypress_cb IupHide now can close popup dialogs Attribute TABSIZE for IupMultiline in Windows was not documented Default value for attribute BGCOLOR for IupCanvas in Windows was not documented Direction keys now are processed by the ACTION callback for IupText The GETFOCUS_CB and KILLFOCUS_CB management for the controls was reviewed and optimized GETFOCUS_CB now works for toggle and button First RESIZE_CB of the canvas received a wrong canvas size Label alignment for images was always center New global attribute MOTIFVERSION 10 IUP_SBDRAGV and IUP_SBDRAGH were not implemented HIGHLIGHT_CB menu item callback COMPUTERNAME USERNAME and LOCKLOOP global attributes IupMessage now uses native XmMessageBox The overwrite confirmation dialog was closing the file open if the user answered No Implemented the IUP_NOOVERWRITEPROMPT attribute for IupFileDlg The dropdown list now uses the Motif 2 combobox widget So IUP is not compatible with Motif 1 x anymore Now the GETFOCUS callback is also invoked when the list is dropdown KEYPRESS_CB is now called only for IupCanvas Controls DEFAULTESC and DEFAULTENTER were missing in IupGetColor New function IupLoadImage that uses the library IM to load an image file implemented in an additional library New dialog IupGetParam similar to IupScanf but uses variable controls for fields IupTabs now uses the FGCOLOR for the text co
200. s All TIP Summarized text usually just a word identifying the element s functionality The text will be shown when the mouse lies over the element Value Text Default NULL Note Background and foreground colors and the font used are predetermined and depend on the native system Affects Allexcept label menu itemand submenu item RASTERSIZE 168 Specifies the element s size in pixels Value widthxheight where width and height are integer values corresponding to the horizontal and vertical size respectively in pixels Default Depends on the system and on the EXPAND attribute Affects All Note When this attribute is changed the SIZE attribute is automatically updated Please refer to the notes on the SIZE attribute for further detail See Also TITLE Element s title It is often used to modify some static text of the element which cannot be changed by the user Value Text Default Affects All elements with an associated text See Also FONT VALUE Affects several elements differently that is its behavior is element dependent It is often used to change the control s main value such as the text of a lupText For the TupRadio and IupZbox elements which are categorized as composition elements this attribute represents the element selected among the others in the designed composition To change this attribute in such cases different mechanism
201. s explaining the expected behavior This also applies to the callbacks In Lua the elements are implemented as tables and the attributes can be accessed as indices For further detail please see the Lua Binding documentation Events Events are handled through callbacks Callbacks are functions the application can register to be called by IUP when a given user action occurs Please refer to the above comment on the use of attributes and callbacks Even though callbacks have different purposes from attributes they are actually associated to an element by means of an attribute To associate a function to a callback the user must employ the IupSetAttribute function linking the action to a name passed as a string From this point on this name will refer to a callback By means of function IupSetFunction the user connects this name to the callback For example TupSetAttribute meulIhandle UP_ACTION botao_foi_apertado TupSetFunction botao_foi_apertado Icallback mybtpressed Therefore callbacks also have some of the attributes functionalities The most important one is inheritance Though many callbacks are specific to a given element a callback can be set to a composition element such as a vbox which contains other elements and 39 while the composition element does not call that callback all other elements contained in it will call the same callback unless the callback is redefined in the el
202. s are necessary according to the programming environment used When the elements taking part in a composition were created in C this attribute s contents is a name that must be defined by 169 the TupSetHand1le function When the elements were created in Lua this attribute s contents is the name of a variable more precisely the one receiving the return from the function that created the element you wish to select In LED it is not possible to dynamically change the value of any attribute so the elements created in this environment must be identified and manipulated in C by means of their identifying name HOTSPOT Hotspot is the position inside a cursor image indicating the mouse click spot Its value is given by the x and y coordinates inside a cursor image Value x y where x and y are integers defining the coordinates in pixels Default NULL no hotspot Affects u mage See Also CURSOR HEIGHT Image height in pixels Verification only attribute Value Integer number Affects upImage WIDTH Image width in pixels This attribute can only be consulted Value Integer number Affects upImage KEY 170 Associates a key to a menu or submenu item Such key works as a shortcut when the menu is open Value String containing a key description Please refer to the Keyboard Codes table for a list of the possible values Default NULL Notes IUP automati
203. s function returns the element that received the focus See Also TupPreviousField IupPreviousField Shifts the focus to the previous element in a dialog to which the specified element belongs In does not depend on the element currently with the focus Parameters Return Thandle IupPreviousField Ihandle element in C IupPreviousField element iuplua_tag gt elem iuplua_tag in IupLua3 iup PreviousField element iuplua_tag gt elem iuplua_tag in IupLua5 element An element This function returns the element that received the focus See Also TupNextField IupDetach Disassociates an interface element from the dialog that contains it Parameters Return void IupDetach Ihandle element in C TupDetach element iuplua_tag in IupLua3 iup Detach element iuplua_tag in IuplLua5 or element detach in IupLua element Identifier of the interface element to be detached Notes This function does not destroy an interface element but only removes the dialog that contains it so that it can be used in another dialog ATTENTION At the moment this function only works before the element is mapped by means of functions IupMap IupShow IupShowXY or IupPopup The following example does not actually work Example Inserts and removes a button box in from a dialog In C include lt stdlib h gt NULL include iup h static Ihandle pc Identifier of the hb
204. s value the user must provide the same amount of 96 and symbols as the amount of items in the list otherwise the specified items will be deselected APPEND Inserts a text at the end of the current text Valid only when EDITBOX YES INSERT Inserts a text in the caret s position Valid only when EDITBOX YES NC Maximum number of characters allowed Valid only when EDITBOX YES CARET Position of the insertion point Valid only when EDITBOX YES READONLY Allows the user only to read the contents without changing it Possible values YES NO default Valid only when EDITBOX YES SELECTION Selection interval Valid only when EDITBOX YES SELECTEDTEXT Selection text Valid only when EDITBOX YES SHOWDROPDOWN Opens a dropdown list Windows Only Callbacks ACTION Action generated when the state of an item in the list is changed Also provides information on the changed item int function Ihandle self char t int i int v in C elem action t string i v string gt ret number in TupLua t Text of the changed item i Number of the changed item v Equal to 1 if the option was selected or to 0 if the option was deselected EDIT_CB Action generated when the text in the text box is manually changed by the user Valid only when EDITBOX YES int function Ihandle self int ce char after in C elem action e number after s
205. sappears when an item is selected Its implementation is done by means of a call to the IupPopup function IupDestroy should be called only for popup menus Lua Binding Offers a cleaner syntax than LED for defining menu submenu and separator items The list of elements in the menu is described as a string with one element after the other separated by commas Each element can be 1 lt item_name gt lt action gt menu item 2 lt submenu_name gt lt menu gt submenu 3 separator 4 lt interfac lement gt submenu item Callbacks OPEN_CB Called just before a submenu is opened MENUCLOSE_CB Called right before the submenu is closed Examples See Also IupDialog IupPopup Iupitem IupSeparator IupSubmenu IupSeparator Creates the separator interface element It shows a line between two menu items Parameters Return Thandle IupSeparator void in C iupseparator gt elem iuplua_tag in IupLua3 iup separator gt elem iuplua_tag in IupLua5 separator in LED This function returns the identifier of the created separator or NULL if an error occurs Note The separator is ignored when it is part of the definition of the items in a bar menu Examples See Also 121 upItem IupSubMenu IupMenu IupSubmenu Creates a menu item that when selected opens another menu Parameters Return Thandle I
206. tderr Error Opening IUP return TupMainLoop TupClose Abstract Layout Most interface toolkits employ the concrete layout model that is element positioning in the dialog is absolute in coordinates relative to the upper left corner of the dialog s client area This makes it easy to position the elements on it by using an interactive tool usually provided with the system It is also easy to dimension them Of course this positioning intrinsically depends on the graphics system s resolution Moreover when the dialog size 36 is altered the elements remain on the same place thus generating an empty area below and to the right of the elements Besides if the graphics system s resolution changes the dialog inevitably will look larger or smaller according to the resolution increase or decrease IUP implements an abstract layout concept in which the positioning of elements is done relatively instead of absolutely For such composition elements are necessary for composing the interface elements They are boxes and fillings invisible to the user but that play an important part When the dialog size changes these elements expand or retract to adjust the positioning of the elements to the new situation Watch the codes below The first one refers to the creation of a dialog for the Microsoft Windows environment using its own resource API The second uses IUP Note that apart from providing the specification greater fle
207. te on a marked element deletes everything Matrix leaves the edition mode when IupText s exit arrows are used There was a computation mistake in cell size when the Matrix was in edition mode When the user scrolls the Matrix exits the edition mode e ALL problems caused by cdAct ivate in Matrix were solved Other Extended Controls The element from IupGL was not getting the focus when it was the only element in the dialog In IupGL OpenGL now synchronizes its functioning with Motif gl XWaitX at resize 23 IupGC now works with IUP_ENGLISH s variable set cancel cancela red Verm etc IupGauge now accepts changing text or percentage values on the fly Tabs font now has a differentiated color when it is inactive IupLua IupScanf at IupLua was not performing the final dialog s popup TupSetLanguage IupGetLanguage IupMapFont and IupUnMapFont were created at IupLua It now considers the TLUPLUA_QUIET attribute The callbacks in IupLua are now inherited eg k_any from a dialog is called when TupCanvas does not have k_any The library s opening message now follows a standard IupLua was passing Lua s pointer to IUP instead of copying its value in IupSetHandle making it crash IupLua Program iuplua was not running with IupVal and lupGetColor iuplua now accepts several files as a parameter iuplua is now joined with 1upluafull iuplua no
208. te FOCUS_CELL Defines the currently focused cell Two numbers in the L C format L and C gt 1 Default 1 1 VALUE Allows setting or verifying the value of the current cell Is the same as using the L C attribute L and C corresponding to the current cell s line and column L and C gt 0 Line and Column Attributes NUMCOL Defines the number of columns in the matrix Must be an integer number Default 0 NUMCOL_ VISIBLE Defines the minimum number of visible columns in the matrix The remaining columns will be accessible only by using the scrollbar Must be an integer number Default 4 NUMLIN Defines the number of lines in the matrix Must be an integer number Default 0 NUMLIN VISIBLE Defines the minimum number of visible lines in the matrix The remaining lines will be accessible only by using the scrollbar Must be an integer number Default 3 ORIGIN Allows setting which cell will be placed in the upper left corner of the matrix by automatically scrolling the visible area To keep one of the coordinates of the cell in the upper left corner from being modified use a value such as L or C L and C gt 1 Possible values Two numbers in the L C format WIDTHDEF Default column width Must be an integer number Default Width corresponding to 20 characters WIDTHn Width of column n where n is the number of the wished column n gt 0 If the width value is 0 t
209. te is defined IMPRESS Image of the pressed button MINACTIVE Image of the button when the ACTIVE attribute equals NO If it is not defined but IMAGE is defined then for inactive buttons the non transparent colors will be replaced by a darker version of the background color creating the disabled effect SIZE Size of the button Default smallest size that allows viewing the text or image TITLE Text of the button Notes Buttons with images or texts can not change its behavior after mapped This is a creation attribute But after creation the image can be changed for another image and the text for another text Text and images are always centered Buttons are activated using Enter or Space keys When IMPRESS and IMAGE are defined together IUP does not show the element s border to provide a 3D effect the user has to define the border in the image itself Callbacks ACTION Action generated when the button is selected BUTTON_CB Action generated when any mouse button is pressed or released Examples See Also upiIimage IupToggle IupCanvas Creates an interface element that is a canvas a working area for your application Parameters Return Thandle IupCanvas char aection in C iupcanvas gt elem iuplua_tag in IupLua3 iup canvas gt elem iuplua_tag in TupLua5 canvas action in LED action Name of the action generated when the can
210. ter a TupOpen so that the control can be used The iupg1 h file must also be included in the source code The program must be linked to the control s library iupg1 lib on Windows and libiupgl aon Unix and with the OpenGL library To make the control available in Lua use the initialization function in C glua_open after calling iuplua_open The luag1 h file must also be included in the source code The program must be linked to the control s libraries luag1l lib on Windows and 1ibluagl a on Unix You will need also to link with the OpenGL libraries In Windows add openg132 11ib and optionally g1u32 1ib or glaux 1ib In Motif add before the Motif libraries LGLw LGLU LGL in Linux the GLw library is not available in the system so we include it inside the iupg1 library Parameters Return Thandle IupGLCanvas char action in C iupglcanvas gt elem iuplua_tag in IupLua3 iup glcanvas gt elem iuplua_tag in IupLua5 glcanvas action in LED action Name of the action generated when the canvas needs to be redrawn This function returns the identifier of the created canvas or NULL if an error occurs Attributes The ITupGLCanvas element understands all attributes defined for a conventional canvas see LupCanvas Apart from these attributes IupGLCanvas understands specific attributes used to define the kind of buffer to be instanced Such attributes must be set before the element is
211. ter the specialized treatment of the new control is executed Function corresponding to the setnaturalsize method int ctrsetnaturalsize Ihandle self Function corresponding to the setcurrentsize method void ctrsetcurrentsize Ihandle self int w int h Functions corresponding to the getsize method int ctrgetsize Ihandle self int w int h ou int ctrgetsizevar Ihandle self int w int h Note A control that associates the ct rget size function to its getsize method cannot vary in size when its dialog s size varies On the other hand a control that uses function ctrgetsizevar can vary in size according to the changes made to its dialog size Function corresponding to the setposition method void ctrsetposition Ihandle self int w int h Function corresponding to the create method void ctrcreate Ihandle self void array Function corresponding to the destroy method void ctrdestroy Ihandle self Function corresponding to the map method void ctrmap 57 Ihandle self Ihandle parent Function corresponding to the unmap method void ctrunmap Ihandle self Function corresponding to the setattr method void ctrsetattr Ihandle self char attr char value Function corresponding to the getattr method char ctrgetattr Ihandle self char attr Function corresponding to the getdefaultattr method char ctrgetdefaultat
212. terface element defined in LED first capture its identifier using function IupGetHand_1e passing the name of the interface element as parameter then use this identifier on the calls to IUP functions for example a call to the function that verifies the value of an attribute IupGetAttribute Attention in Lua IupGetHand1e is not able to get the handle of a IUP element created in C To get an Ihandle created in C use lupGetFromC name See Also TupsetHandle IupGetName Verifies the name of an interface element Parameters Return char IupGetName Ihandle elem in C TupGetName elem iuplua_tag gt name string in IupLua3 iup GetName elem iuplua_tag gt name string in IupLua5 elem Identifier of the interface element TT This function returns the name of an interface element Lua Binding This name is not associated with the Lua variable name this was inherited from LED and is needed for some functions See Also IupSetHandle IupGetHandle IupGetAllNames IupGetAlINames Verifies the names of all interface elements defined Parameters Return int IupGetAllNames char names int n in C TupGetAllNames names string table n numer gt num number in IupLua3 iup GetAllNames names string table n numer gt num number in IupLua5 names table receiving the names n maximum number of names the table can receive This function r
213. th no elements and be dynamic filled using IupAppen Examples l5 x EE erro SZE GAP 10 SIZE 200 ALIGNMENT ACENTER GAP 20 ALIGNMENT 4BOTTOM SIZE 150 See Also IupZbox LIupVBox IupRadio Creates the radio interface element Only one of its descendant toggles to be activated at a time Parameters Return Thandle IupRadio Ihandle element in C iupradio element iuplua_tag gt elem iuplua_tag in IupLua3 iup radiofelement iuplua_tag gt elem iuplua_tag in IupLua5 radio element in LED element Identifier of an interface element Usually it is a vbox or an hbox containing the toggles associated to the radio This function returns the identifier of the created radio or NULL nil in IupLua if an error occurs Attributes VALUE Identifier of the activated toggle The identifier is set by means of IupSetHandle Examples 116 IupRadio x IupVbox Creates a vbox interface element It is a box that shows the elements it contains vertically and from the top down Parameters Return Ihandle IupVbox Ihandle eleml Ihandle elem2 NULL in C iupvbox elem1 elem2 iuplua_tag gt elem iuplua_tag in IupLua3 iup vbox elem1 elem2 iuplua_tag gt elem iuplua_tag in IupLua5 vbox eleml elem2 in LED elem1 elem2 List of the identifiers that will be placed in the box NULL defines the end of the list This fu
214. that programmatically changes are not filtered The valuator when available can be retrieved using the parameter attribute AUXCONTROL The valuator is not automatically updated when the text box is changed programmatically The parameter label is also available using the parameter attribute LABEL Attributes inside the callback For the dialog PARAMn returns an IUP Ihandle representing the nth parameter indexed by the declaration order not couting separators oK returns an IUP Ihandle the main button CANCEL returns an IUP Thandle the close button For a parameter LABEL returns an IUP Ihandle the label associated with the parameter CONTROL returns an IUP Ihanadle the real control associated with the 128 parameter AUXCONTROL returns an UP Ihandle the auxiliary control associated with the parameter only for Valuators INDEX returns an integer value associated with the parameter index ITupGet Int can also be used VALUE returns the parameter value as a string but IupGet Float and TupGet Int can also be used Notes The format string must have the following format notice the n at the end text t extra n where text is a descriptive text to be placed to the left of the entry field in a label t is the type of the parameter The valid options are b boolean shows a True False toggle use int in C i integer shows a integer filtered te
215. the Solaris environment Can not find libresolv so 2 This error occurs if the system does not have an applied patch containing this library This library is important for all installations of Solaris 2 5 and 2 5 1 SunOS 5 5 and 5 5 1 respectively It is a correction of the DNS system involving security The web address to get these patches is SunSolve s http sunsolve 1 sun com sunsolve pubpatches patches html Select the Solaris version you wish 2 5 or 2 5 1 for Sparc and download the patches 103667 09 102980 17 103279 03 103708 02 or more recent for 2 5 the number after the is the patch version and the more recent number is the patch or 103663 12 103594 14 103680 02 and 103686 02 for 2 5 1 All of them have a README file explaining installation and groups have to be installed together TrueColor canvas Whenever a canvas is created one tries to create it with a TrueColor resolution Visual This is not always possible since it is subject to many conditions such as hardware graphics board and the X server s configuration The xdpyinfo program informs which Visuals are available in the X server where the display is being made so that you can see if your X allows creating a canvas with a TrueColor Visual In some platforms however the X server may not make a TrueColor Visual available even though the graphics board is able to display it In this case restart the server with parameters that force this Below
216. the elements in its interior TupMatrx The attributes I UP_DEFAULTESC and IUP_DEFAULTENTER of a dialog were not working in Windows they work only when the matrix is not in edition mode The matrix did not show the selected elements when the focus passed to another interface element In a dropdown when the user left edition mode changing the focus away from the matrix the previously entered value was lost Selection with the control key now works for selecting and deselecting The cell with the input focus now draws the selection status The attribute IUP_MARKED now works after the matrix is mapped The matrix now starts with no cell selected Clicking on the first column of a marked line with MARK_MODE LIN now also deselects the line When MARK_MODE is LIN COL or LINCOL the selection is not done on the focused cell When MARK_MODE is CELL and MULTIPLE is NO the whole line cannot be marked When MARK_MODE is NO nothing can be selected e The TAB key in the matrix now changes focus to next element e When MARK_MODE was NO default after leaving the edition mode with ENTER the cell was being marked TupVal Mousemove is now standardized Idle is not used anymore better optimization and code simplicity Minimum and maximum value when different from 0 and 1 now work Clicking a position in the middle of the IupVal now work correctly Version 1 9 0 18 Dec 2001
217. tically scroll the canvas in the vertical direction by some lines the SCROLL_CB callback if defined will be called with the IUP_SBDRAGV operation Callback 205 int function Ihandle self float delta int x int y char r in C elem wheel delta x y number r string gt ret number in IupLua3 elem wheel_cb delta x y number r string gt ret number in IupLua5 self identifier of the canvas that activated the function s execution delta the amount the wheel was rotated in notches x y position in the canvas where the event has occurred in pixels r status of mouse buttons and certain keyboard keys at the moment the event was generated The following macros must be used for verification isshift r iscontrol isbuttonl isbutton2 r isbutton3 r isdouble r r r a a PR a Notes In Motif delta is always lor 1 In Windows is some situations delta can reach the value of two In the future with more precise wheels this increment can be changed The wheel will only work if the focus is at the canvas Affects TupCanvas WOM_CB Action generated when an audio device receives an event WINDOWS DRIVER ONLY Callback void function Ihandle self int v in C not implemented in Lua where v is 1 0 1 meaning closing ending and opening respectively Affects TupCanvas Drivers IUP s ability to work in several platforms is due to the existence of individual
218. tons and some keyboard keys at the moment the event is generated The following macros must be used for verification 197 isshift status iscontrol status isbutton1 status isbuttonz2 status isbutton3 status isdouble status They return 1 if the respective key or button is pressed and O otherwise Affects lupCanvas JupButton CLOSE_CB Called just before a dialog is hidden due to some action over it for example double clicking the system s menu box usually located to the left in the title bar Callback int function Ihandle self in C elem close gt ret number in IupLua3 elem close_cbh gt ret number in IupLua5 Returning IUP_IGNORE it prevents the dialog from being hidden If you destroy the dialog in this callback you must return IUP_IGNORE Affects TupDialog DEFAULT_ACTION Predefined IUP action generated every time an action has no associated function Callback int function Ihandle self in C There is no Lua equivalent self identifier of the element that activated the function Note Often a programmer defines an action with a name and when associating it to a function he she mistypes the action name or vice versa This kind of mistake is very common and TUP is not able to automatically detect it The predefined IUP_DEFAULT_ACTION action combined with function IupGetAct ionName can help the programmer detect this problem
219. tored in attributes for each cell In callback mode these attributes are ignored and the cells are filled with strings returned by the VALUE_cB callback So the existance of this callback defines the mode the matrix will operate Parameters Return Thandle IupMatrix char action in C lupmatrix gt elem iuplua_tag in IupLua3 iup matrix gt elem iuplua_tag in IupLua5 matrix action in LED action Name of the action generated when the user types something Returns the identifier of the created matrix or NULL if an error occurs Attributes Cell Attributes L C ALIGNMENTn BGCOLOR FGCOLOR FONT FOCUS_CELL VALUE Line and Column Attributes NUMCOL NUMCOL VISIBLE NUMLIN NUMLIN_ VISIBLE ORIGIN WIDTHDEF WIDTHn HEIGHTn RESIZEMATRIX Mark Attributes AREA MARK MODE MARKED MULTIPLE Action Attributes ADDCOL 137 ADDLIN DELCOL DELLIN EDIT MODE REDRAW General Attributes CURSOR FRAMECOLOR SCROLLBAR SIZE CARET SELECTION HIDEFOCUS Callbacks ACTION Action generated when a keyboard event occurs BGCOLOR CB Action generated to retrieve the background color of a cell when it needs to be redrawn CLICK CB Action generated when any mouse button is pressed over a cell DROP CB Action generated to determine if a text field or a dropdown will be shown DROPCHECK CB Action generated to determine if a dropdown feedback should be shown DROPSELECT
220. tr Ihandle self char attr Extra Functions Following we provide a list of extra IUP functions They can be used by programmers wishing to create a new control Main control creation functions Iclass iupCpiCreateNewClass char name char format int iupCpiSetClassMethod Iclass ic char method Imethod func Functions that call the method in charge for the given action int iLupmethSe tNaturalSize Ihandle self void iupm O thSetCurrentSize Ihandle self int w int h int iupmethGe tSize Ihandle self int w int h void void void void void thSetPosition Ihandle self int w int h thCreate Ihandle self void array thDestroy Ihandle self thMap Ihandle self Ihandle parent thUnmap Thandle self void iu value H H H H H E pee e ome ooaogod dod rc thSetAttribute Ihandle self char attr char char iupmethGetAttribute Ihandle self char attr char iupmethGetDefaultAttr Ihandle self char attr char iupmethGetClassName Ihandle self Functions in charge of manipulating an element s size void iupSetCurrentWidth Ihandle self int w void iupSetCurrentHeight Ihandle self int h int iupGetCurrentWidth Ihandle self int int iupGetC
221. tring gt ret number in IupLua text Represents the new text value This is the same callback definition as for the IupText Notes Text is always left aligned Examples 97 uptist Example T E Best medal i Prizes won l Less than US 1000 x m JupList Example us 1000 R 1000 Drop Edit Drop Char B Char CCCCC Char D Char F List Edit See Also IupListDialog Iuptext TupMultiLine Creates an editable field with one or more lines Parameters Return Thandle IupMultiLine char action in C ijupmultiline gt elem iuplua_tag in IupLua3 iup multiline gt elem iuplua_tag in IupLua5 multiline action in LED action name of the action generated when the user types something This function returns the identifier of the created multiline or NULL if an error occurs Attributes APPEND Inserts a text at the end of the multiline INSERT Inserts a text in the caret s position BORDER Shows a frame around the multiline CARET Position of the insertion point in the multiline READONLY Allows the user only to read the contents without changing it Possible values YES NO default 98 SELECTION Selection interval SELECTEDTEXT Selection s text NC Maximum number of characters SIZE Multiline size Default 5 characters width and 1 character height VALUE Text typed by the user The n c
222. ttribute is only consulted when the element is first mapped IupMap IupShow IupShowXyY or IupPopup After this it cannot be changed Affects IupDialog IupText IupMultiline IupCanvas ICON Dialog s icon Value Name of a IUP image Default NULL Note Icon sizes are usually less than or equal to 32x32 On Windows names of resources RES linked to the application are also accepted On Motif it only works with some window managers like mwm and gnome Icon colors can have the BGCOLOR values but it works better if it is at index 0 The Windows SDK recomends that cursors and icons should be implemented as resources rather than created at run time Affects 177 TupDialog Requests a maximize button from the window manager Value YES or NO Default YES Note This attribute is only consulted when the dialog is first mapped LupMap IupShow IupShowXY or lupPopup After such it cannot be changed On Motif it only works if the active window management system is mwm Affects TupDialog Requests a minimize button from the window manager Value W YES or NO Default YES Note This attribute is only consulted when the dialog is first mapped IupMap IupShow IupShowXY or lupPopup After such it cannot be changed On Motif it only works if the active window management system is mwm Affects
223. ttributes inside a SIZE Defines the width if the Fil1 is inside a horizontal box or the height if it is vertical box Default 0 EXPAND The default value is YES which fills every possible space 114 Note This element is used to maintain the dialog s layout untouched after the user made size changes and to align the interface elements Examples ET oxi Left aligned m Centered a r Right aligned oy See Also TupHbox IupVbox IupHbox Creates an hbox interface element It is a box that shows the elements it contains horizontally and from left to right Parameters Return Thandle IupHbox Ihandle elem1l Ihandle elem2 NULL in C iuphbox eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua3 iup hbox eleml elem2 iuplua_tag gt elem iuplua_tag in IupLua5 hbox elem1 elem2 in LED elem1 elem2 List of identifiers that will be placed in the box NULL defines the end of the list This function returns the identifier of the created hbox Attributes ALIGNMENT Aligns the elements vertically Possible values ATOP ACENTER ABOTTOM Default ATOP GAP Defines a space in pixels between the interface elements MARGIN Defines a margin in pixels SIZE Width of the hbox Default the smallest size that contains the children elements Note 115 The box can be created wi
224. type string gt elem iuplua_tag in IupLua5 val type in LED type Type of valuator Can be VERTICAL or HORIZONTAL The function returns the identifier of the created val or NULL if an error occurs Attributes MIN Contains the minimum valuator value Default is 0 MAX Contains the maximum valuator value Default is 1 VALUE Contains a number between MIN and MAX indicating the valuator position TYPE Informs whether the valuator is VERT CAL or HORI ZONTAL Vertical valuators are bottom to up and horizontal valuators are left to right variations of min to max SHOWTICKS Display tick mark along the valuator trail The attribute controls the number of ticks Minimum value is 3 Default is 0 in this case the ticks are not shown The precision of the ticks are affected by the raster size of the control BGCOLOR Controls the background color The default value is the parent or the dialog background color RASTERSIZE The default is 124x28 or 28x124 We recomend to leave this as the minimum size 135 EXPAND The default is NO The thumb will not expand if the valuator is expanded Callbacks MOUSEMOVE_CB Called each time the user moves the valuator s thumb keeping the mouse button pressed The value of VALUE is passed as parameter int function Ihandle self double val in C elem mousemove val number gt ret number in IupLua3 elem
225. u item is activated and all dialog controls are disabled e Fixed lupFileDlg ignored the x y parameters of IupPopup Motif e Enter in IupMultiline activated the DEFAULTENTER button instead of adding a new line e Fixed invalid memory access when set FONT to NULL e Fixed ACTION callback called for IupList when list contents were cleared IupControls e IupTree and IupTabs did not propagate to the parent the K_ANY callback for non used keys TupMatrix e The TITLEs BGCOLORs FGCOLORs and FONTs attributes were incorrectly set after a DELLIN ADDLIN DELCOL or ADDCOL e In Windows when the user double click a dropdown list now will start opened e The user callback scroll_cb was incorrectly registered e New HIDEFOCUS attribute to hide the focus mark when drawing e Now in MARK MODE CELL and MULTIPLE YES you can click on the title area to mark a full line or collumn at once e New BGCOLOR_CB and FGCOLOR_CB callbacks e Fixed when MARKMODE LIN COL LINCOL if the first cell in the line column is selected the click in the title area was ignored IupLua e Removed print debug calls in internal code e upGetAttribute iup GetAttribute now returns an user data if attribute is a known internal pointer data e New lupGetAttributeData iup GetAttributeData that returns the data always as an used data e Fixed incomplete initialization of image object returned by IupLoadImage Version 2 2 1 25 Aug 2004 General e Fixed some minor bugs intro
226. upF lush after the attribute is changed Important A call to this function may cause other callbacks to be processed before its returns IupHelp Opens the given URL In UNIX executes Netscape passing the desired URL as a parameter In Windows calls the default application that handle URLs In UNIX you can change the used browser setting the environment variable IUP_HELPAPP If set it will replace netscape Parameters Return void IupHelp char url in C IupHelp url string in IupLua3 iup Help url string in IupLua5 url may be any kind of address accepted by the Browser that is it can include http or be just a file name etc IupSetLanguage Defines the language used by IUP Parameters Return void IupSetLanguage char lng in C IupSetLanguage language string in IupLua3 iup SetLanguage language string in IupLua5 Ing Language to be used Can have one of the following values e ENGLISH PORTUGUESE default PORTUGUESE Affects All elements that have predefined texts Example in C include lt stdio h gt include lt stdlib h gt include lt string h gt include iup h void main void ITupOpen TupSetLanguage ENGLISH TupMessage IUP Language IupGetLanguage TupClose return lupGetLanguage Verifies the language used by IUP Parameters Return char IupGetLanguage void in C IupGetLanguage
227. upSubmenu char title Ihandle menu in C iupsubmenu menu iuplua_tag title title string gt elem iuplua_tag in iup submenu menu iuplua_tag title title string gt elem iuplua_tag i submenu title menu in LED title String containing the text to be shown on the item It is a creation only attribute and cannot be changed later menu menu identifier This function returns the identifier of the created submenu or NULL if an error occurs Attributes KEY Associates a key to the submenu In Windows when used will also set an underscore on the respective letter of the submenu title Callbacks OPEN_CB Called just before the submenu is opened MENUCLOSE_CB Called right before the submenu is closed Examples 01x File Edit Help This Copy o compose Paste Create Line Circle Equilateral Isoceles Scalenus See Also upitem IupSeparator IupMenu IupColorBrowser Creates an element for selecting colors from the HLS Hue Saturation Brightness model which allows the user to interactively choose a color 122 For a dialog that simply returns the selected color you can use function IupGetColor Parameters Return Thandle IupColorBrowser void in C iupcb elem iuplua_tag in IupLua3 ilup colorbrowser elem iuplua_tag in IupLua5 colorbrowser in LED The function returns the identifier of the created colorbrowser or NULL
228. urrentHeight Ihandle self iupHorResizable Ihandle self int iupVertResizable Ihandle self void iupSetNa turalWidth Ihandle self int w void iupSetNa turalHeight Ihandle self int h void iupGetCharSize Ihandle n int w int h int iupGetSize Ihandle e int w int h 58 void iupGetTextSize Ihandle h char text int size void iupdrvResizeObjects Ihandle n Example The best example possible can be taken from IUP distribution As an advice please refer to the iupgauge control LED Compiler for C Description The LED compiler lede generates a C module from one or more LED files The C module exports only one function which builds the IUP interface described in the LED files Running this function is equivalent to calling the LupLoad function over the original LED files One advantage of using the compiler is that it allows the application to be independent from LED files during its execution Since the interface description is inside the executable file there is no need to worry about locating the configuration files Another advantage is that lede performs a stricter verification than IUP s internal parser This makes error detection in LED files easier Finally running the function generated by the compiler is faster than reading the corresponding LED file with LupLoad since the p
229. use the TupSetHand1e function on the element to be inserted in the tab ACTIVE Allows or inhibits user interaction with a given tab When the attribute is NO the corresponding tab modifies the text color to show that interaction is inhibited Be careful because a REPAINT may be needed to generate a Tabs repaint REPAINT This attribute immediately generates a Tabs repaint Callbacks TABCHANGE_CB Callback called when the user shifts the active tab The parameters passed are int function Ihandle self Ihandle new_tab Ihandle old_tab in C elem tabchange new_tab old_tab iuplua_tag gt ret number in IupLua elem tabchange_cb new_tab old tab iuplua_tag gt ret number in Iup self Ihandle of the control new_tab Ihandle of the tab selected by the user old_tab Ihandle of the previously selected tab Note The Tabs elements differently from a ZBOX does not need to have associated names Those without a name will receive an automatically generated one Examples m JupTabs TabA TabB _TabC_ TabD Inside Tab C Inside Tab A Button A See Also TupCanvas IupVal 134 Button C Creates the Valuator control It allows creating a regulator similar to TupDial but with well defined limits It inherits from IupCanvas Parameters Return Ihandle IupVal char type in C iupval type string gt elem iuplua_tag in IupLua3 iup val
230. uted more than once for the same dialog In fact it works just like functions IupShow and IupShowkxyY but it inhibits interaction with other dialogs Therefore it does not destroy the dialog s elements when it ends To destroy the elements function IupDestroy must be called See Also TupShowXY IupShow IupHide IupShow Displays an interface element This function has the same effect as setting value IUP_YES to the IUP_VISIBLE attribute of the interface element Parameters Return int IupShow Ihandle element in C TupShow element iuplua_tag gt ret number in IupLua3 iup Show element iuplua_tag gt ret number in IupLua5 or element show gt ret number in IupLua element identifier of the interface element This function returns IUP_NOERROR if the element was displayed Notes An interface element is only visible if the dialog that contains it is also visible This function can be executed more than once for the same dialog This will make the dialog be placed above all other dialogs in the application See Also 70 TupShowXyY IupHide IupPopup IupShowX Y Displays a dialog in a given position on the screen Parameters Return int IupShowXY Ihandle element int x int y in C IupShowXY element iuplua_tag x y number gt ret number in IupLua3 iup ShowXY element iuplua_tag x y number gt ret number in IupLua5 or
231. vas needs to be redrawn 89 This function returns the identifier of the created canvas or NULL if an error occurs Attributes BGCOLOR Background color In Windows the default value is TRANSPARENT which does not means that the canvas is transparent but it means that the aplication will draw its contents This will avoid unnecessary redraws of the canvas For better results use also the attribute CLIPCHILDREN YES in the dialog CURSOR Canvas cursor SIZE Size of the canvas Default size of one character SCROLLBAR Associates a horizontal and or vertical scrollbar to the canvas DX Size of the thumb in the horizontal scrollbar DY Size of the thumb in the vertical scrollbar POSxX Position of the thumb in the horizontal scrollbar POSY Position of the thumb in the vertical scrollbar XMAX Maximum value of the horizontal scrollbar XMIN Minimum value of the horizontal scrollbar YMIN Minimum value of the vertical scrollbar YMAX Maximum value of the vertical scrollbar BORDER Shows a border around the canvas It can only be changed before the element is mapped This attribute does not work on Motif EXPAND The default value is YES filling every possible space CONID Identifier of the canvas for GKS puc DRAWSIZE The size of the drawing area in pixels In Motif this is identical to RASTERSIZE In Windows it is obtained from the canvas client area since it
232. via accelerator e Attribute IUP_SELECTION was implemented Motif Driver e Color management for 8bpp displays 256 colors was re implemented Basic colors used by IUP black white and the grays used for highlight and shadow are now reserved and the search for colors in the palette was optimized e Elements such as IupCanvas now have their own visual independent from their parent s If allowed by the display the default visual of a canvas will be TrueColor 24bpp if not it will be the same as the default display visual e The LupToggle element now processes the IMAGE attribute differently it now shows the toggle with the same appearance as the I upButton element but maintaining its functionality the button remains pressed until the user clicks it again The IMPRESS attribute can be used to define the image used for the pressed button In this case the user is in charge of giving it a 3D appearance e IMPORTANT The size of the dialog can be adjusted after being mapped by means of the 27 SIZE and RASTERSIZE attributes The size of the dialog has now precedence over the smallest size required by its children either having been specified in its creation or in run time Attributing a NULL value to the SIZE or RASTERSIZE in C of a dialog will re compute its size according to the size of its children Partial dimensions x and x are now treated corre
233. w shows line number and cursor column Version 1 8 6 21 Jun 2000 e All libraries were generated for AIX 4 3 2 which is available in new IBM machines e A series of memory management problems was solved for all platforms e Attribute UP_SELECTEDTEXT now can also be used to change the selected text in a TupText and IupMultiline field The ITupLabel element now takes the IUP_ALIGNMENT attribute into account The IupList dropdown element now always leaves some option selected unless there is none to select When the selected elements value in IupList dropdown is changed it now remains selected with the new value User Manual The user manual is now also available in several Windows Help formats including the help format for Visual C 5 and 6 To configure your account for Visual C to access I UP s Help run W iup help iuphelp reg ATTENTION On Visual Studio IUP s manual must be activated and deactivated through option Help gt Use extension Help Other available formats can be found at W iup Help A general revision of the user manual is being made The CPI manual was rewritten Several examples were included An application called iupluatest W iup bin was created to run the IupLua examples included in the manual it works with the controls using the installed DLLs Windows Driver There is no longer any restriction for the number of dialogs created usi
234. xample 2 Hierarchy Branches can contain other branches or leaves The tree always has at least one branch the root which will be the parent of all the first level branches and leaves Structure The IupTree is stored as a list so that each node or branch has an associated identification number id starting by the root with id 0 However this number does not always correspond to the same node as the tree is modified For example a node with id 2 will always refer to the third node in the tree For that reason there is also userid which allows identifying a specific node The userid always refers to the same node just as the associated text The userid may contain a user created structure allowing the identification of a node Each node also contains its depth level starting by the root which has depth 0 To allow inserting nodes in any position sometimes the depth of a node must be explicitly changed For instance if you create a leaf in a child branch of the root it will be created with depth 2 To make it become a child of the root its depth must be set to 1 Images IupTree has three types of images one associated to the leaf one to the collapsed branch and the other to the expanded branch Each image can be changed both globally and individually The predefined images used in ITupTree can be obtained by means of function ITupGetHandle The names of the predefined images are IMGLEAF IMGCOLLAPSED IMGEXPANDED
235. xibility the IUP specification is simpler though a little larger In fact creating a dialog on IUP with several elements will force you to plan your dialog more carefully on the other hand this will actually make its implementation easier Moreover this IUP dialog has an indirect advantage if the user changes its size the elements due to being positioned on an abstract layout are automatically re positioned horizontally because of the Lup ill elements dialogo iupdialog iuphbox dialogo DIALOG 0 0 108 34 STYLE WS_MINIMIZEBOX WS_MAXIMIZEBOX WS_CAPTION WS_SYSMENU WS_THICKFRAME iupfill i iupbutton title 0k size 40 APTION Titulo G 9 ee i1upbutton title Cancel size BEGIN iupfill PUSHBUTTON Ok IDOK 16 9 33 15 ymargin 15x15 gap 10 PUSHBUTTON Cancel IDCANCEL 57 9 33 15 END F title Titulo Titulo MEE TITLE Titulo IupSetAttributes IupHbox MARGIN 15x15 GAP 10 TupFill I A j IupB N E 40 Ok do_nothing upset ttributes up utton o E 40 Cancel do_nothing TupSetAttributes IupButton C i D r IupFill NULL MARGIN 15x15 GAP 10 TITLE Titulo 37 Following the abstract layout of this dialog Element Hierarchy Layout Visualization The composition elements are vertical
236. xt box use int in C r real shows a real filtered text box use float in C a angle in degrees shows a real filtered text box and a dial use float in C s string shows a text box use char in C it must have room enough for your string m multiline string shows a multiline text box use char in C it must have room enough for your string 1 list shows a dropdown list box use int in C for the zero based item index selected t separator shows a horizontal line separator label in this case text can be an empty string extra is one or more additional options for type t min max are optional limits for integer and real types The maximum value can be omited When both are specified a valuator will also be added to change the value false true are optional strings for boolean types The strings can not have commas nor brackets or mask is an optional mask for the string and multiline types The dialog uses the lupMask internally In this case we do no use the brackets and to avoid confusion with the specified mask itemO iteml item2 are the items of the list At least one item must exist Again the brackets are not used to increase the possibilities for 129 the strings instead you must use Items index are zero based start The dialog is resizable if it contains a string a multiline string or a number with a valuator All the multiline strings will incre
237. y allocation by IupSetAttribute see TupGetAttribute s notes section Example 1 Defines a radio s initial value In C Thandle portrait IupToggle Portrait acao_portrait Thandle landscape IupToggle landscape acao_landscape Thandle box IupVbox portrait IupFill landscape NULL Thandle modo IupRadio box TupSetHandle landscape landscape associates a name to initialize the IupSetAttribute modo VALUE landscape defines the radio s initial v Example 2 Some usages In C dig TupSetAttribute texto VALUE Ol1a Zi IupSetAttribute indicador VALUE ON 3 struct int x int y myData TupSetAttribute texto myData char amp myData See Also upGetAttribute IupSetAttributes IupGetAttributes upStoreAttribute 80 IupSetfAttribute Defines an attribute for an interface element Parameters Return void IupSetfAttribute Ihandle element char a char f in C There is no equivalent in Lua element identifier of the interface element a name of the attribute f format that describes the attribute It follows the same standard as the printf function in C values of the attribute Note This function is very useful because we usually have integer values and want to pass them to IUP attributes but this is done by means of a string This way we can commonly use sprintf to compose that string
238. y be set Ex IMAGEEXPANDED3 IUP name of the image see IupImage Default NULL Nodes NAME Changes or retrieves the name of the selected node Using the NAMEid form where id is the node identifier it is possible to change the name of any node The value must be a node name STATE Changes or retrieves the state of the selected branch Using the STATEid form where id is the node identifier it is possible to change the state of any branch This attribute only works on branches If it is used on a leaf nothing will happen Possible values EXPANDED Expanded branch state shows its children COLLAPSED Collapsed branch state hides its children 156 DEPTH If set it defines the node s depth Does not verify is the resulting tree is valid If retrieved it returns the node s depth Using the DEPTHid form where id is the node identifier it is possible to refer to any node The value must be the node s depth KIND Returns the kind of the selected node Using the KINDid form where id is the node identifier it is possible to retrieve the kind of any node This attribute can only be retrieved Possible values LEAF The node is a leaf BRANCH The node is a branch PARENT Returns the identifier of the selected node s parent Using the PARENTid form where id is the node identifier it is possible to retrieve the identifier of any node This attribute can only be retrieved COLOR C
239. y generated to work with iup d IUPSTUB lib libraries for technical reasons these libraries cannot be unified Note 11 and is usually distributed in the same directory as iup d11 the IUP DLL depends on the MSVCRT DLL that it is already installed in Windows For the program to work IUP d11 must be inside a PATH directo program does not need to be relinked when the DLL is updated Debug Versions While using the debug version two types of fatal errors can occur 1 Protection errors Unhandled exception access violation 2 Assertive errors Assertion failed ry Usually the In the second type a dialog is shown with buttons Abort Retry and Ignore as well as a number of information among which Name of the font file where the error occurred Line number The bug correction process if it exists becomes a lot faster when this information is provided Therefore if you receive such error please send this information along in the e mail Tips InitCommoncCtrl e On Windows a common error occurs Cannot find function 1 This error occurs if you forgot to add the comct 132 1156 library to be linked with the program This library is not usually in the libraries li you must add it st for the Visual C
240. ystem language WIN_DEFAULTFONT global Stores the name of the default font used in the interface controls SHIFTKEY global Returns the state of the Shit keys left and right Possible values ON or OFF CONTROLKEY global Returns the state of the Control keys left and right Possible values ON or OFF WINFONT all This attribute is still used to maintain compatibility with previous versions Use attribute FONT This attribute s value must be a string with the following format name attributes size name The name the user will see Times New Roman MS Sans Serif etc attributes Can be empty or a list separated by commas with the following names BOLD ITALIC UNDERLINE STRIKEOUT 211 size Size in pixels Examples Times New Roman 10 Ms Sans Serif ITALIC 20 Courier New BOLD STRIKEOUT 15 Differentiated Attributes ICON DIALOG This attribute s value must be a string with the name of a Iup image or an icon in a Windows resource file linked to the application This icon will be used when the dialog is minimized If a Iup image with a name associated to this attribute exists it will be used to define the dialog s icon The Iup images used as icons must necessarily have 32x32 points If there is no Iup image whose name was passed to the attribute Iup will look for a native icon Windows linked to the program This attribute r
241. ze of the element in units proportional to the size of a character Value widthxheight where width and height are integer values corresponding to the horizontal and vertical size respectively in characters The element may have only one dimension which is applicable to be modified for instance IupText which has only width In this case the second parameter is ignored and does not need to be passed You can also change only one of the parameters by removing the other one and maintaining x For example x40 height only or 40x width only The other size will be chosen by IUP depending on the composition elements and on the EXPAND attribute Default Depends on the element and on the element s EXPAND attribute Notes The size observes the following heuristics e Width in 1 4 s of the average width of a character e Height in 1 8 s of the average height of a character When this attribute is changed the RASTERSIZE attribute is automatically updated 167 When this attribute is changed by means of a call to function lupSetAttribute or IupStoreAttribute the size will be the minimum size for the element If you wish to use this size only as an initial size change this attribute to NULL after viewing the dialog Affects All See Also EXPAND RASTERSIZE WID Element identifier in the native interface system Value Depends on the platform Note Verification only attribute Affect

Download Pdf Manuals

image

Related Search

Related Contents

Description du produit Matériau dentaire Pl tre Tewestone blanc  ISTRUZIONI PER L`USO  HP 5991-5565 User's Manual  phosphat stop - Aquatic Nature  User`s Manual Pocket Camera  Fundamentos de Inteligencia Artificial    名称未設定-15  Istruzioni per l'uso  Philips PAC017 Move pack  

Copyright © All rights reserved.
Failed to retrieve file