[Prolint-cvs] SF.net SVN: prolint: [276] trunk/prolint
Brought to you by:
johnallengreen,
jurjen
From: <ju...@us...> - 2006-08-05 17:59:57
|
Revision: 276 Author: jurjen Date: 2006-08-05 10:58:17 -0700 (Sat, 05 Aug 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=276&view=rev Log Message: ----------- continued: clean up the root of prolint; move files to subdirectories. Modified Paths: -------------- trunk/prolint/ab/ab_event.p trunk/prolint/core/add2protools.p trunk/prolint/desktop.w trunk/prolint/help/desktop.htxt trunk/prolint/help/lintcfg.htxt trunk/prolint/help/newrule.htxt trunk/prolint/help/overview.htxt trunk/prolint/help/profiles.htxt trunk/prolint/help/regrtest.htxt trunk/prolint/help/run_prolint.htxt trunk/prolint/help/selectfiles.htxt trunk/prolint/help/settings.htxt trunk/prolint/outputhandlers/codepreview.w trunk/prolint/outputhandlers/logwin.w trunk/prolint/outputhandlers/logwin8.w trunk/prolint/outputhandlers/regrlog.p trunk/prolint/regrtest/test.p trunk/prolint/regrtest/test2.p trunk/prolint/rtb/addmenu.p Added Paths: ----------- trunk/prolint/core/dnewprofile.w trunk/prolint/core/dnewrule.w trunk/prolint/core/lintcfg.w trunk/prolint/core/lintcfgbycat.w trunk/prolint/core/selectfiles.w trunk/prolint/images/delete.gif trunk/prolint/images/desktop.gif trunk/prolint/images/exit.gif trunk/prolint/images/filter.gif trunk/prolint/images/first.gif trunk/prolint/images/help.gif trunk/prolint/images/hideTree.gif trunk/prolint/images/last.gif trunk/prolint/images/locked.gif trunk/prolint/images/next.gif trunk/prolint/images/openlog.gif trunk/prolint/images/prev.gif trunk/prolint/images/preview.gif trunk/prolint/images/prolint.gif trunk/prolint/images/protools.bmp trunk/prolint/images/repositionfailed.gif trunk/prolint/images/savelog.gif trunk/prolint/images/unlocked.gif trunk/prolint/launch/lintproglist.p trunk/prolint/launch/mvo-lintCurrent.p trunk/prolint/launch/mvo-lintFileList.p trunk/prolint/launch/mvo-lintOpen.p trunk/prolint/launch/start.p trunk/prolint/launch/test.p Removed Paths: ------------- trunk/prolint/dnewprofile.w trunk/prolint/dnewrule.w trunk/prolint/lintcfg.w trunk/prolint/lintcfgbycat.w trunk/prolint/lintproglist.p trunk/prolint/mvo-lintCurrent.p trunk/prolint/mvo-lintFileList.p trunk/prolint/mvo-lintOpen.p trunk/prolint/outputhandlers/delete.gif trunk/prolint/outputhandlers/desktop.gif trunk/prolint/outputhandlers/exit.gif trunk/prolint/outputhandlers/filter.gif trunk/prolint/outputhandlers/first.gif trunk/prolint/outputhandlers/help.gif trunk/prolint/outputhandlers/hideTree.gif trunk/prolint/outputhandlers/last.gif trunk/prolint/outputhandlers/locked.gif trunk/prolint/outputhandlers/next.gif trunk/prolint/outputhandlers/openlog.gif trunk/prolint/outputhandlers/prev.gif trunk/prolint/outputhandlers/preview.gif trunk/prolint/outputhandlers/prolint.gif trunk/prolint/outputhandlers/repositionfailed.gif trunk/prolint/outputhandlers/savelog.gif trunk/prolint/outputhandlers/unlocked.gif trunk/prolint/protools.bmp trunk/prolint/selectfiles.w trunk/prolint/start.p trunk/prolint/test.p Modified: trunk/prolint/ab/ab_event.p =================================================================== --- trunk/prolint/ab/ab_event.p 2006-08-05 16:54:06 UTC (rev 275) +++ trunk/prolint/ab/ab_event.p 2006-08-05 17:58:17 UTC (rev 276) @@ -176,9 +176,9 @@ Notes: ------------------------------------------------------------------------------*/ /* lintcfg has a conditional parameter, try it both with & without */ - RUN prolint/lintcfg.w PERSISTENT NO-ERROR. + RUN prolint/core/lintcfg.w PERSISTENT NO-ERROR. IF ERROR-STATUS:ERROR AND ERROR-STATUS:GET-NUMBER(1) = 3234 /* mismatched number of parameters */ - THEN RUN prolint/lintcfg.w PERSISTENT ("AppBuilder") NO-ERROR. + THEN RUN prolint/core/lintcfg.w PERSISTENT ("AppBuilder") NO-ERROR. END PROCEDURE. /* _UIB-CODE-BLOCK-END */ Modified: trunk/prolint/core/add2protools.p =================================================================== --- trunk/prolint/core/add2protools.p 2006-08-05 16:54:06 UTC (rev 275) +++ trunk/prolint/core/add2protools.p 2006-08-05 17:58:17 UTC (rev 276) @@ -9,10 +9,20 @@ DEFINE VARIABLE ProtoolsDatfile AS CHARACTER NO-UNDO. DEFINE VARIABLE cProgram AS CHARACTER NO-UNDO. -DEFINE VARIABLE iOrder AS INTEGER NO-UNDO. DEFINE VARIABLE iMaxOrder AS INTEGER NO-UNDO. DEFINE VARIABLE hproc AS HANDLE NO-UNDO. +DEFINE VARIABLE NeedsNewBitmap AS LOGICAL NO-UNDO INITIAL FALSE. +DEFINE TEMP-TABLE ttTools NO-UNDO + FIELD caption AS CHARACTER + FIELD prog AS CHARACTER + FIELD glyph AS CHARACTER + FIELD dunno1 AS LOGICAL + FIELD dunno2 AS LOGICAL + FIELD ordnum AS INTEGER + FIELD dunno3 AS LOGICAL. + + GET-KEY-VALUE SECTION "ProTools" KEY "FunctionDefs" VALUE ProtoolsDatfile. IF ProtoolsDatfile=? THEN RETURN. @@ -20,36 +30,59 @@ /* read protools.dat */ INPUT FROM VALUE(ProtoolsDatfile). REPEAT: - ASSIGN cProgram = "" - iOrder = 0. - IMPORT ^ cProgram ^ ^ ^ iOrder ^. - IF cProgram MATCHES "*prolint*desktop*" THEN - lAlreadyInThere = TRUE. - IF iOrder > iMaxOrder THEN - iMaxOrder = iOrder. + CREATE ttTools. + IMPORT ttTools. + IF ttTools.ordnum > iMaxOrder THEN + iMaxOrder = ttTools.ordnum. END. INPUT CLOSE. +FOR EACH ttTools WHERE ttTools.prog="" : + DELETE ttTools. +END. +FIND ttTools WHERE ttTools.prog = "prolint/desktop.w" NO-ERROR. +IF AVAILABLE ttTools THEN DO: + lAlreadyInThere = TRUE. + IF ttTools.glyph = "prolint/protools.bmp" THEN DO: + ttTools.glyph = "prolint/images/protools.bmp". + MESSAGE "The bitmap for the Prolint Desktop in PRO*Tools will now be repaired...." VIEW-AS ALERT-BOX. + RUN RewriteProtools. + END. +END. + IF cAction = "ADD":U THEN DO: /* append to protools.dat, if still needed */ IF NOT lAlreadyInThere THEN DO: - OUTPUT TO VALUE(ProtoolsDatfile) APPEND. - PUT UNFORMATTED - SUBSTITUTE('"Prolint Desktop" "prolint/desktop.w" "prolint/protools.bmp" yes yes &1 no',STRING(iMaxOrder + 10)) - SKIP. - OUTPUT CLOSE. + CREATE ttTools. + ASSIGN ttTools.caption = "Prolint Desktop" + ttTools.prog = "prolint/desktop.w" + ttTools.glyph = "prolint/images/protools.bmp" + ttTools.dunno1 = yes + ttTools.dunno2 = yes + ttTools.ordnum = iMaxOrder + 10 + ttTools.dunno3 = NO. + RUN RewriteProtools. lAlreadyInThere = TRUE. - - /* try to close protools palette */ - hproc = SESSION:FIRST-PROCEDURE. - DO WHILE (VALID-HANDLE(hProc)) AND NOT (hProc:FILE-NAME MATCHES "*protools*_protool*") : - hproc = hproc:NEXT-SIBLING. - END. - IF (VALID-HANDLE(hProc)) AND (hProc:FILE-NAME MATCHES "*protools*_protool*") THEN - RUN Destroy IN hProc NO-ERROR. - MESSAGE "Re-open the PRO*Tools palette to see the new Prolint Desktop option" - VIEW-AS ALERT-BOX. END. END. +PROCEDURE RewriteProtools : + OUTPUT TO VALUE(ProtoolsDatfile). + FOR EACH ttTools : + EXPORT ttTools. + END. + OUTPUT CLOSE. + /* try to close protools palette */ + hproc = SESSION:FIRST-PROCEDURE. + DO WHILE (VALID-HANDLE(hProc)) AND NOT (hProc:FILE-NAME MATCHES "*protools*_protool*") : + hproc = hproc:NEXT-SIBLING. + END. + IF (VALID-HANDLE(hProc)) AND (hProc:FILE-NAME MATCHES "*protools*_protool*") THEN + RUN Destroy IN hProc NO-ERROR. + MESSAGE "Re-open the PRO*Tools palette to see the new Prolint Desktop option" + VIEW-AS ALERT-BOX. + +END PROCEDURE. + + Copied: trunk/prolint/core/dnewprofile.w (from rev 250, trunk/prolint/dnewprofile.w) =================================================================== --- trunk/prolint/core/dnewprofile.w (rev 0) +++ trunk/prolint/core/dnewprofile.w 2006-08-05 17:58:17 UTC (rev 276) @@ -0,0 +1,296 @@ +&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v9r12 GUI +&ANALYZE-RESUME +&Scoped-define WINDOW-NAME CURRENT-WINDOW +&Scoped-define FRAME-NAME Dialog-Frame +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Dialog-Frame +/*------------------------------------------------------------------------ + + File: prolint/core/dnewprofile.w + + Description: creates a new profile, + wich is a subdirectory in prolint/settings + or in local-prolint/settings + + Input Parameters: + <none> + + Output Parameters: + pNewProfile as character: + ? when no new profile was created + + Author: Jurjen Dijkstra + + Created: 25 May 2002 + ------------------------------------------------------------------------ + + Copyright (C) 2002 Jurjen Dijkstra + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +------------------------------------------------------------------------*/ +/* This .W file was created with the Progress AppBuilder. */ +/*----------------------------------------------------------------------*/ + +/* *************************** Definitions ************************** */ + +/* Parameters Definitions --- */ +&IF DEFINED(UIB_is_running)=0 &THEN + DEFINE OUTPUT PARAMETER pNewProfile AS CHARACTER NO-UNDO. +&ELSE + DEFINE VARIABLE pNewProfile AS CHARACTER NO-UNDO. +&ENDIF +pNewProfile = ?. + +/* Local Variable Definitions --- */ + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK + +/* ******************** Preprocessor Definitions ******************** */ + +&Scoped-define PROCEDURE-TYPE Dialog-Box +&Scoped-define DB-AWARE no + +/* Name of first Frame and/or Browse and/or first Query */ +&Scoped-define FRAME-NAME Dialog-Frame + +/* Standard List Definitions */ +&Scoped-Define ENABLED-OBJECTS ed_newname rd_where Btn_OK Btn_Cancel +&Scoped-Define DISPLAYED-OBJECTS ed_newname rd_where + +/* Custom List Definitions */ +/* List-1,List-2,List-3,List-4,List-5,List-6 */ + +/* _UIB-PREPROCESSOR-BLOCK-END */ +&ANALYZE-RESUME + + + +/* *********************** Control Definitions ********************** */ + +/* Define a dialog box */ + +/* Definitions of the field level widgets */ +DEFINE BUTTON Btn_Cancel AUTO-END-KEY + LABEL "Cancel" + SIZE 15 BY 1.14 + BGCOLOR 8 . + +DEFINE BUTTON Btn_OK AUTO-GO + LABEL "OK" + SIZE 15 BY 1.14 + BGCOLOR 8 . + +DEFINE VARIABLE ed_newname AS CHARACTER FORMAT "X(256)":U + LABEL "New profile name" + VIEW-AS FILL-IN + SIZE 26 BY 1 NO-UNDO. + +DEFINE VARIABLE rd_where AS INTEGER INITIAL 1 + VIEW-AS RADIO-SET VERTICAL + RADIO-BUTTONS + "Create shared (in prolint/settings)", 1, +"Create local (in local-prolint/settings)", 2 + SIZE 41 BY 2.14 NO-UNDO. + + +/* ************************ Frame Definitions *********************** */ + +DEFINE FRAME Dialog-Frame + ed_newname AT ROW 2.43 COL 19 COLON-ALIGNED + rd_where AT ROW 3.86 COL 21 NO-LABEL + Btn_OK AT ROW 6.95 COL 14 + Btn_Cancel AT ROW 6.95 COL 32 + SPACE(18.19) SKIP(0.42) + WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER + SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE + TITLE "Create a new profile" + DEFAULT-BUTTON Btn_OK CANCEL-BUTTON Btn_Cancel. + + +/* *********************** Procedure Settings ************************ */ + +&ANALYZE-SUSPEND _PROCEDURE-SETTINGS +/* Settings for THIS-PROCEDURE + Type: Dialog-Box + Allow: Basic,Browse,DB-Fields,Query + Other Settings: COMPILE + */ +&ANALYZE-RESUME _END-PROCEDURE-SETTINGS + + + +/* *********** Runtime Attributes and AppBuilder Settings *********** */ + +&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES +/* SETTINGS FOR DIALOG-BOX Dialog-Frame + */ +ASSIGN + FRAME Dialog-Frame:SCROLLABLE = FALSE + FRAME Dialog-Frame:HIDDEN = TRUE. + +/* _RUN-TIME-ATTRIBUTES-END */ +&ANALYZE-RESUME + + + + + +/* ************************ Control Triggers ************************ */ + +&Scoped-define SELF-NAME Dialog-Frame +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Dialog-Frame Dialog-Frame +ON WINDOW-CLOSE OF FRAME Dialog-Frame /* Create a new profile */ +DO: + APPLY "END-ERROR":U TO SELF. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME Btn_OK +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK Dialog-Frame +ON CHOOSE OF Btn_OK IN FRAME Dialog-Frame /* OK */ +DO: + DEFINE VARIABLE done AS LOGICAL NO-UNDO. + ASSIGN + ed_newname + rd_where. + RUN CreateNewProfile (OUTPUT done). + IF NOT done THEN + RETURN NO-APPLY. + ELSE + pNewProfile = ed_newname. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&UNDEFINE SELF-NAME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Dialog-Frame + + +/* *************************** Main Block *************************** */ + +/* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent. */ +IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT eq ? +THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW. + + +/* Now enable the interface and wait for the exit condition. */ +/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */ +MAIN-BLOCK: +DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK + ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK: + RUN enable_UI. + + FILE-INFO:FILE-NAME = "local-prolint/settings":U. + IF FILE-INFO:FULL-PATHNAME = ? THEN + rd_where:SENSITIVE = FALSE. + + WAIT-FOR GO OF FRAME {&FRAME-NAME}. +END. +RUN disable_UI. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +/* ********************** Internal Procedures *********************** */ + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE CreateNewProfile Dialog-Frame +PROCEDURE CreateNewProfile : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + DEFINE OUTPUT PARAMETER done AS LOGICAL NO-UNDO INITIAL FALSE. + + DEFINE VARIABLE basedir AS CHARACTER NO-UNDO. + + IF ed_newname = "" THEN DO: + MESSAGE "Please enter a name" VIEW-AS ALERT-BOX. + RETURN. + END. + + IF rd_where=1 THEN + FILE-INFO:FILE-NAME = "prolint/settings". + ELSE + FILE-INFO:FILE-NAME = "local-prolint/settings". + basedir = FILE-INFO:FULL-PATHNAME. + + /* try to create the new subdirectory: */ + OS-CREATE-DIR VALUE(basedir + "/":U + ed_newname) NO-ERROR. + IF NOT ERROR-STATUS:ERROR THEN + done = TRUE. + ELSE + MESSAGE "Sorry, the subdirectory can not be created:" SKIP + ERROR-STATUS:GET-MESSAGE(1) + VIEW-AS ALERT-BOX. + + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Dialog-Frame _DEFAULT-DISABLE +PROCEDURE disable_UI : +/*------------------------------------------------------------------------------ + Purpose: DISABLE the User Interface + Parameters: <none> + Notes: Here we clean-up the user-interface by deleting + dynamic widgets we have created and/or hide + frames. This procedure is usually called when + we are ready to "clean-up" after running. +------------------------------------------------------------------------------*/ + /* Hide all frames. */ + HIDE FRAME Dialog-Frame. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Dialog-Frame _DEFAULT-ENABLE +PROCEDURE enable_UI : +/*------------------------------------------------------------------------------ + Purpose: ENABLE the User Interface + Parameters: <none> + Notes: Here we display/view/enable the widgets in the + user-interface. In addition, OPEN all queries + associated with each FRAME and BROWSE. + These statements here are based on the "Other + Settings" section of the widget Property Sheets. +------------------------------------------------------------------------------*/ + DISPLAY ed_newname rd_where + WITH FRAME Dialog-Frame. + ENABLE ed_newname rd_where Btn_OK Btn_Cancel + WITH FRAME Dialog-Frame. + VIEW FRAME Dialog-Frame. + {&OPEN-BROWSERS-IN-QUERY-Dialog-Frame} +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + Copied: trunk/prolint/core/dnewrule.w (from rev 274, trunk/prolint/dnewrule.w) =================================================================== --- trunk/prolint/core/dnewrule.w (rev 0) +++ trunk/prolint/core/dnewrule.w 2006-08-05 17:58:17 UTC (rev 276) @@ -0,0 +1,499 @@ +&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v9r12 GUI +&ANALYZE-RESUME +&Scoped-define WINDOW-NAME CURRENT-WINDOW +&Scoped-define FRAME-NAME Dialog-Frame +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Dialog-Frame +/*------------------------------------------------------------------------ + + File: + + Description: + + Input Parameters: + <none> + + Output Parameters: + <none> + + Author: + + Created: +------------------------------------------------------------------------*/ +/* This .W file was created with the Progress AppBuilder. */ +/*----------------------------------------------------------------------*/ + +/* *************************** Definitions ************************** */ + +/* Parameters Definitions --- */ + +/* Local Variable Definitions --- */ + +DEFINE TEMP-TABLE tt_rules NO-UNDO + FIELD RuleID AS CHARACTER FORMAT "x(15)":U + FIELD severity AS INTEGER FORMAT "9":U + FIELD useproparse AS LOGICAL FORMAT "yes/no":U + FIELD uselisting AS LOGICAL FORMAT "yes/no":U + FIELD usexref AS LOGICAL FORMAT "yes/no":U + FIELD useproclist AS LOGICAL FORMAT "yes/no":U + FIELD ignoreUIB AS LOGICAL FORMAT "yes/no":U + FIELD description AS CHARACTER FORMAT "x(60)":U + FIELD category AS CHARACTER +INDEX idx_id AS PRIMARY RuleID. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK + +/* ******************** Preprocessor Definitions ******************** */ + +&Scoped-define PROCEDURE-TYPE Dialog-Box +&Scoped-define DB-AWARE no + +/* Name of first Frame and/or Browse and/or first Query */ +&Scoped-define FRAME-NAME Dialog-Frame + +/* Standard List Definitions */ +&Scoped-Define ENABLED-OBJECTS ed_ruleid ed_description ed_severity ~ +cb_category tg_proparse tg_xref tg_proclist tg_forgetab Btn_OK Btn_Cancel ~ +Btn_Help RECT-1 +&Scoped-Define DISPLAYED-OBJECTS ed_ruleid ed_description ed_severity ~ +cb_category tg_proparse tg_xref tg_proclist tg_forgetab FILL-IN-7 FILL-IN-8 ~ +FILL-IN-9 FILL-IN-10 FILL-IN-11 FILL-IN-12 FILL-IN-13 FILL-IN-14 + +/* Custom List Definitions */ +/* List-1,List-2,List-3,List-4,List-5,List-6 */ + +/* _UIB-PREPROCESSOR-BLOCK-END */ +&ANALYZE-RESUME + + + +/* *********************** Control Definitions ********************** */ + +/* Define a dialog box */ + +/* Definitions of the field level widgets */ +DEFINE BUTTON Btn_Cancel AUTO-END-KEY + LABEL "Cancel" + SIZE 15 BY 1.14 + BGCOLOR 8 . + +DEFINE BUTTON Btn_Help + LABEL "&Help" + SIZE 15 BY 1.14 + BGCOLOR 8 . + +DEFINE BUTTON Btn_OK AUTO-GO + LABEL "OK" + SIZE 15 BY 1.14 + BGCOLOR 8 . + +DEFINE VARIABLE cb_category AS CHARACTER FORMAT "X(256)":U + LABEL "category" + VIEW-AS COMBO-BOX INNER-LINES 5 + LIST-ITEMS "Item 1" + DROP-DOWN-LIST + SIZE 46 BY 1 NO-UNDO. + +DEFINE VARIABLE ed_description AS CHARACTER FORMAT "X(60)":U + LABEL "description" + VIEW-AS FILL-IN + SIZE 60 BY 1 NO-UNDO. + +DEFINE VARIABLE ed_ruleid AS CHARACTER FORMAT "X(15)":U + LABEL "rule-id" + VIEW-AS FILL-IN + SIZE 21 BY 1 NO-UNDO. + +DEFINE VARIABLE ed_severity AS INTEGER FORMAT "9":U INITIAL 5 + LABEL "severity" + VIEW-AS FILL-IN + SIZE 8.6 BY 1 NO-UNDO. + +DEFINE VARIABLE FILL-IN-10 AS CHARACTER FORMAT "X(256)":U INITIAL "default severity, number between 0 to 9 (inclusive)" + VIEW-AS TEXT + SIZE 48 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-11 AS CHARACTER FORMAT "X(256)":U INITIAL "toggle ~"on~" if this rule cannot run without Proparse" + VIEW-AS TEXT + SIZE 51 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-12 AS CHARACTER FORMAT "X(256)":U INITIAL "toggle ~"on~" if this rule needs to read XREF file" + VIEW-AS TEXT + SIZE 49 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-13 AS CHARACTER FORMAT "X(256)":U INITIAL "toggle ~"on~" if this rule needs a list of startnodes for each ip/udf" + VIEW-AS TEXT + SIZE 60 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-14 AS CHARACTER FORMAT "X(256)":U INITIAL "toggle ~"on~" if warnings for AB-generated code should be surpressed" + VIEW-AS TEXT + SIZE 65 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-7 AS CHARACTER FORMAT "X(256)":U INITIAL "This program helps you insert a new entry to prolint/rules/rules.d" + VIEW-AS TEXT + SIZE 76 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-8 AS CHARACTER FORMAT "X(256)":U INITIAL "rule-id is name of sourcefile without ~".p~"" + VIEW-AS TEXT + SIZE 39 BY .62 NO-UNDO. + +DEFINE VARIABLE FILL-IN-9 AS CHARACTER FORMAT "X(256)":U INITIAL "short description for browse in profile configuration dialog" + VIEW-AS TEXT + SIZE 55 BY .62 NO-UNDO. + +DEFINE RECTANGLE RECT-1 + EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL + SIZE 89 BY 1.67. + +DEFINE VARIABLE tg_forgetab AS LOGICAL INITIAL no + LABEL "ignore AB-generated code" + VIEW-AS TOGGLE-BOX + SIZE 30 BY .81 NO-UNDO. + +DEFINE VARIABLE tg_proclist AS LOGICAL INITIAL no + LABEL "uses ProcedureListGet" + VIEW-AS TOGGLE-BOX + SIZE 27 BY .81 NO-UNDO. + +DEFINE VARIABLE tg_proparse AS LOGICAL INITIAL yes + LABEL "requires Proparse" + VIEW-AS TOGGLE-BOX + SIZE 22 BY .81 NO-UNDO. + +DEFINE VARIABLE tg_xref AS LOGICAL INITIAL no + LABEL "requires compile xref" + VIEW-AS TOGGLE-BOX + SIZE 24 BY .81 NO-UNDO. + + +/* ************************ Frame Definitions *********************** */ + +DEFINE FRAME Dialog-Frame + ed_ruleid AT ROW 2.67 COL 14 COLON-ALIGNED + ed_description AT ROW 5.05 COL 14.2 COLON-ALIGNED + ed_severity AT ROW 7.19 COL 14 COLON-ALIGNED + cb_category AT ROW 8.86 COL 14 COLON-ALIGNED + tg_proparse AT ROW 10.52 COL 16 + tg_xref AT ROW 12.67 COL 16 + tg_proclist AT ROW 14.57 COL 16 + tg_forgetab AT ROW 16.48 COL 16 + Btn_OK AT ROW 19.1 COL 39 + Btn_Cancel AT ROW 19.1 COL 56 + Btn_Help AT ROW 19.1 COL 73 + FILL-IN-7 AT ROW 1.48 COL 1 COLON-ALIGNED NO-LABEL + FILL-IN-8 AT ROW 3.76 COL 14 COLON-ALIGNED NO-LABEL + FILL-IN-9 AT ROW 6.1 COL 14 COLON-ALIGNED NO-LABEL + FILL-IN-10 AT ROW 7.38 COL 24 COLON-ALIGNED NO-LABEL + FILL-IN-11 AT ROW 11.33 COL 17.8 COLON-ALIGNED NO-LABEL + FILL-IN-12 AT ROW 13.48 COL 17.8 COLON-ALIGNED NO-LABEL + FILL-IN-13 AT ROW 15.38 COL 17.8 COLON-ALIGNED NO-LABEL + FILL-IN-14 AT ROW 17.29 COL 17.8 COLON-ALIGNED NO-LABEL + RECT-1 AT ROW 18.86 COL 1 + SPACE(0.19) SKIP(0.00) + WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER + SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE + TITLE "Add a new rule to rules.d" + DEFAULT-BUTTON Btn_OK CANCEL-BUTTON Btn_Cancel. + + +/* *********************** Procedure Settings ************************ */ + +&ANALYZE-SUSPEND _PROCEDURE-SETTINGS +/* Settings for THIS-PROCEDURE + Type: Dialog-Box + Allow: Basic,Browse,DB-Fields,Query + */ +&ANALYZE-RESUME _END-PROCEDURE-SETTINGS + + + +/* *********** Runtime Attributes and AppBuilder Settings *********** */ + +&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES +/* SETTINGS FOR DIALOG-BOX Dialog-Frame + */ +ASSIGN + FRAME Dialog-Frame:SCROLLABLE = FALSE + FRAME Dialog-Frame:HIDDEN = TRUE. + +/* SETTINGS FOR FILL-IN FILL-IN-10 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-11 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-12 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-13 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-14 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-7 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-8 IN FRAME Dialog-Frame + NO-ENABLE */ +/* SETTINGS FOR FILL-IN FILL-IN-9 IN FRAME Dialog-Frame + NO-ENABLE */ +/* _RUN-TIME-ATTRIBUTES-END */ +&ANALYZE-RESUME + + + + + +/* ************************ Control Triggers ************************ */ + +&Scoped-define SELF-NAME Dialog-Frame +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Dialog-Frame Dialog-Frame +ON WINDOW-CLOSE OF FRAME Dialog-Frame /* Add a new rule to rules.d */ +DO: + APPLY "END-ERROR":U TO SELF. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME Btn_Help +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Help Dialog-Frame +ON CHOOSE OF Btn_Help IN FRAME Dialog-Frame /* Help */ +OR HELP OF FRAME {&FRAME-NAME} +DO: + + DEF VAR ReturnValue AS INTEGER NO-UNDO. + + FILE-INFO:FILE-NAME = "prolint/help/newrule.htm":U. + {&_proparse_ prolint-nowarn(message)} + IF FILE-INFO:FULL-PATHNAME<>? THEN + RUN prolint/core/openhtml.p (FILE-INFO:FULL-PATHNAME). + ELSE + MESSAGE "no help found for dnewrule.w":T VIEW-AS ALERT-BOX. + +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME Btn_OK +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK Dialog-Frame +ON CHOOSE OF Btn_OK IN FRAME Dialog-Frame /* OK */ +DO: + ASSIGN ed_ruleid + ed_description + ed_severity + tg_proparse + tg_xref + tg_proclist + tg_forgetab + cb_category. + + IF ed_ruleid = "" THEN DO: + MESSAGE "please enter a rule-id" + VIEW-AS ALERT-BOX. + RETURN NO-APPLY. + END. + + IF ed_description = "" THEN DO: + MESSAGE "please enter a description" + VIEW-AS ALERT-BOX. + RETURN NO-APPLY. + END. + + IF cb_category = "" THEN DO: + MESSAGE "please choose a category" + VIEW-AS ALERT-BOX. + RETURN NO-APPLY. + END. + + IF ed_severity<0 OR ed_severity>9 THEN DO: + MESSAGE "severity should be at least 0, not greater than 9" + VIEW-AS ALERT-BOX. + RETURN NO-APPLY. + END. + + FIND tt_rules WHERE tt_rules.RuleID = ed_ruleid NO-LOCK NO-ERROR. + IF AVAILABLE tt_rules THEN DO: + MESSAGE SUBSTITUTE("rule &1 already exists", ed_ruleid) + VIEW-AS ALERT-BOX ERROR. + RETURN NO-APPLY. + END. + + + CREATE tt_rules. + ASSIGN tt_rules.RuleId = ed_ruleid + tt_rules.severity = ed_severity + tt_rules.useproparse = tg_proparse + tt_rules.uselisting = FALSE + tt_rules.usexref = tg_xref + tt_rules.useproclist = tg_proclist + tt_rules.ignoreUIB = tg_forgetab + tt_rules.DESCRIPTION = ed_description + tt_rules.category = cb_category. + RELEASE tt_rules. + + RUN WriteRules. + + MESSAGE "Now that you have created a new rule, would you please consider sharing it with the Prolint Open Source project?" + VIEW-AS ALERT-BOX QUESTION. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&UNDEFINE SELF-NAME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Dialog-Frame + + +/* *************************** Main Block *************************** */ + +/* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent. */ +IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT eq ? +THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW. + + +/* Now enable the interface and wait for the exit condition. */ +/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */ +MAIN-BLOCK: +DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK + ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK: + RUN ReadRules. + RUN enable_UI. + WAIT-FOR GO OF FRAME {&FRAME-NAME}. +END. +RUN disable_UI. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +/* ********************** Internal Procedures *********************** */ + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI Dialog-Frame _DEFAULT-DISABLE +PROCEDURE disable_UI : +/*------------------------------------------------------------------------------ + Purpose: DISABLE the User Interface + Parameters: <none> + Notes: Here we clean-up the user-interface by deleting + dynamic widgets we have created and/or hide + frames. This procedure is usually called when + we are ready to "clean-up" after running. +------------------------------------------------------------------------------*/ + /* Hide all frames. */ + HIDE FRAME Dialog-Frame. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI Dialog-Frame _DEFAULT-ENABLE +PROCEDURE enable_UI : +/*------------------------------------------------------------------------------ + Purpose: ENABLE the User Interface + Parameters: <none> + Notes: Here we display/view/enable the widgets in the + user-interface. In addition, OPEN all queries + associated with each FRAME and BROWSE. + These statements here are based on the "Other + Settings" section of the widget Property Sheets. +------------------------------------------------------------------------------*/ + DISPLAY ed_ruleid ed_description ed_severity cb_category tg_proparse tg_xref + tg_proclist tg_forgetab FILL-IN-7 FILL-IN-8 FILL-IN-9 FILL-IN-10 + FILL-IN-11 FILL-IN-12 FILL-IN-13 FILL-IN-14 + WITH FRAME Dialog-Frame. + ENABLE ed_ruleid ed_description ed_severity cb_category tg_proparse tg_xref + tg_proclist tg_forgetab Btn_OK Btn_Cancel Btn_Help RECT-1 + WITH FRAME Dialog-Frame. + VIEW FRAME Dialog-Frame. + {&OPEN-BROWSERS-IN-QUERY-Dialog-Frame} +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ReadRules Dialog-Frame +PROCEDURE ReadRules : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + DEFINE VARIABLE rules_d AS CHARACTER NO-UNDO. + DEFINE VARIABLE categorylist AS CHARACTER NO-UNDO. + + + FOR EACH tt_rules : + DELETE tt_rules. + END. + + FILE-INFO:FILE-NAME = "prolint/rules/rules.d":U. + IF FILE-INFO:FULL-PATHNAME <> ? THEN + rules_d = FILE-INFO:FULL-PATHNAME. + ELSE DO: + MESSAGE "Cannot find prolint/rules/rules.d" + VIEW-AS ALERT-BOX ERROR. + RETURN. + END. + + INPUT FROM VALUE(rules_d). + REPEAT: + CREATE tt_rules. + IMPORT tt_rules. + END. + INPUT CLOSE. + FOR EACH tt_rules WHERE tt_rules.RuleID = "" : + DELETE tt_rules. + END. + + categorylist = "". + FOR EACH tt_rules WHERE tt_rules.category<>"" : + IF LOOKUP(tt_rules.category, categorylist)=0 THEN + categorylist = categorylist + ",":U + tt_rules.category. + END. + categorylist = TRIM(categorylist,",":U). + + DO WITH FRAME {&FRAME-NAME} : + cb_category:LIST-ITEMS = categorylist. + END. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE WriteRules Dialog-Frame +PROCEDURE WriteRules : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + + DEFINE VARIABLE rules_d AS CHARACTER NO-UNDO. + + FILE-INFO:FILE-NAME = "prolint/rules/rules.d":U. + IF FILE-INFO:FULL-PATHNAME <> ? THEN + rules_d = FILE-INFO:FULL-PATHNAME. + ELSE DO: + MESSAGE "Cannot find prolint/rules/rules.d" + VIEW-AS ALERT-BOX ERROR. + RETURN. + END. + + OUTPUT TO VALUE(rules_d). + FOR EACH tt_rules : + EXPORT tt_rules. + END. + OUTPUT CLOSE. + + MESSAGE "rule is now added to prolint/rules/rules.d" + VIEW-AS ALERT-BOX INFORMATION. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + Copied: trunk/prolint/core/lintcfg.w (from rev 274, trunk/prolint/lintcfg.w) =================================================================== --- trunk/prolint/core/lintcfg.w (rev 0) +++ trunk/prolint/core/lintcfg.w 2006-08-05 17:58:17 UTC (rev 276) @@ -0,0 +1,1175 @@ +&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI +&ANALYZE-RESUME +&Scoped-define WINDOW-NAME C-Win +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS C-Win +/*------------------------------------------------------------------------ + + File: + prolint/core/lintcfg.w + + Description: + UI for maintaining the configuration files in prolint/settings + + Input Parameters: + pInitialProfile : initial value for combo-box "profile" + + Output Parameters: + <none> + + Author: + Jurjen Dijkstra + + Created: + July 3, 2001 + + ----------------------------------------------------------------- + + Copyright (C) 2001,2002,2003,2004 Jurjen Dijkstra + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +------------------------------------------------------------------------*/ +/* This .W file was created with the Progress AppBuilder. */ +/*----------------------------------------------------------------------*/ + +/* Create an unnamed pool to store all the widgets created + by this procedure. This is a good default which assures + that this procedure's triggers and internal procedures + will execute in this procedure's storage, and that proper + cleanup will occur on deletion of the procedure. */ + +CREATE WIDGET-POOL. + +/* *************************** Definitions ************************** */ +{prolint/core/dlc-version.i} + +/* Parameters Definitions --- */ + +/* pInitialProfile : initial value for combo-box "profile" */ +&IF DEFINED(UIB_is_running)=0 &THEN +DEFINE INPUT PARAMETER pInitialProfile AS CHARACTER NO-UNDO. +&ELSE +DEFINE VARIABLE pInitialProfile AS CHARACTER NO-UNDO. +&ENDIF + +/* Local Variable Definitions --- */ + +DEFINE VARIABLE CurrentProfile AS CHAR NO-UNDO INITIAL "":U. +DEFINE VARIABLE PrivateDir AS CHARACTER NO-UNDO. +DEFINE VARIABLE SharedDir AS CHARACTER NO-UNDO. +DEFINE VARIABLE RecentDir AS CHARACTER NO-UNDO. + +DEFINE TEMP-TABLE tt_rules NO-UNDO + FIELD RuleID AS CHARACTER FORMAT "x(15)":U + FIELD severity AS INTEGER FORMAT "9":U + FIELD useproparse AS LOGICAL FORMAT "x/ ":U + FIELD uselisting AS LOGICAL FORMAT "x/ ":U + FIELD usexref AS LOGICAL FORMAT "x/ ":U + FIELD useproclist AS LOGICAL FORMAT "x/ ":U + FIELD ignoreUIB AS LOGICAL FORMAT "x/ ":U + FIELD description AS CHARACTER FORMAT "x(60)":U + FIELD category AS CHARACTER + FIELD required AS LOGICAL INITIAL TRUE FORMAT "yes/no":U + FIELD customseverity AS INTEGER FORMAT "9":U + FIELD customrule AS LOGICAL INITIAL FALSE + INDEX idx_id AS PRIMARY RuleID. + +DEFINE TEMP-TABLE tt_output NO-UNDO + FIELD progname AS CHARACTER FORMAT "x(15)":U + FIELD DlcVersion AS INTEGER FORMAT ">9":U + FIELD WindowSystem AS CHARACTER + FIELD description AS CHARACTER FORMAT "x(80)":U + FIELD required AS LOGICAL FORMAT "yes/no":U INITIAL NO + INDEX idx_progname AS PRIMARY UNIQUE progname. + +DEFINE TEMP-TABLE tt_category NO-UNDO + FIELD catname AS CHARACTER + FIELD hframe AS HANDLE + FIELD hText AS HANDLE + FIELD numrules AS INTEGER. + +DEFINE VARIABLE categorytext AS CHARACTER NO-UNDO INITIAL "selected: &1 out of &2":T. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK + +/* ******************** Preprocessor Definitions ******************** */ + +&Scoped-define PROCEDURE-TYPE Window +&Scoped-define DB-AWARE no + +/* Name of first Frame and/or Browse and/or first Query */ +&Scoped-define FRAME-NAME DEFAULT-FRAME +&Scoped-define BROWSE-NAME brw_output + +/* Internal Tables (found by Frame, Query & Browse Queries) */ +&Scoped-define INTERNAL-TABLES tt_output + +/* Definitions for BROWSE brw_output */ +&Scoped-define FIELDS-IN-QUERY-brw_output tt_output.progname tt_output.required tt_output.description +&Scoped-define ENABLED-FIELDS-IN-QUERY-brw_output tt_output.required +&Scoped-define ENABLED-TABLES-IN-QUERY-brw_output tt_output +&Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-brw_output tt_output +&Scoped-define SELF-NAME brw_output +&Scoped-define QUERY-STRING-brw_output FOR EACH tt_output +&Scoped-define OPEN-QUERY-brw_output OPEN QUERY {&SELF-NAME} FOR EACH tt_output. +&Scoped-define TABLES-IN-QUERY-brw_output tt_output +&Scoped-define FIRST-TABLE-IN-QUERY-brw_output tt_output + + +/* Definitions for FRAME DEFAULT-FRAME */ +&Scoped-define OPEN-BROWSERS-IN-QUERY-DEFAULT-FRAME ~ + ~{&OPEN-QUERY-brw_output} + +/* Standard List Definitions */ +&Scoped-Define ENABLED-OBJECTS btn_help btn_localdel cb-profiles brw_output ~ +btn_localcopy btn_new btn_shareddel ed_where +&Scoped-Define DISPLAYED-OBJECTS cb-profiles ed_where + +/* Custom List Definitions */ +/* List-1,List-2,List-3,List-4,List-5,List-6 */ + +/* _UIB-PREPROCESSOR-BLOCK-END */ +&ANALYZE-RESUME + + + +/* *********************** Control Definitions ********************** */ + +/* Define the widget handle for the window */ +DEFINE VAR C-Win AS WIDGET-HANDLE NO-UNDO. + +/* Definitions of the field level widgets */ +DEFINE BUTTON btn_help + LABEL "Help":T + SIZE 12 BY 1.14 TOOLTIP "Help". + +DEFINE BUTTON btn_localcopy + IMAGE-UP FILE "prolint/images/mklocal.bmp":U + IMAGE-INSENSITIVE FILE "prolint/images/mklocali.bmp":U NO-FOCUS + LABEL "Local Copy" + SIZE 12 BY 1.14 TOOLTIP "Make a local copy of this shared profile". + +DEFINE BUTTON btn_localdel + IMAGE-UP FILE "prolint/images/dellocal.bmp":U + IMAGE-INSENSITIVE FILE "prolint/images/dellocali.bmp":U NO-FOCUS + LABEL "Delete Local" + SIZE 12 BY 1.14 TOOLTIP "Delete this local profile (and maybe revert to shared profile)". + +DEFINE BUTTON btn_new + IMAGE-UP FILE "prolint/images/new.bmp":U NO-FOCUS + LABEL "New..." + SIZE 12 BY 1.14 TOOLTIP "Create a new profile". + +DEFINE BUTTON btn_shareddel + IMAGE-UP FILE "prolint/images/delshared.bmp":U + IMAGE-INSENSITIVE FILE "prolint/images/delsharedi.bmp":U NO-FOCUS + LABEL "Delete Shared" + SIZE 12 BY 1.14 TOOLTIP "Delete this shared profile". + +DEFINE VARIABLE cb-profiles AS CHARACTER FORMAT "X(256)":U INITIAL "<none>" + LABEL "Profile":T + VIEW-AS COMBO-BOX SORT INNER-LINES 10 + LIST-ITEMS "<none>" + DROP-DOWN-LIST + SIZE 41 BY 1 NO-UNDO. + +DEFINE VARIABLE ed_where AS CHARACTER FORMAT "X(256)":U + VIEW-AS TEXT + SIZE 61 BY .62 NO-UNDO. + +/* Query definitions */ +&ANALYZE-SUSPEND +DEFINE QUERY brw_output FOR + tt_output SCROLLING. +&ANALYZE-RESUME + +/* Browse definitions */ +DEFINE BROWSE brw_output +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS brw_output C-Win _FREEFORM + QUERY brw_output DISPLAY + tt_output.progname FORMAT "x(15)":U WIDTH-CHARS 15 + tt_output.required FORMAT "yes/no":U + tt_output.description FORMAT "x(80)":U LABEL "description" + +enable tt_output.required +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + WITH NO-ROW-MARKERS SEPARATORS SIZE 109 BY 5.24. + + +/* ************************ Frame Definitions *********************** */ + +DEFINE FRAME DEFAULT-FRAME + btn_help AT ROW 1 COL 50 + btn_localdel AT ROW 1 COL 26 + cb-profiles AT ROW 2.67 COL 8 COLON-ALIGNED + brw_output AT ROW 5.29 COL 3 + btn_localcopy AT ROW 1 COL 14 + btn_new AT ROW 1 COL 2 + btn_shareddel AT ROW 1 COL 38 + ed_where AT ROW 2.91 COL 50 COLON-ALIGNED NO-LABEL + "Select 1 or more outputhandlers:":T VIEW-AS TEXT + SIZE 32 BY .62 AT ROW 4.43 COL 3 + "Select which rules you want to run, by category:":T VIEW-AS TEXT + SIZE 51 BY .62 AT ROW 11.38 COL 3 + WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY + SIDE-LABELS NO-UNDERLINE THREE-D + AT COL 1 ROW 1 + SIZE 113.6 BY 22. + +DEFINE FRAME FRAME-categories + WITH 1 DOWN KEEP-TAB-ORDER OVERLAY + THREE-D + AT COL 3 ROW 12.24 + SCROLLABLE SIZE 109 BY 14.05 + BGCOLOR 15 . + + +/* *********************** Procedure Settings ************************ */ + +&ANALYZE-SUSPEND _PROCEDURE-SETTINGS +/* Settings for THIS-PROCEDURE + Type: Window + Allow: Basic,Browse,DB-Fields,Window,Query + Other Settings: COMPILE + */ +&ANALYZE-RESUME _END-PROCEDURE-SETTINGS + +/* ************************* Create Window ************************** */ + +&ANALYZE-SUSPEND _CREATE-WINDOW +IF SESSION:DISPLAY-TYPE = "GUI":U THEN + CREATE WINDOW C-Win ASSIGN + HIDDEN = YES + TITLE = "Prolint Profile configuration" + HEIGHT = 22 + WIDTH = 113.6 + MAX-HEIGHT = 25.1 + MAX-WIDTH = 120 + VIRTUAL-HEIGHT = 25.1 + VIRTUAL-WIDTH = 120 + RESIZE = yes + SCROLL-BARS = no + STATUS-AREA = no + BGCOLOR = ? + FGCOLOR = ? + KEEP-FRAME-Z-ORDER = yes + THREE-D = yes + MESSAGE-AREA = no + SENSITIVE = yes. +ELSE {&WINDOW-NAME} = CURRENT-WINDOW. +/* END WINDOW DEFINITION */ +&ANALYZE-RESUME + + + +/* *********** Runtime Attributes and AppBuilder Settings *********** */ + +&ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES +/* SETTINGS FOR WINDOW C-Win + VISIBLE,,RUN-PERSISTENT */ +/* REPARENT FRAME */ +ASSIGN FRAME FRAME-categories:FRAME = FRAME DEFAULT-FRAME:HANDLE. + +/* SETTINGS FOR FRAME DEFAULT-FRAME + */ +/* BROWSE-TAB brw_output cb-profiles DEFAULT-FRAME */ +/* SETTINGS FOR FRAME FRAME-categories + UNDERLINE */ +ASSIGN + FRAME FRAME-categories:HEIGHT = 10.19 + FRAME FRAME-categories:WIDTH = 109. + +IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(C-Win) +THEN C-Win:HIDDEN = no. + +/* _RUN-TIME-ATTRIBUTES-END */ +&ANALYZE-RESUME + + +/* Setting information for Queries and Browse Widgets fields */ + +&ANALYZE-SUSPEND _QUERY-BLOCK BROWSE brw_output +/* Query rebuild information for BROWSE brw_output + _START_FREEFORM +OPEN QUERY {&SELF-NAME} FOR EACH tt_output. + _END_FREEFORM + _Query is OPENED +*/ /* BROWSE brw_output */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _QUERY-BLOCK FRAME FRAME-categories +/* Query rebuild information for FRAME FRAME-categories + _Query is NOT OPENED +*/ /* FRAME FRAME-categories */ +&ANALYZE-RESUME + + + + + +/* ************************ Control Triggers ************************ */ + +&Scoped-define SELF-NAME C-Win +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL C-Win C-Win +ON END-ERROR OF C-Win /* Prolint Profile configuration */ +OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO: + /* This case occurs when the user presses the "Esc" key. + In a persistently run window, just ignore this. If we did not, the + application would exit. */ + IF THIS-PROCEDURE:PERSISTENT THEN RETURN NO-APPLY. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL C-Win C-Win +ON WINDOW-CLOSE OF C-Win /* Prolint Profile configuration */ +DO: + /* This event will close the window and terminate the procedure. */ + APPLY "ENTRY":U TO cb-profiles IN FRAME {&FRAME-NAME}. + RUN SaveProfile (CurrentProfile). + APPLY "CLOSE":U TO THIS-PROCEDURE. + RETURN NO-APPLY. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME btn_help +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_help C-Win +ON CHOOSE OF btn_help IN FRAME DEFAULT-FRAME /* Help */ +DO: + + FILE-INFO:FILE-NAME = "prolint/help/lintcfg.htm":U. + {&_proparse_ prolint-nowarn(message)} + IF FILE-INFO:FULL-PATHNAME<>? THEN + RUN prolint/core/openhtml.p (FILE-INFO:FULL-PATHNAME). + ELSE + MESSAGE "no help found for lintcfg.w":T VIEW-AS ALERT-BOX. + + +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME btn_localcopy +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_localcopy C-Win +ON CHOOSE OF btn_localcopy IN FRAME DEFAULT-FRAME /* Local Copy */ +DO: + DEFINE VARIABLE targetdir AS CHARACTER NO-UNDO. + DEFINE VARIABLE basename AS CHARACTER NO-UNDO. + DEFINE VARIABLE fullpath AS CHARACTER NO-UNDO. + DEFINE VARIABLE attribs AS CHARACTER NO-UNDO. + + ASSIGN cb-profiles. + + IF cb-profiles=? OR cb-profiles="" OR cb-profiles="<none>":U THEN + RETURN NO-APPLY. + + targetdir = PrivateDir + "/":U + cb-profiles. + FILE-INFO:FILE-NAME = targetdir. + IF FILE-INFO:FULL-PATHNAME = ? THEN DO: + OS-CREATE-DIR VALUE(targetdir). + + FILE-INFO:FILE-NAME = SharedDir + "/":U + cb-profiles. + IF FILE-INFO:FULL-PATHNAME<>? THEN DO: + INPUT FROM OS-DIR (FILE-INFO:FULL-PATHNAME). + REPEAT: + IMPORT basename fullpath attribs. + IF NOT (attribs MATCHES "*D*":U OR basename=".":U OR basename="..":U) THEN + OS-COPY VALUE(fullpath) VALUE(targetdir). + END. + INPUT CLOSE. + END. + + + + RUN ImportCustomData. + END. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME btn_localdel +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_localdel C-Win +ON CHOOSE OF btn_localdel IN FRAME DEFAULT-FRAME /* Delete Local */ +DO: + ASSIGN cb-profiles. + + IF cb-profiles=? OR cb-profiles="" OR cb-profiles="<none>":U THEN + RETURN NO-APPLY. + + FILE-INFO:FILE-NAME = "local-prolint/settings/" + cb-profiles. + IF FILE-INFO:FULL-PATHNAME <> ? THEN DO: + OS-DELETE VALUE(FILE-INFO:FULL-PATHNAME) RECURSIVE. + cb-profiles:LIST-ITEMS = "<none>":U. + RUN GetProfiles. + cb-profiles:SCREEN-VALUE = "<none>":U. + CurrentProfile = "<none>":U. + APPLY "value-changed":U TO cb-profiles. + END. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME btn_new +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_new C-Win +ON CHOOSE OF btn_new IN FRAME DEFAULT-FRAME /* New... */ +DO: + DEFINE VARIABLE newprofile AS CHARACTER NO-UNDO. + + RUN prolint/core/dnewprofile.w (OUTPUT newprofile). + IF newprofile <> ? THEN DO: + RUN SaveProfile(CurrentProfile). + cb-profiles:LIST-ITEMS = cb-profiles:LIST-ITEMS + ",":U + newprofile. + cb-profiles:SCREEN-VALUE = newprofile. + APPLY "value-changed":U TO cb-profiles. + END. + + +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME btn_shareddel +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_shareddel C-Win +ON CHOOSE OF btn_shareddel IN FRAME DEFAULT-FRAME /* Delete Shared */ +DO: + ASSIGN cb-profiles. + + IF cb-profiles=? OR cb-profiles="" OR cb-profiles="<none>":U THEN + RETURN NO-APPLY. + + FILE-INFO:FILE-NAME = "prolint/settings/" + cb-profiles. + IF FILE-INFO:FULL-PATHNAME <> ? THEN DO: + OS-DELETE VALUE(FILE-INFO:FULL-PATHNAME) RECURSIVE. + cb-profiles:LIST-ITEMS = "<none>":U. + RUN GetProfiles. + cb-profiles:SCREEN-VALUE = "<none>":U. + CurrentProfile = "<none>":U. + APPLY "value-changed":U TO cb-profiles. + END. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define SELF-NAME cb-profiles +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cb-profiles C-Win +ON VALUE-CHANGED OF cb-profiles IN FRAME DEFAULT-FRAME /* Profile */ +DO: + ASSIGN cb-profiles. + IF cb-profiles <> CurrentProfile THEN + RUN SaveProfile(CurrentProfile). + CurrentProfile = cb-profiles. + RUN ImportCustomData. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&Scoped-define BROWSE-NAME brw_output +&UNDEFINE SELF-NAME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK C-Win + + +/* *************************** Main Block *************************** */ + +/* Set CURRENT-WINDOW: this will parent dialog-boxes and frames. */ +ASSIGN CURRENT-WINDOW = {&WINDOW-NAME} + THIS-PROCEDURE:CURRENT-WINDOW = {&WINDOW-NAME}. + +/* The CLOSE event can be used from inside or outside the procedure to */ +/* terminate it. */ +ON CLOSE OF THIS-PROCEDURE + RUN disable_UI. + +/* Best default for GUI applications is... */ +PAUSE 0 BEFORE-HIDE. + +/* Now enable the interface and wait for the exit condition. */ +/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */ +MAIN-BLOCK: +DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK + ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK: + + RUN GetDirectories. + RUN ImportDefaultData. + RUN enable_UI. + RUN GetProfiles. + RUN CreateCategories. + RUN DisplayCategoryUsage. + APPLY "entry":U TO cb-profiles. + + IF NOT THIS-PROCEDURE:PERSISTENT THEN + WAIT-FOR CLOSE OF THIS-PROCEDURE. +END. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +/* ********************** Internal Procedures *********************** */ + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE CreateCategories C-Win +PROCEDURE CreateCategories : +/*------------------------------------------------------------------------------ + Purpose: Make a list of categories. + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + + FOR EACH tt_rules : + FIND tt_category WHERE tt_category.catname = tt_rules.category NO-ERROR. + IF NOT AVAILABLE tt_category THEN DO: + CREATE tt_category. + ASSIGN tt_category.catname = tt_rules.category. + END. + ASSIGN tt_category.numrules = tt_category.numrules + 1. + END. + + RUN CreateCategoryFrames. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE CreateCategoryFrames C-Win +PROCEDURE CreateCategoryFrames : +/*------------------------------------------------------------------------------ + Purpose: Create a "browse" where each row is in fact a frame, + representing a category + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + + DEFINE VARIABLE frameheight AS INTEGER NO-UNDO INITIAL 25. + DEFINE VARIABLE NextY AS INTEGER NO-UNDO. + DEFINE VARIABLE hwidget AS HANDLE NO-UNDO. + DEFINE VARIABLE parentheight AS INTEGER NO-UNDO. + + parentheight = FRAME frame-categories:HEIGHT-PIXELS. + + FOR EACH tt_category BY tt_category.catname : + CREATE FRAME tt_category.hframe + ASSIGN + PARENT = FRAME frame-categories:FIRST-CHILD + X = 0 + Y = NextY + HEIGHT-PIXELS = frameheight + WIDTH-PIXELS = FRAME frame-categories:WIDTH-PIXELS + THREE-D = TRUE + BGCOLOR = FRAME frame-categories:BGCOLOR + FGCOLOR = FRAME frame-categories:FGCOLOR + BOX = NO + VISIBLE = YES. + + CREATE RECTANGLE hwidget + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 0 + Y = frameheight - 1 + HEIGHT-PIXELS = 1 + WIDTH-PIXELS = tt_category.hframe:WIDTH-PIXELS + FGCOLOR = 8 + VISIBLE = YES. + + NextY = NextY + frameheight. + + CREATE TEXT hwidget + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 10 + Y = 3 + WIDTH-PIXELS = 150 + HEIGHT-PIXELS = 20 + FORMAT = "x(256)" + SCREEN-VALUE = tt_category.catname + /* FONT = 6 */ + VISIBLE = YES. + + CREATE BUTTON hwidget + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 170 + Y = 3 + WIDTH-PIXELS = 50 + HEIGHT-PIXELS = 20 + LABEL = "All" + VISIBLE = YES + SENSITIVE = YES + TRIGGERS: + ON "CHOOSE":U PERSISTENT RUN SelectCategoryAll IN THIS-PROCEDURE (tt_category.catname). + END TRIGGERS. + + CREATE BUTTON hwidget + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 230 + Y = 3 + WIDTH-PIXELS = 50 + HEIGHT-PIXELS = 20 + LABEL = "None" + VISIBLE = YES + SENSITIVE = YES + TRIGGERS: + ON "CHOOSE":U PERSISTENT RUN SelectCategoryNone IN THIS-PROCEDURE (tt_category.catname). + END TRIGGERS. + + CREATE BUTTON hwidget + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 290 + Y = 3 + WIDTH-PIXELS = 50 + HEIGHT-PIXELS = 20 + LABEL = "Some..." + VISIBLE = YES + SENSITIVE = YES + TRIGGERS: + ON "CHOOSE":U PERSISTENT RUN SelectCategorySome IN THIS-PROCEDURE (tt_category.catname). + END TRIGGERS. + + CREATE TEXT tt_Category.hText + ASSIGN + PARENT = tt_category.hframe:FIRST-CHILD + X = 370 + Y = 3 + WIDTH-PIXELS = 150 + HEIGHT-PIXELS = 20 + FORMAT = "x(256)" + SCREEN-VALUE = "" + VISIBLE = YES. + + END. + + FRAME frame-categories:VIRTUAL-HEIGHT-PIXELS = NextY. + FRAME frame-categories:HEIGHT-PIXELS = parentheight. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI C-Win _DEFAULT-DISABLE +PROCEDURE disable_UI : +/*------------------------------------------------------------------------------ + Purpose: DISABLE the User Interface + Parameters: <none> + Notes: Here we clean-up the user-interface by deleting + dynamic widgets we have created and/or hide + frames. This procedure is usually called when + we are ready to "clean-up" after running. +------------------------------------------------------------------------------*/ + /* Delete the WINDOW we created */ + IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(C-Win) + THEN DELETE WIDGET C-Win. + IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE DisplayCategoryUsage C-Win +PROCEDURE DisplayCategoryUsage : +/*------------------------------------------------------------------------------ + Purpose: Display how many rules are selected, by category + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + DEFINE VARIABLE numselected AS INTEGER NO-UNDO. + + FOR EACH tt_category : + numselected = 0. + FOR EACH tt_rules WHERE tt_rules.category = tt_category.catname + AND tt_rules.required = TRUE: + numselected = numselected + 1. + END. + tt_category.hText:SCREEN-VALUE = SUBSTITUTE(categorytext, numselected, tt_category.numrules). + END. + + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI C-Win _DEFAULT-ENABLE +PROCEDURE enable_UI : +/*------------------------------------------------------------------------------ + Purpose: ENABLE the User Interface + Parameters: <none> + Notes: Here we display/view/enable the widgets in the + user-interface. In addition, OPEN all queries + associated with each FRAME and BROWSE. + These statements here are based on the "Other + Settings" section of the widget Property Sheets. +------------------------------------------------------------------------------*/ + DISPLAY cb-profiles ed_where + WITH FRAME DEFAULT-FRAME IN WINDOW C-Win. + ENABLE btn_help btn_localdel cb-profiles brw_output btn_localcopy btn_new + btn_shareddel ed_where + WITH FRAME DEFAULT-FRAME IN WINDOW C-Win. + {&OPEN-BROWSERS-IN-QUERY-DEFAULT-FRAME} + VIEW FRAME FRAME-categories IN WINDOW C-Win. + {&OPEN-BROWSERS-IN-QUERY-FRAME-categories} + VIEW C-Win. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE GetDirectories C-Win +PROCEDURE GetDirectories : +/*------------------------------------------------------------------------------ + Purpose: +---... [truncated message content] |