Working with widget "TextPad"

<< 点击显示目录 >>

主页  mappView帮助助手 > mapp View帮助信息 > Widgets  > Text  > TextPad  > Concept  >

Working with widget "TextPad"

This section explains how to use widget "TextPad" in the browser.

All possible programs and text files can be loaded, created, edited, deleted, copied, etc. Using Keyboard shortcuts makes it easier to work with the editor.

To interact with widget "TextPad", you must use a hardware keyboard or set property "keyboard" to true.

Opening files

Action "OpenFileExplorer" can be used to open programs or texts.

The action can be enabled by clicking on a button. In this example, button "OpenExplorer" was added:

textpad_openexplorer

The following binding can be used for the button:

<EventBinding>

  <Source xsi:type="widgets.brease.Button.Event" contentRefId="MyContent" widgetRefId="OpenExplorer" event="Click" />

      <EventHandler>

          <Action>

              <Target xsi:type="widgets.brease.TextPad.Action" contentRefId="MyContent" widgetRefId="MyTextPad" >

                  <Method xsi:type="widgets.brease.TextPad.Action.OpenFileExplorer" />

              </Target>

          </Action>

      </EventHandler>

</EventBinding>

If the file browser is to be opened in the browser using the button, the desired storage medium must first be selected by using the button marked in red below:

textpad_gotofile

If the storage medium is not available, this is indicated in the window using the following icon:

file_not_connected

All existing files are then listed. A file can be selected and loaded. The contents of the file are displayed in widget "TextPad".

textpad_select_open

Editing files

The opened program (or even a new program) can then be edited as desired. Lines can be deleted, copied, added, etc. The keyboard shortcuts described in section Keyboard shortcuts can be used for this purpose.

For example, you can search for words using Ctrl+F:

textpad_search_edit

Saving files

If the program was edited in the editor, it can be saved. Actions "Save" or "SaveAs" can be used for this purpose. For more information about actions, see here.

In the following example, action "SaveAs" is used. A new button "SaveProgramAs" is also used.

textpad_saveprogramas

The following binding can be made:

<EventBinding>

  <Source xsi:type="widgets.brease.Button.Event" contentRefId="MyContent" widgetRefId="SaveProgramAs" event="Click" />

      <EventHandler>

          <Action>

              <Target xsi:type="widgets.brease.TextPad.Action" contentRefId="MyContent" widgetRefId="MyTextPad" >

                  <Method xsi:type="widgets.brease.TextPad.Action.SaveAs" />

              </Target>

          </Action>

      </EventHandler>

</EventBinding>

If you click on the button in the browser, a file explorer appears in which the name of the file can be specified:

textpad_saveas

Error handling

If an error occurs while using widget "TextPad" (e.g. opening a file although access is not allowed), the error appears using action "OnError".

Additional information is also available in the Logger. This information is entered by mapp File.