SYNEDIT

SYNEDIT N

CREATES A SYSTEM OBJECT SYNEDIT AND ALLOCATES IT NUMBER N AS REFERENCE

  • Type: Command
  • Parameter: 1
  • Group: System Objects Creation

ACTION

The command SYNEDIT N creates a system object SYNEDIT, and allocates it a number N. The number N will be used to designate the SYNEDIT.

The created SYNEDIT can then be used through the appropriated commands.

The SYNEDIT is created at position (0,0) : that is TOP = 0 pixel and LEFT = 0 pixel, with dimensions WIDTH = 418 pixels and HEIGHT = 211 pixels.

A SYNEDIT displays an area where the user can enter and modify a Panoramic source, with syntax-color highlight and aids (copy, paste, find) of word-processing.

A SYNEDIT can generate the events : ON_CLICK, ON_DOUBLE_CLICK, ON_CHANGE, ON_KEY_UP, ON_KEY_DOWN, ON_MOUSE_MOVE.

A SYNEDIT is composed of 5 virtual parts which can be targetted by the commands SYNEDIT_TARGET_IS_COMMENT, SYNEDIT_TARGET_IS_GUTTER, SYNEDIT_TARGET_IS_KEYWORD, SYNEDIT_TARGET_IS_OBJECT , SYNEDIT_TARGET_IS_STRING.

Remark : by default, the SYNEDIT is created on the FORM number 0, but another FORM can be used. For that, create a FORM by FORM N, and send it all the commands by COMMAND_TARGET_IS N before creating the SYNEDIT.

SYNTAX: SYNEDIT N

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • A SYNEDIT is used to display and modify a source.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is already used for a system object number.

EXAMPLE

dim i%,posit,c

label target

synedit 1:full_space 1

item_add 1,"print 123456"

item_add 1,"2D_CIRCLE 10,20,30"

item_add 1,"' this is a comment"

item_add 1,"print "+chr$(34)+"this is a string"+chr$(34)

for i%=0 to 12:gosub target:wait 1000:next i%

end

target:

' keywords

if c=0 then synedit_target_is_keyword:font_color 1,255,0,0

if c=1 then font_italic 1

if c=2 then font_bold 1

if c=3 then font_bold_off 1

if c=4 then font_italic_off 1

' strings

if c=5 then synedit_target_is_string:font_color 1,0,255,0

if c=6 then font_italic 1

if c=7 then font_underline 1

' comments

if c=8 then synedit_target_is_comment:font_color 1,200,200,200

if c=9 then font_strike 1

' gutter

if c=10 then synedit_target_is_gutter:font_size 1,16:font_color 1,0,255,0

if c=11 then hide 1

if c=12 then synedit_target_is_object:font_size 1,16

c=c+1

return

SEE ALSO

SYNEDIT_TARGET_IS_COMMENT

SYNEDIT_TARGET_IS_GUTTER

SYNEDIT_TARGET_IS_KEYWORD

SYNEDIT_TARGET_IS_OBJECT

SYNEDIT_TARGET_IS_STRING