ShowTx (c) 2009-2012, Horst Schaeffer

ShowTx is a plain text viewer that also allows editing and saving the text.
Standard editing functions including copy, insert, drag&drop are available. 

The behavior of ShowTX can be influenced by command parameters and by the
default settings in the INI file.

Special features:

        Auto-adjust window size (limits configurable in INI file)
        Window position: center, x/y (command options) or auto
        Menu and/or status bar can be hidden
        Drag&drop a file on window to open
        Secondary font (menu, shortcut key), background color
        Launch function allows passing current file to another program
        Start ShowTX with text from clipboard (command option)
        Profiles (INI file) as a sequence of command parameters
        ANSI and UNICODE UTF-8, UTF-16(LE)


+++ AutoSize, WordWrap

When AutoSize is active, the program will try to adjust the window width 
according to the longest text line, however, not beyond MaxWidth in the [Auto] 
section. If lines are longer, and WordWrap is active, the window will be
adjusted to WrapWidth and WrapHeight in the [Auto] section (otherwise you will
get a horizontal scroll bar).

If AutoSize is not active, the window size is taken from the [Window] section
(last used). If lines are to long, WordWrap may be applied (within the given
Window width). Note that AutoSize is deactivated when width and height are 
given as command options.

By default AutoSize and WordWrap are both active.


+++ Syntax

        ShowTx filespec [options]

    Filespec
         
         Full path or relative path based on "current directory" (CMD scripts)
         or on "Run in.." folder (shortcuts).

    Options 

        separated by blank space, case ignored;
        colon and equal sign are equivalent

+++ Command options

    /ro    /rw          read only, read and write (*1,*2)
    /wrap  /nowrap      word wrap mode (*1,*2)
    /auto  /noauto      auto size window at start (*1,*2)
    /paste              paste from clipboard, if no file given
    /onTop              keep window on top (*1)
    /center             center window on desktop 
    /XY=x,y             window position (pixel coordinates x,y)
    /WH=w,h             window size (pixels: width, height) 
    /block              menus disabled and text is read-only
    /line=n             select line #n 1.. (see status bar note)
    /find=string        find string; (double) quote marks supported
    /font=2             Start with secondary font
    /bgcolor=#rrggbb    background color (HTML format), not saved
    /QuickClose         on exit: close (save) file without asking
    /QuickQuit          on exit: quit (don't save!) without asking
    /closeAll           close all open ShowTx instances 
                        (quits if no file to open is given)
    /closePrev          close previous (most recent) instance

    (*1) see also: INI file settings
    (*2) only applies to the file specified as command parameter


+++ INI file 

The INI file is expected and saved in the same directory with ShowTx.exe.
The file is created with "Factory settings" the first time ShowTx is used.
Changes to the INI file can be made while an instance of ShowTX is running,
and will be effective for the next instance launched. 

These settings may be edited (sections in square brackets and items):

[File] 

    TextExt = (file name patterns separated by semicolon)

        Extensions for files offered in Open/Save file dialog as 
        "text files" (offered in addition: "all files").
        Example:  TextExt=*.txt;*.ini;*.lst

    NewUTF = (0|8|16) - Encoding for new(!) files: Ansi | UTF-8 | UTF-16(LE)

        This default may be changed in Menu:File/Encoding

[View] 

    MainMenu = (0|1)  - hide|show
    StatusBar = (0|1) - hide|show
    AutoSize = (0|1)  - no|yes 
    OnTop = (0|1)     - no|yes 

[Text] 

    WordWrap = (0|1)  - off|on 
    ReadOnly = (0|1)  - off|on
    TabWidth = (characters, default:8) - for TAB used as input key
    TabToSpace = (1|0) - yes|no, fill spaces, see Menu:Text

[Auto] - width and height (pixels) for auto size mode:

     WrapWidth, WrapHeight   - fixed dimensions if word wrap is active
     MinWidth, MinHeight     - minimum  size
     MaxWidth, MaxHeight     - if MaxWidth exceeded: WordWrap = ?


[Program]  - items may have to be added

    Launch=(Menu item;program path;parameters;folder)

        Examples:  
        Launch=NotePad;Notepad.exe;"$"
        Launch=PopSel;C:\some\where\Popsel.exe;"my editors.lst" "$"

        This will add an extra item under "Program" in the main menu 
        to launch anything you want. Only one item is supported. 
        A dollar sign in parameters will be replaced with the current file;
        a hash sign (#) is replaced with the current line number.
        (Parameters and application folder are optional.)

        Note: in parameters (only) any file name/path should be enclosed
        in double quote marks, in case there are spaces in names.

    Help=(Menu item;help file)

        If you want to display your own help information.
        
        Example:
        Help=Help;ShowTX.txt
        (Actually, same syntax as "Launch" item)

[Profiles] - section and items may have to be added 

    name = (command options)
        
        Defines a new command parameter as a sequence of parameters.
        Example:
        test=/font=2 /QuickQuit /bgcolor=#eeddff
        
        This allows using /test as a new command parameter 


+++ ShowTx menu

The main menu can be hidden (toggle with Ctrl+M or menu:View).
Status and mode switches (View, Text) are not saved in the INI file.
However, Font and Background will be saved instantly.
Find (Find next, F3) always starts at input position or end of marked string.


+++ Status bar info

(1)     ro (readonly), ** (modified)
(2)     w  (wordwrap)
(3)     line and column for input cursor position
(4)     characters: if marked within a single line; lines: if fully marked 

Note: in "word wrap" mode the line numbers represent the count of visible
lines in the window. Switch wrap mode to see the difference.
If you want to select a logical (CR+LF terminated) line by command parameter,
word wrap should be switched off.


+++ Unicode 

Text files beginning with a "BOM" (byte order mark) are read as UTF-8 or
UTF-16(LE); other files are assumed to be ANSI (single byte characters). 
Files are saved with the same format as read, unless the format is changed
in the Menu:File/Encoding. Internally all files are handled as Unicode text.

New files are saved as ANSI by default. The default behavior can be changed
in the INI file, section [File], NewFileUTF = 8 or 16.


+++ Notes

Non-text:
        ShowTx was designed to handle plain text files. 
        The output for other data formats is not handled appropriately. 
        Files containing zero bytes (unless UTF-16LE) will not be loaded.

To use ShowTx in batch files or in "Send To" context menu, see ReadMe.txt.

===
15 Aug, 2012
mailto:horst.schaeffer@gmx.net
http://www.horstmuc.de/win.htm
