Global Mapper Pro

Syntax Highlighting Schema

kbellis
kbellis Global Mapper UserTrusted User
edited October 2013 in GM Script Language
I know how anal this sounds (but that's never slowed me down much ;) - is there a preferred schema for highlighting *.gms files ?

The reason for such a question? I'm setting up TextPad, Document Class: Global Mapper; class members (so far) *.gms and *.gmw and thought first of using the same syntax highlighting as for c but then began wondering if this *.gms-highlighting-color wheel had already been invented :)

Any thought(s)?

Thank you very much.

Kelly

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2013
    Kelly,

    No highlighting wheel here! Perhaps when in-place editing of the scripts is added to the Run Script dialog something could be done where it automatically recognizes known commands and parameter names and highlights them, but that would be quite an enhancement!

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • Geo
    Geo Global Mapper User Trusted User
    edited October 2013
    SyntaxHighlighter vB 4.X with a custom "Global Mapper brush" would be also a great enhancement!

    My favorite source code editor is Notepad++ which also support User Defined Syntax Highlighting and Folding. (screenshot 1, screenshot 2, screenshot 3 and screenshot 4). more help at udl20.weebly.com.

    I don't have (yet) any Syntax Highlighting to share but Global Mapper Scripting Reference is a good place to start gathering keywords, operators and parameters.
  • global_mapper
    global_mapper Administrator
    edited October 2013
    If it helps here is a list of the command names and the parameter names if you can easily put those in the custom highlighter:


    // Command names
    ADD_MEASURE_ATTRS
    APPLY_FORMULA
    ASSIGN_TYPE
    CALC_ATTR
    COMBINE_LINES
    COMBINE_TERRAIN
    COPY_ATTRS
    COPY_LAYER_FILES
    DEFINE_COAST
    DEFINE_LAYER_STYLE
    DEFINE_PALETTE
    DEFINE_PROJ
    DEFINE_SHADER
    DEFINE_SHAPE
    DEFINE_VAR
    DEFINE_VAR_TABLE
    DIR_LOOP_END
    DIR_LOOP_START
    EDIT_MAP_CATALOG
    EDIT_VECTOR
    EMBED_OVERLAY
    EMBED_SCRIPT
    EXPORT_ELEVATION
    EXPORT_METADATA
    EXPORT_PACKAGE
    EXPORT_PDF
    EXPORT_RASTER
    EXPORT_VECTOR
    FORCE_EXIT
    GENERATE_CONTOURS
    GENERATE_ELEV_GRID
    GENERATE_EQUAL_VAL_AREA
    GENERATE_LAYER_BOUNDS
    GENERATE_PATH_PROFILE
    GENERATE_REPORT
    GENERATE_WATERSHED
    GET_COLOR_PROFILE
    IMPORT
    IMPORT_ARCHIVE
    IMPORT_ASCII
    IMPORT_DIGITALGLOBE
    IMPORT_DIR_TREE
    IMPORT_IMAGEBUILDER
    IMPORT_INTERMAP
    IMPORT_OSM_TILE
    IMPORT_SPATIAL_DB
    IMPORT_TERRASERVER
    IMPORT_WMS
    JOIN_TABLE
    LAYER_LOOP_END
    LAYER_LOOP_START
    LOAD_PROJECTION
    LOAD_STYLE_FILE
    LOAD_TYPE_FILTER
    LOG_MESSAGE
    MAP_LAYOUT
    MODIFY_OVERLAY
    PLAY_SOUND
    RESTORE_LAST_SAVED_VIEW
    RUN_COMMAND
    SAVE_CURRENT_VIEW
    SAVE_PROJECTION
    GLOBAL_MAPPER_SCRIPT
    SET_BG_COLOR
    SET_LAYER_OPTIONS
    SET_LOG_FILE
    SET_VERT_DISP_OPTS
    SET_VIEW
    SHOW_3D_VIEW
    SORT_LAYERS
    SPLIT_LAYER
    START_VIEW_DEF
    UNLOAD_ALL
    UNLOAD_LAYER
    VAR_LOOP_END
    VAR_LOOP_START


    // Parameter names
    ABORT_ON_CANCEL
    ADD_BLANK_LINE
    ADD_COORD_ATTRS
    ADD_FILE
    ADD_LAND_USE_CODES
    ADD_LAT_LON
    ADD_LIDAR_STATS
    ADD_OVERVIEW_LAYERS
    ADD_UNKNOWN_TYPES
    ADDRESS
    ALLOW_COMMA_DECIMAL
    ALLOW_DUPLICATES
    ALLOW_LONG_LABELS
    ALLOW_LOSSY
    ALLOW_SELECTION
    AMBIENT_LIGHT_LEVEL
    ANTI_ALIAS
    APPEND_TO_FILE
    ARCHIVE_FILENAME
    AREA_COVERAGE
    AREA_STYLE_NAME
    AREA_TYPE
    ATTR_NAME
    ATTR_REPLACE_STR
    ATTR_TO_COPY
    ATTR_TO_DELETE
    ATTR_TO_KEEP
    ATTR_TO_RENAME
    ATTR_VAL
    AUTO_CONTRAST
    BG_TRANSPARENT
    BAND_BIT_DEPTH
    BAND_EXPORT_SETUP
    BAND_SETUP
    BASE_DIR
    BLEND_COLORS
    BLEND_MODE
    BLOCK_SIZE
    BREAK_COL_IDX
    BREAK_COL_PEN_UP
    BUFFER_ATTR
    BUFFER_ATTR_UNITS
    BUFFER_COMBINE_AREAS
    BUFFER_CREATE_RECTS
    BUFFER_DIST
    BUFFER_Z_OFFSET
    BUFFER_ZONES
    BYTES_PER_SAMPLE
    CASE_SENSITIVE
    CDF_MAJOR_CODE
    CDF_MINOR_CODE
    CDF_USE_DEFAULT_CODE
    CENTER_LABEL
    CENTER_LABEL_POS
    CHART_EDITION_DATE
    CHART_NAME
    CHART_NUMBER
    CHART_SCALE
    CLAMP_ELEVS
    CLIP_COLLAR
    CLIP_COLLAR_BOUNDS
    CLIP_COLLAR_FLAGS
    CLIP_COLLAR_POLY
    CLIP_COLLAR_POLY_AUTO
    CLIP_COLLAR_POLY_PIXEL
    CLOSED_LINES_ONLY
    COL_HEADERS
    COLOR
    COLOR_DIST
    COLOR_GRADE
    COLOR_INTENSITY
    COLOR_INTENSITY_FULL
    COLOR_SCALE
    COMBINE_OP
    COMBINE_VECTOR_LAYERS
    COMMAND_LINE
    COMPARE_NUM
    COMPARE_OP
    COMPARE_STR
    COMPARE_VAL
    COMPATIBLE_ONLY
    COMPRESSION
    COMPRESS_OUTPUT
    CONNECT_ISLANDS
    MULT_MAJOR
    MULT_MINOR
    CREATE_BINARY
    CREATE_ON_WAY_DOWN
    INTERVAL
    SINGLE_LEVEL_ONLY
    CONTRAST_MODE
    CONTRAST_SHARED
    CONTRAST_STRETCH_SIZE
    CONVERT_AREAS_TO_LINES
    COORD_DELIM
    COORD_FORMAT
    COORD_OFFSET
    COORD_ORDER
    COORD_PREFIX
    COORD_SCALE
    COVERAGE_SMOOTHING_FACTOR
    CREATE_AREAS_FROM_LINES
    CREATE_COVERAGE_AREAS
    CREATE_IF_EMPTY
    CREATE_LABEL_POINTS
    CREATE_MULTIPLE_AREAS
    DATA_SIZE
    DAYLIGHT_SHADER_COLOR
    DELETE_DUPLICATES
    DELETE_FEATURES
    DGN_GLOBAL_ORIGIN_LL
    DGN_REPLACE_DARK_COLORS
    DGN_UNIT_RESOLUTION
    DIRECTORY
    DISABLE_BIGTIFF
    DISCARD_ATTRIBUTES
    DISCARD_EMPTY_ATTRS
    DPI
    DRAW_USING_TILES
    DTED_LEVEL
    DTED_PRODUCER_CODE
    DTED_SECURITY_CLASS
    DUPLICATE_ATTR
    DWG_TEXT_SIZE
    DXF_TEXT_SIZE
    ELEV_DIST
    ELEV_FIELD
    ELEV_FIELD_IS_DEPTH
    ELEV_OFFSET
    ELEV_POWER
    ELEV_SCALE
    ELEV_UNITS
    ENABLE_HILL_SHADING
    ENABLE_PROGRESS
    ENABLE_WATER
    ENCLOSED_ONLY
    END_POS
    EQUAL_COLORS
    EXPORT_AREAS
    EXPORT_ATTRS
    EXPORT_COLORS
    EXPORT_DWG_LABELS
    EXPORT_DXF_LABELS
    EXPORT_ECEF
    EXPORT_ELEV
    EXPORT_HEADER
    EXPORT_MEASURES
    EXPORT_ROW_MAJOR
    EXPORT_SCALE
    EXPORT_SLOPE
    EXPORT_SLOPE_DIR
    EXPORT_SLOPE_PERCENT
    FEATHER_BLEND_EDGES
    FEATHER_BLEND_POLY
    FEATHER_BLEND_POLY_FILE
    FEATHER_BLEND_SIZE
    FEATURE_SEP
    FILE_DELIM
    FILENAME
    FILENAME_ATTR
    FILENAME_ATTR_LIST
    FILENAME_INCLUDE_ATTR_NAME
    FILENAME_MASKS
    FILE_SOURCE_ID
    FILLED_DEM_FILENAME
    FILL_GAPS
    FILTER_TYPE
    FIX_INVALID
    FLIGHT_DATE
    FLOW_TO_POS
    FLOW_TO_POS_PROJ
    FLOW_TO_POS_THRESH
    FORCE_RGB
    FORCE_SQUARE_PIXELS
    FORMAT
    FORMULA
    FROM_TYPE
    GCP
    GCP_FILENAME
    GCP_PROJ_EPSG_CODE
    GCP_PROJ_FILENAME
    GCP_PROJ_NAME
    GEN_AREAS
    GEN_AUX_XML_FILE
    GEN_3D_FEATURES
    GEN_3D_LINES
    GEN_ERS_FILE
    GEN_HEIGHT_AREAS
    GEN_MULTI_PATCH
    GEN_OZI_MAP_FILE
    GEN_PRJ_FILE
    GEN_SOFTWARE
    GEN_SPOT_ELEVATIONS
    GEN_TAB_FILE
    GEN_WORLD_FILE
    GLOBAL_BOUNDS
    GLOBAL_BOUNDS_SIZE
    GLOBAL_ENCODING
    GRID_ALG
    GRID_BIN_SIZE
    GRID_CREATE_FOLDERS
    GRID_FILL_TO_BOUNDS
    GRID_FLATTEN_AREAS
    GRID_HEIGHTS_RELATIVE
    GRID_IGNORE_ZERO
    GRID_KEEP_CELL_SIZE
    GRID_NAMING
    GRID_NAMING_COLS
    GRID_NAMING_PREPEND_ZEROES
    GRID_NAMING_ROWS
    GRID_NAMING_SEPARATOR
    GRID_OVERLAP
    GRID_SAVE_TIN
    GRID_TYPE_CELL_SIZE
    GRID_TYPE_PIXEL_SIZE
    GRID_TYPE_PIXEL_SIZE_MAX
    GRID_TYPE_ROWS_COLS
    GRID_USE_CONSTRAINTS
    HIDDEN
    IGNORE_ALPHA
    IGNORE_ATTRS
    IGNORE_ISLANDS
    IGNORE_WHITESPACE
    IMAGEBUILDER_CLIENT_ID
    IMAGEBUILDER_CUSTOM_SIZE
    IMAGEBUILDER_LAYER_NAME
    IMAGEBUILDER_SOURCE_LIST
    IMAGEBUILDER_USE_WATERMARKED
    IMAGEBUILDER_VECTOR_LAYERS
    INC_COLOR
    INC_COORD_LINE_ATTRS
    INC_ELEV_ATTR
    INC_ELEV_COORDS
    INC_LAYER_ATTR
    INC_MAP_NAME_ATTR
    INC_STYLE_ATTRS
    INC_UNIT_SUFFIX
    INC_VECTOR_DATA
    INSERT_VERTICES_AT_INTERSECTIONS
    JOIN_FILE_ATTR_NAME
    JOIN_LAYER_ATTR_NAME
    KEEP_ALL_STYLES
    KEEP_NATIVE_PROJECTION
    KEEP_ZERO_AT_ZERO
    KML_AREA_DISPLAY_ABOVE_TERRAIN
    KML_AREA_ELEVS_RELATIVE
    KML_AREA_EXTRUDE
    KML_AREA_FAKE_HEIGHTS
    KML_AREA_TRANSLUCENCY
    KML_CHOP_FILLED_AREAS
    KML_SUPER_OVERLAY
    KML_FADE_EXTENT_MAX
    KML_FADE_EXTENT_MIN
    KML_FOLDER_ATTR
    KML_HTML_DESC_TEXT
    KML_LINE_DISPLAY_ABOVE_TERRAIN
    KML_LINE_ELEVS_RELATIVE
    KML_MAX_LOD_PIXELS
    KML_MIN_LOD_PIXELS
    KML_POINT_DISPLAY_ABOVE_TERRAIN
    KML_POINT_ELEVS_RELATIVE
    KML_POINT_EXTRUDE
    KML_RASTER_FORMAT
    KML_TILE_SIZE
    KML_ZOOM_SCALE_FACTOR
    LABEL_CUSTOM_DEF
    LABEL_FIELD
    LABEL_FIELD_FORCE_OVERWRITE
    LABEL_FIELD_SEP
    LABEL_PREFIX
    LABEL_SUFFIX
    LAS_VERSION
    LAT_LON_BOUNDS
    LAYER_BOUNDS
    LAYER_BOUNDS_EXPAND
    LAYER_DESC
    LAYER_GROUP
    LAYER_NAME
    LAYER1_FILENAME
    LAYER2_FILENAME
    LIDAR_BRIGHTNESS
    LIDAR_CLASS
    LIDAR_DRAW_MODE
    LIDAR_DRAW_MODE_GLOBAL
    LIDAR_DRAW_QUALITY
    LIDAR_POINT_SIZE
    LIGHT_ALTITUDE
    LIGHT_AZIMUTH
    LINE_STYLE_NAME
    LINE_TYPE
    LOAD_FLAGS
    MAKE_FNAME_LOWER
    MAP_NAME
    MAP_ORDER
    MARK_DUPLICATES
    MAX_DEPTH
    MAX_DIST
    MAX_ELEV
    MAXIMIZE
    METADATA_FILENAME
    MIN_CONTOUR_LEN
    MIN_ELEV
    MIN_STREAM_LEN
    MODEL_PARMS_FILE
    MP_COPY_ENTIRE_TEMPLATE
    MP_EXPORT_TEMPLATE_FILES
    MP_IMAGE_ID
    MULTI_POINT
    NAME
    NEW_ATTR
    NITF_USE_DECIMAL
    NO_DATA_DIST_MULT
    NO_PROJ_HEADER
    NUM_BANDS
    ONLY_GENERATE_METADATA
    ON_OPEN_FILENAME
    OSM_BASE_URL
    OSM_DESC
    OSM_FILE_EXT
    OSM_IS_GOOGLE_MAPS
    OSM_IS_TMS
    OSM_NUM_ZOOM_LEVELS
    OUTPUT_BIT_DEPTH
    OUTPUT_FILENAME
    OUTPUT_GRID
    OVERWRITE_EXISTING
    PALETTE
    PALETTE_NAME
    PASSWORD
    PDF_COMBINE_RASTERS
    PDF_FILL_PAGE
    PDF_FONT_SCALE
    PDF_FOOTER
    PDF_HEADER
    PDF_MARGINS
    PDF_PAGE_ORIENTATION
    PDF_PAGE_SIZE
    PDF_SYMBOL_SCALE
    PIXEL_SIZE
    POINT_COUNT
    POINTS_ONLY
    POINT_SPACING
    POINT_STYLE_NAME
    POINT_TYPE
    POLYGON_CROP_BBOX_ONLY
    POLYGON_CROP_COMBINE_DUPS
    POLYGON_CROP_FILE
    POLYGON_CROP_FILE_PROJ
    POLYGON_CROP_FILENAME_SUFFIX
    POLYGON_CROP_FOLDER_ATTR
    POLYGON_CROP_NAME
    POLYGON_CROP_NAME_ATTR
    POLYGON_CROP_GRID_ONLY
    POLYGON_CROP_USE_ALL
    POLYGON_CROP_USE_EACH
    PRECISION
    PRODUCER_CODE
    PROJ
    PROJ_EPSG_CODE
    PROJ_FILENAME
    PROJ_NAME
    PROMPT
    PROMPT_IF_PROJ_UNKNOWN
    PROMPT_IF_TYPE_UNKNOWN
    PROMPT_TEXT
    PTS_AT_INTERSECTIONS
    QUAD_NAME
    QUALITY
    RADIUS
    RASTER_STATS
    RECTIFY
    RECTIFY_Y_IS_DOWN
    RECURSE_DIR
    REMOVE_MAP
    REPLACE_STR
    REPORT_ATTR
    RETURN_CODE
    REQUIRE_WORKSPACE
    REVERSE_COLS
    REVERSE_ROWS
    ROTATE_ABOUT
    ROTATE_ANGLE
    SAMPLING_METHOD
    SAVE_DIST_Z_FILE
    SAVE_GRID_LINES
    SAVE_HEIGHTS_ABOVE_GROUND
    SAVE_SCALE_AND_LEGEND
    SCALE
    SDB_CONNECTION_FILE
    SDB_CONNECTION_NAME
    SDB_SERVER
    SDB_PORT
    SDB_DATABASE_NAME
    SDB_USER_NAME
    SDB_PASSWORD
    SDB_SAVE_USER_AND_PASSWORD
    SDB_TABLE_NAME
    SDB_IMPORT_BOUNDS
    SECURITY_CLASS
    SECURITY_COUNTRY
    SECURITY_MARKING
    SEP_STR
    SERIES
    SHADE_DARKNESS
    SHADE_HIGHLIGHT
    SHADE_SLOPES
    SHADER_NAME
    SHAPE_NAME
    SHAPE_TYPE
    SHOW_FLOW_ACCUM
    SHOW_LABELS
    SHOW_WARNINGS
    SIMPLIFICATION
    SINGLE_PRECISION
    SKIP_COLUMNS
    SKIP_ROWS
    SKIP_UNLOAD_ALL
    SLOPE_DIST
    SMOOTH_CONTOURS
    SMOOTH_FEATURES
    SMOOTH_STREAMS
    SOURCE_ATTR
    SOURCE_DIR
    SPATIAL_RES
    SPATIAL_RES_METERS
    SPLIT_AT_INTERSECTIONS
    SPLIT_BY_ATTR
    SPLIT_BY_LAYER
    SPLIT_INTO_FOLDERS
    START_POS
    STREAM_THRESHOLD
    STRETCH_TO_RANGE
    SUBSET_IS_DUP
    SYSTEM_ID
    TARGET_COMPRESSION
    TARGET_DIR
    TEMPLATE_FILENAME
    TEXTURE_MAP
    THEME_NAME
    TIFF_COPYRIGHT
    TIFF_DATETIME
    TIFF_DOC_NAME
    TIFF_GT_CITATION
    TIFF_IMAGE_DESC
    TIFF_NO_GTIFF_HEADER
    TIFF_PCS_CITATION
    TILE_SIZE
    TIMINGS_FILENAME
    TO_TYPE
    TRANSFORM_FILENAME
    TRANSPARENT_COLOR
    TRANSPARENT_COLOR_DIST
    TRANSLUCENCY
    TYPE
    UNIQUE_ID_BASE
    URL
    USE_3D_DIST
    USE_8BIT_CLASSES
    USE_BAND4_AS_ALPHA
    USE_BIG_ENDIAN
    USE_COMMA_FOR_DECIMAL
    USE_ESRI_HDR
    USE_LZW
    USER_DATA
    USERNAME
    VAL_FORMAT
    VAL_START
    VAL_STEP
    VAL_STOP
    VALUE
    VALUE_ATTR
    VALUE_COLUMN
    VALUE_TABLE
    VAR_NAME
    VAR_NAME_PREFIX
    VECTOR_ONLY
    VERSION
    VERT_CITATION
    VERT_CS_CODE
    VERT_EXAG
    VOID_ELEV
    WAIT_FOR_COMPLETE
    WATER_ALPHA
    WATER_COLOR
    WATER_LEVEL
    WMS_IS_TILED
    WMS_LAYER
    WMS_MAX_ZOOM_RES
    WMS_REFRESH_TIME
    WMS_SERVER_URL
    WMS_SERVICE
    WMS_STYLE
    WMS_SUB_SOURCE_LIST
    WRITE_EMPTY_FRAMES
    ZOOM_DISPLAY

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2013
    Cool! It would be good to set this up for Notepad++ (and shouldn't be too hard). Anyone else already working on it?

    Nothing is case-sensitive in GM scripting, though--is that correct?

    (What a good idea of Kelly's.)
  • global_mapper
    global_mapper Administrator
    edited October 2013
    That's correct, the command names and parameters are case insensitive.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    c.zip <- Here's a start for languages which broadly conform to C syntax (and what I've just started using for coloring) ... or maybe we should just start from scratch?

    I see at least (2) Notepad++ users... and I'm guessing there's some gedit fans too. Now the question: can / is there be a .syn format to make everybody's life easier and more colorful?
    c.zip 11.3K
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    tjhb wrote: »
    Nothing is case-sensitive in GM scripting, though--is that correct?
    That's correct, the command names and parameters are case insensitive.

    I love the humor after this long day.
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    global_mapper.zip ,- Here's a first crack at it with Mike's keywords

    [Syntax] settings I left untouched (for now) from those for the TextPad c.syn

    Rules to play by:
    TextPad Syntax Definition Files

    Some rules, like for comments may be different in Global Mapper; here's what's in the boiler plate:
    [Syntax]
    Namespace1 = 6
    IgnoreCase = No
    KeyWordLength =
    BracketChars = {[()]}
    OperatorChars = -+*/<>!~%^&|=
    PreprocStart = #
    SyntaxStart =
    SyntaxEnd =
    HexPrefix = 0x
    CommentStart = /*
    CommentEnd = */
    CommentStartAlt =
    CommentEndAlt =
    SingleComment = //
    SingleCommentCol =
    SingleCommentAlt =
    SingleCommentColAlt =
    SingleCommentEsc =
    StringsSpanLines = Yes
    StringStart = "
    StringEnd = "
    StringAlt =
    StringEsc = \
    CharStart = '
    CharEnd = '
    CharEsc = \
    
    Oh - and this:
    
    [Preprocessor keywords]
    #define
    #elif
    #else
    #endif
    #error
    #if
    #ifdef
    #ifndef
    #include
    #pragma
    #undef
    defined
    
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    global_mapper syn Draft 01.PNG

    Still not sure that all the eye's have been crossed ;)
  • global_mapper
    global_mapper Administrator
    edited October 2013
    That looks very nice, I may have to grab Notepad++ and use that for my scripting from now on!

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    That's not Notepad++, it's TextPad and I've been using it for at least 20 years. It's awesome, very reasonably priced and very powerful. Regular Expressions are quite impressive (what little I've learned) and WildEdit takes them to an even higher level of service with great ease.

    BTW, those are the default colors which the user can frig around with should they have a hankerin ;)
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    Geo wrote: »
    SyntaxHighlighter vB 4.X with a custom "Global Mapper brush" would be also a great enhancement!

    My favorite source code editor is Notepad++ which also support User Defined Syntax Highlighting and Folding. (screenshot 1, screenshot 2, screenshot 3 and screenshot 4). more help at udl20.weebly.com.

    I don't have (yet) any Syntax Highlighting to share but Global Mapper Scripting Reference is a good place to start gathering keywords, operators and parameters.

    Geo - were you asking Paul to institute that brush here on the forum?
    If you were, here is a start at a brush, but it's buggy: Attachment not found.
    I've been staring at it for days but can't get the brush to be found; as a standalone install on my local system and in the WP install (with Mills' plugin) on my server. If you are anybody else find where I messed up - please holler!
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    Geo ... and anybody else who's interested,

    I've beat my head against the wall a few more times and got this to come out amongst the splatter: shBrushGlobalMapperScript.zip - a single missing apostrophe had been it's undoing :rolleyes:

    It works with SyntaxHighlighter 3.0.83 on the local machine... still haven't tamed it into the plugin on my WordPress site.
  • Geo
    Geo Global Mapper User Trusted User
    edited October 2013
    hello Kelly,

    I've tried to get calltips working for Notepad++

    306801.jpg
    (the screenshot is related to calltips in Notepad++)

    but Notepad++ doesn't support whitespace to detect a function opening.
    it has been requested, but not implemented: IdeaTorrent | notepad-plus: Idea #307: Use space for calltips - startFunc=" "
    it is possible to make it work with startFunc="(" and then delete all "(" in the .gms file.

    I've found another limitation for calltips:
    For any given function, all text, plus 2 bytes per parameter, plus 24 bytes if 2 overloads or more, can't spill over 2,043 bytes. (Autocompletion, aka API, files)
    it's not enough for all GM function and truncations occur for functions with a lot of options/parameters.
    4,096 bytes could be enough, the developper could raise the limit as he did in 2010: Calltip size restriction


    Functions, parameters and options autocompletion on input is working, Syntax Highlighting is ok.
    306799.jpg
    (the screenshot is related to autocompletion in Notepad++)


    I assigned a key combination to open the Script Reference page in GlobalMapperHelp.chm
    if a function is selected, the Script Reference page in GlobalMapperHelp.chm will open at the function description.


    I still have to "clean up" all that and it will be good.

    kbellis wrote: »
    Geo - were you asking Paul to institute that brush here on the forum?
    yes, scripts would be much more readable with a syntaxhighlighter.

    kbellis wrote: »
    I've beat my head against the wall a few more times and got this to come out amongst the splatter: shBrushGlobalMapperScript.zip - a single missing apostrophe had been it's undoing
    thank you for shBrushGlobalMapperScript.zip, I will look at how it works.
    kbellis wrote: »
    It works with SyntaxHighlighter 3.0.83 on the local machine... still haven't tamed it into the plugin on my WordPress site.
    installation on the forum will not be without difficulty either.
  • kbellis
    kbellis Global Mapper User Trusted User
    edited October 2013
    Notepad++ users may want to look into this:
    Turbo Integrator Syntax Highlighter (Notepad++) « TM1 Tutorials.com

    They may also want to look at TextPad ;) It's not free, but at $27 (US) it is still affordable. As a new student of regex, I'm finding out what I've missed all these years with my caveman cut-paste mentality.

    I'm at a loss on what calltips are and not much help, but if it means that the script reference will be easier to open, particularly if it knows applicable sections to open and zero in on (anchors?) then that sounds very useful.

    Geo, I think you're correct: The implementation of Alex Gorbatchev's SyntaxHighlighter on a vBulletin powered system (from that link you kindly provided above) sounds like it wasn't an easy fix as I read through that thread; however, vBulletin is listed on Alex's integration page so hope is not lost. And FWIW, I was unable to figure what the issue, or easily issues were on my WP installation; whether it was the javascript in the brush, the php registering it, declaring its variables, etc., but in order to get it to work (here's a first example), I had to clone a cpp brush and place it in the same folder with the stock set of brushes that comes with the plugin - far from ideal as it will be disappeared at upgrade time... but for now it will do I guess as support from Alex Mills (the writer for the WP plugin) has been null.
  • Geo
    Geo Global Mapper User Trusted User
    edited October 2013
    hello,

    the commands "EXPORT_ELEVATION", "EXPORT_RASTER", "EXPORT_VECTOR" and "IMPORT" need some customisations to be fully compliant with notepad++ calltips.

    here a screenshot of work in progress :
    notepad++_001_in_progress.png
  • Geo
    Geo Global Mapper User Trusted User
    edited October 2013
    extracts from gm.xml ( a Notepad++ Global Mapper Auto-Completion xml file)
    # Auto_Completion definition file for Global Mapper 14 in Notepad++ : gm.xml
    # 2013-10-23
    # tested with Notepad++ v6.5 (UNICODE) on Windows XP
    # update with latest [URL="http://www.bluemarblegeo.com/knowledgebase/global-mapper/ScriptReference.html"]Global Mapper Scripting Reference[/URL] planned
    
    # tips
        
        keyword auto-completion definition files
            [URL="http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Auto_Completion"]SourceForge.net: Auto Completion - notepad-plus[/URL]
        
        For any given function, all text, plus 2 bytes per parameter, plus 24 bytes if 2 overloads or more, can't spill over 2,043 bytes.
        not enough for all GM functions, calltips won't be displayed if all parameters are present
                [URL="http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Editing_Configuration_Files#Autocompletion.2C_aka_API.2C_files"]SourceForge.net: Editing Configuration Files - notepad-plus[/URL]
        4,096 bytes could be enough, ask the developper to raise the limit
            [URL="http://sourceforge.net/p/notepad-plus/discussion/331753/thread/82343c0f/#9c7a"]Notepad++ / Discussion / 1. Open Discussion:Calltip size restriction.[/URL]
        
        validate your Auto_Completion definition file
            [URL=http://validator.w3.org/unicorn/check#"]Unicorn[/URL] (choose application/xml, "Windows-1252" encoding)
            or
            [URL="http://sourceforge.net/projects/npp-plugins/files/XML%20Tools/"]Notepad++ XML Tool Plugin[/URL]
        
        xml escape characters if needed
            [URL="http://www.w3.org/TR/xml11/#sec-predefined-ent"]Extensible Markup Language (XML) 1.1 (Second Edition)[/URL]
            Original Character   XML entity replacement   XML numeric replacement
            <                    &lt;                     <
            >                    &gt;                     >
            "                    &quot;                   "
            &                    &amp;                    &
            '                    &apos;                   '
        
        to get keywords, description, parameters, ..., extract ScriptReference.html from GlobalMapperHelp.chm:
            7z.exe e GlobalMapperHelp.chm ScriptReference.html
            or
            %windir%\hh.exe -decompile .\tmp GlobalMapperHelp.chm
    
    # [u]gm.xml installation[/u]
        The AutoComplete files are located in the "plugins\APIs" folder,
        to be found in the Notepad++ Install Folder, most often C:\Program Files\Notepad++.
        
        you can set Auto-Completion options using the Settings->Preferences dialog menu
        in Auto-Completion, check
            Enable Auto-completion on each input
                Function Completion
            Function parameters hint on input
        
    # [u]Notepad++_UDL_Global Mapper.xml installation[/u] (Syntax Highlighting for User Defined Languages)
        Select Language->Define your language in menu
        Click Import and select Notepad++_UDL_Global Mapper.xml
        restart Notepad++
        
    # Notepad++_UDL keywords groups for Global Mapper are related to:
        Keywords1 => Global Mapper Commands for scripting
        Keywords2 => Global Mapper Commands found in .gmw files (non-exhaustive list)
        Keywords3 => Commands Parameters 
        Keywords4 => Values that a Parameter can take
        Keywords5 => Values that a Parameter can take in .gmw files (non-exhaustive list)
        
        Auto-Completion for Global Mapper only uses Keywords1, Keywords3 and Keywords4
        
    # [U]get help for GM functions only[/U] (description, parameters and options can't be searched in GlobalMapperHelp.chm)
        Open a .gms or .gmw file
        Select a GM function
        Select Run->Run.... in menu and type:
            %windir%\hh.exe mk:@MSITStore:%programfiles%\GlobalMapper14\GlobalMapperHelp.chm::/ScriptReference.html#cmd_$(CURRENT_WORD)
            click Run!
            adjust directories if needed
        Select Run->Run..., save the command
            assign a key combination, CTRL + F1 for example
                key combination will open the Script Reference page in GlobalMapperHelp.chm
                if a function is selected, the Script Reference page in GlobalMapperHelp.chm will open at the function description
        
        LanguageHelp plugin from [URL]https://sites.google.com/site/fstellari/nppplugins[/URL] may be an alternative
        
    # Hh.exe info
        Several client-side command line switches are available to help authors
        that are part of the HTML Help executable program (Hh.exe)
        and therefore work when HTML Help Workshop is not set up. 
        [URL="http://msdn.microsoft.com/en-us/library/windows/desktop/ms524369%28v=vs.85%29.aspx"]Using Command Line Switches (Windows)[/URL]
    
    # IdeaTorrent notepad++ -> Use space for autocompetion, startFunc=" "
        [URL="http://sourceforge.net/apps/ideatorrent/notepad-plus/ideatorrent/idea/307/"]IdeaTorrent | notepad-plus: IdeaTorrent[/URL]
        
        until it becomes available anf if you use startFunc="{"
        don't forget to remove all "{" characters in your script before saving it
        
        paramSeparator=" " is currently not available in Notepad++,
        paramSeparator=";" works. it permit to loop over parameters in the calltip when typing ";"
        if you want to use paramSeparator=";", don't forget to remove all ";" characters in your script before saving it
    

    preview:
    -notepad++_002_in_progress.png

    gm.xml

    Notepad++_UDL_Global Mapper.xml
Sign In or Register to comment.