Initial Revision
This commit is contained in:
commit
b154ad549e
29
History.txt
Normal file
29
History.txt
Normal file
@ -0,0 +1,29 @@
|
||||
KBL-Visualizer HISTORY
|
||||
|
||||
x Fixed, + Added, * Improved/Changed, i Information
|
||||
|
||||
|
||||
|
||||
2004-02-17 (1.1)
|
||||
----------------
|
||||
|
||||
x : palette of loaded .bmp was used instead of truecolor
|
||||
|
||||
+ : unicode support
|
||||
+ : "New"-button
|
||||
+ : "Modified"-checks and questions to save/abort
|
||||
+ : ColorEditor
|
||||
+ : unicode-Table from unicode-index.txt
|
||||
+ : Syntax-Helper
|
||||
+ : some error handling
|
||||
+ : PopOnTop icon for application
|
||||
+ : Support for row-specific colors
|
||||
|
||||
* : rewrote keymap-painting, now behaves correctly
|
||||
* : renamed from "KBL-Editor" to "KBL-Visualizer"
|
||||
|
||||
|
||||
2004-02-13 (1.0)
|
||||
----------------
|
||||
|
||||
i : initial working version
|
BIN
KBLVisualizer.bmp
Normal file
BIN
KBLVisualizer.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
38
KBLVisualizer.cfg
Normal file
38
KBLVisualizer.cfg
Normal file
@ -0,0 +1,38 @@
|
||||
-$A8
|
||||
-$B-
|
||||
-$C+
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J-
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
136
KBLVisualizer.dof
Normal file
136
KBLVisualizer.dof
Normal file
@ -0,0 +1,136 @@
|
||||
[FileVersion]
|
||||
Version=7.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
NamespacePrefix=
|
||||
SymbolDeprecated=1
|
||||
SymbolLibrary=1
|
||||
SymbolPlatform=1
|
||||
UnitLibrary=1
|
||||
UnitPlatform=1
|
||||
UnitDeprecated=1
|
||||
HResultCompat=1
|
||||
HidingMember=1
|
||||
HiddenVirtual=1
|
||||
Garbage=1
|
||||
BoundsError=1
|
||||
ZeroNilCompat=1
|
||||
StringConstTruncated=1
|
||||
ForLoopVarVarPar=1
|
||||
TypedConstVarPar=1
|
||||
AsgToTypedConst=1
|
||||
CaseLabelRange=1
|
||||
ForVariable=1
|
||||
ConstructingAbstract=1
|
||||
ComparisonFalse=1
|
||||
ComparisonTrue=1
|
||||
ComparingSignedUnsigned=1
|
||||
CombiningSignedUnsigned=1
|
||||
UnsupportedConstruct=1
|
||||
FileOpen=1
|
||||
FileOpenUnitSrc=1
|
||||
BadGlobalSymbol=1
|
||||
DuplicateConstructorDestructor=1
|
||||
InvalidDirective=1
|
||||
PackageNoLink=1
|
||||
PackageThreadVar=1
|
||||
ImplicitImport=1
|
||||
HPPEMITIgnored=1
|
||||
NoRetVal=1
|
||||
UseBeforeDef=1
|
||||
ForLoopVarUndef=1
|
||||
UnitNameMismatch=1
|
||||
NoCFGFileFound=1
|
||||
MessageDirective=1
|
||||
ImplicitVariants=1
|
||||
UnicodeToLocale=1
|
||||
LocaleToUnicode=1
|
||||
ImagebaseMultiple=1
|
||||
SuspiciousTypecast=1
|
||||
PrivatePropAccessor=1
|
||||
UnsafeType=0
|
||||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=vcl;dclOfficeXP;vcldb;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;vclactnband;adortl
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
[Version Info]
|
||||
IncludeVerInfo=1
|
||||
AutoIncBuild=1
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=3
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1033
|
||||
CodePage=1252
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=KBL-Editor
|
||||
FileVersion=1.0.0.3
|
||||
InternalName=KBLEdit
|
||||
LegalCopyright=(c)2004 by Markus Birth <mbirth@webwriters.de>
|
||||
LegalTrademarks=
|
||||
OriginalFilename=KBLEdit.exe
|
||||
ProductName=KBL-Editor
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=Editor to visualize keyboard layouts for PopOnTop of Symbitz Software.
|
14
KBLVisualizer.dpr
Normal file
14
KBLVisualizer.dpr
Normal file
@ -0,0 +1,14 @@
|
||||
program KBLEdit;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
KBLEditU in 'KBLEditU.pas' {KBLEditForm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.Title := 'PopOnTop Keyboard Layout Editor';
|
||||
Application.CreateForm(TKBLEditForm, KBLEditForm);
|
||||
Application.Run;
|
||||
end.
|
BIN
KBLVisualizer.res
Normal file
BIN
KBLVisualizer.res
Normal file
Binary file not shown.
34
KBLVisualizer.txt
Normal file
34
KBLVisualizer.txt
Normal file
@ -0,0 +1,34 @@
|
||||
KBL-Editor
|
||||
(c)2004 by Markus Birth <mbirth@webwriters.de>
|
||||
==============================================
|
||||
|
||||
This program allows you to visualize keyboard
|
||||
layout files (KBL) of Symbitz Software's
|
||||
PopOnTop keyboard replacement for Symbian UIQ
|
||||
devices.
|
||||
|
||||
The program itself should be self-explanatory.
|
||||
The left area is the working space which
|
||||
contains the keyboard layout you are working
|
||||
on. You can open and save your work using the
|
||||
buttons above the text area. THE PROGRAM WON'T
|
||||
ASK YOU TO SAVE YOUR WORK BEFORE EXITING!
|
||||
|
||||
The right hand side shows a preview of the
|
||||
keyboard so that you get an idea how it
|
||||
looks like. Use the SpinControl next to the
|
||||
"Visualize!"-button to select the map you
|
||||
want to see.
|
||||
|
||||
Landscape keyboards are not yet supported.
|
||||
|
||||
I don't take *ANY* responsibility for any
|
||||
damage to your computer which might occur by
|
||||
using this program.
|
||||
|
||||
Please make sure the file KBLEdit.bmp is in
|
||||
the same directory as KBLEdit.exe. If you
|
||||
rename KBLEdit.exe, do so with KBLEdit.bmp.
|
||||
|
||||
Feel free to replace KBLEdit.bmp by a screen-
|
||||
shot of your own Px00. (208x320 pixels)
|
364
KBLVisualizerU.dfm
Normal file
364
KBLVisualizerU.dfm
Normal file
@ -0,0 +1,364 @@
|
||||
object KBLEditForm: TKBLEditForm
|
||||
Left = 192
|
||||
Top = 107
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'KBL-Editor'
|
||||
ClientHeight = 389
|
||||
ClientWidth = 572
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object Px00Screen: TImage
|
||||
Left = 360
|
||||
Top = 40
|
||||
Width = 208
|
||||
Height = 320
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 376
|
||||
Top = 24
|
||||
Width = 192
|
||||
Height = 13
|
||||
Caption = 'by Markus Birth <mbirth@webwriters.de>'
|
||||
Enabled = False
|
||||
end
|
||||
object Memo1: TMemo
|
||||
Left = 8
|
||||
Top = 40
|
||||
Width = 345
|
||||
Height = 297
|
||||
HideSelection = False
|
||||
Lines.Strings = (
|
||||
'T,Fitaly (US)'
|
||||
''
|
||||
'! Maps:'
|
||||
'! 1 - Lowercase (arrows)'
|
||||
'! 2 - Uppercase (arrows)'
|
||||
'! 3 - Numeric'
|
||||
'! 4 - Numeric shifted (Symbols)'
|
||||
''
|
||||
'! MAP 1 Lowercase FITALY'
|
||||
''
|
||||
|
||||
'M,0,0,210,0,300,207,5,12,195,0,209,207,ffffff,000000,333333,dddd' +
|
||||
'ff'
|
||||
'R'
|
||||
'K,001b,2,c0c0c0,000000,Esc'
|
||||
'K,007a'
|
||||
'K,0076'
|
||||
'K,0063'
|
||||
'K,0068'
|
||||
'K,0077'
|
||||
'K,006b'
|
||||
'K,0031,1,ffffa0'
|
||||
'K,0032,1,ffffa0'
|
||||
'K,0008,2,c0c0c0,000000,BS'
|
||||
'R'
|
||||
'K,0009,2,c0c0c0,000000,TAB'
|
||||
'K,0066'
|
||||
'K,0069'
|
||||
'K,0074'
|
||||
'K,0061'
|
||||
'K,006c'
|
||||
'K,0079'
|
||||
'K,0033,1,ffffa0'
|
||||
'K,0034,1,ffffa0'
|
||||
'K,000d,2,c0c0c0,000000,RET'
|
||||
'R'
|
||||
'L,2,2,c0c0c0,000000,Cap'
|
||||
'K,0020,2'
|
||||
'K,006e'
|
||||
'K,0065'
|
||||
'K,0020,2'
|
||||
'K,0035,1,ffffa0'
|
||||
'K,0036,1,ffffa0'
|
||||
'S,2,2,c0c0c0,000000,Shift'
|
||||
'R'
|
||||
'S,1,2,c0c0c0,000000,Ctrl'
|
||||
'K,0067'
|
||||
'K,0064'
|
||||
'K,006f'
|
||||
'K,0072'
|
||||
'K,0073'
|
||||
'K,0062'
|
||||
'K,0037,1,ffffa0'
|
||||
'K,0038,1,ffffa0'
|
||||
'K,f807,1,c0ffff,000000,<'
|
||||
'K,f6dd,1,c0ffff,000000,<<'
|
||||
'R'
|
||||
'L,3,2,c0c0c0,000000,123'
|
||||
'K,0071'
|
||||
'K,006a'
|
||||
'K,0075'
|
||||
'K,006d'
|
||||
'K,0070'
|
||||
'K,0078'
|
||||
'K,0039,1,ffffa0'
|
||||
'K,0030,1,ffffa0'
|
||||
'K,f808,1,c0ffff,000000,>'
|
||||
'K,f6dc,1,c0ffff,000000,>>'
|
||||
''
|
||||
'! MAP 2 Uppercase FITALY'
|
||||
''
|
||||
|
||||
'M,0,0,210,0,300,207,5,12,195,0,209,207,ffffff,000000,333333,dddd' +
|
||||
'ff'
|
||||
'R'
|
||||
'K,001b,2,c0c0c0,000000,Esc'
|
||||
'K,005a'
|
||||
'K,0056'
|
||||
'K,0043'
|
||||
'K,0048'
|
||||
'K,0057'
|
||||
'K,004b'
|
||||
'K,002d,1,ffffa0'
|
||||
'K,0021,1,ffffa0'
|
||||
'K,0008,2,c0c0c0,000000,BS'
|
||||
'R'
|
||||
'K,0009,2,c0c0c0,000000,TAB'
|
||||
'K,0046'
|
||||
'K,0049'
|
||||
'K,0054'
|
||||
'K,0041'
|
||||
'K,004c'
|
||||
'K,0059'
|
||||
'K,002c,1,ffffa0'
|
||||
'K,003f,1,ffffa0'
|
||||
'K,000d,2,c0c0c0,000000,RET'
|
||||
'R'
|
||||
'L,1,2,000000,c0c0c0,Cap'
|
||||
'K,0020,2'
|
||||
'K,004e'
|
||||
'K,0045'
|
||||
'K,0020,2'
|
||||
'K,002e,1,ffffa0'
|
||||
'K,003a,1,ffffa0'
|
||||
'S,1,2,c0c0c0,000000,Shift'
|
||||
'R'
|
||||
'S,1,2,c0c0c0,000000,Ctrl'
|
||||
'K,0047'
|
||||
'K,0044'
|
||||
'K,004f'
|
||||
'K,0052'
|
||||
'K,0053'
|
||||
'K,0042'
|
||||
'K,0027,1,ffffa0'
|
||||
'K,0028,1,ffffa0'
|
||||
'K,f807,1,c0ffff,000000,<'
|
||||
'K,f6dd,1,c0ffff,000000,<<'
|
||||
'R'
|
||||
'L,3,2,c0c0c0,000000,123'
|
||||
'K,0051'
|
||||
'K,004a'
|
||||
'K,0055'
|
||||
'K,004d'
|
||||
'K,0050'
|
||||
'K,0058'
|
||||
'K,002f,1,ffffa0'
|
||||
'K,0029,1,ffffa0'
|
||||
'K,f808,1,c0ffff,000000,>'
|
||||
'K,f6dc,1,c0ffff,000000,>>'
|
||||
''
|
||||
'! MAP 3 Numeric FITALY'
|
||||
''
|
||||
|
||||
'M,0,0,210,0,300,207,5,12,195,0,209,207,ffffff,000000,333333,dddd' +
|
||||
'ff'
|
||||
'R'
|
||||
'K,001b,2,c0c0c0,000000,Esc'
|
||||
'K,003c'
|
||||
'K,003e'
|
||||
'K,003d'
|
||||
'K,00d7'
|
||||
'K,00f7'
|
||||
'K,002b'
|
||||
'K,002d,1,ffffa0'
|
||||
'K,0021,1,ffffa0'
|
||||
'K,0008,2,c0c0c0,000000,BS'
|
||||
'R'
|
||||
'K,0009,2,c0c0c0,000000,TAB'
|
||||
'K,00a4'
|
||||
'K,00b0'
|
||||
'K,0040'
|
||||
'K,0031'
|
||||
'K,0032'
|
||||
'K,0033'
|
||||
'K,002c,1,ffffa0'
|
||||
'K,003f,1,ffffa0'
|
||||
'K,000d,2,c0c0c0,000000,RET'
|
||||
'R'
|
||||
'L,4,2,c0c0c0,000000,Cap'
|
||||
'K,0020,2'
|
||||
'K,0026'
|
||||
'K,0034'
|
||||
'K,0035'
|
||||
'K,0036'
|
||||
'K,002e,1,ffffa0'
|
||||
'K,003a,1,ffffa0'
|
||||
'S,4,2,c0c0c0,000000,Shift'
|
||||
'R'
|
||||
'S,1,2,c0c0c0,000000,Ctrl'
|
||||
'K,00a5'
|
||||
'K,00a2'
|
||||
'K,0025'
|
||||
'K,0037'
|
||||
'K,0038'
|
||||
'K,0039'
|
||||
'K,0027,1,ffffa0'
|
||||
'K,0028,1,ffffa0'
|
||||
'K,f807,1,c0ffff,000000,<'
|
||||
'K,f6dd,1,c0ffff,000000,<<'
|
||||
'R'
|
||||
'L,1,2,c0c0c0,000000,abc'
|
||||
'K,20ac'
|
||||
'K,00a3'
|
||||
'K,0024'
|
||||
'K,002a'
|
||||
'K,0030'
|
||||
'K,0023'
|
||||
'K,002f,1,ffffa0'
|
||||
'K,0029,1,ffffa0'
|
||||
'K,f808,1,c0ffff,000000,>'
|
||||
'K,f6dc,1,c0ffff,000000,>>'
|
||||
''
|
||||
'! MAP 4 Symbols (Numeric shifted)'
|
||||
''
|
||||
|
||||
'M,0,0,210,0,300,207,5,12,195,0,209,207,ffffff,000000,333333,dddd' +
|
||||
'ff'
|
||||
'R'
|
||||
'K,001b,2,c0c0c0,000000,Esc'
|
||||
'K,2020'
|
||||
'K,2021'
|
||||
'K,00aa'
|
||||
'K,00ac'
|
||||
'K,00ba'
|
||||
'K,00b1'
|
||||
'K,005f,1,ffffa0'
|
||||
'K,00a1,1,ffffa0'
|
||||
'K,0008,2,c0c0c0,000000,BS'
|
||||
'R'
|
||||
'K,0009,2,c0c0c0,000000,TAB'
|
||||
'K,2021'
|
||||
'K,2021'
|
||||
'K,007c'
|
||||
'K,00b9'
|
||||
'K,00b2'
|
||||
'K,00b3'
|
||||
'K,2018,1,ffffa0'
|
||||
'K,00bf,1,ffffa0'
|
||||
'K,000d,2,c0c0c0,000000,RET'
|
||||
'R'
|
||||
'L,3,2,c0c0c0,000000,Cap'
|
||||
'K,00a0,2,ffffff,000000,n.b.'
|
||||
'K,00a6'
|
||||
'K,00bc'
|
||||
'K,00bd'
|
||||
'K,00be'
|
||||
'K,2019,1,ffffa0'
|
||||
'K,003b,1,ffffa0'
|
||||
'S,3,2,c0c0c0,000000,Shift'
|
||||
'R'
|
||||
'S,1,2,c0c0c0,000000,Ctrl'
|
||||
'K,00e3'
|
||||
'K,00f5'
|
||||
'K,2030'
|
||||
'K,201a'
|
||||
'K,00af'
|
||||
'K,00b7'
|
||||
'K,0022,1,ffffa0'
|
||||
'K,201c,1,ffffa0'
|
||||
'K,f807,1,c0ffff,000000,<'
|
||||
'K,f6dd,1,c0ffff,000000,<<'
|
||||
'R'
|
||||
'L,1,2,c0c0c0,000000,abc'
|
||||
'K,00c3'
|
||||
'K,00d5'
|
||||
'K,0192'
|
||||
'K,201e'
|
||||
'K,00ad'
|
||||
'K,2026'
|
||||
'K,005c,1,ffffa0'
|
||||
'K,201d,1,ffffa0'
|
||||
'K,f808,1,c0ffff,000000,>'
|
||||
'K,f6dc,1,c0ffff,000000,>>')
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Open...'
|
||||
TabOrder = 1
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 88
|
||||
Top = 8
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Save'
|
||||
Enabled = False
|
||||
TabOrder = 2
|
||||
OnClick = Button2Click
|
||||
end
|
||||
object Button3: TButton
|
||||
Left = 168
|
||||
Top = 8
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Save As...'
|
||||
TabOrder = 3
|
||||
OnClick = Button3Click
|
||||
end
|
||||
object Button4: TButton
|
||||
Left = 408
|
||||
Top = 360
|
||||
Width = 161
|
||||
Height = 25
|
||||
Caption = 'Visualize!'
|
||||
TabOrder = 4
|
||||
OnClick = Button4Click
|
||||
end
|
||||
object Stat: TListBox
|
||||
Left = 8
|
||||
Top = 344
|
||||
Width = 345
|
||||
Height = 41
|
||||
ItemHeight = 13
|
||||
TabOrder = 5
|
||||
end
|
||||
object SpinEdit1: TSpinEdit
|
||||
Left = 360
|
||||
Top = 360
|
||||
Width = 41
|
||||
Height = 22
|
||||
MaxValue = 255
|
||||
MinValue = 1
|
||||
TabOrder = 6
|
||||
Value = 1
|
||||
end
|
||||
object OpenDialog1: TOpenDialog
|
||||
DefaultExt = 'kbl'
|
||||
Filter = 'PopOnTob Keyboard Layouts (*.kbl)|*.kbl|All Files (*.*)|*.*'
|
||||
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofDontAddToRecent]
|
||||
Left = 264
|
||||
Top = 8
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Filter = 'PopOnTop Keyboard Layout (*.kbl)|*.kbl|All Files (*.*)|*.*'
|
||||
Options = [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist, ofEnableSizing, ofDontAddToRecent]
|
||||
Left = 320
|
||||
Top = 8
|
||||
end
|
||||
end
|
277
KBLVisualizerU.pas
Normal file
277
KBLVisualizerU.pas
Normal file
@ -0,0 +1,277 @@
|
||||
unit KBLEditU;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Forms, Graphics, SysUtils, StrUtils, Spin, ExtCtrls, Dialogs,
|
||||
StdCtrls, Controls, Classes;
|
||||
|
||||
type
|
||||
TKBLEditForm = class(TForm)
|
||||
OpenDialog1: TOpenDialog;
|
||||
SaveDialog1: TSaveDialog;
|
||||
Px00Screen: TImage;
|
||||
Memo1: TMemo;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
Button3: TButton;
|
||||
Button4: TButton;
|
||||
Stat: TListBox;
|
||||
SpinEdit1: TSpinEdit;
|
||||
Label1: TLabel;
|
||||
procedure Button4Click(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Button3Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
KBLEditForm: TKBLEditForm;
|
||||
Screenshot: TBitmap;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
type
|
||||
TArray = array of string;
|
||||
TKey = record
|
||||
typ: char;
|
||||
value: string;
|
||||
width: integer;
|
||||
keycap: TColor;
|
||||
ink: TColor;
|
||||
legend: string;
|
||||
end;
|
||||
TRow = array of TKey;
|
||||
TMap = record
|
||||
landscape: boolean;
|
||||
fullscreen: boolean;
|
||||
top, left, bottom, right: integer;
|
||||
rows, cols: integer;
|
||||
otop, oleft, obottom, oright: integer;
|
||||
keycap: TColor;
|
||||
ink: TColor;
|
||||
highlight: TColor;
|
||||
background: TColor;
|
||||
Data: array of TRow;
|
||||
end;
|
||||
|
||||
procedure ClearScreen;
|
||||
begin
|
||||
KBLEditForm.Px00Screen.Picture.LoadFromFile(ChangeFileExt(Application.ExeName,'.bmp'));
|
||||
end;
|
||||
|
||||
function GetMap(x: integer): TArray;
|
||||
var i,j: integer;
|
||||
t: string;
|
||||
r: TArray;
|
||||
begin
|
||||
i := 0;
|
||||
SetLength(r, 200);
|
||||
for j:=0 to KBLEditForm.Memo1.Lines.Count do begin
|
||||
t := KBLEditForm.Memo1.Lines.Strings[j];
|
||||
if (Length(t)>0) then begin
|
||||
if (UpCase(t[1])='M') AND (x>0) then Dec(x)
|
||||
else if (UpCase(t[1])='M') AND (x<=0) then Break;
|
||||
end;
|
||||
if (x=0) then begin
|
||||
r[i] := t;
|
||||
Inc(i);
|
||||
end;
|
||||
end;
|
||||
SetLength(r, i);
|
||||
Result := r;
|
||||
end;
|
||||
|
||||
function Split(x: string): TArray;
|
||||
var i,p,o: integer;
|
||||
r: TArray;
|
||||
begin
|
||||
i := 0;
|
||||
o := 1;
|
||||
SetLength(r, 50);
|
||||
p := PosEx(',',x,o);
|
||||
while (p>0) do begin
|
||||
r[i] := Copy(x,o,p-o);
|
||||
Inc(i);
|
||||
o := p+1;
|
||||
p := PosEx(',',x,o);
|
||||
end;
|
||||
r[i] := Copy(x,o,Length(x)-o+1);
|
||||
Inc(i);
|
||||
SetLength(r, i);
|
||||
Result := r;
|
||||
end;
|
||||
|
||||
function Hex2Col(h: string): TColor;
|
||||
const Hexmap = '0123456789ABCDEF';
|
||||
var r,g,b: integer;
|
||||
begin
|
||||
h := UpperCase(h);
|
||||
r := (Pos(h[1],hexmap)-1)*16 + (Pos(h[2],hexmap)-1);
|
||||
g := (Pos(h[3],hexmap)-1)*16 + (Pos(h[4],hexmap)-1);
|
||||
b := (Pos(h[5],hexmap)-1)*16 + (Pos(h[6],hexmap)-1);
|
||||
// KBLEditForm.Stat.Items.Add('In:'+h+' --- Out r:'+IntToStr(r)+' g:'+IntToStr(g)+' b:'+IntToStr(b));
|
||||
Result := rgb(r, g, b);
|
||||
end;
|
||||
|
||||
function Hex2Str(h: string): string;
|
||||
const Hexmap = '0123456789ABCDEF';
|
||||
var c: integer;
|
||||
t: string;
|
||||
begin
|
||||
h := UpperCase(h);
|
||||
c := (Pos(h[3],hexmap)-1)*16 + (Pos(h[4],hexmap)-1);
|
||||
t := Chr(c);
|
||||
Result := t;
|
||||
end;
|
||||
|
||||
function ParseMap(m: TArray): TMap;
|
||||
var i, rows, keys: integer;
|
||||
l: TArray;
|
||||
r: TMap;
|
||||
begin
|
||||
SetLength(r.Data, 100);
|
||||
SetLength(l, 100);
|
||||
rows := 0;
|
||||
keys := 0;
|
||||
for i:=0 to Length(m)-1 do begin
|
||||
if (Length(m[i])>0) then begin
|
||||
l := Split(m[i]);
|
||||
if Length(l)>0 then begin
|
||||
if (l[0]='M') then begin
|
||||
if (Length(l)=17) then begin
|
||||
if (l[1]='0') then r.landscape := false else r.landscape := true;
|
||||
if (l[2]='0') then r.fullscreen := false else r.fullscreen := true;
|
||||
r.top := StrToInt(l[3]);
|
||||
r.left := StrToInt(l[4]);
|
||||
r.bottom := StrToInt(l[5]);
|
||||
r.right := StrToInt(l[6]);
|
||||
r.rows := StrToInt(l[7]);
|
||||
r.cols := StrToInt(l[8]);
|
||||
r.otop := StrToInt(l[9]);
|
||||
r.oleft := StrToInt(l[10]);
|
||||
r.obottom := StrToInt(l[11]);
|
||||
r.oright := StrToInt(l[12]);
|
||||
r.keycap := Hex2Col(l[13]);
|
||||
r.ink := Hex2Col(l[14]);
|
||||
r.highlight := Hex2Col(l[15]);
|
||||
r.background := Hex2Col(l[16]);
|
||||
end;
|
||||
end else if (l[0]='R') then begin
|
||||
if (rows>0) then SetLength(r.Data[rows-1], keys);
|
||||
Inc(rows);
|
||||
SetLength(r.Data[rows-1], 100);
|
||||
keys := 0;
|
||||
end else if (l[0]='L') OR (l[0]='K') OR (l[0]='S') then begin
|
||||
with r.Data[rows-1][keys] do begin
|
||||
typ := l[0][1];
|
||||
value := l[1];
|
||||
if (Length(l)>2) then width := StrToInt(l[2]) else width := 1;
|
||||
if (Length(l)>3) then keycap := Hex2Col(l[3]) else keycap := r.keycap;
|
||||
if (Length(l)>4) then ink := Hex2Col(l[4]) else ink := r.ink;
|
||||
if (Length(l)>5) then legend := l[5] else legend := Hex2Str(l[1]);
|
||||
end;
|
||||
Inc(keys);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if (rows>0) then begin
|
||||
SetLength(r.Data[rows-1], keys);
|
||||
SetLength(r.Data, rows);
|
||||
end;
|
||||
Result := r;
|
||||
end;
|
||||
|
||||
procedure KeyRect(map: TMap; i,j,ki: integer; lbl: string);
|
||||
const space = 3;
|
||||
var top, left, bottom, right: integer;
|
||||
kw, kh: integer;
|
||||
hc, vc: integer;
|
||||
key: TKey;
|
||||
begin
|
||||
key := map.Data[i][j];
|
||||
hc := map.left + Round((map.right-map.left)/(map.cols+1)) * ki;
|
||||
vc := map.top + Round((map.bottom-map.top)/(map.rows+1)) * (i+1);
|
||||
kw := Round(( map.right - map.left ) / (map.cols+1)) - space;
|
||||
kh := Round(( map.bottom - map.top ) / (map.rows+1)) - space;
|
||||
left := hc - Round(kw/2);
|
||||
right := hc + Round(kw/2) + (key.width-1)*(kw+space);
|
||||
top := vc - Round(kh/2);
|
||||
bottom := vc + Round(kh/2);
|
||||
with KBLEditForm.Px00Screen.Canvas do begin
|
||||
Brush.Color := map.Data[i][j].keycap;
|
||||
Font.Color := map.Data[i][j].ink;
|
||||
Rectangle(left, top, right+1, bottom+1);
|
||||
TextRect(Rect(left,top,right+1,bottom+1),hc-2,vc-Round(kh/2),key.legend);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure VisMap(x: integer);
|
||||
var m: TArray;
|
||||
map: TMap;
|
||||
i, j: integer;
|
||||
keyindex: integer;
|
||||
begin
|
||||
SetLength(m, 200);
|
||||
SetLength(map.Data, 200);
|
||||
m := GetMap(x);
|
||||
map := ParseMap(m);
|
||||
with KBLEditForm.Px00Screen.Canvas do begin
|
||||
Brush.Style := bsSolid;
|
||||
Brush.Color := map.background;
|
||||
Pen.Color := clBlack;
|
||||
Font.Name := 'Arial';
|
||||
Font.Color := clBlack;
|
||||
Font.Size := 8;
|
||||
Rectangle(Rect(map.oleft, map.otop, map.oright+1, map.obottom+1));
|
||||
FillRect(Rect(map.left, map.top, map.right+1, map.bottom+1));
|
||||
for i:=0 to Length(map.Data)-1 do begin
|
||||
keyindex := 1;
|
||||
for j:=0 to Length(map.Data[i])-1 do begin
|
||||
Keyrect(map, i, j, keyindex, map.Data[i][j].legend);
|
||||
Inc(keyindex, map.Data[i][j].width);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TKBLEditForm.Button4Click(Sender: TObject);
|
||||
begin
|
||||
ClearScreen;
|
||||
VisMap(SpinEdit1.Value);
|
||||
end;
|
||||
|
||||
procedure TKBLEditForm.Button1Click(Sender: TObject);
|
||||
begin
|
||||
if (OpenDialog1.Execute) then begin
|
||||
Memo1.Lines.LoadFromFile(OpenDialog1.FileName);
|
||||
Button2.Enabled := true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TKBLEditForm.Button3Click(Sender: TObject);
|
||||
begin
|
||||
if (SaveDialog1.Execute) then begin
|
||||
Memo1.Lines.SaveToFile(SaveDialog1.FileName);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TKBLEditForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ClearScreen;
|
||||
end;
|
||||
|
||||
procedure TKBLEditForm.Button2Click(Sender: TObject);
|
||||
begin
|
||||
Memo1.Lines.SaveToFile(OpenDialog1.FileName);
|
||||
end;
|
||||
|
||||
end.
|
BIN
PopOnTop.ico
Normal file
BIN
PopOnTop.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
6
Todo.txt
Normal file
6
Todo.txt
Normal file
@ -0,0 +1,6 @@
|
||||
KBLVisualizer TODO
|
||||
|
||||
-automatically visualize/render map at cursor, update on changes
|
||||
-show unicode character in unicode list
|
||||
-LANDSCAPE SUPPORT
|
||||
(render in other canvas and translate pixel by pixel to horizontal) or (find out how fonts can be painted vertically)
|
4145
unicode-index.txt
Normal file
4145
unicode-index.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user