Change Site language
eXperimental Guicobol
Amministrazione trasparente
| eXperimental Guicobol |
|
|
|
To take a copy of the opensource Guicobol To share our Italian OpenCOBOL Group or for italian manuals..
Introduction Gui objects are simply declared in working storage section with the cobol object reference usage picture. Some objects are pre-defined from the gtkcobol tool itself. Last version 0.1.4 29 January 2012 colour release legend: // available with...0.1.1 version - // available with... 0.1.2 version // available with... 0.1.3 version // available with... 0.1.4 version
000010 IDENTIFICATION DIVISION. Every pre-defined objects are stored into a system copy named global.cpy * * 78 GDK_X_CURSOR VALUE 0.
78 GDK_NOTHING VALUE -1. It uses the object oriented syntax and the cobol logic to manage it. Then the programmer can use the move to get and set the properties value and the invoke verbs to perform the methods available for them.
List of principal class objects available
Form, Text, Label, Combo, Frame, Check, Radio, Buttons. Every class's objects must be created at runtime. Once created them you can manage the properties that can have a default value assigned from the constructor (invoked method to create them). Events can be cached by using the appropriate cobol procedure you want to execute for. every cobol procedure can have a linkage due to pass the widget and the data (see key property for an example at text field) e.g.: Linkage section. procedure division using by value gtk-window by value gtk-data. Form The form class has the pre-defined GTK-FORM that is created to build a window. It is declared into the global.cpy copy and you can also reference it with the SELF word.
List of methods of the form openform The openform is the first you have to run to create the pre-defined gtk-form invoke gtk-form "openform" createform // 0.1.2 version The createform is the first you have to run to create the pre-defined gtk-form invoke self "createform" it's is like the openform only just map the closeform automatically when the "X" is clicked on the form
showform The showform is allows you to view the form and all its objects (widgets) invoke gtk-form "showform" runform The runform starts the event loop invoke gtk-form "runform" closeform destroy the window associated to gtk-form invoke gtk-form "closeform" stoprun stop the event loop invoke gtk-form "stoprun" createframe create a frame <object> with the specified title at x y given coordinates invoke self "createframe" using <object> "frame title" line <x-coordinate> position <y-coordinate> once the frame is created you can set/get the property and manage the event for the <object> made
createbutton create a button <object> with the specified title at x y given coordinates invoke self "createbutton" using <object> "End" line <x-coordinate> position <y-coordinate> createtext create an edit text field <object> with the specified title at x y given coordinates invoke self "createtext" using <object> line <x-coordinate> position <y-coordinate> createlabel create a static lable <object> with the specified title at x y given coordinates invoke self "createbutton" using <object> "First name" line <x-coordinate> position <y-coordinate> createcheck create a check field <object> with the specified title at x y given coordinates invoke self "createcheck" using <object> "Turn on/off" line <x-coordinate> position <y-coordinate> createcombo create a combo list field <object> with the specified title at x y given coordinates invoke self "createcombo" using <object> line <x-coordinate> position <y-coordinate> createradio create a radio field <object> with the specified title at x y given coordinates invoke self "createradio" using <object> "First Option" line <x-coordinate> position <y-coordinate>
message create an information modal message dialog waiting for the user ok confirm // 0.1.1 version invoke self "message" using "hello world"
warning create a warning modal message dialog waiting for the user ok confirm // 0.1.1 version invoke self "warning" using "take the umbrella ... the weather is going to rain !" severe create a severe modal message dialog waiting for the user ok confirm // 0.1.1 version invoke self "severe" using " You didn't download the Experimental Guicobol... :-("
get-question create a question modal message with yes/no buttons and returns gtk-true (yes) or gtk-false (no) // available with... 0.1.3 version invoke self "get-question" using " didn't you download the Experimental Guicobol ?" returning gtk-int if gtk-int = gtk-true .....
get-message get-warning get-severe....// available with... 0.1.3 version The same features with the appropriate dialog
get-pointer The get-pointer allows you to get the mouse coordinates // 0.1.2 version invoke gtk-form "get-pointer" using gtk-x gtky
loadgui load the gui schema from a xml (glade file) invoke pow-self "loadgui" using "form.xml" returning gtk-builder // available with... 0.1.4 version
List of events of the Forms
closed performed when the windows is closed invoke gtk-form "closed" using <cobolprocedure> e.g. 000920 invoke gtk-form "Closed" using "exitForm" exit program. 001120 identification division.
List of properties of the Form
title Get or set the tittle of the gtk-form with pic x(n) picture move "this is the title" of "title" of gtk-form 77 title-field pic x(100) .....move "title" of gtk-form to title-field modal Get or set the windows modal status with boolean (GTK-TRUE GTK-FALSE) move GTK-TRUE to "modal" of gtk-form IF "modal" of gtk-form = gtk-true .......
cursor Get or set the windows cursor for mouse // available with... 0.1.3 version move 2 to "cursor" of gtk-form IF "cursor" of gtk-form = 1.... global.cpy contains cursor type items
Text edit The text field is created by using the "createtext" invoke method, atfer you can manage it with specific and global properties inheredis from form
List of properties of the Text edit
text Get or set the text inside the edit field with pic x(n) picture 77 your-country usage object reference. procedure division. invoke mk-form "createtext" using your-contry line 10 position 20 move "Italy" to "text" of your-country or a get method... 77 edit-value pic x(20). move "text" of edit to edi-value.
max Get or set the max number of charactes accepted inside the edit field // 0.1.2 version move 10 to "max" of edit
if "max" of edit = 10 invoke self "warning" using " this field accept al least 0 to 10 characters !" key Get the pressed key (look ahead the pressed cobol procedure) from the gtk-data linkage object
List of the events of Text edit
gotfocus performed when the object got the keyboard focus invoke edit "gotfocus" using <cobolprocedure> // 0.1.1 version lostfocus performed when the object lost the keyboard focus invoke edit "lostfocus" using <cobolprocedure> // 0.1.1 version keypress performed when the user press a key during the focus of the object invoke edit "keypress" using <cobolprocedure> // 0.1.1 version keyrelease performed when the user release the pressed key during the focus of the object invoke edit "keyrelease" using <cobolprocedure> // 0.1.1 version keypress example cobolprocedure // 0.1.1 version 002120 identification division. or also during an if statement...
Check button The check button field is created by using the "createcheck" invoke method, atfer you can manage it with specific and global properties inheredis from form
List of properties of the check
value Get or set the boolean value of the check field move gtk-true to "value" of check IF "value" of check = gtk-on
List of the events of check clicked performed when a click is performed invoke check "clicked" using <cobolprocedure>
gotfocus performed when the object got the keyboard focus invoke edit "gotfocus" using <cobolprocedure> // 0.1.1 version lostfocus performed when the object lost the keyboard focus invoke edit "lostfocus" using <cobolprocedure> // 0.1.1 version
Radio field The radio field is created by using the "createradio" invoke method, atfer you can manage it with specific and global properties inheredis from form.
List of methods of the radio
addradio add a radio field <object> to the <radio> with the specified title at x y given coordinates invoke <radio> "addradio" using <object> "second Option" line <x-coordinate> position <y-coordinate>
List of properties of the radio value Get or set the boolean value of the radio field move gtk-true to "value" of radio IF "value" of radio = gtk-true .......(or gtk-on ...)
List of the events of radio clicked performed when a click is performed invoke radio "clicked" using <cobolprocedure>
gotfocus performed when the object got the keyboard focus invoke edit "gotfocus" using <cobolprocedure> // 0.1.1 version lostfocus performed when the object lost the keyboard focus invoke edit "lostfocus" using <cobolprocedure> // 0.1.1 version
label The label contains the text you want to show like a stati, the -1 height value specified that the value is changed to the automatic value.
List of properties of the label caption Get or set the caption of the label object move "hello" to "caption" of label1 IF "caption" of label1 = "hello"
justify Get or set the justify property of the label object // available with... 0.1.3 version
move IF "justify" of label1 =
frame properties methods and events NOT YET implemented
Combo The combo field is created by using the "createcombo" invoke method, atfer you can manage it with specific and global properties inheredis from form
List of methods of the combo field
addstring add an element to the combo field <object> to coordinates invoke combo "addstring" using "first element" invoke combo "addstring" using "second element" invoke combo "addstring" using "third element"
List of properties of the combo
selstring Get the selected item of the combo move "selstring" of combo to stringa IF "selstring" of combo = "third element".....
Selindex Get/Set the selected active index of the combo // available with... 0.1.3 version move "selindex" of combo to index IF "selindex" of combo = zeros invoke warning using "chose an item..."
move 1 to "selindex" of combo List of the events of radio button changed performed when changed item is performed at the combo list invoke combo "changed" using <cobolprocedure> Global method Form, Text, Label, Combo, Frame, Check, Radio, Buttons.
setsize Assign the <width> and <heigth> size to the invoked <object> invoke <anyobject> "setsize" using <width> <heigth> e.g. invoke gtk-form "setsize" using 800 600 show Shown the invoked <object> usually for a refresh invoke <anyobject> "show" moveto move to object to the specified x y coordinates invoke <anyobject> "moveto" using x y. ("using" was added with //0.1.2 version to use the same syntax of other statements
finalize Delete the invoked <object> invoke <anyobject> "finalize"
setfocus Set the object to grab the focus // 0.1.1 version invoke <anyobject> "setfocus"
Global properties for Form, Text, Label, Combo, Frame, Check, Radio, Buttons.
width Get or set the width of the object with pic s9(5) comp-5 picture move 800 to "width" of gtk-form 77 width-value pic s9(5) comp-5. move "width" of gtk-form to width-value height Get or set the height of the gtk-form or object with pic s9(5) comp-5 picture move 600 to "height" of gtk-form 77 height-value pic s9(5) comp-5. move "height" of gtk-form to height-value
forecolor Set the foreground color of the object move "red" to "forecolor"of label
backcolor Set the background color of the object move "blue" to "backcolor"of label move "123,333,232" to "backcolor" of label forecolor-text Set the foreground color of the text object // 0.1.1 version move "red" to "forecolor-text " of edit
backcolor-text Set the background color of the text object // 0.1.1 version move "blue" to "backcolor-text" of edit name Set or get the name for the object // 0.1.1 version move "surname" to "name" of edit1
parent Get the parent of the invoked object // 0.1.1 version move "parent" of edit to parent
tooltip Set or get the tooltip text for the object // 0.1.1 version move "enter the surname" to "tooltip" of edit1
visible Get or set the boolean value of the visibility for the object // 0.1.1 version move gtk-true to "visible" of radio IF "visible" of radio = gtk-true .......(or gtk-on ...)
font set the font value for the object // 0.1.1 version
move "arial italic 18" to "font" of static1 move "arial bold 10" to "font" of static2
enabled Get or set the boolean value of the sensitive for the object // 0.1.2 version move gtk-true to "enabled" of radio IF "enabled" of radio = gtk-true .......(or gtk-on ...) Global events for Form, Text, Label, Combo, Frame, Check, Radio, Buttons. buttonpressed get the mouse button pressed // 0.1.2 version invoke <anyobject> "buttonpressed" using cobolprocedure buttonreleased get the mouse button released // 0.1.2 version invoke <anyobject> "buttonreleased" using cobolprocedure a cobol procedure could be... 001000 invoke edit "buttonpress" using "mousepressed". 002120 identification division. if "button" of gtk-data = ....(see next lines) mouse click available evaluations:// 0.1.2 version if "button" of gtk-data = GTK-LEFT-CLICK DISPLAY "LEFT CLICK".
mousepressed get the mouse button pressed // available with... 0.1.3 version invoke <anyobject> "mousepressed" using cobolprocedure mousereleased get the mouse button released // available with... 0.1.3 version invoke <anyobject> "mousereleased" using cobolprocedure a cobol procedure could be... PS. these signals are the same of buttonpressed and buttonreleased.. just to remember better than you can get from the mouse you can use the same features with this new invoked names.
Click here to view the latest video Click here to view the latest pdf example source file (31 October 2011) Builder // available with... 0.1.4 version The builder object is creatae by using the "loadGui" method, List of methods of the builder object getobject get the object by searching it's name into the xml obecjt // available with... 0.1.4 version invoke gtk-builder "getobject" using "main-window" returning window move "new title" to "title" of window
Index Introduction List of principal class objects available Form List of methods ... List of events List of properties Text List of properties List of events Check List of property List of events
Radio List of methods ... List of events List of properties Label List of properties frame
Combo List of methods ... List of properties List of events Global events for Form, Text, Label, Combo, Frame, Check, Radio, Buttons. Builder List of methods Using the animator for guicobol To run the guicobol inside the animator you have to build a batch process with these lines: guicobol %1.cbl
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Ultimo aggiornamento Sabato 20 Ottobre 2012 06:58 |
Opensource GuiCobol













































































Commenti
Thank you for what you did.
Can we expect you to work on Linux.
Zoran.
I copied guitest.cbl to guiges.cob and I do my testing on it.
How do I send my comments?
First thing: the accents. eg é, à, è ...
move "fédérico and rené" to "title" then the display is not ok ...
this look very nice. I've created something for Web Developement. It still under construction, but you can check the beta at http://www.oocobol.net/PowerWebCobolSample01/index.html)
Regards, Emerson
Yo he tratado de hacer algo similar en AcuCobol para facilitar menus y pantallas y programación
Yo soy de colombia, Cobolero, y trabajo similares proyectos, gestion documental, Salud, Educación, Finanzas
No se idioma italiano, perdon por escribir en Español.
Muchas felicidades por ese proyecto OpenCobol.
Gracias por la invitación.
Carlos Eduardo Suárez
esuarezgo
RSS feed dei commenti di questo post.