SG_EditorGadget

Syntax:

Result=SG_EditorGadget(SG_GadgetID_L.l, X_Pos_L.l, Y_Pos_L.l, Width_L.l, Height_L.l, [Flags_L.l])

Parameters:

SG_GadgetID_L

=

The number of the gadget

X_Pos_L

=

the x-position of the gadget

Y_Pos_L

=

the y position of the gadget

Width_L

=

the width of the gadget

Height_L

=

the height of the gadget

[Flags_L]

=

'Flags' are always optional and can be composed of one or several (using the bitwise OR operator '|') of the following constants:

#PB_String_ReadOnly : Read only mode. No text can be entered.

=

#PB_String_BorderLess : No borders are drawn around the gadget.

=


Return Values:

Result

=

contains a pointer to the internal gadget structur. See the source of this lib for more information


Description:

Creates a Editor gadget in the current screen. SG_GadgetID_L will be the number returned by SG_EventScreenGadgetID() command.

The Editorgadget is based on items. So every line represents an item, which can individually changed. Also the Front- and backcolor, and the Font can be changed seperatly.

Later the content can be changed with SG_SetGadgetText() and received with SG_GetGadgetText() or with SG_...Item() - commands

the following commands will work with this gadget:

- AddGadgetItem(): add a line

- GetGadgetItemText(): get the content of the line

- SG_GetGadgetFont(): The font of the first item

- SG_GetGadgetItemFont(): The font of the specified item

- GetGadgetText(): get the contant of the whole gadget

- RemoveGadgetItem(): remove a line

- ClearGadgetItemList(): clear all lines

- SetGadgetItemText(): (over)write the line

- SetGadgetItemFont(): set the font for this line

- SetGadgetText(): change the whole text of the gadget, each line have to be seperated with CRLF

- SetGadgetFlag(): sets the flags of the gadget

- SG_ShowListItem(): Scroll the Gadget so that the specified item is visible


Example:


Remarks:

These gadget uses a Sprite to render the text to the screen. The sprite is created using #PB_Any. Make sure you doesn´t use these sprites in other ways In other words create all sprites you try to use before you create an editorgadget oder check with issprite() if the sprite exists or not.

For editing gadgets (currently Stringgadgets and Editorgadgets) there are the following keys availalble:

- All Chars

- Up

- Down

- Left

- Right

- Home

- End

- Del

- Backspace

- Return/Enter



Supported OS:   Windows