Entry
TSE: Configuration: File: .UI: Update: Easy: How: How to easy update TSE UI files?
Mar 5th, 2005 09:09
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden - 9 December 2001 - 09:41 pm ----------------------
TSE: Configuration: File: .UI: Update: Easy: How: How to easy update
TSE UI files?
More information about the .ui file:
Your personal configuration information of TSE is stored in a .UI file
of
your choice (e.g. TSE.UI) in the directory of TSE.
By changing the source code in this file, you can adapt TSE to your
liking (e.g. change TSE menu entries, add TSE menu entries, change or
add TSE key settings (like you want to change the behaviour of
<ALT><A>)).
To implement it, you change the source code in a .UI file, recompile it
in TSE, and this will automatically be stored in TSE, and become active
the next time you start your version of TSE.
---
A few possible ideas to make upgrading your personal configuration of
TSE easier.
-use #include to split your original .ui file in
easy recognizable and easy to update parts.
e.g. my .ui original main file is split in
the following files:
start information .ui
my own macros .ui
TSE macros .ui
TSE menus .ui
TSE help .ui
TSE key definitions .ui
---
Method: use an #INCLUDE file and conditional compilation (#IFDEF)
Using an #INCLUDE file to separate parts
E.g.
-store your key definitions separately in a file
-store the TSE menus separately in a file
-store the TSE macros separately in a file
e.g. your key definitions definitely
makes it much easier to centrally and only once change your key
definitions for your different .ui files for the different TSE
versions.
e.g.
put your current key definitions of one TSE file in a central file
(e.g. qedinclu.ui) then replace that lines in this .ui file with the
following
// --- //
#INCLUDE ["qedinclu.ui"]
// --- //
In this #INCLUDE file you have replaced each different key definition
with
conditional compilation #IFDEFs depending on the TSE version for which
this .ui include file is going to be used for:
#IFDEF WIN32
// <Shift f11> // old [kn, ni, mo, 28-07-2003 0:53:36]
<Shift f11> PROCMacroRunPurge( "togmax" ) // new
[kn, ni, mo, 28-07-2003 0:54:03]
#ELSE
<Shift f11>
#ENDIF
<Shift f12>
// --- //
//
// special keys
//
<cursorup> Up()
<cursordown> Down()
<cursorleft> Left()
<cursorright> Right()
<Ctrl cursorleft> WordLeft()
<Ctrl cursorright> WordRight()
<home> BegLine()
<end> EndLine()
<Ctrl home> BegWindow()
<Ctrl end> EndWindow()
<pgup> PageUp()
<pgdn> PageDown()
#IFDEF EDITOR_VERSION
#IF EDITOR_VERSION >= 0x4000
<Ctrl pgdn> mEndFile()
#ENDIF
#ELSE
<Ctrl pgdn> EndFile()
#ENDIF
#IFDEF EDITOR_VERSION
#IF EDITOR_VERSION >= 0x4000
<Ctrl pgup> mBegFile()
#ENDIF
#ELSE
<Ctrl pgup> BegFile()
#ENDIF
---
This is currrently the content of my own .ui file (so you see,
it contains only #INCLUDE files, so clearly showing the structure,
and if you want to change something it is quite easy to do.
// TSE general information (changes)
#INCLUDE ["qedincin.ui"]
// --------------------------------------------------------------------
// my own macros
#INCLUDE ["qedinckn.ui"]
// --------------------------------------------------------------------
// TSE macros
#INCLUDE ["qedincpr.ui"]
// --------------------------------------------------------------------
// TSE menus
#INCLUDE ["qedincme.ui"]
// --------------------------------------------------------------------
// TSE help
#INCLUDE ["qedinche.ui"]
// --------------------------------------------------------------------
// TSE key assignments
#INCLUDE ["qedincke.ui"]
// --------------------------------------------------------------------
---
---
Further remarks:
Changing or implementing your old personal configuration, e.g. when
upgrading from version TSE v2.5 to TSE v4.0 might become easier with
the following actions:
Overview:
1. Store: Store your personal settings in a separate copy of the .UI
file (e.g. in a separate #include file)
2. Changes: Collect: Keep them together as much as possible
3. Changes: Indicate: Indicate any personal changes clearly
---
Worked out:
1. Store: Store your personal settings in a separate copy of the .UI
file store all your personal changes, use your own .UI file (make a
file copy of the .UI file, e.g. from TSE.UI)
2. Changes: Collect: Keep them together as much as possible
Keep all your PROCedures together in this .UI file (clearly indicate
the part of your file where you have stored it), so that you e.g.
very easily can copy this block to another file (just highlight that
contiguous block, copy/paste it)
2.1 Use external macros wherever you can.
This has the advantage, that you:
1. do not have to edit the .ui file, as the macros stay external,
and this macro can be changed independently (that is, you can
change and recompile the content of this macro outside of the
application (e.g. TSE .ui file) that uses it without having to
change or recompile this application (e.g. TSE .ui file)
itself)
Consequently, you can just copy the lines containing the macro
references freely between the different TSE versions (e.g. from
TSE v2.5 for DOS to the 32 bits TSE v3.0). You copy only the
name of the macro, not the content (of course you should ensure
that you (re)compile this macros for those different TSE
versions, e.g. using #IFDEF WIN32 and or putting the resulting
.mac files in the appropriate seperate directories).
2. you add a minimum amount of information (e.g. just the line
ExecMacro( "mymacro" ), so e.g. the size of your .ui file and
so of the corresponding e.exe or e32.exe is growing minimally.
2.2 If you really have to insert source code of procedures and
functions directly in your .ui file, you can keep all your
procedures together (in one large separate block in your file),
without having to worry about the order in which they appear in
your TSE file, by using the TSE keyword 'FORWARD'. Put this
FORWARD declarations in the beginning of your file.
2.3 You might even store all changes in a separate file (by putting
the command like #
INCLUDE "c:\tse\myownprocedures.ui"
in (the beginning) of your .UI file
3. Changes: Indicate: Indicate any personal changes clearly
Changes made by you in your own .UI file:
Indicate clearly in your .UI file where you have changed something
(e.g.
// this is my change [Knud, New York, Saturday 4 August 2001]
)
if you do then a global search for this type of text, you see in one
view all lines with the changed information), you can copy/paste
this parts into your possibly new .ui file
---
For example:
1. Goto your TSE directory
2. Make a copy of your .UI file
e.g.
On a DOS prompt type the command, followed by <ENTER>: COPY
tse.ui mytse.ui
3. Edit this .ui file with TSE:
E32.EXE mytse.ui
4. Do any changes of your liking
Your own mytse.ui might look afterwards like this:
...
// Here comes other stuff from the original TSE.UI file
...
// all my procedures in a contiguous block, starting with a 'BEGIN
KNUD'
// and ending at 'END KNUD'
// --- KNUD: BEGIN --- //
// #DEFINE WIN32 FALSE
//
// FORWARD PROC mCompressView( INTEGER i )
// FORWARD PROC PROCMacroRunKeep( STRING s1 )
// FORWARD PROC PROCWarn( STRING s1 )
// FORWARD INTEGER PROC FNMacroLoadB( STRING s1 )
// FORWARD STRING PROC FNStringGetCarS( STRING s1 )
// FORWARD PROC PROCMacroRunPurge( STRING s1 )
// FORWARD PROC PROCMacroExec( STRING s1 )
// FORWARD PROC PROCMacroPurge( STRING s1 )
// FORWARD INTEGER PROC FNMacroPurgeB( STRING s1 )
// FORWARD INTEGER PROC FNMacroExecB( STRING s1 )
//
// // library: macro: run a macro, then purge it (this text goes into
the main macro file) [kn, zoe, di, 27-10-1998 18:54:17]
// PROC PROCMacroRunPurge( STRING macronameS )
// // e.g. PROC Main()
// // e.g. PROCMacroRunPurge( "mysubma1.mac myparameter11
myparameter12" )
// // e.g. PROCMacroRunPurge( "mysubma2.mac myparameter21" )
// // e.g. PROCMacroRunPurge( "mysubma3.mac myparameter31
myparameter32" )
// // e.g. END
// IF FNMacroLoadB( FNStringGetCarS( macronameS ) ) // necessary if
you pass parameters in a string
// PROCMacroExec( macronameS )
// PROCMacroPurge( FNStringGetCarS( macronameS ) )
// ENDIF
// END
//
// // library: macro: (Purges a Macro File From Memory) R PurgeMacro
(STRING s)* [kn, zoe, fr, 13-10-2000 19:09:32]
// PROC PROCMacroPurge( STRING macronameS )
// // e.g. <F12> PROCMacroPurge( macronameS )
// IF FNMathCheckLogicNotB( FNMacroPurgeB( macronameS ) )
// PROCWarn( "macro " + macronameS + ": could not be found" )
// ENDIF
// END
//
// // library: macro: purge [kn, zoe, fr, 13-10-2000 19:03:50]
// INTEGER PROC FNMacroPurgeB( STRING macronameS )
// RETURN( PurgeMacro( macronameS ) )
// END
//
// // library: procedure: search: name: return the regular expression
to find every occurrence of the NAME of the defined procedures or
functions. Regular expressions from tse themselves (see qeditknu.ui)
[kn, ni, vr, 07-08-1998 16:11:08]
// STRING PROC FNStringGetSearchProcedureNameExpressionS( STRING
fileextensionS )
// STRING s[255] = "[A-Za-z_]" // default
// CASE fileextensionS
// // WHEN extension
of "html", "javascript", "java", "fortran", "cobol", "lisp", "rpg",...
// added knud [kn, ni, vr, 07-08-1998 16:10:32]
// WHEN ".c", ".h"
// WHEN ".cpp", ".hpp"
// WHEN ".s", ".ui", ".si"
// // regular expression: SAL: First 1 character of the type A-Z, a-
z or _. Then 0 or more occurrences of A-Z, a-z, -, 0-9. Then
immediately the character '(' (and position your cursor on the
character '(' by including the '\c' option. This to initialize the
position to goto the next occurrence, and not to remain on or in the
currently found string anymore) [kn, ni, vr, 07-08-1998 14:15:32]
// s = "{{^ @}|{ }}[A-Za-z_][A-Za-z_0-9]@ @\c("
// WHEN ".pas"
// WHEN ".prg",".spr",".mpr",".qpr",".fmt",".frg",".lbg",".ch"
// WHEN ".bas"
// s = "{{^ @}|{ }}{{PROC}|{FN}}[A-Za-z_][A-Za-z_0-9]@\c(@"
// WHEN ".bbc" // this is a binary file! [kn, ni, do, 06-08-
1998 21:55:33]
// WHEN ".ini"
// ENDCASE
// RETURN( s )
// END
//
// MENU FunctionListMenu()
// history
// "&All names of functions or procedures", mCompressView(2)
// "&Definitions of functions or procedures", mCompressView(1)
// END
//
// // goal: find and view the given word or marked block (max 255
characters) at the cursor.
// //
// // position: [kn, ni, zo, 02-08-1998 23:00:05]
//
// // library: string: word: token: get: first: FNStringGetCarS(): Get
the first word of a string (words delimited by a space " "). [kn, ni,
zo, 02-08-1998 15:54:17]
// STRING PROC FNStringGetCarS( STRING s )
// // E.g. Message( FNStringGetCarS( "Knud is the best" ) )
gives "Knud"
// // variation: RETURN( FNStringGetTokenFirstS( s, " " ) )
// RETURN( GetToken( s, " ", 1 ) ) // faster, but not central
// END
//
// // library: macro: run a macro, then purge it (this text goes into
the main macro file) [kn, zoe, di, 27-10-1998 18:54:17]
// PROC PROCMacroRunKeep( STRING macronameS )
// IF LoadMacro( FNStringGetCarS( macronameS ) ) // necessary if you
pass parameters in a string
// ExecMacro( macronameS )
// ENDIF
// END
//
// // library: error: warning: give a warning message [kn, zoe, wo, 09-
06-1999 22:11:07]
// PROC PROCWarn( STRING s )
// // e.g. <F12> PROCWarn( "you have forgotten to input a value" )
// Warn( s )
// END
//
// // library: macro: load: (Loads a Macro File From Disk Into Memory)
R LoadMacro(STRING macro_filename)* [kn, zoe, wo, 16-06-1999
01:07:06]
// INTEGER PROC FNMacroLoadB( STRING macronameS )
// RETURN( LoadMacro( macronameS ) )
// END
//
// // library: macro: (Executes the Requested Macro) O ExecMacro
([STRING macroname])* [kn, zoe, wo, 16-06-1999 01:06:54]
// PROC PROCMacroExec( STRING macronameS )
// // e.g. <F12> PROCMacroExec( "video" )
// IF FNMathCheckLogicNotB( FNMacroExecB( macronameS ) )
// PROCWarn( "macro " + macronameS + ": could not be executed" )
// ENDIF
// END
//
// // library: macro: (Executes the Requested Macro) O ExecMacro
([STRING macroname])* [kn, zoe, wo, 16-06-1999 01:06:54]
// INTEGER PROC FNMacroExecB( STRING macronameS )
// RETURN( ExecMacro( macronameS ) )
// END
// --- KNUD: END --- //
...
// Here comes other stuff from the original TSE .UI file,
mixed with some changes clearly indicated
...
for example here one of my changes when right clicking with the mouse
(you see that every command (e.g. 'goto next file') is called via
external
macros (=ExecMacro("filegone"), and not directly via the command (e.g.
'NextFile()') itself)
// // Mouse functions:
//
// // library: mouse: record [kn, ri, tu, 18-12-2001 22:27:58]
// MENU MENUMouseMenu1()
// history
// Title="Mouse Menu"
// "copy: line: current: &Duplicate", PROCMacroRunPurge
( "linedupl" ), , "operation: copy: line: current: duplicate" // [kn,
ri, we, 19-12-2001 12:42:52]
// "&1. record: copy: current: insert: &Before: separator",
PROCMacroRunPurge( "inserebs" ), , "operation: insert: record: copy:
current: insert: before: separator"
// "&2. record: copy: current: insert: a&Fter: separator",
PROCMacroRunPurge( "insereas" ), , "operation: insert: record: copy:
current: insert: after: separator"
// "&Copy: record: current: clipboard: tse: .gf definition",
PROCMacroRunPurge( "getgfcct" ), , "operation: copy: record:
clipboard: tse: .gf definition" // [kn, ri, tu, 18-12-2001 00:12:06]
// "c&Opy: record: current: to windows clipboard", PROCMacroRunPurge
( "copyrews" ) // [kn, ri, sa, 15-12-2001 23:23:24]
// "insert: line: &Add empty line after", PROCMacroRunPurge
( "inseliad" ), , "operation: insert: line: add empty line after" //
[kn, ri, we, 19-12-2001 12:42:58]
// "in&Sert: record: .gf link: definition, remove square brackets",
PROCMacroRunPurge( "insegfrb" ), , "operation: insert: record: .gf
link: definition, remove square brackets" // [kn, ri, we, 19-12-2001
12:43:00]
// "insert: record: current: line: q&&a: .gf: link: s&Ee also",
PROCMacroRunPurge( "inseseea" ), , "operation: insert: record: line:
qa: .gf: link: see also" // [kn, ri, we, 19-12-2001 12:43:03]
// "remove: record: line: empty: &End", PROCMacroRunPurge
( "recosere" ), , "operation: remove: record: line: empty: end" //
[kn, ri, we, 19-12-2001 12:42:39]
// "remove: line: text: from cursor to &End of line",
PROCMacroRunPurge( "remoliel" ), , "operation: remove: line: from
cursor to end of line" // [kn, ri, we, 19-12-2001 12:42:42]
// "&Remove: record: separator: from current position until
separator", PROCMacroRunPurge( "recosere" ), , "operation: remove:
record: separator: current position until separator" // [kn, ri, mo,
17-12-2001 12:11:40]
// "remove: record: separator: from &Header until separator",
PROCMacroRunPurge( "remoheen" ), , "operation: remove: record:
separator: from header until separator" // [kn, ri, we, 19-12-2001
13:58:14]
// "r&Eplace: record: .gf: iden&Tifier: unique", PROCMacroRunPurge
( "replregf" ), , "operation: replace: record: .gf: identifier:
unique" // [kn, ri, mo, 17-12-2001 11:21:38]
// "replace: text: exchange word between &2 spaces with clipboard
tse", PROCMacroRunPurge( "replspct" ), , "operation: replace: text:
exchange word between 2 spaces with clipboard tse" // [kn, ri, we, 19-
12-2001 12:42:48]
// "search: &Record ", PROCMacroRunPurge
( "searreco" ), , "operation: search: record"
// "undo: line: current cursor &Line", PROCMacroRunPurge
( "undolicu" ), , "operation: undo: line: current cursor line"
// END
//
// // library: mouse: menu (filename=qeditknu.ui) [kn, zoe, we, 11-10-
2000 17:34:11]
// MENU MENUMouseMenu()
// history
// Title="Mouse Menu"
// "goto: &Knud menu", PROCMacroRunKeep( "knudmenu" ) // [kn, zoe,
fr, 27-10-2000 14:36:36]
// "goto: &Main menu", MainMenu() // [kn, zoe, ma, 10-01-2000
12:23:29]
// "", , divide
// "&Operation ", MENUMouseMenu1(), dontclose, "operation:
replace: record: .gf: identifier: unique" // [kn, ri, mo, 17-12-2001
11:21:38]
// "", , divide
// "goto: begin o&F Line", PROCMacroRunPurge( "gotolibe" ) // [kn,
zoe, ma, 22-05-2000 14:44:31]
// "goto: &End of Line", PROCMacroRunPurge( "gotolien" ) // [kn,
zoe, ma, 22-05-2000 14:44:25]
// "goto: screen: line: &Down", PROCMacroRunPurge
( "gotoscrd" ), , "operation: goto: screen: line: down" // [kn, ri,
su, 09-12-2001 21:06:12]
// "goto: &Screen: line: up", PROCMacroRunPurge
( "gotoscru" ), , "operation: goto: screen: line: up" // [kn, ri, su,
09-12-2001 21:06:15]
// "goto: back to previous .gf link", PROCMacroRunPurge
( "gotogfpr" ) // [kn, ri, su, 09-12-2001 17:28:39]
// "goto: begin current record", PROCMacroRunPurge( "recogobt" ) //
[kn, ri, th, 13-12-2001 16:35:03]
// "goto: end current record", PROCMacroRunPurge( "recogoet" ) //
[kn, ri, th, 13-12-2001 16:34:58]
// "goto: previous record", PROCMacroRunPurge( "recogopt" ) // [kn,
ri, su, 09-12-2001 17:54:14]
// "go&To: next record", PROCMacroRunPurge( "recogont" ) // [kn,
ri, su, 09-12-2001 17:54:36]
// "goto: record: current record to top window", PROCMacroRunPurge
( "gotorewt" ), , "operation: goto: record: current record to top
window"
// "goto: p&Revious page", PROCMacroRunPurge( "gotopaup" ) // [kn,
ri, su, 09-12-2001 18:16:30]
// "&Goto: next page", PROCMacroRunPurge( "gotopado" ) // [kn, ri,
su, 09-12-2001 18:16:36]
// "goto: beg&In of File", PROCMacroRunPurge( "gotofibe" ) // [kn,
zoe, di, 18-01-2000 18:53:00]
// "goto: e&Nd of File", PROCMacroRunPurge( "gotofien" ) // [kn,
zoe, di, 18-01-2000 18:53:00]
// "goto: pre&Vious file", PROCMacroRunPurge( "filegopr" ) // [kn,
zoe, do, 25-11-1999 18:54:25]
// "goto: ne&Xt file", PROCMacroRunPurge( "filegone" ) // [kn, zoe,
do, 25-11-1999 18:54:25]
// "", , divide
// "c&Ut to windows clipboard", PROCMacroRunPurge( "cutwclip" ) //
[kn, zoe, di, 18-01-2000 18:50:16]
// "&Copy to windows clipboard", PROCMacroRunPurge( "clipwcop" ) //
[kn, ri, we, 29-08-2001 0:51:28]
// "&1. copy to tse clipboard", PROCMacroRunPurge( "cliptcop" ) //
[kn, ri, tu, 18-12-2001 23:01:29]
// "copy current line to &Windows clipboard", PROCMacroRunPurge
( "copycwld" ) // order changed [kn, zoe, ma, 09-10-2000 11:10:42]
// "copy to end &Line to windows clipboard", PROCMacroRunPurge
( "linecoel" ) // order changed [kn, zoe, ma, 09-10-2000 11:10:42]
// "&Paste from windows clipboard", PROCMacroRunPurge
( "clipwpas" ) // [kn, ri, we, 29-08-2001 0:49:47]
// "search: text: input: menu: &Pcfsearch ", PROCMacroRunKeep
( "pcfsearc" ), , "search: text: input: menu: pcfsearch" // [kn, ri,
we, 19-12-2001 00:48:23]
// "select &All: windows clipboard", PROCMacroRunPurge
( "selemaff" ) // [kn, zoe, di, 18-01-2000 18:48:05]
// // "Cu&t", Cut() // [kn, zoe, do, 25-11-1999 19:02:09]
// // "&Copy", Copy() // [kn, zoe, do, 25-11-1999 19:02:13]
// // "&Paste", Paste() // [kn, zoe, do, 25-11-1999 19:02:54]
// // "Paste &Over", Paste(_OVERWRITE_) // [kn, zoe, do, 25-11-1999
19:02:54]
// // "&UnMark", UnmarkBlock() // [kn, zoe, do, 25-11-1999 19:02:54]
// // "&Paste from Windows Clipboard", PasteFromWinClip() // [kn,
zoe, di, 18-01-2000 18:50:18]
// // "&Copy to Windows Clipboard", CopyToWinClip() // order
changed [kn, zoe, di, 18-08-1998 17:12:15]
// // "Cop&y Block", CopyBlock() // [kn, zoe,
do, 25-11-1999 19:02:54]
// // "Copy O&ver Block", CopyBlock(_OVERWRITE_) //
[kn, zoe, do, 25-11-1999 19:02:54]
// // "&Move Block", MoveBlock() // [kn, zoe,
do, 25-11-1999 19:02:54]
// // "&Delete Block", DelBlock() // [kn, zoe, do,
25-11-1999 19:02:54]
// // "" , ,
Divide // [kn, zoe, do, 25-11-1999 19:02:54]
// // "&Fill Block", FillBlock() // [kn, zoe,
do, 25-11-1999 18:53:00]
// // "&Sort", ExecMacro("sort " + Str
(sort_flags)) // [kn, zoe, do, 25-11-1999 19:02:54]
// // "" , ,
Divide // [kn, zoe, do, 25-11-1999 19:02:54]
// // "Uppe&r ", mUpper() // [kn, zoe, do,
25-11-1999 19:02:54]
// // "&Lower ", mLower() // [kn, zoe, do,
25-11-1999 19:02:54]
// // "Fl&ip ", mFlip() // [kn, zoe, do, 25-
11-1999 19:02:54]
// // "Capitali&ze" , mCapital() ,
DontClose // [kn, zoe, do, 25-11-1999 19:02:54]
// END
---
5. Make your changes active in TSE
Then compile your changes of mytse.ui into TSE via a 'macro',
'compile', e.g.
<CTRL><F9>
If you after successfully compiling leave the TSE editor, and
then re-enter the TSE editor, your changes in the .ui file should
have become activated.
---
---
Internet: see also:
---
TSE: Configuration: File: .UI: Link: Can you give an overview of links?
http://www.faqts.com/knowledge_base/view.phtml/aid/34317/fid/1007
----------------------------------------------------------------------