Home GuiCOBOL 003 Dichiarazione degli oggetti

003 Dichiarazione degli oggetti PDF Stampa E-mail
I tools opensource di OpenCOBOL
Scritto da Administrator   
Mercoledì 11 Ottobre 2006 09:19

Gli oggetti vengono definiti tramite utilizzo dell'USAGE POINTER con l'attributo EXTERNAL  in quanto le variabili puntatore saranno poi disponibili a tutte le procedure assegnate agli eventi.

 

000010  IDENTIFICATION DIVISION.
000020  PROGRAM-ID.    guitest.
000030  ENVIRONMENT DIVISION.
000040  DATA DIVISION.
000050  WORKING-STORAGE SECTION.
000060
000070  01 check             usage pointer external.
000080  01 parent            usage pointer.
000090  01 radio             usage pointer external.
000090  01 radio1            usage pointer external.
000090  01 radio2            usage pointer external.
000090  01 button            usage pointer external.
000100  01 button1           usage pointer external.
000110  01 button2           usage pointer external.
000120  01 edit              usage pointer external.
000130  01 edit1             usage pointer external.
000140  01 edit2             usage pointer external.
000150  01 label1            usage pointer external.
000160  01 label2            usage pointer external.
000170  01 label3            usage pointer external.
000180  01 label4            usage pointer external.
000190  01 label5            usage pointer external.
000200  01 label6            usage pointer external.
000200  01 combo             usage pointer external.
000200  01 frame             usage pointer external.

Le variabili dati di "sistema" sono dichiarate nelal copy global.cpy che dovrà essere sempre inclusa nel codice di ciascuna procedura cobol

*
** GuiCobol private objects
*
01 gtk-main          usage pointer       external.
01 gtk-previous      usage pointer       external.
01 gtk-form          usage pointer       external.
01 gtk-panel         usage pointer       external.
01 gtk-parent        usage pointer       external.
01 gtk-group         usage pointer       external.
01 gtk-object        usage pointer       external.
01 gtk-menu          usage pointer       external.
01 gtk-struct        usage pointer       external.
01 gtk-function      pic x(100)          external.
01 gtk-text          pic x(512)          external.
01 gtk-string        pic x(512)          external.
01 gtk-event         pic x(100)          external.
01 gtk-number        pic s9(12)v9(6)     external.
01 gtk-key-code      usage binary-long   external.
01 gtk-key-char      pic x               external.
01 gtk-button-code   pic s9(5) comp-5    external.

78 GTK-LEFT-CLICK         VALUE 1.
78 GTK-LEFT-DOUBLECLICK   VALUE 2.
78 GTK-LEFT-TRIPLECLICK   VALUE 3.
78 GTK-MIDLE-CLICK        VALUE 4.
78 GTK-MIDLE-DOUBLECLICK  VALUE 5.
78 GTK-MIDLE-TRIPLECLICK  VALUE 6.
78 GTK-RIGHT-CLICK        VALUE 7.
78 GTK-RIGHT-DOUBLECLICK  VALUE 8.
78 GTK-RIGHT-TRIPLECLICK  VALUE 9.


01 gtk-style         usage binary-long    external.
01 gtk-int           usage binary-long    external.
01 gtk-boolean       pic s9(5) comp-5     external.
01 gtk-x             usage binary-long    external.
01 gtk-y             usage binary-long    external.
01 gtk-width         usage binary-long    external.
01 gtk-height        usage binary-long    external.
01 gtk-use-width     usage binary-long    external.
01 gtk-use-height    usage binary-long    external.
01 gtk-red           usage unsigned-short external.
01 gtk-green         usage unsigned-short external.
01 gtk-blue          usage unsigned-short external.
01 gtk-callback  usage procedure-pointer external.


01 params            usage pointer.
01 result            usage binary-long   external.
01 gtk-started       pic 9               external.
01 gtk-cobol         pic x(8)            value "gtkcobol".
01 gtk-buffer        pic x(512)          value space.


78 gtk-true          value 1.
78 gtk-false         value zeros.
78 gtk-on            value 1.
78 gtk-off           value zeros.
78 gtk-default-height value -1.
78 gtk-default-width value 25.

*
** contants cursors
*

