[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Question v11.7 Open Edge UI possibilities (automatic generated)

Status
Not open for further replies.
C

cjbree

Guest
filename: Browse_19.i /* browse.i -- generic browse include file {browse.i &file= /* file name met database naam*/ &lform= /* listing form include filename (no SKIP/SPACE) */ &uform= /* update form include filename (no SKIP/SPACE) */ &sfld= /* field to scan over */ /* optional parameters &where= /* of xxx where yyy > 35 ... */ &tlform= /* listing form include filename (SKIP/SPACE ok) */ &tuform= /* update form include filename (SKIP/SPACE ok) */ &postfind= /* processing following successful find include filename */ &release= /* release processing include filename */ &nodef= /* pass a comment start (/ *) to avoid redundant definitions */ &seq= /* id to distinguish names if multiple browse */ &panel= /* other control panel options */ &other= /* handling for other control panel options */ &create= /* post create processing include filename */ &update= /* post update processing include filename */ &delete= /* pre delete processing include filename */ &numfiles= /* number of related files in jfiles list */ &jfiles= /* list of related files " , ,..." */ &startup= /* startup processing after defines */ all optional include filenames require trailing blank (&xxx="x.i ") */ } */ define variable rid{&seq} as recid extent 50 no-undo. {&nodef} /* nodef starts a comment if defines are already done */ def new global shared variable pick-recid as recid no-undo. def new global shared variable join-recid as recid no-undo. def var command as character no-undo. def var j as integer no-undo. def var k as integer no-undo. def var crecid as recid initial ? no-undo. def var verify as logical no-undo. DEFINE VARIABLE mywin AS WIDGET-HANDLE. /{&nodef}* end of conditional defines */ form {{&tuform}{&*}} with frame uform{&seq} scrollable 1 columns side-labels overlay top-only view-as dialog-box color bright-blue. {{&startup}{&*}} DEFINE QUERY quer1 FOR {&file} SCROLLING. DEF buffer b_{&file} FOR {&file}. DEFINE VARIABLE exit-item-ptr AS WIDGET-HANDLE. DEFINE VARIABLE relate-menu-ptr AS WIDGET-HANDLE. DEFINE VARIABLE main-bar-ptr AS WIDGET-HANDLE. DEFINE VARIABLE temp-hand-ptr AS WIDGET-HANDLE. DEFINE VARIABLE choose-menu-ptr AS WIDGET-HANDLE. DEFINE VARIABLE oldmenu AS WIDGET-HANDLE. DEFINE var rec_id AS RECID. DEFINE var new_recid AS RECID init ?. DEFINE var old_recid AS RECID init ?. oldmenu=CURRENT-WINDOW:MENUBAR. /* Create the main menu bar. */ CREATE MENU main-bar-ptr. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Search" SENSITIVE = TRUE TRIGGERS: ON CHOOSE RUN cp-search. END TRIGGERS. CREATE SUB-MENU choose-menu-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Option" SENSITIVE = TRUE. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Add" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-create. END TRIGGERS. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Update" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-Update. END TRIGGERS. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Copy-New" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-Copy-new. END TRIGGERS. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Kopy-Org" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-Copy-org. END TRIGGERS. CREATE SUB-MENU relate-menu-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Relate" SENSITIVE = TRUE. /* CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Put" SENSITIVE = TRUE. */ CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&List" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-List. END TRIGGERS. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Help" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-Help. END TRIGGERS. CREATE MENU-ITEM temp-hand-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Delete" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-delete. END TRIGGERS. CREATE MENU-ITEM exit-item-ptr ASSIGN PARENT = main-bar-ptr LABEL = "&Exit" SENSITIVE = TRUE TRIGGERS: ON CHOOSE run cp-exit. END TRIGGERS. /* build the relate menu */ /* create window mywin. CURRENT-WINDOW:VISIBLE=FALSE. CURRENT-WINDOW=mywin. */ /* aantal rows & columns */ /* let op - deze size moet ook gedefinieerd worden / is een combinatie verderop in dit bestand en nog in 1 ander bestand (PRO_DEVxx.i) current-window:width-chars = aantal colums - moet gelijk zijn aan de waarde die in bestand \CONNECT\PRO_DEVxx.INI staat bij "columns=" - moet 1 groter zijn dan de waarde die verderop in dit bestand staat bij DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH x DOWN size y by z separators. na "size" of anders gesteld: 1 lager in de DEFINE BROWSE dan de waarde in de PRO_DEVxx.INI bij Columns / current-window:width-chars current-window:height-chars = aantal rows - moet gelijk zijn aan de waarde die in bestand \CONNECT\PRO_DEVxx.INI bij "rows= staat - moet gelijk zijn aan de waarde die verder op in dit bestand staat bij DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH x DOWN size y by z separators. na "WITH" - moet 1 groter zijn aan de waarde die verder op in dit bestand staat bij DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH x DOWN size y by z separators. na "by" of anders gesteld: gelijk in de DEFINE BROWSE achter "WITH" als de waarde in de PRO_DEVxx.INI bij Rows / current-window:height-chars 1 lager in de DEFINE BROWSE achter "by " als de waarde in de PRO_DEVxx.INI bij Rows / current-window:height-chars */ /**********************/ /* KEUZE hoeveel inch */ /**********************/ /* klein (de oude) current-window:width-chars=120. current-window:height-chars=23. breed voor 3:4 19" current-window:width-chars=155. current-window:height-chars=25. lekker breed voor 16:9 22" current-window:width-chars=235. current-window:height-chars=25. lekker groot full screen voor 16:9 current-window:width-chars=240. current-window:height-chars=44. */ /* HUIDIG GEBRUIKT: */ current-window:width-chars=155. current-window:height-chars=25. /* Set up the menu bar. */ CURRENT-WINDOW:MENUBAR = main-bar-ptr. run ververs. /*WAIT-FOR CHOOSE OF exit-item-ptr.*/ CURRENT-WINDOW:MENUBAR=oldmenu. /*************************************************/ procedure ververs: /* Create a menu item for each record in the relate option. */ j = 1. k = 0{&numfiles}. DO WHILE j ? THEN reposition quer1 to recid new_recid. END. END TRIGGERS. END. /********************/ /*keuze hoeveel inch*/ /********************/ /* define van de browse query let op, zie opmerkingen hierboven voor de juiste instelling - waardes hebben relatie met nog 2 plekken, zie begin van deze browse.i 9-6-2015 17:20 goed oude 4:3 DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH 22 DOWN size 119 by 22 separators. 19 size voor een 16:9 scherm smal DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH 25 DOWN size 154 by 24 separators. size voor breed voor 16:9 DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH 25 DOWN size 229 by 24 separators. size voor full screen 23 :25 DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH 44 DOWN size 239 by 43 separators. HUIDIG GEBRUIKT: */ DEFINE BROWSE brow1 QUERY quer1 DISPLAY {{&lform} {&*}} WITH 25 DOWN size 154 by 24 separators. /* define van de frame */ /* org: DEFINE FRAME fram1 brow1 WITH SIDE-LABELS THREE-D. kan ook: DEFINE FRAME fram1 brow1 WITH SIDE-LABELS color Red/white THREE-D. */ DEFINE FRAME fram1 brow1 WITH SIDE-LABELS color bright-blue/white THREE-D. OPEN QUERY quer1 FOR EACH {&file} {&where}. ENABLE ALL. ENABLE brow1 WITH FRAME fram1 THREE-D. WAIT-FOR CHOOSE OF exit-item-ptr. HIDE FRAME fram1. END. /********************************************************************/ procedure cp-search: prompt {&file}.{&sfld} with frame keyfld{&seq} overlay attr-space side-labels row 6 top-only view-as dialog-box centered title "Search" THREE-D. FIND first {&file} {&where} using frame keyfld{&seq} {&file}.{&sfld} no-error. HIDE FRAME keyfld{&seq}. IF NOT AVAILABLE {&file} THEN FIND prev {&file} {&where} no-error. reposition quer1 to recid recid({&file}). END. /********************************************************************/ procedure cp-create: crecid = ?. old_recid = recid({&file}). DO on error undo, retry on endkey undo, leave: /* schonen form */ clear frame uform{&seq} all. create {&file}. {{&create}{&*}} join-recid = recid({&file}). prompt {{&uform} &text=TEXT( &endtext=) &noupdate="/*" {&*}} with frame uform{&seq} three-d. FIND {&file} WHERE recid({&file}) = join-recid EXCLUSIVE-LOCK. IF AVAILABLE {&file} THEN DO: assign {{&uform} &input="input frame uform{&seq}" &nowith="/*" {&*}}. END. IF NOT AVAILABLE {&file} THEN DO: message "Record in use". END. clear frame uform{&seq} all. validate {&file}. IF crecid = ? THEN crecid = recid({&file}). release {&file}. {{&release}{&*}} DOWN. END. HIDE FRAME uform{&seq}. OPEN QUERY quer1 FOR EACH {&file} {&where}. IF crecid <> ? THEN reposition quer1 to recid crecid. IF crecid = ? THEN reposition quer1 to recid old_recid. END. /********************************************************************/ procedure cp-delete: /* 26-8-2015 16:58 origineel verify = no. MESSAGE " Record verwijderen ? " VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE verify. IF NOT verify THEN leave. get current quer1 exclusive-lock. {{&postfind}{&*}} {{&delete}{&*}} delete {&file}. {{&release}{&*}} OPEN QUERY quer1 FOR EACH {&file} {&where}. */ verify = no. old_recid = recid({&file}). crecid = ?. /* record nogmaals zoeken via buffer om de volgende of vorige te zoeken let op, als je gerelateerd via een andere tabel in een volgende tabel gaat deleten (vb FUNCTIE -> FUNCBIT), vindt deze procedure wel een volgende record, maar kan hem niet tonen, dus dan gaat de UI niet helemaal lekker: springt terug naar 1e record */ FIND FIRST b_{&file} WHERE recid(b_{&file}) = old_recid NO-ERROR. IF AVAILABLE b_{&file} THEN DO: /* volgende record zoeken */ FIND NEXT b_{&file} no-error. IF AVAILABLE b_{&file} THEN DO: /* disp b_{&file} with frame b1. disp recid(b_{&file}) with frame b2. */ /* vastleggen record ID */ crecid = recid(b_{&file}). END. IF NOT AVAILABLE b_{&file} THEN DO: /* dan 2 records terug zoeken = de vorige */ FIND PREV b_{&file} no-error. IF AVAILABLE b_{&file} THEN DO: FIND PREV b_{&file} no-error. IF AVAILABLE b_{&file} THEN DO: /* disp b_{&file} with frame c1. disp recid(b_{&file}) with frame c2. */ /* vastleggen record ID */ crecid = recid(b_{&file}). END. END. END. END. HIDE FRAME uform{&seq}. MESSAGE " Record verwijderen ? " VIEW-AS ALERT-BOX QUESTION BUTTONS YES-NO UPDATE verify. IF NOT verify THEN leave. get current quer1 exclusive-lock. {{&postfind}{&*}} {{&delete}{&*}} delete {&file}. {{&release}{&*}} HIDE FRAME uform{&seq}. OPEN QUERY quer1 FOR EACH {&file} {&where}. IF crecid <> ? THEN reposition quer1 to recid crecid no-error. END. /********************************************************************/ procedure cp-update: {{&postfind}{&*}} join-recid = recid({&file}). get current quer1 exclusive-lock. display {{&uform} {&*}} with frame uform{&seq}. DO on error undo, retry on endkey undo, leave: prompt {{&uform} &text=TEXT( &endtext=) &noupdate="/*" {&*}} with frame uform{&seq} three-d. {{&update}{&*}} FIND FIRST {&file} WHERE recid({&file}) = join-recid. IF AVAILABLE {&file} THEN assign {{&uform} &input="input frame uform{&seq}" &nowith="/*" {&*}}. END. HIDE FRAME uform{&seq}. clear frame uform{&seq} all. validate {&file}. release {&file}. {{&release}{&*}} OPEN QUERY quer1 FOR EACH {&file} {&where}. reposition quer1 to recid join-recid. END. /********************************************************************/ procedure cp-copy-new: /* LABEL = "&Copy-New" */ crecid = ?. old_recid = recid({&file}). DO on error undo, retry on endkey undo, leave: display {{&uform} {&*}} with frame uform{&seq}. create {&file}. {{&create}{&*}} join-recid = recid({&file}). prompt {{&uform} &text=TEXT( &endtext=) &noupdate="/*" {&*}} with frame uform{&seq} three-d. FIND {&file} WHERE recid({&file}) = join-recid EXCLUSIVE-LOCK. IF AVAILABLE {&file} THEN DO: assign {{&uform} &input="input frame uform{&seq}" &nowith="/*" {&*}}. END. IF NOT AVAILABLE {&file} THEN DO: message "Record in use". END. clear frame uform{&seq} all. validate {&file}. IF crecid = ? THEN crecid = recid({&file}). release {&file}. {{&release}{&*}} DOWN. END. HIDE FRAME uform{&seq}. OPEN QUERY quer1 FOR EACH {&file} {&where}. /* als copy gedaan is dan view op nieuwe record */ IF crecid <> ? THEN reposition quer1 to recid crecid. IF crecid = ? THEN reposition quer1 to recid old_recid. END. /********************************************************************/ procedure cp-copy-org: /* LABEL = "&Kopy-Org" */ crecid = ?. old_recid = recid({&file}). DO on error undo, retry on endkey undo, leave: display {{&uform} {&*}} with frame uform{&seq}. create {&file}. {{&create}{&*}} join-recid = recid({&file}). prompt {{&uform} &text=TEXT( &endtext=) &noupdate="/*" {&*}} with frame uform{&seq} three-d. FIND {&file} WHERE recid({&file}) = join-recid EXCLUSIVE-LOCK. IF AVAILABLE {&file} THEN DO: assign {{&uform} &input="input frame uform{&seq}" &nowith="/*" {&*}}. END. IF NOT AVAILABLE {&file} THEN DO: message "Record in use". END. clear frame uform{&seq} all. validate {&file}. release {&file}. {{&release}{&*}} DOWN. END. HIDE FRAME uform{&seq}. OPEN QUERY quer1 FOR EACH {&file} {&where}. reposition quer1 to recid old_recid. END. /********************************************************************/ procedure cp-List: run l_{&file}.p (rec_id). END. /********************************************************************/ procedure cp-Help: run h_{&file}.p (rec_id). END. /********************************************************************/ procedure cp-exit: /* release {&file}. HIDE FRAME {&lform}. HIDE FRAME fram1. */ END. hide all.

Continue reading...
 
Status
Not open for further replies.
Top