78 GDK_X_CURSOR               VALUE 0.
78 GDK_ARROW                  VALUE 2.
78 GDK_BASED_ARROW_DOWN       VALUE 4.
78 GDK_BASED_ARROW_UP         VALUE 6.
78 GDK_BOAT                   VALUE 8.
78 GDK_BOGOSITY               VALUE 10.
78 GDK_BOTTOM_LEFT_CORNER     VALUE 12.
78 GDK_BOTTOM_RIGHT_CORNER    VALUE 14.
78 GDK_BOTTOM_SIDE            VALUE 16.
78 GDK_BOTTOM_TEE             VALUE 18.
78 GDK_BOX_SPIRAL             VALUE 20.
78 GDK_CENTER_PTR             VALUE 22.
78 GDK_CIRCLE                 VALUE 24.
78 GDK_CLOCK                  VALUE 26.
78 GDK_COFFEE_MUG             VALUE 28.
78 GDK_CROSS                  VALUE 30.
78 GDK_CROSS_REVERSE          VALUE 32.
78 GDK_CROSSHAIR              VALUE 34.
78 GDK_DIAMOND_CROSS          VALUE 36.
78 GDK_DOT                    VALUE 38.
78 GDK_DOTBOX                 VALUE 40.
78 GDK_DOUBLE_ARROW           VALUE 42.
78 GDK_DRAFT_LARGE            VALUE 44.
78 GDK_DRAFT_SMALL            VALUE 46.
78 GDK_DRAPED_BOX             VALUE 48.
78 GDK_EXCHANGE               VALUE 50.
78 GDK_FLEUR                  VALUE 52.
78 GDK_GOBBLER                VALUE 54.
78 GDK_GUMBY                  VALUE 56.
78 GDK_HAND1                  VALUE 58.
78 GDK_HAND2                  VALUE 60.
78 GDK_HEART                  VALUE 62.
78 GDK_ICON                   VALUE 64.

*
** contants events
*

78 GDK_NOTHING                VALUE -1.
78 GDK_DELETE                 VALUE  0.
78 GDK_DESTROY                VALUE  1.
78 GDK_EXPOSE                 VALUE  2.
78 GDK_MOTION_NOTIFY          VALUE  3.
78 GDK_BUTTON_PRESS           VALUE  4.
78 GDK_2BUTTON_PRESS          VALUE  5.
78 GDK_3BUTTON_PRESS          VALUE  6.
78 GDK_BUTTON_RELEASE         VALUE  7.
78 GDK_KEY_PRESS              VALUE  8.
78 GDK_KEY_RELEASE            VALUE  9.
78 GDK_ENTER_NOTIFY           VALUE 10.
78 GDK_LEAVE_NOTIFY           VALUE 11.
78 GDK_FOCUS_CHANGE           VALUE 12.
78 GDK_CONFIGURE              VALUE 13.
78 GDK_MAP                    VALUE 14.
78 GDK_UNMAP                  VALUE 15.
78 GDK_PROPERTY_NOTIFY        VALUE 16.
78 GDK_SELECTION_CLEAR        VALUE 17.
78 GDK_SELECTION_REQUEST      VALUE 18.
78 GDK_SELECTION_NOTIFY       VALUE 19.
78 GDK_PROXIMITY_IN           VALUE 20.
78 GDK_PROXIMITY_OUT          VALUE 21.
78 GDK_DRAG_ENTER             VALUE 22.
78 GDK_DRAG_LEAVE             VALUE 23.
78 GDK_DRAG_MOTION            VALUE 24.
78 GDK_DRAG_STATUS            VALUE 25.
78 GDK_DROP_START             VALUE 26.
78 GDK_DROP_FINISHED          VALUE 27.
78 GDK_CLIENT_EVENT           VALUE 28.
78 GDK_VISIBILITY_NOTIFY      VALUE 29.
78 GDK_SCROLL                 VALUE 31.
78 GDK_WINDOW_STATE           VALUE 32.
78 GDK_SETTING                VALUE 33.
78 GDK_OWNER_CHANGE           VALUE 34.
78 GDK_GRAB_BROKEN            VALUE 35.
78 GDK_DAMAGE                 VALUE 36.

Ultimo aggiornamento Domenica 26 Febbraio 2012 07:48
 

Aggiungi commento


Codice di sicurezza
Aggiorna

Accessi dal mondo